aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-03-25 11:41:20 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-03-25 11:41:20 -0400
commit7bf7e370d5919112c223a269462cd0b546903829 (patch)
tree03ccc715239df14ae168277dbccc9d9cf4d8a2c8 /arch/arm
parent68b1a1e786f29c900fa1c516a402e24f0ece622a (diff)
parentd39dd11c3e6a7af5c20bfac40594db36cf270f42 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus-1
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6: (9356 commits) [media] rc: update for bitop name changes fs: simplify iget & friends fs: pull inode->i_lock up out of writeback_single_inode fs: rename inode_lock to inode_hash_lock fs: move i_wb_list out from under inode_lock fs: move i_sb_list out from under inode_lock fs: remove inode_lock from iput_final and prune_icache fs: Lock the inode LRU list separately fs: factor inode disposal fs: protect inode->i_state with inode->i_lock lib, arch: add filter argument to show_mem and fix private implementations SLUB: Write to per cpu data when allocating it slub: Fix debugobjects with lockless fastpath autofs4: Do not potentially dereference NULL pointer returned by fget() in autofs_dev_ioctl_setpipefd() autofs4 - remove autofs4_lock autofs4 - fix d_manage() return on rcu-walk autofs4 - fix autofs4_expire_indirect() traversal autofs4 - fix dentry leak in autofs4_expire_direct() autofs4 - reinstate last used update on access vfs - check non-mountpoint dentry might block in __follow_mount_rcu() ... NOTE! This merge commit was created to fix compilation error. The block tree was merged upstream and removed the 'elv_queue_empty()' function which the new 'mtdswap' driver is using. So a simple merge of the mtd tree with upstream does not compile. And the mtd tree has already be published, so re-basing it is not an option. To fix this unfortunate situation, I had to merge upstream into the mtd-2.6.git tree without committing, put the fixup patch on top of this, and then commit this. The result is that we do not have commits which do not compile. In other words, this merge commit "merges" 3 things: the MTD tree, the upstream tree, and the fixup patch.
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig216
-rw-r--r--arch/arm/Makefile15
-rw-r--r--arch/arm/boot/Makefile4
-rw-r--r--arch/arm/boot/compressed/.gitignore6
-rw-r--r--arch/arm/boot/compressed/Makefile25
-rw-r--r--arch/arm/boot/compressed/head-shmobile.S30
-rw-r--r--arch/arm/boot/compressed/head-vt8500.S46
-rw-r--r--arch/arm/boot/compressed/head.S251
-rw-r--r--arch/arm/boot/compressed/misc.c2
-rw-r--r--arch/arm/boot/compressed/mmcif-sh7372.c88
-rw-r--r--arch/arm/boot/compressed/vmlinux.lds.in3
-rw-r--r--arch/arm/common/Kconfig2
-rw-r--r--arch/arm/common/gic.c72
-rw-r--r--arch/arm/configs/exynos4_defconfig70
-rw-r--r--arch/arm/configs/kirkwood_defconfig1
-rw-r--r--arch/arm/configs/lpd7a400_defconfig68
-rw-r--r--arch/arm/configs/lpd7a404_defconfig81
-rw-r--r--arch/arm/configs/mx51_defconfig2
-rw-r--r--arch/arm/configs/omap2plus_defconfig12
-rw-r--r--arch/arm/configs/s5p64x0_defconfig2
-rw-r--r--arch/arm/configs/s5pv210_defconfig2
-rw-r--r--arch/arm/configs/tegra_defconfig146
-rw-r--r--arch/arm/configs/u8500_defconfig59
-rw-r--r--arch/arm/configs/vexpress_defconfig140
-rw-r--r--arch/arm/include/asm/a.out-core.h6
-rw-r--r--arch/arm/include/asm/bitops.h146
-rw-r--r--arch/arm/include/asm/cacheflush.h136
-rw-r--r--arch/arm/include/asm/cpu-multi32.h69
-rw-r--r--arch/arm/include/asm/cpu-single.h44
-rw-r--r--arch/arm/include/asm/cputype.h3
-rw-r--r--arch/arm/include/asm/fncpy.h94
-rw-r--r--arch/arm/include/asm/futex.h29
-rw-r--r--arch/arm/include/asm/glue-cache.h146
-rw-r--r--arch/arm/include/asm/glue-df.h110
-rw-r--r--arch/arm/include/asm/glue-pf.h57
-rw-r--r--arch/arm/include/asm/glue-proc.h264
-rw-r--r--arch/arm/include/asm/glue.h138
-rw-r--r--arch/arm/include/asm/hardware/cache-l2x0.h1
-rw-r--r--arch/arm/include/asm/hardware/gic.h1
-rw-r--r--arch/arm/include/asm/hardware/sp810.h9
-rw-r--r--arch/arm/include/asm/highmem.h29
-rw-r--r--arch/arm/include/asm/io.h33
-rw-r--r--arch/arm/include/asm/kexec.h3
-rw-r--r--arch/arm/include/asm/localtimer.h8
-rw-r--r--arch/arm/include/asm/mach/arch.h4
-rw-r--r--arch/arm/include/asm/mach/irq.h31
-rw-r--r--arch/arm/include/asm/memory.h75
-rw-r--r--arch/arm/include/asm/module.h27
-rw-r--r--arch/arm/include/asm/outercache.h15
-rw-r--r--arch/arm/include/asm/pgalloc.h2
-rw-r--r--arch/arm/include/asm/pgtable.h3
-rw-r--r--arch/arm/include/asm/pmu.h14
-rw-r--r--arch/arm/include/asm/proc-fns.h306
-rw-r--r--arch/arm/include/asm/processor.h14
-rw-r--r--arch/arm/include/asm/ptrace.h2
-rw-r--r--arch/arm/include/asm/setup.h8
-rw-r--r--arch/arm/include/asm/smp_scu.h7
-rw-r--r--arch/arm/include/asm/spinlock.h53
-rw-r--r--arch/arm/include/asm/system.h17
-rw-r--r--arch/arm/include/asm/tlb.h105
-rw-r--r--arch/arm/include/asm/tlbflush.h7
-rw-r--r--arch/arm/include/asm/tls.h11
-rw-r--r--arch/arm/include/asm/traps.h1
-rw-r--r--arch/arm/include/asm/types.h9
-rw-r--r--arch/arm/include/asm/user.h2
-rw-r--r--arch/arm/kernel/Makefile1
-rw-r--r--arch/arm/kernel/armksyms.c22
-rw-r--r--arch/arm/kernel/asm-offsets.c11
-rw-r--r--arch/arm/kernel/bios32.c5
-rw-r--r--arch/arm/kernel/crash_dump.c3
-rw-r--r--arch/arm/kernel/debug.S2
-rw-r--r--arch/arm/kernel/entry-armv.S3
-rw-r--r--arch/arm/kernel/entry-header.S14
-rw-r--r--arch/arm/kernel/etm.c4
-rw-r--r--arch/arm/kernel/head-common.S90
-rw-r--r--arch/arm/kernel/head-nommu.S3
-rw-r--r--arch/arm/kernel/head.S251
-rw-r--r--arch/arm/kernel/hw_breakpoint.c80
-rw-r--r--arch/arm/kernel/irq.c50
-rw-r--r--arch/arm/kernel/kprobes-decode.c2
-rw-r--r--arch/arm/kernel/machine_kexec.c7
-rw-r--r--arch/arm/kernel/module.c55
-rw-r--r--arch/arm/kernel/perf_event.c19
-rw-r--r--arch/arm/kernel/perf_event_v6.c4
-rw-r--r--arch/arm/kernel/pmu.c22
-rw-r--r--arch/arm/kernel/ptrace.c389
-rw-r--r--arch/arm/kernel/ptrace.h37
-rw-r--r--arch/arm/kernel/return_address.c1
-rw-r--r--arch/arm/kernel/setup.c103
-rw-r--r--arch/arm/kernel/signal.c13
-rw-r--r--arch/arm/kernel/sleep.S134
-rw-r--r--arch/arm/kernel/smp.c7
-rw-r--r--arch/arm/kernel/smp_scu.c23
-rw-r--r--arch/arm/kernel/smp_twd.c7
-rw-r--r--arch/arm/kernel/tcm.c2
-rw-r--r--arch/arm/kernel/time.c4
-rw-r--r--arch/arm/kernel/traps.c10
-rw-r--r--arch/arm/kernel/vmlinux.lds.S17
-rw-r--r--arch/arm/lib/bitops.h50
-rw-r--r--arch/arm/lib/changebit.S10
-rw-r--r--arch/arm/lib/clearbit.S11
-rw-r--r--arch/arm/lib/setbit.S11
-rw-r--r--arch/arm/lib/testchangebit.S9
-rw-r--r--arch/arm/lib/testclearbit.S9
-rw-r--r--arch/arm/lib/testsetbit.S9
-rw-r--r--arch/arm/lib/uaccess_with_memcpy.c7
-rw-r--r--arch/arm/mach-aaec2000/Kconfig11
-rw-r--r--arch/arm/mach-aaec2000/Makefile9
-rw-r--r--arch/arm/mach-aaec2000/Makefile.boot1
-rw-r--r--arch/arm/mach-aaec2000/aaed2000.c102
-rw-r--r--arch/arm/mach-aaec2000/core.c298
-rw-r--r--arch/arm/mach-aaec2000/core.h28
-rw-r--r--arch/arm/mach-aaec2000/include/mach/aaec2000.h207
-rw-r--r--arch/arm/mach-aaec2000/include/mach/aaed2000.h40
-rw-r--r--arch/arm/mach-aaec2000/include/mach/debug-macro.S35
-rw-r--r--arch/arm/mach-aaec2000/include/mach/entry-macro.S40
-rw-r--r--arch/arm/mach-aaec2000/include/mach/hardware.h50
-rw-r--r--arch/arm/mach-aaec2000/include/mach/io.h18
-rw-r--r--arch/arm/mach-aaec2000/include/mach/irqs.h46
-rw-r--r--arch/arm/mach-aaec2000/include/mach/memory.h17
-rw-r--r--arch/arm/mach-aaec2000/include/mach/system.h24
-rw-r--r--arch/arm/mach-aaec2000/include/mach/timex.h18
-rw-r--r--arch/arm/mach-aaec2000/include/mach/uncompress.h46
-rw-r--r--arch/arm/mach-aaec2000/include/mach/vmalloc.h16
-rw-r--r--arch/arm/mach-at91/board-snapper9260.c1
-rw-r--r--arch/arm/mach-at91/include/mach/gpio.h11
-rw-r--r--arch/arm/mach-at91/include/mach/memory.h2
-rw-r--r--arch/arm/mach-bcmring/include/mach/hardware.h2
-rw-r--r--arch/arm/mach-bcmring/include/mach/memory.h2
-rw-r--r--arch/arm/mach-clps711x/include/mach/memory.h2
-rw-r--r--arch/arm/mach-clps711x/include/mach/time.h2
-rw-r--r--arch/arm/mach-cns3xxx/include/mach/memory.h2
-rw-r--r--arch/arm/mach-davinci/board-da830-evm.c67
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c96
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c8
-rw-r--r--arch/arm/mach-davinci/board-mityomapl138.c167
-rw-r--r--arch/arm/mach-davinci/board-omapl138-hawk.c284
-rw-r--r--arch/arm/mach-davinci/board-tnetv107x-evm.c57
-rw-r--r--arch/arm/mach-davinci/cpufreq.c2
-rw-r--r--arch/arm/mach-davinci/da830.c6
-rw-r--r--arch/arm/mach-davinci/da850.c99
-rw-r--r--arch/arm/mach-davinci/devices-da8xx.c132
-rw-r--r--arch/arm/mach-davinci/devices-tnetv107x.c25
-rw-r--r--arch/arm/mach-davinci/dm355.c5
-rw-r--r--arch/arm/mach-davinci/dm365.c5
-rw-r--r--arch/arm/mach-davinci/gpio-tnetv107x.c18
-rw-r--r--arch/arm/mach-davinci/include/mach/clkdev.h2
-rw-r--r--arch/arm/mach-davinci/include/mach/da8xx.h11
-rw-r--r--arch/arm/mach-davinci/include/mach/edma.h36
-rw-r--r--arch/arm/mach-davinci/include/mach/memory.h4
-rw-r--r--arch/arm/mach-davinci/include/mach/mux.h4
-rw-r--r--arch/arm/mach-davinci/include/mach/psc.h2
-rw-r--r--arch/arm/mach-davinci/include/mach/spi.h15
-rw-r--r--arch/arm/mach-davinci/include/mach/tnetv107x.h2
-rw-r--r--arch/arm/mach-davinci/tnetv107x.c2
-rw-r--r--arch/arm/mach-dove/Kconfig2
-rw-r--r--arch/arm/mach-dove/cm-a510.c1
-rw-r--r--arch/arm/mach-dove/common.c8
-rw-r--r--arch/arm/mach-dove/common.h1
-rw-r--r--arch/arm/mach-dove/dove-db-setup.c1
-rw-r--r--arch/arm/mach-dove/include/mach/bridge-regs.h4
-rw-r--r--arch/arm/mach-dove/include/mach/dove.h3
-rw-r--r--arch/arm/mach-dove/include/mach/gpio.h42
-rw-r--r--arch/arm/mach-dove/include/mach/irqs.h7
-rw-r--r--arch/arm/mach-dove/include/mach/memory.h2
-rw-r--r--arch/arm/mach-dove/irq.c30
-rw-r--r--arch/arm/mach-ebsa110/include/mach/memory.h2
-rw-r--r--arch/arm/mach-ep93xx/core.c2
-rw-r--r--arch/arm/mach-ep93xx/edb93xx.c116
-rw-r--r--arch/arm/mach-ep93xx/gpio.c40
-rw-r--r--arch/arm/mach-ep93xx/include/mach/gpio.h2
-rw-r--r--arch/arm/mach-ep93xx/include/mach/memory.h10
-rw-r--r--arch/arm/mach-exynos4/Kconfig195
-rw-r--r--arch/arm/mach-exynos4/Makefile56
-rw-r--r--arch/arm/mach-exynos4/Makefile.boot (renamed from arch/arm/mach-s5pv310/Makefile.boot)0
-rw-r--r--arch/arm/mach-exynos4/clock.c (renamed from arch/arm/mach-s5pv310/clock.c)286
-rw-r--r--arch/arm/mach-exynos4/cpu.c (renamed from arch/arm/mach-s5pv310/cpu.c)99
-rw-r--r--arch/arm/mach-exynos4/cpufreq.c (renamed from arch/arm/mach-s5pv310/cpufreq.c)111
-rw-r--r--arch/arm/mach-exynos4/dev-ahci.c263
-rw-r--r--arch/arm/mach-exynos4/dev-audio.c (renamed from arch/arm/mach-s5pv310/dev-audio.c)143
-rw-r--r--arch/arm/mach-exynos4/dev-pd.c (renamed from arch/arm/mach-s5pv310/dev-pd.c)40
-rw-r--r--arch/arm/mach-exynos4/dev-sysmmu.c (renamed from arch/arm/mach-s5pv310/dev-sysmmu.c)121
-rw-r--r--arch/arm/mach-exynos4/dma.c (renamed from arch/arm/mach-s5pv310/dma.c)50
-rw-r--r--arch/arm/mach-exynos4/gpiolib.c365
-rw-r--r--arch/arm/mach-exynos4/headsmp.S (renamed from arch/arm/mach-s5pv310/headsmp.S)6
-rw-r--r--arch/arm/mach-exynos4/hotplug.c (renamed from arch/arm/mach-s5pv310/hotplug.c)10
-rw-r--r--arch/arm/mach-exynos4/include/mach/debug-macro.S (renamed from arch/arm/mach-s5pv310/include/mach/debug-macro.S)6
-rw-r--r--arch/arm/mach-exynos4/include/mach/dma.h (renamed from arch/arm/mach-s5pv310/include/mach/dma.h)0
-rw-r--r--arch/arm/mach-exynos4/include/mach/entry-macro.S (renamed from arch/arm/mach-s5pv310/include/mach/entry-macro.S)4
-rw-r--r--arch/arm/mach-exynos4/include/mach/gpio.h156
-rw-r--r--arch/arm/mach-exynos4/include/mach/hardware.h (renamed from arch/arm/mach-s5pv310/include/mach/hardware.h)8
-rw-r--r--arch/arm/mach-exynos4/include/mach/io.h (renamed from arch/arm/mach-s5pv310/include/mach/io.h)8
-rw-r--r--arch/arm/mach-exynos4/include/mach/irqs.h (renamed from arch/arm/mach-s5pv310/include/mach/irqs.h)26
-rw-r--r--arch/arm/mach-exynos4/include/mach/map.h162
-rw-r--r--arch/arm/mach-exynos4/include/mach/memory.h (renamed from arch/arm/mach-s5pv310/include/mach/memory.h)10
-rw-r--r--arch/arm/mach-exynos4/include/mach/pm-core.h49
-rw-r--r--arch/arm/mach-exynos4/include/mach/pwm-clock.h (renamed from arch/arm/mach-s5pv310/include/mach/pwm-clock.h)8
-rw-r--r--arch/arm/mach-exynos4/include/mach/regs-clock.h (renamed from arch/arm/mach-s5pv310/include/mach/regs-clock.h)41
-rw-r--r--arch/arm/mach-exynos4/include/mach/regs-gpio.h42
-rw-r--r--arch/arm/mach-exynos4/include/mach/regs-irq.h (renamed from arch/arm/mach-s5pv310/include/mach/regs-irq.h)8
-rw-r--r--arch/arm/mach-exynos4/include/mach/regs-mct.h52
-rw-r--r--arch/arm/mach-exynos4/include/mach/regs-mem.h (renamed from arch/arm/mach-s5pv310/include/mach/regs-mem.h)6
-rw-r--r--arch/arm/mach-exynos4/include/mach/regs-pmu.h162
-rw-r--r--arch/arm/mach-exynos4/include/mach/regs-sysmmu.h (renamed from arch/arm/mach-s5pv310/include/mach/regs-sysmmu.h)10
-rw-r--r--arch/arm/mach-exynos4/include/mach/smp.h (renamed from arch/arm/mach-s5pv310/include/mach/smp.h)2
-rw-r--r--arch/arm/mach-exynos4/include/mach/sysmmu.h46
-rw-r--r--arch/arm/mach-exynos4/include/mach/system.h (renamed from arch/arm/mach-s5pv310/include/mach/system.h)8
-rw-r--r--arch/arm/mach-exynos4/include/mach/timex.h (renamed from arch/arm/mach-s5pv310/include/mach/timex.h)8
-rw-r--r--arch/arm/mach-exynos4/include/mach/uncompress.h (renamed from arch/arm/mach-s5pv310/include/mach/uncompress.h)8
-rw-r--r--arch/arm/mach-exynos4/include/mach/vmalloc.h (renamed from arch/arm/mach-s5pv310/include/mach/vmalloc.h)8
-rw-r--r--arch/arm/mach-exynos4/init.c (renamed from arch/arm/mach-s5pv310/init.c)10
-rw-r--r--arch/arm/mach-exynos4/irq-combiner.c (renamed from arch/arm/mach-s5pv310/irq-combiner.c)4
-rw-r--r--arch/arm/mach-exynos4/irq-eint.c (renamed from arch/arm/mach-s5pv310/irq-eint.c)62
-rw-r--r--arch/arm/mach-exynos4/localtimer.c (renamed from arch/arm/mach-s5pv310/localtimer.c)5
-rw-r--r--arch/arm/mach-exynos4/mach-armlex4210.c215
-rw-r--r--arch/arm/mach-exynos4/mach-nuri.c305
-rw-r--r--arch/arm/mach-exynos4/mach-smdkc210.c (renamed from arch/arm/mach-s5pv310/mach-smdkc210.c)48
-rw-r--r--arch/arm/mach-exynos4/mach-smdkv310.c (renamed from arch/arm/mach-s5pv310/mach-smdkv310.c)72
-rw-r--r--arch/arm/mach-exynos4/mach-universal_c210.c650
-rw-r--r--arch/arm/mach-exynos4/mct.c421
-rw-r--r--arch/arm/mach-exynos4/platsmp.c (renamed from arch/arm/mach-s5pv310/platsmp.c)12
-rw-r--r--arch/arm/mach-exynos4/pm.c420
-rw-r--r--arch/arm/mach-exynos4/setup-fimc.c44
-rw-r--r--arch/arm/mach-exynos4/setup-i2c0.c (renamed from arch/arm/mach-s5pv310/setup-i2c0.c)4
-rw-r--r--arch/arm/mach-exynos4/setup-i2c1.c (renamed from arch/arm/mach-s5pv310/setup-i2c1.c)4
-rw-r--r--arch/arm/mach-exynos4/setup-i2c2.c (renamed from arch/arm/mach-s5pv310/setup-i2c2.c)4
-rw-r--r--arch/arm/mach-exynos4/setup-i2c3.c (renamed from arch/arm/mach-s5pv310/setup-i2c3.c)4
-rw-r--r--arch/arm/mach-exynos4/setup-i2c4.c (renamed from arch/arm/mach-s5pv310/setup-i2c4.c)4
-rw-r--r--arch/arm/mach-exynos4/setup-i2c5.c (renamed from arch/arm/mach-s5pv310/setup-i2c5.c)4
-rw-r--r--arch/arm/mach-exynos4/setup-i2c6.c (renamed from arch/arm/mach-s5pv310/setup-i2c6.c)4
-rw-r--r--arch/arm/mach-exynos4/setup-i2c7.c (renamed from arch/arm/mach-s5pv310/setup-i2c7.c)4
-rw-r--r--arch/arm/mach-exynos4/setup-keypad.c35
-rw-r--r--arch/arm/mach-exynos4/setup-sdhci-gpio.c (renamed from arch/arm/mach-s5pv310/setup-sdhci-gpio.c)52
-rw-r--r--arch/arm/mach-exynos4/setup-sdhci.c (renamed from arch/arm/mach-s5pv310/setup-sdhci.c)12
-rw-r--r--arch/arm/mach-exynos4/sleep.S76
-rw-r--r--arch/arm/mach-exynos4/time.c (renamed from arch/arm/mach-s5pv310/time.c)80
-rw-r--r--arch/arm/mach-footbridge/dc21285-timer.c84
-rw-r--r--arch/arm/mach-footbridge/include/mach/debug-macro.S4
-rw-r--r--arch/arm/mach-footbridge/include/mach/hardware.h21
-rw-r--r--arch/arm/mach-footbridge/include/mach/io.h10
-rw-r--r--arch/arm/mach-footbridge/include/mach/memory.h2
-rw-r--r--arch/arm/mach-footbridge/isa-timer.c129
-rw-r--r--arch/arm/mach-gemini/board-nas4220b.c1
-rw-r--r--arch/arm/mach-gemini/board-rut1xx.c1
-rw-r--r--arch/arm/mach-gemini/board-wbd111.c1
-rw-r--r--arch/arm/mach-gemini/board-wbd222.c1
-rw-r--r--arch/arm/mach-gemini/common.h1
-rw-r--r--arch/arm/mach-gemini/devices.c26
-rw-r--r--arch/arm/mach-gemini/include/mach/memory.h4
-rw-r--r--arch/arm/mach-h720x/include/mach/memory.h2
-rw-r--r--arch/arm/mach-imx/Kconfig12
-rw-r--r--arch/arm/mach-imx/Makefile5
-rw-r--r--arch/arm/mach-imx/clock-imx1.c1
-rw-r--r--arch/arm/mach-imx/clock-imx25.c3
-rw-r--r--arch/arm/mach-imx/devices-imx1.h11
-rw-r--r--arch/arm/mach-imx/devices-imx25.h6
-rw-r--r--arch/arm/mach-imx/dma-v1.c2
-rw-r--r--arch/arm/mach-imx/ehci-imx25.c80
-rw-r--r--arch/arm/mach-imx/ehci-imx27.c82
-rw-r--r--arch/arm/mach-imx/eukrea_mbimx27-baseboard.c7
-rw-r--r--arch/arm/mach-imx/mach-cpuimx27.c49
-rw-r--r--arch/arm/mach-imx/mach-eukrea_cpuimx25.c27
-rw-r--r--arch/arm/mach-imx/mach-imx27_visstrim_m10.c32
-rw-r--r--arch/arm/mach-imx/mach-imx27ipcam.c78
-rw-r--r--arch/arm/mach-imx/mach-imx27lite.c11
-rw-r--r--arch/arm/mach-imx/mach-mx1ads.c22
-rw-r--r--arch/arm/mach-imx/mach-mx21ads.c11
-rw-r--r--arch/arm/mach-imx/mach-mx25_3ds.c34
-rw-r--r--arch/arm/mach-imx/mach-mx27_3ds.c48
-rw-r--r--arch/arm/mach-imx/mach-mx27ads.c11
-rw-r--r--arch/arm/mach-imx/mach-mxt_td60.c12
-rw-r--r--arch/arm/mach-imx/mach-pca100.c49
-rw-r--r--arch/arm/mach-imx/mach-pcm038.c29
-rw-r--r--arch/arm/mach-imx/mach-scb9328.c13
-rw-r--r--arch/arm/mach-imx/mm-imx1.c21
-rw-r--r--arch/arm/mach-imx/mm-imx21.c23
-rw-r--r--arch/arm/mach-imx/mm-imx25.c18
-rw-r--r--arch/arm/mach-imx/mm-imx27.c23
-rw-r--r--arch/arm/mach-integrator/Kconfig1
-rw-r--r--arch/arm/mach-integrator/common.h1
-rw-r--r--arch/arm/mach-integrator/core.c7
-rw-r--r--arch/arm/mach-integrator/impd1.c5
-rw-r--r--arch/arm/mach-integrator/include/mach/cm.h4
-rw-r--r--arch/arm/mach-integrator/include/mach/memory.h2
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c44
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c239
-rw-r--r--arch/arm/mach-iop13xx/include/mach/memory.h2
-rw-r--r--arch/arm/mach-iop32x/include/mach/memory.h2
-rw-r--r--arch/arm/mach-iop33x/include/mach/memory.h2
-rw-r--r--arch/arm/mach-ixp2000/include/mach/memory.h2
-rw-r--r--arch/arm/mach-ixp23xx/include/mach/memory.h2
-rw-r--r--arch/arm/mach-ixp4xx/common.c4
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/memory.h2
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/timex.h5
-rw-r--r--arch/arm/mach-ixp4xx/ixp4xx_qmgr.c9
-rw-r--r--arch/arm/mach-kirkwood/common.c16
-rw-r--r--arch/arm/mach-kirkwood/common.h2
-rw-r--r--arch/arm/mach-kirkwood/d2net_v2-setup.c1
-rw-r--r--arch/arm/mach-kirkwood/db88f6281-bp-setup.c1
-rw-r--r--arch/arm/mach-kirkwood/dockstar-setup.c1
-rw-r--r--arch/arm/mach-kirkwood/guruplug-setup.c1
-rw-r--r--arch/arm/mach-kirkwood/include/mach/bridge-regs.h3
-rw-r--r--arch/arm/mach-kirkwood/include/mach/gpio.h29
-rw-r--r--arch/arm/mach-kirkwood/include/mach/kirkwood.h2
-rw-r--r--arch/arm/mach-kirkwood/include/mach/memory.h2
-rw-r--r--arch/arm/mach-kirkwood/irq.c22
-rw-r--r--arch/arm/mach-kirkwood/mpp.c3
-rw-r--r--arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c1
-rw-r--r--arch/arm/mach-kirkwood/netspace_v2-setup.c3
-rw-r--r--arch/arm/mach-kirkwood/netxbig_v2-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/openrd-setup.c3
-rw-r--r--arch/arm/mach-kirkwood/pcie.c8
-rw-r--r--arch/arm/mach-kirkwood/rd88f6192-nas-setup.c1
-rw-r--r--arch/arm/mach-kirkwood/rd88f6281-setup.c1
-rw-r--r--arch/arm/mach-kirkwood/sheevaplug-setup.c2
-rw-r--r--arch/arm/mach-kirkwood/t5325-setup.c18
-rw-r--r--arch/arm/mach-kirkwood/ts219-setup.c1
-rw-r--r--arch/arm/mach-kirkwood/ts41x-setup.c9
-rw-r--r--arch/arm/mach-ks8695/include/mach/memory.h2
-rw-r--r--arch/arm/mach-lh7a40x/Kconfig74
-rw-r--r--arch/arm/mach-lh7a40x/Makefile17
-rw-r--r--arch/arm/mach-lh7a40x/Makefile.boot4
-rw-r--r--arch/arm/mach-lh7a40x/arch-kev7a400.c118
-rw-r--r--arch/arm/mach-lh7a40x/arch-lpd7a40x.c422
-rw-r--r--arch/arm/mach-lh7a40x/clcd.c241
-rw-r--r--arch/arm/mach-lh7a40x/clocks.c108
-rw-r--r--arch/arm/mach-lh7a40x/common.h17
-rw-r--r--arch/arm/mach-lh7a40x/include/mach/clocks.h18
-rw-r--r--arch/arm/mach-lh7a40x/include/mach/constants.h91
-rw-r--r--arch/arm/mach-lh7a40x/include/mach/debug-macro.S37
-rw-r--r--arch/arm/mach-lh7a40x/include/mach/dma.h86
-rw-r--r--arch/arm/mach-lh7a40x/include/mach/entry-macro.S149
-rw-r--r--arch/arm/mach-lh7a40x/include/mach/hardware.h62
-rw-r--r--arch/arm/mach-lh7a40x/include/mach/io.h20
-rw-r--r--arch/arm/mach-lh7a40x/include/mach/irqs.h200
-rw-r--r--arch/arm/mach-lh7a40x/include/mach/memory.h28
-rw-r--r--arch/arm/mach-lh7a40x/include/mach/registers.h224
-rw-r--r--arch/arm/mach-lh7a40x/include/mach/ssp.h70
-rw-r--r--arch/arm/mach-lh7a40x/include/mach/system.h19
-rw-r--r--arch/arm/mach-lh7a40x/include/mach/timex.h17
-rw-r--r--arch/arm/mach-lh7a40x/include/mach/uncompress.h38
-rw-r--r--arch/arm/mach-lh7a40x/include/mach/vmalloc.h10
-rw-r--r--arch/arm/mach-lh7a40x/irq-kev7a400.c93
-rw-r--r--arch/arm/mach-lh7a40x/irq-lh7a400.c91
-rw-r--r--arch/arm/mach-lh7a40x/irq-lh7a404.c175
-rw-r--r--arch/arm/mach-lh7a40x/irq-lpd7a40x.c128
-rw-r--r--arch/arm/mach-lh7a40x/lcd-panel.h345
-rw-r--r--arch/arm/mach-lh7a40x/ssp-cpld.c343
-rw-r--r--arch/arm/mach-lh7a40x/time.c71
-rw-r--r--arch/arm/mach-loki/common.c9
-rw-r--r--arch/arm/mach-loki/common.h1
-rw-r--r--arch/arm/mach-loki/include/mach/bridge-regs.h5
-rw-r--r--arch/arm/mach-loki/include/mach/memory.h2
-rw-r--r--arch/arm/mach-loki/lb88rc8480-setup.c1
-rw-r--r--arch/arm/mach-lpc32xx/include/mach/memory.h2
-rw-r--r--arch/arm/mach-mmp/include/mach/memory.h2
-rw-r--r--arch/arm/mach-mmp/include/mach/mmp2.h2
-rw-r--r--arch/arm/mach-mmp/include/mach/pxa168.h2
-rw-r--r--arch/arm/mach-mmp/include/mach/pxa910.h2
-rw-r--r--arch/arm/mach-msm/Kconfig37
-rw-r--r--arch/arm/mach-msm/Makefile29
-rw-r--r--arch/arm/mach-msm/board-halibut.c2
-rw-r--r--arch/arm/mach-msm/board-mahimahi.c2
-rw-r--r--arch/arm/mach-msm/board-msm7x27.c16
-rw-r--r--arch/arm/mach-msm/board-msm7x30.c37
-rw-r--r--arch/arm/mach-msm/board-msm8960.c91
-rw-r--r--arch/arm/mach-msm/board-msm8x60.c4
-rw-r--r--arch/arm/mach-msm/board-qsd8x50.c90
-rw-r--r--arch/arm/mach-msm/board-sapphire.c4
-rw-r--r--arch/arm/mach-msm/board-trout-gpio.c2
-rw-r--r--arch/arm/mach-msm/board-trout.c3
-rw-r--r--arch/arm/mach-msm/clock-7x30.h61
-rw-r--r--arch/arm/mach-msm/clock-debug.c130
-rw-r--r--arch/arm/mach-msm/clock-dummy.c54
-rw-r--r--arch/arm/mach-msm/clock-pcom.c7
-rw-r--r--arch/arm/mach-msm/clock-pcom.h51
-rw-r--r--arch/arm/mach-msm/clock.c192
-rw-r--r--arch/arm/mach-msm/clock.h55
-rw-r--r--arch/arm/mach-msm/devices-iommu.c (renamed from arch/arm/mach-msm/devices-msm8x60-iommu.c)85
-rw-r--r--arch/arm/mach-msm/devices-msm7x00.c36
-rw-r--r--arch/arm/mach-msm/devices-msm7x30.c11
-rw-r--r--arch/arm/mach-msm/devices-msm8960.c85
-rw-r--r--arch/arm/mach-msm/devices-qsd8x50.c213
-rw-r--r--arch/arm/mach-msm/devices.h11
-rw-r--r--arch/arm/mach-msm/gpiomux-7x30.c38
-rw-r--r--arch/arm/mach-msm/gpiomux-8x50.c23
-rw-r--r--arch/arm/mach-msm/headsmp.S2
-rw-r--r--arch/arm/mach-msm/include/mach/board.h4
-rw-r--r--arch/arm/mach-msm/include/mach/clk.h31
-rw-r--r--arch/arm/mach-msm/include/mach/clkdev.h19
-rw-r--r--arch/arm/mach-msm/include/mach/cpu.h54
-rw-r--r--arch/arm/mach-msm/include/mach/io.h1
-rw-r--r--arch/arm/mach-msm/include/mach/iommu.h18
-rw-r--r--arch/arm/mach-msm/include/mach/iommu_hw-8xxx.h32
-rw-r--r--arch/arm/mach-msm/include/mach/irqs-7x30.h31
-rw-r--r--arch/arm/mach-msm/include/mach/irqs-8960.h277
-rw-r--r--arch/arm/mach-msm/include/mach/irqs-8x50.h31
-rw-r--r--arch/arm/mach-msm/include/mach/irqs.h3
-rw-r--r--arch/arm/mach-msm/include/mach/memory.h12
-rw-r--r--arch/arm/mach-msm/include/mach/mmc.h11
-rw-r--r--arch/arm/mach-msm/include/mach/msm_iomap-7x00.h16
-rw-r--r--arch/arm/mach-msm/include/mach/msm_iomap-7x30.h14
-rw-r--r--arch/arm/mach-msm/include/mach/msm_iomap-8960.h48
-rw-r--r--arch/arm/mach-msm/include/mach/msm_iomap-8x50.h22
-rw-r--r--arch/arm/mach-msm/include/mach/msm_iomap-8x60.h61
-rw-r--r--arch/arm/mach-msm/include/mach/msm_iomap.h9
-rw-r--r--arch/arm/mach-msm/include/mach/sirc.h31
-rw-r--r--arch/arm/mach-msm/include/mach/smp.h30
-rw-r--r--arch/arm/mach-msm/io.c41
-rw-r--r--arch/arm/mach-msm/iommu.c72
-rw-r--r--arch/arm/mach-msm/iommu_dev.c230
-rw-r--r--arch/arm/mach-msm/scm-boot.h30
-rw-r--r--arch/arm/mach-msm/scm.c58
-rw-r--r--arch/arm/mach-msm/scm.h30
-rw-r--r--arch/arm/mach-msm/timer.c49
-rw-r--r--arch/arm/mach-mv78xx0/buffalo-wxl-setup.c1
-rw-r--r--arch/arm/mach-mv78xx0/common.c8
-rw-r--r--arch/arm/mach-mv78xx0/common.h1
-rw-r--r--arch/arm/mach-mv78xx0/db78x00-bp-setup.c1
-rw-r--r--arch/arm/mach-mv78xx0/include/mach/bridge-regs.h4
-rw-r--r--arch/arm/mach-mv78xx0/include/mach/gpio.h31
-rw-r--r--arch/arm/mach-mv78xx0/include/mach/memory.h2
-rw-r--r--arch/arm/mach-mv78xx0/include/mach/mv78xx0.h1
-rw-r--r--arch/arm/mach-mv78xx0/irq.c22
-rw-r--r--arch/arm/mach-mv78xx0/mpp.c3
-rw-r--r--arch/arm/mach-mv78xx0/rd78x00-masa-setup.c1
-rw-r--r--arch/arm/mach-mx3/Kconfig25
-rw-r--r--arch/arm/mach-mx3/Makefile6
-rw-r--r--arch/arm/mach-mx3/devices-imx35.h2
-rw-r--r--arch/arm/mach-mx3/ehci-imx31.c83
-rw-r--r--arch/arm/mach-mx3/ehci-imx35.c80
-rw-r--r--arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c4
-rw-r--r--arch/arm/mach-mx3/iomux-imx31.c12
-rw-r--r--arch/arm/mach-mx3/mach-armadillo5x0.c41
-rw-r--r--arch/arm/mach-mx3/mach-bug.c66
-rw-r--r--arch/arm/mach-mx3/mach-cpuimx35.c31
-rw-r--r--arch/arm/mach-mx3/mach-kzm_arm11_01.c19
-rw-r--r--arch/arm/mach-mx3/mach-mx31_3ds.c466
-rw-r--r--arch/arm/mach-mx3/mach-mx31ads.c57
-rw-r--r--arch/arm/mach-mx3/mach-mx31lilly.c95
-rw-r--r--arch/arm/mach-mx3/mach-mx31lite.c37
-rw-r--r--arch/arm/mach-mx3/mach-mx31moboard.c45
-rw-r--r--arch/arm/mach-mx3/mach-mx35_3ds.c42
-rw-r--r--arch/arm/mach-mx3/mach-pcm037.c46
-rw-r--r--arch/arm/mach-mx3/mach-pcm037_eet.c2
-rw-r--r--arch/arm/mach-mx3/mach-pcm043.c54
-rw-r--r--arch/arm/mach-mx3/mach-qong.c22
-rw-r--r--arch/arm/mach-mx3/mach-vpr200.c328
-rw-r--r--arch/arm/mach-mx3/mm.c43
-rw-r--r--arch/arm/mach-mx3/mx31moboard-devboard.c7
-rw-r--r--arch/arm/mach-mx3/mx31moboard-marxbot.c6
-rw-r--r--arch/arm/mach-mx3/mx31moboard-smartbot.c13
-rw-r--r--arch/arm/mach-mx5/Kconfig27
-rw-r--r--arch/arm/mach-mx5/Makefile4
-rw-r--r--arch/arm/mach-mx5/board-cpuimx51.c20
-rw-r--r--arch/arm/mach-mx5/board-cpuimx51sd.c31
-rw-r--r--arch/arm/mach-mx5/board-mx50_rdp.c34
-rw-r--r--arch/arm/mach-mx5/board-mx51_3ds.c43
-rw-r--r--arch/arm/mach-mx5/board-mx51_babbage.c43
-rw-r--r--arch/arm/mach-mx5/board-mx51_efikamx.c211
-rw-r--r--arch/arm/mach-mx5/board-mx51_efikasb.c283
-rw-r--r--arch/arm/mach-mx5/board-mx53_evk.c40
-rw-r--r--arch/arm/mach-mx5/board-mx53_loco.c178
-rw-r--r--arch/arm/mach-mx5/board-mx53_smd.c40
-rw-r--r--arch/arm/mach-mx5/clock-mx51-mx53.c148
-rw-r--r--arch/arm/mach-mx5/cpu.c11
-rw-r--r--arch/arm/mach-mx5/crm_regs.h7
-rw-r--r--arch/arm/mach-mx5/devices-imx50.h (renamed from arch/arm/mach-mx5/devices-mx50.h)8
-rw-r--r--arch/arm/mach-mx5/devices-imx53.h4
-rw-r--r--arch/arm/mach-mx5/efika.h10
-rw-r--r--arch/arm/mach-mx5/ehci.c156
-rw-r--r--arch/arm/mach-mx5/mm-mx50.c19
-rw-r--r--arch/arm/mach-mx5/mm.c14
-rw-r--r--arch/arm/mach-mx5/mx51_efika.c636
-rw-r--r--arch/arm/mach-mxc91231/iomux.c14
-rw-r--r--arch/arm/mach-mxc91231/magx-zn5.c11
-rw-r--r--arch/arm/mach-mxc91231/mm.c7
-rw-r--r--arch/arm/mach-mxs/Kconfig24
-rw-r--r--arch/arm/mach-mxs/Makefile5
-rw-r--r--arch/arm/mach-mxs/clock-mx23.c15
-rw-r--r--arch/arm/mach-mxs/clock-mx28.c32
-rw-r--r--arch/arm/mach-mxs/clock.c2
-rw-r--r--arch/arm/mach-mxs/devices-mx23.h11
-rw-r--r--arch/arm/mach-mxs/devices-mx28.h23
-rw-r--r--arch/arm/mach-mxs/devices.c2
-rw-r--r--arch/arm/mach-mxs/devices/Kconfig16
-rw-r--r--arch/arm/mach-mxs/devices/Makefile6
-rw-r--r--arch/arm/mach-mxs/devices/platform-auart.c64
-rw-r--r--arch/arm/mach-mxs/devices/platform-dma.c49
-rw-r--r--arch/arm/mach-mxs/devices/platform-fec.c5
-rw-r--r--arch/arm/mach-mxs/devices/platform-flexcan.c51
-rw-r--r--arch/arm/mach-mxs/devices/platform-mxs-i2c.c51
-rw-r--r--arch/arm/mach-mxs/devices/platform-mxs-pwm.c22
-rw-r--r--arch/arm/mach-mxs/devices/platform-mxsfb.c46
-rw-r--r--arch/arm/mach-mxs/gpio.c78
-rw-r--r--arch/arm/mach-mxs/icoll.c16
-rw-r--r--arch/arm/mach-mxs/include/mach/clock.h2
-rw-r--r--arch/arm/mach-mxs/include/mach/common.h1
-rw-r--r--arch/arm/mach-mxs/include/mach/devices-common.h35
-rw-r--r--arch/arm/mach-mxs/include/mach/dma.h26
-rw-r--r--arch/arm/mach-mxs/include/mach/iomux-mx23.h190
-rw-r--r--arch/arm/mach-mxs/include/mach/iomux.h3
-rw-r--r--arch/arm/mach-mxs/include/mach/mmc.h18
-rw-r--r--arch/arm/mach-mxs/include/mach/mx23.h38
-rw-r--r--arch/arm/mach-mxs/include/mach/mx28.h45
-rw-r--r--arch/arm/mach-mxs/include/mach/mxs.h9
-rw-r--r--arch/arm/mach-mxs/include/mach/mxsfb.h49
-rw-r--r--arch/arm/mach-mxs/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-mxs/mach-mx23evk.c90
-rw-r--r--arch/arm/mach-mxs/mach-mx28evk.c237
-rw-r--r--arch/arm/mach-mxs/mach-tx28.c183
-rw-r--r--arch/arm/mach-mxs/module-tx28.c131
-rw-r--r--arch/arm/mach-mxs/module-tx28.h9
-rw-r--r--arch/arm/mach-mxs/ocotp.c90
-rw-r--r--arch/arm/mach-mxs/pm.c43
-rw-r--r--arch/arm/mach-mxs/regs-clkctrl-mx23.h124
-rw-r--r--arch/arm/mach-mxs/regs-clkctrl-mx28.h177
-rw-r--r--arch/arm/mach-mxs/system.c2
-rw-r--r--arch/arm/mach-netx/include/mach/memory.h2
-rw-r--r--arch/arm/mach-nomadik/include/mach/memory.h2
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/memory.h2
-rw-r--r--arch/arm/mach-nuc93x/include/mach/memory.h2
-rw-r--r--arch/arm/mach-omap1/Kconfig2
-rw-r--r--arch/arm/mach-omap1/Makefile5
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c16
-rw-r--r--arch/arm/mach-omap1/board-fsample.c4
-rw-r--r--arch/arm/mach-omap1/board-h2.c2
-rw-r--r--arch/arm/mach-omap1/board-h3.c2
-rw-r--r--arch/arm/mach-omap1/board-htcherald.c4
-rw-r--r--arch/arm/mach-omap1/board-innovator.c2
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c6
-rw-r--r--arch/arm/mach-omap1/board-palmte.c13
-rw-r--r--arch/arm/mach-omap1/board-voiceblue.c107
-rw-r--r--arch/arm/mach-omap1/include/mach/debug-macro.S9
-rw-r--r--arch/arm/mach-omap1/include/mach/entry-macro.S13
-rw-r--r--arch/arm/mach-omap1/irq.c2
-rw-r--r--arch/arm/mach-omap1/lcd_dma.c24
-rw-r--r--arch/arm/mach-omap1/mcbsp.c333
-rw-r--r--arch/arm/mach-omap1/pm.h6
-rw-r--r--arch/arm/mach-omap1/reset.c25
-rw-r--r--arch/arm/mach-omap1/sleep.S3
-rw-r--r--arch/arm/mach-omap1/sram.S1
-rw-r--r--arch/arm/mach-omap1/time.c100
-rw-r--r--arch/arm/mach-omap1/timer32k.c13
-rw-r--r--arch/arm/mach-omap2/Kconfig30
-rw-r--r--arch/arm/mach-omap2/Makefile68
-rw-r--r--arch/arm/mach-omap2/board-2430sdp.c34
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c225
-rw-r--r--arch/arm/mach-omap2/board-3630sdp.c25
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c294
-rw-r--r--arch/arm/mach-omap2/board-am3517crane.c24
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c53
-rw-r--r--arch/arm/mach-omap2/board-apollon.c12
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c53
-rw-r--r--arch/arm/mach-omap2/board-cm-t3517.c54
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c79
-rw-r--r--arch/arm/mach-omap2/board-flash.c34
-rw-r--r--arch/arm/mach-omap2/board-flash.h4
-rw-r--r--arch/arm/mach-omap2/board-generic.c12
-rw-r--r--arch/arm/mach-omap2/board-h4.c16
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c48
-rw-r--r--arch/arm/mach-omap2/board-igep0030.c22
-rw-r--r--arch/arm/mach-omap2/board-ldp.c35
-rw-r--r--arch/arm/mach-omap2/board-n8x0.c20
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c95
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c268
-rw-r--r--arch/arm/mach-omap2/board-omap3logic.c9
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c41
-rw-r--r--arch/arm/mach-omap2/board-omap3stalker.c51
-rw-r--r--arch/arm/mach-omap2/board-omap3touchbook.c30
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c381
-rw-r--r--arch/arm/mach-omap2/board-overo.c377
-rw-r--r--arch/arm/mach-omap2/board-rm680.c13
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c63
-rw-r--r--arch/arm/mach-omap2/board-rx51-video.c15
-rw-r--r--arch/arm/mach-omap2/board-rx51.c14
-rw-r--r--arch/arm/mach-omap2/board-ti8168evm.c62
-rw-r--r--arch/arm/mach-omap2/board-zoom-display.c15
-rw-r--r--arch/arm/mach-omap2/board-zoom-peripherals.c18
-rw-r--r--arch/arm/mach-omap2/board-zoom.c31
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_apll.c24
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_dpll.c63
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_osc.c14
-rw-r--r--arch/arm/mach-omap2/clkt_clksel.c2
-rw-r--r--arch/arm/mach-omap2/clkt_dpll.c93
-rw-r--r--arch/arm/mach-omap2/clkt_iclk.c82
-rw-r--r--arch/arm/mach-omap2/clock.c37
-rw-r--r--arch/arm/mach-omap2/clock.h21
-rw-r--r--arch/arm/mach-omap2/clock2420_data.c229
-rw-r--r--arch/arm/mach-omap2/clock2430_data.c252
-rw-r--r--arch/arm/mach-omap2/clock2xxx.h8
-rw-r--r--arch/arm/mach-omap2/clock34xx.c29
-rw-r--r--arch/arm/mach-omap2/clock34xx.h5
-rw-r--r--arch/arm/mach-omap2/clock3517.c4
-rw-r--r--arch/arm/mach-omap2/clock3xxx.c3
-rw-r--r--arch/arm/mach-omap2/clock3xxx_data.c215
-rw-r--r--arch/arm/mach-omap2/clock44xx_data.c103
-rw-r--r--arch/arm/mach-omap2/clock_common_data.c6
-rw-r--r--arch/arm/mach-omap2/clockdomain.c417
-rw-r--r--arch/arm/mach-omap2/clockdomain.h70
-rw-r--r--arch/arm/mach-omap2/clockdomain2xxx_3xxx.c274
-rw-r--r--arch/arm/mach-omap2/clockdomain44xx.c137
-rw-r--r--arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c28
-rw-r--r--arch/arm/mach-omap2/clockdomains44xx_data.c398
-rw-r--r--arch/arm/mach-omap2/cm-regbits-24xx.h3
-rw-r--r--arch/arm/mach-omap2/cm2xxx_3xxx.c69
-rw-r--r--arch/arm/mach-omap2/cm2xxx_3xxx.h8
-rw-r--r--arch/arm/mach-omap2/cm44xx.h1
-rw-r--r--arch/arm/mach-omap2/cminst44xx.c21
-rw-r--r--arch/arm/mach-omap2/cminst44xx.h6
-rw-r--r--arch/arm/mach-omap2/common.c39
-rw-r--r--arch/arm/mach-omap2/control.h6
-rw-r--r--arch/arm/mach-omap2/cpuidle34xx.c15
-rw-r--r--arch/arm/mach-omap2/devices.c737
-rw-r--r--arch/arm/mach-omap2/devices.h19
-rw-r--r--arch/arm/mach-omap2/display.c125
-rw-r--r--arch/arm/mach-omap2/dma.c2
-rw-r--r--arch/arm/mach-omap2/dpll44xx.c84
-rw-r--r--arch/arm/mach-omap2/gpmc-nand.c7
-rw-r--r--arch/arm/mach-omap2/gpmc-onenand.c113
-rw-r--r--arch/arm/mach-omap2/gpmc.c56
-rw-r--r--arch/arm/mach-omap2/hsmmc.c421
-rw-r--r--arch/arm/mach-omap2/hwspinlock.c63
-rw-r--r--arch/arm/mach-omap2/id.c77
-rw-r--r--arch/arm/mach-omap2/include/mach/debug-macro.S25
-rw-r--r--arch/arm/mach-omap2/include/mach/entry-macro.S27
-rw-r--r--arch/arm/mach-omap2/include/mach/omap4-common.h4
-rw-r--r--arch/arm/mach-omap2/io.c48
-rw-r--r--arch/arm/mach-omap2/iommu2.c33
-rw-r--r--arch/arm/mach-omap2/irq.c9
-rw-r--r--arch/arm/mach-omap2/mailbox.c86
-rw-r--r--arch/arm/mach-omap2/mcbsp.c231
-rw-r--r--arch/arm/mach-omap2/mux.c90
-rw-r--r--arch/arm/mach-omap2/mux.h7
-rw-r--r--arch/arm/mach-omap2/mux44xx.c282
-rw-r--r--arch/arm/mach-omap2/omap-headsmp.S2
-rw-r--r--arch/arm/mach-omap2/omap4-common.c7
-rw-r--r--arch/arm/mach-omap2/omap44xx-smc.S8
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c333
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2420_data.c1315
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2430_data.c1798
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c2337
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_44xx_data.c3201
-rw-r--r--arch/arm/mach-omap2/omap_l3_noc.c253
-rw-r--r--arch/arm/mach-omap2/omap_l3_noc.h132
-rw-r--r--arch/arm/mach-omap2/omap_l3_smx.c314
-rw-r--r--arch/arm/mach-omap2/omap_l3_smx.h338
-rw-r--r--arch/arm/mach-omap2/omap_opp_data.h24
-rw-r--r--arch/arm/mach-omap2/omap_phy_internal.c122
-rw-r--r--arch/arm/mach-omap2/omap_twl.c62
-rw-r--r--arch/arm/mach-omap2/opp2xxx.h2
-rw-r--r--arch/arm/mach-omap2/opp3xxx_data.c115
-rw-r--r--arch/arm/mach-omap2/opp4xxx_data.c66
-rw-r--r--arch/arm/mach-omap2/pm-debug.c8
-rw-r--r--arch/arm/mach-omap2/pm.c12
-rw-r--r--arch/arm/mach-omap2/pm.h3
-rw-r--r--arch/arm/mach-omap2/pm24xx.c89
-rw-r--r--arch/arm/mach-omap2/pm34xx.c170
-rw-r--r--arch/arm/mach-omap2/powerdomain.c69
-rw-r--r--arch/arm/mach-omap2/powerdomain.h19
-rw-r--r--arch/arm/mach-omap2/powerdomain2xxx_3xxx.c1
-rw-r--r--arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c9
-rw-r--r--arch/arm/mach-omap2/powerdomains2xxx_data.c24
-rw-r--r--arch/arm/mach-omap2/powerdomains3xxx_data.c38
-rw-r--r--arch/arm/mach-omap2/powerdomains44xx_data.c88
-rw-r--r--arch/arm/mach-omap2/prcm-common.h8
-rw-r--r--arch/arm/mach-omap2/prcm.c5
-rw-r--r--arch/arm/mach-omap2/prcm_mpu44xx.h4
-rw-r--r--arch/arm/mach-omap2/prm2xxx_3xxx.c18
-rw-r--r--arch/arm/mach-omap2/prm2xxx_3xxx.h5
-rw-r--r--arch/arm/mach-omap2/serial.c21
-rw-r--r--arch/arm/mach-omap2/sleep24xx.S2
-rw-r--r--arch/arm/mach-omap2/sleep34xx.S284
-rw-r--r--arch/arm/mach-omap2/smartreflex-class3.c2
-rw-r--r--arch/arm/mach-omap2/smartreflex.c77
-rw-r--r--arch/arm/mach-omap2/smartreflex.h (renamed from arch/arm/plat-omap/include/plat/smartreflex.h)3
-rw-r--r--arch/arm/mach-omap2/sr_device.c4
-rw-r--r--arch/arm/mach-omap2/sram242x.S3
-rw-r--r--arch/arm/mach-omap2/sram243x.S3
-rw-r--r--arch/arm/mach-omap2/sram34xx.S37
-rw-r--r--arch/arm/mach-omap2/timer-gp.c28
-rw-r--r--arch/arm/mach-omap2/timer-mpu.c7
-rw-r--r--arch/arm/mach-omap2/usb-host.c (renamed from arch/arm/mach-omap2/usb-ehci.c)306
-rw-r--r--arch/arm/mach-omap2/usb-musb.c222
-rw-r--r--arch/arm/mach-omap2/vc.h83
-rw-r--r--arch/arm/mach-omap2/vc3xxx_data.c63
-rw-r--r--arch/arm/mach-omap2/vc44xx_data.c75
-rw-r--r--arch/arm/mach-omap2/voltage.c1021
-rw-r--r--arch/arm/mach-omap2/voltage.h (renamed from arch/arm/plat-omap/include/plat/voltage.h)89
-rw-r--r--arch/arm/mach-omap2/voltagedomains3xxx_data.c95
-rw-r--r--arch/arm/mach-omap2/voltagedomains44xx_data.c102
-rw-r--r--arch/arm/mach-omap2/vp.h143
-rw-r--r--arch/arm/mach-omap2/vp3xxx_data.c82
-rw-r--r--arch/arm/mach-omap2/vp44xx_data.c100
-rw-r--r--arch/arm/mach-orion5x/common.c10
-rw-r--r--arch/arm/mach-orion5x/common.h1
-rw-r--r--arch/arm/mach-orion5x/d2net-setup.c2
-rw-r--r--arch/arm/mach-orion5x/db88f5281-setup.c1
-rw-r--r--arch/arm/mach-orion5x/dns323-setup.c1
-rw-r--r--arch/arm/mach-orion5x/edmini_v2-setup.c1
-rw-r--r--arch/arm/mach-orion5x/include/mach/bridge-regs.h6
-rw-r--r--arch/arm/mach-orion5x/include/mach/gpio.h28
-rw-r--r--arch/arm/mach-orion5x/include/mach/memory.h2
-rw-r--r--arch/arm/mach-orion5x/include/mach/orion5x.h1
-rw-r--r--arch/arm/mach-orion5x/irq.c19
-rw-r--r--arch/arm/mach-orion5x/kurobox_pro-setup.c2
-rw-r--r--arch/arm/mach-orion5x/ls-chl-setup.c1
-rw-r--r--arch/arm/mach-orion5x/ls_hgl-setup.c1
-rw-r--r--arch/arm/mach-orion5x/lsmini-setup.c1
-rw-r--r--arch/arm/mach-orion5x/mpp.c3
-rw-r--r--arch/arm/mach-orion5x/mss2-setup.c1
-rw-r--r--arch/arm/mach-orion5x/mv2120-setup.c1
-rw-r--r--arch/arm/mach-orion5x/net2big-setup.c1
-rw-r--r--arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c1
-rw-r--r--arch/arm/mach-orion5x/rd88f5181l-ge-setup.c1
-rw-r--r--arch/arm/mach-orion5x/rd88f5182-setup.c1
-rw-r--r--arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c1
-rw-r--r--arch/arm/mach-orion5x/terastation_pro2-setup.c1
-rw-r--r--arch/arm/mach-orion5x/ts209-setup.c1
-rw-r--r--arch/arm/mach-orion5x/ts409-setup.c1
-rw-r--r--arch/arm/mach-orion5x/ts78xx-fpga.h15
-rw-r--r--arch/arm/mach-orion5x/ts78xx-setup.c78
-rw-r--r--arch/arm/mach-orion5x/wnr854t-setup.c1
-rw-r--r--arch/arm/mach-orion5x/wrt350n-v2-setup.c1
-rw-r--r--arch/arm/mach-pnx4008/include/mach/memory.h2
-rw-r--r--arch/arm/mach-pxa/balloon3.c5
-rw-r--r--arch/arm/mach-pxa/cm-x300.c2
-rw-r--r--arch/arm/mach-pxa/colibri-evalboard.c5
-rw-r--r--arch/arm/mach-pxa/colibri-pxa270-income.c3
-rw-r--r--arch/arm/mach-pxa/colibri-pxa300.c2
-rw-r--r--arch/arm/mach-pxa/corgi.c2
-rw-r--r--arch/arm/mach-pxa/csb726.c2
-rw-r--r--arch/arm/mach-pxa/devices.c2
-rw-r--r--arch/arm/mach-pxa/em-x270.c2
-rw-r--r--arch/arm/mach-pxa/ezx.c2
-rw-r--r--arch/arm/mach-pxa/hx4700.c2
-rw-r--r--arch/arm/mach-pxa/include/mach/colibri.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/memory.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/pm.h5
-rw-r--r--arch/arm/mach-pxa/littleton.c2
-rw-r--r--arch/arm/mach-pxa/magician.c2
-rw-r--r--arch/arm/mach-pxa/mainstone.c2
-rw-r--r--arch/arm/mach-pxa/mioa701.c2
-rw-r--r--arch/arm/mach-pxa/mxm8x10.c2
-rw-r--r--arch/arm/mach-pxa/palm27x.c5
-rw-r--r--arch/arm/mach-pxa/palmz72.c2
-rw-r--r--arch/arm/mach-pxa/pcm990-baseboard.c2
-rw-r--r--arch/arm/mach-pxa/pm.c9
-rw-r--r--arch/arm/mach-pxa/poodle.c2
-rw-r--r--arch/arm/mach-pxa/pxa25x.c5
-rw-r--r--arch/arm/mach-pxa/pxa27x.c7
-rw-r--r--arch/arm/mach-pxa/pxa3xx.c9
-rw-r--r--arch/arm/mach-pxa/pxa95x.c2
-rw-r--r--arch/arm/mach-pxa/raumfeld.c2
-rw-r--r--arch/arm/mach-pxa/saar.c2
-rw-r--r--arch/arm/mach-pxa/saarb.c3
-rw-r--r--arch/arm/mach-pxa/sleep.S191
-rw-r--r--arch/arm/mach-pxa/spitz.c3
-rw-r--r--arch/arm/mach-pxa/stargate2.c2
-rw-r--r--arch/arm/mach-pxa/tavorevb3.c3
-rw-r--r--arch/arm/mach-pxa/tosa-bt.c2
-rw-r--r--arch/arm/mach-pxa/tosa.c8
-rw-r--r--arch/arm/mach-pxa/trizeps4.c2
-rw-r--r--arch/arm/mach-pxa/viper.c2
-rw-r--r--arch/arm/mach-pxa/vpac270.c3
-rw-r--r--arch/arm/mach-pxa/xcep.c3
-rw-r--r--arch/arm/mach-pxa/z2.c3
-rw-r--r--arch/arm/mach-pxa/zeus.c5
-rw-r--r--arch/arm/mach-pxa/zylonite_pxa300.c2
-rw-r--r--arch/arm/mach-realview/Kconfig54
-rw-r--r--arch/arm/mach-realview/Makefile3
-rw-r--r--arch/arm/mach-realview/core.c233
-rw-r--r--arch/arm/mach-realview/core.h2
-rw-r--r--arch/arm/mach-realview/headsmp.S40
-rw-r--r--arch/arm/mach-realview/include/mach/memory.h4
-rw-r--r--arch/arm/mach-realview/localtimer.c26
-rw-r--r--arch/arm/mach-realview/platsmp.c98
-rw-r--r--arch/arm/mach-realview/realview_eb.c24
-rw-r--r--arch/arm/mach-realview/realview_pb1176.c24
-rw-r--r--arch/arm/mach-realview/realview_pb11mp.c24
-rw-r--r--arch/arm/mach-realview/realview_pba8.c24
-rw-r--r--arch/arm/mach-realview/realview_pbx.c24
-rw-r--r--arch/arm/mach-rpc/include/mach/memory.h2
-rw-r--r--arch/arm/mach-s3c2400/include/mach/memory.h2
-rw-r--r--arch/arm/mach-s3c2410/h1940-bluetooth.c11
-rw-r--r--arch/arm/mach-s3c2410/include/mach/h1940.h3
-rw-r--r--arch/arm/mach-s3c2410/include/mach/memory.h2
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c327
-rw-r--r--arch/arm/mach-s3c2410/mach-n30.c21
-rw-r--r--arch/arm/mach-s3c2412/mach-smdk2413.c24
-rw-r--r--arch/arm/mach-s3c2440/Kconfig1
-rw-r--r--arch/arm/mach-s3c2440/include/mach/gta02.h26
-rw-r--r--arch/arm/mach-s3c2440/mach-gta02.c93
-rw-r--r--arch/arm/mach-s3c2440/mach-mini2440.c31
-rw-r--r--arch/arm/mach-s3c2440/mach-rx1950.c95
-rw-r--r--arch/arm/mach-s3c24a0/include/mach/memory.h2
-rw-r--r--arch/arm/mach-s3c64xx/Kconfig5
-rw-r--r--arch/arm/mach-s3c64xx/clock.c6
-rw-r--r--arch/arm/mach-s3c64xx/cpufreq.c2
-rw-r--r--arch/arm/mach-s3c64xx/dma.c11
-rw-r--r--arch/arm/mach-s3c64xx/gpiolib.c4
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/memory.h2
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6410.c59
-rw-r--r--arch/arm/mach-s3c64xx/setup-keypad.c2
-rw-r--r--arch/arm/mach-s3c64xx/setup-sdhci.c2
-rw-r--r--arch/arm/mach-s3c64xx/sleep.S63
-rw-r--r--arch/arm/mach-s5p6442/include/mach/map.h69
-rw-r--r--arch/arm/mach-s5p6442/include/mach/memory.h2
-rw-r--r--arch/arm/mach-s5p64x0/Kconfig4
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/gpio.h4
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/map.h83
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/memory.h2
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6440.c47
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6450.c47
-rw-r--r--arch/arm/mach-s5pc100/Kconfig1
-rw-r--r--arch/arm/mach-s5pc100/gpiolib.c1
-rw-r--r--arch/arm/mach-s5pc100/include/mach/map.h193
-rw-r--r--arch/arm/mach-s5pc100/include/mach/memory.h2
-rw-r--r--arch/arm/mach-s5pc100/mach-smdkc100.c48
-rw-r--r--arch/arm/mach-s5pv210/Kconfig7
-rw-r--r--arch/arm/mach-s5pv210/Makefile1
-rw-r--r--arch/arm/mach-s5pv210/cpufreq.c3
-rw-r--r--arch/arm/mach-s5pv210/gpiolib.c1
-rw-r--r--arch/arm/mach-s5pv210/include/mach/map.h168
-rw-r--r--arch/arm/mach-s5pv210/include/mach/memory.h2
-rw-r--r--arch/arm/mach-s5pv210/include/mach/regs-clock.h5
-rw-r--r--arch/arm/mach-s5pv210/mach-aquila.c71
-rw-r--r--arch/arm/mach-s5pv210/mach-goni.c130
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkc110.c4
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkv210.c47
-rw-r--r--arch/arm/mach-s5pv210/mach-torbreck.c4
-rw-r--r--arch/arm/mach-s5pv210/setup-fimc.c43
-rw-r--r--arch/arm/mach-s5pv210/sleep.S105
-rw-r--r--arch/arm/mach-s5pv310/Kconfig150
-rw-r--r--arch/arm/mach-s5pv310/Makefile43
-rw-r--r--arch/arm/mach-s5pv310/gpiolib.c304
-rw-r--r--arch/arm/mach-s5pv310/include/mach/gpio.h135
-rw-r--r--arch/arm/mach-s5pv310/include/mach/map.h149
-rw-r--r--arch/arm/mach-s5pv310/include/mach/regs-gpio.h42
-rw-r--r--arch/arm/mach-s5pv310/include/mach/regs-pmu.h30
-rw-r--r--arch/arm/mach-s5pv310/include/mach/sysmmu.h119
-rw-r--r--arch/arm/mach-s5pv310/mach-universal_c210.c237
-rw-r--r--arch/arm/mach-sa1100/collie.c3
-rw-r--r--arch/arm/mach-sa1100/include/mach/memory.h2
-rw-r--r--arch/arm/mach-sa1100/pm.c12
-rw-r--r--arch/arm/mach-sa1100/sleep.S72
-rw-r--r--arch/arm/mach-shark/include/mach/memory.h2
-rw-r--r--arch/arm/mach-shmobile/Kconfig2
-rw-r--r--arch/arm/mach-shmobile/board-ag5evm.c191
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c18
-rw-r--r--arch/arm/mach-shmobile/board-g3evm.c1
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c45
-rw-r--r--arch/arm/mach-shmobile/clock-sh7372.c4
-rw-r--r--arch/arm/mach-shmobile/clock-sh73a0.c40
-rw-r--r--arch/arm/mach-shmobile/include/mach/head-ap4evb.txt10
-rw-r--r--arch/arm/mach-shmobile/include/mach/head-mackerel.txt10
-rw-r--r--arch/arm/mach-shmobile/include/mach/memory.h2
-rw-r--r--arch/arm/mach-shmobile/include/mach/mmc-ap4eb.h29
-rw-r--r--arch/arm/mach-shmobile/include/mach/mmc-mackerel.h38
-rw-r--r--arch/arm/mach-shmobile/include/mach/mmc.h18
-rw-r--r--arch/arm/mach-shmobile/intc-sh7372.c11
-rw-r--r--arch/arm/mach-shmobile/intc-sh73a0.c5
-rw-r--r--arch/arm/mach-shmobile/localtimer.c3
-rw-r--r--arch/arm/mach-spear3xx/clock.c479
-rw-r--r--arch/arm/mach-spear3xx/include/mach/entry-macro.S3
-rw-r--r--arch/arm/mach-spear3xx/include/mach/generic.h22
-rw-r--r--arch/arm/mach-spear3xx/include/mach/hardware.h3
-rw-r--r--arch/arm/mach-spear3xx/include/mach/irqs.h4
-rw-r--r--arch/arm/mach-spear3xx/include/mach/misc_regs.h143
-rw-r--r--arch/arm/mach-spear3xx/include/mach/spear.h135
-rw-r--r--arch/arm/mach-spear3xx/include/mach/spear300.h59
-rw-r--r--arch/arm/mach-spear3xx/include/mach/spear310.h34
-rw-r--r--arch/arm/mach-spear3xx/include/mach/spear320.h67
-rw-r--r--arch/arm/mach-spear3xx/spear300.c82
-rw-r--r--arch/arm/mach-spear3xx/spear300_evb.c15
-rw-r--r--arch/arm/mach-spear3xx/spear310.c21
-rw-r--r--arch/arm/mach-spear3xx/spear310_evb.c13
-rw-r--r--arch/arm/mach-spear3xx/spear320.c41
-rw-r--r--arch/arm/mach-spear3xx/spear320_evb.c15
-rw-r--r--arch/arm/mach-spear3xx/spear3xx.c55
-rw-r--r--arch/arm/mach-spear6xx/clock.c356
-rw-r--r--arch/arm/mach-spear6xx/include/mach/entry-macro.S3
-rw-r--r--arch/arm/mach-spear6xx/include/mach/generic.h7
-rw-r--r--arch/arm/mach-spear6xx/include/mach/hardware.h4
-rw-r--r--arch/arm/mach-spear6xx/include/mach/misc_regs.h143
-rw-r--r--arch/arm/mach-spear6xx/include/mach/spear.h175
-rw-r--r--arch/arm/mach-spear6xx/spear600.c2
-rw-r--r--arch/arm/mach-spear6xx/spear600_evb.c4
-rw-r--r--arch/arm/mach-spear6xx/spear6xx.c60
-rw-r--r--arch/arm/mach-tcc8k/board-tcc8000-sdk.c21
-rw-r--r--arch/arm/mach-tcc8k/clock.c38
-rw-r--r--arch/arm/mach-tegra/Kconfig36
-rw-r--r--arch/arm/mach-tegra/Makefile15
-rw-r--r--arch/arm/mach-tegra/board-harmony-pcie.c24
-rw-r--r--arch/arm/mach-tegra/board-harmony-pinmux.c35
-rw-r--r--arch/arm/mach-tegra/board-harmony-power.c117
-rw-r--r--arch/arm/mach-tegra/board-harmony.c145
-rw-r--r--arch/arm/mach-tegra/board-harmony.h15
-rw-r--r--arch/arm/mach-tegra/board-paz00-pinmux.c157
-rw-r--r--arch/arm/mach-tegra/board-paz00.c128
-rw-r--r--arch/arm/mach-tegra/board-paz00.h29
-rw-r--r--arch/arm/mach-tegra/board-seaboard-pinmux.c180
-rw-r--r--arch/arm/mach-tegra/board-seaboard.c250
-rw-r--r--arch/arm/mach-tegra/board-seaboard.h41
-rw-r--r--arch/arm/mach-tegra/board-trimslice-pinmux.c154
-rw-r--r--arch/arm/mach-tegra/board-trimslice.c125
-rw-r--r--arch/arm/mach-tegra/board-trimslice.h25
-rw-r--r--arch/arm/mach-tegra/board.h4
-rw-r--r--arch/arm/mach-tegra/clock.c532
-rw-r--r--arch/arm/mach-tegra/clock.h129
-rw-r--r--arch/arm/mach-tegra/common.c27
-rw-r--r--arch/arm/mach-tegra/cpu-tegra.c100
-rw-r--r--arch/arm/mach-tegra/devices.c575
-rw-r--r--arch/arm/mach-tegra/devices.h50
-rw-r--r--arch/arm/mach-tegra/dma.c243
-rw-r--r--arch/arm/mach-tegra/gpio.c19
-rw-r--r--arch/arm/mach-tegra/include/mach/clk.h8
-rw-r--r--arch/arm/mach-tegra/include/mach/clkdev.h2
-rw-r--r--arch/arm/mach-tegra/include/mach/debug-macro.S25
-rw-r--r--arch/arm/mach-tegra/include/mach/gpio.h9
-rw-r--r--arch/arm/mach-tegra/include/mach/harmony_audio.h22
-rw-r--r--arch/arm/mach-tegra/include/mach/iomap.h50
-rw-r--r--arch/arm/mach-tegra/include/mach/irqs.h14
-rw-r--r--arch/arm/mach-tegra/include/mach/kbc.h62
-rw-r--r--arch/arm/mach-tegra/include/mach/legacy_irq.h4
-rw-r--r--arch/arm/mach-tegra/include/mach/memory.h2
-rw-r--r--arch/arm/mach-tegra/include/mach/pinmux-t2.h10
-rw-r--r--arch/arm/mach-tegra/include/mach/powergate.h40
-rw-r--r--arch/arm/mach-tegra/include/mach/suspend.h38
-rw-r--r--arch/arm/mach-tegra/include/mach/system.h10
-rw-r--r--arch/arm/mach-tegra/include/mach/uncompress.h18
-rw-r--r--arch/arm/mach-tegra/include/mach/usb_phy.h86
-rw-r--r--arch/arm/mach-tegra/irq.c198
-rw-r--r--arch/arm/mach-tegra/legacy_irq.c109
-rw-r--r--arch/arm/mach-tegra/localtimer.c3
-rw-r--r--arch/arm/mach-tegra/pcie.c38
-rw-r--r--arch/arm/mach-tegra/pinmux-t2-tables.c26
-rw-r--r--arch/arm/mach-tegra/powergate.c212
-rw-r--r--arch/arm/mach-tegra/tegra2_clocks.c1120
-rw-r--r--arch/arm/mach-tegra/tegra2_dvfs.c86
-rw-r--r--arch/arm/mach-tegra/tegra2_emc.c178
-rw-r--r--arch/arm/mach-tegra/tegra2_emc.h27
-rw-r--r--arch/arm/mach-tegra/timer.c77
-rw-r--r--arch/arm/mach-tegra/usb_phy.c795
-rw-r--r--arch/arm/mach-u300/core.c179
-rw-r--r--arch/arm/mach-u300/include/mach/coh901318.h7
-rw-r--r--arch/arm/mach-u300/include/mach/memory.h6
-rw-r--r--arch/arm/mach-u300/mmc.c160
-rw-r--r--arch/arm/mach-u300/spi.c21
-rw-r--r--arch/arm/mach-u300/u300.c2
-rw-r--r--arch/arm/mach-ux500/Kconfig1
-rw-r--r--arch/arm/mach-ux500/Makefile8
-rw-r--r--arch/arm/mach-ux500/board-mop500-keypads.c229
-rw-r--r--arch/arm/mach-ux500/board-mop500-pins.c241
-rw-r--r--arch/arm/mach-ux500/board-mop500-regulators.c62
-rw-r--r--arch/arm/mach-ux500/board-mop500-sdi.c184
-rw-r--r--arch/arm/mach-ux500/board-mop500-stuib.c205
-rw-r--r--arch/arm/mach-ux500/board-mop500-u8500uib.c111
-rw-r--r--arch/arm/mach-ux500/board-mop500-uib.c135
-rw-r--r--arch/arm/mach-ux500/board-mop500.c328
-rw-r--r--arch/arm/mach-ux500/board-mop500.h25
-rw-r--r--arch/arm/mach-ux500/board-u5500-sdi.c25
-rw-r--r--arch/arm/mach-ux500/board-u5500.c6
-rw-r--r--arch/arm/mach-ux500/clock.c6
-rw-r--r--arch/arm/mach-ux500/cpu-db5500.c53
-rw-r--r--arch/arm/mach-ux500/cpu-db8500.c76
-rw-r--r--arch/arm/mach-ux500/devices-common.c1
-rw-r--r--arch/arm/mach-ux500/devices-common.h7
-rw-r--r--arch/arm/mach-ux500/devices-db5500.h19
-rw-r--r--arch/arm/mach-ux500/devices-db8500.c67
-rw-r--r--arch/arm/mach-ux500/devices-db8500.h15
-rw-r--r--arch/arm/mach-ux500/dma-db5500.c16
-rw-r--r--arch/arm/mach-ux500/include/mach/memory.h2
-rw-r--r--arch/arm/mach-ux500/include/mach/uncompress.h6
-rw-r--r--arch/arm/mach-ux500/include/mach/usb.h25
-rw-r--r--arch/arm/mach-ux500/localtimer.c3
-rw-r--r--arch/arm/mach-ux500/mbox-db5500.c2
-rw-r--r--arch/arm/mach-ux500/usb.c160
-rw-r--r--arch/arm/mach-versatile/Kconfig10
-rw-r--r--arch/arm/mach-versatile/core.c295
-rw-r--r--arch/arm/mach-versatile/core.h2
-rw-r--r--arch/arm/mach-versatile/include/mach/hardware.h2
-rw-r--r--arch/arm/mach-versatile/include/mach/memory.h2
-rw-r--r--arch/arm/mach-versatile/versatile_ab.c1
-rw-r--r--arch/arm/mach-versatile/versatile_pb.c6
-rw-r--r--arch/arm/mach-vexpress/Kconfig3
-rw-r--r--arch/arm/mach-vexpress/Makefile3
-rw-r--r--arch/arm/mach-vexpress/core.h5
-rw-r--r--arch/arm/mach-vexpress/ct-ca9x4.c107
-rw-r--r--arch/arm/mach-vexpress/include/mach/ct-ca9x4.h2
-rw-r--r--arch/arm/mach-vexpress/include/mach/memory.h2
-rw-r--r--arch/arm/mach-vexpress/include/mach/motherboard.h22
-rw-r--r--arch/arm/mach-vexpress/platsmp.c125
-rw-r--r--arch/arm/mach-vexpress/v2m.c97
-rw-r--r--arch/arm/mach-vt8500/Kconfig73
-rw-r--r--arch/arm/mach-vt8500/Makefile9
-rw-r--r--arch/arm/mach-vt8500/Makefile.boot3
-rw-r--r--arch/arm/mach-vt8500/bv07.c77
-rw-r--r--arch/arm/mach-vt8500/devices-vt8500.c91
-rw-r--r--arch/arm/mach-vt8500/devices-wm8505.c99
-rw-r--r--arch/arm/mach-vt8500/devices.c270
-rw-r--r--arch/arm/mach-vt8500/devices.h88
-rw-r--r--arch/arm/mach-vt8500/gpio.c240
-rw-r--r--arch/arm/mach-vt8500/include/mach/debug-macro.S31
-rw-r--r--arch/arm/mach-vt8500/include/mach/entry-macro.S32
-rw-r--r--arch/arm/mach-vt8500/include/mach/gpio.h6
-rw-r--r--arch/arm/mach-vt8500/include/mach/hardware.h (renamed from arch/arm/mach-tegra/tegra2_dvfs.h)10
-rw-r--r--arch/arm/mach-vt8500/include/mach/i8042.h18
-rw-r--r--arch/arm/mach-vt8500/include/mach/io.h28
-rw-r--r--arch/arm/mach-vt8500/include/mach/irqs.h22
-rw-r--r--arch/arm/mach-vt8500/include/mach/memory.h28
-rw-r--r--arch/arm/mach-vt8500/include/mach/system.h18
-rw-r--r--arch/arm/mach-vt8500/include/mach/timex.h26
-rw-r--r--arch/arm/mach-vt8500/include/mach/uncompress.h37
-rw-r--r--arch/arm/mach-vt8500/include/mach/vmalloc.h20
-rw-r--r--arch/arm/mach-vt8500/include/mach/vt8500_irqs.h88
-rw-r--r--arch/arm/mach-vt8500/include/mach/vt8500_regs.h79
-rw-r--r--arch/arm/mach-vt8500/include/mach/vt8500fb.h31
-rw-r--r--arch/arm/mach-vt8500/include/mach/wm8505_irqs.h115
-rw-r--r--arch/arm/mach-vt8500/include/mach/wm8505_regs.h78
-rw-r--r--arch/arm/mach-vt8500/irq.c177
-rw-r--r--arch/arm/mach-vt8500/pwm.c265
-rw-r--r--arch/arm/mach-vt8500/timer.c155
-rw-r--r--arch/arm/mach-vt8500/wm8505_7in.c77
-rw-r--r--arch/arm/mach-w90x900/include/mach/memory.h2
-rw-r--r--arch/arm/mm/Kconfig61
-rw-r--r--arch/arm/mm/Makefile1
-rw-r--r--arch/arm/mm/abort-ev6.S6
-rw-r--r--arch/arm/mm/cache-l2x0.c38
-rw-r--r--arch/arm/mm/dma-mapping.c11
-rw-r--r--arch/arm/mm/fault-armv.c7
-rw-r--r--arch/arm/mm/fault.c39
-rw-r--r--arch/arm/mm/idmap.c35
-rw-r--r--arch/arm/mm/init.c14
-rw-r--r--arch/arm/mm/mm.h2
-rw-r--r--arch/arm/mm/mmap.c2
-rw-r--r--arch/arm/mm/mmu.c81
-rw-r--r--arch/arm/mm/pgd.c24
-rw-r--r--arch/arm/mm/proc-arm1020.S3
-rw-r--r--arch/arm/mm/proc-arm1020e.S3
-rw-r--r--arch/arm/mm/proc-arm1022.S3
-rw-r--r--arch/arm/mm/proc-arm1026.S3
-rw-r--r--arch/arm/mm/proc-arm6_7.S6
-rw-r--r--arch/arm/mm/proc-arm720.S3
-rw-r--r--arch/arm/mm/proc-arm740.S3
-rw-r--r--arch/arm/mm/proc-arm7tdmi.S3
-rw-r--r--arch/arm/mm/proc-arm920.S37
-rw-r--r--arch/arm/mm/proc-arm922.S3
-rw-r--r--arch/arm/mm/proc-arm925.S3
-rw-r--r--arch/arm/mm/proc-arm926.S37
-rw-r--r--arch/arm/mm/proc-arm940.S3
-rw-r--r--arch/arm/mm/proc-arm946.S3
-rw-r--r--arch/arm/mm/proc-arm9tdmi.S3
-rw-r--r--arch/arm/mm/proc-fa526.S3
-rw-r--r--arch/arm/mm/proc-feroceon.S3
-rw-r--r--arch/arm/mm/proc-mohawk.S3
-rw-r--r--arch/arm/mm/proc-sa110.S3
-rw-r--r--arch/arm/mm/proc-sa1100.S39
-rw-r--r--arch/arm/mm/proc-v6.S50
-rw-r--r--arch/arm/mm/proc-v7.S128
-rw-r--r--arch/arm/mm/proc-xsc3.S48
-rw-r--r--arch/arm/mm/proc-xscale.S45
-rw-r--r--arch/arm/mm/vmregion.c17
-rw-r--r--arch/arm/oprofile/common.c14
-rw-r--r--arch/arm/plat-mxc/Kconfig1
-rw-r--r--arch/arm/plat-mxc/Makefile1
-rw-r--r--arch/arm/plat-mxc/devices.c2
-rw-r--r--arch/arm/plat-mxc/devices/platform-fec.c9
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx-dma.c6
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx-fb.c5
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx-i2c.c10
-rw-r--r--arch/arm/plat-mxc/devices/platform-imx2-wdt.c9
-rw-r--r--arch/arm/plat-mxc/devices/platform-spi_imx.c9
-rw-r--r--arch/arm/plat-mxc/ehci.c369
-rw-r--r--arch/arm/plat-mxc/gpio.c111
-rw-r--r--arch/arm/plat-mxc/include/mach/common.h10
-rw-r--r--arch/arm/plat-mxc/include/mach/esdhc.h12
-rw-r--r--arch/arm/plat-mxc/include/mach/gpio.h15
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx3.h8
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx35.h14
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx50.h44
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx51.h44
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx53.h2639
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mxc91231.h8
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-v1.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/irqs.h6
-rw-r--r--arch/arm/plat-mxc/include/mach/memory.h18
-rw-r--r--arch/arm/plat-mxc/include/mach/mx1.h9
-rw-r--r--arch/arm/plat-mxc/include/mach/mx53.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/mxc.h10
-rw-r--r--arch/arm/plat-mxc/include/mach/mxc_ehci.h7
-rw-r--r--arch/arm/plat-mxc/include/mach/ulpi.h9
-rw-r--r--arch/arm/plat-mxc/include/mach/uncompress.h9
-rw-r--r--arch/arm/plat-mxc/iomux-v1.c24
-rw-r--r--arch/arm/plat-mxc/ulpi.c5
-rw-r--r--arch/arm/plat-nomadik/gpio.c487
-rw-r--r--arch/arm/plat-nomadik/include/plat/gpio.h6
-rw-r--r--arch/arm/plat-nomadik/include/plat/ste_dma40.h22
-rw-r--r--arch/arm/plat-omap/Kconfig10
-rw-r--r--arch/arm/plat-omap/clock.c99
-rw-r--r--arch/arm/plat-omap/common.c11
-rw-r--r--arch/arm/plat-omap/counter_32k.c26
-rw-r--r--arch/arm/plat-omap/cpu-omap.c2
-rw-r--r--arch/arm/plat-omap/devices.c10
-rw-r--r--arch/arm/plat-omap/dma.c9
-rw-r--r--arch/arm/plat-omap/dmtimer.c4
-rw-r--r--arch/arm/plat-omap/i2c.c2
-rw-r--r--arch/arm/plat-omap/include/plat/board.h4
-rw-r--r--arch/arm/plat-omap/include/plat/clkdev_omap.h1
-rw-r--r--arch/arm/plat-omap/include/plat/clock.h28
-rw-r--r--arch/arm/plat-omap/include/plat/common.h8
-rw-r--r--arch/arm/plat-omap/include/plat/cpu.h44
-rw-r--r--arch/arm/plat-omap/include/plat/display.h26
-rw-r--r--arch/arm/plat-omap/include/plat/dmtimer.h11
-rw-r--r--arch/arm/plat-omap/include/plat/fpga.h92
-rw-r--r--arch/arm/plat-omap/include/plat/gpmc.h18
-rw-r--r--arch/arm/plat-omap/include/plat/hardware.h1
-rw-r--r--arch/arm/plat-omap/include/plat/io.h12
-rw-r--r--arch/arm/plat-omap/include/plat/iommu.h16
-rw-r--r--arch/arm/plat-omap/include/plat/iovmm.h2
-rw-r--r--arch/arm/plat-omap/include/plat/irqs.h11
-rw-r--r--arch/arm/plat-omap/include/plat/l3_2xxx.h20
-rw-r--r--arch/arm/plat-omap/include/plat/l3_3xxx.h20
-rw-r--r--arch/arm/plat-omap/include/plat/l4_2xxx.h24
-rw-r--r--arch/arm/plat-omap/include/plat/l4_3xxx.h10
-rw-r--r--arch/arm/plat-omap/include/plat/mcbsp.h64
-rw-r--r--arch/arm/plat-omap/include/plat/mcspi.h11
-rw-r--r--arch/arm/plat-omap/include/plat/memory.h4
-rw-r--r--arch/arm/plat-omap/include/plat/mmc.h29
-rw-r--r--arch/arm/plat-omap/include/plat/multi.h4
-rw-r--r--arch/arm/plat-omap/include/plat/nand.h11
-rw-r--r--arch/arm/plat-omap/include/plat/omap34xx.h16
-rw-r--r--arch/arm/plat-omap/include/plat/omap_hwmod.h25
-rw-r--r--arch/arm/plat-omap/include/plat/onenand.h10
-rw-r--r--arch/arm/plat-omap/include/plat/prcm.h1
-rw-r--r--arch/arm/plat-omap/include/plat/sdrc.h8
-rw-r--r--arch/arm/plat-omap/include/plat/serial.h11
-rw-r--r--arch/arm/plat-omap/include/plat/sram.h14
-rw-r--r--arch/arm/plat-omap/include/plat/system.h38
-rw-r--r--arch/arm/plat-omap/include/plat/ti816x.h27
-rw-r--r--arch/arm/plat-omap/include/plat/uncompress.h7
-rw-r--r--arch/arm/plat-omap/include/plat/usb.h59
-rw-r--r--arch/arm/plat-omap/io.c5
-rw-r--r--arch/arm/plat-omap/iommu.c69
-rw-r--r--arch/arm/plat-omap/iovmm.c27
-rw-r--r--arch/arm/plat-omap/mailbox.c21
-rw-r--r--arch/arm/plat-omap/mcbsp.c203
-rw-r--r--arch/arm/plat-omap/omap_device.c36
-rw-r--r--arch/arm/plat-omap/sram.c34
-rw-r--r--arch/arm/plat-orion/gpio.c456
-rw-r--r--arch/arm/plat-orion/include/plat/gpio.h5
-rw-r--r--arch/arm/plat-orion/include/plat/time.h5
-rw-r--r--arch/arm/plat-orion/time.c119
-rw-r--r--arch/arm/plat-pxa/include/plat/i2c.h82
-rw-r--r--arch/arm/plat-pxa/mfp.c8
-rw-r--r--arch/arm/plat-s3c24xx/Kconfig7
-rw-r--r--arch/arm/plat-s3c24xx/cpu-freq.c2
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/udc.h4
-rw-r--r--arch/arm/plat-s3c24xx/sleep.S57
-rw-r--r--arch/arm/plat-s5p/Kconfig41
-rw-r--r--arch/arm/plat-s5p/Makefile5
-rw-r--r--arch/arm/plat-s5p/cpu.c25
-rw-r--r--arch/arm/plat-s5p/dev-csis0.c2
-rw-r--r--arch/arm/plat-s5p/dev-csis1.c2
-rw-r--r--arch/arm/plat-s5p/dev-fimc3.c43
-rw-r--r--arch/arm/plat-s5p/dev-uart.c12
-rw-r--r--arch/arm/plat-s5p/include/plat/camport.h28
-rw-r--r--arch/arm/plat-s5p/include/plat/csis.h28
-rw-r--r--arch/arm/plat-s5p/include/plat/exynos4.h34
-rw-r--r--arch/arm/plat-s5p/include/plat/mipi_csis.h43
-rw-r--r--arch/arm/plat-s5p/include/plat/s5p-time.h40
-rw-r--r--arch/arm/plat-s5p/include/plat/s5pv310.h34
-rw-r--r--arch/arm/plat-s5p/include/plat/sysmmu.h94
-rw-r--r--arch/arm/plat-s5p/irq-gpioint.c170
-rw-r--r--arch/arm/plat-s5p/s5p-time.c448
-rw-r--r--arch/arm/plat-s5p/setup-mipiphy.c63
-rw-r--r--arch/arm/plat-s5p/sysmmu.c370
-rw-r--r--arch/arm/plat-samsung/Kconfig13
-rw-r--r--arch/arm/plat-samsung/Makefile1
-rw-r--r--arch/arm/plat-samsung/dev-pwm.c53
-rw-r--r--arch/arm/plat-samsung/dev-ts.c1
-rw-r--r--arch/arm/plat-samsung/dev-uart.c2
-rw-r--r--arch/arm/plat-samsung/include/plat/cpu.h1
-rw-r--r--arch/arm/plat-samsung/include/plat/devs.h25
-rw-r--r--arch/arm/plat-samsung/include/plat/fimc-core.h5
-rw-r--r--arch/arm/plat-samsung/include/plat/gpio-cfg.h16
-rw-r--r--arch/arm/plat-samsung/include/plat/pd.h4
-rw-r--r--arch/arm/plat-samsung/include/plat/pm.h14
-rw-r--r--arch/arm/plat-samsung/include/plat/sdhci.h63
-rw-r--r--arch/arm/plat-samsung/pm.c16
-rw-r--r--arch/arm/plat-samsung/pwm.c33
-rw-r--r--arch/arm/plat-spear/Makefile4
-rw-r--r--arch/arm/plat-spear/clock.c844
-rw-r--r--arch/arm/plat-spear/include/plat/clock.h166
-rw-r--r--arch/arm/plat-spear/include/plat/debug-macro.S2
-rw-r--r--arch/arm/plat-spear/include/plat/hardware.h23
-rw-r--r--arch/arm/plat-spear/include/plat/memory.h2
-rw-r--r--arch/arm/plat-spear/include/plat/system.h4
-rw-r--r--arch/arm/plat-spear/include/plat/uncompress.h6
-rw-r--r--arch/arm/plat-spear/include/plat/vmalloc.h2
-rw-r--r--arch/arm/plat-spear/time.c26
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/memory.h2
-rw-r--r--arch/arm/plat-tcc/include/mach/memory.h2
-rw-r--r--arch/arm/plat-versatile/Kconfig17
-rw-r--r--arch/arm/plat-versatile/Makefile13
-rw-r--r--arch/arm/plat-versatile/clcd.c182
-rw-r--r--arch/arm/plat-versatile/fpga-irq.c72
-rw-r--r--arch/arm/plat-versatile/headsmp.S (renamed from arch/arm/mach-vexpress/headsmp.S)8
-rw-r--r--arch/arm/plat-versatile/include/plat/clcd.h9
-rw-r--r--arch/arm/plat-versatile/include/plat/fpga-irq.h12
-rw-r--r--arch/arm/plat-versatile/localtimer.c (renamed from arch/arm/mach-vexpress/localtimer.c)5
-rw-r--r--arch/arm/plat-versatile/platsmp.c104
-rw-r--r--arch/arm/tools/mach-types2494
-rw-r--r--arch/arm/vfp/Makefile4
-rw-r--r--arch/arm/vfp/vfpmodule.c9
1215 files changed, 53614 insertions, 25336 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 5cff165b7eb0..93d595a7477a 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -7,7 +7,7 @@ config ARM
7 select HAVE_MEMBLOCK 7 select HAVE_MEMBLOCK
8 select RTC_LIB 8 select RTC_LIB
9 select SYS_SUPPORTS_APM_EMULATION 9 select SYS_SUPPORTS_APM_EMULATION
10 select GENERIC_ATOMIC64 if (!CPU_32v6K || !AEABI) 10 select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI)
11 select HAVE_OPROFILE if (HAVE_PERF_EVENTS) 11 select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
12 select HAVE_ARCH_KGDB 12 select HAVE_ARCH_KGDB
13 select HAVE_KPROBES if (!XIP_KERNEL && !THUMB2_KERNEL) 13 select HAVE_KPROBES if (!XIP_KERNEL && !THUMB2_KERNEL)
@@ -24,7 +24,7 @@ config ARM
24 select HAVE_PERF_EVENTS 24 select HAVE_PERF_EVENTS
25 select PERF_USE_VMALLOC 25 select PERF_USE_VMALLOC
26 select HAVE_REGS_AND_STACK_ACCESS_API 26 select HAVE_REGS_AND_STACK_ACCESS_API
27 select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V7)) 27 select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
28 select HAVE_C_RECORDMCOUNT 28 select HAVE_C_RECORDMCOUNT
29 select HAVE_GENERIC_HARDIRQS 29 select HAVE_GENERIC_HARDIRQS
30 select HAVE_SPARSE_IRQ 30 select HAVE_SPARSE_IRQ
@@ -63,6 +63,10 @@ config GENERIC_CLOCKEVENTS_BROADCAST
63 depends on GENERIC_CLOCKEVENTS 63 depends on GENERIC_CLOCKEVENTS
64 default y if SMP 64 default y if SMP
65 65
66config KTIME_SCALAR
67 bool
68 default y
69
66config HAVE_TCM 70config HAVE_TCM
67 bool 71 bool
68 select GENERIC_ALLOCATOR 72 select GENERIC_ALLOCATOR
@@ -178,11 +182,6 @@ config FIQ
178config ARCH_MTD_XIP 182config ARCH_MTD_XIP
179 bool 183 bool
180 184
181config ARM_L1_CACHE_SHIFT_6
182 bool
183 help
184 Setting ARM L1 cache line size to 64 Bytes.
185
186config VECTORS_BASE 185config VECTORS_BASE
187 hex 186 hex
188 default 0xffff0000 if MMU || CPU_HIGH_VECTOR 187 default 0xffff0000 if MMU || CPU_HIGH_VECTOR
@@ -191,6 +190,22 @@ config VECTORS_BASE
191 help 190 help
192 The base address of exception vectors. 191 The base address of exception vectors.
193 192
193config ARM_PATCH_PHYS_VIRT
194 bool "Patch physical to virtual translations at runtime (EXPERIMENTAL)"
195 depends on EXPERIMENTAL
196 depends on !XIP_KERNEL && MMU
197 depends on !ARCH_REALVIEW || !SPARSEMEM
198 help
199 Patch phys-to-virt translation functions at runtime according to
200 the position of the kernel in system memory.
201
202 This can only be used with non-XIP with MMU kernels where
203 the base of physical memory is at a 16MB boundary.
204
205config ARM_PATCH_PHYS_VIRT_16BIT
206 def_bool y
207 depends on ARM_PATCH_PHYS_VIRT && ARCH_MSM
208
194source "init/Kconfig" 209source "init/Kconfig"
195 210
196source "kernel/Kconfig.freezer" 211source "kernel/Kconfig.freezer"
@@ -212,15 +227,6 @@ choice
212 prompt "ARM system type" 227 prompt "ARM system type"
213 default ARCH_VERSATILE 228 default ARCH_VERSATILE
214 229
215config ARCH_AAEC2000
216 bool "Agilent AAEC-2000 based"
217 select CPU_ARM920T
218 select ARM_AMBA
219 select HAVE_CLK
220 select ARCH_USES_GETTIMEOFFSET
221 help
222 This enables support for systems based on the Agilent AAEC-2000
223
224config ARCH_INTEGRATOR 230config ARCH_INTEGRATOR
225 bool "ARM Ltd. Integrator family" 231 bool "ARM Ltd. Integrator family"
226 select ARM_AMBA 232 select ARM_AMBA
@@ -229,6 +235,7 @@ config ARCH_INTEGRATOR
229 select ICST 235 select ICST
230 select GENERIC_CLOCKEVENTS 236 select GENERIC_CLOCKEVENTS
231 select PLAT_VERSATILE 237 select PLAT_VERSATILE
238 select PLAT_VERSATILE_FPGA_IRQ
232 help 239 help
233 Support for ARM's Integrator platform. 240 Support for ARM's Integrator platform.
234 241
@@ -236,11 +243,11 @@ config ARCH_REALVIEW
236 bool "ARM Ltd. RealView family" 243 bool "ARM Ltd. RealView family"
237 select ARM_AMBA 244 select ARM_AMBA
238 select CLKDEV_LOOKUP 245 select CLKDEV_LOOKUP
239 select HAVE_SCHED_CLOCK
240 select ICST 246 select ICST
241 select GENERIC_CLOCKEVENTS 247 select GENERIC_CLOCKEVENTS
242 select ARCH_WANT_OPTIONAL_GPIOLIB 248 select ARCH_WANT_OPTIONAL_GPIOLIB
243 select PLAT_VERSATILE 249 select PLAT_VERSATILE
250 select PLAT_VERSATILE_CLCD
244 select ARM_TIMER_SP804 251 select ARM_TIMER_SP804
245 select GPIO_PL061 if GPIOLIB 252 select GPIO_PL061 if GPIOLIB
246 help 253 help
@@ -251,11 +258,12 @@ config ARCH_VERSATILE
251 select ARM_AMBA 258 select ARM_AMBA
252 select ARM_VIC 259 select ARM_VIC
253 select CLKDEV_LOOKUP 260 select CLKDEV_LOOKUP
254 select HAVE_SCHED_CLOCK
255 select ICST 261 select ICST
256 select GENERIC_CLOCKEVENTS 262 select GENERIC_CLOCKEVENTS
257 select ARCH_WANT_OPTIONAL_GPIOLIB 263 select ARCH_WANT_OPTIONAL_GPIOLIB
258 select PLAT_VERSATILE 264 select PLAT_VERSATILE
265 select PLAT_VERSATILE_CLCD
266 select PLAT_VERSATILE_FPGA_IRQ
259 select ARM_TIMER_SP804 267 select ARM_TIMER_SP804
260 help 268 help
261 This enables support for ARM Ltd Versatile board. 269 This enables support for ARM Ltd Versatile board.
@@ -268,9 +276,10 @@ config ARCH_VEXPRESS
268 select CLKDEV_LOOKUP 276 select CLKDEV_LOOKUP
269 select GENERIC_CLOCKEVENTS 277 select GENERIC_CLOCKEVENTS
270 select HAVE_CLK 278 select HAVE_CLK
271 select HAVE_SCHED_CLOCK 279 select HAVE_PATA_PLATFORM
272 select ICST 280 select ICST
273 select PLAT_VERSATILE 281 select PLAT_VERSATILE
282 select PLAT_VERSATILE_CLCD
274 help 283 help
275 This enables support for the ARM Ltd Versatile Express boards. 284 This enables support for the ARM Ltd Versatile Express boards.
276 285
@@ -346,7 +355,7 @@ config ARCH_FOOTBRIDGE
346 bool "FootBridge" 355 bool "FootBridge"
347 select CPU_SA110 356 select CPU_SA110
348 select FOOTBRIDGE 357 select FOOTBRIDGE
349 select ARCH_USES_GETTIMEOFFSET 358 select GENERIC_CLOCKEVENTS
350 help 359 help
351 Support for systems based on the DC21285 companion chip 360 Support for systems based on the DC21285 companion chip
352 ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder. 361 ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder.
@@ -457,6 +466,7 @@ config ARCH_IXP4XX
457 466
458config ARCH_DOVE 467config ARCH_DOVE
459 bool "Marvell Dove" 468 bool "Marvell Dove"
469 select CPU_V6K
460 select PCI 470 select PCI
461 select ARCH_REQUIRE_GPIOLIB 471 select ARCH_REQUIRE_GPIOLIB
462 select GENERIC_CLOCKEVENTS 472 select GENERIC_CLOCKEVENTS
@@ -619,6 +629,7 @@ config ARCH_MSM
619 select HAVE_CLK 629 select HAVE_CLK
620 select GENERIC_CLOCKEVENTS 630 select GENERIC_CLOCKEVENTS
621 select ARCH_REQUIRE_GPIOLIB 631 select ARCH_REQUIRE_GPIOLIB
632 select CLKDEV_LOOKUP
622 help 633 help
623 Support for Qualcomm MSM/QSD based systems. This runs on the 634 Support for Qualcomm MSM/QSD based systems. This runs on the
624 apps processor of the MSM/QSD and depends on a shared memory 635 apps processor of the MSM/QSD and depends on a shared memory
@@ -715,7 +726,8 @@ config ARCH_S5P64X0
715 select GENERIC_GPIO 726 select GENERIC_GPIO
716 select HAVE_CLK 727 select HAVE_CLK
717 select HAVE_S3C2410_WATCHDOG if WATCHDOG 728 select HAVE_S3C2410_WATCHDOG if WATCHDOG
718 select ARCH_USES_GETTIMEOFFSET 729 select GENERIC_CLOCKEVENTS
730 select HAVE_SCHED_CLOCK
719 select HAVE_S3C2410_I2C if I2C 731 select HAVE_S3C2410_I2C if I2C
720 select HAVE_S3C_RTC if RTC_CLASS 732 select HAVE_S3C_RTC if RTC_CLASS
721 help 733 help
@@ -753,15 +765,16 @@ config ARCH_S5PV210
753 select HAVE_CLK 765 select HAVE_CLK
754 select ARM_L1_CACHE_SHIFT_6 766 select ARM_L1_CACHE_SHIFT_6
755 select ARCH_HAS_CPUFREQ 767 select ARCH_HAS_CPUFREQ
756 select ARCH_USES_GETTIMEOFFSET 768 select GENERIC_CLOCKEVENTS
769 select HAVE_SCHED_CLOCK
757 select HAVE_S3C2410_I2C if I2C 770 select HAVE_S3C2410_I2C if I2C
758 select HAVE_S3C_RTC if RTC_CLASS 771 select HAVE_S3C_RTC if RTC_CLASS
759 select HAVE_S3C2410_WATCHDOG if WATCHDOG 772 select HAVE_S3C2410_WATCHDOG if WATCHDOG
760 help 773 help
761 Samsung S5PV210/S5PC110 series based systems 774 Samsung S5PV210/S5PC110 series based systems
762 775
763config ARCH_S5PV310 776config ARCH_EXYNOS4
764 bool "Samsung S5PV310/S5PC210" 777 bool "Samsung EXYNOS4"
765 select CPU_V7 778 select CPU_V7
766 select ARCH_SPARSEMEM_ENABLE 779 select ARCH_SPARSEMEM_ENABLE
767 select GENERIC_GPIO 780 select GENERIC_GPIO
@@ -772,7 +785,7 @@ config ARCH_S5PV310
772 select HAVE_S3C2410_I2C if I2C 785 select HAVE_S3C2410_I2C if I2C
773 select HAVE_S3C2410_WATCHDOG if WATCHDOG 786 select HAVE_S3C2410_WATCHDOG if WATCHDOG
774 help 787 help
775 Samsung S5PV310 series based systems 788 Samsung EXYNOS4 series based systems
776 789
777config ARCH_SHARK 790config ARCH_SHARK
778 bool "Shark" 791 bool "Shark"
@@ -795,17 +808,6 @@ config ARCH_TCC_926
795 help 808 help
796 Support for Telechips TCC ARM926-based systems. 809 Support for Telechips TCC ARM926-based systems.
797 810
798config ARCH_LH7A40X
799 bool "Sharp LH7A40X"
800 select CPU_ARM922T
801 select ARCH_SPARSEMEM_ENABLE if !LH7A40X_CONTIGMEM
802 select ARCH_USES_GETTIMEOFFSET
803 help
804 Say Y here for systems based on one of the Sharp LH7A40X
805 System on a Chip processors. These CPUs include an ARM922T
806 core with a wide array of integrated devices for
807 hand-held and low-power applications.
808
809config ARCH_U300 811config ARCH_U300
810 bool "ST-Ericsson U300 Series" 812 bool "ST-Ericsson U300 Series"
811 depends on MMU 813 depends on MMU
@@ -875,6 +877,16 @@ config PLAT_SPEAR
875 help 877 help
876 Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx). 878 Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx).
877 879
880config ARCH_VT8500
881 bool "VIA/WonderMedia 85xx"
882 select CPU_ARM926T
883 select GENERIC_GPIO
884 select ARCH_HAS_CPUFREQ
885 select GENERIC_CLOCKEVENTS
886 select ARCH_REQUIRE_GPIOLIB
887 select HAVE_PWM
888 help
889 Support for VIA/WonderMedia VT8500/WM85xx System-on-Chip.
878endchoice 890endchoice
879 891
880# 892#
@@ -882,8 +894,6 @@ endchoice
882# Kconfigs may be included either alphabetically (according to the 894# Kconfigs may be included either alphabetically (according to the
883# plat- suffix) or along side the corresponding mach-* source. 895# plat- suffix) or along side the corresponding mach-* source.
884# 896#
885source "arch/arm/mach-aaec2000/Kconfig"
886
887source "arch/arm/mach-at91/Kconfig" 897source "arch/arm/mach-at91/Kconfig"
888 898
889source "arch/arm/mach-bcmring/Kconfig" 899source "arch/arm/mach-bcmring/Kconfig"
@@ -922,8 +932,6 @@ source "arch/arm/mach-kirkwood/Kconfig"
922 932
923source "arch/arm/mach-ks8695/Kconfig" 933source "arch/arm/mach-ks8695/Kconfig"
924 934
925source "arch/arm/mach-lh7a40x/Kconfig"
926
927source "arch/arm/mach-loki/Kconfig" 935source "arch/arm/mach-loki/Kconfig"
928 936
929source "arch/arm/mach-lpc32xx/Kconfig" 937source "arch/arm/mach-lpc32xx/Kconfig"
@@ -991,7 +999,7 @@ source "arch/arm/mach-s5pc100/Kconfig"
991 999
992source "arch/arm/mach-s5pv210/Kconfig" 1000source "arch/arm/mach-s5pv210/Kconfig"
993 1001
994source "arch/arm/mach-s5pv310/Kconfig" 1002source "arch/arm/mach-exynos4/Kconfig"
995 1003
996source "arch/arm/mach-shmobile/Kconfig" 1004source "arch/arm/mach-shmobile/Kconfig"
997 1005
@@ -1006,6 +1014,9 @@ source "arch/arm/mach-ux500/Kconfig"
1006source "arch/arm/mach-versatile/Kconfig" 1014source "arch/arm/mach-versatile/Kconfig"
1007 1015
1008source "arch/arm/mach-vexpress/Kconfig" 1016source "arch/arm/mach-vexpress/Kconfig"
1017source "arch/arm/plat-versatile/Kconfig"
1018
1019source "arch/arm/mach-vt8500/Kconfig"
1009 1020
1010source "arch/arm/mach-w90x900/Kconfig" 1021source "arch/arm/mach-w90x900/Kconfig"
1011 1022
@@ -1048,7 +1059,7 @@ config XSCALE_PMU
1048 default y 1059 default y
1049 1060
1050config CPU_HAS_PMU 1061config CPU_HAS_PMU
1051 depends on (CPU_V6 || CPU_V7 || XSCALE_PMU) && \ 1062 depends on (CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU) && \
1052 (!ARCH_OMAP3 || OMAP3_EMU) 1063 (!ARCH_OMAP3 || OMAP3_EMU)
1053 default y 1064 default y
1054 bool 1065 bool
@@ -1064,7 +1075,7 @@ endif
1064 1075
1065config ARM_ERRATA_411920 1076config ARM_ERRATA_411920
1066 bool "ARM errata: Invalidation of the Instruction Cache operation can fail" 1077 bool "ARM errata: Invalidation of the Instruction Cache operation can fail"
1067 depends on CPU_V6 1078 depends on CPU_V6 || CPU_V6K
1068 help 1079 help
1069 Invalidation of the Instruction Cache operation can 1080 Invalidation of the Instruction Cache operation can
1070 fail. This erratum is present in 1136 (before r1p4), 1156 and 1176. 1081 fail. This erratum is present in 1136 (before r1p4), 1156 and 1176.
@@ -1140,7 +1151,7 @@ config ARM_ERRATA_742231
1140 1151
1141config PL310_ERRATA_588369 1152config PL310_ERRATA_588369
1142 bool "Clean & Invalidate maintenance operations do not invalidate clean lines" 1153 bool "Clean & Invalidate maintenance operations do not invalidate clean lines"
1143 depends on CACHE_L2X0 && ARCH_OMAP4 1154 depends on CACHE_L2X0
1144 help 1155 help
1145 The PL310 L2 cache controller implements three types of Clean & 1156 The PL310 L2 cache controller implements three types of Clean &
1146 Invalidate maintenance operations: by Physical Address 1157 Invalidate maintenance operations: by Physical Address
@@ -1149,8 +1160,7 @@ config PL310_ERRATA_588369
1149 clean operation followed immediately by an invalidate operation, 1160 clean operation followed immediately by an invalidate operation,
1150 both performing to the same memory location. This functionality 1161 both performing to the same memory location. This functionality
1151 is not correctly implemented in PL310 as clean lines are not 1162 is not correctly implemented in PL310 as clean lines are not
1152 invalidated as a result of these operations. Note that this errata 1163 invalidated as a result of these operations.
1153 uses Texas Instrument's secure monitor api.
1154 1164
1155config ARM_ERRATA_720789 1165config ARM_ERRATA_720789
1156 bool "ARM errata: TLBIASIDIS and TLBIMVAIS operations can broadcast a faulty ASID" 1166 bool "ARM errata: TLBIASIDIS and TLBIMVAIS operations can broadcast a faulty ASID"
@@ -1164,6 +1174,17 @@ config ARM_ERRATA_720789
1164 tables. The workaround changes the TLB flushing routines to invalidate 1174 tables. The workaround changes the TLB flushing routines to invalidate
1165 entries regardless of the ASID. 1175 entries regardless of the ASID.
1166 1176
1177config PL310_ERRATA_727915
1178 bool "Background Clean & Invalidate by Way operation can cause data corruption"
1179 depends on CACHE_L2X0
1180 help
1181 PL310 implements the Clean & Invalidate by Way L2 cache maintenance
1182 operation (offset 0x7FC). This operation runs in background so that
1183 PL310 can handle normal accesses while it is in progress. Under very
1184 rare circumstances, due to this erratum, write data can be lost when
1185 PL310 treats a cacheable write transaction during a Clean &
1186 Invalidate by Way operation.
1187
1167config ARM_ERRATA_743622 1188config ARM_ERRATA_743622
1168 bool "ARM errata: Faulty hazard checking in the Store Buffer may lead to data corruption" 1189 bool "ARM errata: Faulty hazard checking in the Store Buffer may lead to data corruption"
1169 depends on CPU_V7 1190 depends on CPU_V7
@@ -1177,6 +1198,53 @@ config ARM_ERRATA_743622
1177 visible impact on the overall performance or power consumption of the 1198 visible impact on the overall performance or power consumption of the
1178 processor. 1199 processor.
1179 1200
1201config ARM_ERRATA_751472
1202 bool "ARM errata: Interrupted ICIALLUIS may prevent completion of broadcasted operation"
1203 depends on CPU_V7 && SMP
1204 help
1205 This option enables the workaround for the 751472 Cortex-A9 (prior
1206 to r3p0) erratum. An interrupted ICIALLUIS operation may prevent the
1207 completion of a following broadcasted operation if the second
1208 operation is received by a CPU before the ICIALLUIS has completed,
1209 potentially leading to corrupted entries in the cache or TLB.
1210
1211config ARM_ERRATA_753970
1212 bool "ARM errata: cache sync operation may be faulty"
1213 depends on CACHE_PL310
1214 help
1215 This option enables the workaround for the 753970 PL310 (r3p0) erratum.
1216
1217 Under some condition the effect of cache sync operation on
1218 the store buffer still remains when the operation completes.
1219 This means that the store buffer is always asked to drain and
1220 this prevents it from merging any further writes. The workaround
1221 is to replace the normal offset of cache sync operation (0x730)
1222 by another offset targeting an unmapped PL310 register 0x740.
1223 This has the same effect as the cache sync operation: store buffer
1224 drain and waiting for all buffers empty.
1225
1226config ARM_ERRATA_754322
1227 bool "ARM errata: possible faulty MMU translations following an ASID switch"
1228 depends on CPU_V7
1229 help
1230 This option enables the workaround for the 754322 Cortex-A9 (r2p*,
1231 r3p*) erratum. A speculative memory access may cause a page table walk
1232 which starts prior to an ASID switch but completes afterwards. This
1233 can populate the micro-TLB with a stale entry which may be hit with
1234 the new ASID. This workaround places two dsb instructions in the mm
1235 switching code so that no page table walks can cross the ASID switch.
1236
1237config ARM_ERRATA_754327
1238 bool "ARM errata: no automatic Store Buffer drain"
1239 depends on CPU_V7 && SMP
1240 help
1241 This option enables the workaround for the 754327 Cortex-A9 (prior to
1242 r2p0) erratum. The Store Buffer does not have any automatic draining
1243 mechanism and therefore a livelock may occur if an external agent
1244 continuously polls a memory location waiting to observe an update.
1245 This workaround defines cpu_relax() as smp_mb(), preventing correctly
1246 written polling loops from denying visibility of updates to memory.
1247
1180endmenu 1248endmenu
1181 1249
1182source "arch/arm/common/Kconfig" 1250source "arch/arm/common/Kconfig"
@@ -1250,10 +1318,11 @@ source "kernel/time/Kconfig"
1250config SMP 1318config SMP
1251 bool "Symmetric Multi-Processing (EXPERIMENTAL)" 1319 bool "Symmetric Multi-Processing (EXPERIMENTAL)"
1252 depends on EXPERIMENTAL 1320 depends on EXPERIMENTAL
1321 depends on CPU_V6K || CPU_V7
1253 depends on GENERIC_CLOCKEVENTS 1322 depends on GENERIC_CLOCKEVENTS
1254 depends on REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP || \ 1323 depends on REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP || \
1255 MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || \ 1324 MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || \
1256 ARCH_S5PV310 || ARCH_TEGRA || ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || \ 1325 ARCH_EXYNOS4 || ARCH_TEGRA || ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || \
1257 ARCH_MSM_SCORPIONMP || ARCH_SHMOBILE 1326 ARCH_MSM_SCORPIONMP || ARCH_SHMOBILE
1258 select USE_GENERIC_SMP_HELPERS 1327 select USE_GENERIC_SMP_HELPERS
1259 select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP 1328 select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP
@@ -1341,7 +1410,7 @@ config LOCAL_TIMERS
1341 bool "Use local timer interrupts" 1410 bool "Use local timer interrupts"
1342 depends on SMP 1411 depends on SMP
1343 default y 1412 default y
1344 select HAVE_ARM_TWD if !ARCH_MSM_SCORPIONMP 1413 select HAVE_ARM_TWD if (!ARCH_MSM_SCORPIONMP && !EXYNOS4_MCT)
1345 help 1414 help
1346 Enable support for local timers on SMP platforms, rather then the 1415 Enable support for local timers on SMP platforms, rather then the
1347 legacy IPI broadcast method. Local timers allows the system 1416 legacy IPI broadcast method. Local timers allows the system
@@ -1353,7 +1422,7 @@ source kernel/Kconfig.preempt
1353config HZ 1422config HZ
1354 int 1423 int
1355 default 200 if ARCH_EBSA110 || ARCH_S3C2410 || ARCH_S5P64X0 || \ 1424 default 200 if ARCH_EBSA110 || ARCH_S3C2410 || ARCH_S5P64X0 || \
1356 ARCH_S5P6442 || ARCH_S5PV210 || ARCH_S5PV310 1425 ARCH_S5P6442 || ARCH_S5PV210 || ARCH_EXYNOS4
1357 default OMAP_32K_TIMER_HZ if ARCH_OMAP && OMAP_32K_TIMER 1426 default OMAP_32K_TIMER_HZ if ARCH_OMAP && OMAP_32K_TIMER
1358 default AT91_TIMER_HZ if ARCH_AT91 1427 default AT91_TIMER_HZ if ARCH_AT91
1359 default SHMOBILE_TIMER_HZ if ARCH_SHMOBILE 1428 default SHMOBILE_TIMER_HZ if ARCH_SHMOBILE
@@ -1361,7 +1430,7 @@ config HZ
1361 1430
1362config THUMB2_KERNEL 1431config THUMB2_KERNEL
1363 bool "Compile the kernel in Thumb-2 mode (EXPERIMENTAL)" 1432 bool "Compile the kernel in Thumb-2 mode (EXPERIMENTAL)"
1364 depends on CPU_V7 && !CPU_V6 && EXPERIMENTAL 1433 depends on CPU_V7 && !CPU_V6 && !CPU_V6K && EXPERIMENTAL
1365 select AEABI 1434 select AEABI
1366 select ARM_ASM_UNIFIED 1435 select ARM_ASM_UNIFIED
1367 help 1436 help
@@ -1371,6 +1440,37 @@ config THUMB2_KERNEL
1371 1440
1372 If unsure, say N. 1441 If unsure, say N.
1373 1442
1443config THUMB2_AVOID_R_ARM_THM_JUMP11
1444 bool "Work around buggy Thumb-2 short branch relocations in gas"
1445 depends on THUMB2_KERNEL && MODULES
1446 default y
1447 help
1448 Various binutils versions can resolve Thumb-2 branches to
1449 locally-defined, preemptible global symbols as short-range "b.n"
1450 branch instructions.
1451
1452 This is a problem, because there's no guarantee the final
1453 destination of the symbol, or any candidate locations for a
1454 trampoline, are within range of the branch. For this reason, the
1455 kernel does not support fixing up the R_ARM_THM_JUMP11 (102)
1456 relocation in modules at all, and it makes little sense to add
1457 support.
1458
1459 The symptom is that the kernel fails with an "unsupported
1460 relocation" error when loading some modules.
1461
1462 Until fixed tools are available, passing
1463 -fno-optimize-sibling-calls to gcc should prevent gcc generating
1464 code which hits this problem, at the cost of a bit of extra runtime
1465 stack usage in some cases.
1466
1467 The problem is described in more detail at:
1468 https://bugs.launchpad.net/binutils-linaro/+bug/725126
1469
1470 Only Thumb-2 kernels are affected.
1471
1472 Unless you are sure your tools don't have this problem, say Y.
1473
1374config ARM_ASM_UNIFIED 1474config ARM_ASM_UNIFIED
1375 bool 1475 bool
1376 1476
@@ -1391,7 +1491,7 @@ config AEABI
1391 1491
1392config OABI_COMPAT 1492config OABI_COMPAT
1393 bool "Allow old ABI binaries to run with this kernel (EXPERIMENTAL)" 1493 bool "Allow old ABI binaries to run with this kernel (EXPERIMENTAL)"
1394 depends on AEABI && EXPERIMENTAL 1494 depends on AEABI && EXPERIMENTAL && !THUMB2_KERNEL
1395 default y 1495 default y
1396 help 1496 help
1397 This option preserves the old syscall interface along with the 1497 This option preserves the old syscall interface along with the
@@ -1619,6 +1719,18 @@ config ZBOOT_ROM
1619 Say Y here if you intend to execute your compressed kernel image 1719 Say Y here if you intend to execute your compressed kernel image
1620 (zImage) directly from ROM or flash. If unsure, say N. 1720 (zImage) directly from ROM or flash. If unsure, say N.
1621 1721
1722config ZBOOT_ROM_MMCIF
1723 bool "Include MMCIF loader in zImage (EXPERIMENTAL)"
1724 depends on ZBOOT_ROM && ARCH_SH7372 && EXPERIMENTAL
1725 help
1726 Say Y here to include experimental MMCIF loading code in the
1727 ROM-able zImage. With this enabled it is possible to write the
1728 the ROM-able zImage kernel image to an MMC card and boot the
1729 kernel straight from the reset vector. At reset the processor
1730 Mask ROM will load the first part of the the ROM-able zImage
1731 which in turn loads the rest the kernel image to RAM using the
1732 MMCIF hardware block.
1733
1622config CMDLINE 1734config CMDLINE
1623 string "Default kernel command string" 1735 string "Default kernel command string"
1624 default "" 1736 default ""
@@ -1852,7 +1964,7 @@ config FPE_FASTFPE
1852 1964
1853config VFP 1965config VFP
1854 bool "VFP-format floating point maths" 1966 bool "VFP-format floating point maths"
1855 depends on CPU_V6 || CPU_ARM926T || CPU_V7 || CPU_FEROCEON 1967 depends on CPU_V6 || CPU_V6K || CPU_ARM926T || CPU_V7 || CPU_FEROCEON
1856 help 1968 help
1857 Say Y to include VFP support code in the kernel. This is needed 1969 Say Y to include VFP support code in the kernel. This is needed
1858 if your hardware includes a VFP unit. 1970 if your hardware includes a VFP unit.
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index c22c1adfedd6..c7d321a3d95d 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -15,7 +15,7 @@ ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
15LDFLAGS_vmlinux += --be8 15LDFLAGS_vmlinux += --be8
16endif 16endif
17 17
18OBJCOPYFLAGS :=-O binary -R .note -R .note.gnu.build-id -R .comment -S 18OBJCOPYFLAGS :=-O binary -R .comment -S
19GZFLAGS :=-9 19GZFLAGS :=-9
20#KBUILD_CFLAGS +=-pipe 20#KBUILD_CFLAGS +=-pipe
21# Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb: 21# Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
@@ -89,6 +89,7 @@ tune-$(CONFIG_CPU_XSCALE) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110)
89tune-$(CONFIG_CPU_XSC3) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale 89tune-$(CONFIG_CPU_XSC3) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale
90tune-$(CONFIG_CPU_FEROCEON) :=$(call cc-option,-mtune=marvell-f,-mtune=xscale) 90tune-$(CONFIG_CPU_FEROCEON) :=$(call cc-option,-mtune=marvell-f,-mtune=xscale)
91tune-$(CONFIG_CPU_V6) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm) 91tune-$(CONFIG_CPU_V6) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
92tune-$(CONFIG_CPU_V6K) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
92 93
93ifeq ($(CONFIG_AEABI),y) 94ifeq ($(CONFIG_AEABI),y)
94CFLAGS_ABI :=-mabi=aapcs-linux -mno-thumb-interwork 95CFLAGS_ABI :=-mabi=aapcs-linux -mno-thumb-interwork
@@ -105,6 +106,10 @@ AFLAGS_AUTOIT :=$(call as-option,-Wa$(comma)-mimplicit-it=always,-Wa$(comma)-mau
105AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W) 106AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)
106CFLAGS_THUMB2 :=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN) 107CFLAGS_THUMB2 :=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN)
107AFLAGS_THUMB2 :=$(CFLAGS_THUMB2) -Wa$(comma)-mthumb 108AFLAGS_THUMB2 :=$(CFLAGS_THUMB2) -Wa$(comma)-mthumb
109# Work around buggy relocation from gas if requested:
110ifeq ($(CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11),y)
111CFLAGS_MODULE +=-fno-optimize-sibling-calls
112endif
108endif 113endif
109 114
110# Need -Uarm for gcc < 3.x 115# Need -Uarm for gcc < 3.x
@@ -126,7 +131,6 @@ endif
126 131
127# Machine directory name. This list is sorted alphanumerically 132# Machine directory name. This list is sorted alphanumerically
128# by CONFIG_* macro name. 133# by CONFIG_* macro name.
129machine-$(CONFIG_ARCH_AAEC2000) := aaec2000
130machine-$(CONFIG_ARCH_AT91) := at91 134machine-$(CONFIG_ARCH_AT91) := at91
131machine-$(CONFIG_ARCH_BCMRING) := bcmring 135machine-$(CONFIG_ARCH_BCMRING) := bcmring
132machine-$(CONFIG_ARCH_CLPS711X) := clps711x 136machine-$(CONFIG_ARCH_CLPS711X) := clps711x
@@ -146,7 +150,6 @@ machine-$(CONFIG_ARCH_IXP23XX) := ixp23xx
146machine-$(CONFIG_ARCH_IXP4XX) := ixp4xx 150machine-$(CONFIG_ARCH_IXP4XX) := ixp4xx
147machine-$(CONFIG_ARCH_KIRKWOOD) := kirkwood 151machine-$(CONFIG_ARCH_KIRKWOOD) := kirkwood
148machine-$(CONFIG_ARCH_KS8695) := ks8695 152machine-$(CONFIG_ARCH_KS8695) := ks8695
149machine-$(CONFIG_ARCH_LH7A40X) := lh7a40x
150machine-$(CONFIG_ARCH_LOKI) := loki 153machine-$(CONFIG_ARCH_LOKI) := loki
151machine-$(CONFIG_ARCH_LPC32XX) := lpc32xx 154machine-$(CONFIG_ARCH_LPC32XX) := lpc32xx
152machine-$(CONFIG_ARCH_MMP) := mmp 155machine-$(CONFIG_ARCH_MMP) := mmp
@@ -178,7 +181,7 @@ machine-$(CONFIG_ARCH_S5P64X0) := s5p64x0
178machine-$(CONFIG_ARCH_S5P6442) := s5p6442 181machine-$(CONFIG_ARCH_S5P6442) := s5p6442
179machine-$(CONFIG_ARCH_S5PC100) := s5pc100 182machine-$(CONFIG_ARCH_S5PC100) := s5pc100
180machine-$(CONFIG_ARCH_S5PV210) := s5pv210 183machine-$(CONFIG_ARCH_S5PV210) := s5pv210
181machine-$(CONFIG_ARCH_S5PV310) := s5pv310 184machine-$(CONFIG_ARCH_EXYNOS4) := exynos4
182machine-$(CONFIG_ARCH_SA1100) := sa1100 185machine-$(CONFIG_ARCH_SA1100) := sa1100
183machine-$(CONFIG_ARCH_SHARK) := shark 186machine-$(CONFIG_ARCH_SHARK) := shark
184machine-$(CONFIG_ARCH_SHMOBILE) := shmobile 187machine-$(CONFIG_ARCH_SHMOBILE) := shmobile
@@ -190,6 +193,7 @@ machine-$(CONFIG_ARCH_U300) := u300
190machine-$(CONFIG_ARCH_U8500) := ux500 193machine-$(CONFIG_ARCH_U8500) := ux500
191machine-$(CONFIG_ARCH_VERSATILE) := versatile 194machine-$(CONFIG_ARCH_VERSATILE) := versatile
192machine-$(CONFIG_ARCH_VEXPRESS) := vexpress 195machine-$(CONFIG_ARCH_VEXPRESS) := vexpress
196machine-$(CONFIG_ARCH_VT8500) := vt8500
193machine-$(CONFIG_ARCH_W90X900) := w90x900 197machine-$(CONFIG_ARCH_W90X900) := w90x900
194machine-$(CONFIG_ARCH_NUC93X) := nuc93x 198machine-$(CONFIG_ARCH_NUC93X) := nuc93x
195machine-$(CONFIG_FOOTBRIDGE) := footbridge 199machine-$(CONFIG_FOOTBRIDGE) := footbridge
@@ -280,7 +284,7 @@ bzImage: zImage
280zImage Image xipImage bootpImage uImage: vmlinux 284zImage Image xipImage bootpImage uImage: vmlinux
281 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ 285 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
282 286
283zinstall install: vmlinux 287zinstall uinstall install: vmlinux
284 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ 288 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
285 289
286# We use MRPROPER_FILES and CLEAN_FILES now 290# We use MRPROPER_FILES and CLEAN_FILES now
@@ -301,6 +305,7 @@ define archhelp
301 echo ' (supply initrd image via make variable INITRD=<path>)' 305 echo ' (supply initrd image via make variable INITRD=<path>)'
302 echo ' install - Install uncompressed kernel' 306 echo ' install - Install uncompressed kernel'
303 echo ' zinstall - Install compressed kernel' 307 echo ' zinstall - Install compressed kernel'
308 echo ' uinstall - Install U-Boot wrapped compressed kernel'
304 echo ' Install using (your) ~/bin/$(INSTALLKERNEL) or' 309 echo ' Install using (your) ~/bin/$(INSTALLKERNEL) or'
305 echo ' (distribution) /sbin/$(INSTALLKERNEL) or' 310 echo ' (distribution) /sbin/$(INSTALLKERNEL) or'
306 echo ' install to $$(INSTALL_PATH) and run lilo' 311 echo ' install to $$(INSTALL_PATH) and run lilo'
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index 4d26f2c52a75..9128fddf1109 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -99,6 +99,10 @@ zinstall: $(obj)/zImage
99 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ 99 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
100 $(obj)/zImage System.map "$(INSTALL_PATH)" 100 $(obj)/zImage System.map "$(INSTALL_PATH)"
101 101
102uinstall: $(obj)/uImage
103 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
104 $(obj)/uImage System.map "$(INSTALL_PATH)"
105
102zi: 106zi:
103 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ 107 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
104 $(obj)/zImage System.map "$(INSTALL_PATH)" 108 $(obj)/zImage System.map "$(INSTALL_PATH)"
diff --git a/arch/arm/boot/compressed/.gitignore b/arch/arm/boot/compressed/.gitignore
index ab204db594d3..c6028967d336 100644
--- a/arch/arm/boot/compressed/.gitignore
+++ b/arch/arm/boot/compressed/.gitignore
@@ -1,3 +1,7 @@
1font.c 1font.c
2piggy.gz 2lib1funcs.S
3piggy.gzip
4piggy.lzo
5piggy.lzma
6vmlinux
3vmlinux.lds 7vmlinux.lds
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 0a8f748e506a..8ebbb511c783 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -4,9 +4,20 @@
4# create a compressed vmlinuz image from the original vmlinux 4# create a compressed vmlinuz image from the original vmlinux
5# 5#
6 6
7OBJS =
8
9# Ensure that mmcif loader code appears early in the image
10# to minimise that number of bocks that have to be read in
11# order to load it.
12ifeq ($(CONFIG_ZBOOT_ROM_MMCIF),y)
13ifeq ($(CONFIG_ARCH_SH7372),y)
14OBJS += mmcif-sh7372.o
15endif
16endif
17
7AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET) 18AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET)
8HEAD = head.o 19HEAD = head.o
9OBJS = misc.o decompress.o 20OBJS += misc.o decompress.o
10FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c 21FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c
11 22
12# 23#
@@ -29,6 +40,10 @@ ifeq ($(CONFIG_ARCH_SA1100),y)
29OBJS += head-sa1100.o 40OBJS += head-sa1100.o
30endif 41endif
31 42
43ifeq ($(CONFIG_ARCH_VT8500),y)
44OBJS += head-vt8500.o
45endif
46
32ifeq ($(CONFIG_CPU_XSCALE),y) 47ifeq ($(CONFIG_CPU_XSCALE),y)
33OBJS += head-xscale.o 48OBJS += head-xscale.o
34endif 49endif
@@ -80,12 +95,14 @@ ORIG_CFLAGS := $(KBUILD_CFLAGS)
80KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) 95KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
81endif 96endif
82 97
83EXTRA_CFLAGS := -fpic -fno-builtin 98ccflags-y := -fpic -fno-builtin
84EXTRA_AFLAGS := -Wa,-march=all 99asflags-y := -Wa,-march=all
85 100
101# Provide size of uncompressed kernel to the decompressor via a linker symbol.
102LDFLAGS_vmlinux = --defsym _image_size=$(shell stat -c "%s" $(obj)/../Image)
86# Supply ZRELADDR to the decompressor via a linker symbol. 103# Supply ZRELADDR to the decompressor via a linker symbol.
87ifneq ($(CONFIG_AUTO_ZRELADDR),y) 104ifneq ($(CONFIG_AUTO_ZRELADDR),y)
88LDFLAGS_vmlinux := --defsym zreladdr=$(ZRELADDR) 105LDFLAGS_vmlinux += --defsym zreladdr=$(ZRELADDR)
89endif 106endif
90ifeq ($(CONFIG_CPU_ENDIAN_BE8),y) 107ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
91LDFLAGS_vmlinux += --be8 108LDFLAGS_vmlinux += --be8
diff --git a/arch/arm/boot/compressed/head-shmobile.S b/arch/arm/boot/compressed/head-shmobile.S
index 30973b76e6ae..c943d2e7da9d 100644
--- a/arch/arm/boot/compressed/head-shmobile.S
+++ b/arch/arm/boot/compressed/head-shmobile.S
@@ -25,6 +25,36 @@
25 /* load board-specific initialization code */ 25 /* load board-specific initialization code */
26#include <mach/zboot.h> 26#include <mach/zboot.h>
27 27
28#ifdef CONFIG_ZBOOT_ROM_MMCIF
29 /* Load image from MMC */
30 adr sp, __tmp_stack + 128
31 ldr r0, __image_start
32 ldr r1, __image_end
33 subs r1, r1, r0
34 ldr r0, __load_base
35 bl mmcif_loader
36
37 /* Jump to loaded code */
38 ldr r0, __loaded
39 ldr r1, __image_start
40 sub r0, r0, r1
41 ldr r1, __load_base
42 add pc, r0, r1
43
44__image_start:
45 .long _start
46__image_end:
47 .long _got_end
48__load_base:
49 .long CONFIG_MEMORY_START + 0x02000000 @ Load at 32Mb into SDRAM
50__loaded:
51 .long __continue
52 .align
53__tmp_stack:
54 .space 128
55__continue:
56#endif /* CONFIG_ZBOOT_ROM_MMCIF */
57
28 b 1f 58 b 1f
29__atags:@ tag #1 59__atags:@ tag #1
30 .long 12 @ tag->hdr.size = tag_size(tag_core); 60 .long 12 @ tag->hdr.size = tag_size(tag_core);
diff --git a/arch/arm/boot/compressed/head-vt8500.S b/arch/arm/boot/compressed/head-vt8500.S
new file mode 100644
index 000000000000..1dc1e21a3be3
--- /dev/null
+++ b/arch/arm/boot/compressed/head-vt8500.S
@@ -0,0 +1,46 @@
1/*
2 * linux/arch/arm/boot/compressed/head-vt8500.S
3 *
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 *
6 * VIA VT8500 specific tweaks. This is merged into head.S by the linker.
7 *
8 */
9
10#include <linux/linkage.h>
11#include <asm/mach-types.h>
12
13 .section ".start", "ax"
14
15__VT8500_start:
16 @ Compare the SCC ID register against a list of known values
17 ldr r1, .SCCID
18 ldr r3, [r1]
19
20 @ VT8500 override
21 ldr r4, .VT8500SCC
22 cmp r3, r4
23 ldreq r7, .ID_BV07
24 beq .Lendvt8500
25
26 @ WM8505 override
27 ldr r4, .WM8505SCC
28 cmp r3, r4
29 ldreq r7, .ID_8505
30 beq .Lendvt8500
31
32 @ Otherwise, leave the bootloader's machine id untouched
33
34.SCCID:
35 .word 0xd8120000
36.VT8500SCC:
37 .word 0x34000102
38.WM8505SCC:
39 .word 0x34260103
40
41.ID_BV07:
42 .word MACH_TYPE_BV07
43.ID_8505:
44 .word MACH_TYPE_WM8505_7IN_NETBOOK
45
46.Lendvt8500:
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 7193884ed8b0..84ac4d656310 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -21,7 +21,7 @@
21 21
22#if defined(CONFIG_DEBUG_ICEDCC) 22#if defined(CONFIG_DEBUG_ICEDCC)
23 23
24#ifdef CONFIG_CPU_V6 24#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
25 .macro loadsp, rb, tmp 25 .macro loadsp, rb, tmp
26 .endm 26 .endm
27 .macro writeb, ch, rb 27 .macro writeb, ch, rb
@@ -128,14 +128,14 @@ wait: mrc p14, 0, pc, c0, c1, 0
128 .arm @ Always enter in ARM state 128 .arm @ Always enter in ARM state
129start: 129start:
130 .type start,#function 130 .type start,#function
131 THUMB( adr r12, BSYM(1f) ) 131 .rept 7
132 THUMB( bx r12 )
133 THUMB( .rept 6 )
134 ARM( .rept 8 )
135 mov r0, r0 132 mov r0, r0
136 .endr 133 .endr
134 ARM( mov r0, r0 )
135 ARM( b 1f )
136 THUMB( adr r12, BSYM(1f) )
137 THUMB( bx r12 )
137 138
138 b 1f
139 .word 0x016f2818 @ Magic numbers to help the loader 139 .word 0x016f2818 @ Magic numbers to help the loader
140 .word start @ absolute load/run zImage address 140 .word start @ absolute load/run zImage address
141 .word _edata @ zImage end address 141 .word _edata @ zImage end address
@@ -174,9 +174,7 @@ not_angel:
174 */ 174 */
175 175
176 .text 176 .text
177 adr r0, LC0 177
178 ldmia r0, {r1, r2, r3, r5, r6, r11, ip}
179 ldr sp, [r0, #28]
180#ifdef CONFIG_AUTO_ZRELADDR 178#ifdef CONFIG_AUTO_ZRELADDR
181 @ determine final kernel image address 179 @ determine final kernel image address
182 mov r4, pc 180 mov r4, pc
@@ -185,35 +183,108 @@ not_angel:
185#else 183#else
186 ldr r4, =zreladdr 184 ldr r4, =zreladdr
187#endif 185#endif
188 subs r0, r0, r1 @ calculate the delta offset
189 186
190 @ if delta is zero, we are 187 bl cache_on
191 beq not_relocated @ running at the address we 188
192 @ were linked at. 189restart: adr r0, LC0
190 ldmia r0, {r1, r2, r3, r5, r6, r9, r11, r12}
191 ldr sp, [r0, #32]
192
193 /*
194 * We might be running at a different address. We need
195 * to fix up various pointers.
196 */
197 sub r0, r0, r1 @ calculate the delta offset
198 add r5, r5, r0 @ _start
199 add r6, r6, r0 @ _edata
193 200
201#ifndef CONFIG_ZBOOT_ROM
202 /* malloc space is above the relocated stack (64k max) */
203 add sp, sp, r0
204 add r10, sp, #0x10000
205#else
194 /* 206 /*
195 * We're running at a different address. We need to fix 207 * With ZBOOT_ROM the bss/stack is non relocatable,
196 * up various pointers: 208 * but someone could still run this code from RAM,
197 * r5 - zImage base address (_start) 209 * in which case our reference is _edata.
198 * r6 - size of decompressed image
199 * r11 - GOT start
200 * ip - GOT end
201 */ 210 */
202 add r5, r5, r0 211 mov r10, r6
212#endif
213
214/*
215 * Check to see if we will overwrite ourselves.
216 * r4 = final kernel address
217 * r5 = start of this image
218 * r9 = size of decompressed image
219 * r10 = end of this image, including bss/stack/malloc space if non XIP
220 * We basically want:
221 * r4 >= r10 -> OK
222 * r4 + image length <= r5 -> OK
223 */
224 cmp r4, r10
225 bhs wont_overwrite
226 add r10, r4, r9
227 cmp r10, r5
228 bls wont_overwrite
229
230/*
231 * Relocate ourselves past the end of the decompressed kernel.
232 * r5 = start of this image
233 * r6 = _edata
234 * r10 = end of the decompressed kernel
235 * Because we always copy ahead, we need to do it from the end and go
236 * backward in case the source and destination overlap.
237 */
238 /* Round up to next 256-byte boundary. */
239 add r10, r10, #256
240 bic r10, r10, #255
241
242 sub r9, r6, r5 @ size to copy
243 add r9, r9, #31 @ rounded up to a multiple
244 bic r9, r9, #31 @ ... of 32 bytes
245 add r6, r9, r5
246 add r9, r9, r10
247
2481: ldmdb r6!, {r0 - r3, r10 - r12, lr}
249 cmp r6, r5
250 stmdb r9!, {r0 - r3, r10 - r12, lr}
251 bhi 1b
252
253 /* Preserve offset to relocated code. */
254 sub r6, r9, r6
255
256 bl cache_clean_flush
257
258 adr r0, BSYM(restart)
259 add r0, r0, r6
260 mov pc, r0
261
262wont_overwrite:
263/*
264 * If delta is zero, we are running at the address we were linked at.
265 * r0 = delta
266 * r2 = BSS start
267 * r3 = BSS end
268 * r4 = kernel execution address
269 * r7 = architecture ID
270 * r8 = atags pointer
271 * r11 = GOT start
272 * r12 = GOT end
273 * sp = stack pointer
274 */
275 teq r0, #0
276 beq not_relocated
203 add r11, r11, r0 277 add r11, r11, r0
204 add ip, ip, r0 278 add r12, r12, r0
205 279
206#ifndef CONFIG_ZBOOT_ROM 280#ifndef CONFIG_ZBOOT_ROM
207 /* 281 /*
208 * If we're running fully PIC === CONFIG_ZBOOT_ROM = n, 282 * If we're running fully PIC === CONFIG_ZBOOT_ROM = n,
209 * we need to fix up pointers into the BSS region. 283 * we need to fix up pointers into the BSS region.
210 * r2 - BSS start 284 * Note that the stack pointer has already been fixed up.
211 * r3 - BSS end
212 * sp - stack pointer
213 */ 285 */
214 add r2, r2, r0 286 add r2, r2, r0
215 add r3, r3, r0 287 add r3, r3, r0
216 add sp, sp, r0
217 288
218 /* 289 /*
219 * Relocate all entries in the GOT table. 290 * Relocate all entries in the GOT table.
@@ -221,7 +292,7 @@ not_angel:
2211: ldr r1, [r11, #0] @ relocate entries in the GOT 2921: ldr r1, [r11, #0] @ relocate entries in the GOT
222 add r1, r1, r0 @ table. This fixes up the 293 add r1, r1, r0 @ table. This fixes up the
223 str r1, [r11], #4 @ C references. 294 str r1, [r11], #4 @ C references.
224 cmp r11, ip 295 cmp r11, r12
225 blo 1b 296 blo 1b
226#else 297#else
227 298
@@ -234,7 +305,7 @@ not_angel:
234 cmphs r3, r1 @ _end < entry 305 cmphs r3, r1 @ _end < entry
235 addlo r1, r1, r0 @ table. This fixes up the 306 addlo r1, r1, r0 @ table. This fixes up the
236 str r1, [r11], #4 @ C references. 307 str r1, [r11], #4 @ C references.
237 cmp r11, ip 308 cmp r11, r12
238 blo 1b 309 blo 1b
239#endif 310#endif
240 311
@@ -246,76 +317,24 @@ not_relocated: mov r0, #0
246 cmp r2, r3 317 cmp r2, r3
247 blo 1b 318 blo 1b
248 319
249 /*
250 * The C runtime environment should now be setup
251 * sufficiently. Turn the cache on, set up some
252 * pointers, and start decompressing.
253 */
254 bl cache_on
255
256 mov r1, sp @ malloc space above stack
257 add r2, sp, #0x10000 @ 64k max
258
259/* 320/*
260 * Check to see if we will overwrite ourselves. 321 * The C runtime environment should now be setup sufficiently.
261 * r4 = final kernel address 322 * Set up some pointers, and start decompressing.
262 * r5 = start of this image 323 * r4 = kernel execution address
263 * r6 = size of decompressed image 324 * r7 = architecture ID
264 * r2 = end of malloc space (and therefore this image) 325 * r8 = atags pointer
265 * We basically want:
266 * r4 >= r2 -> OK
267 * r4 + image length <= r5 -> OK
268 */ 326 */
269 cmp r4, r2 327 mov r0, r4
270 bhs wont_overwrite 328 mov r1, sp @ malloc space above stack
271 add r0, r4, r6 329 add r2, sp, #0x10000 @ 64k max
272 cmp r0, r5
273 bls wont_overwrite
274
275 mov r5, r2 @ decompress after malloc space
276 mov r0, r5
277 mov r3, r7 330 mov r3, r7
278 bl decompress_kernel 331 bl decompress_kernel
279
280 add r0, r0, #127 + 128 @ alignment + stack
281 bic r0, r0, #127 @ align the kernel length
282/*
283 * r0 = decompressed kernel length
284 * r1-r3 = unused
285 * r4 = kernel execution address
286 * r5 = decompressed kernel start
287 * r7 = architecture ID
288 * r8 = atags pointer
289 * r9-r12,r14 = corrupted
290 */
291 add r1, r5, r0 @ end of decompressed kernel
292 adr r2, reloc_start
293 ldr r3, LC1
294 add r3, r2, r3
2951: ldmia r2!, {r9 - r12, r14} @ copy relocation code
296 stmia r1!, {r9 - r12, r14}
297 ldmia r2!, {r9 - r12, r14}
298 stmia r1!, {r9 - r12, r14}
299 cmp r2, r3
300 blo 1b
301 mov sp, r1
302 add sp, sp, #128 @ relocate the stack
303
304 bl cache_clean_flush 332 bl cache_clean_flush
305 ARM( add pc, r5, r0 ) @ call relocation code 333 bl cache_off
306 THUMB( add r12, r5, r0 ) 334 mov r0, #0 @ must be zero
307 THUMB( mov pc, r12 ) @ call relocation code 335 mov r1, r7 @ restore architecture number
308 336 mov r2, r8 @ restore atags pointer
309/* 337 mov pc, r4 @ call kernel
310 * We're not in danger of overwriting ourselves. Do this the simple way.
311 *
312 * r4 = kernel execution address
313 * r7 = architecture ID
314 */
315wont_overwrite: mov r0, r4
316 mov r3, r7
317 bl decompress_kernel
318 b call_kernel
319 338
320 .align 2 339 .align 2
321 .type LC0, #object 340 .type LC0, #object
@@ -323,11 +342,11 @@ LC0: .word LC0 @ r1
323 .word __bss_start @ r2 342 .word __bss_start @ r2
324 .word _end @ r3 343 .word _end @ r3
325 .word _start @ r5 344 .word _start @ r5
326 .word _image_size @ r6 345 .word _edata @ r6
346 .word _image_size @ r9
327 .word _got_start @ r11 347 .word _got_start @ r11
328 .word _got_end @ ip 348 .word _got_end @ ip
329 .word user_stack_end @ sp 349 .word user_stack_end @ sp
330LC1: .word reloc_end - reloc_start
331 .size LC0, . - LC0 350 .size LC0, . - LC0
332 351
333#ifdef CONFIG_ARCH_RPC 352#ifdef CONFIG_ARCH_RPC
@@ -353,7 +372,7 @@ params: ldr r0, =0x10000100 @ params_phys for RPC
353 * On exit, 372 * On exit,
354 * r0, r1, r2, r3, r9, r10, r12 corrupted 373 * r0, r1, r2, r3, r9, r10, r12 corrupted
355 * This routine must preserve: 374 * This routine must preserve:
356 * r4, r5, r6, r7, r8 375 * r4, r7, r8
357 */ 376 */
358 .align 5 377 .align 5
359cache_on: mov r3, #8 @ cache_on function 378cache_on: mov r3, #8 @ cache_on function
@@ -551,43 +570,6 @@ __common_mmu_cache_on:
551#endif 570#endif
552 571
553/* 572/*
554 * All code following this line is relocatable. It is relocated by
555 * the above code to the end of the decompressed kernel image and
556 * executed there. During this time, we have no stacks.
557 *
558 * r0 = decompressed kernel length
559 * r1-r3 = unused
560 * r4 = kernel execution address
561 * r5 = decompressed kernel start
562 * r7 = architecture ID
563 * r8 = atags pointer
564 * r9-r12,r14 = corrupted
565 */
566 .align 5
567reloc_start: add r9, r5, r0
568 sub r9, r9, #128 @ do not copy the stack
569 debug_reloc_start
570 mov r1, r4
5711:
572 .rept 4
573 ldmia r5!, {r0, r2, r3, r10 - r12, r14} @ relocate kernel
574 stmia r1!, {r0, r2, r3, r10 - r12, r14}
575 .endr
576
577 cmp r5, r9
578 blo 1b
579 mov sp, r1
580 add sp, sp, #128 @ relocate the stack
581 debug_reloc_end
582
583call_kernel: bl cache_clean_flush
584 bl cache_off
585 mov r0, #0 @ must be zero
586 mov r1, r7 @ restore architecture number
587 mov r2, r8 @ restore atags pointer
588 mov pc, r4 @ call kernel
589
590/*
591 * Here follow the relocatable cache support functions for the 573 * Here follow the relocatable cache support functions for the
592 * various processors. This is a generic hook for locating an 574 * various processors. This is a generic hook for locating an
593 * entry and jumping to an instruction at the specified offset 575 * entry and jumping to an instruction at the specified offset
@@ -791,7 +773,7 @@ proc_types:
791 * On exit, 773 * On exit,
792 * r0, r1, r2, r3, r9, r12 corrupted 774 * r0, r1, r2, r3, r9, r12 corrupted
793 * This routine must preserve: 775 * This routine must preserve:
794 * r4, r6, r7 776 * r4, r7, r8
795 */ 777 */
796 .align 5 778 .align 5
797cache_off: mov r3, #12 @ cache_off function 779cache_off: mov r3, #12 @ cache_off function
@@ -866,7 +848,7 @@ __armv3_mmu_cache_off:
866 * On exit, 848 * On exit,
867 * r1, r2, r3, r9, r10, r11, r12 corrupted 849 * r1, r2, r3, r9, r10, r11, r12 corrupted
868 * This routine must preserve: 850 * This routine must preserve:
869 * r0, r4, r5, r6, r7 851 * r4, r6, r7, r8
870 */ 852 */
871 .align 5 853 .align 5
872cache_clean_flush: 854cache_clean_flush:
@@ -1088,7 +1070,6 @@ memdump: mov r12, r0
1088#endif 1070#endif
1089 1071
1090 .ltorg 1072 .ltorg
1091reloc_end:
1092 1073
1093 .align 1074 .align
1094 .section ".stack", "aw", %nobits 1075 .section ".stack", "aw", %nobits
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
index e653a6d3c8d9..4657e877bf8f 100644
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -36,7 +36,7 @@ extern void error(char *x);
36 36
37#ifdef CONFIG_DEBUG_ICEDCC 37#ifdef CONFIG_DEBUG_ICEDCC
38 38
39#ifdef CONFIG_CPU_V6 39#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
40 40
41static void icedcc_putc(int ch) 41static void icedcc_putc(int ch)
42{ 42{
diff --git a/arch/arm/boot/compressed/mmcif-sh7372.c b/arch/arm/boot/compressed/mmcif-sh7372.c
new file mode 100644
index 000000000000..7453c8337b83
--- /dev/null
+++ b/arch/arm/boot/compressed/mmcif-sh7372.c
@@ -0,0 +1,88 @@
1/*
2 * sh7372 MMCIF loader
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2010 Simon Horman
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11
12#include <linux/mmc/sh_mmcif.h>
13#include <linux/mmc/boot.h>
14#include <mach/mmc.h>
15
16#define MMCIF_BASE (void __iomem *)0xe6bd0000
17
18#define PORT84CR (void __iomem *)0xe6050054
19#define PORT85CR (void __iomem *)0xe6050055
20#define PORT86CR (void __iomem *)0xe6050056
21#define PORT87CR (void __iomem *)0xe6050057
22#define PORT88CR (void __iomem *)0xe6050058
23#define PORT89CR (void __iomem *)0xe6050059
24#define PORT90CR (void __iomem *)0xe605005a
25#define PORT91CR (void __iomem *)0xe605005b
26#define PORT92CR (void __iomem *)0xe605005c
27#define PORT99CR (void __iomem *)0xe6050063
28
29#define SMSTPCR3 (void __iomem *)0xe615013c
30
31/* SH7372 specific MMCIF loader
32 *
33 * loads the zImage from an MMC card starting from block 1.
34 *
35 * The image must be start with a vrl4 header and
36 * the zImage must start at offset 512 of the image. That is,
37 * at block 2 (=byte 1024) on the media
38 *
39 * Use the following line to write the vrl4 formated zImage
40 * to an MMC card
41 * # dd if=vrl4.out of=/dev/sdx bs=512 seek=1
42 */
43asmlinkage void mmcif_loader(unsigned char *buf, unsigned long len)
44{
45 mmc_init_progress();
46 mmc_update_progress(MMC_PROGRESS_ENTER);
47
48 /* Initialise MMC
49 * registers: PORT84CR-PORT92CR
50 * (MMCD0_0-MMCD0_7,MMCCMD0 Control)
51 * value: 0x04 - select function 4
52 */
53 __raw_writeb(0x04, PORT84CR);
54 __raw_writeb(0x04, PORT85CR);
55 __raw_writeb(0x04, PORT86CR);
56 __raw_writeb(0x04, PORT87CR);
57 __raw_writeb(0x04, PORT88CR);
58 __raw_writeb(0x04, PORT89CR);
59 __raw_writeb(0x04, PORT90CR);
60 __raw_writeb(0x04, PORT91CR);
61 __raw_writeb(0x04, PORT92CR);
62
63 /* Initialise MMC
64 * registers: PORT99CR (MMCCLK0 Control)
65 * value: 0x10 | 0x04 - enable output | select function 4
66 */
67 __raw_writeb(0x14, PORT99CR);
68
69 /* Enable clock to MMC hardware block */
70 __raw_writel(__raw_readl(SMSTPCR3) & ~(1 << 12), SMSTPCR3);
71
72 mmc_update_progress(MMC_PROGRESS_INIT);
73
74 /* setup MMCIF hardware */
75 sh_mmcif_boot_init(MMCIF_BASE);
76
77 mmc_update_progress(MMC_PROGRESS_LOAD);
78
79 /* load kernel via MMCIF interface */
80 sh_mmcif_boot_do_read(MMCIF_BASE, 2, /* Kernel is at block 2 */
81 (len + SH_MMCIF_BBS - 1) / SH_MMCIF_BBS, buf);
82
83
84 /* Disable clock to MMC hardware block */
85 __raw_writel(__raw_readl(SMSTPCR3) & (1 << 12), SMSTPCR3);
86
87 mmc_update_progress(MMC_PROGRESS_DONE);
88}
diff --git a/arch/arm/boot/compressed/vmlinux.lds.in b/arch/arm/boot/compressed/vmlinux.lds.in
index 366a924019ac..5309909d7282 100644
--- a/arch/arm/boot/compressed/vmlinux.lds.in
+++ b/arch/arm/boot/compressed/vmlinux.lds.in
@@ -43,9 +43,6 @@ SECTIONS
43 43
44 _etext = .; 44 _etext = .;
45 45
46 /* Assume size of decompressed image is 4x the compressed image */
47 _image_size = (_etext - _text) * 4;
48
49 _got_start = .; 46 _got_start = .;
50 .got : { *(.got) } 47 .got : { *(.got) }
51 _got_end = .; 48 _got_end = .;
diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig
index 778655f0257a..ea5ee4d067f3 100644
--- a/arch/arm/common/Kconfig
+++ b/arch/arm/common/Kconfig
@@ -6,6 +6,8 @@ config ARM_VIC
6 6
7config ARM_VIC_NR 7config ARM_VIC_NR
8 int 8 int
9 default 4 if ARCH_S5PV210
10 default 3 if ARCH_S5P6442 || ARCH_S5PC100
9 default 2 11 default 2
10 depends on ARM_VIC 12 depends on ARM_VIC
11 help 13 help
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index 224377211151..cb6b041c39d2 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -44,6 +44,19 @@ struct gic_chip_data {
44 void __iomem *cpu_base; 44 void __iomem *cpu_base;
45}; 45};
46 46
47/*
48 * Supported arch specific GIC irq extension.
49 * Default make them NULL.
50 */
51struct irq_chip gic_arch_extn = {
52 .irq_ack = NULL,
53 .irq_mask = NULL,
54 .irq_unmask = NULL,
55 .irq_retrigger = NULL,
56 .irq_set_type = NULL,
57 .irq_set_wake = NULL,
58};
59
47#ifndef MAX_GIC_NR 60#ifndef MAX_GIC_NR
48#define MAX_GIC_NR 1 61#define MAX_GIC_NR 1
49#endif 62#endif
@@ -74,6 +87,8 @@ static inline unsigned int gic_irq(struct irq_data *d)
74static void gic_ack_irq(struct irq_data *d) 87static void gic_ack_irq(struct irq_data *d)
75{ 88{
76 spin_lock(&irq_controller_lock); 89 spin_lock(&irq_controller_lock);
90 if (gic_arch_extn.irq_ack)
91 gic_arch_extn.irq_ack(d);
77 writel(gic_irq(d), gic_cpu_base(d) + GIC_CPU_EOI); 92 writel(gic_irq(d), gic_cpu_base(d) + GIC_CPU_EOI);
78 spin_unlock(&irq_controller_lock); 93 spin_unlock(&irq_controller_lock);
79} 94}
@@ -84,6 +99,8 @@ static void gic_mask_irq(struct irq_data *d)
84 99
85 spin_lock(&irq_controller_lock); 100 spin_lock(&irq_controller_lock);
86 writel(mask, gic_dist_base(d) + GIC_DIST_ENABLE_CLEAR + (gic_irq(d) / 32) * 4); 101 writel(mask, gic_dist_base(d) + GIC_DIST_ENABLE_CLEAR + (gic_irq(d) / 32) * 4);
102 if (gic_arch_extn.irq_mask)
103 gic_arch_extn.irq_mask(d);
87 spin_unlock(&irq_controller_lock); 104 spin_unlock(&irq_controller_lock);
88} 105}
89 106
@@ -92,6 +109,8 @@ static void gic_unmask_irq(struct irq_data *d)
92 u32 mask = 1 << (d->irq % 32); 109 u32 mask = 1 << (d->irq % 32);
93 110
94 spin_lock(&irq_controller_lock); 111 spin_lock(&irq_controller_lock);
112 if (gic_arch_extn.irq_unmask)
113 gic_arch_extn.irq_unmask(d);
95 writel(mask, gic_dist_base(d) + GIC_DIST_ENABLE_SET + (gic_irq(d) / 32) * 4); 114 writel(mask, gic_dist_base(d) + GIC_DIST_ENABLE_SET + (gic_irq(d) / 32) * 4);
96 spin_unlock(&irq_controller_lock); 115 spin_unlock(&irq_controller_lock);
97} 116}
@@ -116,6 +135,9 @@ static int gic_set_type(struct irq_data *d, unsigned int type)
116 135
117 spin_lock(&irq_controller_lock); 136 spin_lock(&irq_controller_lock);
118 137
138 if (gic_arch_extn.irq_set_type)
139 gic_arch_extn.irq_set_type(d, type);
140
119 val = readl(base + GIC_DIST_CONFIG + confoff); 141 val = readl(base + GIC_DIST_CONFIG + confoff);
120 if (type == IRQ_TYPE_LEVEL_HIGH) 142 if (type == IRQ_TYPE_LEVEL_HIGH)
121 val &= ~confmask; 143 val &= ~confmask;
@@ -141,32 +163,54 @@ static int gic_set_type(struct irq_data *d, unsigned int type)
141 return 0; 163 return 0;
142} 164}
143 165
166static int gic_retrigger(struct irq_data *d)
167{
168 if (gic_arch_extn.irq_retrigger)
169 return gic_arch_extn.irq_retrigger(d);
170
171 return -ENXIO;
172}
173
144#ifdef CONFIG_SMP 174#ifdef CONFIG_SMP
145static int 175static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
146gic_set_cpu(struct irq_data *d, const struct cpumask *mask_val, bool force) 176 bool force)
147{ 177{
148 void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3); 178 void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3);
149 unsigned int shift = (d->irq % 4) * 8; 179 unsigned int shift = (d->irq % 4) * 8;
150 unsigned int cpu = cpumask_first(mask_val); 180 unsigned int cpu = cpumask_first(mask_val);
151 u32 val; 181 u32 val, mask, bit;
152 struct irq_desc *desc;
153 182
154 spin_lock(&irq_controller_lock); 183 if (cpu >= 8)
155 desc = irq_to_desc(d->irq);
156 if (desc == NULL) {
157 spin_unlock(&irq_controller_lock);
158 return -EINVAL; 184 return -EINVAL;
159 } 185
186 mask = 0xff << shift;
187 bit = 1 << (cpu + shift);
188
189 spin_lock(&irq_controller_lock);
160 d->node = cpu; 190 d->node = cpu;
161 val = readl(reg) & ~(0xff << shift); 191 val = readl(reg) & ~mask;
162 val |= 1 << (cpu + shift); 192 writel(val | bit, reg);
163 writel(val, reg);
164 spin_unlock(&irq_controller_lock); 193 spin_unlock(&irq_controller_lock);
165 194
166 return 0; 195 return 0;
167} 196}
168#endif 197#endif
169 198
199#ifdef CONFIG_PM
200static int gic_set_wake(struct irq_data *d, unsigned int on)
201{
202 int ret = -ENXIO;
203
204 if (gic_arch_extn.irq_set_wake)
205 ret = gic_arch_extn.irq_set_wake(d, on);
206
207 return ret;
208}
209
210#else
211#define gic_set_wake NULL
212#endif
213
170static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc) 214static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
171{ 215{
172 struct gic_chip_data *chip_data = get_irq_data(irq); 216 struct gic_chip_data *chip_data = get_irq_data(irq);
@@ -202,9 +246,11 @@ static struct irq_chip gic_chip = {
202 .irq_mask = gic_mask_irq, 246 .irq_mask = gic_mask_irq,
203 .irq_unmask = gic_unmask_irq, 247 .irq_unmask = gic_unmask_irq,
204 .irq_set_type = gic_set_type, 248 .irq_set_type = gic_set_type,
249 .irq_retrigger = gic_retrigger,
205#ifdef CONFIG_SMP 250#ifdef CONFIG_SMP
206 .irq_set_affinity = gic_set_cpu, 251 .irq_set_affinity = gic_set_affinity,
207#endif 252#endif
253 .irq_set_wake = gic_set_wake,
208}; 254};
209 255
210void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq) 256void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq)
diff --git a/arch/arm/configs/exynos4_defconfig b/arch/arm/configs/exynos4_defconfig
new file mode 100644
index 000000000000..2ffba24d2e2a
--- /dev/null
+++ b/arch/arm/configs/exynos4_defconfig
@@ -0,0 +1,70 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_BLK_DEV_INITRD=y
3CONFIG_KALLSYMS_ALL=y
4CONFIG_MODULES=y
5CONFIG_MODULE_UNLOAD=y
6# CONFIG_BLK_DEV_BSG is not set
7CONFIG_ARCH_EXYNOS4=y
8CONFIG_S3C_LOWLEVEL_UART_PORT=1
9CONFIG_MACH_SMDKC210=y
10CONFIG_MACH_SMDKV310=y
11CONFIG_MACH_UNIVERSAL_C210=y
12CONFIG_NO_HZ=y
13CONFIG_HIGH_RES_TIMERS=y
14CONFIG_SMP=y
15CONFIG_NR_CPUS=2
16CONFIG_HOTPLUG_CPU=y
17CONFIG_PREEMPT=y
18CONFIG_AEABI=y
19CONFIG_CMDLINE="root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC1,115200 init=/linuxrc mem=256M"
20CONFIG_VFP=y
21CONFIG_NEON=y
22CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
23CONFIG_BLK_DEV_LOOP=y
24CONFIG_BLK_DEV_RAM=y
25CONFIG_BLK_DEV_RAM_SIZE=8192
26CONFIG_SCSI=y
27CONFIG_BLK_DEV_SD=y
28CONFIG_CHR_DEV_SG=y
29CONFIG_INPUT_EVDEV=y
30# CONFIG_INPUT_KEYBOARD is not set
31# CONFIG_INPUT_MOUSE is not set
32CONFIG_INPUT_TOUCHSCREEN=y
33CONFIG_SERIAL_8250=y
34CONFIG_SERIAL_SAMSUNG=y
35CONFIG_SERIAL_SAMSUNG_CONSOLE=y
36CONFIG_HW_RANDOM=y
37CONFIG_I2C=y
38# CONFIG_HWMON is not set
39# CONFIG_MFD_SUPPORT is not set
40# CONFIG_HID_SUPPORT is not set
41# CONFIG_USB_SUPPORT is not set
42CONFIG_EXT2_FS=y
43CONFIG_MSDOS_FS=y
44CONFIG_VFAT_FS=y
45CONFIG_TMPFS=y
46CONFIG_TMPFS_POSIX_ACL=y
47CONFIG_CRAMFS=y
48CONFIG_ROMFS_FS=y
49CONFIG_PARTITION_ADVANCED=y
50CONFIG_BSD_DISKLABEL=y
51CONFIG_SOLARIS_X86_PARTITION=y
52CONFIG_NLS_CODEPAGE_437=y
53CONFIG_NLS_ASCII=y
54CONFIG_NLS_ISO8859_1=y
55CONFIG_MAGIC_SYSRQ=y
56CONFIG_DEBUG_KERNEL=y
57CONFIG_DETECT_HUNG_TASK=y
58CONFIG_DEBUG_RT_MUTEXES=y
59CONFIG_DEBUG_SPINLOCK=y
60CONFIG_DEBUG_MUTEXES=y
61CONFIG_DEBUG_SPINLOCK_SLEEP=y
62CONFIG_DEBUG_INFO=y
63# CONFIG_RCU_CPU_STALL_DETECTOR is not set
64CONFIG_SYSCTL_SYSCALL_CHECK=y
65CONFIG_DEBUG_USER=y
66CONFIG_DEBUG_ERRORS=y
67CONFIG_DEBUG_LL=y
68CONFIG_EARLY_PRINTK=y
69CONFIG_DEBUG_S3C_UART=1
70CONFIG_CRC_CCITT=y
diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
index 2f7042813765..aeb3af541fed 100644
--- a/arch/arm/configs/kirkwood_defconfig
+++ b/arch/arm/configs/kirkwood_defconfig
@@ -24,6 +24,7 @@ CONFIG_MACH_OPENRD_ULTIMATE=y
24CONFIG_MACH_NETSPACE_V2=y 24CONFIG_MACH_NETSPACE_V2=y
25CONFIG_MACH_INETSPACE_V2=y 25CONFIG_MACH_INETSPACE_V2=y
26CONFIG_MACH_NETSPACE_MAX_V2=y 26CONFIG_MACH_NETSPACE_MAX_V2=y
27CONFIG_MACH_D2NET_V2=y
27CONFIG_MACH_NET2BIG_V2=y 28CONFIG_MACH_NET2BIG_V2=y
28CONFIG_MACH_NET5BIG_V2=y 29CONFIG_MACH_NET5BIG_V2=y
29CONFIG_MACH_T5325=y 30CONFIG_MACH_T5325=y
diff --git a/arch/arm/configs/lpd7a400_defconfig b/arch/arm/configs/lpd7a400_defconfig
deleted file mode 100644
index 5a48f171204c..000000000000
--- a/arch/arm/configs/lpd7a400_defconfig
+++ /dev/null
@@ -1,68 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2# CONFIG_SWAP is not set
3CONFIG_SYSVIPC=y
4CONFIG_IKCONFIG=y
5CONFIG_LOG_BUF_SHIFT=14
6CONFIG_EXPERT=y
7# CONFIG_HOTPLUG is not set
8# CONFIG_EPOLL is not set
9# CONFIG_IOSCHED_DEADLINE is not set
10CONFIG_ARCH_LH7A40X=y
11CONFIG_MACH_LPD7A400=y
12CONFIG_PREEMPT=y
13CONFIG_ZBOOT_ROM_TEXT=0x0
14CONFIG_ZBOOT_ROM_BSS=0x0
15CONFIG_FPE_NWFPE=y
16CONFIG_NET=y
17CONFIG_PACKET=y
18CONFIG_UNIX=y
19CONFIG_INET=y
20CONFIG_IP_PNP=y
21CONFIG_IP_PNP_DHCP=y
22CONFIG_IP_PNP_BOOTP=y
23CONFIG_IP_PNP_RARP=y
24# CONFIG_IPV6 is not set
25CONFIG_MTD=y
26CONFIG_MTD_PARTITIONS=y
27CONFIG_MTD_CMDLINE_PARTS=y
28CONFIG_MTD_CHAR=y
29CONFIG_MTD_BLOCK=y
30CONFIG_MTD_CFI=y
31CONFIG_MTD_CFI_INTELEXT=y
32CONFIG_MTD_PHYSMAP=y
33CONFIG_BLK_DEV_LOOP=y
34CONFIG_IDE=y
35CONFIG_SCSI=y
36# CONFIG_SCSI_PROC_FS is not set
37CONFIG_NETDEVICES=y
38CONFIG_NET_ETHERNET=y
39CONFIG_SMC91X=y
40# CONFIG_INPUT_MOUSEDEV is not set
41CONFIG_INPUT_EVDEV=y
42# CONFIG_INPUT_KEYBOARD is not set
43# CONFIG_INPUT_MOUSE is not set
44CONFIG_INPUT_TOUCHSCREEN=y
45# CONFIG_SERIO is not set
46CONFIG_SERIAL_LH7A40X=y
47CONFIG_SERIAL_LH7A40X_CONSOLE=y
48CONFIG_FB=y
49# CONFIG_VGA_CONSOLE is not set
50CONFIG_SOUND=y
51CONFIG_SND=y
52CONFIG_SND_MIXER_OSS=y
53CONFIG_SND_PCM_OSS=y
54CONFIG_EXT2_FS=y
55CONFIG_EXT3_FS=y
56CONFIG_VFAT_FS=y
57CONFIG_TMPFS=y
58CONFIG_JFFS2_FS=y
59CONFIG_CRAMFS=y
60CONFIG_NFS_FS=y
61CONFIG_NFS_V3=y
62CONFIG_ROOT_NFS=y
63CONFIG_PARTITION_ADVANCED=y
64CONFIG_MAGIC_SYSRQ=y
65CONFIG_DEBUG_KERNEL=y
66CONFIG_DEBUG_INFO=y
67CONFIG_DEBUG_USER=y
68CONFIG_DEBUG_ERRORS=y
diff --git a/arch/arm/configs/lpd7a404_defconfig b/arch/arm/configs/lpd7a404_defconfig
deleted file mode 100644
index 22d0631de009..000000000000
--- a/arch/arm/configs/lpd7a404_defconfig
+++ /dev/null
@@ -1,81 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2# CONFIG_SWAP is not set
3CONFIG_SYSVIPC=y
4CONFIG_IKCONFIG=y
5CONFIG_LOG_BUF_SHIFT=16
6CONFIG_EXPERT=y
7# CONFIG_HOTPLUG is not set
8# CONFIG_EPOLL is not set
9CONFIG_SLAB=y
10# CONFIG_IOSCHED_DEADLINE is not set
11CONFIG_ARCH_LH7A40X=y
12CONFIG_MACH_LPD7A404=y
13CONFIG_PREEMPT=y
14CONFIG_DISCONTIGMEM_MANUAL=y
15CONFIG_ZBOOT_ROM_TEXT=0x0
16CONFIG_ZBOOT_ROM_BSS=0x0
17CONFIG_FPE_NWFPE=y
18CONFIG_NET=y
19CONFIG_PACKET=y
20CONFIG_UNIX=y
21CONFIG_INET=y
22CONFIG_IP_PNP=y
23CONFIG_IP_PNP_DHCP=y
24CONFIG_IP_PNP_BOOTP=y
25CONFIG_IP_PNP_RARP=y
26# CONFIG_IPV6 is not set
27CONFIG_MTD=y
28CONFIG_MTD_PARTITIONS=y
29CONFIG_MTD_CMDLINE_PARTS=y
30CONFIG_MTD_CHAR=y
31CONFIG_MTD_BLOCK=y
32CONFIG_MTD_CFI=y
33CONFIG_MTD_CFI_INTELEXT=y
34CONFIG_MTD_PHYSMAP=y
35CONFIG_BLK_DEV_LOOP=y
36CONFIG_IDE=y
37CONFIG_SCSI=y
38# CONFIG_SCSI_PROC_FS is not set
39CONFIG_NETDEVICES=y
40CONFIG_NET_ETHERNET=y
41CONFIG_SMC91X=y
42# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
43CONFIG_INPUT_EVDEV=y
44# CONFIG_INPUT_KEYBOARD is not set
45# CONFIG_INPUT_MOUSE is not set
46CONFIG_INPUT_TOUCHSCREEN=y
47# CONFIG_SERIO is not set
48CONFIG_SERIAL_LH7A40X=y
49CONFIG_SERIAL_LH7A40X_CONSOLE=y
50CONFIG_FB=y
51# CONFIG_VGA_CONSOLE is not set
52CONFIG_SOUND=y
53CONFIG_SND=y
54CONFIG_SND_MIXER_OSS=y
55CONFIG_SND_PCM_OSS=y
56CONFIG_USB=y
57CONFIG_USB_DEVICEFS=y
58CONFIG_USB_MON=y
59CONFIG_USB_OHCI_HCD=y
60CONFIG_USB_STORAGE=y
61CONFIG_USB_STORAGE_DEBUG=y
62CONFIG_USB_STORAGE_DATAFAB=y
63CONFIG_USB_GADGET=y
64CONFIG_USB_ZERO=y
65CONFIG_EXT2_FS=y
66CONFIG_EXT3_FS=y
67CONFIG_INOTIFY=y
68CONFIG_VFAT_FS=y
69CONFIG_TMPFS=y
70CONFIG_JFFS2_FS=y
71CONFIG_CRAMFS=y
72CONFIG_NFS_FS=y
73CONFIG_NFS_V3=y
74CONFIG_ROOT_NFS=y
75CONFIG_PARTITION_ADVANCED=y
76CONFIG_MAGIC_SYSRQ=y
77CONFIG_DEBUG_KERNEL=y
78CONFIG_DEBUG_MUTEXES=y
79CONFIG_DEBUG_INFO=y
80CONFIG_DEBUG_USER=y
81CONFIG_DEBUG_ERRORS=y
diff --git a/arch/arm/configs/mx51_defconfig b/arch/arm/configs/mx51_defconfig
index 9cba68cfa51a..e3c903281f70 100644
--- a/arch/arm/configs/mx51_defconfig
+++ b/arch/arm/configs/mx51_defconfig
@@ -110,7 +110,7 @@ CONFIG_MMC=y
110CONFIG_MMC_BLOCK=m 110CONFIG_MMC_BLOCK=m
111CONFIG_MMC_SDHCI=m 111CONFIG_MMC_SDHCI=m
112CONFIG_NEW_LEDS=y 112CONFIG_NEW_LEDS=y
113CONFIG_LEDS_CLASS=m 113CONFIG_LEDS_CLASS=y
114CONFIG_RTC_CLASS=y 114CONFIG_RTC_CLASS=y
115CONFIG_RTC_INTF_DEV_UIE_EMUL=y 115CONFIG_RTC_INTF_DEV_UIE_EMUL=y
116CONFIG_EXT2_FS=y 116CONFIG_EXT2_FS=y
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index ae890caa17a7..076db52ff672 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -58,6 +58,7 @@ CONFIG_ARM_ERRATA_411920=y
58CONFIG_NO_HZ=y 58CONFIG_NO_HZ=y
59CONFIG_HIGH_RES_TIMERS=y 59CONFIG_HIGH_RES_TIMERS=y
60CONFIG_SMP=y 60CONFIG_SMP=y
61CONFIG_NR_CPUS=2
61# CONFIG_LOCAL_TIMERS is not set 62# CONFIG_LOCAL_TIMERS is not set
62CONFIG_AEABI=y 63CONFIG_AEABI=y
63CONFIG_LEDS=y 64CONFIG_LEDS=y
@@ -192,6 +193,17 @@ CONFIG_FIRMWARE_EDID=y
192CONFIG_FB_MODE_HELPERS=y 193CONFIG_FB_MODE_HELPERS=y
193CONFIG_FB_TILEBLITTING=y 194CONFIG_FB_TILEBLITTING=y
194CONFIG_FB_OMAP_LCD_VGA=y 195CONFIG_FB_OMAP_LCD_VGA=y
196CONFIG_OMAP2_DSS=m
197CONFIG_OMAP2_DSS_RFBI=y
198CONFIG_OMAP2_DSS_SDI=y
199CONFIG_OMAP2_DSS_DSI=y
200CONFIG_FB_OMAP2=m
201CONFIG_PANEL_GENERIC_DPI=m
202CONFIG_PANEL_SHARP_LS037V7DW01=m
203CONFIG_PANEL_NEC_NL8048HL11_01B=m
204CONFIG_PANEL_TAAL=m
205CONFIG_PANEL_TPO_TD043MTEA1=m
206CONFIG_PANEL_ACX565AKM=m
195CONFIG_BACKLIGHT_LCD_SUPPORT=y 207CONFIG_BACKLIGHT_LCD_SUPPORT=y
196CONFIG_LCD_CLASS_DEVICE=y 208CONFIG_LCD_CLASS_DEVICE=y
197CONFIG_LCD_PLATFORM=y 209CONFIG_LCD_PLATFORM=y
diff --git a/arch/arm/configs/s5p64x0_defconfig b/arch/arm/configs/s5p64x0_defconfig
index 2993ecd35145..ad6b61b0bd11 100644
--- a/arch/arm/configs/s5p64x0_defconfig
+++ b/arch/arm/configs/s5p64x0_defconfig
@@ -10,6 +10,8 @@ CONFIG_S3C_BOOT_ERROR_RESET=y
10CONFIG_S3C_LOWLEVEL_UART_PORT=1 10CONFIG_S3C_LOWLEVEL_UART_PORT=1
11CONFIG_MACH_SMDK6440=y 11CONFIG_MACH_SMDK6440=y
12CONFIG_MACH_SMDK6450=y 12CONFIG_MACH_SMDK6450=y
13CONFIG_NO_HZ=y
14CONFIG_HIGH_RES_TIMERS=y
13CONFIG_CPU_32v6K=y 15CONFIG_CPU_32v6K=y
14CONFIG_AEABI=y 16CONFIG_AEABI=y
15CONFIG_CMDLINE="root=/dev/ram0 rw ramdisk=8192 initrd=0x20800000,8M console=ttySAC1,115200 init=/linuxrc" 17CONFIG_CMDLINE="root=/dev/ram0 rw ramdisk=8192 initrd=0x20800000,8M console=ttySAC1,115200 init=/linuxrc"
diff --git a/arch/arm/configs/s5pv210_defconfig b/arch/arm/configs/s5pv210_defconfig
index 0488a1eb4d7d..fa989902236d 100644
--- a/arch/arm/configs/s5pv210_defconfig
+++ b/arch/arm/configs/s5pv210_defconfig
@@ -13,6 +13,8 @@ CONFIG_MACH_AQUILA=y
13CONFIG_MACH_GONI=y 13CONFIG_MACH_GONI=y
14CONFIG_MACH_SMDKC110=y 14CONFIG_MACH_SMDKC110=y
15CONFIG_MACH_SMDKV210=y 15CONFIG_MACH_SMDKV210=y
16CONFIG_NO_HZ=y
17CONFIG_HIGH_RES_TIMERS=y
16CONFIG_VMSPLIT_2G=y 18CONFIG_VMSPLIT_2G=y
17CONFIG_PREEMPT=y 19CONFIG_PREEMPT=y
18CONFIG_AEABI=y 20CONFIG_AEABI=y
diff --git a/arch/arm/configs/tegra_defconfig b/arch/arm/configs/tegra_defconfig
new file mode 100644
index 000000000000..8845f1c9925d
--- /dev/null
+++ b/arch/arm/configs/tegra_defconfig
@@ -0,0 +1,146 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_IKCONFIG=y
3CONFIG_IKCONFIG_PROC=y
4CONFIG_CGROUPS=y
5CONFIG_CGROUP_DEBUG=y
6CONFIG_CGROUP_FREEZER=y
7CONFIG_CGROUP_CPUACCT=y
8CONFIG_RESOURCE_COUNTERS=y
9CONFIG_CGROUP_SCHED=y
10CONFIG_RT_GROUP_SCHED=y
11CONFIG_BLK_DEV_INITRD=y
12CONFIG_EMBEDDED=y
13# CONFIG_SYSCTL_SYSCALL is not set
14# CONFIG_ELF_CORE is not set
15CONFIG_SLAB=y
16CONFIG_MODULES=y
17CONFIG_MODULE_UNLOAD=y
18CONFIG_MODULE_FORCE_UNLOAD=y
19# CONFIG_BLK_DEV_BSG is not set
20# CONFIG_IOSCHED_DEADLINE is not set
21# CONFIG_IOSCHED_CFQ is not set
22CONFIG_ARCH_TEGRA=y
23CONFIG_MACH_HARMONY=y
24CONFIG_MACH_KAEN=y
25CONFIG_MACH_PAZ00=y
26CONFIG_MACH_TRIMSLICE=y
27CONFIG_MACH_WARIO=y
28CONFIG_TEGRA_DEBUG_UARTD=y
29CONFIG_ARM_ERRATA_742230=y
30CONFIG_NO_HZ=y
31CONFIG_HIGH_RES_TIMERS=y
32CONFIG_SMP=y
33CONFIG_NR_CPUS=2
34CONFIG_PREEMPT=y
35CONFIG_AEABI=y
36# CONFIG_OABI_COMPAT is not set
37CONFIG_HIGHMEM=y
38CONFIG_ZBOOT_ROM_TEXT=0x0
39CONFIG_ZBOOT_ROM_BSS=0x0
40CONFIG_VFP=y
41CONFIG_PM=y
42CONFIG_NET=y
43CONFIG_PACKET=y
44CONFIG_UNIX=y
45CONFIG_NET_KEY=y
46CONFIG_INET=y
47CONFIG_IP_PNP=y
48CONFIG_IP_PNP_DHCP=y
49CONFIG_IP_PNP_BOOTP=y
50CONFIG_IP_PNP_RARP=y
51CONFIG_INET_ESP=y
52# CONFIG_INET_XFRM_MODE_TUNNEL is not set
53# CONFIG_INET_XFRM_MODE_BEET is not set
54# CONFIG_INET_LRO is not set
55# CONFIG_INET_DIAG is not set
56CONFIG_IPV6=y
57CONFIG_IPV6_PRIVACY=y
58CONFIG_IPV6_ROUTER_PREF=y
59CONFIG_IPV6_OPTIMISTIC_DAD=y
60CONFIG_INET6_AH=y
61CONFIG_INET6_ESP=y
62CONFIG_INET6_IPCOMP=y
63CONFIG_IPV6_MIP6=y
64CONFIG_IPV6_TUNNEL=y
65CONFIG_IPV6_MULTIPLE_TABLES=y
66# CONFIG_WIRELESS is not set
67# CONFIG_FIRMWARE_IN_KERNEL is not set
68CONFIG_BLK_DEV_LOOP=y
69CONFIG_MISC_DEVICES=y
70CONFIG_AD525X_DPOT=y
71CONFIG_AD525X_DPOT_I2C=y
72CONFIG_ICS932S401=y
73CONFIG_APDS9802ALS=y
74CONFIG_ISL29003=y
75CONFIG_NETDEVICES=y
76CONFIG_DUMMY=y
77CONFIG_R8169=y
78# CONFIG_NETDEV_10000 is not set
79# CONFIG_WLAN is not set
80# CONFIG_INPUT is not set
81# CONFIG_SERIO is not set
82# CONFIG_VT is not set
83# CONFIG_DEVKMEM is not set
84CONFIG_SERIAL_8250=y
85CONFIG_SERIAL_8250_CONSOLE=y
86# CONFIG_LEGACY_PTYS is not set
87# CONFIG_HW_RANDOM is not set
88CONFIG_I2C=y
89# CONFIG_I2C_COMPAT is not set
90# CONFIG_I2C_HELPER_AUTO is not set
91CONFIG_I2C_TEGRA=y
92CONFIG_SENSORS_LM90=y
93CONFIG_MFD_TPS6586X=y
94CONFIG_REGULATOR=y
95CONFIG_REGULATOR_TPS6586X=y
96# CONFIG_USB_SUPPORT is not set
97CONFIG_MMC=y
98CONFIG_MMC_SDHCI=y
99CONFIG_MMC_SDHCI_PLTFM=y
100CONFIG_MMC_SDHCI_TEGRA=y
101CONFIG_STAGING=y
102# CONFIG_STAGING_EXCLUDE_BUILD is not set
103CONFIG_IIO=y
104CONFIG_SENSORS_ISL29018=y
105CONFIG_SENSORS_AK8975=y
106CONFIG_EXT2_FS=y
107CONFIG_EXT2_FS_XATTR=y
108CONFIG_EXT2_FS_POSIX_ACL=y
109CONFIG_EXT2_FS_SECURITY=y
110CONFIG_EXT3_FS=y
111# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
112CONFIG_EXT3_FS_POSIX_ACL=y
113CONFIG_EXT3_FS_SECURITY=y
114# CONFIG_DNOTIFY is not set
115CONFIG_VFAT_FS=y
116CONFIG_TMPFS=y
117CONFIG_NFS_FS=y
118CONFIG_ROOT_NFS=y
119CONFIG_PARTITION_ADVANCED=y
120CONFIG_EFI_PARTITION=y
121CONFIG_NLS_CODEPAGE_437=y
122CONFIG_NLS_ISO8859_1=y
123CONFIG_PRINTK_TIME=y
124CONFIG_MAGIC_SYSRQ=y
125CONFIG_DEBUG_FS=y
126CONFIG_DEBUG_KERNEL=y
127CONFIG_DETECT_HUNG_TASK=y
128CONFIG_SCHEDSTATS=y
129CONFIG_TIMER_STATS=y
130CONFIG_DEBUG_SLAB=y
131# CONFIG_DEBUG_PREEMPT is not set
132CONFIG_DEBUG_MUTEXES=y
133CONFIG_DEBUG_SPINLOCK_SLEEP=y
134CONFIG_DEBUG_INFO=y
135CONFIG_DEBUG_VM=y
136CONFIG_DEBUG_SG=y
137# CONFIG_RCU_CPU_STALL_DETECTOR is not set
138CONFIG_DEBUG_LL=y
139CONFIG_EARLY_PRINTK=y
140CONFIG_CRYPTO_ECB=y
141CONFIG_CRYPTO_AES=y
142CONFIG_CRYPTO_ARC4=y
143CONFIG_CRYPTO_TWOFISH=y
144# CONFIG_CRYPTO_ANSI_CPRNG is not set
145CONFIG_CRC_CCITT=y
146CONFIG_CRC16=y
diff --git a/arch/arm/configs/u8500_defconfig b/arch/arm/configs/u8500_defconfig
index 52d86c4485bf..a5cce242a775 100644
--- a/arch/arm/configs/u8500_defconfig
+++ b/arch/arm/configs/u8500_defconfig
@@ -1,7 +1,6 @@
1CONFIG_EXPERIMENTAL=y 1CONFIG_EXPERIMENTAL=y
2# CONFIG_SWAP is not set 2# CONFIG_SWAP is not set
3CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
4CONFIG_SYSFS_DEPRECATED_V2=y
5CONFIG_BLK_DEV_INITRD=y 4CONFIG_BLK_DEV_INITRD=y
6CONFIG_KALLSYMS_ALL=y 5CONFIG_KALLSYMS_ALL=y
7CONFIG_MODULES=y 6CONFIG_MODULES=y
@@ -13,43 +12,89 @@ CONFIG_UX500_SOC_DB5500=y
13CONFIG_UX500_SOC_DB8500=y 12CONFIG_UX500_SOC_DB8500=y
14CONFIG_MACH_U8500=y 13CONFIG_MACH_U8500=y
15CONFIG_MACH_U5500=y 14CONFIG_MACH_U5500=y
15CONFIG_NO_HZ=y
16CONFIG_HIGH_RES_TIMERS=y
16CONFIG_SMP=y 17CONFIG_SMP=y
17CONFIG_NR_CPUS=2 18CONFIG_NR_CPUS=2
19CONFIG_HOTPLUG_CPU=y
18CONFIG_PREEMPT=y 20CONFIG_PREEMPT=y
19CONFIG_AEABI=y 21CONFIG_AEABI=y
20CONFIG_CMDLINE="root=/dev/ram0 console=ttyAMA2,115200n8" 22CONFIG_CMDLINE="root=/dev/ram0 console=ttyAMA2,115200n8"
23CONFIG_CPU_FREQ=y
24CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
21CONFIG_VFP=y 25CONFIG_VFP=y
22CONFIG_NEON=y 26CONFIG_NEON=y
27CONFIG_NET=y
28CONFIG_PHONET=y
29CONFIG_PHONET_PIPECTRLR=y
30# CONFIG_WIRELESS is not set
31CONFIG_CAIF=y
23CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 32CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
24CONFIG_BLK_DEV_RAM=y 33CONFIG_BLK_DEV_RAM=y
25CONFIG_BLK_DEV_RAM_SIZE=65536 34CONFIG_BLK_DEV_RAM_SIZE=65536
26# CONFIG_MISC_DEVICES is not set 35CONFIG_MISC_DEVICES=y
36CONFIG_AB8500_PWM=y
37CONFIG_SENSORS_BH1780=y
27# CONFIG_INPUT_MOUSEDEV_PSAUX is not set 38# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
28CONFIG_INPUT_EVDEV=y 39CONFIG_INPUT_EVDEV=y
29# CONFIG_INPUT_KEYBOARD is not set 40# CONFIG_KEYBOARD_ATKBD is not set
41CONFIG_KEYBOARD_GPIO=y
42CONFIG_KEYBOARD_NOMADIK=y
43CONFIG_KEYBOARD_STMPE=y
44CONFIG_KEYBOARD_TC3589X=y
30# CONFIG_INPUT_MOUSE is not set 45# CONFIG_INPUT_MOUSE is not set
46CONFIG_INPUT_TOUCHSCREEN=y
47CONFIG_TOUCHSCREEN_BU21013=y
48CONFIG_INPUT_MISC=y
49CONFIG_INPUT_AB8500_PONKEY=y
31# CONFIG_SERIO is not set 50# CONFIG_SERIO is not set
32CONFIG_VT_HW_CONSOLE_BINDING=y 51CONFIG_VT_HW_CONSOLE_BINDING=y
33CONFIG_SERIAL_AMBA_PL011=y 52CONFIG_SERIAL_AMBA_PL011=y
34CONFIG_SERIAL_AMBA_PL011_CONSOLE=y 53CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
35# CONFIG_LEGACY_PTYS is not set 54# CONFIG_LEGACY_PTYS is not set
36# CONFIG_HW_RANDOM is not set 55CONFIG_HW_RANDOM=y
56CONFIG_HW_RANDOM_NOMADIK=y
57CONFIG_I2C=y
58CONFIG_I2C_NOMADIK=y
37CONFIG_SPI=y 59CONFIG_SPI=y
38CONFIG_SPI_PL022=y 60CONFIG_SPI_PL022=y
61CONFIG_GPIO_STMPE=y
62CONFIG_GPIO_TC3589X=y
39# CONFIG_HWMON is not set 63# CONFIG_HWMON is not set
40# CONFIG_VGA_CONSOLE is not set 64CONFIG_MFD_STMPE=y
65CONFIG_MFD_TC3589X=y
66CONFIG_AB8500_CORE=y
67CONFIG_REGULATOR=y
68CONFIG_REGULATOR_AB8500=y
41# CONFIG_HID_SUPPORT is not set 69# CONFIG_HID_SUPPORT is not set
42# CONFIG_USB_SUPPORT is not set 70# CONFIG_USB_SUPPORT is not set
71CONFIG_MMC=y
72CONFIG_MMC_ARMMMCI=y
73CONFIG_NEW_LEDS=y
74CONFIG_LEDS_CLASS=y
75CONFIG_LEDS_LP5521=y
76CONFIG_RTC_CLASS=y
77CONFIG_RTC_DRV_AB8500=y
78CONFIG_RTC_DRV_PL031=y
79CONFIG_DMADEVICES=y
80CONFIG_STE_DMA40=y
81CONFIG_STAGING=y
82# CONFIG_STAGING_EXCLUDE_BUILD is not set
83CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4=y
43CONFIG_EXT2_FS=y 84CONFIG_EXT2_FS=y
44CONFIG_EXT2_FS_XATTR=y 85CONFIG_EXT2_FS_XATTR=y
45CONFIG_EXT2_FS_POSIX_ACL=y 86CONFIG_EXT2_FS_POSIX_ACL=y
46CONFIG_EXT2_FS_SECURITY=y 87CONFIG_EXT2_FS_SECURITY=y
47CONFIG_INOTIFY=y 88CONFIG_EXT3_FS=y
89CONFIG_VFAT_FS=y
48CONFIG_TMPFS=y 90CONFIG_TMPFS=y
49CONFIG_TMPFS_POSIX_ACL=y 91CONFIG_TMPFS_POSIX_ACL=y
50CONFIG_CONFIGFS_FS=m 92CONFIG_CONFIGFS_FS=m
51# CONFIG_MISC_FILESYSTEMS is not set 93# CONFIG_MISC_FILESYSTEMS is not set
94CONFIG_NLS_CODEPAGE_437=y
95CONFIG_NLS_ISO8859_1=y
52CONFIG_MAGIC_SYSRQ=y 96CONFIG_MAGIC_SYSRQ=y
97CONFIG_DEBUG_FS=y
53CONFIG_DEBUG_KERNEL=y 98CONFIG_DEBUG_KERNEL=y
54# CONFIG_SCHED_DEBUG is not set 99# CONFIG_SCHED_DEBUG is not set
55# CONFIG_DEBUG_PREEMPT is not set 100# CONFIG_DEBUG_PREEMPT is not set
@@ -58,5 +103,3 @@ CONFIG_DEBUG_INFO=y
58# CONFIG_FTRACE is not set 103# CONFIG_FTRACE is not set
59CONFIG_DEBUG_USER=y 104CONFIG_DEBUG_USER=y
60CONFIG_DEBUG_ERRORS=y 105CONFIG_DEBUG_ERRORS=y
61CONFIG_CRC_T10DIF=m
62# CONFIG_CRC32 is not set
diff --git a/arch/arm/configs/vexpress_defconfig b/arch/arm/configs/vexpress_defconfig
new file mode 100644
index 000000000000..f2de51f0bd18
--- /dev/null
+++ b/arch/arm/configs/vexpress_defconfig
@@ -0,0 +1,140 @@
1CONFIG_EXPERIMENTAL=y
2# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_SYSVIPC=y
4CONFIG_IKCONFIG=y
5CONFIG_IKCONFIG_PROC=y
6CONFIG_LOG_BUF_SHIFT=14
7CONFIG_CGROUPS=y
8CONFIG_CPUSETS=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_BLK_DEV_INITRD=y
15# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
16CONFIG_PROFILING=y
17CONFIG_OPROFILE=y
18CONFIG_MODULES=y
19CONFIG_MODULE_UNLOAD=y
20# CONFIG_LBDAF is not set
21# CONFIG_BLK_DEV_BSG is not set
22# CONFIG_IOSCHED_DEADLINE is not set
23# CONFIG_IOSCHED_CFQ is not set
24CONFIG_ARCH_VEXPRESS=y
25CONFIG_ARCH_VEXPRESS_CA9X4=y
26# CONFIG_SWP_EMULATE is not set
27CONFIG_SMP=y
28CONFIG_VMSPLIT_2G=y
29CONFIG_HOTPLUG_CPU=y
30CONFIG_AEABI=y
31CONFIG_ZBOOT_ROM_TEXT=0x0
32CONFIG_ZBOOT_ROM_BSS=0x0
33CONFIG_CMDLINE="root=/dev/nfs nfsroot=10.1.69.3:/work/nfsroot ip=dhcp console=ttyAMA0 mem=128M"
34CONFIG_VFP=y
35CONFIG_NEON=y
36# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
37CONFIG_NET=y
38CONFIG_PACKET=y
39CONFIG_UNIX=y
40CONFIG_INET=y
41CONFIG_IP_PNP=y
42CONFIG_IP_PNP_DHCP=y
43CONFIG_IP_PNP_BOOTP=y
44# CONFIG_INET_LRO is not set
45# CONFIG_IPV6 is not set
46# CONFIG_WIRELESS is not set
47CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
48CONFIG_MTD=y
49CONFIG_MTD_CONCAT=y
50CONFIG_MTD_PARTITIONS=y
51CONFIG_MTD_CMDLINE_PARTS=y
52CONFIG_MTD_CHAR=y
53CONFIG_MTD_BLOCK=y
54CONFIG_MTD_CFI=y
55CONFIG_MTD_CFI_INTELEXT=y
56CONFIG_MTD_CFI_AMDSTD=y
57CONFIG_MTD_ARM_INTEGRATOR=y
58CONFIG_MISC_DEVICES=y
59# CONFIG_SCSI_PROC_FS is not set
60CONFIG_BLK_DEV_SD=y
61# CONFIG_SCSI_LOWLEVEL is not set
62CONFIG_ATA=y
63# CONFIG_SATA_PMP is not set
64CONFIG_NETDEVICES=y
65CONFIG_NET_ETHERNET=y
66CONFIG_SMSC911X=y
67# CONFIG_NETDEV_1000 is not set
68# CONFIG_NETDEV_10000 is not set
69# CONFIG_WLAN is not set
70CONFIG_INPUT_EVDEV=y
71# CONFIG_SERIO_SERPORT is not set
72CONFIG_SERIO_AMBAKMI=y
73CONFIG_SERIAL_AMBA_PL011=y
74CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
75CONFIG_LEGACY_PTY_COUNT=16
76# CONFIG_HW_RANDOM is not set
77# CONFIG_HWMON is not set
78CONFIG_FB=y
79CONFIG_FB_ARMCLCD=y
80CONFIG_FRAMEBUFFER_CONSOLE=y
81CONFIG_LOGO=y
82# CONFIG_LOGO_LINUX_MONO is not set
83# CONFIG_LOGO_LINUX_VGA16 is not set
84CONFIG_SOUND=y
85CONFIG_SND=y
86CONFIG_SND_MIXER_OSS=y
87CONFIG_SND_PCM_OSS=y
88# CONFIG_SND_DRIVERS is not set
89CONFIG_SND_ARMAACI=y
90CONFIG_HID_DRAGONRISE=y
91CONFIG_HID_GYRATION=y
92CONFIG_HID_TWINHAN=y
93CONFIG_HID_NTRIG=y
94CONFIG_HID_PANTHERLORD=y
95CONFIG_HID_PETALYNX=y
96CONFIG_HID_SAMSUNG=y
97CONFIG_HID_SONY=y
98CONFIG_HID_SUNPLUS=y
99CONFIG_HID_GREENASIA=y
100CONFIG_HID_SMARTJOYPLUS=y
101CONFIG_HID_TOPSEED=y
102CONFIG_HID_THRUSTMASTER=y
103CONFIG_HID_ZEROPLUS=y
104CONFIG_USB=y
105CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
106# CONFIG_USB_DEVICE_CLASS is not set
107CONFIG_USB_MON=y
108CONFIG_USB_ISP1760_HCD=y
109CONFIG_USB_STORAGE=y
110CONFIG_MMC=y
111CONFIG_MMC_ARMMMCI=y
112CONFIG_RTC_CLASS=y
113CONFIG_RTC_DRV_PL031=y
114CONFIG_EXT2_FS=y
115CONFIG_EXT3_FS=y
116# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
117# CONFIG_EXT3_FS_XATTR is not set
118CONFIG_VFAT_FS=y
119CONFIG_TMPFS=y
120CONFIG_JFFS2_FS=y
121CONFIG_CRAMFS=y
122CONFIG_NFS_FS=y
123CONFIG_NFS_V3=y
124CONFIG_ROOT_NFS=y
125# CONFIG_RPCSEC_GSS_KRB5 is not set
126CONFIG_NLS_CODEPAGE_437=y
127CONFIG_NLS_ISO8859_1=y
128CONFIG_MAGIC_SYSRQ=y
129CONFIG_DEBUG_FS=y
130CONFIG_DEBUG_KERNEL=y
131CONFIG_DETECT_HUNG_TASK=y
132# CONFIG_SCHED_DEBUG is not set
133CONFIG_DEBUG_INFO=y
134# CONFIG_RCU_CPU_STALL_DETECTOR is not set
135CONFIG_DEBUG_USER=y
136CONFIG_DEBUG_ERRORS=y
137CONFIG_DEBUG_LL=y
138CONFIG_EARLY_PRINTK=y
139# CONFIG_CRYPTO_ANSI_CPRNG is not set
140# CONFIG_CRYPTO_HW is not set
diff --git a/arch/arm/include/asm/a.out-core.h b/arch/arm/include/asm/a.out-core.h
index 93d04acaa31f..92f10cb5c70c 100644
--- a/arch/arm/include/asm/a.out-core.h
+++ b/arch/arm/include/asm/a.out-core.h
@@ -32,11 +32,7 @@ static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
32 dump->u_dsize = (tsk->mm->brk - tsk->mm->start_data + PAGE_SIZE - 1) >> PAGE_SHIFT; 32 dump->u_dsize = (tsk->mm->brk - tsk->mm->start_data + PAGE_SIZE - 1) >> PAGE_SHIFT;
33 dump->u_ssize = 0; 33 dump->u_ssize = 0;
34 34
35 dump->u_debugreg[0] = tsk->thread.debug.bp[0].address; 35 memset(dump->u_debugreg, 0, sizeof(dump->u_debugreg));
36 dump->u_debugreg[1] = tsk->thread.debug.bp[1].address;
37 dump->u_debugreg[2] = tsk->thread.debug.bp[0].insn.arm;
38 dump->u_debugreg[3] = tsk->thread.debug.bp[1].insn.arm;
39 dump->u_debugreg[4] = tsk->thread.debug.nsaved;
40 36
41 if (dump->start_stack < 0x04000000) 37 if (dump->start_stack < 0x04000000)
42 dump->u_ssize = (0x04000000 - dump->start_stack) >> PAGE_SHIFT; 38 dump->u_ssize = (0x04000000 - dump->start_stack) >> PAGE_SHIFT;
diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index 7b1bb2bbaf88..6b7403fd8f54 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -149,14 +149,18 @@ ____atomic_test_and_change_bit(unsigned int bit, volatile unsigned long *p)
149 */ 149 */
150 150
151/* 151/*
152 * Native endian assembly bitops. nr = 0 -> word 0 bit 0.
153 */
154extern void _set_bit(int nr, volatile unsigned long * p);
155extern void _clear_bit(int nr, volatile unsigned long * p);
156extern void _change_bit(int nr, volatile unsigned long * p);
157extern int _test_and_set_bit(int nr, volatile unsigned long * p);
158extern int _test_and_clear_bit(int nr, volatile unsigned long * p);
159extern int _test_and_change_bit(int nr, volatile unsigned long * p);
160
161/*
152 * Little endian assembly bitops. nr = 0 -> byte 0 bit 0. 162 * Little endian assembly bitops. nr = 0 -> byte 0 bit 0.
153 */ 163 */
154extern void _set_bit_le(int nr, volatile unsigned long * p);
155extern void _clear_bit_le(int nr, volatile unsigned long * p);
156extern void _change_bit_le(int nr, volatile unsigned long * p);
157extern int _test_and_set_bit_le(int nr, volatile unsigned long * p);
158extern int _test_and_clear_bit_le(int nr, volatile unsigned long * p);
159extern int _test_and_change_bit_le(int nr, volatile unsigned long * p);
160extern int _find_first_zero_bit_le(const void * p, unsigned size); 164extern int _find_first_zero_bit_le(const void * p, unsigned size);
161extern int _find_next_zero_bit_le(const void * p, int size, int offset); 165extern int _find_next_zero_bit_le(const void * p, int size, int offset);
162extern int _find_first_bit_le(const unsigned long *p, unsigned size); 166extern int _find_first_bit_le(const unsigned long *p, unsigned size);
@@ -165,12 +169,6 @@ extern int _find_next_bit_le(const unsigned long *p, int size, int offset);
165/* 169/*
166 * Big endian assembly bitops. nr = 0 -> byte 3 bit 0. 170 * Big endian assembly bitops. nr = 0 -> byte 3 bit 0.
167 */ 171 */
168extern void _set_bit_be(int nr, volatile unsigned long * p);
169extern void _clear_bit_be(int nr, volatile unsigned long * p);
170extern void _change_bit_be(int nr, volatile unsigned long * p);
171extern int _test_and_set_bit_be(int nr, volatile unsigned long * p);
172extern int _test_and_clear_bit_be(int nr, volatile unsigned long * p);
173extern int _test_and_change_bit_be(int nr, volatile unsigned long * p);
174extern int _find_first_zero_bit_be(const void * p, unsigned size); 172extern int _find_first_zero_bit_be(const void * p, unsigned size);
175extern int _find_next_zero_bit_be(const void * p, int size, int offset); 173extern int _find_next_zero_bit_be(const void * p, int size, int offset);
176extern int _find_first_bit_be(const unsigned long *p, unsigned size); 174extern int _find_first_bit_be(const unsigned long *p, unsigned size);
@@ -180,33 +178,26 @@ extern int _find_next_bit_be(const unsigned long *p, int size, int offset);
180/* 178/*
181 * The __* form of bitops are non-atomic and may be reordered. 179 * The __* form of bitops are non-atomic and may be reordered.
182 */ 180 */
183#define ATOMIC_BITOP_LE(name,nr,p) \ 181#define ATOMIC_BITOP(name,nr,p) \
184 (__builtin_constant_p(nr) ? \ 182 (__builtin_constant_p(nr) ? ____atomic_##name(nr, p) : _##name(nr,p))
185 ____atomic_##name(nr, p) : \
186 _##name##_le(nr,p))
187
188#define ATOMIC_BITOP_BE(name,nr,p) \
189 (__builtin_constant_p(nr) ? \
190 ____atomic_##name(nr, p) : \
191 _##name##_be(nr,p))
192#else 183#else
193#define ATOMIC_BITOP_LE(name,nr,p) _##name##_le(nr,p) 184#define ATOMIC_BITOP(name,nr,p) _##name(nr,p)
194#define ATOMIC_BITOP_BE(name,nr,p) _##name##_be(nr,p)
195#endif 185#endif
196 186
197#define NONATOMIC_BITOP(name,nr,p) \ 187/*
198 (____nonatomic_##name(nr, p)) 188 * Native endian atomic definitions.
189 */
190#define set_bit(nr,p) ATOMIC_BITOP(set_bit,nr,p)
191#define clear_bit(nr,p) ATOMIC_BITOP(clear_bit,nr,p)
192#define change_bit(nr,p) ATOMIC_BITOP(change_bit,nr,p)
193#define test_and_set_bit(nr,p) ATOMIC_BITOP(test_and_set_bit,nr,p)
194#define test_and_clear_bit(nr,p) ATOMIC_BITOP(test_and_clear_bit,nr,p)
195#define test_and_change_bit(nr,p) ATOMIC_BITOP(test_and_change_bit,nr,p)
199 196
200#ifndef __ARMEB__ 197#ifndef __ARMEB__
201/* 198/*
202 * These are the little endian, atomic definitions. 199 * These are the little endian, atomic definitions.
203 */ 200 */
204#define set_bit(nr,p) ATOMIC_BITOP_LE(set_bit,nr,p)
205#define clear_bit(nr,p) ATOMIC_BITOP_LE(clear_bit,nr,p)
206#define change_bit(nr,p) ATOMIC_BITOP_LE(change_bit,nr,p)
207#define test_and_set_bit(nr,p) ATOMIC_BITOP_LE(test_and_set_bit,nr,p)
208#define test_and_clear_bit(nr,p) ATOMIC_BITOP_LE(test_and_clear_bit,nr,p)
209#define test_and_change_bit(nr,p) ATOMIC_BITOP_LE(test_and_change_bit,nr,p)
210#define find_first_zero_bit(p,sz) _find_first_zero_bit_le(p,sz) 201#define find_first_zero_bit(p,sz) _find_first_zero_bit_le(p,sz)
211#define find_next_zero_bit(p,sz,off) _find_next_zero_bit_le(p,sz,off) 202#define find_next_zero_bit(p,sz,off) _find_next_zero_bit_le(p,sz,off)
212#define find_first_bit(p,sz) _find_first_bit_le(p,sz) 203#define find_first_bit(p,sz) _find_first_bit_le(p,sz)
@@ -215,16 +206,9 @@ extern int _find_next_bit_be(const unsigned long *p, int size, int offset);
215#define WORD_BITOFF_TO_LE(x) ((x)) 206#define WORD_BITOFF_TO_LE(x) ((x))
216 207
217#else 208#else
218
219/* 209/*
220 * These are the big endian, atomic definitions. 210 * These are the big endian, atomic definitions.
221 */ 211 */
222#define set_bit(nr,p) ATOMIC_BITOP_BE(set_bit,nr,p)
223#define clear_bit(nr,p) ATOMIC_BITOP_BE(clear_bit,nr,p)
224#define change_bit(nr,p) ATOMIC_BITOP_BE(change_bit,nr,p)
225#define test_and_set_bit(nr,p) ATOMIC_BITOP_BE(test_and_set_bit,nr,p)
226#define test_and_clear_bit(nr,p) ATOMIC_BITOP_BE(test_and_clear_bit,nr,p)
227#define test_and_change_bit(nr,p) ATOMIC_BITOP_BE(test_and_change_bit,nr,p)
228#define find_first_zero_bit(p,sz) _find_first_zero_bit_be(p,sz) 212#define find_first_zero_bit(p,sz) _find_first_zero_bit_be(p,sz)
229#define find_next_zero_bit(p,sz,off) _find_next_zero_bit_be(p,sz,off) 213#define find_next_zero_bit(p,sz,off) _find_next_zero_bit_be(p,sz,off)
230#define find_first_bit(p,sz) _find_first_bit_be(p,sz) 214#define find_first_bit(p,sz) _find_first_bit_be(p,sz)
@@ -303,41 +287,63 @@ static inline int fls(int x)
303#include <asm-generic/bitops/hweight.h> 287#include <asm-generic/bitops/hweight.h>
304#include <asm-generic/bitops/lock.h> 288#include <asm-generic/bitops/lock.h>
305 289
306/* 290static inline void __set_bit_le(int nr, void *addr)
307 * Ext2 is defined to use little-endian byte ordering. 291{
308 * These do not need to be atomic. 292 __set_bit(WORD_BITOFF_TO_LE(nr), addr);
309 */ 293}
310#define ext2_set_bit(nr,p) \ 294
311 __test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p)) 295static inline void __clear_bit_le(int nr, void *addr)
312#define ext2_set_bit_atomic(lock,nr,p) \ 296{
313 test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p)) 297 __clear_bit(WORD_BITOFF_TO_LE(nr), addr);
314#define ext2_clear_bit(nr,p) \ 298}
315 __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p)) 299
316#define ext2_clear_bit_atomic(lock,nr,p) \ 300static inline int __test_and_set_bit_le(int nr, void *addr)
317 test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p)) 301{
318#define ext2_test_bit(nr,p) \ 302 return __test_and_set_bit(WORD_BITOFF_TO_LE(nr), addr);
319 test_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p)) 303}
320#define ext2_find_first_zero_bit(p,sz) \ 304
321 _find_first_zero_bit_le(p,sz) 305static inline int test_and_set_bit_le(int nr, void *addr)
322#define ext2_find_next_zero_bit(p,sz,off) \ 306{
323 _find_next_zero_bit_le(p,sz,off) 307 return test_and_set_bit(WORD_BITOFF_TO_LE(nr), addr);
324#define ext2_find_next_bit(p, sz, off) \ 308}
325 _find_next_bit_le(p, sz, off) 309
310static inline int __test_and_clear_bit_le(int nr, void *addr)
311{
312 return __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), addr);
313}
314
315static inline int test_and_clear_bit_le(int nr, void *addr)
316{
317 return test_and_clear_bit(WORD_BITOFF_TO_LE(nr), addr);
318}
319
320static inline int test_bit_le(int nr, const void *addr)
321{
322 return test_bit(WORD_BITOFF_TO_LE(nr), addr);
323}
324
325static inline int find_first_zero_bit_le(const void *p, unsigned size)
326{
327 return _find_first_zero_bit_le(p, size);
328}
329
330static inline int find_next_zero_bit_le(const void *p, int size, int offset)
331{
332 return _find_next_zero_bit_le(p, size, offset);
333}
334
335static inline int find_next_bit_le(const void *p, int size, int offset)
336{
337 return _find_next_bit_le(p, size, offset);
338}
326 339
327/* 340/*
328 * Minix is defined to use little-endian byte ordering. 341 * Ext2 is defined to use little-endian byte ordering.
329 * These do not need to be atomic.
330 */ 342 */
331#define minix_set_bit(nr,p) \ 343#define ext2_set_bit_atomic(lock, nr, p) \
332 __set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p)) 344 test_and_set_bit_le(nr, p)
333#define minix_test_bit(nr,p) \ 345#define ext2_clear_bit_atomic(lock, nr, p) \
334 test_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p)) 346 test_and_clear_bit_le(nr, p)
335#define minix_test_and_set_bit(nr,p) \
336 __test_and_set_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
337#define minix_test_and_clear_bit(nr,p) \
338 __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p))
339#define minix_find_first_zero_bit(p,sz) \
340 _find_first_zero_bit_le(p,sz)
341 347
342#endif /* __KERNEL__ */ 348#endif /* __KERNEL__ */
343 349
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h
index 3acd8fa25e34..d5d8d5c72682 100644
--- a/arch/arm/include/asm/cacheflush.h
+++ b/arch/arm/include/asm/cacheflush.h
@@ -12,7 +12,7 @@
12 12
13#include <linux/mm.h> 13#include <linux/mm.h>
14 14
15#include <asm/glue.h> 15#include <asm/glue-cache.h>
16#include <asm/shmparam.h> 16#include <asm/shmparam.h>
17#include <asm/cachetype.h> 17#include <asm/cachetype.h>
18#include <asm/outercache.h> 18#include <asm/outercache.h>
@@ -20,123 +20,6 @@
20#define CACHE_COLOUR(vaddr) ((vaddr & (SHMLBA - 1)) >> PAGE_SHIFT) 20#define CACHE_COLOUR(vaddr) ((vaddr & (SHMLBA - 1)) >> PAGE_SHIFT)
21 21
22/* 22/*
23 * Cache Model
24 * ===========
25 */
26#undef _CACHE
27#undef MULTI_CACHE
28
29#if defined(CONFIG_CPU_CACHE_V3)
30# ifdef _CACHE
31# define MULTI_CACHE 1
32# else
33# define _CACHE v3
34# endif
35#endif
36
37#if defined(CONFIG_CPU_CACHE_V4)
38# ifdef _CACHE
39# define MULTI_CACHE 1
40# else
41# define _CACHE v4
42# endif
43#endif
44
45#if defined(CONFIG_CPU_ARM920T) || defined(CONFIG_CPU_ARM922T) || \
46 defined(CONFIG_CPU_ARM925T) || defined(CONFIG_CPU_ARM1020) || \
47 defined(CONFIG_CPU_ARM1026)
48# define MULTI_CACHE 1
49#endif
50
51#if defined(CONFIG_CPU_FA526)
52# ifdef _CACHE
53# define MULTI_CACHE 1
54# else
55# define _CACHE fa
56# endif
57#endif
58
59#if defined(CONFIG_CPU_ARM926T)
60# ifdef _CACHE
61# define MULTI_CACHE 1
62# else
63# define _CACHE arm926
64# endif
65#endif
66
67#if defined(CONFIG_CPU_ARM940T)
68# ifdef _CACHE
69# define MULTI_CACHE 1
70# else
71# define _CACHE arm940
72# endif
73#endif
74
75#if defined(CONFIG_CPU_ARM946E)
76# ifdef _CACHE
77# define MULTI_CACHE 1
78# else
79# define _CACHE arm946
80# endif
81#endif
82
83#if defined(CONFIG_CPU_CACHE_V4WB)
84# ifdef _CACHE
85# define MULTI_CACHE 1
86# else
87# define _CACHE v4wb
88# endif
89#endif
90
91#if defined(CONFIG_CPU_XSCALE)
92# ifdef _CACHE
93# define MULTI_CACHE 1
94# else
95# define _CACHE xscale
96# endif
97#endif
98
99#if defined(CONFIG_CPU_XSC3)
100# ifdef _CACHE
101# define MULTI_CACHE 1
102# else
103# define _CACHE xsc3
104# endif
105#endif
106
107#if defined(CONFIG_CPU_MOHAWK)
108# ifdef _CACHE
109# define MULTI_CACHE 1
110# else
111# define _CACHE mohawk
112# endif
113#endif
114
115#if defined(CONFIG_CPU_FEROCEON)
116# define MULTI_CACHE 1
117#endif
118
119#if defined(CONFIG_CPU_V6)
120//# ifdef _CACHE
121# define MULTI_CACHE 1
122//# else
123//# define _CACHE v6
124//# endif
125#endif
126
127#if defined(CONFIG_CPU_V7)
128//# ifdef _CACHE
129# define MULTI_CACHE 1
130//# else
131//# define _CACHE v7
132//# endif
133#endif
134
135#if !defined(_CACHE) && !defined(MULTI_CACHE)
136#error Unknown cache maintainence model
137#endif
138
139/*
140 * This flag is used to indicate that the page pointed to by a pte is clean 23 * This flag is used to indicate that the page pointed to by a pte is clean
141 * and does not require cleaning before returning it to the user. 24 * and does not require cleaning before returning it to the user.
142 */ 25 */
@@ -249,19 +132,11 @@ extern struct cpu_cache_fns cpu_cache;
249 * visible to the CPU. 132 * visible to the CPU.
250 */ 133 */
251#define dmac_map_area cpu_cache.dma_map_area 134#define dmac_map_area cpu_cache.dma_map_area
252#define dmac_unmap_area cpu_cache.dma_unmap_area 135#define dmac_unmap_area cpu_cache.dma_unmap_area
253#define dmac_flush_range cpu_cache.dma_flush_range 136#define dmac_flush_range cpu_cache.dma_flush_range
254 137
255#else 138#else
256 139
257#define __cpuc_flush_icache_all __glue(_CACHE,_flush_icache_all)
258#define __cpuc_flush_kern_all __glue(_CACHE,_flush_kern_cache_all)
259#define __cpuc_flush_user_all __glue(_CACHE,_flush_user_cache_all)
260#define __cpuc_flush_user_range __glue(_CACHE,_flush_user_cache_range)
261#define __cpuc_coherent_kern_range __glue(_CACHE,_coherent_kern_range)
262#define __cpuc_coherent_user_range __glue(_CACHE,_coherent_user_range)
263#define __cpuc_flush_dcache_area __glue(_CACHE,_flush_kern_dcache_area)
264
265extern void __cpuc_flush_icache_all(void); 140extern void __cpuc_flush_icache_all(void);
266extern void __cpuc_flush_kern_all(void); 141extern void __cpuc_flush_kern_all(void);
267extern void __cpuc_flush_user_all(void); 142extern void __cpuc_flush_user_all(void);
@@ -276,10 +151,6 @@ extern void __cpuc_flush_dcache_area(void *, size_t);
276 * is visible to DMA, or data written by DMA to system memory is 151 * is visible to DMA, or data written by DMA to system memory is
277 * visible to the CPU. 152 * visible to the CPU.
278 */ 153 */
279#define dmac_map_area __glue(_CACHE,_dma_map_area)
280#define dmac_unmap_area __glue(_CACHE,_dma_unmap_area)
281#define dmac_flush_range __glue(_CACHE,_dma_flush_range)
282
283extern void dmac_map_area(const void *, size_t, int); 154extern void dmac_map_area(const void *, size_t, int);
284extern void dmac_unmap_area(const void *, size_t, int); 155extern void dmac_unmap_area(const void *, size_t, int);
285extern void dmac_flush_range(const void *, const void *); 156extern void dmac_flush_range(const void *, const void *);
@@ -316,7 +187,8 @@ extern void copy_to_user_page(struct vm_area_struct *, struct page *,
316 * Optimized __flush_icache_all for the common cases. Note that UP ARMv7 187 * Optimized __flush_icache_all for the common cases. Note that UP ARMv7
317 * will fall through to use __flush_icache_all_generic. 188 * will fall through to use __flush_icache_all_generic.
318 */ 189 */
319#if (defined(CONFIG_CPU_V7) && defined(CONFIG_CPU_V6)) || \ 190#if (defined(CONFIG_CPU_V7) && \
191 (defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K))) || \
320 defined(CONFIG_SMP_ON_UP) 192 defined(CONFIG_SMP_ON_UP)
321#define __flush_icache_preferred __cpuc_flush_icache_all 193#define __flush_icache_preferred __cpuc_flush_icache_all
322#elif __LINUX_ARM_ARCH__ >= 7 && defined(CONFIG_SMP) 194#elif __LINUX_ARM_ARCH__ >= 7 && defined(CONFIG_SMP)
diff --git a/arch/arm/include/asm/cpu-multi32.h b/arch/arm/include/asm/cpu-multi32.h
deleted file mode 100644
index e2b5b0b2116a..000000000000
--- a/arch/arm/include/asm/cpu-multi32.h
+++ /dev/null
@@ -1,69 +0,0 @@
1/*
2 * arch/arm/include/asm/cpu-multi32.h
3 *
4 * Copyright (C) 2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <asm/page.h>
11
12struct mm_struct;
13
14/*
15 * Don't change this structure - ASM code
16 * relies on it.
17 */
18extern struct processor {
19 /* MISC
20 * get data abort address/flags
21 */
22 void (*_data_abort)(unsigned long pc);
23 /*
24 * Retrieve prefetch fault address
25 */
26 unsigned long (*_prefetch_abort)(unsigned long lr);
27 /*
28 * Set up any processor specifics
29 */
30 void (*_proc_init)(void);
31 /*
32 * Disable any processor specifics
33 */
34 void (*_proc_fin)(void);
35 /*
36 * Special stuff for a reset
37 */
38 void (*reset)(unsigned long addr) __attribute__((noreturn));
39 /*
40 * Idle the processor
41 */
42 int (*_do_idle)(void);
43 /*
44 * Processor architecture specific
45 */
46 /*
47 * clean a virtual address range from the
48 * D-cache without flushing the cache.
49 */
50 void (*dcache_clean_area)(void *addr, int size);
51
52 /*
53 * Set the page table
54 */
55 void (*switch_mm)(unsigned long pgd_phys, struct mm_struct *mm);
56 /*
57 * Set a possibly extended PTE. Non-extended PTEs should
58 * ignore 'ext'.
59 */
60 void (*set_pte_ext)(pte_t *ptep, pte_t pte, unsigned int ext);
61} processor;
62
63#define cpu_proc_init() processor._proc_init()
64#define cpu_proc_fin() processor._proc_fin()
65#define cpu_reset(addr) processor.reset(addr)
66#define cpu_do_idle() processor._do_idle()
67#define cpu_dcache_clean_area(addr,sz) processor.dcache_clean_area(addr,sz)
68#define cpu_set_pte_ext(ptep,pte,ext) processor.set_pte_ext(ptep,pte,ext)
69#define cpu_do_switch_mm(pgd,mm) processor.switch_mm(pgd,mm)
diff --git a/arch/arm/include/asm/cpu-single.h b/arch/arm/include/asm/cpu-single.h
deleted file mode 100644
index f073a6d2a406..000000000000
--- a/arch/arm/include/asm/cpu-single.h
+++ /dev/null
@@ -1,44 +0,0 @@
1/*
2 * arch/arm/include/asm/cpu-single.h
3 *
4 * Copyright (C) 2000 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10/*
11 * Single CPU
12 */
13#ifdef __STDC__
14#define __catify_fn(name,x) name##x
15#else
16#define __catify_fn(name,x) name/**/x
17#endif
18#define __cpu_fn(name,x) __catify_fn(name,x)
19
20/*
21 * If we are supporting multiple CPUs, then we must use a table of
22 * function pointers for this lot. Otherwise, we can optimise the
23 * table away.
24 */
25#define cpu_proc_init __cpu_fn(CPU_NAME,_proc_init)
26#define cpu_proc_fin __cpu_fn(CPU_NAME,_proc_fin)
27#define cpu_reset __cpu_fn(CPU_NAME,_reset)
28#define cpu_do_idle __cpu_fn(CPU_NAME,_do_idle)
29#define cpu_dcache_clean_area __cpu_fn(CPU_NAME,_dcache_clean_area)
30#define cpu_do_switch_mm __cpu_fn(CPU_NAME,_switch_mm)
31#define cpu_set_pte_ext __cpu_fn(CPU_NAME,_set_pte_ext)
32
33#include <asm/page.h>
34
35struct mm_struct;
36
37/* declare all the functions as extern */
38extern void cpu_proc_init(void);
39extern void cpu_proc_fin(void);
40extern int cpu_do_idle(void);
41extern void cpu_dcache_clean_area(void *, int);
42extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm);
43extern void cpu_set_pte_ext(pte_t *ptep, pte_t pte, unsigned int ext);
44extern void cpu_reset(unsigned long addr) __attribute__((noreturn));
diff --git a/arch/arm/include/asm/cputype.h b/arch/arm/include/asm/cputype.h
index 20ae96cc0020..ed5bc9e05a4e 100644
--- a/arch/arm/include/asm/cputype.h
+++ b/arch/arm/include/asm/cputype.h
@@ -23,6 +23,8 @@
23#define CPUID_EXT_ISAR4 "c2, 4" 23#define CPUID_EXT_ISAR4 "c2, 4"
24#define CPUID_EXT_ISAR5 "c2, 5" 24#define CPUID_EXT_ISAR5 "c2, 5"
25 25
26extern unsigned int processor_id;
27
26#ifdef CONFIG_CPU_CP15 28#ifdef CONFIG_CPU_CP15
27#define read_cpuid(reg) \ 29#define read_cpuid(reg) \
28 ({ \ 30 ({ \
@@ -43,7 +45,6 @@
43 __val; \ 45 __val; \
44 }) 46 })
45#else 47#else
46extern unsigned int processor_id;
47#define read_cpuid(reg) (processor_id) 48#define read_cpuid(reg) (processor_id)
48#define read_cpuid_ext(reg) 0 49#define read_cpuid_ext(reg) 0
49#endif 50#endif
diff --git a/arch/arm/include/asm/fncpy.h b/arch/arm/include/asm/fncpy.h
new file mode 100644
index 000000000000..de5354746924
--- /dev/null
+++ b/arch/arm/include/asm/fncpy.h
@@ -0,0 +1,94 @@
1/*
2 * arch/arm/include/asm/fncpy.h - helper macros for function body copying
3 *
4 * Copyright (C) 2011 Linaro Limited
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20/*
21 * These macros are intended for use when there is a need to copy a low-level
22 * function body into special memory.
23 *
24 * For example, when reconfiguring the SDRAM controller, the code doing the
25 * reconfiguration may need to run from SRAM.
26 *
27 * NOTE: that the copied function body must be entirely self-contained and
28 * position-independent in order for this to work properly.
29 *
30 * NOTE: in order for embedded literals and data to get referenced correctly,
31 * the alignment of functions must be preserved when copying. To ensure this,
32 * the source and destination addresses for fncpy() must be aligned to a
33 * multiple of 8 bytes: you will be get a BUG() if this condition is not met.
34 * You will typically need a ".align 3" directive in the assembler where the
35 * function to be copied is defined, and ensure that your allocator for the
36 * destination buffer returns 8-byte-aligned pointers.
37 *
38 * Typical usage example:
39 *
40 * extern int f(args);
41 * extern uint32_t size_of_f;
42 * int (*copied_f)(args);
43 * void *sram_buffer;
44 *
45 * copied_f = fncpy(sram_buffer, &f, size_of_f);
46 *
47 * ... later, call the function: ...
48 *
49 * copied_f(args);
50 *
51 * The size of the function to be copied can't be determined from C:
52 * this must be determined by other means, such as adding assmbler directives
53 * in the file where f is defined.
54 */
55
56#ifndef __ASM_FNCPY_H
57#define __ASM_FNCPY_H
58
59#include <linux/types.h>
60#include <linux/string.h>
61
62#include <asm/bug.h>
63#include <asm/cacheflush.h>
64
65/*
66 * Minimum alignment requirement for the source and destination addresses
67 * for function copying.
68 */
69#define FNCPY_ALIGN 8
70
71#define fncpy(dest_buf, funcp, size) ({ \
72 uintptr_t __funcp_address; \
73 typeof(funcp) __result; \
74 \
75 asm("" : "=r" (__funcp_address) : "0" (funcp)); \
76 \
77 /* \
78 * Ensure alignment of source and destination addresses, \
79 * disregarding the function's Thumb bit: \
80 */ \
81 BUG_ON((uintptr_t)(dest_buf) & (FNCPY_ALIGN - 1) || \
82 (__funcp_address & ~(uintptr_t)1 & (FNCPY_ALIGN - 1))); \
83 \
84 memcpy(dest_buf, (void const *)(__funcp_address & ~1), size); \
85 flush_icache_range((unsigned long)(dest_buf), \
86 (unsigned long)(dest_buf) + (size)); \
87 \
88 asm("" : "=r" (__result) \
89 : "0" ((uintptr_t)(dest_buf) | (__funcp_address & 1))); \
90 \
91 __result; \
92})
93
94#endif /* !__ASM_FNCPY_H */
diff --git a/arch/arm/include/asm/futex.h b/arch/arm/include/asm/futex.h
index b33fe7065b38..199a6b6de7f4 100644
--- a/arch/arm/include/asm/futex.h
+++ b/arch/arm/include/asm/futex.h
@@ -35,7 +35,7 @@
35 : "cc", "memory") 35 : "cc", "memory")
36 36
37static inline int 37static inline int
38futex_atomic_op_inuser (int encoded_op, int __user *uaddr) 38futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr)
39{ 39{
40 int op = (encoded_op >> 28) & 7; 40 int op = (encoded_op >> 28) & 7;
41 int cmp = (encoded_op >> 24) & 15; 41 int cmp = (encoded_op >> 24) & 15;
@@ -46,7 +46,7 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
46 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) 46 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
47 oparg = 1 << oparg; 47 oparg = 1 << oparg;
48 48
49 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) 49 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
50 return -EFAULT; 50 return -EFAULT;
51 51
52 pagefault_disable(); /* implies preempt_disable() */ 52 pagefault_disable(); /* implies preempt_disable() */
@@ -88,36 +88,35 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
88} 88}
89 89
90static inline int 90static inline int
91futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) 91futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
92 u32 oldval, u32 newval)
92{ 93{
93 int val; 94 int ret = 0;
95 u32 val;
94 96
95 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) 97 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
96 return -EFAULT; 98 return -EFAULT;
97 99
98 pagefault_disable(); /* implies preempt_disable() */
99
100 __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n" 100 __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n"
101 "1: " T(ldr) " %0, [%3]\n" 101 "1: " T(ldr) " %1, [%4]\n"
102 " teq %0, %1\n" 102 " teq %1, %2\n"
103 " it eq @ explicit IT needed for the 2b label\n" 103 " it eq @ explicit IT needed for the 2b label\n"
104 "2: " T(streq) " %2, [%3]\n" 104 "2: " T(streq) " %3, [%4]\n"
105 "3:\n" 105 "3:\n"
106 " .pushsection __ex_table,\"a\"\n" 106 " .pushsection __ex_table,\"a\"\n"
107 " .align 3\n" 107 " .align 3\n"
108 " .long 1b, 4f, 2b, 4f\n" 108 " .long 1b, 4f, 2b, 4f\n"
109 " .popsection\n" 109 " .popsection\n"
110 " .pushsection .fixup,\"ax\"\n" 110 " .pushsection .fixup,\"ax\"\n"
111 "4: mov %0, %4\n" 111 "4: mov %0, %5\n"
112 " b 3b\n" 112 " b 3b\n"
113 " .popsection" 113 " .popsection"
114 : "=&r" (val) 114 : "+r" (ret), "=&r" (val)
115 : "r" (oldval), "r" (newval), "r" (uaddr), "Ir" (-EFAULT) 115 : "r" (oldval), "r" (newval), "r" (uaddr), "Ir" (-EFAULT)
116 : "cc", "memory"); 116 : "cc", "memory");
117 117
118 pagefault_enable(); /* subsumes preempt_enable() */ 118 *uval = val;
119 119 return ret;
120 return val;
121} 120}
122 121
123#endif /* !SMP */ 122#endif /* !SMP */
diff --git a/arch/arm/include/asm/glue-cache.h b/arch/arm/include/asm/glue-cache.h
new file mode 100644
index 000000000000..c7afbc552c7f
--- /dev/null
+++ b/arch/arm/include/asm/glue-cache.h
@@ -0,0 +1,146 @@
1/*
2 * arch/arm/include/asm/glue-cache.h
3 *
4 * Copyright (C) 1999-2002 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef ASM_GLUE_CACHE_H
11#define ASM_GLUE_CACHE_H
12
13#include <asm/glue.h>
14
15/*
16 * Cache Model
17 * ===========
18 */
19#undef _CACHE
20#undef MULTI_CACHE
21
22#if defined(CONFIG_CPU_CACHE_V3)
23# ifdef _CACHE
24# define MULTI_CACHE 1
25# else
26# define _CACHE v3
27# endif
28#endif
29
30#if defined(CONFIG_CPU_CACHE_V4)
31# ifdef _CACHE
32# define MULTI_CACHE 1
33# else
34# define _CACHE v4
35# endif
36#endif
37
38#if defined(CONFIG_CPU_ARM920T) || defined(CONFIG_CPU_ARM922T) || \
39 defined(CONFIG_CPU_ARM925T) || defined(CONFIG_CPU_ARM1020) || \
40 defined(CONFIG_CPU_ARM1026)
41# define MULTI_CACHE 1
42#endif
43
44#if defined(CONFIG_CPU_FA526)
45# ifdef _CACHE
46# define MULTI_CACHE 1
47# else
48# define _CACHE fa
49# endif
50#endif
51
52#if defined(CONFIG_CPU_ARM926T)
53# ifdef _CACHE
54# define MULTI_CACHE 1
55# else
56# define _CACHE arm926
57# endif
58#endif
59
60#if defined(CONFIG_CPU_ARM940T)
61# ifdef _CACHE
62# define MULTI_CACHE 1
63# else
64# define _CACHE arm940
65# endif
66#endif
67
68#if defined(CONFIG_CPU_ARM946E)
69# ifdef _CACHE
70# define MULTI_CACHE 1
71# else
72# define _CACHE arm946
73# endif
74#endif
75
76#if defined(CONFIG_CPU_CACHE_V4WB)
77# ifdef _CACHE
78# define MULTI_CACHE 1
79# else
80# define _CACHE v4wb
81# endif
82#endif
83
84#if defined(CONFIG_CPU_XSCALE)
85# ifdef _CACHE
86# define MULTI_CACHE 1
87# else
88# define _CACHE xscale
89# endif
90#endif
91
92#if defined(CONFIG_CPU_XSC3)
93# ifdef _CACHE
94# define MULTI_CACHE 1
95# else
96# define _CACHE xsc3
97# endif
98#endif
99
100#if defined(CONFIG_CPU_MOHAWK)
101# ifdef _CACHE
102# define MULTI_CACHE 1
103# else
104# define _CACHE mohawk
105# endif
106#endif
107
108#if defined(CONFIG_CPU_FEROCEON)
109# define MULTI_CACHE 1
110#endif
111
112#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
113//# ifdef _CACHE
114# define MULTI_CACHE 1
115//# else
116//# define _CACHE v6
117//# endif
118#endif
119
120#if defined(CONFIG_CPU_V7)
121//# ifdef _CACHE
122# define MULTI_CACHE 1
123//# else
124//# define _CACHE v7
125//# endif
126#endif
127
128#if !defined(_CACHE) && !defined(MULTI_CACHE)
129#error Unknown cache maintainence model
130#endif
131
132#ifndef MULTI_CACHE
133#define __cpuc_flush_icache_all __glue(_CACHE,_flush_icache_all)
134#define __cpuc_flush_kern_all __glue(_CACHE,_flush_kern_cache_all)
135#define __cpuc_flush_user_all __glue(_CACHE,_flush_user_cache_all)
136#define __cpuc_flush_user_range __glue(_CACHE,_flush_user_cache_range)
137#define __cpuc_coherent_kern_range __glue(_CACHE,_coherent_kern_range)
138#define __cpuc_coherent_user_range __glue(_CACHE,_coherent_user_range)
139#define __cpuc_flush_dcache_area __glue(_CACHE,_flush_kern_dcache_area)
140
141#define dmac_map_area __glue(_CACHE,_dma_map_area)
142#define dmac_unmap_area __glue(_CACHE,_dma_unmap_area)
143#define dmac_flush_range __glue(_CACHE,_dma_flush_range)
144#endif
145
146#endif
diff --git a/arch/arm/include/asm/glue-df.h b/arch/arm/include/asm/glue-df.h
new file mode 100644
index 000000000000..354d571e8bcc
--- /dev/null
+++ b/arch/arm/include/asm/glue-df.h
@@ -0,0 +1,110 @@
1/*
2 * arch/arm/include/asm/glue-df.h
3 *
4 * Copyright (C) 1997-1999 Russell King
5 * Copyright (C) 2000-2002 Deep Blue Solutions Ltd.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef ASM_GLUE_DF_H
12#define ASM_GLUE_DF_H
13
14#include <asm/glue.h>
15
16/*
17 * Data Abort Model
18 * ================
19 *
20 * We have the following to choose from:
21 * arm6 - ARM6 style
22 * arm7 - ARM7 style
23 * v4_early - ARMv4 without Thumb early abort handler
24 * v4t_late - ARMv4 with Thumb late abort handler
25 * v4t_early - ARMv4 with Thumb early abort handler
26 * v5tej_early - ARMv5 with Thumb and Java early abort handler
27 * xscale - ARMv5 with Thumb with Xscale extensions
28 * v6_early - ARMv6 generic early abort handler
29 * v7_early - ARMv7 generic early abort handler
30 */
31#undef CPU_DABORT_HANDLER
32#undef MULTI_DABORT
33
34#if defined(CONFIG_CPU_ARM610)
35# ifdef CPU_DABORT_HANDLER
36# define MULTI_DABORT 1
37# else
38# define CPU_DABORT_HANDLER cpu_arm6_data_abort
39# endif
40#endif
41
42#if defined(CONFIG_CPU_ARM710)
43# ifdef CPU_DABORT_HANDLER
44# define MULTI_DABORT 1
45# else
46# define CPU_DABORT_HANDLER cpu_arm7_data_abort
47# endif
48#endif
49
50#ifdef CONFIG_CPU_ABRT_LV4T
51# ifdef CPU_DABORT_HANDLER
52# define MULTI_DABORT 1
53# else
54# define CPU_DABORT_HANDLER v4t_late_abort
55# endif
56#endif
57
58#ifdef CONFIG_CPU_ABRT_EV4
59# ifdef CPU_DABORT_HANDLER
60# define MULTI_DABORT 1
61# else
62# define CPU_DABORT_HANDLER v4_early_abort
63# endif
64#endif
65
66#ifdef CONFIG_CPU_ABRT_EV4T
67# ifdef CPU_DABORT_HANDLER
68# define MULTI_DABORT 1
69# else
70# define CPU_DABORT_HANDLER v4t_early_abort
71# endif
72#endif
73
74#ifdef CONFIG_CPU_ABRT_EV5TJ
75# ifdef CPU_DABORT_HANDLER
76# define MULTI_DABORT 1
77# else
78# define CPU_DABORT_HANDLER v5tj_early_abort
79# endif
80#endif
81
82#ifdef CONFIG_CPU_ABRT_EV5T
83# ifdef CPU_DABORT_HANDLER
84# define MULTI_DABORT 1
85# else
86# define CPU_DABORT_HANDLER v5t_early_abort
87# endif
88#endif
89
90#ifdef CONFIG_CPU_ABRT_EV6
91# ifdef CPU_DABORT_HANDLER
92# define MULTI_DABORT 1
93# else
94# define CPU_DABORT_HANDLER v6_early_abort
95# endif
96#endif
97
98#ifdef CONFIG_CPU_ABRT_EV7
99# ifdef CPU_DABORT_HANDLER
100# define MULTI_DABORT 1
101# else
102# define CPU_DABORT_HANDLER v7_early_abort
103# endif
104#endif
105
106#ifndef CPU_DABORT_HANDLER
107#error Unknown data abort handler type
108#endif
109
110#endif
diff --git a/arch/arm/include/asm/glue-pf.h b/arch/arm/include/asm/glue-pf.h
new file mode 100644
index 000000000000..d385f37c13f0
--- /dev/null
+++ b/arch/arm/include/asm/glue-pf.h
@@ -0,0 +1,57 @@
1/*
2 * arch/arm/include/asm/glue-pf.h
3 *
4 * Copyright (C) 1997-1999 Russell King
5 * Copyright (C) 2000-2002 Deep Blue Solutions Ltd.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef ASM_GLUE_PF_H
12#define ASM_GLUE_PF_H
13
14#include <asm/glue.h>
15
16/*
17 * Prefetch Abort Model
18 * ================
19 *
20 * We have the following to choose from:
21 * legacy - no IFSR, no IFAR
22 * v6 - ARMv6: IFSR, no IFAR
23 * v7 - ARMv7: IFSR and IFAR
24 */
25
26#undef CPU_PABORT_HANDLER
27#undef MULTI_PABORT
28
29#ifdef CONFIG_CPU_PABRT_LEGACY
30# ifdef CPU_PABORT_HANDLER
31# define MULTI_PABORT 1
32# else
33# define CPU_PABORT_HANDLER legacy_pabort
34# endif
35#endif
36
37#ifdef CONFIG_CPU_PABRT_V6
38# ifdef CPU_PABORT_HANDLER
39# define MULTI_PABORT 1
40# else
41# define CPU_PABORT_HANDLER v6_pabort
42# endif
43#endif
44
45#ifdef CONFIG_CPU_PABRT_V7
46# ifdef CPU_PABORT_HANDLER
47# define MULTI_PABORT 1
48# else
49# define CPU_PABORT_HANDLER v7_pabort
50# endif
51#endif
52
53#ifndef CPU_PABORT_HANDLER
54#error Unknown prefetch abort handler type
55#endif
56
57#endif
diff --git a/arch/arm/include/asm/glue-proc.h b/arch/arm/include/asm/glue-proc.h
new file mode 100644
index 000000000000..e2be7f142668
--- /dev/null
+++ b/arch/arm/include/asm/glue-proc.h
@@ -0,0 +1,264 @@
1/*
2 * arch/arm/include/asm/glue-proc.h
3 *
4 * Copyright (C) 1997-1999 Russell King
5 * Copyright (C) 2000 Deep Blue Solutions Ltd
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef ASM_GLUE_PROC_H
12#define ASM_GLUE_PROC_H
13
14#include <asm/glue.h>
15
16/*
17 * Work out if we need multiple CPU support
18 */
19#undef MULTI_CPU
20#undef CPU_NAME
21
22/*
23 * CPU_NAME - the prefix for CPU related functions
24 */
25
26#ifdef CONFIG_CPU_ARM610
27# ifdef CPU_NAME
28# undef MULTI_CPU
29# define MULTI_CPU
30# else
31# define CPU_NAME cpu_arm6
32# endif
33#endif
34
35#ifdef CONFIG_CPU_ARM7TDMI
36# ifdef CPU_NAME
37# undef MULTI_CPU
38# define MULTI_CPU
39# else
40# define CPU_NAME cpu_arm7tdmi
41# endif
42#endif
43
44#ifdef CONFIG_CPU_ARM710
45# ifdef CPU_NAME
46# undef MULTI_CPU
47# define MULTI_CPU
48# else
49# define CPU_NAME cpu_arm7
50# endif
51#endif
52
53#ifdef CONFIG_CPU_ARM720T
54# ifdef CPU_NAME
55# undef MULTI_CPU
56# define MULTI_CPU
57# else
58# define CPU_NAME cpu_arm720
59# endif
60#endif
61
62#ifdef CONFIG_CPU_ARM740T
63# ifdef CPU_NAME
64# undef MULTI_CPU
65# define MULTI_CPU
66# else
67# define CPU_NAME cpu_arm740
68# endif
69#endif
70
71#ifdef CONFIG_CPU_ARM9TDMI
72# ifdef CPU_NAME
73# undef MULTI_CPU
74# define MULTI_CPU
75# else
76# define CPU_NAME cpu_arm9tdmi
77# endif
78#endif
79
80#ifdef CONFIG_CPU_ARM920T
81# ifdef CPU_NAME
82# undef MULTI_CPU
83# define MULTI_CPU
84# else
85# define CPU_NAME cpu_arm920
86# endif
87#endif
88
89#ifdef CONFIG_CPU_ARM922T
90# ifdef CPU_NAME
91# undef MULTI_CPU
92# define MULTI_CPU
93# else
94# define CPU_NAME cpu_arm922
95# endif
96#endif
97
98#ifdef CONFIG_CPU_FA526
99# ifdef CPU_NAME
100# undef MULTI_CPU
101# define MULTI_CPU
102# else
103# define CPU_NAME cpu_fa526
104# endif
105#endif
106
107#ifdef CONFIG_CPU_ARM925T
108# ifdef CPU_NAME
109# undef MULTI_CPU
110# define MULTI_CPU
111# else
112# define CPU_NAME cpu_arm925
113# endif
114#endif
115
116#ifdef CONFIG_CPU_ARM926T
117# ifdef CPU_NAME
118# undef MULTI_CPU
119# define MULTI_CPU
120# else
121# define CPU_NAME cpu_arm926
122# endif
123#endif
124
125#ifdef CONFIG_CPU_ARM940T
126# ifdef CPU_NAME
127# undef MULTI_CPU
128# define MULTI_CPU
129# else
130# define CPU_NAME cpu_arm940
131# endif
132#endif
133
134#ifdef CONFIG_CPU_ARM946E
135# ifdef CPU_NAME
136# undef MULTI_CPU
137# define MULTI_CPU
138# else
139# define CPU_NAME cpu_arm946
140# endif
141#endif
142
143#ifdef CONFIG_CPU_SA110
144# ifdef CPU_NAME
145# undef MULTI_CPU
146# define MULTI_CPU
147# else
148# define CPU_NAME cpu_sa110
149# endif
150#endif
151
152#ifdef CONFIG_CPU_SA1100
153# ifdef CPU_NAME
154# undef MULTI_CPU
155# define MULTI_CPU
156# else
157# define CPU_NAME cpu_sa1100
158# endif
159#endif
160
161#ifdef CONFIG_CPU_ARM1020
162# ifdef CPU_NAME
163# undef MULTI_CPU
164# define MULTI_CPU
165# else
166# define CPU_NAME cpu_arm1020
167# endif
168#endif
169
170#ifdef CONFIG_CPU_ARM1020E
171# ifdef CPU_NAME
172# undef MULTI_CPU
173# define MULTI_CPU
174# else
175# define CPU_NAME cpu_arm1020e
176# endif
177#endif
178
179#ifdef CONFIG_CPU_ARM1022
180# ifdef CPU_NAME
181# undef MULTI_CPU
182# define MULTI_CPU
183# else
184# define CPU_NAME cpu_arm1022
185# endif
186#endif
187
188#ifdef CONFIG_CPU_ARM1026
189# ifdef CPU_NAME
190# undef MULTI_CPU
191# define MULTI_CPU
192# else
193# define CPU_NAME cpu_arm1026
194# endif
195#endif
196
197#ifdef CONFIG_CPU_XSCALE
198# ifdef CPU_NAME
199# undef MULTI_CPU
200# define MULTI_CPU
201# else
202# define CPU_NAME cpu_xscale
203# endif
204#endif
205
206#ifdef CONFIG_CPU_XSC3
207# ifdef CPU_NAME
208# undef MULTI_CPU
209# define MULTI_CPU
210# else
211# define CPU_NAME cpu_xsc3
212# endif
213#endif
214
215#ifdef CONFIG_CPU_MOHAWK
216# ifdef CPU_NAME
217# undef MULTI_CPU
218# define MULTI_CPU
219# else
220# define CPU_NAME cpu_mohawk
221# endif
222#endif
223
224#ifdef CONFIG_CPU_FEROCEON
225# ifdef CPU_NAME
226# undef MULTI_CPU
227# define MULTI_CPU
228# else
229# define CPU_NAME cpu_feroceon
230# endif
231#endif
232
233#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
234# ifdef CPU_NAME
235# undef MULTI_CPU
236# define MULTI_CPU
237# else
238# define CPU_NAME cpu_v6
239# endif
240#endif
241
242#ifdef CONFIG_CPU_V7
243# ifdef CPU_NAME
244# undef MULTI_CPU
245# define MULTI_CPU
246# else
247# define CPU_NAME cpu_v7
248# endif
249#endif
250
251#ifndef MULTI_CPU
252#define cpu_proc_init __glue(CPU_NAME,_proc_init)
253#define cpu_proc_fin __glue(CPU_NAME,_proc_fin)
254#define cpu_reset __glue(CPU_NAME,_reset)
255#define cpu_do_idle __glue(CPU_NAME,_do_idle)
256#define cpu_dcache_clean_area __glue(CPU_NAME,_dcache_clean_area)
257#define cpu_do_switch_mm __glue(CPU_NAME,_switch_mm)
258#define cpu_set_pte_ext __glue(CPU_NAME,_set_pte_ext)
259#define cpu_suspend_size __glue(CPU_NAME,_suspend_size)
260#define cpu_do_suspend __glue(CPU_NAME,_do_suspend)
261#define cpu_do_resume __glue(CPU_NAME,_do_resume)
262#endif
263
264#endif
diff --git a/arch/arm/include/asm/glue.h b/arch/arm/include/asm/glue.h
index 234a3fc1c78e..0ec35d1698aa 100644
--- a/arch/arm/include/asm/glue.h
+++ b/arch/arm/include/asm/glue.h
@@ -15,7 +15,6 @@
15 */ 15 */
16#ifdef __KERNEL__ 16#ifdef __KERNEL__
17 17
18
19#ifdef __STDC__ 18#ifdef __STDC__
20#define ____glue(name,fn) name##fn 19#define ____glue(name,fn) name##fn
21#else 20#else
@@ -23,141 +22,4 @@
23#endif 22#endif
24#define __glue(name,fn) ____glue(name,fn) 23#define __glue(name,fn) ____glue(name,fn)
25 24
26
27
28/*
29 * Data Abort Model
30 * ================
31 *
32 * We have the following to choose from:
33 * arm6 - ARM6 style
34 * arm7 - ARM7 style
35 * v4_early - ARMv4 without Thumb early abort handler
36 * v4t_late - ARMv4 with Thumb late abort handler
37 * v4t_early - ARMv4 with Thumb early abort handler
38 * v5tej_early - ARMv5 with Thumb and Java early abort handler
39 * xscale - ARMv5 with Thumb with Xscale extensions
40 * v6_early - ARMv6 generic early abort handler
41 * v7_early - ARMv7 generic early abort handler
42 */
43#undef CPU_DABORT_HANDLER
44#undef MULTI_DABORT
45
46#if defined(CONFIG_CPU_ARM610)
47# ifdef CPU_DABORT_HANDLER
48# define MULTI_DABORT 1
49# else
50# define CPU_DABORT_HANDLER cpu_arm6_data_abort
51# endif
52#endif
53
54#if defined(CONFIG_CPU_ARM710)
55# ifdef CPU_DABORT_HANDLER
56# define MULTI_DABORT 1
57# else
58# define CPU_DABORT_HANDLER cpu_arm7_data_abort
59# endif
60#endif
61
62#ifdef CONFIG_CPU_ABRT_LV4T
63# ifdef CPU_DABORT_HANDLER
64# define MULTI_DABORT 1
65# else
66# define CPU_DABORT_HANDLER v4t_late_abort
67# endif
68#endif
69
70#ifdef CONFIG_CPU_ABRT_EV4
71# ifdef CPU_DABORT_HANDLER
72# define MULTI_DABORT 1
73# else
74# define CPU_DABORT_HANDLER v4_early_abort
75# endif
76#endif
77
78#ifdef CONFIG_CPU_ABRT_EV4T
79# ifdef CPU_DABORT_HANDLER
80# define MULTI_DABORT 1
81# else
82# define CPU_DABORT_HANDLER v4t_early_abort
83# endif
84#endif
85
86#ifdef CONFIG_CPU_ABRT_EV5TJ
87# ifdef CPU_DABORT_HANDLER
88# define MULTI_DABORT 1
89# else
90# define CPU_DABORT_HANDLER v5tj_early_abort
91# endif
92#endif
93
94#ifdef CONFIG_CPU_ABRT_EV5T
95# ifdef CPU_DABORT_HANDLER
96# define MULTI_DABORT 1
97# else
98# define CPU_DABORT_HANDLER v5t_early_abort
99# endif
100#endif
101
102#ifdef CONFIG_CPU_ABRT_EV6
103# ifdef CPU_DABORT_HANDLER
104# define MULTI_DABORT 1
105# else
106# define CPU_DABORT_HANDLER v6_early_abort
107# endif
108#endif
109
110#ifdef CONFIG_CPU_ABRT_EV7
111# ifdef CPU_DABORT_HANDLER
112# define MULTI_DABORT 1
113# else
114# define CPU_DABORT_HANDLER v7_early_abort
115# endif
116#endif
117
118#ifndef CPU_DABORT_HANDLER
119#error Unknown data abort handler type
120#endif
121
122/*
123 * Prefetch Abort Model
124 * ================
125 *
126 * We have the following to choose from:
127 * legacy - no IFSR, no IFAR
128 * v6 - ARMv6: IFSR, no IFAR
129 * v7 - ARMv7: IFSR and IFAR
130 */
131
132#undef CPU_PABORT_HANDLER
133#undef MULTI_PABORT
134
135#ifdef CONFIG_CPU_PABRT_LEGACY
136# ifdef CPU_PABORT_HANDLER
137# define MULTI_PABORT 1
138# else
139# define CPU_PABORT_HANDLER legacy_pabort
140# endif
141#endif
142
143#ifdef CONFIG_CPU_PABRT_V6
144# ifdef CPU_PABORT_HANDLER
145# define MULTI_PABORT 1
146# else
147# define CPU_PABORT_HANDLER v6_pabort
148# endif
149#endif
150
151#ifdef CONFIG_CPU_PABRT_V7
152# ifdef CPU_PABORT_HANDLER
153# define MULTI_PABORT 1
154# else
155# define CPU_PABORT_HANDLER v7_pabort
156# endif
157#endif
158
159#ifndef CPU_PABORT_HANDLER
160#error Unknown prefetch abort handler type
161#endif
162
163#endif 25#endif
diff --git a/arch/arm/include/asm/hardware/cache-l2x0.h b/arch/arm/include/asm/hardware/cache-l2x0.h
index 5aeec1e1735c..16bd48031583 100644
--- a/arch/arm/include/asm/hardware/cache-l2x0.h
+++ b/arch/arm/include/asm/hardware/cache-l2x0.h
@@ -36,6 +36,7 @@
36#define L2X0_RAW_INTR_STAT 0x21C 36#define L2X0_RAW_INTR_STAT 0x21C
37#define L2X0_INTR_CLEAR 0x220 37#define L2X0_INTR_CLEAR 0x220
38#define L2X0_CACHE_SYNC 0x730 38#define L2X0_CACHE_SYNC 0x730
39#define L2X0_DUMMY_REG 0x740
39#define L2X0_INV_LINE_PA 0x770 40#define L2X0_INV_LINE_PA 0x770
40#define L2X0_INV_WAY 0x77C 41#define L2X0_INV_WAY 0x77C
41#define L2X0_CLEAN_LINE_PA 0x7B0 42#define L2X0_CLEAN_LINE_PA 0x7B0
diff --git a/arch/arm/include/asm/hardware/gic.h b/arch/arm/include/asm/hardware/gic.h
index 84557d321001..0691f9dcc500 100644
--- a/arch/arm/include/asm/hardware/gic.h
+++ b/arch/arm/include/asm/hardware/gic.h
@@ -34,6 +34,7 @@
34 34
35#ifndef __ASSEMBLY__ 35#ifndef __ASSEMBLY__
36extern void __iomem *gic_cpu_base_addr; 36extern void __iomem *gic_cpu_base_addr;
37extern struct irq_chip gic_arch_extn;
37 38
38void gic_init(unsigned int, unsigned int, void __iomem *, void __iomem *); 39void gic_init(unsigned int, unsigned int, void __iomem *, void __iomem *);
39void gic_secondary_init(unsigned int); 40void gic_secondary_init(unsigned int);
diff --git a/arch/arm/include/asm/hardware/sp810.h b/arch/arm/include/asm/hardware/sp810.h
index a101f10bb5b1..e0d1c0cfa548 100644
--- a/arch/arm/include/asm/hardware/sp810.h
+++ b/arch/arm/include/asm/hardware/sp810.h
@@ -50,8 +50,17 @@
50#define SCPCELLID2 0xFF8 50#define SCPCELLID2 0xFF8
51#define SCPCELLID3 0xFFC 51#define SCPCELLID3 0xFFC
52 52
53#define SCCTRL_TIMEREN0SEL_REFCLK (0 << 15)
54#define SCCTRL_TIMEREN0SEL_TIMCLK (1 << 15)
55
56#define SCCTRL_TIMEREN1SEL_REFCLK (0 << 17)
57#define SCCTRL_TIMEREN1SEL_TIMCLK (1 << 17)
58
53static inline void sysctl_soft_reset(void __iomem *base) 59static inline void sysctl_soft_reset(void __iomem *base)
54{ 60{
61 /* switch to slow mode */
62 writel(0x2, base + SCCTRL);
63
55 /* writing any value to SCSYSSTAT reg will reset system */ 64 /* writing any value to SCSYSSTAT reg will reset system */
56 writel(0, base + SCSYSSTAT); 65 writel(0, base + SCSYSSTAT);
57} 66}
diff --git a/arch/arm/include/asm/highmem.h b/arch/arm/include/asm/highmem.h
index 7080e2c8fa62..a4edd19dd3d6 100644
--- a/arch/arm/include/asm/highmem.h
+++ b/arch/arm/include/asm/highmem.h
@@ -19,11 +19,36 @@
19 19
20extern pte_t *pkmap_page_table; 20extern pte_t *pkmap_page_table;
21 21
22extern void *kmap_high(struct page *page);
23extern void kunmap_high(struct page *page);
24
25/*
26 * The reason for kmap_high_get() is to ensure that the currently kmap'd
27 * page usage count does not decrease to zero while we're using its
28 * existing virtual mapping in an atomic context. With a VIVT cache this
29 * is essential to do, but with a VIPT cache this is only an optimization
30 * so not to pay the price of establishing a second mapping if an existing
31 * one can be used. However, on platforms without hardware TLB maintenance
32 * broadcast, we simply cannot use ARCH_NEEDS_KMAP_HIGH_GET at all since
33 * the locking involved must also disable IRQs which is incompatible with
34 * the IPI mechanism used by global TLB operations.
35 */
22#define ARCH_NEEDS_KMAP_HIGH_GET 36#define ARCH_NEEDS_KMAP_HIGH_GET
37#if defined(CONFIG_SMP) && defined(CONFIG_CPU_TLB_V6)
38#undef ARCH_NEEDS_KMAP_HIGH_GET
39#if defined(CONFIG_HIGHMEM) && defined(CONFIG_CPU_CACHE_VIVT)
40#error "The sum of features in your kernel config cannot be supported together"
41#endif
42#endif
23 43
24extern void *kmap_high(struct page *page); 44#ifdef ARCH_NEEDS_KMAP_HIGH_GET
25extern void *kmap_high_get(struct page *page); 45extern void *kmap_high_get(struct page *page);
26extern void kunmap_high(struct page *page); 46#else
47static inline void *kmap_high_get(struct page *page)
48{
49 return NULL;
50}
51#endif
27 52
28/* 53/*
29 * The following functions are already defined by <linux/highmem.h> 54 * The following functions are already defined by <linux/highmem.h>
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index 20e0f7c9e03e..d66605dea55a 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -95,6 +95,15 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
95 return (void __iomem *)addr; 95 return (void __iomem *)addr;
96} 96}
97 97
98/* IO barriers */
99#ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
100#define __iormb() rmb()
101#define __iowmb() wmb()
102#else
103#define __iormb() do { } while (0)
104#define __iowmb() do { } while (0)
105#endif
106
98/* 107/*
99 * Now, pick up the machine-defined IO definitions 108 * Now, pick up the machine-defined IO definitions
100 */ 109 */
@@ -125,17 +134,17 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
125 * The {in,out}[bwl] macros are for emulating x86-style PCI/ISA IO space. 134 * The {in,out}[bwl] macros are for emulating x86-style PCI/ISA IO space.
126 */ 135 */
127#ifdef __io 136#ifdef __io
128#define outb(v,p) __raw_writeb(v,__io(p)) 137#define outb(v,p) ({ __iowmb(); __raw_writeb(v,__io(p)); })
129#define outw(v,p) __raw_writew((__force __u16) \ 138#define outw(v,p) ({ __iowmb(); __raw_writew((__force __u16) \
130 cpu_to_le16(v),__io(p)) 139 cpu_to_le16(v),__io(p)); })
131#define outl(v,p) __raw_writel((__force __u32) \ 140#define outl(v,p) ({ __iowmb(); __raw_writel((__force __u32) \
132 cpu_to_le32(v),__io(p)) 141 cpu_to_le32(v),__io(p)); })
133 142
134#define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __v; }) 143#define inb(p) ({ __u8 __v = __raw_readb(__io(p)); __iormb(); __v; })
135#define inw(p) ({ __u16 __v = le16_to_cpu((__force __le16) \ 144#define inw(p) ({ __u16 __v = le16_to_cpu((__force __le16) \
136 __raw_readw(__io(p))); __v; }) 145 __raw_readw(__io(p))); __iormb(); __v; })
137#define inl(p) ({ __u32 __v = le32_to_cpu((__force __le32) \ 146#define inl(p) ({ __u32 __v = le32_to_cpu((__force __le32) \
138 __raw_readl(__io(p))); __v; }) 147 __raw_readl(__io(p))); __iormb(); __v; })
139 148
140#define outsb(p,d,l) __raw_writesb(__io(p),d,l) 149#define outsb(p,d,l) __raw_writesb(__io(p),d,l)
141#define outsw(p,d,l) __raw_writesw(__io(p),d,l) 150#define outsw(p,d,l) __raw_writesw(__io(p),d,l)
@@ -192,14 +201,6 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
192#define writel_relaxed(v,c) ((void)__raw_writel((__force u32) \ 201#define writel_relaxed(v,c) ((void)__raw_writel((__force u32) \
193 cpu_to_le32(v),__mem_pci(c))) 202 cpu_to_le32(v),__mem_pci(c)))
194 203
195#ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
196#define __iormb() rmb()
197#define __iowmb() wmb()
198#else
199#define __iormb() do { } while (0)
200#define __iowmb() do { } while (0)
201#endif
202
203#define readb(c) ({ u8 __v = readb_relaxed(c); __iormb(); __v; }) 204#define readb(c) ({ u8 __v = readb_relaxed(c); __iormb(); __v; })
204#define readw(c) ({ u16 __v = readw_relaxed(c); __iormb(); __v; }) 205#define readw(c) ({ u16 __v = readw_relaxed(c); __iormb(); __v; })
205#define readl(c) ({ u32 __v = readl_relaxed(c); __iormb(); __v; }) 206#define readl(c) ({ u32 __v = readl_relaxed(c); __iormb(); __v; })
diff --git a/arch/arm/include/asm/kexec.h b/arch/arm/include/asm/kexec.h
index c0094d8edae4..c2b9b4bdec00 100644
--- a/arch/arm/include/asm/kexec.h
+++ b/arch/arm/include/asm/kexec.h
@@ -50,6 +50,9 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
50 } 50 }
51} 51}
52 52
53/* Function pointer to optional machine-specific reinitialization */
54extern void (*kexec_reinit)(void);
55
53#endif /* __ASSEMBLY__ */ 56#endif /* __ASSEMBLY__ */
54 57
55#endif /* CONFIG_KEXEC */ 58#endif /* CONFIG_KEXEC */
diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h
index 6bc63ab498ce..080d74f8128d 100644
--- a/arch/arm/include/asm/localtimer.h
+++ b/arch/arm/include/asm/localtimer.h
@@ -44,8 +44,14 @@ int local_timer_ack(void);
44/* 44/*
45 * Setup a local timer interrupt for a CPU. 45 * Setup a local timer interrupt for a CPU.
46 */ 46 */
47void local_timer_setup(struct clock_event_device *); 47int local_timer_setup(struct clock_event_device *);
48 48
49#else
50
51static inline int local_timer_setup(struct clock_event_device *evt)
52{
53 return -ENXIO;
54}
49#endif 55#endif
50 56
51#endif 57#endif
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index 3a0893a76a3b..bf13b814c1b8 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -15,10 +15,6 @@ struct meminfo;
15struct sys_timer; 15struct sys_timer;
16 16
17struct machine_desc { 17struct machine_desc {
18 /*
19 * Note! The first two elements are used
20 * by assembler code in head.S, head-common.S
21 */
22 unsigned int nr; /* architecture number */ 18 unsigned int nr; /* architecture number */
23 const char *name; /* architecture name */ 19 const char *name; /* architecture name */
24 unsigned long boot_params; /* tagged list */ 20 unsigned long boot_params; /* tagged list */
diff --git a/arch/arm/include/asm/mach/irq.h b/arch/arm/include/asm/mach/irq.h
index 22ac140edd9e..febe495d0c6e 100644
--- a/arch/arm/include/asm/mach/irq.h
+++ b/arch/arm/include/asm/mach/irq.h
@@ -34,4 +34,35 @@ do { \
34 raw_spin_unlock(&desc->lock); \ 34 raw_spin_unlock(&desc->lock); \
35} while(0) 35} while(0)
36 36
37#ifndef __ASSEMBLY__
38/*
39 * Entry/exit functions for chained handlers where the primary IRQ chip
40 * may implement either fasteoi or level-trigger flow control.
41 */
42static inline void chained_irq_enter(struct irq_chip *chip,
43 struct irq_desc *desc)
44{
45 /* FastEOI controllers require no action on entry. */
46 if (chip->irq_eoi)
47 return;
48
49 if (chip->irq_mask_ack) {
50 chip->irq_mask_ack(&desc->irq_data);
51 } else {
52 chip->irq_mask(&desc->irq_data);
53 if (chip->irq_ack)
54 chip->irq_ack(&desc->irq_data);
55 }
56}
57
58static inline void chained_irq_exit(struct irq_chip *chip,
59 struct irq_desc *desc)
60{
61 if (chip->irq_eoi)
62 chip->irq_eoi(&desc->irq_data);
63 else
64 chip->irq_unmask(&desc->irq_data);
65}
66#endif
67
37#endif 68#endif
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 23c2e8e5c0fa..431077c5a867 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -15,6 +15,7 @@
15 15
16#include <linux/compiler.h> 16#include <linux/compiler.h>
17#include <linux/const.h> 17#include <linux/const.h>
18#include <linux/types.h>
18#include <mach/memory.h> 19#include <mach/memory.h>
19#include <asm/sizes.h> 20#include <asm/sizes.h>
20 21
@@ -133,20 +134,10 @@
133#endif 134#endif
134 135
135/* 136/*
136 * Physical vs virtual RAM address space conversion. These are
137 * private definitions which should NOT be used outside memory.h
138 * files. Use virt_to_phys/phys_to_virt/__pa/__va instead.
139 */
140#ifndef __virt_to_phys
141#define __virt_to_phys(x) ((x) - PAGE_OFFSET + PHYS_OFFSET)
142#define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET)
143#endif
144
145/*
146 * Convert a physical address to a Page Frame Number and back 137 * Convert a physical address to a Page Frame Number and back
147 */ 138 */
148#define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT) 139#define __phys_to_pfn(paddr) ((unsigned long)((paddr) >> PAGE_SHIFT))
149#define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT) 140#define __pfn_to_phys(pfn) ((phys_addr_t)(pfn) << PAGE_SHIFT)
150 141
151/* 142/*
152 * Convert a page to/from a physical address 143 * Convert a page to/from a physical address
@@ -157,6 +148,62 @@
157#ifndef __ASSEMBLY__ 148#ifndef __ASSEMBLY__
158 149
159/* 150/*
151 * Physical vs virtual RAM address space conversion. These are
152 * private definitions which should NOT be used outside memory.h
153 * files. Use virt_to_phys/phys_to_virt/__pa/__va instead.
154 */
155#ifndef __virt_to_phys
156#ifdef CONFIG_ARM_PATCH_PHYS_VIRT
157
158/*
159 * Constants used to force the right instruction encodings and shifts
160 * so that all we need to do is modify the 8-bit constant field.
161 */
162#define __PV_BITS_31_24 0x81000000
163#define __PV_BITS_23_16 0x00810000
164
165extern unsigned long __pv_phys_offset;
166#define PHYS_OFFSET __pv_phys_offset
167
168#define __pv_stub(from,to,instr,type) \
169 __asm__("@ __pv_stub\n" \
170 "1: " instr " %0, %1, %2\n" \
171 " .pushsection .pv_table,\"a\"\n" \
172 " .long 1b\n" \
173 " .popsection\n" \
174 : "=r" (to) \
175 : "r" (from), "I" (type))
176
177static inline unsigned long __virt_to_phys(unsigned long x)
178{
179 unsigned long t;
180 __pv_stub(x, t, "add", __PV_BITS_31_24);
181#ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT
182 __pv_stub(t, t, "add", __PV_BITS_23_16);
183#endif
184 return t;
185}
186
187static inline unsigned long __phys_to_virt(unsigned long x)
188{
189 unsigned long t;
190 __pv_stub(x, t, "sub", __PV_BITS_31_24);
191#ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT
192 __pv_stub(t, t, "sub", __PV_BITS_23_16);
193#endif
194 return t;
195}
196#else
197#define __virt_to_phys(x) ((x) - PAGE_OFFSET + PHYS_OFFSET)
198#define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET)
199#endif
200#endif
201
202#ifndef PHYS_OFFSET
203#define PHYS_OFFSET PLAT_PHYS_OFFSET
204#endif
205
206/*
160 * The DMA mask corresponding to the maximum bus address allocatable 207 * The DMA mask corresponding to the maximum bus address allocatable
161 * using GFP_DMA. The default here places no restriction on DMA 208 * using GFP_DMA. The default here places no restriction on DMA
162 * allocations. This must be the smallest DMA mask in the system, 209 * allocations. This must be the smallest DMA mask in the system,
@@ -188,12 +235,12 @@
188 * translation for translating DMA addresses. Use the driver 235 * translation for translating DMA addresses. Use the driver
189 * DMA support - see dma-mapping.h. 236 * DMA support - see dma-mapping.h.
190 */ 237 */
191static inline unsigned long virt_to_phys(void *x) 238static inline phys_addr_t virt_to_phys(const volatile void *x)
192{ 239{
193 return __virt_to_phys((unsigned long)(x)); 240 return __virt_to_phys((unsigned long)(x));
194} 241}
195 242
196static inline void *phys_to_virt(unsigned long x) 243static inline void *phys_to_virt(phys_addr_t x)
197{ 244{
198 return (void *)(__phys_to_virt((unsigned long)(x))); 245 return (void *)(__phys_to_virt((unsigned long)(x)));
199} 246}
diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h
index 12c8e680cbff..543b44916d2c 100644
--- a/arch/arm/include/asm/module.h
+++ b/arch/arm/include/asm/module.h
@@ -25,8 +25,31 @@ struct mod_arch_specific {
25}; 25};
26 26
27/* 27/*
28 * Include the ARM architecture version. 28 * Add the ARM architecture version to the version magic string
29 */ 29 */
30#define MODULE_ARCH_VERMAGIC "ARMv" __stringify(__LINUX_ARM_ARCH__) " " 30#define MODULE_ARCH_VERMAGIC_ARMVSN "ARMv" __stringify(__LINUX_ARM_ARCH__) " "
31
32/* Add __virt_to_phys patching state as well */
33#ifdef CONFIG_ARM_PATCH_PHYS_VIRT
34#ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT
35#define MODULE_ARCH_VERMAGIC_P2V "p2v16 "
36#else
37#define MODULE_ARCH_VERMAGIC_P2V "p2v8 "
38#endif
39#else
40#define MODULE_ARCH_VERMAGIC_P2V ""
41#endif
42
43/* Add instruction set architecture tag to distinguish ARM/Thumb kernels */
44#ifdef CONFIG_THUMB2_KERNEL
45#define MODULE_ARCH_VERMAGIC_ARMTHUMB "thumb2 "
46#else
47#define MODULE_ARCH_VERMAGIC_ARMTHUMB ""
48#endif
49
50#define MODULE_ARCH_VERMAGIC \
51 MODULE_ARCH_VERMAGIC_ARMVSN \
52 MODULE_ARCH_VERMAGIC_ARMTHUMB \
53 MODULE_ARCH_VERMAGIC_P2V
31 54
32#endif /* _ASM_ARM_MODULE_H */ 55#endif /* _ASM_ARM_MODULE_H */
diff --git a/arch/arm/include/asm/outercache.h b/arch/arm/include/asm/outercache.h
index fc1900925275..d8387437ec5a 100644
--- a/arch/arm/include/asm/outercache.h
+++ b/arch/arm/include/asm/outercache.h
@@ -21,6 +21,8 @@
21#ifndef __ASM_OUTERCACHE_H 21#ifndef __ASM_OUTERCACHE_H
22#define __ASM_OUTERCACHE_H 22#define __ASM_OUTERCACHE_H
23 23
24#include <linux/types.h>
25
24struct outer_cache_fns { 26struct outer_cache_fns {
25 void (*inv_range)(unsigned long, unsigned long); 27 void (*inv_range)(unsigned long, unsigned long);
26 void (*clean_range)(unsigned long, unsigned long); 28 void (*clean_range)(unsigned long, unsigned long);
@@ -31,23 +33,24 @@ struct outer_cache_fns {
31#ifdef CONFIG_OUTER_CACHE_SYNC 33#ifdef CONFIG_OUTER_CACHE_SYNC
32 void (*sync)(void); 34 void (*sync)(void);
33#endif 35#endif
36 void (*set_debug)(unsigned long);
34}; 37};
35 38
36#ifdef CONFIG_OUTER_CACHE 39#ifdef CONFIG_OUTER_CACHE
37 40
38extern struct outer_cache_fns outer_cache; 41extern struct outer_cache_fns outer_cache;
39 42
40static inline void outer_inv_range(unsigned long start, unsigned long end) 43static inline void outer_inv_range(phys_addr_t start, phys_addr_t end)
41{ 44{
42 if (outer_cache.inv_range) 45 if (outer_cache.inv_range)
43 outer_cache.inv_range(start, end); 46 outer_cache.inv_range(start, end);
44} 47}
45static inline void outer_clean_range(unsigned long start, unsigned long end) 48static inline void outer_clean_range(phys_addr_t start, phys_addr_t end)
46{ 49{
47 if (outer_cache.clean_range) 50 if (outer_cache.clean_range)
48 outer_cache.clean_range(start, end); 51 outer_cache.clean_range(start, end);
49} 52}
50static inline void outer_flush_range(unsigned long start, unsigned long end) 53static inline void outer_flush_range(phys_addr_t start, phys_addr_t end)
51{ 54{
52 if (outer_cache.flush_range) 55 if (outer_cache.flush_range)
53 outer_cache.flush_range(start, end); 56 outer_cache.flush_range(start, end);
@@ -73,11 +76,11 @@ static inline void outer_disable(void)
73 76
74#else 77#else
75 78
76static inline void outer_inv_range(unsigned long start, unsigned long end) 79static inline void outer_inv_range(phys_addr_t start, phys_addr_t end)
77{ } 80{ }
78static inline void outer_clean_range(unsigned long start, unsigned long end) 81static inline void outer_clean_range(phys_addr_t start, phys_addr_t end)
79{ } 82{ }
80static inline void outer_flush_range(unsigned long start, unsigned long end) 83static inline void outer_flush_range(phys_addr_t start, phys_addr_t end)
81{ } 84{ }
82static inline void outer_flush_all(void) { } 85static inline void outer_flush_all(void) { }
83static inline void outer_inv_all(void) { } 86static inline void outer_inv_all(void) { }
diff --git a/arch/arm/include/asm/pgalloc.h b/arch/arm/include/asm/pgalloc.h
index 9763be04f77e..22de005f159c 100644
--- a/arch/arm/include/asm/pgalloc.h
+++ b/arch/arm/include/asm/pgalloc.h
@@ -10,6 +10,8 @@
10#ifndef _ASMARM_PGALLOC_H 10#ifndef _ASMARM_PGALLOC_H
11#define _ASMARM_PGALLOC_H 11#define _ASMARM_PGALLOC_H
12 12
13#include <linux/pagemap.h>
14
13#include <asm/domain.h> 15#include <asm/domain.h>
14#include <asm/pgtable-hwdef.h> 16#include <asm/pgtable-hwdef.h>
15#include <asm/processor.h> 17#include <asm/processor.h>
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index ebcb6432f45f..5750704e0271 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -301,6 +301,7 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
301#define pgd_present(pgd) (1) 301#define pgd_present(pgd) (1)
302#define pgd_clear(pgdp) do { } while (0) 302#define pgd_clear(pgdp) do { } while (0)
303#define set_pgd(pgd,pgdp) do { } while (0) 303#define set_pgd(pgd,pgdp) do { } while (0)
304#define set_pud(pud,pudp) do { } while (0)
304 305
305 306
306/* Find an entry in the second-level page table.. */ 307/* Find an entry in the second-level page table.. */
@@ -351,7 +352,7 @@ static inline pte_t *pmd_page_vaddr(pmd_t pmd)
351#define pte_unmap(pte) __pte_unmap(pte) 352#define pte_unmap(pte) __pte_unmap(pte)
352 353
353#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT) 354#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT)
354#define pfn_pte(pfn,prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) 355#define pfn_pte(pfn,prot) __pte(__pfn_to_phys(pfn) | pgprot_val(prot))
355 356
356#define pte_page(pte) pfn_to_page(pte_pfn(pte)) 357#define pte_page(pte) pfn_to_page(pte_pfn(pte))
357#define mk_pte(page,prot) pfn_pte(page_to_pfn(page), prot) 358#define mk_pte(page,prot) pfn_pte(page_to_pfn(page), prot)
diff --git a/arch/arm/include/asm/pmu.h b/arch/arm/include/asm/pmu.h
index 8ccea012722c..7544ce6b481a 100644
--- a/arch/arm/include/asm/pmu.h
+++ b/arch/arm/include/asm/pmu.h
@@ -12,11 +12,25 @@
12#ifndef __ARM_PMU_H__ 12#ifndef __ARM_PMU_H__
13#define __ARM_PMU_H__ 13#define __ARM_PMU_H__
14 14
15#include <linux/interrupt.h>
16
15enum arm_pmu_type { 17enum arm_pmu_type {
16 ARM_PMU_DEVICE_CPU = 0, 18 ARM_PMU_DEVICE_CPU = 0,
17 ARM_NUM_PMU_DEVICES, 19 ARM_NUM_PMU_DEVICES,
18}; 20};
19 21
22/*
23 * struct arm_pmu_platdata - ARM PMU platform data
24 *
25 * @handle_irq: an optional handler which will be called from the interrupt and
26 * passed the address of the low level handler, and can be used to implement
27 * any platform specific handling before or after calling it.
28 */
29struct arm_pmu_platdata {
30 irqreturn_t (*handle_irq)(int irq, void *dev,
31 irq_handler_t pmu_handler);
32};
33
20#ifdef CONFIG_CPU_HAS_PMU 34#ifdef CONFIG_CPU_HAS_PMU
21 35
22/** 36/**
diff --git a/arch/arm/include/asm/proc-fns.h b/arch/arm/include/asm/proc-fns.h
index 8fdae9bc9abb..8ec535e11fd7 100644
--- a/arch/arm/include/asm/proc-fns.h
+++ b/arch/arm/include/asm/proc-fns.h
@@ -13,250 +13,86 @@
13 13
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15 15
16#include <asm/glue-proc.h>
17#include <asm/page.h>
16 18
17/* 19#ifndef __ASSEMBLY__
18 * Work out if we need multiple CPU support 20
19 */ 21struct mm_struct;
20#undef MULTI_CPU
21#undef CPU_NAME
22 22
23/* 23/*
24 * CPU_NAME - the prefix for CPU related functions 24 * Don't change this structure - ASM code relies on it.
25 */ 25 */
26 26extern struct processor {
27#ifdef CONFIG_CPU_ARM610 27 /* MISC
28# ifdef CPU_NAME 28 * get data abort address/flags
29# undef MULTI_CPU 29 */
30# define MULTI_CPU 30 void (*_data_abort)(unsigned long pc);
31# else 31 /*
32# define CPU_NAME cpu_arm6 32 * Retrieve prefetch fault address
33# endif 33 */
34#endif 34 unsigned long (*_prefetch_abort)(unsigned long lr);
35 35 /*
36#ifdef CONFIG_CPU_ARM7TDMI 36 * Set up any processor specifics
37# ifdef CPU_NAME 37 */
38# undef MULTI_CPU 38 void (*_proc_init)(void);
39# define MULTI_CPU 39 /*
40# else 40 * Disable any processor specifics
41# define CPU_NAME cpu_arm7tdmi 41 */
42# endif 42 void (*_proc_fin)(void);
43#endif 43 /*
44 44 * Special stuff for a reset
45#ifdef CONFIG_CPU_ARM710 45 */
46# ifdef CPU_NAME 46 void (*reset)(unsigned long addr) __attribute__((noreturn));
47# undef MULTI_CPU 47 /*
48# define MULTI_CPU 48 * Idle the processor
49# else 49 */
50# define CPU_NAME cpu_arm7 50 int (*_do_idle)(void);
51# endif 51 /*
52#endif 52 * Processor architecture specific
53 53 */
54#ifdef CONFIG_CPU_ARM720T 54 /*
55# ifdef CPU_NAME 55 * clean a virtual address range from the
56# undef MULTI_CPU 56 * D-cache without flushing the cache.
57# define MULTI_CPU 57 */
58# else 58 void (*dcache_clean_area)(void *addr, int size);
59# define CPU_NAME cpu_arm720 59
60# endif 60 /*
61#endif 61 * Set the page table
62 62 */
63#ifdef CONFIG_CPU_ARM740T 63 void (*switch_mm)(unsigned long pgd_phys, struct mm_struct *mm);
64# ifdef CPU_NAME 64 /*
65# undef MULTI_CPU 65 * Set a possibly extended PTE. Non-extended PTEs should
66# define MULTI_CPU 66 * ignore 'ext'.
67# else 67 */
68# define CPU_NAME cpu_arm740 68 void (*set_pte_ext)(pte_t *ptep, pte_t pte, unsigned int ext);
69# endif 69
70#endif 70 /* Suspend/resume */
71 71 unsigned int suspend_size;
72#ifdef CONFIG_CPU_ARM9TDMI 72 void (*do_suspend)(void *);
73# ifdef CPU_NAME 73 void (*do_resume)(void *);
74# undef MULTI_CPU 74} processor;
75# define MULTI_CPU
76# else
77# define CPU_NAME cpu_arm9tdmi
78# endif
79#endif
80
81#ifdef CONFIG_CPU_ARM920T
82# ifdef CPU_NAME
83# undef MULTI_CPU
84# define MULTI_CPU
85# else
86# define CPU_NAME cpu_arm920
87# endif
88#endif
89
90#ifdef CONFIG_CPU_ARM922T
91# ifdef CPU_NAME
92# undef MULTI_CPU
93# define MULTI_CPU
94# else
95# define CPU_NAME cpu_arm922
96# endif
97#endif
98
99#ifdef CONFIG_CPU_FA526
100# ifdef CPU_NAME
101# undef MULTI_CPU
102# define MULTI_CPU
103# else
104# define CPU_NAME cpu_fa526
105# endif
106#endif
107
108#ifdef CONFIG_CPU_ARM925T
109# ifdef CPU_NAME
110# undef MULTI_CPU
111# define MULTI_CPU
112# else
113# define CPU_NAME cpu_arm925
114# endif
115#endif
116
117#ifdef CONFIG_CPU_ARM926T
118# ifdef CPU_NAME
119# undef MULTI_CPU
120# define MULTI_CPU
121# else
122# define CPU_NAME cpu_arm926
123# endif
124#endif
125
126#ifdef CONFIG_CPU_ARM940T
127# ifdef CPU_NAME
128# undef MULTI_CPU
129# define MULTI_CPU
130# else
131# define CPU_NAME cpu_arm940
132# endif
133#endif
134
135#ifdef CONFIG_CPU_ARM946E
136# ifdef CPU_NAME
137# undef MULTI_CPU
138# define MULTI_CPU
139# else
140# define CPU_NAME cpu_arm946
141# endif
142#endif
143
144#ifdef CONFIG_CPU_SA110
145# ifdef CPU_NAME
146# undef MULTI_CPU
147# define MULTI_CPU
148# else
149# define CPU_NAME cpu_sa110
150# endif
151#endif
152
153#ifdef CONFIG_CPU_SA1100
154# ifdef CPU_NAME
155# undef MULTI_CPU
156# define MULTI_CPU
157# else
158# define CPU_NAME cpu_sa1100
159# endif
160#endif
161
162#ifdef CONFIG_CPU_ARM1020
163# ifdef CPU_NAME
164# undef MULTI_CPU
165# define MULTI_CPU
166# else
167# define CPU_NAME cpu_arm1020
168# endif
169#endif
170
171#ifdef CONFIG_CPU_ARM1020E
172# ifdef CPU_NAME
173# undef MULTI_CPU
174# define MULTI_CPU
175# else
176# define CPU_NAME cpu_arm1020e
177# endif
178#endif
179
180#ifdef CONFIG_CPU_ARM1022
181# ifdef CPU_NAME
182# undef MULTI_CPU
183# define MULTI_CPU
184# else
185# define CPU_NAME cpu_arm1022
186# endif
187#endif
188
189#ifdef CONFIG_CPU_ARM1026
190# ifdef CPU_NAME
191# undef MULTI_CPU
192# define MULTI_CPU
193# else
194# define CPU_NAME cpu_arm1026
195# endif
196#endif
197
198#ifdef CONFIG_CPU_XSCALE
199# ifdef CPU_NAME
200# undef MULTI_CPU
201# define MULTI_CPU
202# else
203# define CPU_NAME cpu_xscale
204# endif
205#endif
206
207#ifdef CONFIG_CPU_XSC3
208# ifdef CPU_NAME
209# undef MULTI_CPU
210# define MULTI_CPU
211# else
212# define CPU_NAME cpu_xsc3
213# endif
214#endif
215
216#ifdef CONFIG_CPU_MOHAWK
217# ifdef CPU_NAME
218# undef MULTI_CPU
219# define MULTI_CPU
220# else
221# define CPU_NAME cpu_mohawk
222# endif
223#endif
224
225#ifdef CONFIG_CPU_FEROCEON
226# ifdef CPU_NAME
227# undef MULTI_CPU
228# define MULTI_CPU
229# else
230# define CPU_NAME cpu_feroceon
231# endif
232#endif
233
234#ifdef CONFIG_CPU_V6
235# ifdef CPU_NAME
236# undef MULTI_CPU
237# define MULTI_CPU
238# else
239# define CPU_NAME cpu_v6
240# endif
241#endif
242
243#ifdef CONFIG_CPU_V7
244# ifdef CPU_NAME
245# undef MULTI_CPU
246# define MULTI_CPU
247# else
248# define CPU_NAME cpu_v7
249# endif
250#endif
251
252#ifndef __ASSEMBLY__
253 75
254#ifndef MULTI_CPU 76#ifndef MULTI_CPU
255#include <asm/cpu-single.h> 77extern void cpu_proc_init(void);
78extern void cpu_proc_fin(void);
79extern int cpu_do_idle(void);
80extern void cpu_dcache_clean_area(void *, int);
81extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm);
82extern void cpu_set_pte_ext(pte_t *ptep, pte_t pte, unsigned int ext);
83extern void cpu_reset(unsigned long addr) __attribute__((noreturn));
256#else 84#else
257#include <asm/cpu-multi32.h> 85#define cpu_proc_init() processor._proc_init()
86#define cpu_proc_fin() processor._proc_fin()
87#define cpu_reset(addr) processor.reset(addr)
88#define cpu_do_idle() processor._do_idle()
89#define cpu_dcache_clean_area(addr,sz) processor.dcache_clean_area(addr,sz)
90#define cpu_set_pte_ext(ptep,pte,ext) processor.set_pte_ext(ptep,pte,ext)
91#define cpu_do_switch_mm(pgd,mm) processor.switch_mm(pgd,mm)
258#endif 92#endif
259 93
94extern void cpu_resume(void);
95
260#include <asm/memory.h> 96#include <asm/memory.h>
261 97
262#ifdef CONFIG_MMU 98#ifdef CONFIG_MMU
diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h
index 67357baaeeeb..b2d9df5667af 100644
--- a/arch/arm/include/asm/processor.h
+++ b/arch/arm/include/asm/processor.h
@@ -29,19 +29,7 @@
29#define STACK_TOP_MAX TASK_SIZE 29#define STACK_TOP_MAX TASK_SIZE
30#endif 30#endif
31 31
32union debug_insn {
33 u32 arm;
34 u16 thumb;
35};
36
37struct debug_entry {
38 u32 address;
39 union debug_insn insn;
40};
41
42struct debug_info { 32struct debug_info {
43 int nsaved;
44 struct debug_entry bp[2];
45#ifdef CONFIG_HAVE_HW_BREAKPOINT 33#ifdef CONFIG_HAVE_HW_BREAKPOINT
46 struct perf_event *hbp[ARM_MAX_HBP_SLOTS]; 34 struct perf_event *hbp[ARM_MAX_HBP_SLOTS];
47#endif 35#endif
@@ -95,7 +83,7 @@ extern void release_thread(struct task_struct *);
95 83
96unsigned long get_wchan(struct task_struct *p); 84unsigned long get_wchan(struct task_struct *p);
97 85
98#if __LINUX_ARM_ARCH__ == 6 86#if __LINUX_ARM_ARCH__ == 6 || defined(CONFIG_ARM_ERRATA_754327)
99#define cpu_relax() smp_mb() 87#define cpu_relax() smp_mb()
100#else 88#else
101#define cpu_relax() barrier() 89#define cpu_relax() barrier()
diff --git a/arch/arm/include/asm/ptrace.h b/arch/arm/include/asm/ptrace.h
index 783d50f32618..a8ff22b2a391 100644
--- a/arch/arm/include/asm/ptrace.h
+++ b/arch/arm/include/asm/ptrace.h
@@ -130,8 +130,6 @@ struct pt_regs {
130 130
131#ifdef __KERNEL__ 131#ifdef __KERNEL__
132 132
133#define arch_has_single_step() (1)
134
135#define user_mode(regs) \ 133#define user_mode(regs) \
136 (((regs)->ARM_cpsr & 0xf) == 0) 134 (((regs)->ARM_cpsr & 0xf) == 0)
137 135
diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index f1e5a9bca249..95176af3df8c 100644
--- a/arch/arm/include/asm/setup.h
+++ b/arch/arm/include/asm/setup.h
@@ -192,14 +192,10 @@ static struct tagtable __tagtable_##fn __tag = { tag, fn }
192/* 192/*
193 * Memory map description 193 * Memory map description
194 */ 194 */
195#ifdef CONFIG_ARCH_LH7A40X 195#define NR_BANKS 8
196# define NR_BANKS 16
197#else
198# define NR_BANKS 8
199#endif
200 196
201struct membank { 197struct membank {
202 unsigned long start; 198 phys_addr_t start;
203 unsigned long size; 199 unsigned long size;
204 unsigned int highmem; 200 unsigned int highmem;
205}; 201};
diff --git a/arch/arm/include/asm/smp_scu.h b/arch/arm/include/asm/smp_scu.h
index 2376835015d6..4eb6d005ffaa 100644
--- a/arch/arm/include/asm/smp_scu.h
+++ b/arch/arm/include/asm/smp_scu.h
@@ -1,7 +1,14 @@
1#ifndef __ASMARM_ARCH_SCU_H 1#ifndef __ASMARM_ARCH_SCU_H
2#define __ASMARM_ARCH_SCU_H 2#define __ASMARM_ARCH_SCU_H
3 3
4#define SCU_PM_NORMAL 0
5#define SCU_PM_DORMANT 2
6#define SCU_PM_POWEROFF 3
7
8#ifndef __ASSEMBLER__
4unsigned int scu_get_core_count(void __iomem *); 9unsigned int scu_get_core_count(void __iomem *);
5void scu_enable(void __iomem *); 10void scu_enable(void __iomem *);
11int scu_power_mode(void __iomem *, unsigned int);
12#endif
6 13
7#endif 14#endif
diff --git a/arch/arm/include/asm/spinlock.h b/arch/arm/include/asm/spinlock.h
index 17eb355707dd..fdd3820edff8 100644
--- a/arch/arm/include/asm/spinlock.h
+++ b/arch/arm/include/asm/spinlock.h
@@ -5,17 +5,52 @@
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/*
9 * 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.
11 */
12#define ALT_SMP(smp, up) \
13 "9998: " smp "\n" \
14 " .pushsection \".alt.smp.init\", \"a\"\n" \
15 " .long 9998b\n" \
16 " " up "\n" \
17 " .popsection\n"
18
19#ifdef CONFIG_THUMB2_KERNEL
20#define SEV ALT_SMP("sev.w", "nop.w")
21/*
22 * For Thumb-2, special care is needed to ensure that the conditional WFE
23 * instruction really does assemble to exactly 4 bytes (as required by
24 * the SMP_ON_UP fixup code). By itself "wfene" might cause the
25 * assembler to insert a extra (16-bit) IT instruction, depending on the
26 * presence or absence of neighbouring conditional instructions.
27 *
28 * To avoid this unpredictableness, an approprite IT is inserted explicitly:
29 * the assembler won't change IT instructions which are explicitly present
30 * in the input.
31 */
32#define WFE(cond) ALT_SMP( \
33 "it " cond "\n\t" \
34 "wfe" cond ".n", \
35 \
36 "nop.w" \
37)
38#else
39#define SEV ALT_SMP("sev", "nop")
40#define WFE(cond) ALT_SMP("wfe" cond, "nop")
41#endif
42
8static inline void dsb_sev(void) 43static inline void dsb_sev(void)
9{ 44{
10#if __LINUX_ARM_ARCH__ >= 7 45#if __LINUX_ARM_ARCH__ >= 7
11 __asm__ __volatile__ ( 46 __asm__ __volatile__ (
12 "dsb\n" 47 "dsb\n"
13 "sev" 48 SEV
14 ); 49 );
15#elif defined(CONFIG_CPU_32v6K) 50#else
16 __asm__ __volatile__ ( 51 __asm__ __volatile__ (
17 "mcr p15, 0, %0, c7, c10, 4\n" 52 "mcr p15, 0, %0, c7, c10, 4\n"
18 "sev" 53 SEV
19 : : "r" (0) 54 : : "r" (0)
20 ); 55 );
21#endif 56#endif
@@ -46,9 +81,7 @@ static inline void arch_spin_lock(arch_spinlock_t *lock)
46 __asm__ __volatile__( 81 __asm__ __volatile__(
47"1: ldrex %0, [%1]\n" 82"1: ldrex %0, [%1]\n"
48" teq %0, #0\n" 83" teq %0, #0\n"
49#ifdef CONFIG_CPU_32v6K 84 WFE("ne")
50" wfene\n"
51#endif
52" strexeq %0, %2, [%1]\n" 85" strexeq %0, %2, [%1]\n"
53" teqeq %0, #0\n" 86" teqeq %0, #0\n"
54" bne 1b" 87" bne 1b"
@@ -107,9 +140,7 @@ static inline void arch_write_lock(arch_rwlock_t *rw)
107 __asm__ __volatile__( 140 __asm__ __volatile__(
108"1: ldrex %0, [%1]\n" 141"1: ldrex %0, [%1]\n"
109" teq %0, #0\n" 142" teq %0, #0\n"
110#ifdef CONFIG_CPU_32v6K 143 WFE("ne")
111" wfene\n"
112#endif
113" strexeq %0, %2, [%1]\n" 144" strexeq %0, %2, [%1]\n"
114" teq %0, #0\n" 145" teq %0, #0\n"
115" bne 1b" 146" bne 1b"
@@ -176,9 +207,7 @@ static inline void arch_read_lock(arch_rwlock_t *rw)
176"1: ldrex %0, [%2]\n" 207"1: ldrex %0, [%2]\n"
177" adds %0, %0, #1\n" 208" adds %0, %0, #1\n"
178" strexpl %1, %0, [%2]\n" 209" strexpl %1, %0, [%2]\n"
179#ifdef CONFIG_CPU_32v6K 210 WFE("mi")
180" wfemi\n"
181#endif
182" rsbpls %0, %1, #0\n" 211" rsbpls %0, %1, #0\n"
183" bmi 1b" 212" bmi 1b"
184 : "=&r" (tmp), "=&r" (tmp2) 213 : "=&r" (tmp), "=&r" (tmp2)
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 97f6d60297d5..9a87823642d0 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -347,6 +347,7 @@ void cpu_idle_wait(void);
347#include <asm-generic/cmpxchg-local.h> 347#include <asm-generic/cmpxchg-local.h>
348 348
349#if __LINUX_ARM_ARCH__ < 6 349#if __LINUX_ARM_ARCH__ < 6
350/* min ARCH < ARMv6 */
350 351
351#ifdef CONFIG_SMP 352#ifdef CONFIG_SMP
352#error "SMP is not supported on this platform" 353#error "SMP is not supported on this platform"
@@ -365,7 +366,7 @@ void cpu_idle_wait(void);
365#include <asm-generic/cmpxchg.h> 366#include <asm-generic/cmpxchg.h>
366#endif 367#endif
367 368
368#else /* __LINUX_ARM_ARCH__ >= 6 */ 369#else /* min ARCH >= ARMv6 */
369 370
370extern void __bad_cmpxchg(volatile void *ptr, int size); 371extern void __bad_cmpxchg(volatile void *ptr, int size);
371 372
@@ -379,7 +380,7 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
379 unsigned long oldval, res; 380 unsigned long oldval, res;
380 381
381 switch (size) { 382 switch (size) {
382#ifdef CONFIG_CPU_32v6K 383#ifndef CONFIG_CPU_V6 /* min ARCH >= ARMv6K */
383 case 1: 384 case 1:
384 do { 385 do {
385 asm volatile("@ __cmpxchg1\n" 386 asm volatile("@ __cmpxchg1\n"
@@ -404,7 +405,7 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
404 : "memory", "cc"); 405 : "memory", "cc");
405 } while (res); 406 } while (res);
406 break; 407 break;
407#endif /* CONFIG_CPU_32v6K */ 408#endif
408 case 4: 409 case 4:
409 do { 410 do {
410 asm volatile("@ __cmpxchg4\n" 411 asm volatile("@ __cmpxchg4\n"
@@ -450,12 +451,12 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr,
450 unsigned long ret; 451 unsigned long ret;
451 452
452 switch (size) { 453 switch (size) {
453#ifndef CONFIG_CPU_32v6K 454#ifdef CONFIG_CPU_V6 /* min ARCH == ARMv6 */
454 case 1: 455 case 1:
455 case 2: 456 case 2:
456 ret = __cmpxchg_local_generic(ptr, old, new, size); 457 ret = __cmpxchg_local_generic(ptr, old, new, size);
457 break; 458 break;
458#endif /* !CONFIG_CPU_32v6K */ 459#endif
459 default: 460 default:
460 ret = __cmpxchg(ptr, old, new, size); 461 ret = __cmpxchg(ptr, old, new, size);
461 } 462 }
@@ -469,7 +470,7 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr,
469 (unsigned long)(n), \ 470 (unsigned long)(n), \
470 sizeof(*(ptr)))) 471 sizeof(*(ptr))))
471 472
472#ifdef CONFIG_CPU_32v6K 473#ifndef CONFIG_CPU_V6 /* min ARCH >= ARMv6K */
473 474
474/* 475/*
475 * Note : ARMv7-M (currently unsupported by Linux) does not support 476 * Note : ARMv7-M (currently unsupported by Linux) does not support
@@ -524,11 +525,11 @@ static inline unsigned long long __cmpxchg64_mb(volatile void *ptr,
524 (unsigned long long)(o), \ 525 (unsigned long long)(o), \
525 (unsigned long long)(n))) 526 (unsigned long long)(n)))
526 527
527#else /* !CONFIG_CPU_32v6K */ 528#else /* min ARCH = ARMv6 */
528 529
529#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) 530#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
530 531
531#endif /* CONFIG_CPU_32v6K */ 532#endif
532 533
533#endif /* __LINUX_ARM_ARCH__ >= 6 */ 534#endif /* __LINUX_ARM_ARCH__ >= 6 */
534 535
diff --git a/arch/arm/include/asm/tlb.h b/arch/arm/include/asm/tlb.h
index f41a6f57cd12..82dfe5d0c41e 100644
--- a/arch/arm/include/asm/tlb.h
+++ b/arch/arm/include/asm/tlb.h
@@ -18,16 +18,34 @@
18#define __ASMARM_TLB_H 18#define __ASMARM_TLB_H
19 19
20#include <asm/cacheflush.h> 20#include <asm/cacheflush.h>
21#include <asm/tlbflush.h>
22 21
23#ifndef CONFIG_MMU 22#ifndef CONFIG_MMU
24 23
25#include <linux/pagemap.h> 24#include <linux/pagemap.h>
25
26#define tlb_flush(tlb) ((void) tlb)
27
26#include <asm-generic/tlb.h> 28#include <asm-generic/tlb.h>
27 29
28#else /* !CONFIG_MMU */ 30#else /* !CONFIG_MMU */
29 31
32#include <linux/swap.h>
30#include <asm/pgalloc.h> 33#include <asm/pgalloc.h>
34#include <asm/tlbflush.h>
35
36/*
37 * We need to delay page freeing for SMP as other CPUs can access pages
38 * which have been removed but not yet had their TLB entries invalidated.
39 * Also, as ARMv7 speculative prefetch can drag new entries into the TLB,
40 * we need to apply this same delaying tactic to ensure correct operation.
41 */
42#if defined(CONFIG_SMP) || defined(CONFIG_CPU_32v7)
43#define tlb_fast_mode(tlb) 0
44#define FREE_PTE_NR 500
45#else
46#define tlb_fast_mode(tlb) 1
47#define FREE_PTE_NR 0
48#endif
31 49
32/* 50/*
33 * TLB handling. This allows us to remove pages from the page 51 * TLB handling. This allows us to remove pages from the page
@@ -36,12 +54,58 @@
36struct mmu_gather { 54struct mmu_gather {
37 struct mm_struct *mm; 55 struct mm_struct *mm;
38 unsigned int fullmm; 56 unsigned int fullmm;
57 struct vm_area_struct *vma;
39 unsigned long range_start; 58 unsigned long range_start;
40 unsigned long range_end; 59 unsigned long range_end;
60 unsigned int nr;
61 struct page *pages[FREE_PTE_NR];
41}; 62};
42 63
43DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); 64DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
44 65
66/*
67 * This is unnecessarily complex. There's three ways the TLB shootdown
68 * code is used:
69 * 1. Unmapping a range of vmas. See zap_page_range(), unmap_region().
70 * tlb->fullmm = 0, and tlb_start_vma/tlb_end_vma will be called.
71 * tlb->vma will be non-NULL.
72 * 2. Unmapping all vmas. See exit_mmap().
73 * tlb->fullmm = 1, and tlb_start_vma/tlb_end_vma will be called.
74 * tlb->vma will be non-NULL. Additionally, page tables will be freed.
75 * 3. Unmapping argument pages. See shift_arg_pages().
76 * tlb->fullmm = 0, but tlb_start_vma/tlb_end_vma will not be called.
77 * tlb->vma will be NULL.
78 */
79static inline void tlb_flush(struct mmu_gather *tlb)
80{
81 if (tlb->fullmm || !tlb->vma)
82 flush_tlb_mm(tlb->mm);
83 else if (tlb->range_end > 0) {
84 flush_tlb_range(tlb->vma, tlb->range_start, tlb->range_end);
85 tlb->range_start = TASK_SIZE;
86 tlb->range_end = 0;
87 }
88}
89
90static inline void tlb_add_flush(struct mmu_gather *tlb, unsigned long addr)
91{
92 if (!tlb->fullmm) {
93 if (addr < tlb->range_start)
94 tlb->range_start = addr;
95 if (addr + PAGE_SIZE > tlb->range_end)
96 tlb->range_end = addr + PAGE_SIZE;
97 }
98}
99
100static inline void tlb_flush_mmu(struct mmu_gather *tlb)
101{
102 tlb_flush(tlb);
103 if (!tlb_fast_mode(tlb)) {
104 free_pages_and_swap_cache(tlb->pages, tlb->nr);
105 tlb->nr = 0;
106 }
107}
108
45static inline struct mmu_gather * 109static inline struct mmu_gather *
46tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) 110tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
47{ 111{
@@ -49,6 +113,8 @@ tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
49 113
50 tlb->mm = mm; 114 tlb->mm = mm;
51 tlb->fullmm = full_mm_flush; 115 tlb->fullmm = full_mm_flush;
116 tlb->vma = NULL;
117 tlb->nr = 0;
52 118
53 return tlb; 119 return tlb;
54} 120}
@@ -56,8 +122,7 @@ tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
56static inline void 122static inline void
57tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) 123tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
58{ 124{
59 if (tlb->fullmm) 125 tlb_flush_mmu(tlb);
60 flush_tlb_mm(tlb->mm);
61 126
62 /* keep the page table cache within bounds */ 127 /* keep the page table cache within bounds */
63 check_pgt_cache(); 128 check_pgt_cache();
@@ -71,12 +136,7 @@ tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
71static inline void 136static inline void
72tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep, unsigned long addr) 137tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep, unsigned long addr)
73{ 138{
74 if (!tlb->fullmm) { 139 tlb_add_flush(tlb, addr);
75 if (addr < tlb->range_start)
76 tlb->range_start = addr;
77 if (addr + PAGE_SIZE > tlb->range_end)
78 tlb->range_end = addr + PAGE_SIZE;
79 }
80} 140}
81 141
82/* 142/*
@@ -89,6 +149,7 @@ tlb_start_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
89{ 149{
90 if (!tlb->fullmm) { 150 if (!tlb->fullmm) {
91 flush_cache_range(vma, vma->vm_start, vma->vm_end); 151 flush_cache_range(vma, vma->vm_start, vma->vm_end);
152 tlb->vma = vma;
92 tlb->range_start = TASK_SIZE; 153 tlb->range_start = TASK_SIZE;
93 tlb->range_end = 0; 154 tlb->range_end = 0;
94 } 155 }
@@ -97,12 +158,30 @@ tlb_start_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
97static inline void 158static inline void
98tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma) 159tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
99{ 160{
100 if (!tlb->fullmm && tlb->range_end > 0) 161 if (!tlb->fullmm)
101 flush_tlb_range(vma, tlb->range_start, tlb->range_end); 162 tlb_flush(tlb);
163}
164
165static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
166{
167 if (tlb_fast_mode(tlb)) {
168 free_page_and_swap_cache(page);
169 } else {
170 tlb->pages[tlb->nr++] = page;
171 if (tlb->nr >= FREE_PTE_NR)
172 tlb_flush_mmu(tlb);
173 }
174}
175
176static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
177 unsigned long addr)
178{
179 pgtable_page_dtor(pte);
180 tlb_add_flush(tlb, addr);
181 tlb_remove_page(tlb, pte);
102} 182}
103 183
104#define tlb_remove_page(tlb,page) free_page_and_swap_cache(page) 184#define pte_free_tlb(tlb, ptep, addr) __pte_free_tlb(tlb, ptep, addr)
105#define pte_free_tlb(tlb, ptep, addr) pte_free((tlb)->mm, ptep)
106#define pmd_free_tlb(tlb, pmdp, addr) pmd_free((tlb)->mm, pmdp) 185#define pmd_free_tlb(tlb, pmdp, addr) pmd_free((tlb)->mm, pmdp)
107 186
108#define tlb_migrate_finish(mm) do { } while (0) 187#define tlb_migrate_finish(mm) do { } while (0)
diff --git a/arch/arm/include/asm/tlbflush.h b/arch/arm/include/asm/tlbflush.h
index ce7378ea15a2..d2005de383b8 100644
--- a/arch/arm/include/asm/tlbflush.h
+++ b/arch/arm/include/asm/tlbflush.h
@@ -10,12 +10,7 @@
10#ifndef _ASMARM_TLBFLUSH_H 10#ifndef _ASMARM_TLBFLUSH_H
11#define _ASMARM_TLBFLUSH_H 11#define _ASMARM_TLBFLUSH_H
12 12
13 13#ifdef CONFIG_MMU
14#ifndef CONFIG_MMU
15
16#define tlb_flush(tlb) ((void) tlb)
17
18#else /* CONFIG_MMU */
19 14
20#include <asm/glue.h> 15#include <asm/glue.h>
21 16
diff --git a/arch/arm/include/asm/tls.h b/arch/arm/include/asm/tls.h
index e71d6ff8d104..60843eb0f61c 100644
--- a/arch/arm/include/asm/tls.h
+++ b/arch/arm/include/asm/tls.h
@@ -28,15 +28,14 @@
28#define tls_emu 1 28#define tls_emu 1
29#define has_tls_reg 1 29#define has_tls_reg 1
30#define set_tls set_tls_none 30#define set_tls set_tls_none
31#elif __LINUX_ARM_ARCH__ >= 7 || \ 31#elif defined(CONFIG_CPU_V6)
32 (__LINUX_ARM_ARCH__ == 6 && defined(CONFIG_CPU_32v6K))
33#define tls_emu 0
34#define has_tls_reg 1
35#define set_tls set_tls_v6k
36#elif __LINUX_ARM_ARCH__ == 6
37#define tls_emu 0 32#define tls_emu 0
38#define has_tls_reg (elf_hwcap & HWCAP_TLS) 33#define has_tls_reg (elf_hwcap & HWCAP_TLS)
39#define set_tls set_tls_v6 34#define set_tls set_tls_v6
35#elif defined(CONFIG_CPU_32v6K)
36#define tls_emu 0
37#define has_tls_reg 1
38#define set_tls set_tls_v6k
40#else 39#else
41#define tls_emu 0 40#define tls_emu 0
42#define has_tls_reg 0 41#define has_tls_reg 0
diff --git a/arch/arm/include/asm/traps.h b/arch/arm/include/asm/traps.h
index 1b960d5ef6a5..f90756dc16dc 100644
--- a/arch/arm/include/asm/traps.h
+++ b/arch/arm/include/asm/traps.h
@@ -45,6 +45,7 @@ static inline int in_exception_text(unsigned long ptr)
45 45
46extern void __init early_trap_init(void); 46extern void __init early_trap_init(void);
47extern void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame); 47extern void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame);
48extern void ptrace_break(struct task_struct *tsk, struct pt_regs *regs);
48 49
49extern void *vectors_page; 50extern void *vectors_page;
50 51
diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h
index 345df01534a4..48192ac3a23a 100644
--- a/arch/arm/include/asm/types.h
+++ b/arch/arm/include/asm/types.h
@@ -16,15 +16,6 @@ typedef unsigned short umode_t;
16 16
17#define BITS_PER_LONG 32 17#define BITS_PER_LONG 32
18 18
19#ifndef __ASSEMBLY__
20
21/* Dma addresses are 32-bits wide. */
22
23typedef u32 dma_addr_t;
24typedef u32 dma64_addr_t;
25
26#endif /* __ASSEMBLY__ */
27
28#endif /* __KERNEL__ */ 19#endif /* __KERNEL__ */
29 20
30#endif 21#endif
diff --git a/arch/arm/include/asm/user.h b/arch/arm/include/asm/user.h
index 05ac4b06876a..35917b3a97f9 100644
--- a/arch/arm/include/asm/user.h
+++ b/arch/arm/include/asm/user.h
@@ -71,7 +71,7 @@ struct user{
71 /* the registers. */ 71 /* the registers. */
72 unsigned long magic; /* To uniquely identify a core file */ 72 unsigned long magic; /* To uniquely identify a core file */
73 char u_comm[32]; /* User command that was responsible */ 73 char u_comm[32]; /* User command that was responsible */
74 int u_debugreg[8]; 74 int u_debugreg[8]; /* No longer used */
75 struct user_fp u_fp; /* FP state */ 75 struct user_fp u_fp; /* FP state */
76 struct user_fp_struct * u_fp0;/* Used by gdb to help find the values for */ 76 struct user_fp_struct * u_fp0;/* Used by gdb to help find the values for */
77 /* the FP registers. */ 77 /* the FP registers. */
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 185ee822c935..74554f1742d7 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -29,6 +29,7 @@ obj-$(CONFIG_MODULES) += armksyms.o module.o
29obj-$(CONFIG_ARTHUR) += arthur.o 29obj-$(CONFIG_ARTHUR) += arthur.o
30obj-$(CONFIG_ISA_DMA) += dma-isa.o 30obj-$(CONFIG_ISA_DMA) += dma-isa.o
31obj-$(CONFIG_PCI) += bios32.o isa.o 31obj-$(CONFIG_PCI) += bios32.o isa.o
32obj-$(CONFIG_PM) += sleep.o
32obj-$(CONFIG_HAVE_SCHED_CLOCK) += sched_clock.o 33obj-$(CONFIG_HAVE_SCHED_CLOCK) += sched_clock.o
33obj-$(CONFIG_SMP) += smp.o smp_tlb.o 34obj-$(CONFIG_SMP) += smp.o smp_tlb.o
34obj-$(CONFIG_HAVE_ARM_SCU) += smp_scu.o 35obj-$(CONFIG_HAVE_ARM_SCU) += smp_scu.o
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
index e5e1e5387678..acca35aebe28 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -140,24 +140,18 @@ EXPORT_SYMBOL(__aeabi_ulcmp);
140#endif 140#endif
141 141
142 /* bitops */ 142 /* bitops */
143EXPORT_SYMBOL(_set_bit_le); 143EXPORT_SYMBOL(_set_bit);
144EXPORT_SYMBOL(_test_and_set_bit_le); 144EXPORT_SYMBOL(_test_and_set_bit);
145EXPORT_SYMBOL(_clear_bit_le); 145EXPORT_SYMBOL(_clear_bit);
146EXPORT_SYMBOL(_test_and_clear_bit_le); 146EXPORT_SYMBOL(_test_and_clear_bit);
147EXPORT_SYMBOL(_change_bit_le); 147EXPORT_SYMBOL(_change_bit);
148EXPORT_SYMBOL(_test_and_change_bit_le); 148EXPORT_SYMBOL(_test_and_change_bit);
149EXPORT_SYMBOL(_find_first_zero_bit_le); 149EXPORT_SYMBOL(_find_first_zero_bit_le);
150EXPORT_SYMBOL(_find_next_zero_bit_le); 150EXPORT_SYMBOL(_find_next_zero_bit_le);
151EXPORT_SYMBOL(_find_first_bit_le); 151EXPORT_SYMBOL(_find_first_bit_le);
152EXPORT_SYMBOL(_find_next_bit_le); 152EXPORT_SYMBOL(_find_next_bit_le);
153 153
154#ifdef __ARMEB__ 154#ifdef __ARMEB__
155EXPORT_SYMBOL(_set_bit_be);
156EXPORT_SYMBOL(_test_and_set_bit_be);
157EXPORT_SYMBOL(_clear_bit_be);
158EXPORT_SYMBOL(_test_and_clear_bit_be);
159EXPORT_SYMBOL(_change_bit_be);
160EXPORT_SYMBOL(_test_and_change_bit_be);
161EXPORT_SYMBOL(_find_first_zero_bit_be); 155EXPORT_SYMBOL(_find_first_zero_bit_be);
162EXPORT_SYMBOL(_find_next_zero_bit_be); 156EXPORT_SYMBOL(_find_next_zero_bit_be);
163EXPORT_SYMBOL(_find_first_bit_be); 157EXPORT_SYMBOL(_find_first_bit_be);
@@ -170,3 +164,7 @@ EXPORT_SYMBOL(mcount);
170#endif 164#endif
171EXPORT_SYMBOL(__gnu_mcount_nc); 165EXPORT_SYMBOL(__gnu_mcount_nc);
172#endif 166#endif
167
168#ifdef CONFIG_ARM_PATCH_PHYS_VIRT
169EXPORT_SYMBOL(__pv_phys_offset);
170#endif
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
index 82da66172132..927522cfc12e 100644
--- a/arch/arm/kernel/asm-offsets.c
+++ b/arch/arm/kernel/asm-offsets.c
@@ -13,6 +13,9 @@
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/dma-mapping.h> 15#include <linux/dma-mapping.h>
16#include <asm/cacheflush.h>
17#include <asm/glue-df.h>
18#include <asm/glue-pf.h>
16#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
17#include <asm/thread_info.h> 20#include <asm/thread_info.h>
18#include <asm/memory.h> 21#include <asm/memory.h>
@@ -114,6 +117,14 @@ int main(void)
114#ifdef MULTI_PABORT 117#ifdef MULTI_PABORT
115 DEFINE(PROCESSOR_PABT_FUNC, offsetof(struct processor, _prefetch_abort)); 118 DEFINE(PROCESSOR_PABT_FUNC, offsetof(struct processor, _prefetch_abort));
116#endif 119#endif
120#ifdef MULTI_CPU
121 DEFINE(CPU_SLEEP_SIZE, offsetof(struct processor, suspend_size));
122 DEFINE(CPU_DO_SUSPEND, offsetof(struct processor, do_suspend));
123 DEFINE(CPU_DO_RESUME, offsetof(struct processor, do_resume));
124#endif
125#ifdef MULTI_CACHE
126 DEFINE(CACHE_FLUSH_KERN_ALL, offsetof(struct cpu_cache_fns, flush_kern_all));
127#endif
117 BLANK(); 128 BLANK();
118 DEFINE(DMA_BIDIRECTIONAL, DMA_BIDIRECTIONAL); 129 DEFINE(DMA_BIDIRECTIONAL, DMA_BIDIRECTIONAL);
119 DEFINE(DMA_TO_DEVICE, DMA_TO_DEVICE); 130 DEFINE(DMA_TO_DEVICE, DMA_TO_DEVICE);
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index c6273a3bfc25..d86fcd44b220 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -583,6 +583,11 @@ void __init pci_common_init(struct hw_pci *hw)
583 * Assign resources. 583 * Assign resources.
584 */ 584 */
585 pci_bus_assign_resources(bus); 585 pci_bus_assign_resources(bus);
586
587 /*
588 * Enable bridges
589 */
590 pci_enable_bridges(bus);
586 } 591 }
587 592
588 /* 593 /*
diff --git a/arch/arm/kernel/crash_dump.c b/arch/arm/kernel/crash_dump.c
index cd3b853a8a6d..90c50d4b43f7 100644
--- a/arch/arm/kernel/crash_dump.c
+++ b/arch/arm/kernel/crash_dump.c
@@ -18,9 +18,6 @@
18#include <linux/uaccess.h> 18#include <linux/uaccess.h>
19#include <linux/io.h> 19#include <linux/io.h>
20 20
21/* stores the physical address of elf header of crash image */
22unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
23
24/** 21/**
25 * copy_oldmem_page() - copy one page from old kernel memory 22 * copy_oldmem_page() - copy one page from old kernel memory
26 * @pfn: page frame number to be copied 23 * @pfn: page frame number to be copied
diff --git a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S
index a0f07521ca8a..d2d983be096d 100644
--- a/arch/arm/kernel/debug.S
+++ b/arch/arm/kernel/debug.S
@@ -25,7 +25,7 @@
25 .macro addruart, rp, rv 25 .macro addruart, rp, rv
26 .endm 26 .endm
27 27
28#if defined(CONFIG_CPU_V6) 28#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
29 29
30 .macro senduart, rd, rx 30 .macro senduart, rd, rx
31 mcr p14, 0, \rd, c0, c5, 0 31 mcr p14, 0, \rd, c0, c5, 0
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 2b46fea36c9f..e8d885676807 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -16,7 +16,8 @@
16 */ 16 */
17 17
18#include <asm/memory.h> 18#include <asm/memory.h>
19#include <asm/glue.h> 19#include <asm/glue-df.h>
20#include <asm/glue-pf.h>
20#include <asm/vfpmacros.h> 21#include <asm/vfpmacros.h>
21#include <mach/entry-macro.S> 22#include <mach/entry-macro.S>
22#include <asm/thread_notify.h> 23#include <asm/thread_notify.h>
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
index ae9464900168..051166c2a932 100644
--- a/arch/arm/kernel/entry-header.S
+++ b/arch/arm/kernel/entry-header.S
@@ -76,13 +76,13 @@
76#ifndef CONFIG_THUMB2_KERNEL 76#ifndef CONFIG_THUMB2_KERNEL
77 .macro svc_exit, rpsr 77 .macro svc_exit, rpsr
78 msr spsr_cxsf, \rpsr 78 msr spsr_cxsf, \rpsr
79#if defined(CONFIG_CPU_32v6K) 79#if defined(CONFIG_CPU_V6)
80 clrex @ clear the exclusive monitor
81 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
82#elif defined (CONFIG_CPU_V6)
83 ldr r0, [sp] 80 ldr r0, [sp]
84 strex r1, r2, [sp] @ clear the exclusive monitor 81 strex r1, r2, [sp] @ clear the exclusive monitor
85 ldmib sp, {r1 - pc}^ @ load r1 - pc, cpsr 82 ldmib sp, {r1 - pc}^ @ load r1 - pc, cpsr
83#elif defined(CONFIG_CPU_32v6K)
84 clrex @ clear the exclusive monitor
85 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
86#else 86#else
87 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr 87 ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr
88#endif 88#endif
@@ -92,10 +92,10 @@
92 ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr 92 ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr
93 ldr lr, [sp, #\offset + S_PC]! @ get pc 93 ldr lr, [sp, #\offset + S_PC]! @ get pc
94 msr spsr_cxsf, r1 @ save in spsr_svc 94 msr spsr_cxsf, r1 @ save in spsr_svc
95#if defined(CONFIG_CPU_32v6K) 95#if defined(CONFIG_CPU_V6)
96 clrex @ clear the exclusive monitor
97#elif defined (CONFIG_CPU_V6)
98 strex r1, r2, [sp] @ clear the exclusive monitor 96 strex r1, r2, [sp] @ clear the exclusive monitor
97#elif defined(CONFIG_CPU_32v6K)
98 clrex @ clear the exclusive monitor
99#endif 99#endif
100 .if \fast 100 .if \fast
101 ldmdb sp, {r1 - lr}^ @ get calling r1 - lr 101 ldmdb sp, {r1 - lr}^ @ get calling r1 - lr
diff --git a/arch/arm/kernel/etm.c b/arch/arm/kernel/etm.c
index 11db62806a1a..052b509e2d5f 100644
--- a/arch/arm/kernel/etm.c
+++ b/arch/arm/kernel/etm.c
@@ -338,7 +338,7 @@ static struct miscdevice etb_miscdev = {
338 .fops = &etb_fops, 338 .fops = &etb_fops,
339}; 339};
340 340
341static int __init etb_probe(struct amba_device *dev, struct amba_id *id) 341static int __init etb_probe(struct amba_device *dev, const struct amba_id *id)
342{ 342{
343 struct tracectx *t = &tracer; 343 struct tracectx *t = &tracer;
344 int ret = 0; 344 int ret = 0;
@@ -530,7 +530,7 @@ static ssize_t trace_mode_store(struct kobject *kobj,
530static struct kobj_attribute trace_mode_attr = 530static struct kobj_attribute trace_mode_attr =
531 __ATTR(trace_mode, 0644, trace_mode_show, trace_mode_store); 531 __ATTR(trace_mode, 0644, trace_mode_show, trace_mode_store);
532 532
533static int __init etm_probe(struct amba_device *dev, struct amba_id *id) 533static int __init etm_probe(struct amba_device *dev, const struct amba_id *id)
534{ 534{
535 struct tracectx *t = &tracer; 535 struct tracectx *t = &tracer;
536 int ret = 0; 536 int ret = 0;
diff --git a/arch/arm/kernel/head-common.S b/arch/arm/kernel/head-common.S
index 8f57515bbdb0..c84b57d27d07 100644
--- a/arch/arm/kernel/head-common.S
+++ b/arch/arm/kernel/head-common.S
@@ -25,83 +25,6 @@
25 * machine ID for example). 25 * machine ID for example).
26 */ 26 */
27 __HEAD 27 __HEAD
28__error_a:
29#ifdef CONFIG_DEBUG_LL
30 mov r4, r1 @ preserve machine ID
31 adr r0, str_a1
32 bl printascii
33 mov r0, r4
34 bl printhex8
35 adr r0, str_a2
36 bl printascii
37 adr r3, __lookup_machine_type_data
38 ldmia r3, {r4, r5, r6} @ get machine desc list
39 sub r4, r3, r4 @ get offset between virt&phys
40 add r5, r5, r4 @ convert virt addresses to
41 add r6, r6, r4 @ physical address space
421: ldr r0, [r5, #MACHINFO_TYPE] @ get machine type
43 bl printhex8
44 mov r0, #'\t'
45 bl printch
46 ldr r0, [r5, #MACHINFO_NAME] @ get machine name
47 add r0, r0, r4
48 bl printascii
49 mov r0, #'\n'
50 bl printch
51 add r5, r5, #SIZEOF_MACHINE_DESC @ next machine_desc
52 cmp r5, r6
53 blo 1b
54 adr r0, str_a3
55 bl printascii
56 b __error
57ENDPROC(__error_a)
58
59str_a1: .asciz "\nError: unrecognized/unsupported machine ID (r1 = 0x"
60str_a2: .asciz ").\n\nAvailable machine support:\n\nID (hex)\tNAME\n"
61str_a3: .asciz "\nPlease check your kernel config and/or bootloader.\n"
62 .align
63#else
64 b __error
65#endif
66
67/*
68 * Lookup machine architecture in the linker-build list of architectures.
69 * Note that we can't use the absolute addresses for the __arch_info
70 * lists since we aren't running with the MMU on (and therefore, we are
71 * not in the correct address space). We have to calculate the offset.
72 *
73 * r1 = machine architecture number
74 * Returns:
75 * r3, r4, r6 corrupted
76 * r5 = mach_info pointer in physical address space
77 */
78__lookup_machine_type:
79 adr r3, __lookup_machine_type_data
80 ldmia r3, {r4, r5, r6}
81 sub r3, r3, r4 @ get offset between virt&phys
82 add r5, r5, r3 @ convert virt addresses to
83 add r6, r6, r3 @ physical address space
841: ldr r3, [r5, #MACHINFO_TYPE] @ get machine type
85 teq r3, r1 @ matches loader number?
86 beq 2f @ found
87 add r5, r5, #SIZEOF_MACHINE_DESC @ next machine_desc
88 cmp r5, r6
89 blo 1b
90 mov r5, #0 @ unknown machine
912: mov pc, lr
92ENDPROC(__lookup_machine_type)
93
94/*
95 * Look in arch/arm/kernel/arch.[ch] for information about the
96 * __arch_info structures.
97 */
98 .align 2
99 .type __lookup_machine_type_data, %object
100__lookup_machine_type_data:
101 .long .
102 .long __arch_info_begin
103 .long __arch_info_end
104 .size __lookup_machine_type_data, . - __lookup_machine_type_data
105 28
106/* Determine validity of the r2 atags pointer. The heuristic requires 29/* Determine validity of the r2 atags pointer. The heuristic requires
107 * that the pointer be aligned, in the first 16k of physical RAM and 30 * that the pointer be aligned, in the first 16k of physical RAM and
@@ -109,8 +32,6 @@ __lookup_machine_type_data:
109 * of this function may be more lenient with the physical address and 32 * of this function may be more lenient with the physical address and
110 * may also be able to move the ATAGS block if necessary. 33 * may also be able to move the ATAGS block if necessary.
111 * 34 *
112 * r8 = machinfo
113 *
114 * Returns: 35 * Returns:
115 * r2 either valid atags pointer, or zero 36 * r2 either valid atags pointer, or zero
116 * r5, r6 corrupted 37 * r5, r6 corrupted
@@ -185,17 +106,6 @@ __mmap_switched_data:
185 .size __mmap_switched_data, . - __mmap_switched_data 106 .size __mmap_switched_data, . - __mmap_switched_data
186 107
187/* 108/*
188 * This provides a C-API version of __lookup_machine_type
189 */
190ENTRY(lookup_machine_type)
191 stmfd sp!, {r4 - r6, lr}
192 mov r1, r0
193 bl __lookup_machine_type
194 mov r0, r5
195 ldmfd sp!, {r4 - r6, pc}
196ENDPROC(lookup_machine_type)
197
198/*
199 * This provides a C-API version of __lookup_processor_type 109 * This provides a C-API version of __lookup_processor_type
200 */ 110 */
201ENTRY(lookup_processor_type) 111ENTRY(lookup_processor_type)
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index 814ce1a73270..6b1e0ad9ec3b 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -44,9 +44,6 @@ ENTRY(stext)
44 bl __lookup_processor_type @ r5=procinfo r9=cpuid 44 bl __lookup_processor_type @ r5=procinfo r9=cpuid
45 movs r10, r5 @ invalid processor (r5=0)? 45 movs r10, r5 @ invalid processor (r5=0)?
46 beq __error_p @ yes, error 'p' 46 beq __error_p @ yes, error 'p'
47 bl __lookup_machine_type @ r5=machinfo
48 movs r8, r5 @ invalid machine (r5=0)?
49 beq __error_a @ yes, error 'a'
50 47
51 adr lr, BSYM(__after_proc_init) @ return (PIC) address 48 adr lr, BSYM(__after_proc_init) @ return (PIC) address
52 ARM( add pc, r10, #PROCINFO_INITFUNC ) 49 ARM( add pc, r10, #PROCINFO_INITFUNC )
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index f17d9a09e8fb..c9173cfbbc74 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -26,14 +26,6 @@
26#include <mach/debug-macro.S> 26#include <mach/debug-macro.S>
27#endif 27#endif
28 28
29#if (PHYS_OFFSET & 0x001fffff)
30#error "PHYS_OFFSET must be at an even 2MiB boundary!"
31#endif
32
33#define KERNEL_RAM_VADDR (PAGE_OFFSET + TEXT_OFFSET)
34#define KERNEL_RAM_PADDR (PHYS_OFFSET + TEXT_OFFSET)
35
36
37/* 29/*
38 * swapper_pg_dir is the virtual address of the initial page table. 30 * swapper_pg_dir is the virtual address of the initial page table.
39 * We place the page tables 16K below KERNEL_RAM_VADDR. Therefore, we must 31 * We place the page tables 16K below KERNEL_RAM_VADDR. Therefore, we must
@@ -41,6 +33,7 @@
41 * the least significant 16 bits to be 0x8000, but we could probably 33 * the least significant 16 bits to be 0x8000, but we could probably
42 * relax this restriction to KERNEL_RAM_VADDR >= PAGE_OFFSET + 0x4000. 34 * relax this restriction to KERNEL_RAM_VADDR >= PAGE_OFFSET + 0x4000.
43 */ 35 */
36#define KERNEL_RAM_VADDR (PAGE_OFFSET + TEXT_OFFSET)
44#if (KERNEL_RAM_VADDR & 0xffff) != 0x8000 37#if (KERNEL_RAM_VADDR & 0xffff) != 0x8000
45#error KERNEL_RAM_VADDR must start at 0xXXXX8000 38#error KERNEL_RAM_VADDR must start at 0xXXXX8000
46#endif 39#endif
@@ -48,8 +41,8 @@
48 .globl swapper_pg_dir 41 .globl swapper_pg_dir
49 .equ swapper_pg_dir, KERNEL_RAM_VADDR - 0x4000 42 .equ swapper_pg_dir, KERNEL_RAM_VADDR - 0x4000
50 43
51 .macro pgtbl, rd 44 .macro pgtbl, rd, phys
52 ldr \rd, =(KERNEL_RAM_PADDR - 0x4000) 45 add \rd, \phys, #TEXT_OFFSET - 0x4000
53 .endm 46 .endm
54 47
55#ifdef CONFIG_XIP_KERNEL 48#ifdef CONFIG_XIP_KERNEL
@@ -87,25 +80,33 @@ ENTRY(stext)
87 movs r10, r5 @ invalid processor (r5=0)? 80 movs r10, r5 @ invalid processor (r5=0)?
88 THUMB( it eq ) @ force fixup-able long branch encoding 81 THUMB( it eq ) @ force fixup-able long branch encoding
89 beq __error_p @ yes, error 'p' 82 beq __error_p @ yes, error 'p'
90 bl __lookup_machine_type @ r5=machinfo 83
91 movs r8, r5 @ invalid machine (r5=0)? 84#ifndef CONFIG_XIP_KERNEL
92 THUMB( it eq ) @ force fixup-able long branch encoding 85 adr r3, 2f
93 beq __error_a @ yes, error 'a' 86 ldmia r3, {r4, r8}
87 sub r4, r3, r4 @ (PHYS_OFFSET - PAGE_OFFSET)
88 add r8, r8, r4 @ PHYS_OFFSET
89#else
90 ldr r8, =PLAT_PHYS_OFFSET
91#endif
94 92
95 /* 93 /*
96 * r1 = machine no, r2 = atags, 94 * r1 = machine no, r2 = atags,
97 * r8 = machinfo, r9 = cpuid, r10 = procinfo 95 * r8 = phys_offset, r9 = cpuid, r10 = procinfo
98 */ 96 */
99 bl __vet_atags 97 bl __vet_atags
100#ifdef CONFIG_SMP_ON_UP 98#ifdef CONFIG_SMP_ON_UP
101 bl __fixup_smp 99 bl __fixup_smp
102#endif 100#endif
101#ifdef CONFIG_ARM_PATCH_PHYS_VIRT
102 bl __fixup_pv_table
103#endif
103 bl __create_page_tables 104 bl __create_page_tables
104 105
105 /* 106 /*
106 * The following calls CPU specific code in a position independent 107 * The following calls CPU specific code in a position independent
107 * manner. See arch/arm/mm/proc-*.S for details. r10 = base of 108 * manner. See arch/arm/mm/proc-*.S for details. r10 = base of
108 * xxx_proc_info structure selected by __lookup_machine_type 109 * xxx_proc_info structure selected by __lookup_processor_type
109 * above. On return, the CPU will be ready for the MMU to be 110 * above. On return, the CPU will be ready for the MMU to be
110 * turned on, and r0 will hold the CPU control register value. 111 * turned on, and r0 will hold the CPU control register value.
111 */ 112 */
@@ -118,22 +119,24 @@ ENTRY(stext)
1181: b __enable_mmu 1191: b __enable_mmu
119ENDPROC(stext) 120ENDPROC(stext)
120 .ltorg 121 .ltorg
122#ifndef CONFIG_XIP_KERNEL
1232: .long .
124 .long PAGE_OFFSET
125#endif
121 126
122/* 127/*
123 * Setup the initial page tables. We only setup the barest 128 * Setup the initial page tables. We only setup the barest
124 * amount which are required to get the kernel running, which 129 * amount which are required to get the kernel running, which
125 * generally means mapping in the kernel code. 130 * generally means mapping in the kernel code.
126 * 131 *
127 * r8 = machinfo 132 * r8 = phys_offset, r9 = cpuid, r10 = procinfo
128 * r9 = cpuid
129 * r10 = procinfo
130 * 133 *
131 * Returns: 134 * Returns:
132 * r0, r3, r5-r7 corrupted 135 * r0, r3, r5-r7 corrupted
133 * r4 = physical page table address 136 * r4 = physical page table address
134 */ 137 */
135__create_page_tables: 138__create_page_tables:
136 pgtbl r4 @ page table address 139 pgtbl r4, r8 @ page table address
137 140
138 /* 141 /*
139 * Clear the 16K level 1 swapper page table 142 * Clear the 16K level 1 swapper page table
@@ -189,10 +192,8 @@ __create_page_tables:
189 /* 192 /*
190 * Map some ram to cover our .data and .bss areas. 193 * Map some ram to cover our .data and .bss areas.
191 */ 194 */
192 orr r3, r7, #(KERNEL_RAM_PADDR & 0xff000000) 195 add r3, r8, #TEXT_OFFSET
193 .if (KERNEL_RAM_PADDR & 0x00f00000) 196 orr r3, r3, r7
194 orr r3, r3, #(KERNEL_RAM_PADDR & 0x00f00000)
195 .endif
196 add r0, r4, #(KERNEL_RAM_VADDR & 0xff000000) >> 18 197 add r0, r4, #(KERNEL_RAM_VADDR & 0xff000000) >> 18
197 str r3, [r0, #(KERNEL_RAM_VADDR & 0x00f00000) >> 18]! 198 str r3, [r0, #(KERNEL_RAM_VADDR & 0x00f00000) >> 18]!
198 ldr r6, =(_end - 1) 199 ldr r6, =(_end - 1)
@@ -205,14 +206,17 @@ __create_page_tables:
205#endif 206#endif
206 207
207 /* 208 /*
208 * Then map first 1MB of ram in case it contains our boot params. 209 * Then map boot params address in r2 or
210 * the first 1MB of ram if boot params address is not specified.
209 */ 211 */
210 add r0, r4, #PAGE_OFFSET >> 18 212 mov r0, r2, lsr #20
211 orr r6, r7, #(PHYS_OFFSET & 0xff000000) 213 movs r0, r0, lsl #20
212 .if (PHYS_OFFSET & 0x00f00000) 214 moveq r0, r8
213 orr r6, r6, #(PHYS_OFFSET & 0x00f00000) 215 sub r3, r0, r8
214 .endif 216 add r3, r3, #PAGE_OFFSET
215 str r6, [r0] 217 add r3, r4, r3, lsr #18
218 orr r6, r7, r0
219 str r6, [r3]
216 220
217#ifdef CONFIG_DEBUG_LL 221#ifdef CONFIG_DEBUG_LL
218#ifndef CONFIG_DEBUG_ICEDCC 222#ifndef CONFIG_DEBUG_ICEDCC
@@ -391,25 +395,24 @@ ENDPROC(__turn_mmu_on)
391 395
392 396
393#ifdef CONFIG_SMP_ON_UP 397#ifdef CONFIG_SMP_ON_UP
398 __INIT
394__fixup_smp: 399__fixup_smp:
395 mov r4, #0x00070000 400 and r3, r9, #0x000f0000 @ architecture version
396 orr r3, r4, #0xff000000 @ mask 0xff070000 401 teq r3, #0x000f0000 @ CPU ID supported?
397 orr r4, r4, #0x41000000 @ val 0x41070000
398 and r0, r9, r3
399 teq r0, r4 @ ARM CPU and ARMv6/v7?
400 bne __fixup_smp_on_up @ no, assume UP 402 bne __fixup_smp_on_up @ no, assume UP
401 403
402 orr r3, r3, #0x0000ff00 404 bic r3, r9, #0x00ff0000
403 orr r3, r3, #0x000000f0 @ mask 0xff07fff0 405 bic r3, r3, #0x0000000f @ mask 0xff00fff0
406 mov r4, #0x41000000
404 orr r4, r4, #0x0000b000 407 orr r4, r4, #0x0000b000
405 orr r4, r4, #0x00000020 @ val 0x4107b020 408 orr r4, r4, #0x00000020 @ val 0x4100b020
406 and r0, r9, r3 409 teq r3, r4 @ ARM 11MPCore?
407 teq r0, r4 @ ARM 11MPCore?
408 moveq pc, lr @ yes, assume SMP 410 moveq pc, lr @ yes, assume SMP
409 411
410 mrc p15, 0, r0, c0, c0, 5 @ read MPIDR 412 mrc p15, 0, r0, c0, c0, 5 @ read MPIDR
411 tst r0, #1 << 31 413 and r0, r0, #0xc0000000 @ multiprocessing extensions and
412 movne pc, lr @ bit 31 => SMP 414 teq r0, #0x80000000 @ not part of a uniprocessor system?
415 moveq pc, lr @ yes, assume SMP
413 416
414__fixup_smp_on_up: 417__fixup_smp_on_up:
415 adr r0, 1f 418 adr r0, 1f
@@ -417,18 +420,7 @@ __fixup_smp_on_up:
417 sub r3, r0, r3 420 sub r3, r0, r3
418 add r4, r4, r3 421 add r4, r4, r3
419 add r5, r5, r3 422 add r5, r5, r3
4202: cmp r4, r5 423 b __do_fixup_smp_on_up
421 movhs pc, lr
422 ldmia r4!, {r0, r6}
423 ARM( str r6, [r0, r3] )
424 THUMB( add r0, r0, r3 )
425#ifdef __ARMEB__
426 THUMB( mov r6, r6, ror #16 ) @ Convert word order for big-endian.
427#endif
428 THUMB( strh r6, [r0], #2 ) @ For Thumb-2, store as two halfwords
429 THUMB( mov r6, r6, lsr #16 ) @ to be robust against misaligned r3.
430 THUMB( strh r6, [r0] )
431 b 2b
432ENDPROC(__fixup_smp) 424ENDPROC(__fixup_smp)
433 425
434 .align 426 .align
@@ -442,7 +434,156 @@ smp_on_up:
442 ALT_SMP(.long 1) 434 ALT_SMP(.long 1)
443 ALT_UP(.long 0) 435 ALT_UP(.long 0)
444 .popsection 436 .popsection
437#endif
438
439 .text
440__do_fixup_smp_on_up:
441 cmp r4, r5
442 movhs pc, lr
443 ldmia r4!, {r0, r6}
444 ARM( str r6, [r0, r3] )
445 THUMB( add r0, r0, r3 )
446#ifdef __ARMEB__
447 THUMB( mov r6, r6, ror #16 ) @ Convert word order for big-endian.
448#endif
449 THUMB( strh r6, [r0], #2 ) @ For Thumb-2, store as two halfwords
450 THUMB( mov r6, r6, lsr #16 ) @ to be robust against misaligned r3.
451 THUMB( strh r6, [r0] )
452 b __do_fixup_smp_on_up
453ENDPROC(__do_fixup_smp_on_up)
454
455ENTRY(fixup_smp)
456 stmfd sp!, {r4 - r6, lr}
457 mov r4, r0
458 add r5, r0, r1
459 mov r3, #0
460 bl __do_fixup_smp_on_up
461 ldmfd sp!, {r4 - r6, pc}
462ENDPROC(fixup_smp)
463
464#ifdef CONFIG_ARM_PATCH_PHYS_VIRT
445 465
466/* __fixup_pv_table - patch the stub instructions with the delta between
467 * PHYS_OFFSET and PAGE_OFFSET, which is assumed to be 16MiB aligned and
468 * can be expressed by an immediate shifter operand. The stub instruction
469 * has a form of '(add|sub) rd, rn, #imm'.
470 */
471 __HEAD
472__fixup_pv_table:
473 adr r0, 1f
474 ldmia r0, {r3-r5, r7}
475 sub r3, r0, r3 @ PHYS_OFFSET - PAGE_OFFSET
476 add r4, r4, r3 @ adjust table start address
477 add r5, r5, r3 @ adjust table end address
478 add r7, r7, r3 @ adjust __pv_phys_offset address
479 str r8, [r7] @ save computed PHYS_OFFSET to __pv_phys_offset
480#ifndef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT
481 mov r6, r3, lsr #24 @ constant for add/sub instructions
482 teq r3, r6, lsl #24 @ must be 16MiB aligned
483#else
484 mov r6, r3, lsr #16 @ constant for add/sub instructions
485 teq r3, r6, lsl #16 @ must be 64kiB aligned
486#endif
487THUMB( it ne @ cross section branch )
488 bne __error
489 str r6, [r7, #4] @ save to __pv_offset
490 b __fixup_a_pv_table
491ENDPROC(__fixup_pv_table)
492
493 .align
4941: .long .
495 .long __pv_table_begin
496 .long __pv_table_end
4972: .long __pv_phys_offset
498
499 .text
500__fixup_a_pv_table:
501#ifdef CONFIG_THUMB2_KERNEL
502#ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT
503 lsls r0, r6, #24
504 lsr r6, #8
505 beq 1f
506 clz r7, r0
507 lsr r0, #24
508 lsl r0, r7
509 bic r0, 0x0080
510 lsrs r7, #1
511 orrcs r0, #0x0080
512 orr r0, r0, r7, lsl #12
513#endif
5141: lsls r6, #24
515 beq 4f
516 clz r7, r6
517 lsr r6, #24
518 lsl r6, r7
519 bic r6, #0x0080
520 lsrs r7, #1
521 orrcs r6, #0x0080
522 orr r6, r6, r7, lsl #12
523 orr r6, #0x4000
524 b 4f
5252: @ at this point the C flag is always clear
526 add r7, r3
527#ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT
528 ldrh ip, [r7]
529 tst ip, 0x0400 @ the i bit tells us LS or MS byte
530 beq 3f
531 cmp r0, #0 @ set C flag, and ...
532 biceq ip, 0x0400 @ immediate zero value has a special encoding
533 streqh ip, [r7] @ that requires the i bit cleared
534#endif
5353: ldrh ip, [r7, #2]
536 and ip, 0x8f00
537 orrcc ip, r6 @ mask in offset bits 31-24
538 orrcs ip, r0 @ mask in offset bits 23-16
539 strh ip, [r7, #2]
5404: cmp r4, r5
541 ldrcc r7, [r4], #4 @ use branch for delay slot
542 bcc 2b
543 bx lr
544#else
545#ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT
546 and r0, r6, #255 @ offset bits 23-16
547 mov r6, r6, lsr #8 @ offset bits 31-24
548#else
549 mov r0, #0 @ just in case...
550#endif
551 b 3f
5522: ldr ip, [r7, r3]
553 bic ip, ip, #0x000000ff
554 tst ip, #0x400 @ rotate shift tells us LS or MS byte
555 orrne ip, ip, r6 @ mask in offset bits 31-24
556 orreq ip, ip, r0 @ mask in offset bits 23-16
557 str ip, [r7, r3]
5583: cmp r4, r5
559 ldrcc r7, [r4], #4 @ use branch for delay slot
560 bcc 2b
561 mov pc, lr
562#endif
563ENDPROC(__fixup_a_pv_table)
564
565ENTRY(fixup_pv_table)
566 stmfd sp!, {r4 - r7, lr}
567 ldr r2, 2f @ get address of __pv_phys_offset
568 mov r3, #0 @ no offset
569 mov r4, r0 @ r0 = table start
570 add r5, r0, r1 @ r1 = table size
571 ldr r6, [r2, #4] @ get __pv_offset
572 bl __fixup_a_pv_table
573 ldmfd sp!, {r4 - r7, pc}
574ENDPROC(fixup_pv_table)
575
576 .align
5772: .long __pv_phys_offset
578
579 .data
580 .globl __pv_phys_offset
581 .type __pv_phys_offset, %object
582__pv_phys_offset:
583 .long 0
584 .size __pv_phys_offset, . - __pv_phys_offset
585__pv_offset:
586 .long 0
446#endif 587#endif
447 588
448#include "head-common.S" 589#include "head-common.S"
diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c
index c9f3f0467570..8dbc126f7152 100644
--- a/arch/arm/kernel/hw_breakpoint.c
+++ b/arch/arm/kernel/hw_breakpoint.c
@@ -137,11 +137,10 @@ static u8 get_debug_arch(void)
137 u32 didr; 137 u32 didr;
138 138
139 /* Do we implement the extended CPUID interface? */ 139 /* Do we implement the extended CPUID interface? */
140 if (((read_cpuid_id() >> 16) & 0xf) != 0xf) { 140 if (WARN_ONCE((((read_cpuid_id() >> 16) & 0xf) != 0xf),
141 pr_warning("CPUID feature registers not supported. " 141 "CPUID feature registers not supported. "
142 "Assuming v6 debug is present.\n"); 142 "Assuming v6 debug is present.\n"))
143 return ARM_DEBUG_ARCH_V6; 143 return ARM_DEBUG_ARCH_V6;
144 }
145 144
146 ARM_DBG_READ(c0, 0, didr); 145 ARM_DBG_READ(c0, 0, didr);
147 return (didr >> 16) & 0xf; 146 return (didr >> 16) & 0xf;
@@ -152,6 +151,12 @@ u8 arch_get_debug_arch(void)
152 return debug_arch; 151 return debug_arch;
153} 152}
154 153
154static int debug_arch_supported(void)
155{
156 u8 arch = get_debug_arch();
157 return arch >= ARM_DEBUG_ARCH_V6 && arch <= ARM_DEBUG_ARCH_V7_ECP14;
158}
159
155/* Determine number of BRP register available. */ 160/* Determine number of BRP register available. */
156static int get_num_brp_resources(void) 161static int get_num_brp_resources(void)
157{ 162{
@@ -233,8 +238,8 @@ static int enable_monitor_mode(void)
233 ARM_DBG_READ(c1, 0, dscr); 238 ARM_DBG_READ(c1, 0, dscr);
234 239
235 /* Ensure that halting mode is disabled. */ 240 /* Ensure that halting mode is disabled. */
236 if (WARN_ONCE(dscr & ARM_DSCR_HDBGEN, "halting debug mode enabled." 241 if (WARN_ONCE(dscr & ARM_DSCR_HDBGEN,
237 "Unable to access hardware resources.")) { 242 "halting debug mode enabled. Unable to access hardware resources.\n")) {
238 ret = -EPERM; 243 ret = -EPERM;
239 goto out; 244 goto out;
240 } 245 }
@@ -268,6 +273,9 @@ out:
268 273
269int hw_breakpoint_slots(int type) 274int hw_breakpoint_slots(int type)
270{ 275{
276 if (!debug_arch_supported())
277 return 0;
278
271 /* 279 /*
272 * We can be called early, so don't rely on 280 * We can be called early, so don't rely on
273 * our static variables being initialised. 281 * our static variables being initialised.
@@ -369,7 +377,7 @@ int arch_install_hw_breakpoint(struct perf_event *bp)
369 } 377 }
370 } 378 }
371 379
372 if (WARN_ONCE(i == max_slots, "Can't find any breakpoint slot")) { 380 if (WARN_ONCE(i == max_slots, "Can't find any breakpoint slot\n")) {
373 ret = -EBUSY; 381 ret = -EBUSY;
374 goto out; 382 goto out;
375 } 383 }
@@ -415,7 +423,7 @@ void arch_uninstall_hw_breakpoint(struct perf_event *bp)
415 } 423 }
416 } 424 }
417 425
418 if (WARN_ONCE(i == max_slots, "Can't find any breakpoint slot")) 426 if (WARN_ONCE(i == max_slots, "Can't find any breakpoint slot\n"))
419 return; 427 return;
420 428
421 /* Reset the control register. */ 429 /* Reset the control register. */
@@ -627,7 +635,7 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp)
627 if (WARN_ONCE(!bp->overflow_handler && 635 if (WARN_ONCE(!bp->overflow_handler &&
628 (arch_check_bp_in_kernelspace(bp) || !core_has_mismatch_brps() 636 (arch_check_bp_in_kernelspace(bp) || !core_has_mismatch_brps()
629 || !bp->hw.bp_target), 637 || !bp->hw.bp_target),
630 "overflow handler required but none found")) { 638 "overflow handler required but none found\n")) {
631 ret = -EINVAL; 639 ret = -EINVAL;
632 } 640 }
633out: 641out:
@@ -828,20 +836,33 @@ static int hw_breakpoint_pending(unsigned long addr, unsigned int fsr,
828/* 836/*
829 * One-time initialisation. 837 * One-time initialisation.
830 */ 838 */
831static void reset_ctrl_regs(void *unused) 839static void reset_ctrl_regs(void *info)
832{ 840{
833 int i; 841 int i, cpu = smp_processor_id();
842 u32 dbg_power;
843 cpumask_t *cpumask = info;
834 844
835 /* 845 /*
836 * v7 debug contains save and restore registers so that debug state 846 * v7 debug contains save and restore registers so that debug state
837 * can be maintained across low-power modes without leaving 847 * can be maintained across low-power modes without leaving the debug
838 * the debug logic powered up. It is IMPLEMENTATION DEFINED whether 848 * logic powered up. It is IMPLEMENTATION DEFINED whether we can access
839 * we can write to the debug registers out of reset, so we must 849 * the debug registers out of reset, so we must unlock the OS Lock
840 * unlock the OS Lock Access Register to avoid taking undefined 850 * Access Register to avoid taking undefined instruction exceptions
841 * instruction exceptions later on. 851 * later on.
842 */ 852 */
843 if (debug_arch >= ARM_DEBUG_ARCH_V7_ECP14) { 853 if (debug_arch >= ARM_DEBUG_ARCH_V7_ECP14) {
844 /* 854 /*
855 * Ensure sticky power-down is clear (i.e. debug logic is
856 * powered up).
857 */
858 asm volatile("mrc p14, 0, %0, c1, c5, 4" : "=r" (dbg_power));
859 if ((dbg_power & 0x1) == 0) {
860 pr_warning("CPU %d debug is powered down!\n", cpu);
861 cpumask_or(cpumask, cpumask, cpumask_of(cpu));
862 return;
863 }
864
865 /*
845 * Unconditionally clear the lock by writing a value 866 * Unconditionally clear the lock by writing a value
846 * other than 0xC5ACCE55 to the access register. 867 * other than 0xC5ACCE55 to the access register.
847 */ 868 */
@@ -879,10 +900,11 @@ static struct notifier_block __cpuinitdata dbg_reset_nb = {
879static int __init arch_hw_breakpoint_init(void) 900static int __init arch_hw_breakpoint_init(void)
880{ 901{
881 u32 dscr; 902 u32 dscr;
903 cpumask_t cpumask = { CPU_BITS_NONE };
882 904
883 debug_arch = get_debug_arch(); 905 debug_arch = get_debug_arch();
884 906
885 if (debug_arch > ARM_DEBUG_ARCH_V7_ECP14) { 907 if (!debug_arch_supported()) {
886 pr_info("debug architecture 0x%x unsupported.\n", debug_arch); 908 pr_info("debug architecture 0x%x unsupported.\n", debug_arch);
887 return 0; 909 return 0;
888 } 910 }
@@ -899,18 +921,24 @@ static int __init arch_hw_breakpoint_init(void)
899 pr_info("%d breakpoint(s) reserved for watchpoint " 921 pr_info("%d breakpoint(s) reserved for watchpoint "
900 "single-step.\n", core_num_reserved_brps); 922 "single-step.\n", core_num_reserved_brps);
901 923
924 /*
925 * Reset the breakpoint resources. We assume that a halting
926 * debugger will leave the world in a nice state for us.
927 */
928 on_each_cpu(reset_ctrl_regs, &cpumask, 1);
929 if (!cpumask_empty(&cpumask)) {
930 core_num_brps = 0;
931 core_num_reserved_brps = 0;
932 core_num_wrps = 0;
933 return 0;
934 }
935
902 ARM_DBG_READ(c1, 0, dscr); 936 ARM_DBG_READ(c1, 0, dscr);
903 if (dscr & ARM_DSCR_HDBGEN) { 937 if (dscr & ARM_DSCR_HDBGEN) {
904 pr_warning("halting debug mode enabled. Assuming maximum " 938 max_watchpoint_len = 4;
905 "watchpoint size of 4 bytes."); 939 pr_warning("halting debug mode enabled. Assuming maximum watchpoint size of %u bytes.\n",
940 max_watchpoint_len);
906 } else { 941 } else {
907 /*
908 * Reset the breakpoint resources. We assume that a halting
909 * debugger will leave the world in a nice state for us.
910 */
911 smp_call_function(reset_ctrl_regs, NULL, 1);
912 reset_ctrl_regs(NULL);
913
914 /* Work out the maximum supported watchpoint length. */ 942 /* Work out the maximum supported watchpoint length. */
915 max_watchpoint_len = get_max_wp_len(); 943 max_watchpoint_len = get_max_wp_len();
916 pr_info("maximum watchpoint size is %u bytes.\n", 944 pr_info("maximum watchpoint size is %u bytes.\n",
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 28536e352deb..3535d3793e65 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -179,14 +179,21 @@ int __init arch_probe_nr_irqs(void)
179 179
180#ifdef CONFIG_HOTPLUG_CPU 180#ifdef CONFIG_HOTPLUG_CPU
181 181
182static void route_irq(struct irq_desc *desc, unsigned int irq, unsigned int cpu) 182static bool migrate_one_irq(struct irq_data *d)
183{ 183{
184 pr_debug("IRQ%u: moving from cpu%u to cpu%u\n", irq, desc->irq_data.node, cpu); 184 unsigned int cpu = cpumask_any_and(d->affinity, cpu_online_mask);
185 bool ret = false;
185 186
186 raw_spin_lock_irq(&desc->lock); 187 if (cpu >= nr_cpu_ids) {
187 desc->irq_data.chip->irq_set_affinity(&desc->irq_data, 188 cpu = cpumask_any(cpu_online_mask);
188 cpumask_of(cpu), false); 189 ret = true;
189 raw_spin_unlock_irq(&desc->lock); 190 }
191
192 pr_debug("IRQ%u: moving from cpu%u to cpu%u\n", d->irq, d->node, cpu);
193
194 d->chip->irq_set_affinity(d, cpumask_of(cpu), true);
195
196 return ret;
190} 197}
191 198
192/* 199/*
@@ -198,25 +205,30 @@ void migrate_irqs(void)
198{ 205{
199 unsigned int i, cpu = smp_processor_id(); 206 unsigned int i, cpu = smp_processor_id();
200 struct irq_desc *desc; 207 struct irq_desc *desc;
208 unsigned long flags;
209
210 local_irq_save(flags);
201 211
202 for_each_irq_desc(i, desc) { 212 for_each_irq_desc(i, desc) {
203 struct irq_data *d = &desc->irq_data; 213 struct irq_data *d = &desc->irq_data;
214 bool affinity_broken = false;
204 215
205 if (d->node == cpu) { 216 raw_spin_lock(&desc->lock);
206 unsigned int newcpu = cpumask_any_and(d->affinity, 217 do {
207 cpu_online_mask); 218 if (desc->action == NULL)
208 if (newcpu >= nr_cpu_ids) { 219 break;
209 if (printk_ratelimit())
210 printk(KERN_INFO "IRQ%u no longer affine to CPU%u\n",
211 i, cpu);
212 220
213 cpumask_setall(d->affinity); 221 if (d->node != cpu)
214 newcpu = cpumask_any_and(d->affinity, 222 break;
215 cpu_online_mask);
216 }
217 223
218 route_irq(desc, i, newcpu); 224 affinity_broken = migrate_one_irq(d);
219 } 225 } while (0);
226 raw_spin_unlock(&desc->lock);
227
228 if (affinity_broken && printk_ratelimit())
229 pr_warning("IRQ%u no longer affine to CPU%u\n", i, cpu);
220 } 230 }
231
232 local_irq_restore(flags);
221} 233}
222#endif /* CONFIG_HOTPLUG_CPU */ 234#endif /* CONFIG_HOTPLUG_CPU */
diff --git a/arch/arm/kernel/kprobes-decode.c b/arch/arm/kernel/kprobes-decode.c
index 2c1f0050c9c4..8f6ed43861f1 100644
--- a/arch/arm/kernel/kprobes-decode.c
+++ b/arch/arm/kernel/kprobes-decode.c
@@ -1437,7 +1437,7 @@ arm_kprobe_decode_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi)
1437 1437
1438 return space_cccc_1100_010x(insn, asi); 1438 return space_cccc_1100_010x(insn, asi);
1439 1439
1440 } else if ((insn & 0x0e000000) == 0x0c400000) { 1440 } else if ((insn & 0x0e000000) == 0x0c000000) {
1441 1441
1442 return space_cccc_110x(insn, asi); 1442 return space_cccc_110x(insn, asi);
1443 1443
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
index 30ead135ff5f..e59bbd496c39 100644
--- a/arch/arm/kernel/machine_kexec.c
+++ b/arch/arm/kernel/machine_kexec.c
@@ -75,6 +75,11 @@ void machine_crash_shutdown(struct pt_regs *regs)
75 printk(KERN_INFO "Loading crashdump kernel...\n"); 75 printk(KERN_INFO "Loading crashdump kernel...\n");
76} 76}
77 77
78/*
79 * Function pointer to optional machine-specific reinitialization
80 */
81void (*kexec_reinit)(void);
82
78void machine_kexec(struct kimage *image) 83void machine_kexec(struct kimage *image)
79{ 84{
80 unsigned long page_list; 85 unsigned long page_list;
@@ -104,6 +109,8 @@ void machine_kexec(struct kimage *image)
104 (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE); 109 (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE);
105 printk(KERN_INFO "Bye!\n"); 110 printk(KERN_INFO "Bye!\n");
106 111
112 if (kexec_reinit)
113 kexec_reinit();
107 local_irq_disable(); 114 local_irq_disable();
108 local_fiq_disable(); 115 local_fiq_disable();
109 setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/ 116 setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
index 2cfe8161b478..fee7c36349eb 100644
--- a/arch/arm/kernel/module.c
+++ b/arch/arm/kernel/module.c
@@ -22,6 +22,7 @@
22 22
23#include <asm/pgtable.h> 23#include <asm/pgtable.h>
24#include <asm/sections.h> 24#include <asm/sections.h>
25#include <asm/smp_plat.h>
25#include <asm/unwind.h> 26#include <asm/unwind.h>
26 27
27#ifdef CONFIG_XIP_KERNEL 28#ifdef CONFIG_XIP_KERNEL
@@ -75,6 +76,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
75 for (i = 0; i < relsec->sh_size / sizeof(Elf32_Rel); i++, rel++) { 76 for (i = 0; i < relsec->sh_size / sizeof(Elf32_Rel); i++, rel++) {
76 unsigned long loc; 77 unsigned long loc;
77 Elf32_Sym *sym; 78 Elf32_Sym *sym;
79 const char *symname;
78 s32 offset; 80 s32 offset;
79#ifdef CONFIG_THUMB2_KERNEL 81#ifdef CONFIG_THUMB2_KERNEL
80 u32 upper, lower, sign, j1, j2; 82 u32 upper, lower, sign, j1, j2;
@@ -82,18 +84,18 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
82 84
83 offset = ELF32_R_SYM(rel->r_info); 85 offset = ELF32_R_SYM(rel->r_info);
84 if (offset < 0 || offset > (symsec->sh_size / sizeof(Elf32_Sym))) { 86 if (offset < 0 || offset > (symsec->sh_size / sizeof(Elf32_Sym))) {
85 printk(KERN_ERR "%s: bad relocation, section %d reloc %d\n", 87 pr_err("%s: section %u reloc %u: bad relocation sym offset\n",
86 module->name, relindex, i); 88 module->name, relindex, i);
87 return -ENOEXEC; 89 return -ENOEXEC;
88 } 90 }
89 91
90 sym = ((Elf32_Sym *)symsec->sh_addr) + offset; 92 sym = ((Elf32_Sym *)symsec->sh_addr) + offset;
93 symname = strtab + sym->st_name;
91 94
92 if (rel->r_offset < 0 || rel->r_offset > dstsec->sh_size - sizeof(u32)) { 95 if (rel->r_offset < 0 || rel->r_offset > dstsec->sh_size - sizeof(u32)) {
93 printk(KERN_ERR "%s: out of bounds relocation, " 96 pr_err("%s: section %u reloc %u sym '%s': out of bounds relocation, offset %d size %u\n",
94 "section %d reloc %d offset %d size %d\n", 97 module->name, relindex, i, symname,
95 module->name, relindex, i, rel->r_offset, 98 rel->r_offset, dstsec->sh_size);
96 dstsec->sh_size);
97 return -ENOEXEC; 99 return -ENOEXEC;
98 } 100 }
99 101
@@ -119,10 +121,10 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
119 if (offset & 3 || 121 if (offset & 3 ||
120 offset <= (s32)0xfe000000 || 122 offset <= (s32)0xfe000000 ||
121 offset >= (s32)0x02000000) { 123 offset >= (s32)0x02000000) {
122 printk(KERN_ERR 124 pr_err("%s: section %u reloc %u sym '%s': relocation %u out of range (%#lx -> %#x)\n",
123 "%s: relocation out of range, section " 125 module->name, relindex, i, symname,
124 "%d reloc %d sym '%s'\n", module->name, 126 ELF32_R_TYPE(rel->r_info), loc,
125 relindex, i, strtab + sym->st_name); 127 sym->st_value);
126 return -ENOEXEC; 128 return -ENOEXEC;
127 } 129 }
128 130
@@ -195,10 +197,10 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
195 if (!(offset & 1) || 197 if (!(offset & 1) ||
196 offset <= (s32)0xff000000 || 198 offset <= (s32)0xff000000 ||
197 offset >= (s32)0x01000000) { 199 offset >= (s32)0x01000000) {
198 printk(KERN_ERR 200 pr_err("%s: section %u reloc %u sym '%s': relocation %u out of range (%#lx -> %#x)\n",
199 "%s: relocation out of range, section " 201 module->name, relindex, i, symname,
200 "%d reloc %d sym '%s'\n", module->name, 202 ELF32_R_TYPE(rel->r_info), loc,
201 relindex, i, strtab + sym->st_name); 203 sym->st_value);
202 return -ENOEXEC; 204 return -ENOEXEC;
203 } 205 }
204 206
@@ -268,12 +270,29 @@ struct mod_unwind_map {
268 const Elf_Shdr *txt_sec; 270 const Elf_Shdr *txt_sec;
269}; 271};
270 272
273static const Elf_Shdr *find_mod_section(const Elf32_Ehdr *hdr,
274 const Elf_Shdr *sechdrs, const char *name)
275{
276 const Elf_Shdr *s, *se;
277 const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
278
279 for (s = sechdrs, se = sechdrs + hdr->e_shnum; s < se; s++)
280 if (strcmp(name, secstrs + s->sh_name) == 0)
281 return s;
282
283 return NULL;
284}
285
286extern void fixup_pv_table(const void *, unsigned long);
287extern void fixup_smp(const void *, unsigned long);
288
271int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs, 289int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
272 struct module *mod) 290 struct module *mod)
273{ 291{
292 const Elf_Shdr *s = NULL;
274#ifdef CONFIG_ARM_UNWIND 293#ifdef CONFIG_ARM_UNWIND
275 const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; 294 const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
276 const Elf_Shdr *s, *sechdrs_end = sechdrs + hdr->e_shnum; 295 const Elf_Shdr *sechdrs_end = sechdrs + hdr->e_shnum;
277 struct mod_unwind_map maps[ARM_SEC_MAX]; 296 struct mod_unwind_map maps[ARM_SEC_MAX];
278 int i; 297 int i;
279 298
@@ -315,6 +334,14 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
315 maps[i].txt_sec->sh_addr, 334 maps[i].txt_sec->sh_addr,
316 maps[i].txt_sec->sh_size); 335 maps[i].txt_sec->sh_size);
317#endif 336#endif
337#ifdef CONFIG_ARM_PATCH_PHYS_VIRT
338 s = find_mod_section(hdr, sechdrs, ".pv_table");
339 if (s)
340 fixup_pv_table((void *)s->sh_addr, s->sh_size);
341#endif
342 s = find_mod_section(hdr, sechdrs, ".alt.smp.init");
343 if (s && !is_smp())
344 fixup_smp((void *)s->sh_addr, s->sh_size);
318 return 0; 345 return 0;
319} 346}
320 347
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 5efa2647a2fb..22e194eb8536 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -377,9 +377,18 @@ validate_group(struct perf_event *event)
377 return 0; 377 return 0;
378} 378}
379 379
380static irqreturn_t armpmu_platform_irq(int irq, void *dev)
381{
382 struct arm_pmu_platdata *plat = dev_get_platdata(&pmu_device->dev);
383
384 return plat->handle_irq(irq, dev, armpmu->handle_irq);
385}
386
380static int 387static int
381armpmu_reserve_hardware(void) 388armpmu_reserve_hardware(void)
382{ 389{
390 struct arm_pmu_platdata *plat;
391 irq_handler_t handle_irq;
383 int i, err = -ENODEV, irq; 392 int i, err = -ENODEV, irq;
384 393
385 pmu_device = reserve_pmu(ARM_PMU_DEVICE_CPU); 394 pmu_device = reserve_pmu(ARM_PMU_DEVICE_CPU);
@@ -390,6 +399,12 @@ armpmu_reserve_hardware(void)
390 399
391 init_pmu(ARM_PMU_DEVICE_CPU); 400 init_pmu(ARM_PMU_DEVICE_CPU);
392 401
402 plat = dev_get_platdata(&pmu_device->dev);
403 if (plat && plat->handle_irq)
404 handle_irq = armpmu_platform_irq;
405 else
406 handle_irq = armpmu->handle_irq;
407
393 if (pmu_device->num_resources < 1) { 408 if (pmu_device->num_resources < 1) {
394 pr_err("no irqs for PMUs defined\n"); 409 pr_err("no irqs for PMUs defined\n");
395 return -ENODEV; 410 return -ENODEV;
@@ -400,7 +415,7 @@ armpmu_reserve_hardware(void)
400 if (irq < 0) 415 if (irq < 0)
401 continue; 416 continue;
402 417
403 err = request_irq(irq, armpmu->handle_irq, 418 err = request_irq(irq, handle_irq,
404 IRQF_DISABLED | IRQF_NOBALANCING, 419 IRQF_DISABLED | IRQF_NOBALANCING,
405 "armpmu", NULL); 420 "armpmu", NULL);
406 if (err) { 421 if (err) {
@@ -700,7 +715,7 @@ user_backtrace(struct frame_tail __user *tail,
700 * Frame pointers should strictly progress back up the stack 715 * Frame pointers should strictly progress back up the stack
701 * (towards higher addresses). 716 * (towards higher addresses).
702 */ 717 */
703 if (tail >= buftail.fp) 718 if (tail + 1 >= buftail.fp)
704 return NULL; 719 return NULL;
705 720
706 return buftail.fp - 1; 721 return buftail.fp - 1;
diff --git a/arch/arm/kernel/perf_event_v6.c b/arch/arm/kernel/perf_event_v6.c
index c058bfc8532b..6fc2d228db55 100644
--- a/arch/arm/kernel/perf_event_v6.c
+++ b/arch/arm/kernel/perf_event_v6.c
@@ -30,7 +30,7 @@
30 * enable the interrupt. 30 * enable the interrupt.
31 */ 31 */
32 32
33#ifdef CONFIG_CPU_V6 33#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
34enum armv6_perf_types { 34enum armv6_perf_types {
35 ARMV6_PERFCTR_ICACHE_MISS = 0x0, 35 ARMV6_PERFCTR_ICACHE_MISS = 0x0,
36 ARMV6_PERFCTR_IBUF_STALL = 0x1, 36 ARMV6_PERFCTR_IBUF_STALL = 0x1,
@@ -669,4 +669,4 @@ static const struct arm_pmu *__init armv6mpcore_pmu_init(void)
669{ 669{
670 return NULL; 670 return NULL;
671} 671}
672#endif /* CONFIG_CPU_V6 */ 672#endif /* CONFIG_CPU_V6 || CONFIG_CPU_V6K */
diff --git a/arch/arm/kernel/pmu.c b/arch/arm/kernel/pmu.c
index b8af96ea62e6..2c79eec19262 100644
--- a/arch/arm/kernel/pmu.c
+++ b/arch/arm/kernel/pmu.c
@@ -97,28 +97,34 @@ set_irq_affinity(int irq,
97 irq, cpu); 97 irq, cpu);
98 return err; 98 return err;
99#else 99#else
100 return 0; 100 return -EINVAL;
101#endif 101#endif
102} 102}
103 103
104static int 104static int
105init_cpu_pmu(void) 105init_cpu_pmu(void)
106{ 106{
107 int i, err = 0; 107 int i, irqs, err = 0;
108 struct platform_device *pdev = pmu_devices[ARM_PMU_DEVICE_CPU]; 108 struct platform_device *pdev = pmu_devices[ARM_PMU_DEVICE_CPU];
109 109
110 if (!pdev) { 110 if (!pdev)
111 err = -ENODEV; 111 return -ENODEV;
112 goto out; 112
113 } 113 irqs = pdev->num_resources;
114
115 /*
116 * If we have a single PMU interrupt that we can't shift, assume that
117 * we're running on a uniprocessor machine and continue.
118 */
119 if (irqs == 1 && !irq_can_set_affinity(platform_get_irq(pdev, 0)))
120 return 0;
114 121
115 for (i = 0; i < pdev->num_resources; ++i) { 122 for (i = 0; i < irqs; ++i) {
116 err = set_irq_affinity(platform_get_irq(pdev, i), i); 123 err = set_irq_affinity(platform_get_irq(pdev, i), i);
117 if (err) 124 if (err)
118 break; 125 break;
119 } 126 }
120 127
121out:
122 return err; 128 return err;
123} 129}
124 130
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index 19c6816db61e..2bf27f364d09 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -26,8 +26,6 @@
26#include <asm/system.h> 26#include <asm/system.h>
27#include <asm/traps.h> 27#include <asm/traps.h>
28 28
29#include "ptrace.h"
30
31#define REG_PC 15 29#define REG_PC 15
32#define REG_PSR 16 30#define REG_PSR 16
33/* 31/*
@@ -184,389 +182,12 @@ put_user_reg(struct task_struct *task, int offset, long data)
184 return ret; 182 return ret;
185} 183}
186 184
187static inline int
188read_u32(struct task_struct *task, unsigned long addr, u32 *res)
189{
190 int ret;
191
192 ret = access_process_vm(task, addr, res, sizeof(*res), 0);
193
194 return ret == sizeof(*res) ? 0 : -EIO;
195}
196
197static inline int
198read_instr(struct task_struct *task, unsigned long addr, u32 *res)
199{
200 int ret;
201
202 if (addr & 1) {
203 u16 val;
204 ret = access_process_vm(task, addr & ~1, &val, sizeof(val), 0);
205 ret = ret == sizeof(val) ? 0 : -EIO;
206 *res = val;
207 } else {
208 u32 val;
209 ret = access_process_vm(task, addr & ~3, &val, sizeof(val), 0);
210 ret = ret == sizeof(val) ? 0 : -EIO;
211 *res = val;
212 }
213 return ret;
214}
215
216/*
217 * Get value of register `rn' (in the instruction)
218 */
219static unsigned long
220ptrace_getrn(struct task_struct *child, unsigned long insn)
221{
222 unsigned int reg = (insn >> 16) & 15;
223 unsigned long val;
224
225 val = get_user_reg(child, reg);
226 if (reg == 15)
227 val += 8;
228
229 return val;
230}
231
232/*
233 * Get value of operand 2 (in an ALU instruction)
234 */
235static unsigned long
236ptrace_getaluop2(struct task_struct *child, unsigned long insn)
237{
238 unsigned long val;
239 int shift;
240 int type;
241
242 if (insn & 1 << 25) {
243 val = insn & 255;
244 shift = (insn >> 8) & 15;
245 type = 3;
246 } else {
247 val = get_user_reg (child, insn & 15);
248
249 if (insn & (1 << 4))
250 shift = (int)get_user_reg (child, (insn >> 8) & 15);
251 else
252 shift = (insn >> 7) & 31;
253
254 type = (insn >> 5) & 3;
255 }
256
257 switch (type) {
258 case 0: val <<= shift; break;
259 case 1: val >>= shift; break;
260 case 2:
261 val = (((signed long)val) >> shift);
262 break;
263 case 3:
264 val = (val >> shift) | (val << (32 - shift));
265 break;
266 }
267 return val;
268}
269
270/*
271 * Get value of operand 2 (in a LDR instruction)
272 */
273static unsigned long
274ptrace_getldrop2(struct task_struct *child, unsigned long insn)
275{
276 unsigned long val;
277 int shift;
278 int type;
279
280 val = get_user_reg(child, insn & 15);
281 shift = (insn >> 7) & 31;
282 type = (insn >> 5) & 3;
283
284 switch (type) {
285 case 0: val <<= shift; break;
286 case 1: val >>= shift; break;
287 case 2:
288 val = (((signed long)val) >> shift);
289 break;
290 case 3:
291 val = (val >> shift) | (val << (32 - shift));
292 break;
293 }
294 return val;
295}
296
297#define OP_MASK 0x01e00000
298#define OP_AND 0x00000000
299#define OP_EOR 0x00200000
300#define OP_SUB 0x00400000
301#define OP_RSB 0x00600000
302#define OP_ADD 0x00800000
303#define OP_ADC 0x00a00000
304#define OP_SBC 0x00c00000
305#define OP_RSC 0x00e00000
306#define OP_ORR 0x01800000
307#define OP_MOV 0x01a00000
308#define OP_BIC 0x01c00000
309#define OP_MVN 0x01e00000
310
311static unsigned long
312get_branch_address(struct task_struct *child, unsigned long pc, unsigned long insn)
313{
314 u32 alt = 0;
315
316 switch (insn & 0x0e000000) {
317 case 0x00000000:
318 case 0x02000000: {
319 /*
320 * data processing
321 */
322 long aluop1, aluop2, ccbit;
323
324 if ((insn & 0x0fffffd0) == 0x012fff10) {
325 /*
326 * bx or blx
327 */
328 alt = get_user_reg(child, insn & 15);
329 break;
330 }
331
332
333 if ((insn & 0xf000) != 0xf000)
334 break;
335
336 aluop1 = ptrace_getrn(child, insn);
337 aluop2 = ptrace_getaluop2(child, insn);
338 ccbit = get_user_reg(child, REG_PSR) & PSR_C_BIT ? 1 : 0;
339
340 switch (insn & OP_MASK) {
341 case OP_AND: alt = aluop1 & aluop2; break;
342 case OP_EOR: alt = aluop1 ^ aluop2; break;
343 case OP_SUB: alt = aluop1 - aluop2; break;
344 case OP_RSB: alt = aluop2 - aluop1; break;
345 case OP_ADD: alt = aluop1 + aluop2; break;
346 case OP_ADC: alt = aluop1 + aluop2 + ccbit; break;
347 case OP_SBC: alt = aluop1 - aluop2 + ccbit; break;
348 case OP_RSC: alt = aluop2 - aluop1 + ccbit; break;
349 case OP_ORR: alt = aluop1 | aluop2; break;
350 case OP_MOV: alt = aluop2; break;
351 case OP_BIC: alt = aluop1 & ~aluop2; break;
352 case OP_MVN: alt = ~aluop2; break;
353 }
354 break;
355 }
356
357 case 0x04000000:
358 case 0x06000000:
359 /*
360 * ldr
361 */
362 if ((insn & 0x0010f000) == 0x0010f000) {
363 unsigned long base;
364
365 base = ptrace_getrn(child, insn);
366 if (insn & 1 << 24) {
367 long aluop2;
368
369 if (insn & 0x02000000)
370 aluop2 = ptrace_getldrop2(child, insn);
371 else
372 aluop2 = insn & 0xfff;
373
374 if (insn & 1 << 23)
375 base += aluop2;
376 else
377 base -= aluop2;
378 }
379 read_u32(child, base, &alt);
380 }
381 break;
382
383 case 0x08000000:
384 /*
385 * ldm
386 */
387 if ((insn & 0x00108000) == 0x00108000) {
388 unsigned long base;
389 unsigned int nr_regs;
390
391 if (insn & (1 << 23)) {
392 nr_regs = hweight16(insn & 65535) << 2;
393
394 if (!(insn & (1 << 24)))
395 nr_regs -= 4;
396 } else {
397 if (insn & (1 << 24))
398 nr_regs = -4;
399 else
400 nr_regs = 0;
401 }
402
403 base = ptrace_getrn(child, insn);
404
405 read_u32(child, base + nr_regs, &alt);
406 break;
407 }
408 break;
409
410 case 0x0a000000: {
411 /*
412 * bl or b
413 */
414 signed long displ;
415 /* It's a branch/branch link: instead of trying to
416 * figure out whether the branch will be taken or not,
417 * we'll put a breakpoint at both locations. This is
418 * simpler, more reliable, and probably not a whole lot
419 * slower than the alternative approach of emulating the
420 * branch.
421 */
422 displ = (insn & 0x00ffffff) << 8;
423 displ = (displ >> 6) + 8;
424 if (displ != 0 && displ != 4)
425 alt = pc + displ;
426 }
427 break;
428 }
429
430 return alt;
431}
432
433static int
434swap_insn(struct task_struct *task, unsigned long addr,
435 void *old_insn, void *new_insn, int size)
436{
437 int ret;
438
439 ret = access_process_vm(task, addr, old_insn, size, 0);
440 if (ret == size)
441 ret = access_process_vm(task, addr, new_insn, size, 1);
442 return ret;
443}
444
445static void
446add_breakpoint(struct task_struct *task, struct debug_info *dbg, unsigned long addr)
447{
448 int nr = dbg->nsaved;
449
450 if (nr < 2) {
451 u32 new_insn = BREAKINST_ARM;
452 int res;
453
454 res = swap_insn(task, addr, &dbg->bp[nr].insn, &new_insn, 4);
455
456 if (res == 4) {
457 dbg->bp[nr].address = addr;
458 dbg->nsaved += 1;
459 }
460 } else
461 printk(KERN_ERR "ptrace: too many breakpoints\n");
462}
463
464/*
465 * Clear one breakpoint in the user program. We copy what the hardware
466 * does and use bit 0 of the address to indicate whether this is a Thumb
467 * breakpoint or an ARM breakpoint.
468 */
469static void clear_breakpoint(struct task_struct *task, struct debug_entry *bp)
470{
471 unsigned long addr = bp->address;
472 union debug_insn old_insn;
473 int ret;
474
475 if (addr & 1) {
476 ret = swap_insn(task, addr & ~1, &old_insn.thumb,
477 &bp->insn.thumb, 2);
478
479 if (ret != 2 || old_insn.thumb != BREAKINST_THUMB)
480 printk(KERN_ERR "%s:%d: corrupted Thumb breakpoint at "
481 "0x%08lx (0x%04x)\n", task->comm,
482 task_pid_nr(task), addr, old_insn.thumb);
483 } else {
484 ret = swap_insn(task, addr & ~3, &old_insn.arm,
485 &bp->insn.arm, 4);
486
487 if (ret != 4 || old_insn.arm != BREAKINST_ARM)
488 printk(KERN_ERR "%s:%d: corrupted ARM breakpoint at "
489 "0x%08lx (0x%08x)\n", task->comm,
490 task_pid_nr(task), addr, old_insn.arm);
491 }
492}
493
494void ptrace_set_bpt(struct task_struct *child)
495{
496 struct pt_regs *regs;
497 unsigned long pc;
498 u32 insn;
499 int res;
500
501 regs = task_pt_regs(child);
502 pc = instruction_pointer(regs);
503
504 if (thumb_mode(regs)) {
505 printk(KERN_WARNING "ptrace: can't handle thumb mode\n");
506 return;
507 }
508
509 res = read_instr(child, pc, &insn);
510 if (!res) {
511 struct debug_info *dbg = &child->thread.debug;
512 unsigned long alt;
513
514 dbg->nsaved = 0;
515
516 alt = get_branch_address(child, pc, insn);
517 if (alt)
518 add_breakpoint(child, dbg, alt);
519
520 /*
521 * Note that we ignore the result of setting the above
522 * breakpoint since it may fail. When it does, this is
523 * not so much an error, but a forewarning that we may
524 * be receiving a prefetch abort shortly.
525 *
526 * If we don't set this breakpoint here, then we can
527 * lose control of the thread during single stepping.
528 */
529 if (!alt || predicate(insn) != PREDICATE_ALWAYS)
530 add_breakpoint(child, dbg, pc + 4);
531 }
532}
533
534/*
535 * Ensure no single-step breakpoint is pending. Returns non-zero
536 * value if child was being single-stepped.
537 */
538void ptrace_cancel_bpt(struct task_struct *child)
539{
540 int i, nsaved = child->thread.debug.nsaved;
541
542 child->thread.debug.nsaved = 0;
543
544 if (nsaved > 2) {
545 printk("ptrace_cancel_bpt: bogus nsaved: %d!\n", nsaved);
546 nsaved = 2;
547 }
548
549 for (i = 0; i < nsaved; i++)
550 clear_breakpoint(child, &child->thread.debug.bp[i]);
551}
552
553void user_disable_single_step(struct task_struct *task)
554{
555 task->ptrace &= ~PT_SINGLESTEP;
556 ptrace_cancel_bpt(task);
557}
558
559void user_enable_single_step(struct task_struct *task)
560{
561 task->ptrace |= PT_SINGLESTEP;
562}
563
564/* 185/*
565 * Called by kernel/ptrace.c when detaching.. 186 * Called by kernel/ptrace.c when detaching..
566 */ 187 */
567void ptrace_disable(struct task_struct *child) 188void ptrace_disable(struct task_struct *child)
568{ 189{
569 user_disable_single_step(child); 190 /* Nothing to do. */
570} 191}
571 192
572/* 193/*
@@ -576,8 +197,6 @@ void ptrace_break(struct task_struct *tsk, struct pt_regs *regs)
576{ 197{
577 siginfo_t info; 198 siginfo_t info;
578 199
579 ptrace_cancel_bpt(tsk);
580
581 info.si_signo = SIGTRAP; 200 info.si_signo = SIGTRAP;
582 info.si_errno = 0; 201 info.si_errno = 0;
583 info.si_code = TRAP_BRKPT; 202 info.si_code = TRAP_BRKPT;
@@ -996,10 +615,10 @@ static int ptrace_gethbpregs(struct task_struct *tsk, long num,
996 while (!(arch_ctrl.len & 0x1)) 615 while (!(arch_ctrl.len & 0x1))
997 arch_ctrl.len >>= 1; 616 arch_ctrl.len >>= 1;
998 617
999 if (idx & 0x1) 618 if (num & 0x1)
1000 reg = encode_ctrl_reg(arch_ctrl);
1001 else
1002 reg = bp->attr.bp_addr; 619 reg = bp->attr.bp_addr;
620 else
621 reg = encode_ctrl_reg(arch_ctrl);
1003 } 622 }
1004 623
1005put: 624put:
diff --git a/arch/arm/kernel/ptrace.h b/arch/arm/kernel/ptrace.h
deleted file mode 100644
index 3926605b82ea..000000000000
--- a/arch/arm/kernel/ptrace.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * linux/arch/arm/kernel/ptrace.h
3 *
4 * Copyright (C) 2000-2003 Russell King
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/ptrace.h>
11
12extern void ptrace_cancel_bpt(struct task_struct *);
13extern void ptrace_set_bpt(struct task_struct *);
14extern void ptrace_break(struct task_struct *, struct pt_regs *);
15
16/*
17 * Send SIGTRAP if we're single-stepping
18 */
19static inline void single_step_trap(struct task_struct *task)
20{
21 if (task->ptrace & PT_SINGLESTEP) {
22 ptrace_cancel_bpt(task);
23 send_sig(SIGTRAP, task, 1);
24 }
25}
26
27static inline void single_step_clear(struct task_struct *task)
28{
29 if (task->ptrace & PT_SINGLESTEP)
30 ptrace_cancel_bpt(task);
31}
32
33static inline void single_step_set(struct task_struct *task)
34{
35 if (task->ptrace & PT_SINGLESTEP)
36 ptrace_set_bpt(task);
37}
diff --git a/arch/arm/kernel/return_address.c b/arch/arm/kernel/return_address.c
index df246da4ceca..0b13a72f855d 100644
--- a/arch/arm/kernel/return_address.c
+++ b/arch/arm/kernel/return_address.c
@@ -9,6 +9,7 @@
9 * the Free Software Foundation. 9 * the Free Software Foundation.
10 */ 10 */
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/ftrace.h>
12 13
13#if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) 14#if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND)
14#include <linux/sched.h> 15#include <linux/sched.h>
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 420b8d6485d6..006c1e884eaf 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -226,8 +226,8 @@ int cpu_architecture(void)
226 * Register 0 and check for VMSAv7 or PMSAv7 */ 226 * Register 0 and check for VMSAv7 or PMSAv7 */
227 asm("mrc p15, 0, %0, c0, c1, 4" 227 asm("mrc p15, 0, %0, c0, c1, 4"
228 : "=r" (mmfr0)); 228 : "=r" (mmfr0));
229 if ((mmfr0 & 0x0000000f) == 0x00000003 || 229 if ((mmfr0 & 0x0000000f) >= 0x00000003 ||
230 (mmfr0 & 0x000000f0) == 0x00000030) 230 (mmfr0 & 0x000000f0) >= 0x00000030)
231 cpu_arch = CPU_ARCH_ARMv7; 231 cpu_arch = CPU_ARCH_ARMv7;
232 else if ((mmfr0 & 0x0000000f) == 0x00000002 || 232 else if ((mmfr0 & 0x0000000f) == 0x00000002 ||
233 (mmfr0 & 0x000000f0) == 0x00000020) 233 (mmfr0 & 0x000000f0) == 0x00000020)
@@ -308,7 +308,22 @@ static void __init cacheid_init(void)
308 * already provide the required functionality. 308 * already provide the required functionality.
309 */ 309 */
310extern struct proc_info_list *lookup_processor_type(unsigned int); 310extern struct proc_info_list *lookup_processor_type(unsigned int);
311extern struct machine_desc *lookup_machine_type(unsigned int); 311
312static void __init early_print(const char *str, ...)
313{
314 extern void printascii(const char *);
315 char buf[256];
316 va_list ap;
317
318 va_start(ap, str);
319 vsnprintf(buf, sizeof(buf), str, ap);
320 va_end(ap);
321
322#ifdef CONFIG_DEBUG_LL
323 printascii(buf);
324#endif
325 printk("%s", buf);
326}
312 327
313static void __init feat_v6_fixup(void) 328static void __init feat_v6_fixup(void)
314{ 329{
@@ -426,30 +441,38 @@ void cpu_init(void)
426 441
427static struct machine_desc * __init setup_machine(unsigned int nr) 442static struct machine_desc * __init setup_machine(unsigned int nr)
428{ 443{
429 struct machine_desc *list; 444 extern struct machine_desc __arch_info_begin[], __arch_info_end[];
445 struct machine_desc *p;
430 446
431 /* 447 /*
432 * locate machine in the list of supported machines. 448 * locate machine in the list of supported machines.
433 */ 449 */
434 list = lookup_machine_type(nr); 450 for (p = __arch_info_begin; p < __arch_info_end; p++)
435 if (!list) { 451 if (nr == p->nr) {
436 printk("Machine configuration botched (nr %d), unable " 452 printk("Machine: %s\n", p->name);
437 "to continue.\n", nr); 453 return p;
438 while (1); 454 }
439 } 455
456 early_print("\n"
457 "Error: unrecognized/unsupported machine ID (r1 = 0x%08x).\n\n"
458 "Available machine support:\n\nID (hex)\tNAME\n", nr);
459
460 for (p = __arch_info_begin; p < __arch_info_end; p++)
461 early_print("%08x\t%s\n", p->nr, p->name);
440 462
441 printk("Machine: %s\n", list->name); 463 early_print("\nPlease check your kernel config and/or bootloader.\n");
442 464
443 return list; 465 while (true)
466 /* can't use cpu_relax() here as it may require MMU setup */;
444} 467}
445 468
446static int __init arm_add_memory(unsigned long start, unsigned long size) 469static int __init arm_add_memory(phys_addr_t start, unsigned long size)
447{ 470{
448 struct membank *bank = &meminfo.bank[meminfo.nr_banks]; 471 struct membank *bank = &meminfo.bank[meminfo.nr_banks];
449 472
450 if (meminfo.nr_banks >= NR_BANKS) { 473 if (meminfo.nr_banks >= NR_BANKS) {
451 printk(KERN_CRIT "NR_BANKS too low, " 474 printk(KERN_CRIT "NR_BANKS too low, "
452 "ignoring memory at %#lx\n", start); 475 "ignoring memory at 0x%08llx\n", (long long)start);
453 return -EINVAL; 476 return -EINVAL;
454 } 477 }
455 478
@@ -479,7 +502,8 @@ static int __init arm_add_memory(unsigned long start, unsigned long size)
479static int __init early_mem(char *p) 502static int __init early_mem(char *p)
480{ 503{
481 static int usermem __initdata = 0; 504 static int usermem __initdata = 0;
482 unsigned long size, start; 505 unsigned long size;
506 phys_addr_t start;
483 char *endp; 507 char *endp;
484 508
485 /* 509 /*
@@ -703,7 +727,7 @@ static struct init_tags {
703 { tag_size(tag_core), ATAG_CORE }, 727 { tag_size(tag_core), ATAG_CORE },
704 { 1, PAGE_SIZE, 0xff }, 728 { 1, PAGE_SIZE, 0xff },
705 { tag_size(tag_mem32), ATAG_MEM }, 729 { tag_size(tag_mem32), ATAG_MEM },
706 { MEM_SIZE, PHYS_OFFSET }, 730 { MEM_SIZE },
707 { 0, ATAG_NONE } 731 { 0, ATAG_NONE }
708}; 732};
709 733
@@ -765,30 +789,6 @@ static void __init reserve_crashkernel(void)
765static inline void reserve_crashkernel(void) {} 789static inline void reserve_crashkernel(void) {}
766#endif /* CONFIG_KEXEC */ 790#endif /* CONFIG_KEXEC */
767 791
768/*
769 * Note: elfcorehdr_addr is not just limited to vmcore. It is also used by
770 * is_kdump_kernel() to determine if we are booting after a panic. Hence
771 * ifdef it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE.
772 */
773
774#ifdef CONFIG_CRASH_DUMP
775/*
776 * elfcorehdr= specifies the location of elf core header stored by the crashed
777 * kernel. This option will be passed by kexec loader to the capture kernel.
778 */
779static int __init setup_elfcorehdr(char *arg)
780{
781 char *end;
782
783 if (!arg)
784 return -EINVAL;
785
786 elfcorehdr_addr = memparse(arg, &end);
787 return end > arg ? 0 : -EINVAL;
788}
789early_param("elfcorehdr", setup_elfcorehdr);
790#endif /* CONFIG_CRASH_DUMP */
791
792static void __init squash_mem_tags(struct tag *tag) 792static void __init squash_mem_tags(struct tag *tag)
793{ 793{
794 for (; tag->hdr.size; tag = tag_next(tag)) 794 for (; tag->hdr.size; tag = tag_next(tag))
@@ -802,6 +802,8 @@ void __init setup_arch(char **cmdline_p)
802 struct machine_desc *mdesc; 802 struct machine_desc *mdesc;
803 char *from = default_command_line; 803 char *from = default_command_line;
804 804
805 init_tags.mem.start = PHYS_OFFSET;
806
805 unwind_init(); 807 unwind_init();
806 808
807 setup_processor(); 809 setup_processor();
@@ -814,8 +816,25 @@ void __init setup_arch(char **cmdline_p)
814 816
815 if (__atags_pointer) 817 if (__atags_pointer)
816 tags = phys_to_virt(__atags_pointer); 818 tags = phys_to_virt(__atags_pointer);
817 else if (mdesc->boot_params) 819 else if (mdesc->boot_params) {
818 tags = phys_to_virt(mdesc->boot_params); 820#ifdef CONFIG_MMU
821 /*
822 * We still are executing with a minimal MMU mapping created
823 * with the presumption that the machine default for this
824 * is located in the first MB of RAM. Anything else will
825 * fault and silently hang the kernel at this point.
826 */
827 if (mdesc->boot_params < PHYS_OFFSET ||
828 mdesc->boot_params >= PHYS_OFFSET + SZ_1M) {
829 printk(KERN_WARNING
830 "Default boot params at physical 0x%08lx out of reach\n",
831 mdesc->boot_params);
832 } else
833#endif
834 {
835 tags = phys_to_virt(mdesc->boot_params);
836 }
837 }
819 838
820#if defined(CONFIG_DEPRECATED_PARAM_STRUCT) 839#if defined(CONFIG_DEPRECATED_PARAM_STRUCT)
821 /* 840 /*
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 907d5a620bca..cb8398317644 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -20,7 +20,6 @@
20#include <asm/unistd.h> 20#include <asm/unistd.h>
21#include <asm/vfp.h> 21#include <asm/vfp.h>
22 22
23#include "ptrace.h"
24#include "signal.h" 23#include "signal.h"
25 24
26#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 25#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
@@ -348,8 +347,6 @@ asmlinkage int sys_sigreturn(struct pt_regs *regs)
348 if (restore_sigframe(regs, frame)) 347 if (restore_sigframe(regs, frame))
349 goto badframe; 348 goto badframe;
350 349
351 single_step_trap(current);
352
353 return regs->ARM_r0; 350 return regs->ARM_r0;
354 351
355badframe: 352badframe:
@@ -383,8 +380,6 @@ asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
383 if (do_sigaltstack(&frame->sig.uc.uc_stack, NULL, regs->ARM_sp) == -EFAULT) 380 if (do_sigaltstack(&frame->sig.uc.uc_stack, NULL, regs->ARM_sp) == -EFAULT)
384 goto badframe; 381 goto badframe;
385 382
386 single_step_trap(current);
387
388 return regs->ARM_r0; 383 return regs->ARM_r0;
389 384
390badframe: 385badframe:
@@ -474,7 +469,9 @@ setup_return(struct pt_regs *regs, struct k_sigaction *ka,
474 unsigned long handler = (unsigned long)ka->sa.sa_handler; 469 unsigned long handler = (unsigned long)ka->sa.sa_handler;
475 unsigned long retcode; 470 unsigned long retcode;
476 int thumb = 0; 471 int thumb = 0;
477 unsigned long cpsr = regs->ARM_cpsr & ~PSR_f; 472 unsigned long cpsr = regs->ARM_cpsr & ~(PSR_f | PSR_E_BIT);
473
474 cpsr |= PSR_ENDSTATE;
478 475
479 /* 476 /*
480 * Maybe we need to deliver a 32-bit signal to a 26-bit task. 477 * Maybe we need to deliver a 32-bit signal to a 26-bit task.
@@ -704,8 +701,6 @@ static void do_signal(struct pt_regs *regs, int syscall)
704 if (try_to_freeze()) 701 if (try_to_freeze())
705 goto no_signal; 702 goto no_signal;
706 703
707 single_step_clear(current);
708
709 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 704 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
710 if (signr > 0) { 705 if (signr > 0) {
711 sigset_t *oldset; 706 sigset_t *oldset;
@@ -724,7 +719,6 @@ static void do_signal(struct pt_regs *regs, int syscall)
724 if (test_thread_flag(TIF_RESTORE_SIGMASK)) 719 if (test_thread_flag(TIF_RESTORE_SIGMASK))
725 clear_thread_flag(TIF_RESTORE_SIGMASK); 720 clear_thread_flag(TIF_RESTORE_SIGMASK);
726 } 721 }
727 single_step_set(current);
728 return; 722 return;
729 } 723 }
730 724
@@ -770,7 +764,6 @@ static void do_signal(struct pt_regs *regs, int syscall)
770 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL); 764 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
771 } 765 }
772 } 766 }
773 single_step_set(current);
774} 767}
775 768
776asmlinkage void 769asmlinkage void
diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S
new file mode 100644
index 000000000000..bfad698a02e7
--- /dev/null
+++ b/arch/arm/kernel/sleep.S
@@ -0,0 +1,134 @@
1#include <linux/linkage.h>
2#include <linux/threads.h>
3#include <asm/asm-offsets.h>
4#include <asm/assembler.h>
5#include <asm/glue-cache.h>
6#include <asm/glue-proc.h>
7#include <asm/system.h>
8 .text
9
10/*
11 * Save CPU state for a suspend
12 * r1 = v:p offset
13 * r3 = virtual return function
14 * Note: sp is decremented to allocate space for CPU state on stack
15 * r0-r3,r9,r10,lr corrupted
16 */
17ENTRY(cpu_suspend)
18 mov r9, lr
19#ifdef MULTI_CPU
20 ldr r10, =processor
21 mov r2, sp @ current virtual SP
22 ldr r0, [r10, #CPU_SLEEP_SIZE] @ size of CPU sleep state
23 ldr ip, [r10, #CPU_DO_RESUME] @ virtual resume function
24 sub sp, sp, r0 @ allocate CPU state on stack
25 mov r0, sp @ save pointer
26 add ip, ip, r1 @ convert resume fn to phys
27 stmfd sp!, {r1, r2, r3, ip} @ save v:p, virt SP, retfn, phys resume fn
28 ldr r3, =sleep_save_sp
29 add r2, sp, r1 @ convert SP to phys
30#ifdef CONFIG_SMP
31 ALT_SMP(mrc p15, 0, lr, c0, c0, 5)
32 ALT_UP(mov lr, #0)
33 and lr, lr, #15
34 str r2, [r3, lr, lsl #2] @ save phys SP
35#else
36 str r2, [r3] @ save phys SP
37#endif
38 mov lr, pc
39 ldr pc, [r10, #CPU_DO_SUSPEND] @ save CPU state
40#else
41 mov r2, sp @ current virtual SP
42 ldr r0, =cpu_suspend_size
43 sub sp, sp, r0 @ allocate CPU state on stack
44 mov r0, sp @ save pointer
45 stmfd sp!, {r1, r2, r3} @ save v:p, virt SP, return fn
46 ldr r3, =sleep_save_sp
47 add r2, sp, r1 @ convert SP to phys
48#ifdef CONFIG_SMP
49 ALT_SMP(mrc p15, 0, lr, c0, c0, 5)
50 ALT_UP(mov lr, #0)
51 and lr, lr, #15
52 str r2, [r3, lr, lsl #2] @ save phys SP
53#else
54 str r2, [r3] @ save phys SP
55#endif
56 bl cpu_do_suspend
57#endif
58
59 @ flush data cache
60#ifdef MULTI_CACHE
61 ldr r10, =cpu_cache
62 mov lr, r9
63 ldr pc, [r10, #CACHE_FLUSH_KERN_ALL]
64#else
65 mov lr, r9
66 b __cpuc_flush_kern_all
67#endif
68ENDPROC(cpu_suspend)
69 .ltorg
70
71/*
72 * r0 = control register value
73 * r1 = v:p offset (preserved by cpu_do_resume)
74 * r2 = phys page table base
75 * r3 = L1 section flags
76 */
77ENTRY(cpu_resume_mmu)
78 adr r4, cpu_resume_turn_mmu_on
79 mov r4, r4, lsr #20
80 orr r3, r3, r4, lsl #20
81 ldr r5, [r2, r4, lsl #2] @ save old mapping
82 str r3, [r2, r4, lsl #2] @ setup 1:1 mapping for mmu code
83 sub r2, r2, r1
84 ldr r3, =cpu_resume_after_mmu
85 bic r1, r0, #CR_C @ ensure D-cache is disabled
86 b cpu_resume_turn_mmu_on
87ENDPROC(cpu_resume_mmu)
88 .ltorg
89 .align 5
90cpu_resume_turn_mmu_on:
91 mcr p15, 0, r1, c1, c0, 0 @ turn on MMU, I-cache, etc
92 mrc p15, 0, r1, c0, c0, 0 @ read id reg
93 mov r1, r1
94 mov r1, r1
95 mov pc, r3 @ jump to virtual address
96ENDPROC(cpu_resume_turn_mmu_on)
97cpu_resume_after_mmu:
98 str r5, [r2, r4, lsl #2] @ restore old mapping
99 mcr p15, 0, r0, c1, c0, 0 @ turn on D-cache
100 mov pc, lr
101ENDPROC(cpu_resume_after_mmu)
102
103/*
104 * Note: Yes, part of the following code is located into the .data section.
105 * This is to allow sleep_save_sp to be accessed with a relative load
106 * while we can't rely on any MMU translation. We could have put
107 * sleep_save_sp in the .text section as well, but some setups might
108 * insist on it to be truly read-only.
109 */
110 .data
111 .align
112ENTRY(cpu_resume)
113#ifdef CONFIG_SMP
114 adr r0, sleep_save_sp
115 ALT_SMP(mrc p15, 0, r1, c0, c0, 5)
116 ALT_UP(mov r1, #0)
117 and r1, r1, #15
118 ldr r0, [r0, r1, lsl #2] @ stack phys addr
119#else
120 ldr r0, sleep_save_sp @ stack phys addr
121#endif
122 msr cpsr_c, #PSR_I_BIT | PSR_F_BIT | SVC_MODE @ set SVC, irqs off
123#ifdef MULTI_CPU
124 ldmia r0!, {r1, sp, lr, pc} @ load v:p, stack, return fn, resume fn
125#else
126 ldmia r0!, {r1, sp, lr} @ load v:p, stack, return fn
127 b cpu_do_resume
128#endif
129ENDPROC(cpu_resume)
130
131sleep_save_sp:
132 .rept CONFIG_NR_CPUS
133 .long 0 @ preserve stack phys ptr here
134 .endr
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 4539ebcb089f..8fe05ad932e4 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -474,13 +474,12 @@ static void smp_timer_broadcast(const struct cpumask *mask)
474#define smp_timer_broadcast NULL 474#define smp_timer_broadcast NULL
475#endif 475#endif
476 476
477#ifndef CONFIG_LOCAL_TIMERS
478static void broadcast_timer_set_mode(enum clock_event_mode mode, 477static void broadcast_timer_set_mode(enum clock_event_mode mode,
479 struct clock_event_device *evt) 478 struct clock_event_device *evt)
480{ 479{
481} 480}
482 481
483static void local_timer_setup(struct clock_event_device *evt) 482static void broadcast_timer_setup(struct clock_event_device *evt)
484{ 483{
485 evt->name = "dummy_timer"; 484 evt->name = "dummy_timer";
486 evt->features = CLOCK_EVT_FEAT_ONESHOT | 485 evt->features = CLOCK_EVT_FEAT_ONESHOT |
@@ -492,7 +491,6 @@ static void local_timer_setup(struct clock_event_device *evt)
492 491
493 clockevents_register_device(evt); 492 clockevents_register_device(evt);
494} 493}
495#endif
496 494
497void __cpuinit percpu_timer_setup(void) 495void __cpuinit percpu_timer_setup(void)
498{ 496{
@@ -502,7 +500,8 @@ void __cpuinit percpu_timer_setup(void)
502 evt->cpumask = cpumask_of(cpu); 500 evt->cpumask = cpumask_of(cpu);
503 evt->broadcast = smp_timer_broadcast; 501 evt->broadcast = smp_timer_broadcast;
504 502
505 local_timer_setup(evt); 503 if (local_timer_setup(evt))
504 broadcast_timer_setup(evt);
506} 505}
507 506
508#ifdef CONFIG_HOTPLUG_CPU 507#ifdef CONFIG_HOTPLUG_CPU
diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c
index 9ab4149bd983..a1e757c3439b 100644
--- a/arch/arm/kernel/smp_scu.c
+++ b/arch/arm/kernel/smp_scu.c
@@ -50,3 +50,26 @@ void __init scu_enable(void __iomem *scu_base)
50 */ 50 */
51 flush_cache_all(); 51 flush_cache_all();
52} 52}
53
54/*
55 * Set the executing CPUs power mode as defined. This will be in
56 * preparation for it executing a WFI instruction.
57 *
58 * This function must be called with preemption disabled, and as it
59 * has the side effect of disabling coherency, caches must have been
60 * flushed. Interrupts must also have been disabled.
61 */
62int scu_power_mode(void __iomem *scu_base, unsigned int mode)
63{
64 unsigned int val;
65 int cpu = smp_processor_id();
66
67 if (mode > 3 || mode == 1 || cpu > 3)
68 return -EINVAL;
69
70 val = __raw_readb(scu_base + SCU_CPU_STATUS + cpu) & ~0x03;
71 val |= mode;
72 __raw_writeb(val, scu_base + SCU_CPU_STATUS + cpu);
73
74 return 0;
75}
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index fd9156698ab9..60636f499cb3 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -36,6 +36,7 @@ static void twd_set_mode(enum clock_event_mode mode,
36 /* timer load already set up */ 36 /* timer load already set up */
37 ctrl = TWD_TIMER_CONTROL_ENABLE | TWD_TIMER_CONTROL_IT_ENABLE 37 ctrl = TWD_TIMER_CONTROL_ENABLE | TWD_TIMER_CONTROL_IT_ENABLE
38 | TWD_TIMER_CONTROL_PERIODIC; 38 | TWD_TIMER_CONTROL_PERIODIC;
39 __raw_writel(twd_timer_rate / HZ, twd_base + TWD_TIMER_LOAD);
39 break; 40 break;
40 case CLOCK_EVT_MODE_ONESHOT: 41 case CLOCK_EVT_MODE_ONESHOT:
41 /* period set, and timer enabled in 'next_event' hook */ 42 /* period set, and timer enabled in 'next_event' hook */
@@ -81,7 +82,7 @@ int twd_timer_ack(void)
81 82
82static void __cpuinit twd_calibrate_rate(void) 83static void __cpuinit twd_calibrate_rate(void)
83{ 84{
84 unsigned long load, count; 85 unsigned long count;
85 u64 waitjiffies; 86 u64 waitjiffies;
86 87
87 /* 88 /*
@@ -116,10 +117,6 @@ static void __cpuinit twd_calibrate_rate(void)
116 printk("%lu.%02luMHz.\n", twd_timer_rate / 1000000, 117 printk("%lu.%02luMHz.\n", twd_timer_rate / 1000000,
117 (twd_timer_rate / 1000000) % 100); 118 (twd_timer_rate / 1000000) % 100);
118 } 119 }
119
120 load = twd_timer_rate / HZ;
121
122 __raw_writel(load, twd_base + TWD_TIMER_LOAD);
123} 120}
124 121
125/* 122/*
diff --git a/arch/arm/kernel/tcm.c b/arch/arm/kernel/tcm.c
index 26685c2f7a49..f5cf660eefcc 100644
--- a/arch/arm/kernel/tcm.c
+++ b/arch/arm/kernel/tcm.c
@@ -15,7 +15,7 @@
15#include <linux/string.h> /* memcpy */ 15#include <linux/string.h> /* memcpy */
16#include <asm/cputype.h> 16#include <asm/cputype.h>
17#include <asm/mach/map.h> 17#include <asm/mach/map.h>
18#include <mach/memory.h> 18#include <asm/memory.h>
19#include "tcm.h" 19#include "tcm.h"
20 20
21static struct gen_pool *tcm_pool; 21static struct gen_pool *tcm_pool;
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index 3d76bf233734..1ff46cabc7ef 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -107,9 +107,7 @@ void timer_tick(void)
107{ 107{
108 profile_tick(CPU_PROFILING); 108 profile_tick(CPU_PROFILING);
109 do_leds(); 109 do_leds();
110 write_seqlock(&xtime_lock); 110 xtime_update(1);
111 do_timer(1);
112 write_sequnlock(&xtime_lock);
113#ifndef CONFIG_SMP 111#ifndef CONFIG_SMP
114 update_process_times(user_mode(get_irq_regs())); 112 update_process_times(user_mode(get_irq_regs()));
115#endif 113#endif
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index ee57640ba2bb..f0000e188c8c 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -23,6 +23,7 @@
23#include <linux/kexec.h> 23#include <linux/kexec.h>
24#include <linux/delay.h> 24#include <linux/delay.h>
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/sched.h>
26 27
27#include <asm/atomic.h> 28#include <asm/atomic.h>
28#include <asm/cacheflush.h> 29#include <asm/cacheflush.h>
@@ -32,7 +33,6 @@
32#include <asm/unwind.h> 33#include <asm/unwind.h>
33#include <asm/tls.h> 34#include <asm/tls.h>
34 35
35#include "ptrace.h"
36#include "signal.h" 36#include "signal.h"
37 37
38static const char *handler[]= { "prefetch abort", "data abort", "address exception", "interrupt" }; 38static const char *handler[]= { "prefetch abort", "data abort", "address exception", "interrupt" };
@@ -256,7 +256,7 @@ static int __die(const char *str, int err, struct thread_info *thread, struct pt
256 return ret; 256 return ret;
257} 257}
258 258
259DEFINE_SPINLOCK(die_lock); 259static DEFINE_SPINLOCK(die_lock);
260 260
261/* 261/*
262 * This function is protected against re-entrancy. 262 * This function is protected against re-entrancy.
@@ -712,17 +712,17 @@ EXPORT_SYMBOL(__readwrite_bug);
712 712
713void __pte_error(const char *file, int line, pte_t pte) 713void __pte_error(const char *file, int line, pte_t pte)
714{ 714{
715 printk("%s:%d: bad pte %08lx.\n", file, line, pte_val(pte)); 715 printk("%s:%d: bad pte %08llx.\n", file, line, (long long)pte_val(pte));
716} 716}
717 717
718void __pmd_error(const char *file, int line, pmd_t pmd) 718void __pmd_error(const char *file, int line, pmd_t pmd)
719{ 719{
720 printk("%s:%d: bad pmd %08lx.\n", file, line, pmd_val(pmd)); 720 printk("%s:%d: bad pmd %08llx.\n", file, line, (long long)pmd_val(pmd));
721} 721}
722 722
723void __pgd_error(const char *file, int line, pgd_t pgd) 723void __pgd_error(const char *file, int line, pgd_t pgd)
724{ 724{
725 printk("%s:%d: bad pgd %08lx.\n", file, line, pgd_val(pgd)); 725 printk("%s:%d: bad pgd %08llx.\n", file, line, (long long)pgd_val(pgd));
726} 726}
727 727
728asmlinkage void __div0(void) 728asmlinkage void __div0(void)
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index 86b66f3f2031..b4348e62ef06 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -21,6 +21,12 @@
21#define ARM_CPU_KEEP(x) 21#define ARM_CPU_KEEP(x)
22#endif 22#endif
23 23
24#if defined(CONFIG_SMP_ON_UP) && !defined(CONFIG_DEBUG_SPINLOCK)
25#define ARM_EXIT_KEEP(x) x
26#else
27#define ARM_EXIT_KEEP(x)
28#endif
29
24OUTPUT_ARCH(arm) 30OUTPUT_ARCH(arm)
25ENTRY(stext) 31ENTRY(stext)
26 32
@@ -43,6 +49,7 @@ SECTIONS
43 _sinittext = .; 49 _sinittext = .;
44 HEAD_TEXT 50 HEAD_TEXT
45 INIT_TEXT 51 INIT_TEXT
52 ARM_EXIT_KEEP(EXIT_TEXT)
46 _einittext = .; 53 _einittext = .;
47 ARM_CPU_DISCARD(PROC_INFO) 54 ARM_CPU_DISCARD(PROC_INFO)
48 __arch_info_begin = .; 55 __arch_info_begin = .;
@@ -57,6 +64,10 @@ SECTIONS
57 __smpalt_end = .; 64 __smpalt_end = .;
58#endif 65#endif
59 66
67 __pv_table_begin = .;
68 *(.pv_table)
69 __pv_table_end = .;
70
60 INIT_SETUP(16) 71 INIT_SETUP(16)
61 72
62 INIT_CALLS 73 INIT_CALLS
@@ -67,10 +78,11 @@ SECTIONS
67#ifndef CONFIG_XIP_KERNEL 78#ifndef CONFIG_XIP_KERNEL
68 __init_begin = _stext; 79 __init_begin = _stext;
69 INIT_DATA 80 INIT_DATA
81 ARM_EXIT_KEEP(EXIT_DATA)
70#endif 82#endif
71 } 83 }
72 84
73 PERCPU(PAGE_SIZE) 85 PERCPU(32, PAGE_SIZE)
74 86
75#ifndef CONFIG_XIP_KERNEL 87#ifndef CONFIG_XIP_KERNEL
76 . = ALIGN(PAGE_SIZE); 88 . = ALIGN(PAGE_SIZE);
@@ -162,6 +174,7 @@ SECTIONS
162 . = ALIGN(PAGE_SIZE); 174 . = ALIGN(PAGE_SIZE);
163 __init_begin = .; 175 __init_begin = .;
164 INIT_DATA 176 INIT_DATA
177 ARM_EXIT_KEEP(EXIT_DATA)
165 . = ALIGN(PAGE_SIZE); 178 . = ALIGN(PAGE_SIZE);
166 __init_end = .; 179 __init_end = .;
167#endif 180#endif
@@ -247,6 +260,8 @@ SECTIONS
247 } 260 }
248#endif 261#endif
249 262
263 NOTES
264
250 BSS_SECTION(0, 0, 0) 265 BSS_SECTION(0, 0, 0)
251 _end = .; 266 _end = .;
252 267
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h
index d42252918bfb..10d868a5a481 100644
--- a/arch/arm/lib/bitops.h
+++ b/arch/arm/lib/bitops.h
@@ -1,44 +1,52 @@
1 1#if __LINUX_ARM_ARCH__ >= 6
2#if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_CPU_32v6K)
3 .macro bitop, instr 2 .macro bitop, instr
3 ands ip, r1, #3
4 strneb r1, [ip] @ assert word-aligned
4 mov r2, #1 5 mov r2, #1
5 and r3, r0, #7 @ Get bit offset 6 and r3, r0, #31 @ Get bit offset
6 add r1, r1, r0, lsr #3 @ Get byte offset 7 mov r0, r0, lsr #5
8 add r1, r1, r0, lsl #2 @ Get word offset
7 mov r3, r2, lsl r3 9 mov r3, r2, lsl r3
81: ldrexb r2, [r1] 101: ldrex r2, [r1]
9 \instr r2, r2, r3 11 \instr r2, r2, r3
10 strexb r0, r2, [r1] 12 strex r0, r2, [r1]
11 cmp r0, #0 13 cmp r0, #0
12 bne 1b 14 bne 1b
13 mov pc, lr 15 bx lr
14 .endm 16 .endm
15 17
16 .macro testop, instr, store 18 .macro testop, instr, store
17 and r3, r0, #7 @ Get bit offset 19 ands ip, r1, #3
20 strneb r1, [ip] @ assert word-aligned
18 mov r2, #1 21 mov r2, #1
19 add r1, r1, r0, lsr #3 @ Get byte offset 22 and r3, r0, #31 @ Get bit offset
23 mov r0, r0, lsr #5
24 add r1, r1, r0, lsl #2 @ Get word offset
20 mov r3, r2, lsl r3 @ create mask 25 mov r3, r2, lsl r3 @ create mask
21 smp_dmb 26 smp_dmb
221: ldrexb r2, [r1] 271: ldrex r2, [r1]
23 ands r0, r2, r3 @ save old value of bit 28 ands r0, r2, r3 @ save old value of bit
24 \instr r2, r2, r3 @ toggle bit 29 \instr r2, r2, r3 @ toggle bit
25 strexb ip, r2, [r1] 30 strex ip, r2, [r1]
26 cmp ip, #0 31 cmp ip, #0
27 bne 1b 32 bne 1b
28 smp_dmb 33 smp_dmb
29 cmp r0, #0 34 cmp r0, #0
30 movne r0, #1 35 movne r0, #1
312: mov pc, lr 362: bx lr
32 .endm 37 .endm
33#else 38#else
34 .macro bitop, instr 39 .macro bitop, instr
35 and r2, r0, #7 40 ands ip, r1, #3
41 strneb r1, [ip] @ assert word-aligned
42 and r2, r0, #31
43 mov r0, r0, lsr #5
36 mov r3, #1 44 mov r3, #1
37 mov r3, r3, lsl r2 45 mov r3, r3, lsl r2
38 save_and_disable_irqs ip 46 save_and_disable_irqs ip
39 ldrb r2, [r1, r0, lsr #3] 47 ldr r2, [r1, r0, lsl #2]
40 \instr r2, r2, r3 48 \instr r2, r2, r3
41 strb r2, [r1, r0, lsr #3] 49 str r2, [r1, r0, lsl #2]
42 restore_irqs ip 50 restore_irqs ip
43 mov pc, lr 51 mov pc, lr
44 .endm 52 .endm
@@ -52,11 +60,13 @@
52 * to avoid dirtying the data cache. 60 * to avoid dirtying the data cache.
53 */ 61 */
54 .macro testop, instr, store 62 .macro testop, instr, store
55 add r1, r1, r0, lsr #3 63 ands ip, r1, #3
56 and r3, r0, #7 64 strneb r1, [ip] @ assert word-aligned
57 mov r0, #1 65 and r3, r0, #31
66 mov r0, r0, lsr #5
58 save_and_disable_irqs ip 67 save_and_disable_irqs ip
59 ldrb r2, [r1] 68 ldr r2, [r1, r0, lsl #2]!
69 mov r0, #1
60 tst r2, r0, lsl r3 70 tst r2, r0, lsl r3
61 \instr r2, r2, r0, lsl r3 71 \instr r2, r2, r0, lsl r3
62 \store r2, [r1] 72 \store r2, [r1]
diff --git a/arch/arm/lib/changebit.S b/arch/arm/lib/changebit.S
index 80f3115cbee2..68ed5b62e839 100644
--- a/arch/arm/lib/changebit.S
+++ b/arch/arm/lib/changebit.S
@@ -12,12 +12,6 @@
12#include "bitops.h" 12#include "bitops.h"
13 .text 13 .text
14 14
15/* Purpose : Function to change a bit 15ENTRY(_change_bit)
16 * Prototype: int change_bit(int bit, void *addr)
17 */
18ENTRY(_change_bit_be)
19 eor r0, r0, #0x18 @ big endian byte ordering
20ENTRY(_change_bit_le)
21 bitop eor 16 bitop eor
22ENDPROC(_change_bit_be) 17ENDPROC(_change_bit)
23ENDPROC(_change_bit_le)
diff --git a/arch/arm/lib/clearbit.S b/arch/arm/lib/clearbit.S
index 1a63e43a1df0..4c04c3b51eeb 100644
--- a/arch/arm/lib/clearbit.S
+++ b/arch/arm/lib/clearbit.S
@@ -12,13 +12,6 @@
12#include "bitops.h" 12#include "bitops.h"
13 .text 13 .text
14 14
15/* 15ENTRY(_clear_bit)
16 * Purpose : Function to clear a bit
17 * Prototype: int clear_bit(int bit, void *addr)
18 */
19ENTRY(_clear_bit_be)
20 eor r0, r0, #0x18 @ big endian byte ordering
21ENTRY(_clear_bit_le)
22 bitop bic 16 bitop bic
23ENDPROC(_clear_bit_be) 17ENDPROC(_clear_bit)
24ENDPROC(_clear_bit_le)
diff --git a/arch/arm/lib/setbit.S b/arch/arm/lib/setbit.S
index 1dd7176c4b2b..bbee5c66a23e 100644
--- a/arch/arm/lib/setbit.S
+++ b/arch/arm/lib/setbit.S
@@ -12,13 +12,6 @@
12#include "bitops.h" 12#include "bitops.h"
13 .text 13 .text
14 14
15/* 15ENTRY(_set_bit)
16 * Purpose : Function to set a bit
17 * Prototype: int set_bit(int bit, void *addr)
18 */
19ENTRY(_set_bit_be)
20 eor r0, r0, #0x18 @ big endian byte ordering
21ENTRY(_set_bit_le)
22 bitop orr 16 bitop orr
23ENDPROC(_set_bit_be) 17ENDPROC(_set_bit)
24ENDPROC(_set_bit_le)
diff --git a/arch/arm/lib/testchangebit.S b/arch/arm/lib/testchangebit.S
index 5c98dc567f0f..15a4d431f229 100644
--- a/arch/arm/lib/testchangebit.S
+++ b/arch/arm/lib/testchangebit.S
@@ -12,9 +12,6 @@
12#include "bitops.h" 12#include "bitops.h"
13 .text 13 .text
14 14
15ENTRY(_test_and_change_bit_be) 15ENTRY(_test_and_change_bit)
16 eor r0, r0, #0x18 @ big endian byte ordering 16 testop eor, str
17ENTRY(_test_and_change_bit_le) 17ENDPROC(_test_and_change_bit)
18 testop eor, strb
19ENDPROC(_test_and_change_bit_be)
20ENDPROC(_test_and_change_bit_le)
diff --git a/arch/arm/lib/testclearbit.S b/arch/arm/lib/testclearbit.S
index 543d7094d18e..521b66b5b95d 100644
--- a/arch/arm/lib/testclearbit.S
+++ b/arch/arm/lib/testclearbit.S
@@ -12,9 +12,6 @@
12#include "bitops.h" 12#include "bitops.h"
13 .text 13 .text
14 14
15ENTRY(_test_and_clear_bit_be) 15ENTRY(_test_and_clear_bit)
16 eor r0, r0, #0x18 @ big endian byte ordering 16 testop bicne, strne
17ENTRY(_test_and_clear_bit_le) 17ENDPROC(_test_and_clear_bit)
18 testop bicne, strneb
19ENDPROC(_test_and_clear_bit_be)
20ENDPROC(_test_and_clear_bit_le)
diff --git a/arch/arm/lib/testsetbit.S b/arch/arm/lib/testsetbit.S
index 0b3f390401ce..1c98cc2185bb 100644
--- a/arch/arm/lib/testsetbit.S
+++ b/arch/arm/lib/testsetbit.S
@@ -12,9 +12,6 @@
12#include "bitops.h" 12#include "bitops.h"
13 .text 13 .text
14 14
15ENTRY(_test_and_set_bit_be) 15ENTRY(_test_and_set_bit)
16 eor r0, r0, #0x18 @ big endian byte ordering 16 testop orreq, streq
17ENTRY(_test_and_set_bit_le) 17ENDPROC(_test_and_set_bit)
18 testop orreq, streqb
19ENDPROC(_test_and_set_bit_be)
20ENDPROC(_test_and_set_bit_le)
diff --git a/arch/arm/lib/uaccess_with_memcpy.c b/arch/arm/lib/uaccess_with_memcpy.c
index e2d2f2cd0c4f..8b9b13649f81 100644
--- a/arch/arm/lib/uaccess_with_memcpy.c
+++ b/arch/arm/lib/uaccess_with_memcpy.c
@@ -27,13 +27,18 @@ pin_page_for_write(const void __user *_addr, pte_t **ptep, spinlock_t **ptlp)
27 pgd_t *pgd; 27 pgd_t *pgd;
28 pmd_t *pmd; 28 pmd_t *pmd;
29 pte_t *pte; 29 pte_t *pte;
30 pud_t *pud;
30 spinlock_t *ptl; 31 spinlock_t *ptl;
31 32
32 pgd = pgd_offset(current->mm, addr); 33 pgd = pgd_offset(current->mm, addr);
33 if (unlikely(pgd_none(*pgd) || pgd_bad(*pgd))) 34 if (unlikely(pgd_none(*pgd) || pgd_bad(*pgd)))
34 return 0; 35 return 0;
35 36
36 pmd = pmd_offset(pgd, addr); 37 pud = pud_offset(pgd, addr);
38 if (unlikely(pud_none(*pud) || pud_bad(*pud)))
39 return 0;
40
41 pmd = pmd_offset(pud, addr);
37 if (unlikely(pmd_none(*pmd) || pmd_bad(*pmd))) 42 if (unlikely(pmd_none(*pmd) || pmd_bad(*pmd)))
38 return 0; 43 return 0;
39 44
diff --git a/arch/arm/mach-aaec2000/Kconfig b/arch/arm/mach-aaec2000/Kconfig
deleted file mode 100644
index 5e4bef93754c..000000000000
--- a/arch/arm/mach-aaec2000/Kconfig
+++ /dev/null
@@ -1,11 +0,0 @@
1if ARCH_AAEC2000
2
3menu "Agilent AAEC-2000 Implementations"
4
5config MACH_AAED2000
6 bool "Agilent AAED-2000 Development Platform"
7 select CPU_ARM920T
8
9endmenu
10
11endif
diff --git a/arch/arm/mach-aaec2000/Makefile b/arch/arm/mach-aaec2000/Makefile
deleted file mode 100644
index 20ec83896c37..000000000000
--- a/arch/arm/mach-aaec2000/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Common support (must be linked before board specific support)
6obj-y += core.o
7
8# Specific board support
9obj-$(CONFIG_MACH_AAED2000) += aaed2000.o
diff --git a/arch/arm/mach-aaec2000/Makefile.boot b/arch/arm/mach-aaec2000/Makefile.boot
deleted file mode 100644
index 8f5a8b7c53c7..000000000000
--- a/arch/arm/mach-aaec2000/Makefile.boot
+++ /dev/null
@@ -1 +0,0 @@
1 zreladdr-y := 0xf0008000
diff --git a/arch/arm/mach-aaec2000/aaed2000.c b/arch/arm/mach-aaec2000/aaed2000.c
deleted file mode 100644
index 0eb3e3e5b2d1..000000000000
--- a/arch/arm/mach-aaec2000/aaed2000.c
+++ /dev/null
@@ -1,102 +0,0 @@
1/*
2 * linux/arch/arm/mach-aaec2000/aaed2000.c
3 *
4 * Support for the Agilent AAED-2000 Development Platform.
5 *
6 * Copyright (c) 2005 Nicolas Bellido Y Ortega
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/device.h>
17#include <linux/major.h>
18#include <linux/interrupt.h>
19
20#include <asm/setup.h>
21#include <asm/memory.h>
22#include <asm/mach-types.h>
23#include <mach/hardware.h>
24#include <asm/irq.h>
25
26#include <asm/mach/arch.h>
27#include <asm/mach/map.h>
28#include <asm/mach/irq.h>
29
30#include <mach/aaed2000.h>
31
32#include "core.h"
33
34static void aaed2000_clcd_disable(struct clcd_fb *fb)
35{
36 AAED_EXT_GPIO &= ~AAED_EGPIO_LCD_PWR_EN;
37}
38
39static void aaed2000_clcd_enable(struct clcd_fb *fb)
40{
41 AAED_EXT_GPIO |= AAED_EGPIO_LCD_PWR_EN;
42}
43
44struct aaec2000_clcd_info clcd_info = {
45 .enable = aaed2000_clcd_enable,
46 .disable = aaed2000_clcd_disable,
47 .panel = {
48 .mode = {
49 .name = "Sharp",
50 .refresh = 60,
51 .xres = 640,
52 .yres = 480,
53 .pixclock = 39721,
54 .left_margin = 20,
55 .right_margin = 44,
56 .upper_margin = 21,
57 .lower_margin = 34,
58 .hsync_len = 96,
59 .vsync_len = 2,
60 .sync = 0,
61 .vmode = FB_VMODE_NONINTERLACED,
62 },
63 .width = -1,
64 .height = -1,
65 .tim2 = TIM2_IVS | TIM2_IHS,
66 .cntl = CNTL_LCDTFT,
67 .bpp = 16,
68 },
69};
70
71static void __init aaed2000_init_irq(void)
72{
73 aaec2000_init_irq();
74}
75
76static void __init aaed2000_init(void)
77{
78 aaec2000_set_clcd_plat_data(&clcd_info);
79}
80
81static struct map_desc aaed2000_io_desc[] __initdata = {
82 {
83 .virtual = EXT_GPIO_VBASE,
84 .pfn = __phys_to_pfn(EXT_GPIO_PBASE),
85 .length = EXT_GPIO_LENGTH,
86 .type = MT_DEVICE
87 },
88};
89
90static void __init aaed2000_map_io(void)
91{
92 aaec2000_map_io();
93 iotable_init(aaed2000_io_desc, ARRAY_SIZE(aaed2000_io_desc));
94}
95
96MACHINE_START(AAED2000, "Agilent AAED-2000 Development Platform")
97 /* Maintainer: Nicolas Bellido Y Ortega */
98 .map_io = aaed2000_map_io,
99 .init_irq = aaed2000_init_irq,
100 .timer = &aaec2000_timer,
101 .init_machine = aaed2000_init,
102MACHINE_END
diff --git a/arch/arm/mach-aaec2000/core.c b/arch/arm/mach-aaec2000/core.c
deleted file mode 100644
index f8465bd17e67..000000000000
--- a/arch/arm/mach-aaec2000/core.c
+++ /dev/null
@@ -1,298 +0,0 @@
1/*
2 * linux/arch/arm/mach-aaec2000/core.c
3 *
4 * Code common to all AAEC-2000 machines
5 *
6 * Copyright (c) 2005 Nicolas Bellido Y Ortega
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#include <linux/module.h>
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/platform_device.h>
16#include <linux/list.h>
17#include <linux/errno.h>
18#include <linux/dma-mapping.h>
19#include <linux/interrupt.h>
20#include <linux/timex.h>
21#include <linux/signal.h>
22#include <linux/clk.h>
23#include <linux/gfp.h>
24
25#include <mach/hardware.h>
26#include <asm/irq.h>
27#include <asm/sizes.h>
28
29#include <asm/mach/flash.h>
30#include <asm/mach/irq.h>
31#include <asm/mach/time.h>
32#include <asm/mach/map.h>
33
34#include "core.h"
35
36/*
37 * Common I/O mapping:
38 *
39 * Static virtual address mappings are as follow:
40 *
41 * 0xf8000000-0xf8001ffff: Devices connected to APB bus
42 * 0xf8002000-0xf8003ffff: Devices connected to AHB bus
43 *
44 * Below 0xe8000000 is reserved for vm allocation.
45 *
46 * The machine specific code must provide the extra mapping beside the
47 * default mapping provided here.
48 */
49static struct map_desc standard_io_desc[] __initdata = {
50 {
51 .virtual = VIO_APB_BASE,
52 .pfn = __phys_to_pfn(PIO_APB_BASE),
53 .length = IO_APB_LENGTH,
54 .type = MT_DEVICE
55 }, {
56 .virtual = VIO_AHB_BASE,
57 .pfn = __phys_to_pfn(PIO_AHB_BASE),
58 .length = IO_AHB_LENGTH,
59 .type = MT_DEVICE
60 }
61};
62
63void __init aaec2000_map_io(void)
64{
65 iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
66}
67
68/*
69 * Interrupt handling routines
70 */
71static void aaec2000_int_ack(struct irq_data *d)
72{
73 IRQ_INTSR = 1 << d->irq;
74}
75
76static void aaec2000_int_mask(struct irq_data *d)
77{
78 IRQ_INTENC |= (1 << d->irq);
79}
80
81static void aaec2000_int_unmask(struct irq_data *d)
82{
83 IRQ_INTENS |= (1 << d->irq);
84}
85
86static struct irq_chip aaec2000_irq_chip = {
87 .irq_ack = aaec2000_int_ack,
88 .irq_mask = aaec2000_int_mask,
89 .irq_unmask = aaec2000_int_unmask,
90};
91
92void __init aaec2000_init_irq(void)
93{
94 unsigned int i;
95
96 for (i = 0; i < NR_IRQS; i++) {
97 set_irq_handler(i, handle_level_irq);
98 set_irq_chip(i, &aaec2000_irq_chip);
99 set_irq_flags(i, IRQF_VALID);
100 }
101
102 /* Disable all interrupts */
103 IRQ_INTENC = 0xffffffff;
104
105 /* Clear any pending interrupts */
106 IRQ_INTSR = IRQ_INTSR;
107}
108
109/*
110 * Time keeping
111 */
112/* IRQs are disabled before entering here from do_gettimeofday() */
113static unsigned long aaec2000_gettimeoffset(void)
114{
115 unsigned long ticks_to_match, elapsed, usec;
116
117 /* Get ticks before next timer match */
118 ticks_to_match = TIMER1_LOAD - TIMER1_VAL;
119
120 /* We need elapsed ticks since last match */
121 elapsed = LATCH - ticks_to_match;
122
123 /* Now, convert them to usec */
124 usec = (unsigned long)(elapsed * (tick_nsec / 1000))/LATCH;
125
126 return usec;
127}
128
129/* We enter here with IRQs enabled */
130static irqreturn_t
131aaec2000_timer_interrupt(int irq, void *dev_id)
132{
133 /* TODO: Check timer accuracy */
134 timer_tick();
135 TIMER1_CLEAR = 1;
136
137 return IRQ_HANDLED;
138}
139
140static struct irqaction aaec2000_timer_irq = {
141 .name = "AAEC-2000 Timer Tick",
142 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
143 .handler = aaec2000_timer_interrupt,
144};
145
146static void __init aaec2000_timer_init(void)
147{
148 /* Disable timer 1 */
149 TIMER1_CTRL = 0;
150
151 /* We have somehow to generate a 100Hz clock.
152 * We then use the 508KHz timer in periodic mode.
153 */
154 TIMER1_LOAD = LATCH;
155 TIMER1_CLEAR = 1; /* Clear interrupt */
156
157 setup_irq(INT_TMR1_OFL, &aaec2000_timer_irq);
158
159 TIMER1_CTRL = TIMER_CTRL_ENABLE |
160 TIMER_CTRL_PERIODIC |
161 TIMER_CTRL_CLKSEL_508K;
162}
163
164struct sys_timer aaec2000_timer = {
165 .init = aaec2000_timer_init,
166 .offset = aaec2000_gettimeoffset,
167};
168
169static struct clcd_panel mach_clcd_panel;
170
171static int aaec2000_clcd_setup(struct clcd_fb *fb)
172{
173 dma_addr_t dma;
174
175 fb->panel = &mach_clcd_panel;
176
177 fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, SZ_1M,
178 &dma, GFP_KERNEL);
179
180 if (!fb->fb.screen_base) {
181 printk(KERN_ERR "CLCD: unable to map framebuffer\n");
182 return -ENOMEM;
183 }
184
185 fb->fb.fix.smem_start = dma;
186 fb->fb.fix.smem_len = SZ_1M;
187
188 return 0;
189}
190
191static int aaec2000_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma)
192{
193 return dma_mmap_writecombine(&fb->dev->dev, vma,
194 fb->fb.screen_base,
195 fb->fb.fix.smem_start,
196 fb->fb.fix.smem_len);
197}
198
199static void aaec2000_clcd_remove(struct clcd_fb *fb)
200{
201 dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len,
202 fb->fb.screen_base, fb->fb.fix.smem_start);
203}
204
205static struct clcd_board clcd_plat_data = {
206 .name = "AAEC-2000",
207 .check = clcdfb_check,
208 .decode = clcdfb_decode,
209 .setup = aaec2000_clcd_setup,
210 .mmap = aaec2000_clcd_mmap,
211 .remove = aaec2000_clcd_remove,
212};
213
214static struct amba_device clcd_device = {
215 .dev = {
216 .init_name = "mb:16",
217 .coherent_dma_mask = ~0,
218 .platform_data = &clcd_plat_data,
219 },
220 .res = {
221 .start = AAEC_CLCD_PHYS,
222 .end = AAEC_CLCD_PHYS + SZ_4K - 1,
223 .flags = IORESOURCE_MEM,
224 },
225 .irq = { INT_LCD, NO_IRQ },
226 .periphid = 0x41110,
227};
228
229static struct amba_device *amba_devs[] __initdata = {
230 &clcd_device,
231};
232
233void clk_disable(struct clk *clk)
234{
235}
236
237int clk_set_rate(struct clk *clk, unsigned long rate)
238{
239 return 0;
240}
241
242int clk_enable(struct clk *clk)
243{
244 return 0;
245}
246
247struct clk *clk_get(struct device *dev, const char *id)
248{
249 return dev && strcmp(dev_name(dev), "mb:16") == 0 ? NULL : ERR_PTR(-ENOENT);
250}
251
252void clk_put(struct clk *clk)
253{
254}
255
256void __init aaec2000_set_clcd_plat_data(struct aaec2000_clcd_info *clcd)
257{
258 clcd_plat_data.enable = clcd->enable;
259 clcd_plat_data.disable = clcd->disable;
260 memcpy(&mach_clcd_panel, &clcd->panel, sizeof(struct clcd_panel));
261}
262
263static struct flash_platform_data aaec2000_flash_data = {
264 .map_name = "cfi_probe",
265 .width = 4,
266};
267
268static struct resource aaec2000_flash_resource = {
269 .start = AAEC_FLASH_BASE,
270 .end = AAEC_FLASH_BASE + AAEC_FLASH_SIZE,
271 .flags = IORESOURCE_MEM,
272};
273
274static struct platform_device aaec2000_flash_device = {
275 .name = "armflash",
276 .id = 0,
277 .dev = {
278 .platform_data = &aaec2000_flash_data,
279 },
280 .num_resources = 1,
281 .resource = &aaec2000_flash_resource,
282};
283
284static int __init aaec2000_init(void)
285{
286 int i;
287
288 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
289 struct amba_device *d = amba_devs[i];
290 amba_device_register(d, &iomem_resource);
291 }
292
293 platform_device_register(&aaec2000_flash_device);
294
295 return 0;
296};
297arch_initcall(aaec2000_init);
298
diff --git a/arch/arm/mach-aaec2000/core.h b/arch/arm/mach-aaec2000/core.h
deleted file mode 100644
index 59501b573167..000000000000
--- a/arch/arm/mach-aaec2000/core.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * linux/arch/arm/mach-aaec2000/core.h
3 *
4 * Copyright (c) 2005 Nicolas Bellido Y Ortega
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12#include <linux/amba/bus.h>
13#include <linux/amba/clcd.h>
14
15struct sys_timer;
16
17extern struct sys_timer aaec2000_timer;
18extern void __init aaec2000_map_io(void);
19extern void __init aaec2000_init_irq(void);
20
21struct aaec2000_clcd_info {
22 struct clcd_panel panel;
23 void (*disable)(struct clcd_fb *);
24 void (*enable)(struct clcd_fb *);
25};
26
27extern void __init aaec2000_set_clcd_plat_data(struct aaec2000_clcd_info *);
28
diff --git a/arch/arm/mach-aaec2000/include/mach/aaec2000.h b/arch/arm/mach-aaec2000/include/mach/aaec2000.h
deleted file mode 100644
index bc729c42f843..000000000000
--- a/arch/arm/mach-aaec2000/include/mach/aaec2000.h
+++ /dev/null
@@ -1,207 +0,0 @@
1/*
2 * arch/arm/mach-aaec2000/include/mach/aaec2000.h
3 *
4 * AAEC-2000 registers definition
5 *
6 * Copyright (c) 2005 Nicolas Bellido Y Ortega
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __ASM_ARCH_AAEC2000_H
14#define __ASM_ARCH_AAEC2000_H
15
16#ifndef __ASM_ARCH_HARDWARE_H
17#error You must include hardware.h not this file
18#endif /* __ASM_ARCH_HARDWARE_H */
19
20/* Chip selects */
21#define AAEC_CS0 0x00000000
22#define AAEC_CS1 0x10000000
23#define AAEC_CS2 0x20000000
24#define AAEC_CS3 0x30000000
25
26/* Flash */
27#define AAEC_FLASH_BASE AAEC_CS0
28#define AAEC_FLASH_SIZE SZ_64M
29
30/* Interrupt controller */
31#define IRQ_BASE __REG(0x80000500)
32#define IRQ_INTSR __REG(0x80000500) /* Int Status Register */
33#define IRQ_INTRSR __REG(0x80000504) /* Int Raw (unmasked) Status */
34#define IRQ_INTENS __REG(0x80000508) /* Int Enable Set */
35#define IRQ_INTENC __REG(0x8000050c) /* Int Enable Clear */
36
37/* UART 1 */
38#define UART1_BASE __REG(0x80000600)
39#define UART1_DR __REG(0x80000600) /* Data/FIFO Register */
40#define UART1_LCR __REG(0x80000604) /* Link Control Register */
41#define UART1_BRCR __REG(0x80000608) /* Baud Rate Control Register */
42#define UART1_CR __REG(0x8000060c) /* Control Register */
43#define UART1_SR __REG(0x80000610) /* Status Register */
44#define UART1_INT __REG(0x80000614) /* Interrupt Status Register */
45#define UART1_INTM __REG(0x80000618) /* Interrupt Mask Register */
46#define UART1_INTRES __REG(0x8000061c) /* Int Result (masked status) Register */
47
48/* UART 2 */
49#define UART2_BASE __REG(0x80000700)
50#define UART2_DR __REG(0x80000700) /* Data/FIFO Register */
51#define UART2_LCR __REG(0x80000704) /* Link Control Register */
52#define UART2_BRCR __REG(0x80000708) /* Baud Rate Control Register */
53#define UART2_CR __REG(0x8000070c) /* Control Register */
54#define UART2_SR __REG(0x80000710) /* Status Register */
55#define UART2_INT __REG(0x80000714) /* Interrupt Status Register */
56#define UART2_INTM __REG(0x80000718) /* Interrupt Mask Register */
57#define UART2_INTRES __REG(0x8000071c) /* Int Result (masked status) Register */
58
59/* UART 3 */
60#define UART3_BASE __REG(0x80000800)
61#define UART3_DR __REG(0x80000800) /* Data/FIFO Register */
62#define UART3_LCR __REG(0x80000804) /* Link Control Register */
63#define UART3_BRCR __REG(0x80000808) /* Baud Rate Control Register */
64#define UART3_CR __REG(0x8000080c) /* Control Register */
65#define UART3_SR __REG(0x80000810) /* Status Register */
66#define UART3_INT __REG(0x80000814) /* Interrupt Status Register */
67#define UART3_INTM __REG(0x80000818) /* Interrupt Mask Register */
68#define UART3_INTRES __REG(0x8000081c) /* Int Result (masked status) Register */
69
70/* These are used in some places */
71#define _UART1_BASE __PREG(UART1_BASE)
72#define _UART2_BASE __PREG(UART2_BASE)
73#define _UART3_BASE __PREG(UART3_BASE)
74
75/* UART Registers Offsets */
76#define UART_DR 0x00
77#define UART_LCR 0x04
78#define UART_BRCR 0x08
79#define UART_CR 0x0c
80#define UART_SR 0x10
81#define UART_INT 0x14
82#define UART_INTM 0x18
83#define UART_INTRES 0x1c
84
85/* UART_LCR Bitmask */
86#define UART_LCR_BRK (1 << 0) /* Send Break */
87#define UART_LCR_PEN (1 << 1) /* Parity Enable */
88#define UART_LCR_EP (1 << 2) /* Even/Odd Parity */
89#define UART_LCR_S2 (1 << 3) /* One/Two Stop bits */
90#define UART_LCR_FIFO (1 << 4) /* FIFO Enable */
91#define UART_LCR_WL5 (0 << 5) /* Word Length - 5 bits */
92#define UART_LCR_WL6 (1 << 5) /* Word Length - 6 bits */
93#define UART_LCR_WL7 (1 << 6) /* Word Length - 7 bits */
94#define UART_LCR_WL8 (1 << 7) /* Word Length - 8 bits */
95
96/* UART_CR Bitmask */
97#define UART_CR_EN (1 << 0) /* UART Enable */
98#define UART_CR_SIR (1 << 1) /* IrDA SIR Enable */
99#define UART_CR_SIRLP (1 << 2) /* Low Power IrDA Enable */
100#define UART_CR_RXP (1 << 3) /* Receive Pin Polarity */
101#define UART_CR_TXP (1 << 4) /* Transmit Pin Polarity */
102#define UART_CR_MXP (1 << 5) /* Modem Pin Polarity */
103#define UART_CR_LOOP (1 << 6) /* Loopback Mode */
104
105/* UART_SR Bitmask */
106#define UART_SR_CTS (1 << 0) /* Clear To Send Status */
107#define UART_SR_DSR (1 << 1) /* Data Set Ready Status */
108#define UART_SR_DCD (1 << 2) /* Data Carrier Detect Status */
109#define UART_SR_TxBSY (1 << 3) /* Transmitter Busy Status */
110#define UART_SR_RxFE (1 << 4) /* Receive FIFO Empty Status */
111#define UART_SR_TxFF (1 << 5) /* Transmit FIFO Full Status */
112#define UART_SR_RxFF (1 << 6) /* Receive FIFO Full Status */
113#define UART_SR_TxFE (1 << 7) /* Transmit FIFO Empty Status */
114
115/* UART_INT Bitmask */
116#define UART_INT_RIS (1 << 0) /* Rx Interrupt */
117#define UART_INT_TIS (1 << 1) /* Tx Interrupt */
118#define UART_INT_MIS (1 << 2) /* Modem Interrupt */
119#define UART_INT_RTIS (1 << 3) /* Receive Timeout Interrupt */
120
121/* Timer 1 */
122#define TIMER1_BASE __REG(0x80000c00)
123#define TIMER1_LOAD __REG(0x80000c00) /* Timer 1 Load Register */
124#define TIMER1_VAL __REG(0x80000c04) /* Timer 1 Value Register */
125#define TIMER1_CTRL __REG(0x80000c08) /* Timer 1 Control Register */
126#define TIMER1_CLEAR __REG(0x80000c0c) /* Timer 1 Clear Register */
127
128/* Timer 2 */
129#define TIMER2_BASE __REG(0x80000d00)
130#define TIMER2_LOAD __REG(0x80000d00) /* Timer 2 Load Register */
131#define TIMER2_VAL __REG(0x80000d04) /* Timer 2 Value Register */
132#define TIMER2_CTRL __REG(0x80000d08) /* Timer 2 Control Register */
133#define TIMER2_CLEAR __REG(0x80000d0c) /* Timer 2 Clear Register */
134
135/* Timer 3 */
136#define TIMER3_BASE __REG(0x80000e00)
137#define TIMER3_LOAD __REG(0x80000e00) /* Timer 3 Load Register */
138#define TIMER3_VAL __REG(0x80000e04) /* Timer 3 Value Register */
139#define TIMER3_CTRL __REG(0x80000e08) /* Timer 3 Control Register */
140#define TIMER3_CLEAR __REG(0x80000e0c) /* Timer 3 Clear Register */
141
142/* Timer Control register bits */
143#define TIMER_CTRL_ENABLE (1 << 7) /* Enable (Start Timer) */
144#define TIMER_CTRL_PERIODIC (1 << 6) /* Periodic Running Mode */
145#define TIMER_CTRL_FREE_RUNNING (0 << 6) /* Normal Running Mode */
146#define TIMER_CTRL_CLKSEL_508K (1 << 3) /* 508KHz Clock select (Timer 1, 2) */
147#define TIMER_CTRL_CLKSEL_2K (0 << 3) /* 2KHz Clock Select (Timer 1, 2) */
148
149/* Power and State Control */
150#define POWER_BASE __REG(0x80000400)
151#define POWER_PWRSR __REG(0x80000400) /* Power Status Register */
152#define POWER_PWRCNT __REG(0x80000404) /* Power/Clock control */
153#define POWER_HALT __REG(0x80000408) /* Power Idle Mode */
154#define POWER_STDBY __REG(0x8000040c) /* Power Standby Mode */
155#define POWER_BLEOI __REG(0x80000410) /* Battery Low End of Interrupt */
156#define POWER_MCEOI __REG(0x80000414) /* Media Changed EoI */
157#define POWER_TEOI __REG(0x80000418) /* Tick EoI */
158#define POWER_STFCLR __REG(0x8000041c) /* NbFlg, RSTFlg, PFFlg, CLDFlg Clear */
159#define POWER_CLKSET __REG(0x80000420) /* Clock Speed Control */
160
161/* GPIO Registers */
162#define AAEC_GPIO_PHYS 0x80000e00
163
164#define AAEC_GPIO_PADR __REG(AAEC_GPIO_PHYS + 0x00)
165#define AAEC_GPIO_PBDR __REG(AAEC_GPIO_PHYS + 0x04)
166#define AAEC_GPIO_PCDR __REG(AAEC_GPIO_PHYS + 0x08)
167#define AAEC_GPIO_PDDR __REG(AAEC_GPIO_PHYS + 0x0c)
168#define AAEC_GPIO_PADDR __REG(AAEC_GPIO_PHYS + 0x10)
169#define AAEC_GPIO_PBDDR __REG(AAEC_GPIO_PHYS + 0x14)
170#define AAEC_GPIO_PCDDR __REG(AAEC_GPIO_PHYS + 0x18)
171#define AAEC_GPIO_PDDDR __REG(AAEC_GPIO_PHYS + 0x1c)
172#define AAEC_GPIO_PEDR __REG(AAEC_GPIO_PHYS + 0x20)
173#define AAEC_GPIO_PEDDR __REG(AAEC_GPIO_PHYS + 0x24)
174#define AAEC_GPIO_KSCAN __REG(AAEC_GPIO_PHYS + 0x28)
175#define AAEC_GPIO_PINMUX __REG(AAEC_GPIO_PHYS + 0x2c)
176#define AAEC_GPIO_PFDR __REG(AAEC_GPIO_PHYS + 0x30)
177#define AAEC_GPIO_PFDDR __REG(AAEC_GPIO_PHYS + 0x34)
178#define AAEC_GPIO_PGDR __REG(AAEC_GPIO_PHYS + 0x38)
179#define AAEC_GPIO_PGDDR __REG(AAEC_GPIO_PHYS + 0x3c)
180#define AAEC_GPIO_PHDR __REG(AAEC_GPIO_PHYS + 0x40)
181#define AAEC_GPIO_PHDDR __REG(AAEC_GPIO_PHYS + 0x44)
182#define AAEC_GPIO_RAZ __REG(AAEC_GPIO_PHYS + 0x48)
183#define AAEC_GPIO_INTTYPE1 __REG(AAEC_GPIO_PHYS + 0x4c)
184#define AAEC_GPIO_INTTYPE2 __REG(AAEC_GPIO_PHYS + 0x50)
185#define AAEC_GPIO_FEOI __REG(AAEC_GPIO_PHYS + 0x54)
186#define AAEC_GPIO_INTEN __REG(AAEC_GPIO_PHYS + 0x58)
187#define AAEC_GPIO_INTSTATUS __REG(AAEC_GPIO_PHYS + 0x5c)
188#define AAEC_GPIO_RAWINTSTATUS __REG(AAEC_GPIO_PHYS + 0x60)
189#define AAEC_GPIO_DB __REG(AAEC_GPIO_PHYS + 0x64)
190#define AAEC_GPIO_PAPINDR __REG(AAEC_GPIO_PHYS + 0x68)
191#define AAEC_GPIO_PBPINDR __REG(AAEC_GPIO_PHYS + 0x6c)
192#define AAEC_GPIO_PCPINDR __REG(AAEC_GPIO_PHYS + 0x70)
193#define AAEC_GPIO_PDPINDR __REG(AAEC_GPIO_PHYS + 0x74)
194#define AAEC_GPIO_PEPINDR __REG(AAEC_GPIO_PHYS + 0x78)
195#define AAEC_GPIO_PFPINDR __REG(AAEC_GPIO_PHYS + 0x7c)
196#define AAEC_GPIO_PGPINDR __REG(AAEC_GPIO_PHYS + 0x80)
197#define AAEC_GPIO_PHPINDR __REG(AAEC_GPIO_PHYS + 0x84)
198
199#define AAEC_GPIO_PINMUX_PE0CON (1 << 0)
200#define AAEC_GPIO_PINMUX_PD0CON (1 << 1)
201#define AAEC_GPIO_PINMUX_CODECON (1 << 2)
202#define AAEC_GPIO_PINMUX_UART3CON (1 << 3)
203
204/* LCD Controller */
205#define AAEC_CLCD_PHYS 0x80003000
206
207#endif /* __ARM_ARCH_AAEC2000_H */
diff --git a/arch/arm/mach-aaec2000/include/mach/aaed2000.h b/arch/arm/mach-aaec2000/include/mach/aaed2000.h
deleted file mode 100644
index f821295ca71b..000000000000
--- a/arch/arm/mach-aaec2000/include/mach/aaed2000.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * arch/arm/mach-aaec2000/include/mach/aaed2000.h
3 *
4 * AAED-2000 specific bits definition
5 *
6 * Copyright (c) 2005 Nicolas Bellido Y Ortega
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __ASM_ARCH_AAED2000_H
14#define __ASM_ARCH_AAED2000_H
15
16/* External GPIOs. */
17
18#define EXT_GPIO_PBASE AAEC_CS3
19#define EXT_GPIO_VBASE 0xf8100000
20#define EXT_GPIO_LENGTH 0x00001000
21
22#define __ext_gpio_p2v(x) ((x) - EXT_GPIO_PBASE + EXT_GPIO_VBASE)
23#define __ext_gpio_v2p(x) ((x) + EXT_GPIO_PBASE - EXT_GPIO_VBASE)
24
25#define __EXT_GPIO_REG(x) (*((volatile u32 *)__ext_gpio_p2v(x)))
26#define __EXT_GPIO_PREG(x) (__ext_gpio_v2p((u32)&(x)))
27
28#define AAED_EXT_GPIO __EXT_GPIO_REG(EXT_GPIO_PBASE)
29
30#define AAED_EGPIO_KBD_SCAN 0x00003fff /* Keyboard scan data */
31#define AAED_EGPIO_PWR_INT 0x00008fff /* Smart battery charger interrupt */
32#define AAED_EGPIO_SWITCHED 0x000f0000 /* DIP Switches */
33#define AAED_EGPIO_USB_VBUS 0x00400000 /* USB Vbus sense */
34#define AAED_EGPIO_LCD_PWR_EN 0x02000000 /* LCD and backlight PWR enable */
35#define AAED_EGPIO_nLED0 0x20000000 /* LED 0 */
36#define AAED_EGPIO_nLED1 0x20000000 /* LED 1 */
37#define AAED_EGPIO_nLED2 0x20000000 /* LED 2 */
38
39
40#endif /* __ARM_ARCH_AAED2000_H */
diff --git a/arch/arm/mach-aaec2000/include/mach/debug-macro.S b/arch/arm/mach-aaec2000/include/mach/debug-macro.S
deleted file mode 100644
index bc7ad5561c4c..000000000000
--- a/arch/arm/mach-aaec2000/include/mach/debug-macro.S
+++ /dev/null
@@ -1,35 +0,0 @@
1/* arch/arm/mach-aaec2000/include/mach/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (c) 2005 Nicolas Bellido Y Ortega
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include "hardware.h"
13 .macro addruart, rp, rv
14 mov \rp, 0x00000800
15 orr \rv, \rp, #io_p2v(0x80000000) @ virtual
16 orr \rp, \rp, #0x80000000 @ physical
17 .endm
18
19 .macro senduart,rd,rx
20 str \rd, [\rx, #0]
21 .endm
22
23 .macro busyuart,rd,rx
241002: ldr \rd, [\rx, #0x10]
25 tst \rd, #(1 << 7)
26 beq 1002b
27 .endm
28
29 .macro waituart,rd,rx
30#if 0
311001: ldr \rd, [\rx, #0x10]
32 tst \rd, #(1 << 5)
33 beq 1001b
34#endif
35 .endm
diff --git a/arch/arm/mach-aaec2000/include/mach/entry-macro.S b/arch/arm/mach-aaec2000/include/mach/entry-macro.S
deleted file mode 100644
index c8fb34469007..000000000000
--- a/arch/arm/mach-aaec2000/include/mach/entry-macro.S
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * arch/arm/mach-aaec2000/include/mach/entry-macro.S
3 *
4 * Low-level IRQ helper for aaec-2000 based platforms
5 *
6 * Copyright (c) 2005 Nicolas Bellido Y Ortega
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
13#include <mach/irqs.h>
14
15 .macro disable_fiq
16 .endm
17
18 .macro get_irqnr_preamble, base, tmp
19 .endm
20
21 .macro arch_ret_to_user, tmp1, tmp2
22 .endm
23
24 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
25 mov r4, #0xf8000000
26 add r4, r4, #0x00000500
27 mov \base, r4
28 ldr \irqstat, [\base, #0]
29 cmp \irqstat, #0
30 bne 1001f
31 ldr \irqnr, =NR_IRQS+1
32 b 1003f
331001: mov \irqnr, #0
341002: ands \tmp, \irqstat, #1
35 mov \irqstat, \irqstat, LSR #1
36 add \irqnr, \irqnr, #1
37 beq 1002b
38 sub \irqnr, \irqnr, #1
391003:
40 .endm
diff --git a/arch/arm/mach-aaec2000/include/mach/hardware.h b/arch/arm/mach-aaec2000/include/mach/hardware.h
deleted file mode 100644
index 965a6f6672d6..000000000000
--- a/arch/arm/mach-aaec2000/include/mach/hardware.h
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 * arch/arm/mach-aaec2000/include/mach/hardware.h
3 *
4 * Copyright (c) 2005 Nicolas Bellido Y Ortega
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_HARDWARE_H
12#define __ASM_ARCH_HARDWARE_H
13
14#include <asm/sizes.h>
15#include <mach/aaec2000.h>
16
17/* The kernel is loaded at physical address 0xf8000000.
18 * We map the IO space a bit after
19 */
20#define PIO_APB_BASE 0x80000000
21#define VIO_APB_BASE 0xf8000000
22#define IO_APB_LENGTH 0x2000
23#define PIO_AHB_BASE 0x80002000
24#define VIO_AHB_BASE 0xf8002000
25#define IO_AHB_LENGTH 0x2000
26
27#define VIO_BASE VIO_APB_BASE
28#define PIO_BASE PIO_APB_BASE
29
30#define io_p2v(x) ( (x) - PIO_BASE + VIO_BASE )
31#define io_v2p(x) ( (x) + PIO_BASE - VIO_BASE )
32
33#ifndef __ASSEMBLY__
34
35#include <asm/types.h>
36
37/* FIXME: Is it needed to optimize this a la pxa ?? */
38#define __REG(x) (*((volatile u32 *)io_p2v(x)))
39#define __PREG(x) (io_v2p((u32)&(x)))
40
41#else /* __ASSEMBLY__ */
42
43#define __REG(x) io_p2v(x)
44#define __PREG(x) io_v2p(x)
45
46#endif
47
48#include "aaec2000.h"
49
50#endif /* __ASM_ARCH_HARDWARE_H */
diff --git a/arch/arm/mach-aaec2000/include/mach/io.h b/arch/arm/mach-aaec2000/include/mach/io.h
deleted file mode 100644
index ab4fe5d20eaf..000000000000
--- a/arch/arm/mach-aaec2000/include/mach/io.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/*
2 * arch/arm/mach-aaec2000/include/mach/io.h
3 *
4 * Copied from asm/arch/sa1100/io.h
5 */
6#ifndef __ASM_ARM_ARCH_IO_H
7#define __ASM_ARM_ARCH_IO_H
8
9#define IO_SPACE_LIMIT 0xffffffff
10
11/*
12 * We don't actually have real ISA nor PCI buses, but there is so many
13 * drivers out there that might just work if we fake them...
14 */
15#define __io(a) __typesafe_io(a)
16#define __mem_pci(a) (a)
17
18#endif
diff --git a/arch/arm/mach-aaec2000/include/mach/irqs.h b/arch/arm/mach-aaec2000/include/mach/irqs.h
deleted file mode 100644
index bf45c6d2f294..000000000000
--- a/arch/arm/mach-aaec2000/include/mach/irqs.h
+++ /dev/null
@@ -1,46 +0,0 @@
1/*
2 * arch/arm/mach-aaec2000/include/mach/irqs.h
3 *
4 * Copyright (c) 2005 Nicolas Bellido Y Ortega
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_IRQS_H
12#define __ASM_ARCH_IRQS_H
13
14
15#define INT_GPIOF0_FIQ 0 /* External GPIO Port F O Fast Interrupt Input */
16#define INT_BL_FIQ 1 /* Battery Low Fast Interrupt */
17#define INT_WE_FIQ 2 /* Watchdog Expired Fast Interrupt */
18#define INT_MV_FIQ 3 /* Media Changed Interrupt */
19#define INT_SC 4 /* Sound Codec Interrupt */
20#define INT_GPIO1 5 /* GPIO Port F Configurable Int 1 */
21#define INT_GPIO2 6 /* GPIO Port F Configurable Int 2 */
22#define INT_GPIO3 7 /* GPIO Port F Configurable Int 3 */
23#define INT_TMR1_OFL 8 /* Timer 1 Overflow Interrupt */
24#define INT_TMR2_OFL 9 /* Timer 2 Overflow Interrupt */
25#define INT_RTC_CM 10 /* RTC Compare Match Interrupt */
26#define INT_TICK 11 /* 64Hz Tick Interrupt */
27#define INT_UART1 12 /* UART1 Interrupt */
28#define INT_UART2 13 /* UART2 & Modem State Changed Interrupt */
29#define INT_LCD 14 /* LCD Interrupt */
30#define INT_SSI 15 /* SSI End of Transfer Interrupt */
31#define INT_UART3 16 /* UART3 Interrupt */
32#define INT_SCI 17 /* SCI Interrupt */
33#define INT_AAC 18 /* Advanced Audio Codec Interrupt */
34#define INT_MMC 19 /* MMC Interrupt */
35#define INT_USB 20 /* USB Interrupt */
36#define INT_DMA 21 /* DMA Interrupt */
37#define INT_TMR3_UOFL 22 /* Timer 3 Underflow Interrupt */
38#define INT_GPIO4 23 /* GPIO Port F Configurable Int 4 */
39#define INT_GPIO5 24 /* GPIO Port F Configurable Int 4 */
40#define INT_GPIO6 25 /* GPIO Port F Configurable Int 4 */
41#define INT_GPIO7 26 /* GPIO Port F Configurable Int 4 */
42#define INT_BMI 27 /* BMI Interrupt */
43
44#define NR_IRQS (INT_BMI + 1)
45
46#endif /* __ASM_ARCH_IRQS_H */
diff --git a/arch/arm/mach-aaec2000/include/mach/memory.h b/arch/arm/mach-aaec2000/include/mach/memory.h
deleted file mode 100644
index 4f93c567a35a..000000000000
--- a/arch/arm/mach-aaec2000/include/mach/memory.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/*
2 * arch/arm/mach-aaec2000/include/mach/memory.h
3 *
4 * Copyright (c) 2005 Nicolas Bellido Y Ortega
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_MEMORY_H
12#define __ASM_ARCH_MEMORY_H
13
14
15#define PHYS_OFFSET UL(0xf0000000)
16
17#endif /* __ASM_ARCH_MEMORY_H */
diff --git a/arch/arm/mach-aaec2000/include/mach/system.h b/arch/arm/mach-aaec2000/include/mach/system.h
deleted file mode 100644
index fe08ca1add6f..000000000000
--- a/arch/arm/mach-aaec2000/include/mach/system.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * arch/arm/mach-aaed2000/include/mach/system.h
3 *
4 * Copyright (c) 2005 Nicolas Bellido Y Ortega
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_SYSTEM_H
12#define __ASM_ARCH_SYSTEM_H
13
14static inline void arch_idle(void)
15{
16 cpu_do_idle();
17}
18
19static inline void arch_reset(char mode, const char *cmd)
20{
21 cpu_reset(0);
22}
23
24#endif /* __ASM_ARCH_SYSTEM_H */
diff --git a/arch/arm/mach-aaec2000/include/mach/timex.h b/arch/arm/mach-aaec2000/include/mach/timex.h
deleted file mode 100644
index 6c8edf4a8828..000000000000
--- a/arch/arm/mach-aaec2000/include/mach/timex.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/*
2 * arch/arm/mach-aaec2000/include/mach/timex.h
3 *
4 * AAEC-2000 Architecture timex specification
5 *
6 * Copyright (c) 2005 Nicolas Bellido Y Ortega
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __ASM_ARCH_TIMEX_H
14#define __ASM_ARCH_TIMEX_H
15
16#define CLOCK_TICK_RATE 508000
17
18#endif /* __ASM_ARCH_TIMEX_H */
diff --git a/arch/arm/mach-aaec2000/include/mach/uncompress.h b/arch/arm/mach-aaec2000/include/mach/uncompress.h
deleted file mode 100644
index 381ecad1a1bb..000000000000
--- a/arch/arm/mach-aaec2000/include/mach/uncompress.h
+++ /dev/null
@@ -1,46 +0,0 @@
1/*
2 * arch/arm/mach-aaec2000/include/mach/uncompress.h
3 *
4 * Copyright (c) 2005 Nicolas Bellido Y Ortega
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_UNCOMPRESS_H
12#define __ASM_ARCH_UNCOMPRESS_H
13
14#include "hardware.h"
15
16#define UART(x) (*(volatile unsigned long *)(serial_port + (x)))
17
18static void putc(int c)
19{
20 unsigned long serial_port;
21 do {
22 serial_port = _UART3_BASE;
23 if (UART(UART_CR) & UART_CR_EN) break;
24 serial_port = _UART1_BASE;
25 if (UART(UART_CR) & UART_CR_EN) break;
26 serial_port = _UART2_BASE;
27 if (UART(UART_CR) & UART_CR_EN) break;
28 return;
29 } while (0);
30
31 /* wait for space in the UART's transmitter */
32 while ((UART(UART_SR) & UART_SR_TxFF))
33 barrier();
34
35 /* send the character out. */
36 UART(UART_DR) = c;
37}
38
39static inline void flush(void)
40{
41}
42
43#define arch_decomp_setup()
44#define arch_decomp_wdog()
45
46#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-aaec2000/include/mach/vmalloc.h b/arch/arm/mach-aaec2000/include/mach/vmalloc.h
deleted file mode 100644
index a6299e8321bd..000000000000
--- a/arch/arm/mach-aaec2000/include/mach/vmalloc.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/*
2 * arch/arm/mach-aaec2000/include/mach/vmalloc.h
3 *
4 * Copyright (c) 2005 Nicolas Bellido Y Ortega
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __ASM_ARCH_VMALLOC_H
12#define __ASM_ARCH_VMALLOC_H
13
14#define VMALLOC_END 0xd0000000UL
15
16#endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-at91/board-snapper9260.c b/arch/arm/mach-at91/board-snapper9260.c
index 0a99b3cedd7a..17f7d9b32142 100644
--- a/arch/arm/mach-at91/board-snapper9260.c
+++ b/arch/arm/mach-at91/board-snapper9260.c
@@ -153,6 +153,7 @@ static struct i2c_board_info __initdata snapper9260_i2c_devices[] = {
153 { 153 {
154 /* RTC */ 154 /* RTC */
155 I2C_BOARD_INFO("isl1208", 0x6f), 155 I2C_BOARD_INFO("isl1208", 0x6f),
156 .irq = gpio_to_irq(AT91_PIN_PA31),
156 }, 157 },
157}; 158};
158 159
diff --git a/arch/arm/mach-at91/include/mach/gpio.h b/arch/arm/mach-at91/include/mach/gpio.h
index bfdd8ab26dc8..ddeb64536756 100644
--- a/arch/arm/mach-at91/include/mach/gpio.h
+++ b/arch/arm/mach-at91/include/mach/gpio.h
@@ -220,15 +220,8 @@ extern void at91_gpio_resume(void);
220#define gpio_set_value __gpio_set_value 220#define gpio_set_value __gpio_set_value
221#define gpio_cansleep __gpio_cansleep 221#define gpio_cansleep __gpio_cansleep
222 222
223static inline int gpio_to_irq(unsigned gpio) 223#define gpio_to_irq(gpio) (gpio)
224{ 224#define irq_to_gpio(irq) (irq)
225 return gpio;
226}
227
228static inline int irq_to_gpio(unsigned irq)
229{
230 return irq;
231}
232 225
233#endif /* __ASSEMBLY__ */ 226#endif /* __ASSEMBLY__ */
234 227
diff --git a/arch/arm/mach-at91/include/mach/memory.h b/arch/arm/mach-at91/include/mach/memory.h
index 14f4ef4b6a9e..c2cfe5040642 100644
--- a/arch/arm/mach-at91/include/mach/memory.h
+++ b/arch/arm/mach-at91/include/mach/memory.h
@@ -23,6 +23,6 @@
23 23
24#include <mach/hardware.h> 24#include <mach/hardware.h>
25 25
26#define PHYS_OFFSET (AT91_SDRAM_BASE) 26#define PLAT_PHYS_OFFSET (AT91_SDRAM_BASE)
27 27
28#endif 28#endif
diff --git a/arch/arm/mach-bcmring/include/mach/hardware.h b/arch/arm/mach-bcmring/include/mach/hardware.h
index 447eb340c611..8bf3564fba50 100644
--- a/arch/arm/mach-bcmring/include/mach/hardware.h
+++ b/arch/arm/mach-bcmring/include/mach/hardware.h
@@ -31,7 +31,7 @@
31 * *_SIZE is the size of the region 31 * *_SIZE is the size of the region
32 * *_BASE is the virtual address 32 * *_BASE is the virtual address
33 */ 33 */
34#define RAM_START PHYS_OFFSET 34#define RAM_START PLAT_PHYS_OFFSET
35 35
36#define RAM_SIZE (CFG_GLOBAL_RAM_SIZE-CFG_GLOBAL_RAM_SIZE_RESERVED) 36#define RAM_SIZE (CFG_GLOBAL_RAM_SIZE-CFG_GLOBAL_RAM_SIZE_RESERVED)
37#define RAM_BASE PAGE_OFFSET 37#define RAM_BASE PAGE_OFFSET
diff --git a/arch/arm/mach-bcmring/include/mach/memory.h b/arch/arm/mach-bcmring/include/mach/memory.h
index 114f942bb4f3..15162e4c75f9 100644
--- a/arch/arm/mach-bcmring/include/mach/memory.h
+++ b/arch/arm/mach-bcmring/include/mach/memory.h
@@ -23,7 +23,7 @@
23 * files. Use virt_to_phys/phys_to_virt/__pa/__va instead. 23 * files. Use virt_to_phys/phys_to_virt/__pa/__va instead.
24 */ 24 */
25 25
26#define PHYS_OFFSET CFG_GLOBAL_RAM_BASE 26#define PLAT_PHYS_OFFSET CFG_GLOBAL_RAM_BASE
27 27
28/* 28/*
29 * Maximum DMA memory allowed is 14M 29 * Maximum DMA memory allowed is 14M
diff --git a/arch/arm/mach-clps711x/include/mach/memory.h b/arch/arm/mach-clps711x/include/mach/memory.h
index f45c8e892cb5..3a032a67725c 100644
--- a/arch/arm/mach-clps711x/include/mach/memory.h
+++ b/arch/arm/mach-clps711x/include/mach/memory.h
@@ -23,7 +23,7 @@
23/* 23/*
24 * Physical DRAM offset. 24 * Physical DRAM offset.
25 */ 25 */
26#define PHYS_OFFSET UL(0xc0000000) 26#define PLAT_PHYS_OFFSET UL(0xc0000000)
27 27
28#if !defined(CONFIG_ARCH_CDB89712) && !defined (CONFIG_ARCH_AUTCPU12) 28#if !defined(CONFIG_ARCH_CDB89712) && !defined (CONFIG_ARCH_AUTCPU12)
29 29
diff --git a/arch/arm/mach-clps711x/include/mach/time.h b/arch/arm/mach-clps711x/include/mach/time.h
index 8fe283ccd1f3..61fef9129c6a 100644
--- a/arch/arm/mach-clps711x/include/mach/time.h
+++ b/arch/arm/mach-clps711x/include/mach/time.h
@@ -30,7 +30,7 @@ p720t_timer_interrupt(int irq, void *dev_id)
30{ 30{
31 struct pt_regs *regs = get_irq_regs(); 31 struct pt_regs *regs = get_irq_regs();
32 do_leds(); 32 do_leds();
33 do_timer(1); 33 xtime_update(1);
34#ifndef CONFIG_SMP 34#ifndef CONFIG_SMP
35 update_process_times(user_mode(regs)); 35 update_process_times(user_mode(regs));
36#endif 36#endif
diff --git a/arch/arm/mach-cns3xxx/include/mach/memory.h b/arch/arm/mach-cns3xxx/include/mach/memory.h
index 3b6b769b7a27..dc16c5c5d86b 100644
--- a/arch/arm/mach-cns3xxx/include/mach/memory.h
+++ b/arch/arm/mach-cns3xxx/include/mach/memory.h
@@ -13,7 +13,7 @@
13/* 13/*
14 * Physical DRAM offset. 14 * Physical DRAM offset.
15 */ 15 */
16#define PHYS_OFFSET UL(0x00000000) 16#define PLAT_PHYS_OFFSET UL(0x00000000)
17 17
18#define __phys_to_bus(x) ((x) + PHYS_OFFSET) 18#define __phys_to_bus(x) ((x) + PHYS_OFFSET)
19#define __bus_to_phys(x) ((x) - PHYS_OFFSET) 19#define __bus_to_phys(x) ((x) - PHYS_OFFSET)
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index b52a3a1abd94..8bc3701aa05c 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -20,6 +20,8 @@
20#include <linux/i2c/at24.h> 20#include <linux/i2c/at24.h>
21#include <linux/mtd/mtd.h> 21#include <linux/mtd/mtd.h>
22#include <linux/mtd/partitions.h> 22#include <linux/mtd/partitions.h>
23#include <linux/spi/spi.h>
24#include <linux/spi/flash.h>
23 25
24#include <asm/mach-types.h> 26#include <asm/mach-types.h>
25#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
@@ -30,6 +32,7 @@
30#include <mach/da8xx.h> 32#include <mach/da8xx.h>
31#include <mach/usb.h> 33#include <mach/usb.h>
32#include <mach/aemif.h> 34#include <mach/aemif.h>
35#include <mach/spi.h>
33 36
34#define DA830_EVM_PHY_ID "" 37#define DA830_EVM_PHY_ID ""
35/* 38/*
@@ -534,6 +537,64 @@ static struct edma_rsv_info da830_edma_rsv[] = {
534 }, 537 },
535}; 538};
536 539
540static struct mtd_partition da830evm_spiflash_part[] = {
541 [0] = {
542 .name = "DSP-UBL",
543 .offset = 0,
544 .size = SZ_8K,
545 .mask_flags = MTD_WRITEABLE,
546 },
547 [1] = {
548 .name = "ARM-UBL",
549 .offset = MTDPART_OFS_APPEND,
550 .size = SZ_16K + SZ_8K,
551 .mask_flags = MTD_WRITEABLE,
552 },
553 [2] = {
554 .name = "U-Boot",
555 .offset = MTDPART_OFS_APPEND,
556 .size = SZ_256K - SZ_32K,
557 .mask_flags = MTD_WRITEABLE,
558 },
559 [3] = {
560 .name = "U-Boot-Environment",
561 .offset = MTDPART_OFS_APPEND,
562 .size = SZ_16K,
563 .mask_flags = 0,
564 },
565 [4] = {
566 .name = "Kernel",
567 .offset = MTDPART_OFS_APPEND,
568 .size = MTDPART_SIZ_FULL,
569 .mask_flags = 0,
570 },
571};
572
573static struct flash_platform_data da830evm_spiflash_data = {
574 .name = "m25p80",
575 .parts = da830evm_spiflash_part,
576 .nr_parts = ARRAY_SIZE(da830evm_spiflash_part),
577 .type = "w25x32",
578};
579
580static struct davinci_spi_config da830evm_spiflash_cfg = {
581 .io_type = SPI_IO_TYPE_DMA,
582 .c2tdelay = 8,
583 .t2cdelay = 8,
584};
585
586static struct spi_board_info da830evm_spi_info[] = {
587 {
588 .modalias = "m25p80",
589 .platform_data = &da830evm_spiflash_data,
590 .controller_data = &da830evm_spiflash_cfg,
591 .mode = SPI_MODE_0,
592 .max_speed_hz = 30000000,
593 .bus_num = 0,
594 .chip_select = 0,
595 },
596};
597
537static __init void da830_evm_init(void) 598static __init void da830_evm_init(void)
538{ 599{
539 struct davinci_soc_info *soc_info = &davinci_soc_info; 600 struct davinci_soc_info *soc_info = &davinci_soc_info;
@@ -590,6 +651,12 @@ static __init void da830_evm_init(void)
590 ret = da8xx_register_rtc(); 651 ret = da8xx_register_rtc();
591 if (ret) 652 if (ret)
592 pr_warning("da830_evm_init: rtc setup failed: %d\n", ret); 653 pr_warning("da830_evm_init: rtc setup failed: %d\n", ret);
654
655 ret = da8xx_register_spi(0, da830evm_spi_info,
656 ARRAY_SIZE(da830evm_spi_info));
657 if (ret)
658 pr_warning("da830_evm_init: spi 0 registration failed: %d\n",
659 ret);
593} 660}
594 661
595#ifdef CONFIG_SERIAL_8250_CONSOLE 662#ifdef CONFIG_SERIAL_8250_CONSOLE
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index b01fb2ab944a..a7b41bf505f1 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -29,6 +29,8 @@
29#include <linux/regulator/machine.h> 29#include <linux/regulator/machine.h>
30#include <linux/regulator/tps6507x.h> 30#include <linux/regulator/tps6507x.h>
31#include <linux/input/tps6507x-ts.h> 31#include <linux/input/tps6507x-ts.h>
32#include <linux/spi/spi.h>
33#include <linux/spi/flash.h>
32 34
33#include <asm/mach-types.h> 35#include <asm/mach-types.h>
34#include <asm/mach/arch.h> 36#include <asm/mach/arch.h>
@@ -38,6 +40,7 @@
38#include <mach/nand.h> 40#include <mach/nand.h>
39#include <mach/mux.h> 41#include <mach/mux.h>
40#include <mach/aemif.h> 42#include <mach/aemif.h>
43#include <mach/spi.h>
41 44
42#define DA850_EVM_PHY_ID "0:00" 45#define DA850_EVM_PHY_ID "0:00"
43#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8) 46#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8)
@@ -48,6 +51,70 @@
48 51
49#define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6) 52#define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6)
50 53
54static struct mtd_partition da850evm_spiflash_part[] = {
55 [0] = {
56 .name = "UBL",
57 .offset = 0,
58 .size = SZ_64K,
59 .mask_flags = MTD_WRITEABLE,
60 },
61 [1] = {
62 .name = "U-Boot",
63 .offset = MTDPART_OFS_APPEND,
64 .size = SZ_512K,
65 .mask_flags = MTD_WRITEABLE,
66 },
67 [2] = {
68 .name = "U-Boot-Env",
69 .offset = MTDPART_OFS_APPEND,
70 .size = SZ_64K,
71 .mask_flags = MTD_WRITEABLE,
72 },
73 [3] = {
74 .name = "Kernel",
75 .offset = MTDPART_OFS_APPEND,
76 .size = SZ_2M + SZ_512K,
77 .mask_flags = 0,
78 },
79 [4] = {
80 .name = "Filesystem",
81 .offset = MTDPART_OFS_APPEND,
82 .size = SZ_4M,
83 .mask_flags = 0,
84 },
85 [5] = {
86 .name = "MAC-Address",
87 .offset = SZ_8M - SZ_64K,
88 .size = SZ_64K,
89 .mask_flags = MTD_WRITEABLE,
90 },
91};
92
93static struct flash_platform_data da850evm_spiflash_data = {
94 .name = "m25p80",
95 .parts = da850evm_spiflash_part,
96 .nr_parts = ARRAY_SIZE(da850evm_spiflash_part),
97 .type = "m25p64",
98};
99
100static struct davinci_spi_config da850evm_spiflash_cfg = {
101 .io_type = SPI_IO_TYPE_DMA,
102 .c2tdelay = 8,
103 .t2cdelay = 8,
104};
105
106static struct spi_board_info da850evm_spi_info[] = {
107 {
108 .modalias = "m25p80",
109 .platform_data = &da850evm_spiflash_data,
110 .controller_data = &da850evm_spiflash_cfg,
111 .mode = SPI_MODE_0,
112 .max_speed_hz = 30000000,
113 .bus_num = 1,
114 .chip_select = 0,
115 },
116};
117
51static struct mtd_partition da850_evm_norflash_partition[] = { 118static struct mtd_partition da850_evm_norflash_partition[] = {
52 { 119 {
53 .name = "bootloaders + env", 120 .name = "bootloaders + env",
@@ -231,8 +298,6 @@ static const short da850_evm_nor_pins[] = {
231 -1 298 -1
232}; 299};
233 300
234static u32 ui_card_detected;
235
236#if defined(CONFIG_MMC_DAVINCI) || \ 301#if defined(CONFIG_MMC_DAVINCI) || \
237 defined(CONFIG_MMC_DAVINCI_MODULE) 302 defined(CONFIG_MMC_DAVINCI_MODULE)
238#define HAS_MMC 1 303#define HAS_MMC 1
@@ -244,7 +309,7 @@ static inline void da850_evm_setup_nor_nand(void)
244{ 309{
245 int ret = 0; 310 int ret = 0;
246 311
247 if (ui_card_detected & !HAS_MMC) { 312 if (!HAS_MMC) {
248 ret = davinci_cfg_reg_list(da850_evm_nand_pins); 313 ret = davinci_cfg_reg_list(da850_evm_nand_pins);
249 if (ret) 314 if (ret)
250 pr_warning("da850_evm_init: nand mux setup failed: " 315 pr_warning("da850_evm_init: nand mux setup failed: "
@@ -394,7 +459,6 @@ static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio,
394 goto exp_setup_keys_fail; 459 goto exp_setup_keys_fail;
395 } 460 }
396 461
397 ui_card_detected = 1;
398 pr_info("DA850/OMAP-L138 EVM UI card detected\n"); 462 pr_info("DA850/OMAP-L138 EVM UI card detected\n");
399 463
400 da850_evm_setup_nor_nand(); 464 da850_evm_setup_nor_nand();
@@ -664,6 +728,13 @@ static struct snd_platform_data da850_evm_snd_data = {
664 .rxnumevt = 1, 728 .rxnumevt = 1,
665}; 729};
666 730
731static const short da850_evm_mcasp_pins[] __initconst = {
732 DA850_AHCLKX, DA850_ACLKX, DA850_AFSX,
733 DA850_AHCLKR, DA850_ACLKR, DA850_AFSR, DA850_AMUTE,
734 DA850_AXR_11, DA850_AXR_12,
735 -1
736};
737
667static int da850_evm_mmc_get_ro(int index) 738static int da850_evm_mmc_get_ro(int index)
668{ 739{
669 return gpio_get_value(DA850_MMCSD_WP_PIN); 740 return gpio_get_value(DA850_MMCSD_WP_PIN);
@@ -683,6 +754,13 @@ static struct davinci_mmc_config da850_mmc_config = {
683 .version = MMC_CTLR_VERSION_2, 754 .version = MMC_CTLR_VERSION_2,
684}; 755};
685 756
757static const short da850_evm_mmcsd0_pins[] __initconst = {
758 DA850_MMCSD0_DAT_0, DA850_MMCSD0_DAT_1, DA850_MMCSD0_DAT_2,
759 DA850_MMCSD0_DAT_3, DA850_MMCSD0_CLK, DA850_MMCSD0_CMD,
760 DA850_GPIO4_0, DA850_GPIO4_1,
761 -1
762};
763
686static void da850_panel_power_ctrl(int val) 764static void da850_panel_power_ctrl(int val)
687{ 765{
688 /* lcd backlight */ 766 /* lcd backlight */
@@ -1070,7 +1148,7 @@ static __init void da850_evm_init(void)
1070 ret); 1148 ret);
1071 1149
1072 if (HAS_MMC) { 1150 if (HAS_MMC) {
1073 ret = davinci_cfg_reg_list(da850_mmcsd0_pins); 1151 ret = davinci_cfg_reg_list(da850_evm_mmcsd0_pins);
1074 if (ret) 1152 if (ret)
1075 pr_warning("da850_evm_init: mmcsd0 mux setup failed:" 1153 pr_warning("da850_evm_init: mmcsd0 mux setup failed:"
1076 " %d\n", ret); 1154 " %d\n", ret);
@@ -1106,7 +1184,7 @@ static __init void da850_evm_init(void)
1106 __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30); 1184 __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);
1107 __raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30); 1185 __raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30);
1108 1186
1109 ret = davinci_cfg_reg_list(da850_mcasp_pins); 1187 ret = davinci_cfg_reg_list(da850_evm_mcasp_pins);
1110 if (ret) 1188 if (ret)
1111 pr_warning("da850_evm_init: mcasp mux setup failed: %d\n", 1189 pr_warning("da850_evm_init: mcasp mux setup failed: %d\n",
1112 ret); 1190 ret);
@@ -1153,6 +1231,12 @@ static __init void da850_evm_init(void)
1153 if (ret) 1231 if (ret)
1154 pr_warning("da850_evm_init: suspend registration failed: %d\n", 1232 pr_warning("da850_evm_init: suspend registration failed: %d\n",
1155 ret); 1233 ret);
1234
1235 ret = da8xx_register_spi(1, da850evm_spi_info,
1236 ARRAY_SIZE(da850evm_spi_info));
1237 if (ret)
1238 pr_warning("da850_evm_init: spi 1 registration failed: %d\n",
1239 ret);
1156} 1240}
1157 1241
1158#ifdef CONFIG_SERIAL_8250_CONSOLE 1242#ifdef CONFIG_SERIAL_8250_CONSOLE
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 0ca90b834586..556bbd468db3 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -440,11 +440,6 @@ evm_u35_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
440 gpio_request(gpio + 7, "nCF_SEL"); 440 gpio_request(gpio + 7, "nCF_SEL");
441 gpio_direction_output(gpio + 7, 1); 441 gpio_direction_output(gpio + 7, 1);
442 442
443 /* irlml6401 switches over 1A, in under 8 msec;
444 * now it can be managed by nDRV_VBUS ...
445 */
446 davinci_setup_usb(1000, 8);
447
448 return 0; 443 return 0;
449} 444}
450 445
@@ -705,6 +700,9 @@ static __init void davinci_evm_init(void)
705 davinci_serial_init(&uart_config); 700 davinci_serial_init(&uart_config);
706 dm644x_init_asp(&dm644x_evm_snd_data); 701 dm644x_init_asp(&dm644x_evm_snd_data);
707 702
703 /* irlml6401 switches over 1A, in under 8 msec */
704 davinci_setup_usb(1000, 8);
705
708 soc_info->emac_pdata->phy_id = DM644X_EVM_PHY_ID; 706 soc_info->emac_pdata->phy_id = DM644X_EVM_PHY_ID;
709 /* Register the fixup for PHY on DaVinci */ 707 /* Register the fixup for PHY on DaVinci */
710 phy_register_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK, 708 phy_register_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK,
diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c
index 0bb5f0ce4fdc..2aa79c54f98e 100644
--- a/arch/arm/mach-davinci/board-mityomapl138.c
+++ b/arch/arm/mach-davinci/board-mityomapl138.c
@@ -17,6 +17,8 @@
17#include <linux/i2c.h> 17#include <linux/i2c.h>
18#include <linux/i2c/at24.h> 18#include <linux/i2c/at24.h>
19#include <linux/etherdevice.h> 19#include <linux/etherdevice.h>
20#include <linux/spi/spi.h>
21#include <linux/spi/flash.h>
20 22
21#include <asm/mach-types.h> 23#include <asm/mach-types.h>
22#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
@@ -25,6 +27,7 @@
25#include <mach/da8xx.h> 27#include <mach/da8xx.h>
26#include <mach/nand.h> 28#include <mach/nand.h>
27#include <mach/mux.h> 29#include <mach/mux.h>
30#include <mach/spi.h>
28 31
29#define MITYOMAPL138_PHY_ID "0:03" 32#define MITYOMAPL138_PHY_ID "0:03"
30 33
@@ -44,38 +47,109 @@ struct factory_config {
44 47
45static struct factory_config factory_config; 48static struct factory_config factory_config;
46 49
50struct part_no_info {
51 const char *part_no; /* part number string of interest */
52 int max_freq; /* khz */
53};
54
55static struct part_no_info mityomapl138_pn_info[] = {
56 {
57 .part_no = "L138-C",
58 .max_freq = 300000,
59 },
60 {
61 .part_no = "L138-D",
62 .max_freq = 375000,
63 },
64 {
65 .part_no = "L138-F",
66 .max_freq = 456000,
67 },
68 {
69 .part_no = "1808-C",
70 .max_freq = 300000,
71 },
72 {
73 .part_no = "1808-D",
74 .max_freq = 375000,
75 },
76 {
77 .part_no = "1808-F",
78 .max_freq = 456000,
79 },
80 {
81 .part_no = "1810-D",
82 .max_freq = 375000,
83 },
84};
85
86#ifdef CONFIG_CPU_FREQ
87static void mityomapl138_cpufreq_init(const char *partnum)
88{
89 int i, ret;
90
91 for (i = 0; partnum && i < ARRAY_SIZE(mityomapl138_pn_info); i++) {
92 /*
93 * the part number has additional characters beyond what is
94 * stored in the table. This information is not needed for
95 * determining the speed grade, and would require several
96 * more table entries. Only check the first N characters
97 * for a match.
98 */
99 if (!strncmp(partnum, mityomapl138_pn_info[i].part_no,
100 strlen(mityomapl138_pn_info[i].part_no))) {
101 da850_max_speed = mityomapl138_pn_info[i].max_freq;
102 break;
103 }
104 }
105
106 ret = da850_register_cpufreq("pll0_sysclk3");
107 if (ret)
108 pr_warning("cpufreq registration failed: %d\n", ret);
109}
110#else
111static void mityomapl138_cpufreq_init(const char *partnum) { }
112#endif
113
47static void read_factory_config(struct memory_accessor *a, void *context) 114static void read_factory_config(struct memory_accessor *a, void *context)
48{ 115{
49 int ret; 116 int ret;
117 const char *partnum = NULL;
50 struct davinci_soc_info *soc_info = &davinci_soc_info; 118 struct davinci_soc_info *soc_info = &davinci_soc_info;
51 119
52 ret = a->read(a, (char *)&factory_config, 0, sizeof(factory_config)); 120 ret = a->read(a, (char *)&factory_config, 0, sizeof(factory_config));
53 if (ret != sizeof(struct factory_config)) { 121 if (ret != sizeof(struct factory_config)) {
54 pr_warning("MityOMAPL138: Read Factory Config Failed: %d\n", 122 pr_warning("MityOMAPL138: Read Factory Config Failed: %d\n",
55 ret); 123 ret);
56 return; 124 goto bad_config;
57 } 125 }
58 126
59 if (factory_config.magic != FACTORY_CONFIG_MAGIC) { 127 if (factory_config.magic != FACTORY_CONFIG_MAGIC) {
60 pr_warning("MityOMAPL138: Factory Config Magic Wrong (%X)\n", 128 pr_warning("MityOMAPL138: Factory Config Magic Wrong (%X)\n",
61 factory_config.magic); 129 factory_config.magic);
62 return; 130 goto bad_config;
63 } 131 }
64 132
65 if (factory_config.version != FACTORY_CONFIG_VERSION) { 133 if (factory_config.version != FACTORY_CONFIG_VERSION) {
66 pr_warning("MityOMAPL138: Factory Config Version Wrong (%X)\n", 134 pr_warning("MityOMAPL138: Factory Config Version Wrong (%X)\n",
67 factory_config.version); 135 factory_config.version);
68 return; 136 goto bad_config;
69 } 137 }
70 138
71 pr_info("MityOMAPL138: Found MAC = %pM\n", factory_config.mac); 139 pr_info("MityOMAPL138: Found MAC = %pM\n", factory_config.mac);
72 pr_info("MityOMAPL138: Part Number = %s\n", factory_config.partnum);
73 if (is_valid_ether_addr(factory_config.mac)) 140 if (is_valid_ether_addr(factory_config.mac))
74 memcpy(soc_info->emac_pdata->mac_addr, 141 memcpy(soc_info->emac_pdata->mac_addr,
75 factory_config.mac, ETH_ALEN); 142 factory_config.mac, ETH_ALEN);
76 else 143 else
77 pr_warning("MityOMAPL138: Invalid MAC found " 144 pr_warning("MityOMAPL138: Invalid MAC found "
78 "in factory config block\n"); 145 "in factory config block\n");
146
147 partnum = factory_config.partnum;
148 pr_info("MityOMAPL138: Part Number = %s\n", partnum);
149
150bad_config:
151 /* default maximum speed is valid for all platforms */
152 mityomapl138_cpufreq_init(partnum);
79} 153}
80 154
81static struct at24_platform_data mityomapl138_fd_chip = { 155static struct at24_platform_data mityomapl138_fd_chip = {
@@ -223,6 +297,82 @@ static int __init pmic_tps65023_init(void)
223} 297}
224 298
225/* 299/*
300 * SPI Devices:
301 * SPI1_CS0: 8M Flash ST-M25P64-VME6G
302 */
303static struct mtd_partition spi_flash_partitions[] = {
304 [0] = {
305 .name = "ubl",
306 .offset = 0,
307 .size = SZ_64K,
308 .mask_flags = MTD_WRITEABLE,
309 },
310 [1] = {
311 .name = "u-boot",
312 .offset = MTDPART_OFS_APPEND,
313 .size = SZ_512K,
314 .mask_flags = MTD_WRITEABLE,
315 },
316 [2] = {
317 .name = "u-boot-env",
318 .offset = MTDPART_OFS_APPEND,
319 .size = SZ_64K,
320 .mask_flags = MTD_WRITEABLE,
321 },
322 [3] = {
323 .name = "periph-config",
324 .offset = MTDPART_OFS_APPEND,
325 .size = SZ_64K,
326 .mask_flags = MTD_WRITEABLE,
327 },
328 [4] = {
329 .name = "reserved",
330 .offset = MTDPART_OFS_APPEND,
331 .size = SZ_256K + SZ_64K,
332 },
333 [5] = {
334 .name = "kernel",
335 .offset = MTDPART_OFS_APPEND,
336 .size = SZ_2M + SZ_1M,
337 },
338 [6] = {
339 .name = "fpga",
340 .offset = MTDPART_OFS_APPEND,
341 .size = SZ_2M,
342 },
343 [7] = {
344 .name = "spare",
345 .offset = MTDPART_OFS_APPEND,
346 .size = MTDPART_SIZ_FULL,
347 },
348};
349
350static struct flash_platform_data mityomapl138_spi_flash_data = {
351 .name = "m25p80",
352 .parts = spi_flash_partitions,
353 .nr_parts = ARRAY_SIZE(spi_flash_partitions),
354 .type = "m24p64",
355};
356
357static struct davinci_spi_config spi_eprom_config = {
358 .io_type = SPI_IO_TYPE_DMA,
359 .c2tdelay = 8,
360 .t2cdelay = 8,
361};
362
363static struct spi_board_info mityomapl138_spi_flash_info[] = {
364 {
365 .modalias = "m25p80",
366 .platform_data = &mityomapl138_spi_flash_data,
367 .controller_data = &spi_eprom_config,
368 .mode = SPI_MODE_0,
369 .max_speed_hz = 30000000,
370 .bus_num = 1,
371 .chip_select = 0,
372 },
373};
374
375/*
226 * MityDSP-L138 includes a 256 MByte large-page NAND flash 376 * MityDSP-L138 includes a 256 MByte large-page NAND flash
227 * (128K blocks). 377 * (128K blocks).
228 */ 378 */
@@ -377,16 +527,17 @@ static void __init mityomapl138_init(void)
377 527
378 mityomapl138_setup_nand(); 528 mityomapl138_setup_nand();
379 529
530 ret = da8xx_register_spi(1, mityomapl138_spi_flash_info,
531 ARRAY_SIZE(mityomapl138_spi_flash_info));
532 if (ret)
533 pr_warning("spi 1 registration failed: %d\n", ret);
534
380 mityomapl138_config_emac(); 535 mityomapl138_config_emac();
381 536
382 ret = da8xx_register_rtc(); 537 ret = da8xx_register_rtc();
383 if (ret) 538 if (ret)
384 pr_warning("rtc setup failed: %d\n", ret); 539 pr_warning("rtc setup failed: %d\n", ret);
385 540
386 ret = da850_register_cpufreq("pll0_sysclk3");
387 if (ret)
388 pr_warning("cpufreq registration failed: %d\n", ret);
389
390 ret = da8xx_register_cpuidle(); 541 ret = da8xx_register_cpuidle();
391 if (ret) 542 if (ret)
392 pr_warning("cpuidle registration failed: %d\n", ret); 543 pr_warning("cpuidle registration failed: %d\n", ret);
diff --git a/arch/arm/mach-davinci/board-omapl138-hawk.c b/arch/arm/mach-davinci/board-omapl138-hawk.c
index 0b8dbdb79fe0..67c38d0ecd10 100644
--- a/arch/arm/mach-davinci/board-omapl138-hawk.c
+++ b/arch/arm/mach-davinci/board-omapl138-hawk.c
@@ -19,6 +19,279 @@
19 19
20#include <mach/cp_intc.h> 20#include <mach/cp_intc.h>
21#include <mach/da8xx.h> 21#include <mach/da8xx.h>
22#include <mach/mux.h>
23
24#define HAWKBOARD_PHY_ID "0:07"
25#define DA850_HAWK_MMCSD_CD_PIN GPIO_TO_PIN(3, 12)
26#define DA850_HAWK_MMCSD_WP_PIN GPIO_TO_PIN(3, 13)
27
28#define DA850_USB1_VBUS_PIN GPIO_TO_PIN(2, 4)
29#define DA850_USB1_OC_PIN GPIO_TO_PIN(6, 13)
30
31static short omapl138_hawk_mii_pins[] __initdata = {
32 DA850_MII_TXEN, DA850_MII_TXCLK, DA850_MII_COL, DA850_MII_TXD_3,
33 DA850_MII_TXD_2, DA850_MII_TXD_1, DA850_MII_TXD_0, DA850_MII_RXER,
34 DA850_MII_CRS, DA850_MII_RXCLK, DA850_MII_RXDV, DA850_MII_RXD_3,
35 DA850_MII_RXD_2, DA850_MII_RXD_1, DA850_MII_RXD_0, DA850_MDIO_CLK,
36 DA850_MDIO_D,
37 -1
38};
39
40static __init void omapl138_hawk_config_emac(void)
41{
42 void __iomem *cfgchip3 = DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG);
43 int ret;
44 u32 val;
45 struct davinci_soc_info *soc_info = &davinci_soc_info;
46
47 val = __raw_readl(cfgchip3);
48 val &= ~BIT(8);
49 ret = davinci_cfg_reg_list(omapl138_hawk_mii_pins);
50 if (ret) {
51 pr_warning("%s: cpgmac/mii mux setup failed: %d\n",
52 __func__, ret);
53 return;
54 }
55
56 /* configure the CFGCHIP3 register for MII */
57 __raw_writel(val, cfgchip3);
58 pr_info("EMAC: MII PHY configured\n");
59
60 soc_info->emac_pdata->phy_id = HAWKBOARD_PHY_ID;
61
62 ret = da8xx_register_emac();
63 if (ret)
64 pr_warning("%s: emac registration failed: %d\n",
65 __func__, ret);
66}
67
68/*
69 * The following EDMA channels/slots are not being used by drivers (for
70 * example: Timer, GPIO, UART events etc) on da850/omap-l138 EVM/Hawkboard,
71 * hence they are being reserved for codecs on the DSP side.
72 */
73static const s16 da850_dma0_rsv_chans[][2] = {
74 /* (offset, number) */
75 { 8, 6},
76 {24, 4},
77 {30, 2},
78 {-1, -1}
79};
80
81static const s16 da850_dma0_rsv_slots[][2] = {
82 /* (offset, number) */
83 { 8, 6},
84 {24, 4},
85 {30, 50},
86 {-1, -1}
87};
88
89static const s16 da850_dma1_rsv_chans[][2] = {
90 /* (offset, number) */
91 { 0, 28},
92 {30, 2},
93 {-1, -1}
94};
95
96static const s16 da850_dma1_rsv_slots[][2] = {
97 /* (offset, number) */
98 { 0, 28},
99 {30, 90},
100 {-1, -1}
101};
102
103static struct edma_rsv_info da850_edma_cc0_rsv = {
104 .rsv_chans = da850_dma0_rsv_chans,
105 .rsv_slots = da850_dma0_rsv_slots,
106};
107
108static struct edma_rsv_info da850_edma_cc1_rsv = {
109 .rsv_chans = da850_dma1_rsv_chans,
110 .rsv_slots = da850_dma1_rsv_slots,
111};
112
113static struct edma_rsv_info *da850_edma_rsv[2] = {
114 &da850_edma_cc0_rsv,
115 &da850_edma_cc1_rsv,
116};
117
118static const short hawk_mmcsd0_pins[] = {
119 DA850_MMCSD0_DAT_0, DA850_MMCSD0_DAT_1, DA850_MMCSD0_DAT_2,
120 DA850_MMCSD0_DAT_3, DA850_MMCSD0_CLK, DA850_MMCSD0_CMD,
121 DA850_GPIO3_12, DA850_GPIO3_13,
122 -1
123};
124
125static int da850_hawk_mmc_get_ro(int index)
126{
127 return gpio_get_value(DA850_HAWK_MMCSD_WP_PIN);
128}
129
130static int da850_hawk_mmc_get_cd(int index)
131{
132 return !gpio_get_value(DA850_HAWK_MMCSD_CD_PIN);
133}
134
135static struct davinci_mmc_config da850_mmc_config = {
136 .get_ro = da850_hawk_mmc_get_ro,
137 .get_cd = da850_hawk_mmc_get_cd,
138 .wires = 4,
139 .max_freq = 50000000,
140 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
141 .version = MMC_CTLR_VERSION_2,
142};
143
144static __init void omapl138_hawk_mmc_init(void)
145{
146 int ret;
147
148 ret = davinci_cfg_reg_list(hawk_mmcsd0_pins);
149 if (ret) {
150 pr_warning("%s: MMC/SD0 mux setup failed: %d\n",
151 __func__, ret);
152 return;
153 }
154
155 ret = gpio_request_one(DA850_HAWK_MMCSD_CD_PIN,
156 GPIOF_DIR_IN, "MMC CD");
157 if (ret < 0) {
158 pr_warning("%s: can not open GPIO %d\n",
159 __func__, DA850_HAWK_MMCSD_CD_PIN);
160 return;
161 }
162
163 ret = gpio_request_one(DA850_HAWK_MMCSD_WP_PIN,
164 GPIOF_DIR_IN, "MMC WP");
165 if (ret < 0) {
166 pr_warning("%s: can not open GPIO %d\n",
167 __func__, DA850_HAWK_MMCSD_WP_PIN);
168 goto mmc_setup_wp_fail;
169 }
170
171 ret = da8xx_register_mmcsd0(&da850_mmc_config);
172 if (ret) {
173 pr_warning("%s: MMC/SD0 registration failed: %d\n",
174 __func__, ret);
175 goto mmc_setup_mmcsd_fail;
176 }
177
178 return;
179
180mmc_setup_mmcsd_fail:
181 gpio_free(DA850_HAWK_MMCSD_WP_PIN);
182mmc_setup_wp_fail:
183 gpio_free(DA850_HAWK_MMCSD_CD_PIN);
184}
185
186static irqreturn_t omapl138_hawk_usb_ocic_irq(int irq, void *dev_id);
187static da8xx_ocic_handler_t hawk_usb_ocic_handler;
188
189static const short da850_hawk_usb11_pins[] = {
190 DA850_GPIO2_4, DA850_GPIO6_13,
191 -1
192};
193
194static int hawk_usb_set_power(unsigned port, int on)
195{
196 gpio_set_value(DA850_USB1_VBUS_PIN, on);
197 return 0;
198}
199
200static int hawk_usb_get_power(unsigned port)
201{
202 return gpio_get_value(DA850_USB1_VBUS_PIN);
203}
204
205static int hawk_usb_get_oci(unsigned port)
206{
207 return !gpio_get_value(DA850_USB1_OC_PIN);
208}
209
210static int hawk_usb_ocic_notify(da8xx_ocic_handler_t handler)
211{
212 int irq = gpio_to_irq(DA850_USB1_OC_PIN);
213 int error = 0;
214
215 if (handler != NULL) {
216 hawk_usb_ocic_handler = handler;
217
218 error = request_irq(irq, omapl138_hawk_usb_ocic_irq,
219 IRQF_DISABLED | IRQF_TRIGGER_RISING |
220 IRQF_TRIGGER_FALLING,
221 "OHCI over-current indicator", NULL);
222 if (error)
223 pr_err("%s: could not request IRQ to watch "
224 "over-current indicator changes\n", __func__);
225 } else {
226 free_irq(irq, NULL);
227 }
228 return error;
229}
230
231static struct da8xx_ohci_root_hub omapl138_hawk_usb11_pdata = {
232 .set_power = hawk_usb_set_power,
233 .get_power = hawk_usb_get_power,
234 .get_oci = hawk_usb_get_oci,
235 .ocic_notify = hawk_usb_ocic_notify,
236 /* TPS2087 switch @ 5V */
237 .potpgt = (3 + 1) / 2, /* 3 ms max */
238};
239
240static irqreturn_t omapl138_hawk_usb_ocic_irq(int irq, void *dev_id)
241{
242 hawk_usb_ocic_handler(&omapl138_hawk_usb11_pdata, 1);
243 return IRQ_HANDLED;
244}
245
246static __init void omapl138_hawk_usb_init(void)
247{
248 int ret;
249 u32 cfgchip2;
250
251 ret = davinci_cfg_reg_list(da850_hawk_usb11_pins);
252 if (ret) {
253 pr_warning("%s: USB 1.1 PinMux setup failed: %d\n",
254 __func__, ret);
255 return;
256 }
257
258 /* Setup the Ref. clock frequency for the HAWK at 24 MHz. */
259
260 cfgchip2 = __raw_readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG));
261 cfgchip2 &= ~CFGCHIP2_REFFREQ;
262 cfgchip2 |= CFGCHIP2_REFFREQ_24MHZ;
263 __raw_writel(cfgchip2, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG));
264
265 ret = gpio_request_one(DA850_USB1_VBUS_PIN,
266 GPIOF_DIR_OUT, "USB1 VBUS");
267 if (ret < 0) {
268 pr_err("%s: failed to request GPIO for USB 1.1 port "
269 "power control: %d\n", __func__, ret);
270 return;
271 }
272
273 ret = gpio_request_one(DA850_USB1_OC_PIN,
274 GPIOF_DIR_IN, "USB1 OC");
275 if (ret < 0) {
276 pr_err("%s: failed to request GPIO for USB 1.1 port "
277 "over-current indicator: %d\n", __func__, ret);
278 goto usb11_setup_oc_fail;
279 }
280
281 ret = da8xx_register_usb11(&omapl138_hawk_usb11_pdata);
282 if (ret) {
283 pr_warning("%s: USB 1.1 registration failed: %d\n",
284 __func__, ret);
285 goto usb11_setup_fail;
286 }
287
288 return;
289
290usb11_setup_fail:
291 gpio_free(DA850_USB1_OC_PIN);
292usb11_setup_oc_fail:
293 gpio_free(DA850_USB1_VBUS_PIN);
294}
22 295
23static struct davinci_uart_config omapl138_hawk_uart_config __initdata = { 296static struct davinci_uart_config omapl138_hawk_uart_config __initdata = {
24 .enabled_uarts = 0x7, 297 .enabled_uarts = 0x7,
@@ -30,6 +303,17 @@ static __init void omapl138_hawk_init(void)
30 303
31 davinci_serial_init(&omapl138_hawk_uart_config); 304 davinci_serial_init(&omapl138_hawk_uart_config);
32 305
306 omapl138_hawk_config_emac();
307
308 ret = da850_register_edma(da850_edma_rsv);
309 if (ret)
310 pr_warning("%s: EDMA registration failed: %d\n",
311 __func__, ret);
312
313 omapl138_hawk_mmc_init();
314
315 omapl138_hawk_usb_init();
316
33 ret = da8xx_register_watchdog(); 317 ret = da8xx_register_watchdog();
34 if (ret) 318 if (ret)
35 pr_warning("omapl138_hawk_init: " 319 pr_warning("omapl138_hawk_init: "
diff --git a/arch/arm/mach-davinci/board-tnetv107x-evm.c b/arch/arm/mach-davinci/board-tnetv107x-evm.c
index a6db85460227..1a656e882262 100644
--- a/arch/arm/mach-davinci/board-tnetv107x-evm.c
+++ b/arch/arm/mach-davinci/board-tnetv107x-evm.c
@@ -25,6 +25,7 @@
25#include <linux/mtd/partitions.h> 25#include <linux/mtd/partitions.h>
26#include <linux/input.h> 26#include <linux/input.h>
27#include <linux/input/matrix_keypad.h> 27#include <linux/input/matrix_keypad.h>
28#include <linux/spi/spi.h>
28 29
29#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
30#include <asm/mach-types.h> 31#include <asm/mach-types.h>
@@ -37,6 +38,7 @@
37 38
38#define EVM_MMC_WP_GPIO 21 39#define EVM_MMC_WP_GPIO 21
39#define EVM_MMC_CD_GPIO 24 40#define EVM_MMC_CD_GPIO 24
41#define EVM_SPI_CS_GPIO 54
40 42
41static int initialize_gpio(int gpio, char *desc) 43static int initialize_gpio(int gpio, char *desc)
42{ 44{
@@ -99,6 +101,12 @@ static const short uart1_pins[] __initdata = {
99 -1 101 -1
100}; 102};
101 103
104static const short ssp_pins[] __initdata = {
105 TNETV107X_SSP0_0, TNETV107X_SSP0_1, TNETV107X_SSP0_2,
106 TNETV107X_SSP1_0, TNETV107X_SSP1_1, TNETV107X_SSP1_2,
107 TNETV107X_SSP1_3, -1
108};
109
102static struct mtd_partition nand_partitions[] = { 110static struct mtd_partition nand_partitions[] = {
103 /* bootloader (U-Boot, etc) in first 12 sectors */ 111 /* bootloader (U-Boot, etc) in first 12 sectors */
104 { 112 {
@@ -196,19 +204,68 @@ static struct matrix_keypad_platform_data keypad_config = {
196 .no_autorepeat = 0, 204 .no_autorepeat = 0,
197}; 205};
198 206
207static void spi_select_device(int cs)
208{
209 static int gpio;
210
211 if (!gpio) {
212 int ret;
213 ret = gpio_request(EVM_SPI_CS_GPIO, "spi chipsel");
214 if (ret < 0) {
215 pr_err("cannot open spi chipsel gpio\n");
216 gpio = -ENOSYS;
217 return;
218 } else {
219 gpio = EVM_SPI_CS_GPIO;
220 gpio_direction_output(gpio, 0);
221 }
222 }
223
224 if (gpio < 0)
225 return;
226
227 return gpio_set_value(gpio, cs ? 1 : 0);
228}
229
230static struct ti_ssp_spi_data spi_master_data = {
231 .num_cs = 2,
232 .select = spi_select_device,
233 .iosel = SSP_PIN_SEL(0, SSP_CLOCK) | SSP_PIN_SEL(1, SSP_DATA) |
234 SSP_PIN_SEL(2, SSP_CHIPSEL) | SSP_PIN_SEL(3, SSP_IN) |
235 SSP_INPUT_SEL(3),
236};
237
238static struct ti_ssp_data ssp_config = {
239 .out_clock = 250 * 1000,
240 .dev_data = {
241 [1] = {
242 .dev_name = "ti-ssp-spi",
243 .pdata = &spi_master_data,
244 .pdata_size = sizeof(spi_master_data),
245 },
246 },
247};
248
199static struct tnetv107x_device_info evm_device_info __initconst = { 249static struct tnetv107x_device_info evm_device_info __initconst = {
200 .serial_config = &serial_config, 250 .serial_config = &serial_config,
201 .mmc_config[1] = &mmc_config, /* controller 1 */ 251 .mmc_config[1] = &mmc_config, /* controller 1 */
202 .nand_config[0] = &nand_config, /* chip select 0 */ 252 .nand_config[0] = &nand_config, /* chip select 0 */
203 .keypad_config = &keypad_config, 253 .keypad_config = &keypad_config,
254 .ssp_config = &ssp_config,
255};
256
257static struct spi_board_info spi_info[] __initconst = {
204}; 258};
205 259
206static __init void tnetv107x_evm_board_init(void) 260static __init void tnetv107x_evm_board_init(void)
207{ 261{
208 davinci_cfg_reg_list(sdio1_pins); 262 davinci_cfg_reg_list(sdio1_pins);
209 davinci_cfg_reg_list(uart1_pins); 263 davinci_cfg_reg_list(uart1_pins);
264 davinci_cfg_reg_list(ssp_pins);
210 265
211 tnetv107x_devices_init(&evm_device_info); 266 tnetv107x_devices_init(&evm_device_info);
267
268 spi_register_board_info(spi_info, ARRAY_SIZE(spi_info));
212} 269}
213 270
214#ifdef CONFIG_SERIAL_8250_CONSOLE 271#ifdef CONFIG_SERIAL_8250_CONSOLE
diff --git a/arch/arm/mach-davinci/cpufreq.c b/arch/arm/mach-davinci/cpufreq.c
index 343de73161fa..4a68c2b1ec11 100644
--- a/arch/arm/mach-davinci/cpufreq.c
+++ b/arch/arm/mach-davinci/cpufreq.c
@@ -132,7 +132,7 @@ out:
132 return ret; 132 return ret;
133} 133}
134 134
135static int __init davinci_cpu_init(struct cpufreq_policy *policy) 135static int davinci_cpu_init(struct cpufreq_policy *policy)
136{ 136{
137 int result = 0; 137 int result = 0;
138 struct davinci_cpufreq_config *pdata = cpufreq.dev->platform_data; 138 struct davinci_cpufreq_config *pdata = cpufreq.dev->platform_data;
diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c
index ec23ab473620..2ed2f822fc40 100644
--- a/arch/arm/mach-davinci/da830.c
+++ b/arch/arm/mach-davinci/da830.c
@@ -148,7 +148,7 @@ static struct clk scr2_ss_clk = {
148static struct clk dmax_clk = { 148static struct clk dmax_clk = {
149 .name = "dmax", 149 .name = "dmax",
150 .parent = &pll0_sysclk2, 150 .parent = &pll0_sysclk2,
151 .lpsc = DA8XX_LPSC0_DMAX, 151 .lpsc = DA8XX_LPSC0_PRUSS,
152 .flags = ALWAYS_ENABLED, 152 .flags = ALWAYS_ENABLED,
153}; 153};
154 154
@@ -397,8 +397,8 @@ static struct clk_lookup da830_clks[] = {
397 CLK(NULL, "uart0", &uart0_clk), 397 CLK(NULL, "uart0", &uart0_clk),
398 CLK(NULL, "uart1", &uart1_clk), 398 CLK(NULL, "uart1", &uart1_clk),
399 CLK(NULL, "uart2", &uart2_clk), 399 CLK(NULL, "uart2", &uart2_clk),
400 CLK("dm_spi.0", NULL, &spi0_clk), 400 CLK("spi_davinci.0", NULL, &spi0_clk),
401 CLK("dm_spi.1", NULL, &spi1_clk), 401 CLK("spi_davinci.1", NULL, &spi1_clk),
402 CLK(NULL, "ecap0", &ecap0_clk), 402 CLK(NULL, "ecap0", &ecap0_clk),
403 CLK(NULL, "ecap1", &ecap1_clk), 403 CLK(NULL, "ecap1", &ecap1_clk),
404 CLK(NULL, "ecap2", &ecap2_clk), 404 CLK(NULL, "ecap2", &ecap2_clk),
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 78b5ae29ae40..68fe4c289d77 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -345,6 +345,34 @@ static struct clk aemif_clk = {
345 .flags = ALWAYS_ENABLED, 345 .flags = ALWAYS_ENABLED,
346}; 346};
347 347
348static struct clk usb11_clk = {
349 .name = "usb11",
350 .parent = &pll0_sysclk4,
351 .lpsc = DA8XX_LPSC1_USB11,
352 .gpsc = 1,
353};
354
355static struct clk usb20_clk = {
356 .name = "usb20",
357 .parent = &pll0_sysclk2,
358 .lpsc = DA8XX_LPSC1_USB20,
359 .gpsc = 1,
360};
361
362static struct clk spi0_clk = {
363 .name = "spi0",
364 .parent = &pll0_sysclk2,
365 .lpsc = DA8XX_LPSC0_SPI0,
366};
367
368static struct clk spi1_clk = {
369 .name = "spi1",
370 .parent = &pll0_sysclk2,
371 .lpsc = DA8XX_LPSC1_SPI1,
372 .gpsc = 1,
373 .flags = DA850_CLK_ASYNC3,
374};
375
348static struct clk_lookup da850_clks[] = { 376static struct clk_lookup da850_clks[] = {
349 CLK(NULL, "ref", &ref_clk), 377 CLK(NULL, "ref", &ref_clk),
350 CLK(NULL, "pll0", &pll0_clk), 378 CLK(NULL, "pll0", &pll0_clk),
@@ -387,6 +415,10 @@ static struct clk_lookup da850_clks[] = {
387 CLK("davinci_mmc.0", NULL, &mmcsd0_clk), 415 CLK("davinci_mmc.0", NULL, &mmcsd0_clk),
388 CLK("davinci_mmc.1", NULL, &mmcsd1_clk), 416 CLK("davinci_mmc.1", NULL, &mmcsd1_clk),
389 CLK(NULL, "aemif", &aemif_clk), 417 CLK(NULL, "aemif", &aemif_clk),
418 CLK(NULL, "usb11", &usb11_clk),
419 CLK(NULL, "usb20", &usb20_clk),
420 CLK("spi_davinci.0", NULL, &spi0_clk),
421 CLK("spi_davinci.1", NULL, &spi1_clk),
390 CLK(NULL, NULL, NULL), 422 CLK(NULL, NULL, NULL),
391}; 423};
392 424
@@ -543,30 +575,19 @@ static const struct mux_config da850_pins[] = {
543 MUX_CFG(DA850, EMA_WAIT_1, 6, 24, 15, 1, false) 575 MUX_CFG(DA850, EMA_WAIT_1, 6, 24, 15, 1, false)
544 MUX_CFG(DA850, NEMA_CS_2, 7, 0, 15, 1, false) 576 MUX_CFG(DA850, NEMA_CS_2, 7, 0, 15, 1, false)
545 /* GPIO function */ 577 /* GPIO function */
578 MUX_CFG(DA850, GPIO2_4, 6, 12, 15, 8, false)
546 MUX_CFG(DA850, GPIO2_6, 6, 4, 15, 8, false) 579 MUX_CFG(DA850, GPIO2_6, 6, 4, 15, 8, false)
547 MUX_CFG(DA850, GPIO2_8, 5, 28, 15, 8, false) 580 MUX_CFG(DA850, GPIO2_8, 5, 28, 15, 8, false)
548 MUX_CFG(DA850, GPIO2_15, 5, 0, 15, 8, false) 581 MUX_CFG(DA850, GPIO2_15, 5, 0, 15, 8, false)
582 MUX_CFG(DA850, GPIO3_12, 7, 12, 15, 8, false)
583 MUX_CFG(DA850, GPIO3_13, 7, 8, 15, 8, false)
549 MUX_CFG(DA850, GPIO4_0, 10, 28, 15, 8, false) 584 MUX_CFG(DA850, GPIO4_0, 10, 28, 15, 8, false)
550 MUX_CFG(DA850, GPIO4_1, 10, 24, 15, 8, false) 585 MUX_CFG(DA850, GPIO4_1, 10, 24, 15, 8, false)
586 MUX_CFG(DA850, GPIO6_13, 13, 8, 15, 8, false)
551 MUX_CFG(DA850, RTC_ALARM, 0, 28, 15, 2, false) 587 MUX_CFG(DA850, RTC_ALARM, 0, 28, 15, 2, false)
552#endif 588#endif
553}; 589};
554 590
555const short da850_uart0_pins[] __initdata = {
556 DA850_NUART0_CTS, DA850_NUART0_RTS, DA850_UART0_RXD, DA850_UART0_TXD,
557 -1
558};
559
560const short da850_uart1_pins[] __initdata = {
561 DA850_UART1_RXD, DA850_UART1_TXD,
562 -1
563};
564
565const short da850_uart2_pins[] __initdata = {
566 DA850_UART2_RXD, DA850_UART2_TXD,
567 -1
568};
569
570const short da850_i2c0_pins[] __initdata = { 591const short da850_i2c0_pins[] __initdata = {
571 DA850_I2C0_SDA, DA850_I2C0_SCL, 592 DA850_I2C0_SDA, DA850_I2C0_SCL,
572 -1 593 -1
@@ -577,24 +598,6 @@ const short da850_i2c1_pins[] __initdata = {
577 -1 598 -1
578}; 599};
579 600
580const short da850_cpgmac_pins[] __initdata = {
581 DA850_MII_TXEN, DA850_MII_TXCLK, DA850_MII_COL, DA850_MII_TXD_3,
582 DA850_MII_TXD_2, DA850_MII_TXD_1, DA850_MII_TXD_0, DA850_MII_RXER,
583 DA850_MII_CRS, DA850_MII_RXCLK, DA850_MII_RXDV, DA850_MII_RXD_3,
584 DA850_MII_RXD_2, DA850_MII_RXD_1, DA850_MII_RXD_0, DA850_MDIO_CLK,
585 DA850_MDIO_D, DA850_RMII_TXD_0, DA850_RMII_TXD_1, DA850_RMII_TXEN,
586 DA850_RMII_CRS_DV, DA850_RMII_RXD_0, DA850_RMII_RXD_1, DA850_RMII_RXER,
587 DA850_RMII_MHZ_50_CLK,
588 -1
589};
590
591const short da850_mcasp_pins[] __initdata = {
592 DA850_AHCLKX, DA850_ACLKX, DA850_AFSX,
593 DA850_AHCLKR, DA850_ACLKR, DA850_AFSR, DA850_AMUTE,
594 DA850_AXR_11, DA850_AXR_12,
595 -1
596};
597
598const short da850_lcdcntl_pins[] __initdata = { 601const short da850_lcdcntl_pins[] __initdata = {
599 DA850_LCD_D_0, DA850_LCD_D_1, DA850_LCD_D_2, DA850_LCD_D_3, 602 DA850_LCD_D_0, DA850_LCD_D_1, DA850_LCD_D_2, DA850_LCD_D_3,
600 DA850_LCD_D_4, DA850_LCD_D_5, DA850_LCD_D_6, DA850_LCD_D_7, 603 DA850_LCD_D_4, DA850_LCD_D_5, DA850_LCD_D_6, DA850_LCD_D_7,
@@ -604,29 +607,6 @@ const short da850_lcdcntl_pins[] __initdata = {
604 -1 607 -1
605}; 608};
606 609
607const short da850_mmcsd0_pins[] __initdata = {
608 DA850_MMCSD0_DAT_0, DA850_MMCSD0_DAT_1, DA850_MMCSD0_DAT_2,
609 DA850_MMCSD0_DAT_3, DA850_MMCSD0_CLK, DA850_MMCSD0_CMD,
610 DA850_GPIO4_0, DA850_GPIO4_1,
611 -1
612};
613
614const short da850_emif25_pins[] __initdata = {
615 DA850_EMA_BA_1, DA850_EMA_CLK, DA850_EMA_WAIT_1, DA850_NEMA_CS_2,
616 DA850_NEMA_CS_3, DA850_NEMA_CS_4, DA850_NEMA_WE, DA850_NEMA_OE,
617 DA850_EMA_D_0, DA850_EMA_D_1, DA850_EMA_D_2, DA850_EMA_D_3,
618 DA850_EMA_D_4, DA850_EMA_D_5, DA850_EMA_D_6, DA850_EMA_D_7,
619 DA850_EMA_D_8, DA850_EMA_D_9, DA850_EMA_D_10, DA850_EMA_D_11,
620 DA850_EMA_D_12, DA850_EMA_D_13, DA850_EMA_D_14, DA850_EMA_D_15,
621 DA850_EMA_A_0, DA850_EMA_A_1, DA850_EMA_A_2, DA850_EMA_A_3,
622 DA850_EMA_A_4, DA850_EMA_A_5, DA850_EMA_A_6, DA850_EMA_A_7,
623 DA850_EMA_A_8, DA850_EMA_A_9, DA850_EMA_A_10, DA850_EMA_A_11,
624 DA850_EMA_A_12, DA850_EMA_A_13, DA850_EMA_A_14, DA850_EMA_A_15,
625 DA850_EMA_A_16, DA850_EMA_A_17, DA850_EMA_A_18, DA850_EMA_A_19,
626 DA850_EMA_A_20, DA850_EMA_A_21, DA850_EMA_A_22, DA850_EMA_A_23,
627 -1
628};
629
630/* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */ 610/* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */
631static u8 da850_default_priorities[DA850_N_CP_INTC_IRQ] = { 611static u8 da850_default_priorities[DA850_N_CP_INTC_IRQ] = {
632 [IRQ_DA8XX_COMMTX] = 7, 612 [IRQ_DA8XX_COMMTX] = 7,
@@ -764,6 +744,13 @@ static struct davinci_id da850_ids[] = {
764 .cpu_id = DAVINCI_CPU_ID_DA850, 744 .cpu_id = DAVINCI_CPU_ID_DA850,
765 .name = "da850/omap-l138", 745 .name = "da850/omap-l138",
766 }, 746 },
747 {
748 .variant = 0x1,
749 .part_no = 0xb7d1,
750 .manufacturer = 0x017, /* 0x02f >> 1 */
751 .cpu_id = DAVINCI_CPU_ID_DA850,
752 .name = "da850/omap-l138/am18x",
753 },
767}; 754};
768 755
769static struct davinci_timer_instance da850_timer_instance[4] = { 756static struct davinci_timer_instance da850_timer_instance[4] = {
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index 9eec63070e0c..625d4b66718b 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -38,12 +38,23 @@
38#define DA8XX_EMAC_MDIO_BASE 0x01e24000 38#define DA8XX_EMAC_MDIO_BASE 0x01e24000
39#define DA8XX_GPIO_BASE 0x01e26000 39#define DA8XX_GPIO_BASE 0x01e26000
40#define DA8XX_I2C1_BASE 0x01e28000 40#define DA8XX_I2C1_BASE 0x01e28000
41#define DA8XX_SPI0_BASE 0x01c41000
42#define DA8XX_SPI1_BASE 0x01f0e000
41 43
42#define DA8XX_EMAC_CTRL_REG_OFFSET 0x3000 44#define DA8XX_EMAC_CTRL_REG_OFFSET 0x3000
43#define DA8XX_EMAC_MOD_REG_OFFSET 0x2000 45#define DA8XX_EMAC_MOD_REG_OFFSET 0x2000
44#define DA8XX_EMAC_RAM_OFFSET 0x0000 46#define DA8XX_EMAC_RAM_OFFSET 0x0000
45#define DA8XX_EMAC_CTRL_RAM_SIZE SZ_8K 47#define DA8XX_EMAC_CTRL_RAM_SIZE SZ_8K
46 48
49#define DA8XX_DMA_SPI0_RX EDMA_CTLR_CHAN(0, 14)
50#define DA8XX_DMA_SPI0_TX EDMA_CTLR_CHAN(0, 15)
51#define DA8XX_DMA_MMCSD0_RX EDMA_CTLR_CHAN(0, 16)
52#define DA8XX_DMA_MMCSD0_TX EDMA_CTLR_CHAN(0, 17)
53#define DA8XX_DMA_SPI1_RX EDMA_CTLR_CHAN(0, 18)
54#define DA8XX_DMA_SPI1_TX EDMA_CTLR_CHAN(0, 19)
55#define DA850_DMA_MMCSD1_RX EDMA_CTLR_CHAN(1, 28)
56#define DA850_DMA_MMCSD1_TX EDMA_CTLR_CHAN(1, 29)
57
47void __iomem *da8xx_syscfg0_base; 58void __iomem *da8xx_syscfg0_base;
48void __iomem *da8xx_syscfg1_base; 59void __iomem *da8xx_syscfg1_base;
49 60
@@ -480,8 +491,15 @@ static struct platform_device da850_mcasp_device = {
480 .resource = da850_mcasp_resources, 491 .resource = da850_mcasp_resources,
481}; 492};
482 493
494struct platform_device davinci_pcm_device = {
495 .name = "davinci-pcm-audio",
496 .id = -1,
497};
498
483void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata) 499void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata)
484{ 500{
501 platform_device_register(&davinci_pcm_device);
502
485 /* DA830/OMAP-L137 has 3 instances of McASP */ 503 /* DA830/OMAP-L137 has 3 instances of McASP */
486 if (cpu_is_davinci_da830() && id == 1) { 504 if (cpu_is_davinci_da830() && id == 1) {
487 da830_mcasp1_device.dev.platform_data = pdata; 505 da830_mcasp1_device.dev.platform_data = pdata;
@@ -566,13 +584,13 @@ static struct resource da8xx_mmcsd0_resources[] = {
566 .flags = IORESOURCE_IRQ, 584 .flags = IORESOURCE_IRQ,
567 }, 585 },
568 { /* DMA RX */ 586 { /* DMA RX */
569 .start = EDMA_CTLR_CHAN(0, 16), 587 .start = DA8XX_DMA_MMCSD0_RX,
570 .end = EDMA_CTLR_CHAN(0, 16), 588 .end = DA8XX_DMA_MMCSD0_RX,
571 .flags = IORESOURCE_DMA, 589 .flags = IORESOURCE_DMA,
572 }, 590 },
573 { /* DMA TX */ 591 { /* DMA TX */
574 .start = EDMA_CTLR_CHAN(0, 17), 592 .start = DA8XX_DMA_MMCSD0_TX,
575 .end = EDMA_CTLR_CHAN(0, 17), 593 .end = DA8XX_DMA_MMCSD0_TX,
576 .flags = IORESOURCE_DMA, 594 .flags = IORESOURCE_DMA,
577 }, 595 },
578}; 596};
@@ -603,13 +621,13 @@ static struct resource da850_mmcsd1_resources[] = {
603 .flags = IORESOURCE_IRQ, 621 .flags = IORESOURCE_IRQ,
604 }, 622 },
605 { /* DMA RX */ 623 { /* DMA RX */
606 .start = EDMA_CTLR_CHAN(1, 28), 624 .start = DA850_DMA_MMCSD1_RX,
607 .end = EDMA_CTLR_CHAN(1, 28), 625 .end = DA850_DMA_MMCSD1_RX,
608 .flags = IORESOURCE_DMA, 626 .flags = IORESOURCE_DMA,
609 }, 627 },
610 { /* DMA TX */ 628 { /* DMA TX */
611 .start = EDMA_CTLR_CHAN(1, 29), 629 .start = DA850_DMA_MMCSD1_TX,
612 .end = EDMA_CTLR_CHAN(1, 29), 630 .end = DA850_DMA_MMCSD1_TX,
613 .flags = IORESOURCE_DMA, 631 .flags = IORESOURCE_DMA,
614 }, 632 },
615}; 633};
@@ -718,3 +736,101 @@ int __init da8xx_register_cpuidle(void)
718 736
719 return platform_device_register(&da8xx_cpuidle_device); 737 return platform_device_register(&da8xx_cpuidle_device);
720} 738}
739
740static struct resource da8xx_spi0_resources[] = {
741 [0] = {
742 .start = DA8XX_SPI0_BASE,
743 .end = DA8XX_SPI0_BASE + SZ_4K - 1,
744 .flags = IORESOURCE_MEM,
745 },
746 [1] = {
747 .start = IRQ_DA8XX_SPINT0,
748 .end = IRQ_DA8XX_SPINT0,
749 .flags = IORESOURCE_IRQ,
750 },
751 [2] = {
752 .start = DA8XX_DMA_SPI0_RX,
753 .end = DA8XX_DMA_SPI0_RX,
754 .flags = IORESOURCE_DMA,
755 },
756 [3] = {
757 .start = DA8XX_DMA_SPI0_TX,
758 .end = DA8XX_DMA_SPI0_TX,
759 .flags = IORESOURCE_DMA,
760 },
761};
762
763static struct resource da8xx_spi1_resources[] = {
764 [0] = {
765 .start = DA8XX_SPI1_BASE,
766 .end = DA8XX_SPI1_BASE + SZ_4K - 1,
767 .flags = IORESOURCE_MEM,
768 },
769 [1] = {
770 .start = IRQ_DA8XX_SPINT1,
771 .end = IRQ_DA8XX_SPINT1,
772 .flags = IORESOURCE_IRQ,
773 },
774 [2] = {
775 .start = DA8XX_DMA_SPI1_RX,
776 .end = DA8XX_DMA_SPI1_RX,
777 .flags = IORESOURCE_DMA,
778 },
779 [3] = {
780 .start = DA8XX_DMA_SPI1_TX,
781 .end = DA8XX_DMA_SPI1_TX,
782 .flags = IORESOURCE_DMA,
783 },
784};
785
786struct davinci_spi_platform_data da8xx_spi_pdata[] = {
787 [0] = {
788 .version = SPI_VERSION_2,
789 .intr_line = 1,
790 .dma_event_q = EVENTQ_0,
791 },
792 [1] = {
793 .version = SPI_VERSION_2,
794 .intr_line = 1,
795 .dma_event_q = EVENTQ_0,
796 },
797};
798
799static struct platform_device da8xx_spi_device[] = {
800 [0] = {
801 .name = "spi_davinci",
802 .id = 0,
803 .num_resources = ARRAY_SIZE(da8xx_spi0_resources),
804 .resource = da8xx_spi0_resources,
805 .dev = {
806 .platform_data = &da8xx_spi_pdata[0],
807 },
808 },
809 [1] = {
810 .name = "spi_davinci",
811 .id = 1,
812 .num_resources = ARRAY_SIZE(da8xx_spi1_resources),
813 .resource = da8xx_spi1_resources,
814 .dev = {
815 .platform_data = &da8xx_spi_pdata[1],
816 },
817 },
818};
819
820int __init da8xx_register_spi(int instance, struct spi_board_info *info,
821 unsigned len)
822{
823 int ret;
824
825 if (instance < 0 || instance > 1)
826 return -EINVAL;
827
828 ret = spi_register_board_info(info, len);
829 if (ret)
830 pr_warning("%s: failed to register board info for spi %d :"
831 " %d\n", __func__, instance, ret);
832
833 da8xx_spi_pdata[instance].num_chipselect = len;
834
835 return platform_device_register(&da8xx_spi_device[instance]);
836}
diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c b/arch/arm/mach-davinci/devices-tnetv107x.c
index 85503debda51..6162cae7f868 100644
--- a/arch/arm/mach-davinci/devices-tnetv107x.c
+++ b/arch/arm/mach-davinci/devices-tnetv107x.c
@@ -35,6 +35,7 @@
35#define TNETV107X_SDIO0_BASE 0x08088700 35#define TNETV107X_SDIO0_BASE 0x08088700
36#define TNETV107X_SDIO1_BASE 0x08088800 36#define TNETV107X_SDIO1_BASE 0x08088800
37#define TNETV107X_KEYPAD_BASE 0x08088a00 37#define TNETV107X_KEYPAD_BASE 0x08088a00
38#define TNETV107X_SSP_BASE 0x08088c00
38#define TNETV107X_ASYNC_EMIF_CNTRL_BASE 0x08200000 39#define TNETV107X_ASYNC_EMIF_CNTRL_BASE 0x08200000
39#define TNETV107X_ASYNC_EMIF_DATA_CE0_BASE 0x30000000 40#define TNETV107X_ASYNC_EMIF_DATA_CE0_BASE 0x30000000
40#define TNETV107X_ASYNC_EMIF_DATA_CE1_BASE 0x40000000 41#define TNETV107X_ASYNC_EMIF_DATA_CE1_BASE 0x40000000
@@ -342,6 +343,25 @@ static struct platform_device tsc_device = {
342 .resource = tsc_resources, 343 .resource = tsc_resources,
343}; 344};
344 345
346static struct resource ssp_resources[] = {
347 {
348 .start = TNETV107X_SSP_BASE,
349 .end = TNETV107X_SSP_BASE + 0x1ff,
350 .flags = IORESOURCE_MEM,
351 },
352 {
353 .start = IRQ_TNETV107X_SSP,
354 .flags = IORESOURCE_IRQ,
355 },
356};
357
358static struct platform_device ssp_device = {
359 .name = "ti-ssp",
360 .id = -1,
361 .num_resources = ARRAY_SIZE(ssp_resources),
362 .resource = ssp_resources,
363};
364
345void __init tnetv107x_devices_init(struct tnetv107x_device_info *info) 365void __init tnetv107x_devices_init(struct tnetv107x_device_info *info)
346{ 366{
347 int i, error; 367 int i, error;
@@ -380,4 +400,9 @@ void __init tnetv107x_devices_init(struct tnetv107x_device_info *info)
380 keypad_device.dev.platform_data = info->keypad_config; 400 keypad_device.dev.platform_data = info->keypad_config;
381 platform_device_register(&keypad_device); 401 platform_device_register(&keypad_device);
382 } 402 }
403
404 if (info->ssp_config) {
405 ssp_device.dev.platform_data = info->ssp_config;
406 platform_device_register(&ssp_device);
407 }
383} 408}
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index a5f8a80c1f28..76364d1345df 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -403,16 +403,13 @@ static struct resource dm355_spi0_resources[] = {
403 .start = 16, 403 .start = 16,
404 .flags = IORESOURCE_DMA, 404 .flags = IORESOURCE_DMA,
405 }, 405 },
406 {
407 .start = EVENTQ_1,
408 .flags = IORESOURCE_DMA,
409 },
410}; 406};
411 407
412static struct davinci_spi_platform_data dm355_spi0_pdata = { 408static struct davinci_spi_platform_data dm355_spi0_pdata = {
413 .version = SPI_VERSION_1, 409 .version = SPI_VERSION_1,
414 .num_chipselect = 2, 410 .num_chipselect = 2,
415 .cshold_bug = true, 411 .cshold_bug = true,
412 .dma_event_q = EVENTQ_1,
416}; 413};
417static struct platform_device dm355_spi0_device = { 414static struct platform_device dm355_spi0_device = {
418 .name = "spi_davinci", 415 .name = "spi_davinci",
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index 02d2cc380df7..4604e72d7d99 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -625,6 +625,7 @@ static u64 dm365_spi0_dma_mask = DMA_BIT_MASK(32);
625static struct davinci_spi_platform_data dm365_spi0_pdata = { 625static struct davinci_spi_platform_data dm365_spi0_pdata = {
626 .version = SPI_VERSION_1, 626 .version = SPI_VERSION_1,
627 .num_chipselect = 2, 627 .num_chipselect = 2,
628 .dma_event_q = EVENTQ_3,
628}; 629};
629 630
630static struct resource dm365_spi0_resources[] = { 631static struct resource dm365_spi0_resources[] = {
@@ -645,10 +646,6 @@ static struct resource dm365_spi0_resources[] = {
645 .start = 16, 646 .start = 16,
646 .flags = IORESOURCE_DMA, 647 .flags = IORESOURCE_DMA,
647 }, 648 },
648 {
649 .start = EVENTQ_3,
650 .flags = IORESOURCE_DMA,
651 },
652}; 649};
653 650
654static struct platform_device dm365_spi0_device = { 651static struct platform_device dm365_spi0_device = {
diff --git a/arch/arm/mach-davinci/gpio-tnetv107x.c b/arch/arm/mach-davinci/gpio-tnetv107x.c
index d10298620e2c..3fa3e2867e19 100644
--- a/arch/arm/mach-davinci/gpio-tnetv107x.c
+++ b/arch/arm/mach-davinci/gpio-tnetv107x.c
@@ -58,7 +58,7 @@ static int tnetv107x_gpio_request(struct gpio_chip *chip, unsigned offset)
58 58
59 spin_lock_irqsave(&ctlr->lock, flags); 59 spin_lock_irqsave(&ctlr->lock, flags);
60 60
61 gpio_reg_set_bit(&regs->enable, gpio); 61 gpio_reg_set_bit(regs->enable, gpio);
62 62
63 spin_unlock_irqrestore(&ctlr->lock, flags); 63 spin_unlock_irqrestore(&ctlr->lock, flags);
64 64
@@ -74,7 +74,7 @@ static void tnetv107x_gpio_free(struct gpio_chip *chip, unsigned offset)
74 74
75 spin_lock_irqsave(&ctlr->lock, flags); 75 spin_lock_irqsave(&ctlr->lock, flags);
76 76
77 gpio_reg_clear_bit(&regs->enable, gpio); 77 gpio_reg_clear_bit(regs->enable, gpio);
78 78
79 spin_unlock_irqrestore(&ctlr->lock, flags); 79 spin_unlock_irqrestore(&ctlr->lock, flags);
80} 80}
@@ -88,7 +88,7 @@ static int tnetv107x_gpio_dir_in(struct gpio_chip *chip, unsigned offset)
88 88
89 spin_lock_irqsave(&ctlr->lock, flags); 89 spin_lock_irqsave(&ctlr->lock, flags);
90 90
91 gpio_reg_set_bit(&regs->direction, gpio); 91 gpio_reg_set_bit(regs->direction, gpio);
92 92
93 spin_unlock_irqrestore(&ctlr->lock, flags); 93 spin_unlock_irqrestore(&ctlr->lock, flags);
94 94
@@ -106,11 +106,11 @@ static int tnetv107x_gpio_dir_out(struct gpio_chip *chip,
106 spin_lock_irqsave(&ctlr->lock, flags); 106 spin_lock_irqsave(&ctlr->lock, flags);
107 107
108 if (value) 108 if (value)
109 gpio_reg_set_bit(&regs->data_out, gpio); 109 gpio_reg_set_bit(regs->data_out, gpio);
110 else 110 else
111 gpio_reg_clear_bit(&regs->data_out, gpio); 111 gpio_reg_clear_bit(regs->data_out, gpio);
112 112
113 gpio_reg_clear_bit(&regs->direction, gpio); 113 gpio_reg_clear_bit(regs->direction, gpio);
114 114
115 spin_unlock_irqrestore(&ctlr->lock, flags); 115 spin_unlock_irqrestore(&ctlr->lock, flags);
116 116
@@ -124,7 +124,7 @@ static int tnetv107x_gpio_get(struct gpio_chip *chip, unsigned offset)
124 unsigned gpio = chip->base + offset; 124 unsigned gpio = chip->base + offset;
125 int ret; 125 int ret;
126 126
127 ret = gpio_reg_get_bit(&regs->data_in, gpio); 127 ret = gpio_reg_get_bit(regs->data_in, gpio);
128 128
129 return ret ? 1 : 0; 129 return ret ? 1 : 0;
130} 130}
@@ -140,9 +140,9 @@ static void tnetv107x_gpio_set(struct gpio_chip *chip,
140 spin_lock_irqsave(&ctlr->lock, flags); 140 spin_lock_irqsave(&ctlr->lock, flags);
141 141
142 if (value) 142 if (value)
143 gpio_reg_set_bit(&regs->data_out, gpio); 143 gpio_reg_set_bit(regs->data_out, gpio);
144 else 144 else
145 gpio_reg_clear_bit(&regs->data_out, gpio); 145 gpio_reg_clear_bit(regs->data_out, gpio);
146 146
147 spin_unlock_irqrestore(&ctlr->lock, flags); 147 spin_unlock_irqrestore(&ctlr->lock, flags);
148} 148}
diff --git a/arch/arm/mach-davinci/include/mach/clkdev.h b/arch/arm/mach-davinci/include/mach/clkdev.h
index 730c49d1ebd8..14a504887189 100644
--- a/arch/arm/mach-davinci/include/mach/clkdev.h
+++ b/arch/arm/mach-davinci/include/mach/clkdev.h
@@ -1,6 +1,8 @@
1#ifndef __MACH_CLKDEV_H 1#ifndef __MACH_CLKDEV_H
2#define __MACH_CLKDEV_H 2#define __MACH_CLKDEV_H
3 3
4struct clk;
5
4static inline int __clk_get(struct clk *clk) 6static inline int __clk_get(struct clk *clk)
5{ 7{
6 return 1; 8 return 1;
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index e7f952066527..e4fc1af8500e 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -15,6 +15,7 @@
15 15
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/davinci_emac.h> 17#include <linux/davinci_emac.h>
18#include <linux/spi/spi.h>
18 19
19#include <mach/serial.h> 20#include <mach/serial.h>
20#include <mach/edma.h> 21#include <mach/edma.h>
@@ -23,6 +24,7 @@
23#include <mach/mmc.h> 24#include <mach/mmc.h>
24#include <mach/usb.h> 25#include <mach/usb.h>
25#include <mach/pm.h> 26#include <mach/pm.h>
27#include <mach/spi.h>
26 28
27extern void __iomem *da8xx_syscfg0_base; 29extern void __iomem *da8xx_syscfg0_base;
28extern void __iomem *da8xx_syscfg1_base; 30extern void __iomem *da8xx_syscfg1_base;
@@ -77,6 +79,7 @@ void __init da850_init(void);
77int da830_register_edma(struct edma_rsv_info *rsv); 79int da830_register_edma(struct edma_rsv_info *rsv);
78int da850_register_edma(struct edma_rsv_info *rsv[2]); 80int da850_register_edma(struct edma_rsv_info *rsv[2]);
79int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata); 81int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata);
82int da8xx_register_spi(int instance, struct spi_board_info *info, unsigned len);
80int da8xx_register_watchdog(void); 83int da8xx_register_watchdog(void);
81int da8xx_register_usb20(unsigned mA, unsigned potpgt); 84int da8xx_register_usb20(unsigned mA, unsigned potpgt);
82int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata); 85int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata);
@@ -95,6 +98,7 @@ extern struct platform_device da8xx_serial_device;
95extern struct emac_platform_data da8xx_emac_pdata; 98extern struct emac_platform_data da8xx_emac_pdata;
96extern struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata; 99extern struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata;
97extern struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata; 100extern struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata;
101extern struct davinci_spi_platform_data da8xx_spi_pdata[];
98 102
99extern struct platform_device da8xx_wdt_device; 103extern struct platform_device da8xx_wdt_device;
100 104
@@ -123,15 +127,8 @@ extern const short da830_ecap2_pins[];
123extern const short da830_eqep0_pins[]; 127extern const short da830_eqep0_pins[];
124extern const short da830_eqep1_pins[]; 128extern const short da830_eqep1_pins[];
125 129
126extern const short da850_uart0_pins[];
127extern const short da850_uart1_pins[];
128extern const short da850_uart2_pins[];
129extern const short da850_i2c0_pins[]; 130extern const short da850_i2c0_pins[];
130extern const short da850_i2c1_pins[]; 131extern const short da850_i2c1_pins[];
131extern const short da850_cpgmac_pins[];
132extern const short da850_mcasp_pins[];
133extern const short da850_lcdcntl_pins[]; 132extern const short da850_lcdcntl_pins[];
134extern const short da850_mmcsd0_pins[];
135extern const short da850_emif25_pins[];
136 133
137#endif /* __ASM_ARCH_DAVINCI_DA8XX_H */ 134#endif /* __ASM_ARCH_DAVINCI_DA8XX_H */
diff --git a/arch/arm/mach-davinci/include/mach/edma.h b/arch/arm/mach-davinci/include/mach/edma.h
index dc10ef6cf572..20c77f29bf0f 100644
--- a/arch/arm/mach-davinci/include/mach/edma.h
+++ b/arch/arm/mach-davinci/include/mach/edma.h
@@ -151,42 +151,6 @@ struct edmacc_param {
151#define DA830_DMACH2EVENT_MAP1 0x00000000u 151#define DA830_DMACH2EVENT_MAP1 0x00000000u
152#define DA830_EDMA_ARM_OWN 0x30FFCCFFu 152#define DA830_EDMA_ARM_OWN 0x30FFCCFFu
153 153
154/* DA830 specific EDMA3 Events Information */
155enum DA830_edma_ch {
156 DA830_DMACH_MCASP0_RX,
157 DA830_DMACH_MCASP0_TX,
158 DA830_DMACH_MCASP1_RX,
159 DA830_DMACH_MCASP1_TX,
160 DA830_DMACH_MCASP2_RX,
161 DA830_DMACH_MCASP2_TX,
162 DA830_DMACH_GPIO_BNK0INT,
163 DA830_DMACH_GPIO_BNK1INT,
164 DA830_DMACH_UART0_RX,
165 DA830_DMACH_UART0_TX,
166 DA830_DMACH_TMR64P0_EVTOUT12,
167 DA830_DMACH_TMR64P0_EVTOUT34,
168 DA830_DMACH_UART1_RX,
169 DA830_DMACH_UART1_TX,
170 DA830_DMACH_SPI0_RX,
171 DA830_DMACH_SPI0_TX,
172 DA830_DMACH_MMCSD_RX,
173 DA830_DMACH_MMCSD_TX,
174 DA830_DMACH_SPI1_RX,
175 DA830_DMACH_SPI1_TX,
176 DA830_DMACH_DMAX_EVTOUT6,
177 DA830_DMACH_DMAX_EVTOUT7,
178 DA830_DMACH_GPIO_BNK2INT,
179 DA830_DMACH_GPIO_BNK3INT,
180 DA830_DMACH_I2C0_RX,
181 DA830_DMACH_I2C0_TX,
182 DA830_DMACH_I2C1_RX,
183 DA830_DMACH_I2C1_TX,
184 DA830_DMACH_GPIO_BNK4INT,
185 DA830_DMACH_GPIO_BNK5INT,
186 DA830_DMACH_UART2_RX,
187 DA830_DMACH_UART2_TX
188};
189
190/*ch_status paramater of callback function possible values*/ 154/*ch_status paramater of callback function possible values*/
191#define DMA_COMPLETE 1 155#define DMA_COMPLETE 1
192#define DMA_CC_ERROR 2 156#define DMA_CC_ERROR 2
diff --git a/arch/arm/mach-davinci/include/mach/memory.h b/arch/arm/mach-davinci/include/mach/memory.h
index 22eb97c1c30b..78822723f382 100644
--- a/arch/arm/mach-davinci/include/mach/memory.h
+++ b/arch/arm/mach-davinci/include/mach/memory.h
@@ -26,9 +26,9 @@
26#if defined(CONFIG_ARCH_DAVINCI_DA8XX) && defined(CONFIG_ARCH_DAVINCI_DMx) 26#if defined(CONFIG_ARCH_DAVINCI_DA8XX) && defined(CONFIG_ARCH_DAVINCI_DMx)
27#error Cannot enable DaVinci and DA8XX platforms concurrently 27#error Cannot enable DaVinci and DA8XX platforms concurrently
28#elif defined(CONFIG_ARCH_DAVINCI_DA8XX) 28#elif defined(CONFIG_ARCH_DAVINCI_DA8XX)
29#define PHYS_OFFSET DA8XX_DDR_BASE 29#define PLAT_PHYS_OFFSET DA8XX_DDR_BASE
30#else 30#else
31#define PHYS_OFFSET DAVINCI_DDR_BASE 31#define PLAT_PHYS_OFFSET DAVINCI_DDR_BASE
32#endif 32#endif
33 33
34#define DDR2_SDRCR_OFFSET 0xc 34#define DDR2_SDRCR_OFFSET 0xc
diff --git a/arch/arm/mach-davinci/include/mach/mux.h b/arch/arm/mach-davinci/include/mach/mux.h
index de11aac76a80..5d4e0fed828a 100644
--- a/arch/arm/mach-davinci/include/mach/mux.h
+++ b/arch/arm/mach-davinci/include/mach/mux.h
@@ -908,11 +908,15 @@ enum davinci_da850_index {
908 DA850_NEMA_CS_2, 908 DA850_NEMA_CS_2,
909 909
910 /* GPIO function */ 910 /* GPIO function */
911 DA850_GPIO2_4,
911 DA850_GPIO2_6, 912 DA850_GPIO2_6,
912 DA850_GPIO2_8, 913 DA850_GPIO2_8,
913 DA850_GPIO2_15, 914 DA850_GPIO2_15,
915 DA850_GPIO3_12,
916 DA850_GPIO3_13,
914 DA850_GPIO4_0, 917 DA850_GPIO4_0,
915 DA850_GPIO4_1, 918 DA850_GPIO4_1,
919 DA850_GPIO6_13,
916 DA850_RTC_ALARM, 920 DA850_RTC_ALARM,
917}; 921};
918 922
diff --git a/arch/arm/mach-davinci/include/mach/psc.h b/arch/arm/mach-davinci/include/mach/psc.h
index 62b0858f68ca..a47e6f29206e 100644
--- a/arch/arm/mach-davinci/include/mach/psc.h
+++ b/arch/arm/mach-davinci/include/mach/psc.h
@@ -150,7 +150,7 @@
150#define DA8XX_LPSC0_SCR0_SS 10 150#define DA8XX_LPSC0_SCR0_SS 10
151#define DA8XX_LPSC0_SCR1_SS 11 151#define DA8XX_LPSC0_SCR1_SS 11
152#define DA8XX_LPSC0_SCR2_SS 12 152#define DA8XX_LPSC0_SCR2_SS 12
153#define DA8XX_LPSC0_DMAX 13 153#define DA8XX_LPSC0_PRUSS 13
154#define DA8XX_LPSC0_ARM 14 154#define DA8XX_LPSC0_ARM 14
155#define DA8XX_LPSC0_GEM 15 155#define DA8XX_LPSC0_GEM 15
156 156
diff --git a/arch/arm/mach-davinci/include/mach/spi.h b/arch/arm/mach-davinci/include/mach/spi.h
index 38f4da5ca135..7af305b37868 100644
--- a/arch/arm/mach-davinci/include/mach/spi.h
+++ b/arch/arm/mach-davinci/include/mach/spi.h
@@ -19,6 +19,8 @@
19#ifndef __ARCH_ARM_DAVINCI_SPI_H 19#ifndef __ARCH_ARM_DAVINCI_SPI_H
20#define __ARCH_ARM_DAVINCI_SPI_H 20#define __ARCH_ARM_DAVINCI_SPI_H
21 21
22#include <mach/edma.h>
23
22#define SPI_INTERN_CS 0xFF 24#define SPI_INTERN_CS 0xFF
23 25
24enum { 26enum {
@@ -39,13 +41,16 @@ enum {
39 * to populate if all chip-selects are internal. 41 * to populate if all chip-selects are internal.
40 * @cshold_bug: set this to true if the SPI controller on your chip requires 42 * @cshold_bug: set this to true if the SPI controller on your chip requires
41 * a write to CSHOLD bit in between transfers (like in DM355). 43 * a write to CSHOLD bit in between transfers (like in DM355).
44 * @dma_event_q: DMA event queue to use if SPI_IO_TYPE_DMA is used for any
45 * device on the bus.
42 */ 46 */
43struct davinci_spi_platform_data { 47struct davinci_spi_platform_data {
44 u8 version; 48 u8 version;
45 u8 num_chipselect; 49 u8 num_chipselect;
46 u8 intr_line; 50 u8 intr_line;
47 u8 *chip_sel; 51 u8 *chip_sel;
48 bool cshold_bug; 52 bool cshold_bug;
53 enum dma_event_q dma_event_q;
49}; 54};
50 55
51/** 56/**
diff --git a/arch/arm/mach-davinci/include/mach/tnetv107x.h b/arch/arm/mach-davinci/include/mach/tnetv107x.h
index 5a681d880dcb..89c1fdc63c0b 100644
--- a/arch/arm/mach-davinci/include/mach/tnetv107x.h
+++ b/arch/arm/mach-davinci/include/mach/tnetv107x.h
@@ -34,6 +34,7 @@
34 34
35#include <linux/serial_8250.h> 35#include <linux/serial_8250.h>
36#include <linux/input/matrix_keypad.h> 36#include <linux/input/matrix_keypad.h>
37#include <linux/mfd/ti_ssp.h>
37 38
38#include <mach/mmc.h> 39#include <mach/mmc.h>
39#include <mach/nand.h> 40#include <mach/nand.h>
@@ -44,6 +45,7 @@ struct tnetv107x_device_info {
44 struct davinci_mmc_config *mmc_config[2]; /* 2 controllers */ 45 struct davinci_mmc_config *mmc_config[2]; /* 2 controllers */
45 struct davinci_nand_pdata *nand_config[4]; /* 4 chipsels */ 46 struct davinci_nand_pdata *nand_config[4]; /* 4 chipsels */
46 struct matrix_keypad_platform_data *keypad_config; 47 struct matrix_keypad_platform_data *keypad_config;
48 struct ti_ssp_data *ssp_config;
47}; 49};
48 50
49extern struct platform_device tnetv107x_wdt_device; 51extern struct platform_device tnetv107x_wdt_device;
diff --git a/arch/arm/mach-davinci/tnetv107x.c b/arch/arm/mach-davinci/tnetv107x.c
index 6fcdecec8d8c..1b28fdd892a6 100644
--- a/arch/arm/mach-davinci/tnetv107x.c
+++ b/arch/arm/mach-davinci/tnetv107x.c
@@ -278,7 +278,7 @@ static struct clk_lookup clks[] = {
278 CLK(NULL, "timer1", &clk_timer1), 278 CLK(NULL, "timer1", &clk_timer1),
279 CLK("tnetv107x_wdt.0", NULL, &clk_wdt_arm), 279 CLK("tnetv107x_wdt.0", NULL, &clk_wdt_arm),
280 CLK(NULL, "clk_wdt_dsp", &clk_wdt_dsp), 280 CLK(NULL, "clk_wdt_dsp", &clk_wdt_dsp),
281 CLK("ti-ssp.0", NULL, &clk_ssp), 281 CLK("ti-ssp", NULL, &clk_ssp),
282 CLK(NULL, "clk_tdm0", &clk_tdm0), 282 CLK(NULL, "clk_tdm0", &clk_tdm0),
283 CLK(NULL, "clk_vlynq", &clk_vlynq), 283 CLK(NULL, "clk_vlynq", &clk_vlynq),
284 CLK(NULL, "clk_mcdma", &clk_mcdma), 284 CLK(NULL, "clk_mcdma", &clk_mcdma),
diff --git a/arch/arm/mach-dove/Kconfig b/arch/arm/mach-dove/Kconfig
index a4ed3900912a..dd937c526a45 100644
--- a/arch/arm/mach-dove/Kconfig
+++ b/arch/arm/mach-dove/Kconfig
@@ -9,7 +9,7 @@ config MACH_DOVE_DB
9 Say 'Y' here if you want your kernel to support the 9 Say 'Y' here if you want your kernel to support the
10 Marvell DB-MV88AP510 Development Board. 10 Marvell DB-MV88AP510 Development Board.
11 11
12 config MACH_CM_A510 12config MACH_CM_A510
13 bool "CompuLab CM-A510 Board" 13 bool "CompuLab CM-A510 Board"
14 help 14 help
15 Say 'Y' here if you want your kernel to support the 15 Say 'Y' here if you want your kernel to support the
diff --git a/arch/arm/mach-dove/cm-a510.c b/arch/arm/mach-dove/cm-a510.c
index 96e0e94e5fa9..03e11f9dca97 100644
--- a/arch/arm/mach-dove/cm-a510.c
+++ b/arch/arm/mach-dove/cm-a510.c
@@ -90,6 +90,7 @@ MACHINE_START(CM_A510, "Compulab CM-A510 Board")
90 .boot_params = 0x00000100, 90 .boot_params = 0x00000100,
91 .init_machine = cm_a510_init, 91 .init_machine = cm_a510_init,
92 .map_io = dove_map_io, 92 .map_io = dove_map_io,
93 .init_early = dove_init_early,
93 .init_irq = dove_init_irq, 94 .init_irq = dove_init_irq,
94 .timer = &dove_timer, 95 .timer = &dove_timer,
95MACHINE_END 96MACHINE_END
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
index fe627aba6da7..e06a88f1f81d 100644
--- a/arch/arm/mach-dove/common.c
+++ b/arch/arm/mach-dove/common.c
@@ -532,6 +532,11 @@ void __init dove_i2c_init(void)
532/***************************************************************************** 532/*****************************************************************************
533 * Time handling 533 * Time handling
534 ****************************************************************************/ 534 ****************************************************************************/
535void __init dove_init_early(void)
536{
537 orion_time_set_base(TIMER_VIRT_BASE);
538}
539
535static int get_tclk(void) 540static int get_tclk(void)
536{ 541{
537 /* use DOVE_RESET_SAMPLE_HI/LO to detect tclk */ 542 /* use DOVE_RESET_SAMPLE_HI/LO to detect tclk */
@@ -540,7 +545,8 @@ static int get_tclk(void)
540 545
541static void dove_timer_init(void) 546static void dove_timer_init(void)
542{ 547{
543 orion_time_init(IRQ_DOVE_BRIDGE, get_tclk()); 548 orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR,
549 IRQ_DOVE_BRIDGE, get_tclk());
544} 550}
545 551
546struct sys_timer dove_timer = { 552struct sys_timer dove_timer = {
diff --git a/arch/arm/mach-dove/common.h b/arch/arm/mach-dove/common.h
index a51517c3fe76..6a2046e44706 100644
--- a/arch/arm/mach-dove/common.h
+++ b/arch/arm/mach-dove/common.h
@@ -22,6 +22,7 @@ extern struct mbus_dram_target_info dove_mbus_dram_info;
22 */ 22 */
23void dove_map_io(void); 23void dove_map_io(void);
24void dove_init(void); 24void dove_init(void);
25void dove_init_early(void);
25void dove_init_irq(void); 26void dove_init_irq(void);
26void dove_setup_cpu_mbus(void); 27void dove_setup_cpu_mbus(void);
27void dove_ge00_init(struct mv643xx_eth_platform_data *eth_data); 28void dove_ge00_init(struct mv643xx_eth_platform_data *eth_data);
diff --git a/arch/arm/mach-dove/dove-db-setup.c b/arch/arm/mach-dove/dove-db-setup.c
index 95925aa76dd9..2ac34ecfa745 100644
--- a/arch/arm/mach-dove/dove-db-setup.c
+++ b/arch/arm/mach-dove/dove-db-setup.c
@@ -97,6 +97,7 @@ MACHINE_START(DOVE_DB, "Marvell DB-MV88AP510-BP Development Board")
97 .boot_params = 0x00000100, 97 .boot_params = 0x00000100,
98 .init_machine = dove_db_init, 98 .init_machine = dove_db_init,
99 .map_io = dove_map_io, 99 .map_io = dove_map_io,
100 .init_early = dove_init_early,
100 .init_irq = dove_init_irq, 101 .init_irq = dove_init_irq,
101 .timer = &dove_timer, 102 .timer = &dove_timer,
102MACHINE_END 103MACHINE_END
diff --git a/arch/arm/mach-dove/include/mach/bridge-regs.h b/arch/arm/mach-dove/include/mach/bridge-regs.h
index 214a4c31f069..226949dc4ac0 100644
--- a/arch/arm/mach-dove/include/mach/bridge-regs.h
+++ b/arch/arm/mach-dove/include/mach/bridge-regs.h
@@ -26,10 +26,6 @@
26#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE | 0x010c) 26#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE | 0x010c)
27#define SOFT_RESET 0x00000001 27#define SOFT_RESET 0x00000001
28 28
29#define BRIDGE_CAUSE (BRIDGE_VIRT_BASE | 0x0110)
30#define BRIDGE_MASK (BRIDGE_VIRT_BASE | 0x0114)
31#define BRIDGE_INT_TIMER0 0x0002
32#define BRIDGE_INT_TIMER1 0x0004
33#define BRIDGE_INT_TIMER1_CLR (~0x0004) 29#define BRIDGE_INT_TIMER1_CLR (~0x0004)
34 30
35#define IRQ_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0200) 31#define IRQ_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0200)
diff --git a/arch/arm/mach-dove/include/mach/dove.h b/arch/arm/mach-dove/include/mach/dove.h
index 27b414578f2e..e5fcdd3f5bf5 100644
--- a/arch/arm/mach-dove/include/mach/dove.h
+++ b/arch/arm/mach-dove/include/mach/dove.h
@@ -130,7 +130,8 @@
130#define DOVE_PMU_MPP_GENERAL_CTRL (DOVE_MPP_VIRT_BASE + 0x10) 130#define DOVE_PMU_MPP_GENERAL_CTRL (DOVE_MPP_VIRT_BASE + 0x10)
131#define DOVE_RESET_SAMPLE_LO (DOVE_MPP_VIRT_BASE | 0x014) 131#define DOVE_RESET_SAMPLE_LO (DOVE_MPP_VIRT_BASE | 0x014)
132#define DOVE_RESET_SAMPLE_HI (DOVE_MPP_VIRT_BASE | 0x018) 132#define DOVE_RESET_SAMPLE_HI (DOVE_MPP_VIRT_BASE | 0x018)
133#define DOVE_GPIO_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0400) 133#define DOVE_GPIO_LO_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0400)
134#define DOVE_GPIO_HI_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xd0420)
134#define DOVE_GPIO2_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe8400) 135#define DOVE_GPIO2_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe8400)
135#define DOVE_MPP_GENERAL_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe803c) 136#define DOVE_MPP_GENERAL_VIRT_BASE (DOVE_SB_REGS_VIRT_BASE | 0xe803c)
136#define DOVE_AU1_SPDIFO_GPIO_EN (1 << 1) 137#define DOVE_AU1_SPDIFO_GPIO_EN (1 << 1)
diff --git a/arch/arm/mach-dove/include/mach/gpio.h b/arch/arm/mach-dove/include/mach/gpio.h
index 340bb7af529d..e7e5101e35a5 100644
--- a/arch/arm/mach-dove/include/mach/gpio.h
+++ b/arch/arm/mach-dove/include/mach/gpio.h
@@ -6,46 +6,4 @@
6 * warranty of any kind, whether express or implied. 6 * warranty of any kind, whether express or implied.
7 */ 7 */
8 8
9#ifndef __ASM_ARCH_GPIO_H
10#define __ASM_ARCH_GPIO_H
11
12#include <asm/errno.h>
13#include <mach/irqs.h>
14#include <plat/gpio.h> 9#include <plat/gpio.h>
15#include <asm-generic/gpio.h> /* cansleep wrappers */
16
17#define GPIO_MAX 72
18
19#define GPIO_BASE_LO (DOVE_GPIO_VIRT_BASE + 0x00)
20#define GPIO_BASE_HI (DOVE_GPIO_VIRT_BASE + 0x20)
21
22#define GPIO_BASE(pin) ((pin < 32) ? GPIO_BASE_LO : \
23 ((pin < 64) ? GPIO_BASE_HI : \
24 DOVE_GPIO2_VIRT_BASE))
25
26#define GPIO_OUT(pin) (GPIO_BASE(pin) + 0x00)
27#define GPIO_IO_CONF(pin) (GPIO_BASE(pin) + 0x04)
28#define GPIO_BLINK_EN(pin) (GPIO_BASE(pin) + 0x08)
29#define GPIO_IN_POL(pin) (GPIO_BASE(pin) + 0x0c)
30#define GPIO_DATA_IN(pin) (GPIO_BASE(pin) + 0x10)
31#define GPIO_EDGE_CAUSE(pin) (GPIO_BASE(pin) + 0x14)
32#define GPIO_EDGE_MASK(pin) (GPIO_BASE(pin) + 0x18)
33#define GPIO_LEVEL_MASK(pin) (GPIO_BASE(pin) + 0x1c)
34
35static inline int gpio_to_irq(int pin)
36{
37 if (pin < NR_GPIO_IRQS)
38 return pin + IRQ_DOVE_GPIO_START;
39
40 return -EINVAL;
41}
42
43static inline int irq_to_gpio(int irq)
44{
45 if (IRQ_DOVE_GPIO_START < irq && irq < NR_IRQS)
46 return irq - IRQ_DOVE_GPIO_START;
47
48 return -EINVAL;
49}
50
51#endif
diff --git a/arch/arm/mach-dove/include/mach/irqs.h b/arch/arm/mach-dove/include/mach/irqs.h
index 46681466f92b..03d401d20453 100644
--- a/arch/arm/mach-dove/include/mach/irqs.h
+++ b/arch/arm/mach-dove/include/mach/irqs.h
@@ -92,10 +92,5 @@
92 92
93#define NR_IRQS (IRQ_DOVE_PMU_START + NR_PMU_IRQS) 93#define NR_IRQS (IRQ_DOVE_PMU_START + NR_PMU_IRQS)
94 94
95/* Required for compatability with PXA AC97 driver. */ 95
96#define IRQ_AC97 IRQ_DOVE_AC97
97/* Required for compatability with PXA DMA driver. */
98#define IRQ_DMA IRQ_DOVE_PDMA
99/* Required for compatability with PXA NAND driver */
100#define IRQ_NAND IRQ_DOVE_NAND
101#endif 96#endif
diff --git a/arch/arm/mach-dove/include/mach/memory.h b/arch/arm/mach-dove/include/mach/memory.h
index d66872074946..bbc93fee6c75 100644
--- a/arch/arm/mach-dove/include/mach/memory.h
+++ b/arch/arm/mach-dove/include/mach/memory.h
@@ -5,6 +5,6 @@
5#ifndef __ASM_ARCH_MEMORY_H 5#ifndef __ASM_ARCH_MEMORY_H
6#define __ASM_ARCH_MEMORY_H 6#define __ASM_ARCH_MEMORY_H
7 7
8#define PHYS_OFFSET UL(0x00000000) 8#define PLAT_PHYS_OFFSET UL(0x00000000)
9 9
10#endif 10#endif
diff --git a/arch/arm/mach-dove/irq.c b/arch/arm/mach-dove/irq.c
index 9317f0558b57..101707fa2e2c 100644
--- a/arch/arm/mach-dove/irq.c
+++ b/arch/arm/mach-dove/irq.c
@@ -99,11 +99,21 @@ void __init dove_init_irq(void)
99 orion_irq_init(32, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF)); 99 orion_irq_init(32, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF));
100 100
101 /* 101 /*
102 * Mask and clear GPIO IRQ interrupts. 102 * Initialize gpiolib for GPIOs 0-71.
103 */ 103 */
104 writel(0, GPIO_LEVEL_MASK(0)); 104 orion_gpio_init(0, 32, DOVE_GPIO_LO_VIRT_BASE, 0,
105 writel(0, GPIO_EDGE_MASK(0)); 105 IRQ_DOVE_GPIO_START);
106 writel(0, GPIO_EDGE_CAUSE(0)); 106 set_irq_chained_handler(IRQ_DOVE_GPIO_0_7, gpio_irq_handler);
107 set_irq_chained_handler(IRQ_DOVE_GPIO_8_15, gpio_irq_handler);
108 set_irq_chained_handler(IRQ_DOVE_GPIO_16_23, gpio_irq_handler);
109 set_irq_chained_handler(IRQ_DOVE_GPIO_24_31, gpio_irq_handler);
110
111 orion_gpio_init(32, 32, DOVE_GPIO_HI_VIRT_BASE, 0,
112 IRQ_DOVE_GPIO_START + 32);
113 set_irq_chained_handler(IRQ_DOVE_HIGH_GPIO, gpio_irq_handler);
114
115 orion_gpio_init(64, 8, DOVE_GPIO2_VIRT_BASE, 0,
116 IRQ_DOVE_GPIO_START + 64);
107 117
108 /* 118 /*
109 * Mask and clear PMU interrupts 119 * Mask and clear PMU interrupts
@@ -111,18 +121,6 @@ void __init dove_init_irq(void)
111 writel(0, PMU_INTERRUPT_MASK); 121 writel(0, PMU_INTERRUPT_MASK);
112 writel(0, PMU_INTERRUPT_CAUSE); 122 writel(0, PMU_INTERRUPT_CAUSE);
113 123
114 for (i = IRQ_DOVE_GPIO_START; i < IRQ_DOVE_PMU_START; i++) {
115 set_irq_chip(i, &orion_gpio_irq_chip);
116 set_irq_handler(i, handle_level_irq);
117 irq_desc[i].status |= IRQ_LEVEL;
118 set_irq_flags(i, IRQF_VALID);
119 }
120 set_irq_chained_handler(IRQ_DOVE_GPIO_0_7, gpio_irq_handler);
121 set_irq_chained_handler(IRQ_DOVE_GPIO_8_15, gpio_irq_handler);
122 set_irq_chained_handler(IRQ_DOVE_GPIO_16_23, gpio_irq_handler);
123 set_irq_chained_handler(IRQ_DOVE_GPIO_24_31, gpio_irq_handler);
124 set_irq_chained_handler(IRQ_DOVE_HIGH_GPIO, gpio_irq_handler);
125
126 for (i = IRQ_DOVE_PMU_START; i < NR_IRQS; i++) { 124 for (i = IRQ_DOVE_PMU_START; i < NR_IRQS; i++) {
127 set_irq_chip(i, &pmu_irq_chip); 125 set_irq_chip(i, &pmu_irq_chip);
128 set_irq_handler(i, handle_level_irq); 126 set_irq_handler(i, handle_level_irq);
diff --git a/arch/arm/mach-ebsa110/include/mach/memory.h b/arch/arm/mach-ebsa110/include/mach/memory.h
index 0ca66d080c69..8e49066ad850 100644
--- a/arch/arm/mach-ebsa110/include/mach/memory.h
+++ b/arch/arm/mach-ebsa110/include/mach/memory.h
@@ -19,7 +19,7 @@
19/* 19/*
20 * Physical DRAM offset. 20 * Physical DRAM offset.
21 */ 21 */
22#define PHYS_OFFSET UL(0x00000000) 22#define PLAT_PHYS_OFFSET UL(0x00000000)
23 23
24/* 24/*
25 * Cache flushing area - SRAM 25 * Cache flushing area - SRAM
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index ffdf87be2958..82079545adc4 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -838,7 +838,7 @@ EXPORT_SYMBOL(ep93xx_i2s_release);
838static struct resource ep93xx_ac97_resources[] = { 838static struct resource ep93xx_ac97_resources[] = {
839 { 839 {
840 .start = EP93XX_AAC_PHYS_BASE, 840 .start = EP93XX_AAC_PHYS_BASE,
841 .end = EP93XX_AAC_PHYS_BASE + 0xb0 - 1, 841 .end = EP93XX_AAC_PHYS_BASE + 0xac - 1,
842 .flags = IORESOURCE_MEM, 842 .flags = IORESOURCE_MEM,
843 }, 843 },
844 { 844 {
diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c
index 4b0431652131..9969bb115f60 100644
--- a/arch/arm/mach-ep93xx/edb93xx.c
+++ b/arch/arm/mach-ep93xx/edb93xx.c
@@ -30,8 +30,13 @@
30#include <linux/gpio.h> 30#include <linux/gpio.h>
31#include <linux/i2c.h> 31#include <linux/i2c.h>
32#include <linux/i2c-gpio.h> 32#include <linux/i2c-gpio.h>
33#include <linux/spi/spi.h>
34
35#include <sound/cs4271.h>
33 36
34#include <mach/hardware.h> 37#include <mach/hardware.h>
38#include <mach/fb.h>
39#include <mach/ep93xx_spi.h>
35 40
36#include <asm/mach-types.h> 41#include <asm/mach-types.h>
37#include <asm/mach/arch.h> 42#include <asm/mach/arch.h>
@@ -93,6 +98,83 @@ static void __init edb93xx_register_i2c(void)
93 98
94 99
95/************************************************************************* 100/*************************************************************************
101 * EDB93xx SPI peripheral handling
102 *************************************************************************/
103static struct cs4271_platform_data edb93xx_cs4271_data = {
104 .gpio_nreset = -EINVAL, /* filled in later */
105};
106
107static int edb93xx_cs4271_hw_setup(struct spi_device *spi)
108{
109 return gpio_request_one(EP93XX_GPIO_LINE_EGPIO6,
110 GPIOF_OUT_INIT_HIGH, spi->modalias);
111}
112
113static void edb93xx_cs4271_hw_cleanup(struct spi_device *spi)
114{
115 gpio_free(EP93XX_GPIO_LINE_EGPIO6);
116}
117
118static void edb93xx_cs4271_hw_cs_control(struct spi_device *spi, int value)
119{
120 gpio_set_value(EP93XX_GPIO_LINE_EGPIO6, value);
121}
122
123static struct ep93xx_spi_chip_ops edb93xx_cs4271_hw = {
124 .setup = edb93xx_cs4271_hw_setup,
125 .cleanup = edb93xx_cs4271_hw_cleanup,
126 .cs_control = edb93xx_cs4271_hw_cs_control,
127};
128
129static struct spi_board_info edb93xx_spi_board_info[] __initdata = {
130 {
131 .modalias = "cs4271",
132 .platform_data = &edb93xx_cs4271_data,
133 .controller_data = &edb93xx_cs4271_hw,
134 .max_speed_hz = 6000000,
135 .bus_num = 0,
136 .chip_select = 0,
137 .mode = SPI_MODE_3,
138 },
139};
140
141static struct ep93xx_spi_info edb93xx_spi_info __initdata = {
142 .num_chipselect = ARRAY_SIZE(edb93xx_spi_board_info),
143};
144
145static void __init edb93xx_register_spi(void)
146{
147 if (machine_is_edb9301() || machine_is_edb9302())
148 edb93xx_cs4271_data.gpio_nreset = EP93XX_GPIO_LINE_EGPIO1;
149 else if (machine_is_edb9302a() || machine_is_edb9307a())
150 edb93xx_cs4271_data.gpio_nreset = EP93XX_GPIO_LINE_H(2);
151 else if (machine_is_edb9315a())
152 edb93xx_cs4271_data.gpio_nreset = EP93XX_GPIO_LINE_EGPIO14;
153
154 ep93xx_register_spi(&edb93xx_spi_info, edb93xx_spi_board_info,
155 ARRAY_SIZE(edb93xx_spi_board_info));
156}
157
158
159/*************************************************************************
160 * EDB93xx I2S
161 *************************************************************************/
162static int __init edb93xx_has_audio(void)
163{
164 return (machine_is_edb9301() || machine_is_edb9302() ||
165 machine_is_edb9302a() || machine_is_edb9307a() ||
166 machine_is_edb9315a());
167}
168
169static void __init edb93xx_register_i2s(void)
170{
171 if (edb93xx_has_audio()) {
172 ep93xx_register_i2s();
173 }
174}
175
176
177/*************************************************************************
96 * EDB93xx pwm 178 * EDB93xx pwm
97 *************************************************************************/ 179 *************************************************************************/
98static void __init edb93xx_register_pwm(void) 180static void __init edb93xx_register_pwm(void)
@@ -111,13 +193,47 @@ static void __init edb93xx_register_pwm(void)
111} 193}
112 194
113 195
196/*************************************************************************
197 * EDB93xx framebuffer
198 *************************************************************************/
199static struct ep93xxfb_mach_info __initdata edb93xxfb_info = {
200 .num_modes = EP93XXFB_USE_MODEDB,
201 .bpp = 16,
202 .flags = 0,
203};
204
205static int __init edb93xx_has_fb(void)
206{
207 /* These platforms have an ep93xx with video capability */
208 return machine_is_edb9307() || machine_is_edb9307a() ||
209 machine_is_edb9312() || machine_is_edb9315() ||
210 machine_is_edb9315a();
211}
212
213static void __init edb93xx_register_fb(void)
214{
215 if (!edb93xx_has_fb())
216 return;
217
218 if (machine_is_edb9307a() || machine_is_edb9315a())
219 edb93xxfb_info.flags |= EP93XXFB_USE_SDCSN0;
220 else
221 edb93xxfb_info.flags |= EP93XXFB_USE_SDCSN3;
222
223 ep93xx_register_fb(&edb93xxfb_info);
224}
225
226
114static void __init edb93xx_init_machine(void) 227static void __init edb93xx_init_machine(void)
115{ 228{
116 ep93xx_init_devices(); 229 ep93xx_init_devices();
117 edb93xx_register_flash(); 230 edb93xx_register_flash();
118 ep93xx_register_eth(&edb93xx_eth_data, 1); 231 ep93xx_register_eth(&edb93xx_eth_data, 1);
119 edb93xx_register_i2c(); 232 edb93xx_register_i2c();
233 edb93xx_register_spi();
234 edb93xx_register_i2s();
120 edb93xx_register_pwm(); 235 edb93xx_register_pwm();
236 edb93xx_register_fb();
121} 237}
122 238
123 239
diff --git a/arch/arm/mach-ep93xx/gpio.c b/arch/arm/mach-ep93xx/gpio.c
index f3dc76fdcea8..a889fa7c3ba1 100644
--- a/arch/arm/mach-ep93xx/gpio.c
+++ b/arch/arm/mach-ep93xx/gpio.c
@@ -61,7 +61,7 @@ static inline void ep93xx_gpio_int_mask(unsigned line)
61 gpio_int_unmasked[line >> 3] &= ~(1 << (line & 7)); 61 gpio_int_unmasked[line >> 3] &= ~(1 << (line & 7));
62} 62}
63 63
64void ep93xx_gpio_int_debounce(unsigned int irq, int enable) 64static void ep93xx_gpio_int_debounce(unsigned int irq, bool enable)
65{ 65{
66 int line = irq_to_gpio(irq); 66 int line = irq_to_gpio(irq);
67 int port = line >> 3; 67 int port = line >> 3;
@@ -75,7 +75,6 @@ void ep93xx_gpio_int_debounce(unsigned int irq, int enable)
75 __raw_writeb(gpio_int_debounce[port], 75 __raw_writeb(gpio_int_debounce[port],
76 EP93XX_GPIO_REG(int_debounce_register_offset[port])); 76 EP93XX_GPIO_REG(int_debounce_register_offset[port]));
77} 77}
78EXPORT_SYMBOL(ep93xx_gpio_int_debounce);
79 78
80static void ep93xx_gpio_ab_irq_handler(unsigned int irq, struct irq_desc *desc) 79static void ep93xx_gpio_ab_irq_handler(unsigned int irq, struct irq_desc *desc)
81{ 80{
@@ -335,6 +334,20 @@ static void ep93xx_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
335 local_irq_restore(flags); 334 local_irq_restore(flags);
336} 335}
337 336
337static int ep93xx_gpio_set_debounce(struct gpio_chip *chip,
338 unsigned offset, unsigned debounce)
339{
340 int gpio = chip->base + offset;
341 int irq = gpio_to_irq(gpio);
342
343 if (irq < 0)
344 return -EINVAL;
345
346 ep93xx_gpio_int_debounce(irq, debounce ? true : false);
347
348 return 0;
349}
350
338static void ep93xx_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) 351static void ep93xx_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
339{ 352{
340 struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip); 353 struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip);
@@ -427,6 +440,25 @@ void __init ep93xx_gpio_init(void)
427{ 440{
428 int i; 441 int i;
429 442
430 for (i = 0; i < ARRAY_SIZE(ep93xx_gpio_banks); i++) 443 /* Set Ports C, D, E, G, and H for GPIO use */
431 gpiochip_add(&ep93xx_gpio_banks[i].chip); 444 ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_KEYS |
445 EP93XX_SYSCON_DEVCFG_GONK |
446 EP93XX_SYSCON_DEVCFG_EONIDE |
447 EP93XX_SYSCON_DEVCFG_GONIDE |
448 EP93XX_SYSCON_DEVCFG_HONIDE);
449
450 for (i = 0; i < ARRAY_SIZE(ep93xx_gpio_banks); i++) {
451 struct gpio_chip *chip = &ep93xx_gpio_banks[i].chip;
452
453 /*
454 * Ports A, B, and F support input debouncing when
455 * used as interrupts.
456 */
457 if (!strcmp(chip->label, "A") ||
458 !strcmp(chip->label, "B") ||
459 !strcmp(chip->label, "F"))
460 chip->set_debounce = ep93xx_gpio_set_debounce;
461
462 gpiochip_add(chip);
463 }
432} 464}
diff --git a/arch/arm/mach-ep93xx/include/mach/gpio.h b/arch/arm/mach-ep93xx/include/mach/gpio.h
index c991b149bdf2..c57152c231f1 100644
--- a/arch/arm/mach-ep93xx/include/mach/gpio.h
+++ b/arch/arm/mach-ep93xx/include/mach/gpio.h
@@ -99,8 +99,6 @@
99/* maximum value for irq capable line identifiers */ 99/* maximum value for irq capable line identifiers */
100#define EP93XX_GPIO_LINE_MAX_IRQ EP93XX_GPIO_LINE_F(7) 100#define EP93XX_GPIO_LINE_MAX_IRQ EP93XX_GPIO_LINE_F(7)
101 101
102extern void ep93xx_gpio_int_debounce(unsigned int irq, int enable);
103
104/* new generic GPIO API - see Documentation/gpio.txt */ 102/* new generic GPIO API - see Documentation/gpio.txt */
105 103
106#include <asm-generic/gpio.h> 104#include <asm-generic/gpio.h>
diff --git a/arch/arm/mach-ep93xx/include/mach/memory.h b/arch/arm/mach-ep93xx/include/mach/memory.h
index 554064e90307..c9400cf0051c 100644
--- a/arch/arm/mach-ep93xx/include/mach/memory.h
+++ b/arch/arm/mach-ep93xx/include/mach/memory.h
@@ -6,15 +6,15 @@
6#define __ASM_ARCH_MEMORY_H 6#define __ASM_ARCH_MEMORY_H
7 7
8#if defined(CONFIG_EP93XX_SDCE3_SYNC_PHYS_OFFSET) 8#if defined(CONFIG_EP93XX_SDCE3_SYNC_PHYS_OFFSET)
9#define PHYS_OFFSET UL(0x00000000) 9#define PLAT_PHYS_OFFSET UL(0x00000000)
10#elif defined(CONFIG_EP93XX_SDCE0_PHYS_OFFSET) 10#elif defined(CONFIG_EP93XX_SDCE0_PHYS_OFFSET)
11#define PHYS_OFFSET UL(0xc0000000) 11#define PLAT_PHYS_OFFSET UL(0xc0000000)
12#elif defined(CONFIG_EP93XX_SDCE1_PHYS_OFFSET) 12#elif defined(CONFIG_EP93XX_SDCE1_PHYS_OFFSET)
13#define PHYS_OFFSET UL(0xd0000000) 13#define PLAT_PHYS_OFFSET UL(0xd0000000)
14#elif defined(CONFIG_EP93XX_SDCE2_PHYS_OFFSET) 14#elif defined(CONFIG_EP93XX_SDCE2_PHYS_OFFSET)
15#define PHYS_OFFSET UL(0xe0000000) 15#define PLAT_PHYS_OFFSET UL(0xe0000000)
16#elif defined(CONFIG_EP93XX_SDCE3_ASYNC_PHYS_OFFSET) 16#elif defined(CONFIG_EP93XX_SDCE3_ASYNC_PHYS_OFFSET)
17#define PHYS_OFFSET UL(0xf0000000) 17#define PLAT_PHYS_OFFSET UL(0xf0000000)
18#else 18#else
19#error "Kconfig bug: No EP93xx PHYS_OFFSET set" 19#error "Kconfig bug: No EP93xx PHYS_OFFSET set"
20#endif 20#endif
diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig
new file mode 100644
index 000000000000..a021b5240bba
--- /dev/null
+++ b/arch/arm/mach-exynos4/Kconfig
@@ -0,0 +1,195 @@
1# arch/arm/mach-exynos4/Kconfig
2#
3# Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4# http://www.samsung.com/
5#
6# Licensed under GPLv2
7
8# Configuration options for the EXYNOS4
9
10if ARCH_EXYNOS4
11
12config CPU_EXYNOS4210
13 bool
14 select S3C_PL330_DMA
15 help
16 Enable EXYNOS4210 CPU support
17
18config EXYNOS4_MCT
19 bool "Kernel timer support by MCT"
20 help
21 Use MCT (Multi Core Timer) as kernel timers
22
23config EXYNOS4_DEV_PD
24 bool
25 help
26 Compile in platform device definitions for Power Domain
27
28config EXYNOS4_DEV_SYSMMU
29 bool
30 help
31 Common setup code for SYSTEM MMU in EXYNOS4
32
33config EXYNOS4_SETUP_I2C1
34 bool
35 help
36 Common setup code for i2c bus 1.
37
38config EXYNOS4_SETUP_I2C2
39 bool
40 help
41 Common setup code for i2c bus 2.
42
43config EXYNOS4_SETUP_I2C3
44 bool
45 help
46 Common setup code for i2c bus 3.
47
48config EXYNOS4_SETUP_I2C4
49 bool
50 help
51 Common setup code for i2c bus 4.
52
53config EXYNOS4_SETUP_I2C5
54 bool
55 help
56 Common setup code for i2c bus 5.
57
58config EXYNOS4_SETUP_I2C6
59 bool
60 help
61 Common setup code for i2c bus 6.
62
63config EXYNOS4_SETUP_I2C7
64 bool
65 help
66 Common setup code for i2c bus 7.
67
68config EXYNOS4_SETUP_KEYPAD
69 bool
70 help
71 Common setup code for keypad.
72
73config EXYNOS4_SETUP_SDHCI
74 bool
75 select EXYNOS4_SETUP_SDHCI_GPIO
76 help
77 Internal helper functions for EXYNOS4 based SDHCI systems.
78
79config EXYNOS4_SETUP_SDHCI_GPIO
80 bool
81 help
82 Common setup code for SDHCI gpio.
83
84config EXYNOS4_SETUP_FIMC
85 bool
86 help
87 Common setup code for the camera interfaces.
88
89# machine support
90
91menu "EXYNOS4 Machines"
92
93config MACH_SMDKC210
94 bool "SMDKC210"
95 select CPU_EXYNOS4210
96 select S3C_DEV_RTC
97 select S3C_DEV_WDT
98 select S3C_DEV_I2C1
99 select S3C_DEV_HSMMC
100 select S3C_DEV_HSMMC1
101 select S3C_DEV_HSMMC2
102 select S3C_DEV_HSMMC3
103 select EXYNOS4_DEV_PD
104 select EXYNOS4_DEV_SYSMMU
105 select EXYNOS4_SETUP_I2C1
106 select EXYNOS4_SETUP_SDHCI
107 help
108 Machine support for Samsung SMDKC210
109
110config MACH_SMDKV310
111 bool "SMDKV310"
112 select CPU_EXYNOS4210
113 select S3C_DEV_RTC
114 select S3C_DEV_WDT
115 select S3C_DEV_I2C1
116 select S3C_DEV_HSMMC
117 select S3C_DEV_HSMMC1
118 select S3C_DEV_HSMMC2
119 select S3C_DEV_HSMMC3
120 select SAMSUNG_DEV_KEYPAD
121 select EXYNOS4_DEV_PD
122 select EXYNOS4_DEV_SYSMMU
123 select EXYNOS4_SETUP_I2C1
124 select EXYNOS4_SETUP_KEYPAD
125 select EXYNOS4_SETUP_SDHCI
126 help
127 Machine support for Samsung SMDKV310
128
129config MACH_ARMLEX4210
130 bool "ARMLEX4210"
131 select CPU_EXYNOS4210
132 select S3C_DEV_RTC
133 select S3C_DEV_WDT
134 select S3C_DEV_HSMMC
135 select S3C_DEV_HSMMC2
136 select S3C_DEV_HSMMC3
137 select EXYNOS4_DEV_SYSMMU
138 select EXYNOS4_SETUP_SDHCI
139 select SATA_AHCI_PLATFORM
140 help
141 Machine support for Samsung ARMLEX4210 based on EXYNOS4210
142
143config MACH_UNIVERSAL_C210
144 bool "Mobile UNIVERSAL_C210 Board"
145 select CPU_EXYNOS4210
146 select S3C_DEV_HSMMC
147 select S3C_DEV_HSMMC2
148 select S3C_DEV_HSMMC3
149 select S3C_DEV_I2C1
150 select S3C_DEV_I2C5
151 select S5P_DEV_ONENAND
152 select EXYNOS4_SETUP_I2C1
153 select EXYNOS4_SETUP_I2C5
154 select EXYNOS4_SETUP_SDHCI
155 help
156 Machine support for Samsung Mobile Universal S5PC210 Reference
157 Board.
158
159config MACH_NURI
160 bool "Mobile NURI Board"
161 select CPU_EXYNOS4210
162 select S3C_DEV_WDT
163 select S3C_DEV_HSMMC
164 select S3C_DEV_HSMMC2
165 select S3C_DEV_HSMMC3
166 select S3C_DEV_I2C1
167 select S3C_DEV_I2C5
168 select EXYNOS4_SETUP_I2C1
169 select EXYNOS4_SETUP_I2C5
170 select EXYNOS4_SETUP_SDHCI
171 select SAMSUNG_DEV_PWM
172 help
173 Machine support for Samsung Mobile NURI Board.
174
175endmenu
176
177comment "Configuration for HSMMC bus width"
178
179menu "Use 8-bit bus width"
180
181config EXYNOS4_SDHCI_CH0_8BIT
182 bool "Channel 0 with 8-bit bus"
183 help
184 Support HSMMC Channel 0 8-bit bus.
185 If selected, Channel 1 is disabled.
186
187config EXYNOS4_SDHCI_CH2_8BIT
188 bool "Channel 2 with 8-bit bus"
189 help
190 Support HSMMC Channel 2 8-bit bus.
191 If selected, Channel 3 is disabled.
192
193endmenu
194
195endif
diff --git a/arch/arm/mach-exynos4/Makefile b/arch/arm/mach-exynos4/Makefile
new file mode 100644
index 000000000000..b8f0e7d82d7e
--- /dev/null
+++ b/arch/arm/mach-exynos4/Makefile
@@ -0,0 +1,56 @@
1# arch/arm/mach-exynos4/Makefile
2#
3# Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4# http://www.samsung.com/
5#
6# Licensed under GPLv2
7
8obj-y :=
9obj-m :=
10obj-n :=
11obj- :=
12
13# Core support for EXYNOS4 system
14
15obj-$(CONFIG_CPU_EXYNOS4210) += cpu.o init.o clock.o irq-combiner.o
16obj-$(CONFIG_CPU_EXYNOS4210) += setup-i2c0.o gpiolib.o irq-eint.o dma.o
17obj-$(CONFIG_PM) += pm.o sleep.o
18obj-$(CONFIG_CPU_FREQ) += cpufreq.o
19
20obj-$(CONFIG_SMP) += platsmp.o headsmp.o
21
22ifeq ($(CONFIG_EXYNOS4_MCT),y)
23obj-y += mct.o
24else
25obj-y += time.o
26obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
27endif
28
29obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
30
31# machine support
32
33obj-$(CONFIG_MACH_SMDKC210) += mach-smdkc210.o
34obj-$(CONFIG_MACH_SMDKV310) += mach-smdkv310.o
35obj-$(CONFIG_MACH_ARMLEX4210) += mach-armlex4210.o
36obj-$(CONFIG_MACH_UNIVERSAL_C210) += mach-universal_c210.o
37obj-$(CONFIG_MACH_NURI) += mach-nuri.o
38
39# device support
40
41obj-y += dev-audio.o
42obj-$(CONFIG_EXYNOS4_DEV_PD) += dev-pd.o
43obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) += dev-sysmmu.o
44
45obj-$(CONFIG_EXYNOS4_SETUP_FIMC) += setup-fimc.o
46obj-$(CONFIG_EXYNOS4_SETUP_I2C1) += setup-i2c1.o
47obj-$(CONFIG_EXYNOS4_SETUP_I2C2) += setup-i2c2.o
48obj-$(CONFIG_EXYNOS4_SETUP_I2C3) += setup-i2c3.o
49obj-$(CONFIG_EXYNOS4_SETUP_I2C4) += setup-i2c4.o
50obj-$(CONFIG_EXYNOS4_SETUP_I2C5) += setup-i2c5.o
51obj-$(CONFIG_EXYNOS4_SETUP_I2C6) += setup-i2c6.o
52obj-$(CONFIG_EXYNOS4_SETUP_I2C7) += setup-i2c7.o
53obj-$(CONFIG_EXYNOS4_SETUP_KEYPAD) += setup-keypad.o
54obj-$(CONFIG_EXYNOS4_SETUP_SDHCI) += setup-sdhci.o
55obj-$(CONFIG_EXYNOS4_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
56obj-$(CONFIG_SATA_AHCI_PLATFORM) += dev-ahci.o
diff --git a/arch/arm/mach-s5pv310/Makefile.boot b/arch/arm/mach-exynos4/Makefile.boot
index d65956ffb43d..d65956ffb43d 100644
--- a/arch/arm/mach-s5pv310/Makefile.boot
+++ b/arch/arm/mach-exynos4/Makefile.boot
diff --git a/arch/arm/mach-s5pv310/clock.c b/arch/arm/mach-exynos4/clock.c
index fc7c2f8d165e..871f9d508fde 100644
--- a/arch/arm/mach-s5pv310/clock.c
+++ b/arch/arm/mach-exynos4/clock.c
@@ -1,9 +1,9 @@
1/* linux/arch/arm/mach-s5pv310/clock.c 1/* linux/arch/arm/mach-exynos4/clock.c
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * S5PV310 - Clock support 6 * EXYNOS4 - Clock support
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -23,6 +23,7 @@
23 23
24#include <mach/map.h> 24#include <mach/map.h>
25#include <mach/regs-clock.h> 25#include <mach/regs-clock.h>
26#include <mach/sysmmu.h>
26 27
27static struct clk clk_sclk_hdmi27m = { 28static struct clk clk_sclk_hdmi27m = {
28 .name = "sclk_hdmi27m", 29 .name = "sclk_hdmi27m",
@@ -46,72 +47,82 @@ static struct clk clk_sclk_usbphy1 = {
46 .id = -1, 47 .id = -1,
47}; 48};
48 49
49static int s5pv310_clksrc_mask_top_ctrl(struct clk *clk, int enable) 50static int exynos4_clksrc_mask_top_ctrl(struct clk *clk, int enable)
50{ 51{
51 return s5p_gatectrl(S5P_CLKSRC_MASK_TOP, clk, enable); 52 return s5p_gatectrl(S5P_CLKSRC_MASK_TOP, clk, enable);
52} 53}
53 54
54static int s5pv310_clksrc_mask_cam_ctrl(struct clk *clk, int enable) 55static int exynos4_clksrc_mask_cam_ctrl(struct clk *clk, int enable)
55{ 56{
56 return s5p_gatectrl(S5P_CLKSRC_MASK_CAM, clk, enable); 57 return s5p_gatectrl(S5P_CLKSRC_MASK_CAM, clk, enable);
57} 58}
58 59
59static int s5pv310_clksrc_mask_lcd0_ctrl(struct clk *clk, int enable) 60static int exynos4_clksrc_mask_lcd0_ctrl(struct clk *clk, int enable)
60{ 61{
61 return s5p_gatectrl(S5P_CLKSRC_MASK_LCD0, clk, enable); 62 return s5p_gatectrl(S5P_CLKSRC_MASK_LCD0, clk, enable);
62} 63}
63 64
64static int s5pv310_clksrc_mask_lcd1_ctrl(struct clk *clk, int enable) 65static int exynos4_clksrc_mask_lcd1_ctrl(struct clk *clk, int enable)
65{ 66{
66 return s5p_gatectrl(S5P_CLKSRC_MASK_LCD1, clk, enable); 67 return s5p_gatectrl(S5P_CLKSRC_MASK_LCD1, clk, enable);
67} 68}
68 69
69static int s5pv310_clksrc_mask_fsys_ctrl(struct clk *clk, int enable) 70static int exynos4_clksrc_mask_fsys_ctrl(struct clk *clk, int enable)
70{ 71{
71 return s5p_gatectrl(S5P_CLKSRC_MASK_FSYS, clk, enable); 72 return s5p_gatectrl(S5P_CLKSRC_MASK_FSYS, clk, enable);
72} 73}
73 74
74static int s5pv310_clksrc_mask_peril0_ctrl(struct clk *clk, int enable) 75static int exynos4_clksrc_mask_peril0_ctrl(struct clk *clk, int enable)
75{ 76{
76 return s5p_gatectrl(S5P_CLKSRC_MASK_PERIL0, clk, enable); 77 return s5p_gatectrl(S5P_CLKSRC_MASK_PERIL0, clk, enable);
77} 78}
78 79
79static int s5pv310_clksrc_mask_peril1_ctrl(struct clk *clk, int enable) 80static int exynos4_clksrc_mask_peril1_ctrl(struct clk *clk, int enable)
80{ 81{
81 return s5p_gatectrl(S5P_CLKSRC_MASK_PERIL1, clk, enable); 82 return s5p_gatectrl(S5P_CLKSRC_MASK_PERIL1, clk, enable);
82} 83}
83 84
84static int s5pv310_clk_ip_cam_ctrl(struct clk *clk, int enable) 85static int exynos4_clk_ip_mfc_ctrl(struct clk *clk, int enable)
86{
87 return s5p_gatectrl(S5P_CLKGATE_IP_MFC, clk, enable);
88}
89
90static int exynos4_clk_ip_cam_ctrl(struct clk *clk, int enable)
85{ 91{
86 return s5p_gatectrl(S5P_CLKGATE_IP_CAM, clk, enable); 92 return s5p_gatectrl(S5P_CLKGATE_IP_CAM, clk, enable);
87} 93}
88 94
89static int s5pv310_clk_ip_image_ctrl(struct clk *clk, int enable) 95static int exynos4_clk_ip_tv_ctrl(struct clk *clk, int enable)
96{
97 return s5p_gatectrl(S5P_CLKGATE_IP_TV, clk, enable);
98}
99
100static int exynos4_clk_ip_image_ctrl(struct clk *clk, int enable)
90{ 101{
91 return s5p_gatectrl(S5P_CLKGATE_IP_IMAGE, clk, enable); 102 return s5p_gatectrl(S5P_CLKGATE_IP_IMAGE, clk, enable);
92} 103}
93 104
94static int s5pv310_clk_ip_lcd0_ctrl(struct clk *clk, int enable) 105static int exynos4_clk_ip_lcd0_ctrl(struct clk *clk, int enable)
95{ 106{
96 return s5p_gatectrl(S5P_CLKGATE_IP_LCD0, clk, enable); 107 return s5p_gatectrl(S5P_CLKGATE_IP_LCD0, clk, enable);
97} 108}
98 109
99static int s5pv310_clk_ip_lcd1_ctrl(struct clk *clk, int enable) 110static int exynos4_clk_ip_lcd1_ctrl(struct clk *clk, int enable)
100{ 111{
101 return s5p_gatectrl(S5P_CLKGATE_IP_LCD1, clk, enable); 112 return s5p_gatectrl(S5P_CLKGATE_IP_LCD1, clk, enable);
102} 113}
103 114
104static int s5pv310_clk_ip_fsys_ctrl(struct clk *clk, int enable) 115static int exynos4_clk_ip_fsys_ctrl(struct clk *clk, int enable)
105{ 116{
106 return s5p_gatectrl(S5P_CLKGATE_IP_FSYS, clk, enable); 117 return s5p_gatectrl(S5P_CLKGATE_IP_FSYS, clk, enable);
107} 118}
108 119
109static int s5pv310_clk_ip_peril_ctrl(struct clk *clk, int enable) 120static int exynos4_clk_ip_peril_ctrl(struct clk *clk, int enable)
110{ 121{
111 return s5p_gatectrl(S5P_CLKGATE_IP_PERIL, clk, enable); 122 return s5p_gatectrl(S5P_CLKGATE_IP_PERIL, clk, enable);
112} 123}
113 124
114static int s5pv310_clk_ip_perir_ctrl(struct clk *clk, int enable) 125static int exynos4_clk_ip_perir_ctrl(struct clk *clk, int enable)
115{ 126{
116 return s5p_gatectrl(S5P_CLKGATE_IP_PERIR, clk, enable); 127 return s5p_gatectrl(S5P_CLKGATE_IP_PERIR, clk, enable);
117} 128}
@@ -358,7 +369,7 @@ static struct clksrc_clk clk_vpllsrc = {
358 .clk = { 369 .clk = {
359 .name = "vpll_src", 370 .name = "vpll_src",
360 .id = -1, 371 .id = -1,
361 .enable = s5pv310_clksrc_mask_top_ctrl, 372 .enable = exynos4_clksrc_mask_top_ctrl,
362 .ctrlbit = (1 << 0), 373 .ctrlbit = (1 << 0),
363 }, 374 },
364 .sources = &clkset_vpllsrc, 375 .sources = &clkset_vpllsrc,
@@ -389,239 +400,322 @@ static struct clk init_clocks_off[] = {
389 .name = "timers", 400 .name = "timers",
390 .id = -1, 401 .id = -1,
391 .parent = &clk_aclk_100.clk, 402 .parent = &clk_aclk_100.clk,
392 .enable = s5pv310_clk_ip_peril_ctrl, 403 .enable = exynos4_clk_ip_peril_ctrl,
393 .ctrlbit = (1<<24), 404 .ctrlbit = (1<<24),
394 }, { 405 }, {
395 .name = "csis", 406 .name = "csis",
396 .id = 0, 407 .id = 0,
397 .enable = s5pv310_clk_ip_cam_ctrl, 408 .enable = exynos4_clk_ip_cam_ctrl,
398 .ctrlbit = (1 << 4), 409 .ctrlbit = (1 << 4),
399 }, { 410 }, {
400 .name = "csis", 411 .name = "csis",
401 .id = 1, 412 .id = 1,
402 .enable = s5pv310_clk_ip_cam_ctrl, 413 .enable = exynos4_clk_ip_cam_ctrl,
403 .ctrlbit = (1 << 5), 414 .ctrlbit = (1 << 5),
404 }, { 415 }, {
405 .name = "fimc", 416 .name = "fimc",
406 .id = 0, 417 .id = 0,
407 .enable = s5pv310_clk_ip_cam_ctrl, 418 .enable = exynos4_clk_ip_cam_ctrl,
408 .ctrlbit = (1 << 0), 419 .ctrlbit = (1 << 0),
409 }, { 420 }, {
410 .name = "fimc", 421 .name = "fimc",
411 .id = 1, 422 .id = 1,
412 .enable = s5pv310_clk_ip_cam_ctrl, 423 .enable = exynos4_clk_ip_cam_ctrl,
413 .ctrlbit = (1 << 1), 424 .ctrlbit = (1 << 1),
414 }, { 425 }, {
415 .name = "fimc", 426 .name = "fimc",
416 .id = 2, 427 .id = 2,
417 .enable = s5pv310_clk_ip_cam_ctrl, 428 .enable = exynos4_clk_ip_cam_ctrl,
418 .ctrlbit = (1 << 2), 429 .ctrlbit = (1 << 2),
419 }, { 430 }, {
420 .name = "fimc", 431 .name = "fimc",
421 .id = 3, 432 .id = 3,
422 .enable = s5pv310_clk_ip_cam_ctrl, 433 .enable = exynos4_clk_ip_cam_ctrl,
423 .ctrlbit = (1 << 3), 434 .ctrlbit = (1 << 3),
424 }, { 435 }, {
425 .name = "fimd", 436 .name = "fimd",
426 .id = 0, 437 .id = 0,
427 .enable = s5pv310_clk_ip_lcd0_ctrl, 438 .enable = exynos4_clk_ip_lcd0_ctrl,
428 .ctrlbit = (1 << 0), 439 .ctrlbit = (1 << 0),
429 }, { 440 }, {
430 .name = "fimd", 441 .name = "fimd",
431 .id = 1, 442 .id = 1,
432 .enable = s5pv310_clk_ip_lcd1_ctrl, 443 .enable = exynos4_clk_ip_lcd1_ctrl,
433 .ctrlbit = (1 << 0), 444 .ctrlbit = (1 << 0),
434 }, { 445 }, {
446 .name = "sataphy",
447 .id = -1,
448 .parent = &clk_aclk_133.clk,
449 .enable = exynos4_clk_ip_fsys_ctrl,
450 .ctrlbit = (1 << 3),
451 }, {
435 .name = "hsmmc", 452 .name = "hsmmc",
436 .id = 0, 453 .id = 0,
437 .parent = &clk_aclk_133.clk, 454 .parent = &clk_aclk_133.clk,
438 .enable = s5pv310_clk_ip_fsys_ctrl, 455 .enable = exynos4_clk_ip_fsys_ctrl,
439 .ctrlbit = (1 << 5), 456 .ctrlbit = (1 << 5),
440 }, { 457 }, {
441 .name = "hsmmc", 458 .name = "hsmmc",
442 .id = 1, 459 .id = 1,
443 .parent = &clk_aclk_133.clk, 460 .parent = &clk_aclk_133.clk,
444 .enable = s5pv310_clk_ip_fsys_ctrl, 461 .enable = exynos4_clk_ip_fsys_ctrl,
445 .ctrlbit = (1 << 6), 462 .ctrlbit = (1 << 6),
446 }, { 463 }, {
447 .name = "hsmmc", 464 .name = "hsmmc",
448 .id = 2, 465 .id = 2,
449 .parent = &clk_aclk_133.clk, 466 .parent = &clk_aclk_133.clk,
450 .enable = s5pv310_clk_ip_fsys_ctrl, 467 .enable = exynos4_clk_ip_fsys_ctrl,
451 .ctrlbit = (1 << 7), 468 .ctrlbit = (1 << 7),
452 }, { 469 }, {
453 .name = "hsmmc", 470 .name = "hsmmc",
454 .id = 3, 471 .id = 3,
455 .parent = &clk_aclk_133.clk, 472 .parent = &clk_aclk_133.clk,
456 .enable = s5pv310_clk_ip_fsys_ctrl, 473 .enable = exynos4_clk_ip_fsys_ctrl,
457 .ctrlbit = (1 << 8), 474 .ctrlbit = (1 << 8),
458 }, { 475 }, {
459 .name = "hsmmc", 476 .name = "hsmmc",
460 .id = 4, 477 .id = 4,
461 .parent = &clk_aclk_133.clk, 478 .parent = &clk_aclk_133.clk,
462 .enable = s5pv310_clk_ip_fsys_ctrl, 479 .enable = exynos4_clk_ip_fsys_ctrl,
463 .ctrlbit = (1 << 9), 480 .ctrlbit = (1 << 9),
464 }, { 481 }, {
465 .name = "sata", 482 .name = "sata",
466 .id = -1, 483 .id = -1,
467 .enable = s5pv310_clk_ip_fsys_ctrl, 484 .parent = &clk_aclk_133.clk,
485 .enable = exynos4_clk_ip_fsys_ctrl,
468 .ctrlbit = (1 << 10), 486 .ctrlbit = (1 << 10),
469 }, { 487 }, {
470 .name = "pdma", 488 .name = "pdma",
471 .id = 0, 489 .id = 0,
472 .enable = s5pv310_clk_ip_fsys_ctrl, 490 .enable = exynos4_clk_ip_fsys_ctrl,
473 .ctrlbit = (1 << 0), 491 .ctrlbit = (1 << 0),
474 }, { 492 }, {
475 .name = "pdma", 493 .name = "pdma",
476 .id = 1, 494 .id = 1,
477 .enable = s5pv310_clk_ip_fsys_ctrl, 495 .enable = exynos4_clk_ip_fsys_ctrl,
478 .ctrlbit = (1 << 1), 496 .ctrlbit = (1 << 1),
479 }, { 497 }, {
480 .name = "adc", 498 .name = "adc",
481 .id = -1, 499 .id = -1,
482 .enable = s5pv310_clk_ip_peril_ctrl, 500 .enable = exynos4_clk_ip_peril_ctrl,
483 .ctrlbit = (1 << 15), 501 .ctrlbit = (1 << 15),
484 }, { 502 }, {
503 .name = "keypad",
504 .id = -1,
505 .enable = exynos4_clk_ip_perir_ctrl,
506 .ctrlbit = (1 << 16),
507 }, {
485 .name = "rtc", 508 .name = "rtc",
486 .id = -1, 509 .id = -1,
487 .enable = s5pv310_clk_ip_perir_ctrl, 510 .enable = exynos4_clk_ip_perir_ctrl,
488 .ctrlbit = (1 << 15), 511 .ctrlbit = (1 << 15),
489 }, { 512 }, {
490 .name = "watchdog", 513 .name = "watchdog",
491 .id = -1, 514 .id = -1,
492 .enable = s5pv310_clk_ip_perir_ctrl, 515 .parent = &clk_aclk_100.clk,
516 .enable = exynos4_clk_ip_perir_ctrl,
493 .ctrlbit = (1 << 14), 517 .ctrlbit = (1 << 14),
494 }, { 518 }, {
495 .name = "usbhost", 519 .name = "usbhost",
496 .id = -1, 520 .id = -1,
497 .enable = s5pv310_clk_ip_fsys_ctrl , 521 .enable = exynos4_clk_ip_fsys_ctrl ,
498 .ctrlbit = (1 << 12), 522 .ctrlbit = (1 << 12),
499 }, { 523 }, {
500 .name = "otg", 524 .name = "otg",
501 .id = -1, 525 .id = -1,
502 .enable = s5pv310_clk_ip_fsys_ctrl, 526 .enable = exynos4_clk_ip_fsys_ctrl,
503 .ctrlbit = (1 << 13), 527 .ctrlbit = (1 << 13),
504 }, { 528 }, {
505 .name = "spi", 529 .name = "spi",
506 .id = 0, 530 .id = 0,
507 .enable = s5pv310_clk_ip_peril_ctrl, 531 .enable = exynos4_clk_ip_peril_ctrl,
508 .ctrlbit = (1 << 16), 532 .ctrlbit = (1 << 16),
509 }, { 533 }, {
510 .name = "spi", 534 .name = "spi",
511 .id = 1, 535 .id = 1,
512 .enable = s5pv310_clk_ip_peril_ctrl, 536 .enable = exynos4_clk_ip_peril_ctrl,
513 .ctrlbit = (1 << 17), 537 .ctrlbit = (1 << 17),
514 }, { 538 }, {
515 .name = "spi", 539 .name = "spi",
516 .id = 2, 540 .id = 2,
517 .enable = s5pv310_clk_ip_peril_ctrl, 541 .enable = exynos4_clk_ip_peril_ctrl,
518 .ctrlbit = (1 << 18), 542 .ctrlbit = (1 << 18),
519 }, { 543 }, {
520 .name = "iis", 544 .name = "iis",
521 .id = 0, 545 .id = 0,
522 .enable = s5pv310_clk_ip_peril_ctrl, 546 .enable = exynos4_clk_ip_peril_ctrl,
523 .ctrlbit = (1 << 19), 547 .ctrlbit = (1 << 19),
524 }, { 548 }, {
525 .name = "iis", 549 .name = "iis",
526 .id = 1, 550 .id = 1,
527 .enable = s5pv310_clk_ip_peril_ctrl, 551 .enable = exynos4_clk_ip_peril_ctrl,
528 .ctrlbit = (1 << 20), 552 .ctrlbit = (1 << 20),
529 }, { 553 }, {
530 .name = "iis", 554 .name = "iis",
531 .id = 2, 555 .id = 2,
532 .enable = s5pv310_clk_ip_peril_ctrl, 556 .enable = exynos4_clk_ip_peril_ctrl,
533 .ctrlbit = (1 << 21), 557 .ctrlbit = (1 << 21),
534 }, { 558 }, {
535 .name = "ac97", 559 .name = "ac97",
536 .id = -1, 560 .id = -1,
537 .enable = s5pv310_clk_ip_peril_ctrl, 561 .enable = exynos4_clk_ip_peril_ctrl,
538 .ctrlbit = (1 << 27), 562 .ctrlbit = (1 << 27),
539 }, { 563 }, {
540 .name = "fimg2d", 564 .name = "fimg2d",
541 .id = -1, 565 .id = -1,
542 .enable = s5pv310_clk_ip_image_ctrl, 566 .enable = exynos4_clk_ip_image_ctrl,
543 .ctrlbit = (1 << 0), 567 .ctrlbit = (1 << 0),
544 }, { 568 }, {
545 .name = "i2c", 569 .name = "i2c",
546 .id = 0, 570 .id = 0,
547 .parent = &clk_aclk_100.clk, 571 .parent = &clk_aclk_100.clk,
548 .enable = s5pv310_clk_ip_peril_ctrl, 572 .enable = exynos4_clk_ip_peril_ctrl,
549 .ctrlbit = (1 << 6), 573 .ctrlbit = (1 << 6),
550 }, { 574 }, {
551 .name = "i2c", 575 .name = "i2c",
552 .id = 1, 576 .id = 1,
553 .parent = &clk_aclk_100.clk, 577 .parent = &clk_aclk_100.clk,
554 .enable = s5pv310_clk_ip_peril_ctrl, 578 .enable = exynos4_clk_ip_peril_ctrl,
555 .ctrlbit = (1 << 7), 579 .ctrlbit = (1 << 7),
556 }, { 580 }, {
557 .name = "i2c", 581 .name = "i2c",
558 .id = 2, 582 .id = 2,
559 .parent = &clk_aclk_100.clk, 583 .parent = &clk_aclk_100.clk,
560 .enable = s5pv310_clk_ip_peril_ctrl, 584 .enable = exynos4_clk_ip_peril_ctrl,
561 .ctrlbit = (1 << 8), 585 .ctrlbit = (1 << 8),
562 }, { 586 }, {
563 .name = "i2c", 587 .name = "i2c",
564 .id = 3, 588 .id = 3,
565 .parent = &clk_aclk_100.clk, 589 .parent = &clk_aclk_100.clk,
566 .enable = s5pv310_clk_ip_peril_ctrl, 590 .enable = exynos4_clk_ip_peril_ctrl,
567 .ctrlbit = (1 << 9), 591 .ctrlbit = (1 << 9),
568 }, { 592 }, {
569 .name = "i2c", 593 .name = "i2c",
570 .id = 4, 594 .id = 4,
571 .parent = &clk_aclk_100.clk, 595 .parent = &clk_aclk_100.clk,
572 .enable = s5pv310_clk_ip_peril_ctrl, 596 .enable = exynos4_clk_ip_peril_ctrl,
573 .ctrlbit = (1 << 10), 597 .ctrlbit = (1 << 10),
574 }, { 598 }, {
575 .name = "i2c", 599 .name = "i2c",
576 .id = 5, 600 .id = 5,
577 .parent = &clk_aclk_100.clk, 601 .parent = &clk_aclk_100.clk,
578 .enable = s5pv310_clk_ip_peril_ctrl, 602 .enable = exynos4_clk_ip_peril_ctrl,
579 .ctrlbit = (1 << 11), 603 .ctrlbit = (1 << 11),
580 }, { 604 }, {
581 .name = "i2c", 605 .name = "i2c",
582 .id = 6, 606 .id = 6,
583 .parent = &clk_aclk_100.clk, 607 .parent = &clk_aclk_100.clk,
584 .enable = s5pv310_clk_ip_peril_ctrl, 608 .enable = exynos4_clk_ip_peril_ctrl,
585 .ctrlbit = (1 << 12), 609 .ctrlbit = (1 << 12),
586 }, { 610 }, {
587 .name = "i2c", 611 .name = "i2c",
588 .id = 7, 612 .id = 7,
589 .parent = &clk_aclk_100.clk, 613 .parent = &clk_aclk_100.clk,
590 .enable = s5pv310_clk_ip_peril_ctrl, 614 .enable = exynos4_clk_ip_peril_ctrl,
591 .ctrlbit = (1 << 13), 615 .ctrlbit = (1 << 13),
592 }, 616 }, {
617 .name = "SYSMMU_MDMA",
618 .id = -1,
619 .enable = exynos4_clk_ip_image_ctrl,
620 .ctrlbit = (1 << 5),
621 }, {
622 .name = "SYSMMU_FIMC0",
623 .id = -1,
624 .enable = exynos4_clk_ip_cam_ctrl,
625 .ctrlbit = (1 << 7),
626 }, {
627 .name = "SYSMMU_FIMC1",
628 .id = -1,
629 .enable = exynos4_clk_ip_cam_ctrl,
630 .ctrlbit = (1 << 8),
631 }, {
632 .name = "SYSMMU_FIMC2",
633 .id = -1,
634 .enable = exynos4_clk_ip_cam_ctrl,
635 .ctrlbit = (1 << 9),
636 }, {
637 .name = "SYSMMU_FIMC3",
638 .id = -1,
639 .enable = exynos4_clk_ip_cam_ctrl,
640 .ctrlbit = (1 << 10),
641 }, {
642 .name = "SYSMMU_JPEG",
643 .id = -1,
644 .enable = exynos4_clk_ip_cam_ctrl,
645 .ctrlbit = (1 << 11),
646 }, {
647 .name = "SYSMMU_FIMD0",
648 .id = -1,
649 .enable = exynos4_clk_ip_lcd0_ctrl,
650 .ctrlbit = (1 << 4),
651 }, {
652 .name = "SYSMMU_FIMD1",
653 .id = -1,
654 .enable = exynos4_clk_ip_lcd1_ctrl,
655 .ctrlbit = (1 << 4),
656 }, {
657 .name = "SYSMMU_PCIe",
658 .id = -1,
659 .enable = exynos4_clk_ip_fsys_ctrl,
660 .ctrlbit = (1 << 18),
661 }, {
662 .name = "SYSMMU_G2D",
663 .id = -1,
664 .enable = exynos4_clk_ip_image_ctrl,
665 .ctrlbit = (1 << 3),
666 }, {
667 .name = "SYSMMU_ROTATOR",
668 .id = -1,
669 .enable = exynos4_clk_ip_image_ctrl,
670 .ctrlbit = (1 << 4),
671 }, {
672 .name = "SYSMMU_TV",
673 .id = -1,
674 .enable = exynos4_clk_ip_tv_ctrl,
675 .ctrlbit = (1 << 4),
676 }, {
677 .name = "SYSMMU_MFC_L",
678 .id = -1,
679 .enable = exynos4_clk_ip_mfc_ctrl,
680 .ctrlbit = (1 << 1),
681 }, {
682 .name = "SYSMMU_MFC_R",
683 .id = -1,
684 .enable = exynos4_clk_ip_mfc_ctrl,
685 .ctrlbit = (1 << 2),
686 }
593}; 687};
594 688
595static struct clk init_clocks[] = { 689static struct clk init_clocks[] = {
596 { 690 {
597 .name = "uart", 691 .name = "uart",
598 .id = 0, 692 .id = 0,
599 .enable = s5pv310_clk_ip_peril_ctrl, 693 .enable = exynos4_clk_ip_peril_ctrl,
600 .ctrlbit = (1 << 0), 694 .ctrlbit = (1 << 0),
601 }, { 695 }, {
602 .name = "uart", 696 .name = "uart",
603 .id = 1, 697 .id = 1,
604 .enable = s5pv310_clk_ip_peril_ctrl, 698 .enable = exynos4_clk_ip_peril_ctrl,
605 .ctrlbit = (1 << 1), 699 .ctrlbit = (1 << 1),
606 }, { 700 }, {
607 .name = "uart", 701 .name = "uart",
608 .id = 2, 702 .id = 2,
609 .enable = s5pv310_clk_ip_peril_ctrl, 703 .enable = exynos4_clk_ip_peril_ctrl,
610 .ctrlbit = (1 << 2), 704 .ctrlbit = (1 << 2),
611 }, { 705 }, {
612 .name = "uart", 706 .name = "uart",
613 .id = 3, 707 .id = 3,
614 .enable = s5pv310_clk_ip_peril_ctrl, 708 .enable = exynos4_clk_ip_peril_ctrl,
615 .ctrlbit = (1 << 3), 709 .ctrlbit = (1 << 3),
616 }, { 710 }, {
617 .name = "uart", 711 .name = "uart",
618 .id = 4, 712 .id = 4,
619 .enable = s5pv310_clk_ip_peril_ctrl, 713 .enable = exynos4_clk_ip_peril_ctrl,
620 .ctrlbit = (1 << 4), 714 .ctrlbit = (1 << 4),
621 }, { 715 }, {
622 .name = "uart", 716 .name = "uart",
623 .id = 5, 717 .id = 5,
624 .enable = s5pv310_clk_ip_peril_ctrl, 718 .enable = exynos4_clk_ip_peril_ctrl,
625 .ctrlbit = (1 << 5), 719 .ctrlbit = (1 << 5),
626 } 720 }
627}; 721};
@@ -746,7 +840,7 @@ static struct clksrc_clk clksrcs[] = {
746 .clk = { 840 .clk = {
747 .name = "uclk1", 841 .name = "uclk1",
748 .id = 0, 842 .id = 0,
749 .enable = s5pv310_clksrc_mask_peril0_ctrl, 843 .enable = exynos4_clksrc_mask_peril0_ctrl,
750 .ctrlbit = (1 << 0), 844 .ctrlbit = (1 << 0),
751 }, 845 },
752 .sources = &clkset_group, 846 .sources = &clkset_group,
@@ -756,7 +850,7 @@ static struct clksrc_clk clksrcs[] = {
756 .clk = { 850 .clk = {
757 .name = "uclk1", 851 .name = "uclk1",
758 .id = 1, 852 .id = 1,
759 .enable = s5pv310_clksrc_mask_peril0_ctrl, 853 .enable = exynos4_clksrc_mask_peril0_ctrl,
760 .ctrlbit = (1 << 4), 854 .ctrlbit = (1 << 4),
761 }, 855 },
762 .sources = &clkset_group, 856 .sources = &clkset_group,
@@ -766,7 +860,7 @@ static struct clksrc_clk clksrcs[] = {
766 .clk = { 860 .clk = {
767 .name = "uclk1", 861 .name = "uclk1",
768 .id = 2, 862 .id = 2,
769 .enable = s5pv310_clksrc_mask_peril0_ctrl, 863 .enable = exynos4_clksrc_mask_peril0_ctrl,
770 .ctrlbit = (1 << 8), 864 .ctrlbit = (1 << 8),
771 }, 865 },
772 .sources = &clkset_group, 866 .sources = &clkset_group,
@@ -776,7 +870,7 @@ static struct clksrc_clk clksrcs[] = {
776 .clk = { 870 .clk = {
777 .name = "uclk1", 871 .name = "uclk1",
778 .id = 3, 872 .id = 3,
779 .enable = s5pv310_clksrc_mask_peril0_ctrl, 873 .enable = exynos4_clksrc_mask_peril0_ctrl,
780 .ctrlbit = (1 << 12), 874 .ctrlbit = (1 << 12),
781 }, 875 },
782 .sources = &clkset_group, 876 .sources = &clkset_group,
@@ -786,7 +880,7 @@ static struct clksrc_clk clksrcs[] = {
786 .clk = { 880 .clk = {
787 .name = "sclk_pwm", 881 .name = "sclk_pwm",
788 .id = -1, 882 .id = -1,
789 .enable = s5pv310_clksrc_mask_peril0_ctrl, 883 .enable = exynos4_clksrc_mask_peril0_ctrl,
790 .ctrlbit = (1 << 24), 884 .ctrlbit = (1 << 24),
791 }, 885 },
792 .sources = &clkset_group, 886 .sources = &clkset_group,
@@ -796,7 +890,7 @@ static struct clksrc_clk clksrcs[] = {
796 .clk = { 890 .clk = {
797 .name = "sclk_csis", 891 .name = "sclk_csis",
798 .id = 0, 892 .id = 0,
799 .enable = s5pv310_clksrc_mask_cam_ctrl, 893 .enable = exynos4_clksrc_mask_cam_ctrl,
800 .ctrlbit = (1 << 24), 894 .ctrlbit = (1 << 24),
801 }, 895 },
802 .sources = &clkset_group, 896 .sources = &clkset_group,
@@ -806,7 +900,7 @@ static struct clksrc_clk clksrcs[] = {
806 .clk = { 900 .clk = {
807 .name = "sclk_csis", 901 .name = "sclk_csis",
808 .id = 1, 902 .id = 1,
809 .enable = s5pv310_clksrc_mask_cam_ctrl, 903 .enable = exynos4_clksrc_mask_cam_ctrl,
810 .ctrlbit = (1 << 28), 904 .ctrlbit = (1 << 28),
811 }, 905 },
812 .sources = &clkset_group, 906 .sources = &clkset_group,
@@ -816,7 +910,7 @@ static struct clksrc_clk clksrcs[] = {
816 .clk = { 910 .clk = {
817 .name = "sclk_cam", 911 .name = "sclk_cam",
818 .id = 0, 912 .id = 0,
819 .enable = s5pv310_clksrc_mask_cam_ctrl, 913 .enable = exynos4_clksrc_mask_cam_ctrl,
820 .ctrlbit = (1 << 16), 914 .ctrlbit = (1 << 16),
821 }, 915 },
822 .sources = &clkset_group, 916 .sources = &clkset_group,
@@ -826,7 +920,7 @@ static struct clksrc_clk clksrcs[] = {
826 .clk = { 920 .clk = {
827 .name = "sclk_cam", 921 .name = "sclk_cam",
828 .id = 1, 922 .id = 1,
829 .enable = s5pv310_clksrc_mask_cam_ctrl, 923 .enable = exynos4_clksrc_mask_cam_ctrl,
830 .ctrlbit = (1 << 20), 924 .ctrlbit = (1 << 20),
831 }, 925 },
832 .sources = &clkset_group, 926 .sources = &clkset_group,
@@ -836,7 +930,7 @@ static struct clksrc_clk clksrcs[] = {
836 .clk = { 930 .clk = {
837 .name = "sclk_fimc", 931 .name = "sclk_fimc",
838 .id = 0, 932 .id = 0,
839 .enable = s5pv310_clksrc_mask_cam_ctrl, 933 .enable = exynos4_clksrc_mask_cam_ctrl,
840 .ctrlbit = (1 << 0), 934 .ctrlbit = (1 << 0),
841 }, 935 },
842 .sources = &clkset_group, 936 .sources = &clkset_group,
@@ -846,7 +940,7 @@ static struct clksrc_clk clksrcs[] = {
846 .clk = { 940 .clk = {
847 .name = "sclk_fimc", 941 .name = "sclk_fimc",
848 .id = 1, 942 .id = 1,
849 .enable = s5pv310_clksrc_mask_cam_ctrl, 943 .enable = exynos4_clksrc_mask_cam_ctrl,
850 .ctrlbit = (1 << 4), 944 .ctrlbit = (1 << 4),
851 }, 945 },
852 .sources = &clkset_group, 946 .sources = &clkset_group,
@@ -856,7 +950,7 @@ static struct clksrc_clk clksrcs[] = {
856 .clk = { 950 .clk = {
857 .name = "sclk_fimc", 951 .name = "sclk_fimc",
858 .id = 2, 952 .id = 2,
859 .enable = s5pv310_clksrc_mask_cam_ctrl, 953 .enable = exynos4_clksrc_mask_cam_ctrl,
860 .ctrlbit = (1 << 8), 954 .ctrlbit = (1 << 8),
861 }, 955 },
862 .sources = &clkset_group, 956 .sources = &clkset_group,
@@ -866,7 +960,7 @@ static struct clksrc_clk clksrcs[] = {
866 .clk = { 960 .clk = {
867 .name = "sclk_fimc", 961 .name = "sclk_fimc",
868 .id = 3, 962 .id = 3,
869 .enable = s5pv310_clksrc_mask_cam_ctrl, 963 .enable = exynos4_clksrc_mask_cam_ctrl,
870 .ctrlbit = (1 << 12), 964 .ctrlbit = (1 << 12),
871 }, 965 },
872 .sources = &clkset_group, 966 .sources = &clkset_group,
@@ -876,7 +970,7 @@ static struct clksrc_clk clksrcs[] = {
876 .clk = { 970 .clk = {
877 .name = "sclk_fimd", 971 .name = "sclk_fimd",
878 .id = 0, 972 .id = 0,
879 .enable = s5pv310_clksrc_mask_lcd0_ctrl, 973 .enable = exynos4_clksrc_mask_lcd0_ctrl,
880 .ctrlbit = (1 << 0), 974 .ctrlbit = (1 << 0),
881 }, 975 },
882 .sources = &clkset_group, 976 .sources = &clkset_group,
@@ -886,7 +980,7 @@ static struct clksrc_clk clksrcs[] = {
886 .clk = { 980 .clk = {
887 .name = "sclk_fimd", 981 .name = "sclk_fimd",
888 .id = 1, 982 .id = 1,
889 .enable = s5pv310_clksrc_mask_lcd1_ctrl, 983 .enable = exynos4_clksrc_mask_lcd1_ctrl,
890 .ctrlbit = (1 << 0), 984 .ctrlbit = (1 << 0),
891 }, 985 },
892 .sources = &clkset_group, 986 .sources = &clkset_group,
@@ -896,7 +990,7 @@ static struct clksrc_clk clksrcs[] = {
896 .clk = { 990 .clk = {
897 .name = "sclk_sata", 991 .name = "sclk_sata",
898 .id = -1, 992 .id = -1,
899 .enable = s5pv310_clksrc_mask_fsys_ctrl, 993 .enable = exynos4_clksrc_mask_fsys_ctrl,
900 .ctrlbit = (1 << 24), 994 .ctrlbit = (1 << 24),
901 }, 995 },
902 .sources = &clkset_mout_corebus, 996 .sources = &clkset_mout_corebus,
@@ -906,7 +1000,7 @@ static struct clksrc_clk clksrcs[] = {
906 .clk = { 1000 .clk = {
907 .name = "sclk_spi", 1001 .name = "sclk_spi",
908 .id = 0, 1002 .id = 0,
909 .enable = s5pv310_clksrc_mask_peril1_ctrl, 1003 .enable = exynos4_clksrc_mask_peril1_ctrl,
910 .ctrlbit = (1 << 16), 1004 .ctrlbit = (1 << 16),
911 }, 1005 },
912 .sources = &clkset_group, 1006 .sources = &clkset_group,
@@ -916,7 +1010,7 @@ static struct clksrc_clk clksrcs[] = {
916 .clk = { 1010 .clk = {
917 .name = "sclk_spi", 1011 .name = "sclk_spi",
918 .id = 1, 1012 .id = 1,
919 .enable = s5pv310_clksrc_mask_peril1_ctrl, 1013 .enable = exynos4_clksrc_mask_peril1_ctrl,
920 .ctrlbit = (1 << 20), 1014 .ctrlbit = (1 << 20),
921 }, 1015 },
922 .sources = &clkset_group, 1016 .sources = &clkset_group,
@@ -926,7 +1020,7 @@ static struct clksrc_clk clksrcs[] = {
926 .clk = { 1020 .clk = {
927 .name = "sclk_spi", 1021 .name = "sclk_spi",
928 .id = 2, 1022 .id = 2,
929 .enable = s5pv310_clksrc_mask_peril1_ctrl, 1023 .enable = exynos4_clksrc_mask_peril1_ctrl,
930 .ctrlbit = (1 << 24), 1024 .ctrlbit = (1 << 24),
931 }, 1025 },
932 .sources = &clkset_group, 1026 .sources = &clkset_group,
@@ -945,7 +1039,7 @@ static struct clksrc_clk clksrcs[] = {
945 .name = "sclk_mmc", 1039 .name = "sclk_mmc",
946 .id = 0, 1040 .id = 0,
947 .parent = &clk_dout_mmc0.clk, 1041 .parent = &clk_dout_mmc0.clk,
948 .enable = s5pv310_clksrc_mask_fsys_ctrl, 1042 .enable = exynos4_clksrc_mask_fsys_ctrl,
949 .ctrlbit = (1 << 0), 1043 .ctrlbit = (1 << 0),
950 }, 1044 },
951 .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 8, .size = 8 }, 1045 .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 8, .size = 8 },
@@ -954,7 +1048,7 @@ static struct clksrc_clk clksrcs[] = {
954 .name = "sclk_mmc", 1048 .name = "sclk_mmc",
955 .id = 1, 1049 .id = 1,
956 .parent = &clk_dout_mmc1.clk, 1050 .parent = &clk_dout_mmc1.clk,
957 .enable = s5pv310_clksrc_mask_fsys_ctrl, 1051 .enable = exynos4_clksrc_mask_fsys_ctrl,
958 .ctrlbit = (1 << 4), 1052 .ctrlbit = (1 << 4),
959 }, 1053 },
960 .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 24, .size = 8 }, 1054 .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 24, .size = 8 },
@@ -963,7 +1057,7 @@ static struct clksrc_clk clksrcs[] = {
963 .name = "sclk_mmc", 1057 .name = "sclk_mmc",
964 .id = 2, 1058 .id = 2,
965 .parent = &clk_dout_mmc2.clk, 1059 .parent = &clk_dout_mmc2.clk,
966 .enable = s5pv310_clksrc_mask_fsys_ctrl, 1060 .enable = exynos4_clksrc_mask_fsys_ctrl,
967 .ctrlbit = (1 << 8), 1061 .ctrlbit = (1 << 8),
968 }, 1062 },
969 .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 8, .size = 8 }, 1063 .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 8, .size = 8 },
@@ -972,7 +1066,7 @@ static struct clksrc_clk clksrcs[] = {
972 .name = "sclk_mmc", 1066 .name = "sclk_mmc",
973 .id = 3, 1067 .id = 3,
974 .parent = &clk_dout_mmc3.clk, 1068 .parent = &clk_dout_mmc3.clk,
975 .enable = s5pv310_clksrc_mask_fsys_ctrl, 1069 .enable = exynos4_clksrc_mask_fsys_ctrl,
976 .ctrlbit = (1 << 12), 1070 .ctrlbit = (1 << 12),
977 }, 1071 },
978 .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 }, 1072 .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
@@ -981,7 +1075,7 @@ static struct clksrc_clk clksrcs[] = {
981 .name = "sclk_mmc", 1075 .name = "sclk_mmc",
982 .id = 4, 1076 .id = 4,
983 .parent = &clk_dout_mmc4.clk, 1077 .parent = &clk_dout_mmc4.clk,
984 .enable = s5pv310_clksrc_mask_fsys_ctrl, 1078 .enable = exynos4_clksrc_mask_fsys_ctrl,
985 .ctrlbit = (1 << 16), 1079 .ctrlbit = (1 << 16),
986 }, 1080 },
987 .reg_div = { .reg = S5P_CLKDIV_FSYS3, .shift = 8, .size = 8 }, 1081 .reg_div = { .reg = S5P_CLKDIV_FSYS3, .shift = 8, .size = 8 },
@@ -1022,16 +1116,16 @@ static struct clksrc_clk *sysclks[] = {
1022 1116
1023static int xtal_rate; 1117static int xtal_rate;
1024 1118
1025static unsigned long s5pv310_fout_apll_get_rate(struct clk *clk) 1119static unsigned long exynos4_fout_apll_get_rate(struct clk *clk)
1026{ 1120{
1027 return s5p_get_pll45xx(xtal_rate, __raw_readl(S5P_APLL_CON0), pll_4508); 1121 return s5p_get_pll45xx(xtal_rate, __raw_readl(S5P_APLL_CON0), pll_4508);
1028} 1122}
1029 1123
1030static struct clk_ops s5pv310_fout_apll_ops = { 1124static struct clk_ops exynos4_fout_apll_ops = {
1031 .get_rate = s5pv310_fout_apll_get_rate, 1125 .get_rate = exynos4_fout_apll_get_rate,
1032}; 1126};
1033 1127
1034void __init_or_cpufreq s5pv310_setup_clocks(void) 1128void __init_or_cpufreq exynos4_setup_clocks(void)
1035{ 1129{
1036 struct clk *xtal_clk; 1130 struct clk *xtal_clk;
1037 unsigned long apll; 1131 unsigned long apll;
@@ -1070,12 +1164,12 @@ void __init_or_cpufreq s5pv310_setup_clocks(void)
1070 vpll = s5p_get_pll46xx(vpllsrc, __raw_readl(S5P_VPLL_CON0), 1164 vpll = s5p_get_pll46xx(vpllsrc, __raw_readl(S5P_VPLL_CON0),
1071 __raw_readl(S5P_VPLL_CON1), pll_4650); 1165 __raw_readl(S5P_VPLL_CON1), pll_4650);
1072 1166
1073 clk_fout_apll.ops = &s5pv310_fout_apll_ops; 1167 clk_fout_apll.ops = &exynos4_fout_apll_ops;
1074 clk_fout_mpll.rate = mpll; 1168 clk_fout_mpll.rate = mpll;
1075 clk_fout_epll.rate = epll; 1169 clk_fout_epll.rate = epll;
1076 clk_fout_vpll.rate = vpll; 1170 clk_fout_vpll.rate = vpll;
1077 1171
1078 printk(KERN_INFO "S5PV310: PLL settings, A=%ld, M=%ld, E=%ld V=%ld", 1172 printk(KERN_INFO "EXYNOS4: PLL settings, A=%ld, M=%ld, E=%ld V=%ld",
1079 apll, mpll, epll, vpll); 1173 apll, mpll, epll, vpll);
1080 1174
1081 armclk = clk_get_rate(&clk_armclk.clk); 1175 armclk = clk_get_rate(&clk_armclk.clk);
@@ -1086,7 +1180,7 @@ void __init_or_cpufreq s5pv310_setup_clocks(void)
1086 aclk_160 = clk_get_rate(&clk_aclk_160.clk); 1180 aclk_160 = clk_get_rate(&clk_aclk_160.clk);
1087 aclk_133 = clk_get_rate(&clk_aclk_133.clk); 1181 aclk_133 = clk_get_rate(&clk_aclk_133.clk);
1088 1182
1089 printk(KERN_INFO "S5PV310: ARMCLK=%ld, DMC=%ld, ACLK200=%ld\n" 1183 printk(KERN_INFO "EXYNOS4: ARMCLK=%ld, DMC=%ld, ACLK200=%ld\n"
1090 "ACLK100=%ld, ACLK160=%ld, ACLK133=%ld\n", 1184 "ACLK100=%ld, ACLK160=%ld, ACLK133=%ld\n",
1091 armclk, sclk_dmc, aclk_200, 1185 armclk, sclk_dmc, aclk_200,
1092 aclk_100, aclk_160, aclk_133); 1186 aclk_100, aclk_160, aclk_133);
@@ -1103,7 +1197,7 @@ static struct clk *clks[] __initdata = {
1103 /* Nothing here yet */ 1197 /* Nothing here yet */
1104}; 1198};
1105 1199
1106void __init s5pv310_register_clocks(void) 1200void __init exynos4_register_clocks(void)
1107{ 1201{
1108 int ptr; 1202 int ptr;
1109 1203
diff --git a/arch/arm/mach-s5pv310/cpu.c b/arch/arm/mach-exynos4/cpu.c
index 0db0fb65bd70..793011391943 100644
--- a/arch/arm/mach-s5pv310/cpu.c
+++ b/arch/arm/mach-exynos4/cpu.c
@@ -1,7 +1,7 @@
1/* linux/arch/arm/mach-s5pv310/cpu.c 1/* linux/arch/arm/mach-exynos4/cpu.c
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
@@ -19,8 +19,10 @@
19 19
20#include <plat/cpu.h> 20#include <plat/cpu.h>
21#include <plat/clock.h> 21#include <plat/clock.h>
22#include <plat/s5pv310.h> 22#include <plat/exynos4.h>
23#include <plat/sdhci.h> 23#include <plat/sdhci.h>
24#include <plat/devs.h>
25#include <plat/fimc-core.h>
24 26
25#include <mach/regs-irq.h> 27#include <mach/regs-irq.h>
26 28
@@ -29,55 +31,60 @@ extern int combiner_init(unsigned int combiner_nr, void __iomem *base,
29extern void combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq); 31extern void combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq);
30 32
31/* Initial IO mappings */ 33/* Initial IO mappings */
32static struct map_desc s5pv310_iodesc[] __initdata = { 34static struct map_desc exynos4_iodesc[] __initdata = {
33 { 35 {
36 .virtual = (unsigned long)S5P_VA_SYSTIMER,
37 .pfn = __phys_to_pfn(EXYNOS4_PA_SYSTIMER),
38 .length = SZ_4K,
39 .type = MT_DEVICE,
40 }, {
34 .virtual = (unsigned long)S5P_VA_SYSRAM, 41 .virtual = (unsigned long)S5P_VA_SYSRAM,
35 .pfn = __phys_to_pfn(S5PV310_PA_SYSRAM), 42 .pfn = __phys_to_pfn(EXYNOS4_PA_SYSRAM),
36 .length = SZ_4K, 43 .length = SZ_4K,
37 .type = MT_DEVICE, 44 .type = MT_DEVICE,
38 }, { 45 }, {
39 .virtual = (unsigned long)S5P_VA_CMU, 46 .virtual = (unsigned long)S5P_VA_CMU,
40 .pfn = __phys_to_pfn(S5PV310_PA_CMU), 47 .pfn = __phys_to_pfn(EXYNOS4_PA_CMU),
41 .length = SZ_128K, 48 .length = SZ_128K,
42 .type = MT_DEVICE, 49 .type = MT_DEVICE,
43 }, { 50 }, {
44 .virtual = (unsigned long)S5P_VA_PMU, 51 .virtual = (unsigned long)S5P_VA_PMU,
45 .pfn = __phys_to_pfn(S5PV310_PA_PMU), 52 .pfn = __phys_to_pfn(EXYNOS4_PA_PMU),
46 .length = SZ_64K, 53 .length = SZ_64K,
47 .type = MT_DEVICE, 54 .type = MT_DEVICE,
48 }, { 55 }, {
49 .virtual = (unsigned long)S5P_VA_COMBINER_BASE, 56 .virtual = (unsigned long)S5P_VA_COMBINER_BASE,
50 .pfn = __phys_to_pfn(S5PV310_PA_COMBINER), 57 .pfn = __phys_to_pfn(EXYNOS4_PA_COMBINER),
51 .length = SZ_4K, 58 .length = SZ_4K,
52 .type = MT_DEVICE, 59 .type = MT_DEVICE,
53 }, { 60 }, {
54 .virtual = (unsigned long)S5P_VA_COREPERI_BASE, 61 .virtual = (unsigned long)S5P_VA_COREPERI_BASE,
55 .pfn = __phys_to_pfn(S5PV310_PA_COREPERI), 62 .pfn = __phys_to_pfn(EXYNOS4_PA_COREPERI),
56 .length = SZ_8K, 63 .length = SZ_8K,
57 .type = MT_DEVICE, 64 .type = MT_DEVICE,
58 }, { 65 }, {
59 .virtual = (unsigned long)S5P_VA_L2CC, 66 .virtual = (unsigned long)S5P_VA_L2CC,
60 .pfn = __phys_to_pfn(S5PV310_PA_L2CC), 67 .pfn = __phys_to_pfn(EXYNOS4_PA_L2CC),
61 .length = SZ_4K, 68 .length = SZ_4K,
62 .type = MT_DEVICE, 69 .type = MT_DEVICE,
63 }, { 70 }, {
64 .virtual = (unsigned long)S5P_VA_GPIO1, 71 .virtual = (unsigned long)S5P_VA_GPIO1,
65 .pfn = __phys_to_pfn(S5PV310_PA_GPIO1), 72 .pfn = __phys_to_pfn(EXYNOS4_PA_GPIO1),
66 .length = SZ_4K, 73 .length = SZ_4K,
67 .type = MT_DEVICE, 74 .type = MT_DEVICE,
68 }, { 75 }, {
69 .virtual = (unsigned long)S5P_VA_GPIO2, 76 .virtual = (unsigned long)S5P_VA_GPIO2,
70 .pfn = __phys_to_pfn(S5PV310_PA_GPIO2), 77 .pfn = __phys_to_pfn(EXYNOS4_PA_GPIO2),
71 .length = SZ_4K, 78 .length = SZ_4K,
72 .type = MT_DEVICE, 79 .type = MT_DEVICE,
73 }, { 80 }, {
74 .virtual = (unsigned long)S5P_VA_GPIO3, 81 .virtual = (unsigned long)S5P_VA_GPIO3,
75 .pfn = __phys_to_pfn(S5PV310_PA_GPIO3), 82 .pfn = __phys_to_pfn(EXYNOS4_PA_GPIO3),
76 .length = SZ_256, 83 .length = SZ_256,
77 .type = MT_DEVICE, 84 .type = MT_DEVICE,
78 }, { 85 }, {
79 .virtual = (unsigned long)S5P_VA_DMC0, 86 .virtual = (unsigned long)S5P_VA_DMC0,
80 .pfn = __phys_to_pfn(S5PV310_PA_DMC0), 87 .pfn = __phys_to_pfn(EXYNOS4_PA_DMC0),
81 .length = SZ_4K, 88 .length = SZ_4K,
82 .type = MT_DEVICE, 89 .type = MT_DEVICE,
83 }, { 90 }, {
@@ -87,13 +94,13 @@ static struct map_desc s5pv310_iodesc[] __initdata = {
87 .type = MT_DEVICE, 94 .type = MT_DEVICE,
88 }, { 95 }, {
89 .virtual = (unsigned long)S5P_VA_SROMC, 96 .virtual = (unsigned long)S5P_VA_SROMC,
90 .pfn = __phys_to_pfn(S5PV310_PA_SROMC), 97 .pfn = __phys_to_pfn(EXYNOS4_PA_SROMC),
91 .length = SZ_4K, 98 .length = SZ_4K,
92 .type = MT_DEVICE, 99 .type = MT_DEVICE,
93 }, 100 },
94}; 101};
95 102
96static void s5pv310_idle(void) 103static void exynos4_idle(void)
97{ 104{
98 if (!need_resched()) 105 if (!need_resched())
99 cpu_do_idle(); 106 cpu_do_idle();
@@ -101,32 +108,38 @@ static void s5pv310_idle(void)
101 local_irq_enable(); 108 local_irq_enable();
102} 109}
103 110
104/* s5pv310_map_io 111/*
112 * exynos4_map_io
105 * 113 *
106 * register the standard cpu IO areas 114 * register the standard cpu IO areas
107*/ 115 */
108void __init s5pv310_map_io(void) 116void __init exynos4_map_io(void)
109{ 117{
110 iotable_init(s5pv310_iodesc, ARRAY_SIZE(s5pv310_iodesc)); 118 iotable_init(exynos4_iodesc, ARRAY_SIZE(exynos4_iodesc));
111 119
112 /* initialize device information early */ 120 /* initialize device information early */
113 s5pv310_default_sdhci0(); 121 exynos4_default_sdhci0();
114 s5pv310_default_sdhci1(); 122 exynos4_default_sdhci1();
115 s5pv310_default_sdhci2(); 123 exynos4_default_sdhci2();
116 s5pv310_default_sdhci3(); 124 exynos4_default_sdhci3();
125
126 s3c_fimc_setname(0, "exynos4-fimc");
127 s3c_fimc_setname(1, "exynos4-fimc");
128 s3c_fimc_setname(2, "exynos4-fimc");
129 s3c_fimc_setname(3, "exynos4-fimc");
117} 130}
118 131
119void __init s5pv310_init_clocks(int xtal) 132void __init exynos4_init_clocks(int xtal)
120{ 133{
121 printk(KERN_DEBUG "%s: initializing clocks\n", __func__); 134 printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
122 135
123 s3c24xx_register_baseclocks(xtal); 136 s3c24xx_register_baseclocks(xtal);
124 s5p_register_clocks(xtal); 137 s5p_register_clocks(xtal);
125 s5pv310_register_clocks(); 138 exynos4_register_clocks();
126 s5pv310_setup_clocks(); 139 exynos4_setup_clocks();
127} 140}
128 141
129void __init s5pv310_init_irq(void) 142void __init exynos4_init_irq(void)
130{ 143{
131 int irq; 144 int irq;
132 145
@@ -148,29 +161,29 @@ void __init s5pv310_init_irq(void)
148 } 161 }
149 162
150 /* The parameters of s5p_init_irq() are for VIC init. 163 /* The parameters of s5p_init_irq() are for VIC init.
151 * Theses parameters should be NULL and 0 because S5PV310 164 * Theses parameters should be NULL and 0 because EXYNOS4
152 * uses GIC instead of VIC. 165 * uses GIC instead of VIC.
153 */ 166 */
154 s5p_init_irq(NULL, 0); 167 s5p_init_irq(NULL, 0);
155} 168}
156 169
157struct sysdev_class s5pv310_sysclass = { 170struct sysdev_class exynos4_sysclass = {
158 .name = "s5pv310-core", 171 .name = "exynos4-core",
159}; 172};
160 173
161static struct sys_device s5pv310_sysdev = { 174static struct sys_device exynos4_sysdev = {
162 .cls = &s5pv310_sysclass, 175 .cls = &exynos4_sysclass,
163}; 176};
164 177
165static int __init s5pv310_core_init(void) 178static int __init exynos4_core_init(void)
166{ 179{
167 return sysdev_class_register(&s5pv310_sysclass); 180 return sysdev_class_register(&exynos4_sysclass);
168} 181}
169 182
170core_initcall(s5pv310_core_init); 183core_initcall(exynos4_core_init);
171 184
172#ifdef CONFIG_CACHE_L2X0 185#ifdef CONFIG_CACHE_L2X0
173static int __init s5pv310_l2x0_cache_init(void) 186static int __init exynos4_l2x0_cache_init(void)
174{ 187{
175 /* TAG, Data Latency Control: 2cycle */ 188 /* TAG, Data Latency Control: 2cycle */
176 __raw_writel(0x110, S5P_VA_L2CC + L2X0_TAG_LATENCY_CTRL); 189 __raw_writel(0x110, S5P_VA_L2CC + L2X0_TAG_LATENCY_CTRL);
@@ -188,15 +201,15 @@ static int __init s5pv310_l2x0_cache_init(void)
188 return 0; 201 return 0;
189} 202}
190 203
191early_initcall(s5pv310_l2x0_cache_init); 204early_initcall(exynos4_l2x0_cache_init);
192#endif 205#endif
193 206
194int __init s5pv310_init(void) 207int __init exynos4_init(void)
195{ 208{
196 printk(KERN_INFO "S5PV310: Initializing architecture\n"); 209 printk(KERN_INFO "EXYNOS4: Initializing architecture\n");
197 210
198 /* set idle function */ 211 /* set idle function */
199 pm_idle = s5pv310_idle; 212 pm_idle = exynos4_idle;
200 213
201 return sysdev_register(&s5pv310_sysdev); 214 return sysdev_register(&exynos4_sysdev);
202} 215}
diff --git a/arch/arm/mach-s5pv310/cpufreq.c b/arch/arm/mach-exynos4/cpufreq.c
index b04cbc731128..a1bd258f0c4d 100644
--- a/arch/arm/mach-s5pv310/cpufreq.c
+++ b/arch/arm/mach-exynos4/cpufreq.c
@@ -1,9 +1,9 @@
1/* linux/arch/arm/mach-s5pv310/cpufreq.c 1/* linux/arch/arm/mach-exynos4/cpufreq.c
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 4 * http://www.samsung.com
5 * 5 *
6 * S5PV310 - CPU frequency scaling support 6 * EXYNOS4 - CPU frequency scaling support
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -31,15 +31,13 @@ static struct clk *moutcore;
31static struct clk *mout_mpll; 31static struct clk *mout_mpll;
32static struct clk *mout_apll; 32static struct clk *mout_apll;
33 33
34#ifdef CONFIG_REGULATOR
35static struct regulator *arm_regulator; 34static struct regulator *arm_regulator;
36static struct regulator *int_regulator; 35static struct regulator *int_regulator;
37#endif
38 36
39static struct cpufreq_freqs freqs; 37static struct cpufreq_freqs freqs;
40static unsigned int memtype; 38static unsigned int memtype;
41 39
42enum s5pv310_memory_type { 40enum exynos4_memory_type {
43 DDR2 = 4, 41 DDR2 = 4,
44 LPDDR2, 42 LPDDR2,
45 DDR3, 43 DDR3,
@@ -49,7 +47,7 @@ enum cpufreq_level_index {
49 L0, L1, L2, L3, CPUFREQ_LEVEL_END, 47 L0, L1, L2, L3, CPUFREQ_LEVEL_END,
50}; 48};
51 49
52static struct cpufreq_frequency_table s5pv310_freq_table[] = { 50static struct cpufreq_frequency_table exynos4_freq_table[] = {
53 {L0, 1000*1000}, 51 {L0, 1000*1000},
54 {L1, 800*1000}, 52 {L1, 800*1000},
55 {L2, 400*1000}, 53 {L2, 400*1000},
@@ -160,7 +158,7 @@ struct cpufreq_voltage_table {
160 unsigned int int_volt; 158 unsigned int int_volt;
161}; 159};
162 160
163static struct cpufreq_voltage_table s5pv310_volt_table[CPUFREQ_LEVEL_END] = { 161static struct cpufreq_voltage_table exynos4_volt_table[CPUFREQ_LEVEL_END] = {
164 { 162 {
165 .index = L0, 163 .index = L0,
166 .arm_volt = 1200000, 164 .arm_volt = 1200000,
@@ -180,7 +178,7 @@ static struct cpufreq_voltage_table s5pv310_volt_table[CPUFREQ_LEVEL_END] = {
180 }, 178 },
181}; 179};
182 180
183static unsigned int s5pv310_apll_pms_table[CPUFREQ_LEVEL_END] = { 181static unsigned int exynos4_apll_pms_table[CPUFREQ_LEVEL_END] = {
184 /* APLL FOUT L0: 1000MHz */ 182 /* APLL FOUT L0: 1000MHz */
185 ((250 << 16) | (6 << 8) | 1), 183 ((250 << 16) | (6 << 8) | 1),
186 184
@@ -194,17 +192,17 @@ static unsigned int s5pv310_apll_pms_table[CPUFREQ_LEVEL_END] = {
194 ((200 << 16) | (6 << 8) | 4), 192 ((200 << 16) | (6 << 8) | 4),
195}; 193};
196 194
197int s5pv310_verify_speed(struct cpufreq_policy *policy) 195int exynos4_verify_speed(struct cpufreq_policy *policy)
198{ 196{
199 return cpufreq_frequency_table_verify(policy, s5pv310_freq_table); 197 return cpufreq_frequency_table_verify(policy, exynos4_freq_table);
200} 198}
201 199
202unsigned int s5pv310_getspeed(unsigned int cpu) 200unsigned int exynos4_getspeed(unsigned int cpu)
203{ 201{
204 return clk_get_rate(cpu_clk) / 1000; 202 return clk_get_rate(cpu_clk) / 1000;
205} 203}
206 204
207void s5pv310_set_clkdiv(unsigned int div_index) 205void exynos4_set_clkdiv(unsigned int div_index)
208{ 206{
209 unsigned int tmp; 207 unsigned int tmp;
210 208
@@ -321,7 +319,7 @@ void s5pv310_set_clkdiv(unsigned int div_index)
321 } while (tmp & 0x11); 319 } while (tmp & 0x11);
322} 320}
323 321
324static void s5pv310_set_apll(unsigned int index) 322static void exynos4_set_apll(unsigned int index)
325{ 323{
326 unsigned int tmp; 324 unsigned int tmp;
327 325
@@ -340,7 +338,7 @@ static void s5pv310_set_apll(unsigned int index)
340 /* 3. Change PLL PMS values */ 338 /* 3. Change PLL PMS values */
341 tmp = __raw_readl(S5P_APLL_CON0); 339 tmp = __raw_readl(S5P_APLL_CON0);
342 tmp &= ~((0x3ff << 16) | (0x3f << 8) | (0x7 << 0)); 340 tmp &= ~((0x3ff << 16) | (0x3f << 8) | (0x7 << 0));
343 tmp |= s5pv310_apll_pms_table[index]; 341 tmp |= exynos4_apll_pms_table[index];
344 __raw_writel(tmp, S5P_APLL_CON0); 342 __raw_writel(tmp, S5P_APLL_CON0);
345 343
346 /* 4. wait_lock_time */ 344 /* 4. wait_lock_time */
@@ -357,99 +355,95 @@ static void s5pv310_set_apll(unsigned int index)
357 } while (tmp != (0x1 << S5P_CLKSRC_CPU_MUXCORE_SHIFT)); 355 } while (tmp != (0x1 << S5P_CLKSRC_CPU_MUXCORE_SHIFT));
358} 356}
359 357
360static void s5pv310_set_frequency(unsigned int old_index, unsigned int new_index) 358static void exynos4_set_frequency(unsigned int old_index, unsigned int new_index)
361{ 359{
362 unsigned int tmp; 360 unsigned int tmp;
363 361
364 if (old_index > new_index) { 362 if (old_index > new_index) {
365 /* The frequency changing to L0 needs to change apll */ 363 /* The frequency changing to L0 needs to change apll */
366 if (freqs.new == s5pv310_freq_table[L0].frequency) { 364 if (freqs.new == exynos4_freq_table[L0].frequency) {
367 /* 1. Change the system clock divider values */ 365 /* 1. Change the system clock divider values */
368 s5pv310_set_clkdiv(new_index); 366 exynos4_set_clkdiv(new_index);
369 367
370 /* 2. Change the apll m,p,s value */ 368 /* 2. Change the apll m,p,s value */
371 s5pv310_set_apll(new_index); 369 exynos4_set_apll(new_index);
372 } else { 370 } else {
373 /* 1. Change the system clock divider values */ 371 /* 1. Change the system clock divider values */
374 s5pv310_set_clkdiv(new_index); 372 exynos4_set_clkdiv(new_index);
375 373
376 /* 2. Change just s value in apll m,p,s value */ 374 /* 2. Change just s value in apll m,p,s value */
377 tmp = __raw_readl(S5P_APLL_CON0); 375 tmp = __raw_readl(S5P_APLL_CON0);
378 tmp &= ~(0x7 << 0); 376 tmp &= ~(0x7 << 0);
379 tmp |= (s5pv310_apll_pms_table[new_index] & 0x7); 377 tmp |= (exynos4_apll_pms_table[new_index] & 0x7);
380 __raw_writel(tmp, S5P_APLL_CON0); 378 __raw_writel(tmp, S5P_APLL_CON0);
381 } 379 }
382 } 380 }
383 381
384 else if (old_index < new_index) { 382 else if (old_index < new_index) {
385 /* The frequency changing from L0 needs to change apll */ 383 /* The frequency changing from L0 needs to change apll */
386 if (freqs.old == s5pv310_freq_table[L0].frequency) { 384 if (freqs.old == exynos4_freq_table[L0].frequency) {
387 /* 1. Change the apll m,p,s value */ 385 /* 1. Change the apll m,p,s value */
388 s5pv310_set_apll(new_index); 386 exynos4_set_apll(new_index);
389 387
390 /* 2. Change the system clock divider values */ 388 /* 2. Change the system clock divider values */
391 s5pv310_set_clkdiv(new_index); 389 exynos4_set_clkdiv(new_index);
392 } else { 390 } else {
393 /* 1. Change just s value in apll m,p,s value */ 391 /* 1. Change just s value in apll m,p,s value */
394 tmp = __raw_readl(S5P_APLL_CON0); 392 tmp = __raw_readl(S5P_APLL_CON0);
395 tmp &= ~(0x7 << 0); 393 tmp &= ~(0x7 << 0);
396 tmp |= (s5pv310_apll_pms_table[new_index] & 0x7); 394 tmp |= (exynos4_apll_pms_table[new_index] & 0x7);
397 __raw_writel(tmp, S5P_APLL_CON0); 395 __raw_writel(tmp, S5P_APLL_CON0);
398 396
399 /* 2. Change the system clock divider values */ 397 /* 2. Change the system clock divider values */
400 s5pv310_set_clkdiv(new_index); 398 exynos4_set_clkdiv(new_index);
401 } 399 }
402 } 400 }
403} 401}
404 402
405static int s5pv310_target(struct cpufreq_policy *policy, 403static int exynos4_target(struct cpufreq_policy *policy,
406 unsigned int target_freq, 404 unsigned int target_freq,
407 unsigned int relation) 405 unsigned int relation)
408{ 406{
409 unsigned int index, old_index; 407 unsigned int index, old_index;
410 unsigned int arm_volt, int_volt; 408 unsigned int arm_volt, int_volt;
411 409
412 freqs.old = s5pv310_getspeed(policy->cpu); 410 freqs.old = exynos4_getspeed(policy->cpu);
413 411
414 if (cpufreq_frequency_table_target(policy, s5pv310_freq_table, 412 if (cpufreq_frequency_table_target(policy, exynos4_freq_table,
415 freqs.old, relation, &old_index)) 413 freqs.old, relation, &old_index))
416 return -EINVAL; 414 return -EINVAL;
417 415
418 if (cpufreq_frequency_table_target(policy, s5pv310_freq_table, 416 if (cpufreq_frequency_table_target(policy, exynos4_freq_table,
419 target_freq, relation, &index)) 417 target_freq, relation, &index))
420 return -EINVAL; 418 return -EINVAL;
421 419
422 freqs.new = s5pv310_freq_table[index].frequency; 420 freqs.new = exynos4_freq_table[index].frequency;
423 freqs.cpu = policy->cpu; 421 freqs.cpu = policy->cpu;
424 422
425 if (freqs.new == freqs.old) 423 if (freqs.new == freqs.old)
426 return 0; 424 return 0;
427 425
428 /* get the voltage value */ 426 /* get the voltage value */
429 arm_volt = s5pv310_volt_table[index].arm_volt; 427 arm_volt = exynos4_volt_table[index].arm_volt;
430 int_volt = s5pv310_volt_table[index].int_volt; 428 int_volt = exynos4_volt_table[index].int_volt;
431 429
432 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 430 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
433 431
434 /* control regulator */ 432 /* control regulator */
435 if (freqs.new > freqs.old) { 433 if (freqs.new > freqs.old) {
436 /* Voltage up */ 434 /* Voltage up */
437#ifdef CONFIG_REGULATOR
438 regulator_set_voltage(arm_regulator, arm_volt, arm_volt); 435 regulator_set_voltage(arm_regulator, arm_volt, arm_volt);
439 regulator_set_voltage(int_regulator, int_volt, int_volt); 436 regulator_set_voltage(int_regulator, int_volt, int_volt);
440#endif
441 } 437 }
442 438
443 /* Clock Configuration Procedure */ 439 /* Clock Configuration Procedure */
444 s5pv310_set_frequency(old_index, index); 440 exynos4_set_frequency(old_index, index);
445 441
446 /* control regulator */ 442 /* control regulator */
447 if (freqs.new < freqs.old) { 443 if (freqs.new < freqs.old) {
448 /* Voltage down */ 444 /* Voltage down */
449#ifdef CONFIG_REGULATOR
450 regulator_set_voltage(arm_regulator, arm_volt, arm_volt); 445 regulator_set_voltage(arm_regulator, arm_volt, arm_volt);
451 regulator_set_voltage(int_regulator, int_volt, int_volt); 446 regulator_set_voltage(int_regulator, int_volt, int_volt);
452#endif
453 } 447 }
454 448
455 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 449 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
@@ -458,52 +452,51 @@ static int s5pv310_target(struct cpufreq_policy *policy,
458} 452}
459 453
460#ifdef CONFIG_PM 454#ifdef CONFIG_PM
461static int s5pv310_cpufreq_suspend(struct cpufreq_policy *policy, 455static int exynos4_cpufreq_suspend(struct cpufreq_policy *policy)
462 pm_message_t pmsg)
463{ 456{
464 return 0; 457 return 0;
465} 458}
466 459
467static int s5pv310_cpufreq_resume(struct cpufreq_policy *policy) 460static int exynos4_cpufreq_resume(struct cpufreq_policy *policy)
468{ 461{
469 return 0; 462 return 0;
470} 463}
471#endif 464#endif
472 465
473static int s5pv310_cpufreq_cpu_init(struct cpufreq_policy *policy) 466static int exynos4_cpufreq_cpu_init(struct cpufreq_policy *policy)
474{ 467{
475 policy->cur = policy->min = policy->max = s5pv310_getspeed(policy->cpu); 468 policy->cur = policy->min = policy->max = exynos4_getspeed(policy->cpu);
476 469
477 cpufreq_frequency_table_get_attr(s5pv310_freq_table, policy->cpu); 470 cpufreq_frequency_table_get_attr(exynos4_freq_table, policy->cpu);
478 471
479 /* set the transition latency value */ 472 /* set the transition latency value */
480 policy->cpuinfo.transition_latency = 100000; 473 policy->cpuinfo.transition_latency = 100000;
481 474
482 /* 475 /*
483 * S5PV310 multi-core processors has 2 cores 476 * EXYNOS4 multi-core processors has 2 cores
484 * that the frequency cannot be set independently. 477 * that the frequency cannot be set independently.
485 * Each cpu is bound to the same speed. 478 * Each cpu is bound to the same speed.
486 * So the affected cpu is all of the cpus. 479 * So the affected cpu is all of the cpus.
487 */ 480 */
488 cpumask_setall(policy->cpus); 481 cpumask_setall(policy->cpus);
489 482
490 return cpufreq_frequency_table_cpuinfo(policy, s5pv310_freq_table); 483 return cpufreq_frequency_table_cpuinfo(policy, exynos4_freq_table);
491} 484}
492 485
493static struct cpufreq_driver s5pv310_driver = { 486static struct cpufreq_driver exynos4_driver = {
494 .flags = CPUFREQ_STICKY, 487 .flags = CPUFREQ_STICKY,
495 .verify = s5pv310_verify_speed, 488 .verify = exynos4_verify_speed,
496 .target = s5pv310_target, 489 .target = exynos4_target,
497 .get = s5pv310_getspeed, 490 .get = exynos4_getspeed,
498 .init = s5pv310_cpufreq_cpu_init, 491 .init = exynos4_cpufreq_cpu_init,
499 .name = "s5pv310_cpufreq", 492 .name = "exynos4_cpufreq",
500#ifdef CONFIG_PM 493#ifdef CONFIG_PM
501 .suspend = s5pv310_cpufreq_suspend, 494 .suspend = exynos4_cpufreq_suspend,
502 .resume = s5pv310_cpufreq_resume, 495 .resume = exynos4_cpufreq_resume,
503#endif 496#endif
504}; 497};
505 498
506static int __init s5pv310_cpufreq_init(void) 499static int __init exynos4_cpufreq_init(void)
507{ 500{
508 cpu_clk = clk_get(NULL, "armclk"); 501 cpu_clk = clk_get(NULL, "armclk");
509 if (IS_ERR(cpu_clk)) 502 if (IS_ERR(cpu_clk))
@@ -521,7 +514,6 @@ static int __init s5pv310_cpufreq_init(void)
521 if (IS_ERR(mout_apll)) 514 if (IS_ERR(mout_apll))
522 goto out; 515 goto out;
523 516
524#ifdef CONFIG_REGULATOR
525 arm_regulator = regulator_get(NULL, "vdd_arm"); 517 arm_regulator = regulator_get(NULL, "vdd_arm");
526 if (IS_ERR(arm_regulator)) { 518 if (IS_ERR(arm_regulator)) {
527 printk(KERN_ERR "failed to get resource %s\n", "vdd_arm"); 519 printk(KERN_ERR "failed to get resource %s\n", "vdd_arm");
@@ -533,7 +525,6 @@ static int __init s5pv310_cpufreq_init(void)
533 printk(KERN_ERR "failed to get resource %s\n", "vdd_int"); 525 printk(KERN_ERR "failed to get resource %s\n", "vdd_int");
534 goto out; 526 goto out;
535 } 527 }
536#endif
537 528
538 /* 529 /*
539 * Check DRAM type. 530 * Check DRAM type.
@@ -550,7 +541,7 @@ static int __init s5pv310_cpufreq_init(void)
550 printk(KERN_DEBUG "%s: memtype= 0x%x\n", __func__, memtype); 541 printk(KERN_DEBUG "%s: memtype= 0x%x\n", __func__, memtype);
551 } 542 }
552 543
553 return cpufreq_register_driver(&s5pv310_driver); 544 return cpufreq_register_driver(&exynos4_driver);
554 545
555out: 546out:
556 if (!IS_ERR(cpu_clk)) 547 if (!IS_ERR(cpu_clk))
@@ -565,16 +556,14 @@ out:
565 if (!IS_ERR(mout_apll)) 556 if (!IS_ERR(mout_apll))
566 clk_put(mout_apll); 557 clk_put(mout_apll);
567 558
568#ifdef CONFIG_REGULATOR
569 if (!IS_ERR(arm_regulator)) 559 if (!IS_ERR(arm_regulator))
570 regulator_put(arm_regulator); 560 regulator_put(arm_regulator);
571 561
572 if (!IS_ERR(int_regulator)) 562 if (!IS_ERR(int_regulator))
573 regulator_put(int_regulator); 563 regulator_put(int_regulator);
574#endif
575 564
576 printk(KERN_ERR "%s: failed initialization\n", __func__); 565 printk(KERN_ERR "%s: failed initialization\n", __func__);
577 566
578 return -EINVAL; 567 return -EINVAL;
579} 568}
580late_initcall(s5pv310_cpufreq_init); 569late_initcall(exynos4_cpufreq_init);
diff --git a/arch/arm/mach-exynos4/dev-ahci.c b/arch/arm/mach-exynos4/dev-ahci.c
new file mode 100644
index 000000000000..f57a3de8e1d2
--- /dev/null
+++ b/arch/arm/mach-exynos4/dev-ahci.c
@@ -0,0 +1,263 @@
1/* linux/arch/arm/mach-exynos4/dev-ahci.c
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * EXYNOS4 - AHCI support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/clk.h>
14#include <linux/delay.h>
15#include <linux/dma-mapping.h>
16#include <linux/platform_device.h>
17#include <linux/ahci_platform.h>
18
19#include <plat/cpu.h>
20
21#include <mach/irqs.h>
22#include <mach/map.h>
23#include <mach/regs-pmu.h>
24
25/* PHY Control Register */
26#define SATA_CTRL0 0x0
27/* PHY Link Control Register */
28#define SATA_CTRL1 0x4
29/* PHY Status Register */
30#define SATA_PHY_STATUS 0x8
31
32#define SATA_CTRL0_RX_DATA_VALID(x) (x << 27)
33#define SATA_CTRL0_SPEED_MODE (1 << 26)
34#define SATA_CTRL0_M_PHY_CAL (1 << 19)
35#define SATA_CTRL0_PHY_CMU_RST_N (1 << 10)
36#define SATA_CTRL0_M_PHY_LN_RST_N (1 << 9)
37#define SATA_CTRL0_PHY_POR_N (1 << 8)
38
39#define SATA_CTRL1_RST_PMALIVE_N (1 << 8)
40#define SATA_CTRL1_RST_RXOOB_N (1 << 7)
41#define SATA_CTRL1_RST_RX_N (1 << 6)
42#define SATA_CTRL1_RST_TX_N (1 << 5)
43
44#define SATA_PHY_STATUS_CMU_OK (1 << 18)
45#define SATA_PHY_STATUS_LANE_OK (1 << 16)
46
47#define LANE0 0x200
48#define COM_LANE 0xA00
49
50#define HOST_PORTS_IMPL 0xC
51#define SCLK_SATA_FREQ (67 * MHZ)
52
53static void __iomem *phy_base, *phy_ctrl;
54
55struct phy_reg {
56 u8 reg;
57 u8 val;
58};
59
60/* SATA PHY setup */
61static const struct phy_reg exynos4_sataphy_cmu[] = {
62 { 0x00, 0x06 }, { 0x02, 0x80 }, { 0x22, 0xa0 }, { 0x23, 0x42 },
63 { 0x2e, 0x04 }, { 0x2f, 0x50 }, { 0x30, 0x70 }, { 0x31, 0x02 },
64 { 0x32, 0x25 }, { 0x33, 0x40 }, { 0x34, 0x01 }, { 0x35, 0x40 },
65 { 0x61, 0x2e }, { 0x63, 0x5e }, { 0x65, 0x42 }, { 0x66, 0xd1 },
66 { 0x67, 0x20 }, { 0x68, 0x28 }, { 0x69, 0x78 }, { 0x6a, 0x04 },
67 { 0x6b, 0xc8 }, { 0x6c, 0x06 },
68};
69
70static const struct phy_reg exynos4_sataphy_lane[] = {
71 { 0x00, 0x02 }, { 0x05, 0x10 }, { 0x06, 0x84 }, { 0x07, 0x04 },
72 { 0x08, 0xe0 }, { 0x10, 0x23 }, { 0x13, 0x05 }, { 0x14, 0x30 },
73 { 0x15, 0x00 }, { 0x17, 0x70 }, { 0x18, 0xf2 }, { 0x19, 0x1e },
74 { 0x1a, 0x18 }, { 0x1b, 0x0d }, { 0x1c, 0x08 }, { 0x50, 0x60 },
75 { 0x51, 0x0f },
76};
77
78static const struct phy_reg exynos4_sataphy_comlane[] = {
79 { 0x01, 0x20 }, { 0x03, 0x40 }, { 0x04, 0x3c }, { 0x05, 0x7d },
80 { 0x06, 0x1d }, { 0x07, 0xcf }, { 0x08, 0x05 }, { 0x09, 0x63 },
81 { 0x0a, 0x29 }, { 0x0b, 0xc4 }, { 0x0c, 0x01 }, { 0x0d, 0x03 },
82 { 0x0e, 0x28 }, { 0x0f, 0x98 }, { 0x10, 0x19 }, { 0x13, 0x80 },
83 { 0x14, 0xf0 }, { 0x15, 0xd0 }, { 0x39, 0xa0 }, { 0x3a, 0xa0 },
84 { 0x3b, 0xa0 }, { 0x3c, 0xa0 }, { 0x3d, 0xa0 }, { 0x3e, 0xa0 },
85 { 0x3f, 0xa0 }, { 0x40, 0x42 }, { 0x42, 0x80 }, { 0x43, 0x58 },
86 { 0x45, 0x44 }, { 0x46, 0x5c }, { 0x47, 0x86 }, { 0x48, 0x8d },
87 { 0x49, 0xd0 }, { 0x4a, 0x09 }, { 0x4b, 0x90 }, { 0x4c, 0x07 },
88 { 0x4d, 0x40 }, { 0x51, 0x20 }, { 0x52, 0x32 }, { 0x7f, 0xd8 },
89 { 0x80, 0x1a }, { 0x81, 0xff }, { 0x82, 0x11 }, { 0x83, 0x00 },
90 { 0x87, 0xf0 }, { 0x87, 0xff }, { 0x87, 0xff }, { 0x87, 0xff },
91 { 0x87, 0xff }, { 0x8c, 0x1c }, { 0x8d, 0xc2 }, { 0x8e, 0xc3 },
92 { 0x8f, 0x3f }, { 0x90, 0x0a }, { 0x96, 0xf8 },
93};
94
95static int wait_for_phy_ready(void __iomem *reg, unsigned long bit)
96{
97 unsigned long timeout;
98
99 /* wait for maximum of 3 sec */
100 timeout = jiffies + msecs_to_jiffies(3000);
101 while (!(__raw_readl(reg) & bit)) {
102 if (time_after(jiffies, timeout))
103 return -1;
104 cpu_relax();
105 }
106 return 0;
107}
108
109static int ahci_phy_init(void __iomem *mmio)
110{
111 int i, ctrl0;
112
113 for (i = 0; i < ARRAY_SIZE(exynos4_sataphy_cmu); i++)
114 __raw_writeb(exynos4_sataphy_cmu[i].val,
115 phy_base + (exynos4_sataphy_cmu[i].reg * 4));
116
117 for (i = 0; i < ARRAY_SIZE(exynos4_sataphy_lane); i++)
118 __raw_writeb(exynos4_sataphy_lane[i].val,
119 phy_base + (LANE0 + exynos4_sataphy_lane[i].reg) * 4);
120
121 for (i = 0; i < ARRAY_SIZE(exynos4_sataphy_comlane); i++)
122 __raw_writeb(exynos4_sataphy_comlane[i].val,
123 phy_base + (COM_LANE + exynos4_sataphy_comlane[i].reg) * 4);
124
125 __raw_writeb(0x07, phy_base);
126
127 ctrl0 = __raw_readl(phy_ctrl + SATA_CTRL0);
128 ctrl0 |= SATA_CTRL0_PHY_CMU_RST_N;
129 __raw_writel(ctrl0, phy_ctrl + SATA_CTRL0);
130
131 if (wait_for_phy_ready(phy_ctrl + SATA_PHY_STATUS,
132 SATA_PHY_STATUS_CMU_OK) < 0) {
133 printk(KERN_ERR "PHY CMU not ready\n");
134 return -EBUSY;
135 }
136
137 __raw_writeb(0x03, phy_base + (COM_LANE * 4));
138
139 ctrl0 = __raw_readl(phy_ctrl + SATA_CTRL0);
140 ctrl0 |= SATA_CTRL0_M_PHY_LN_RST_N;
141 __raw_writel(ctrl0, phy_ctrl + SATA_CTRL0);
142
143 if (wait_for_phy_ready(phy_ctrl + SATA_PHY_STATUS,
144 SATA_PHY_STATUS_LANE_OK) < 0) {
145 printk(KERN_ERR "PHY LANE not ready\n");
146 return -EBUSY;
147 }
148
149 ctrl0 = __raw_readl(phy_ctrl + SATA_CTRL0);
150 ctrl0 |= SATA_CTRL0_M_PHY_CAL;
151 __raw_writel(ctrl0, phy_ctrl + SATA_CTRL0);
152
153 return 0;
154}
155
156static int exynos4_ahci_init(struct device *dev, void __iomem *mmio)
157{
158 struct clk *clk_sata, *clk_sataphy, *clk_sclk_sata;
159 int val, ret;
160
161 phy_base = ioremap(EXYNOS4_PA_SATAPHY, SZ_64K);
162 if (!phy_base) {
163 dev_err(dev, "failed to allocate memory for SATA PHY\n");
164 return -ENOMEM;
165 }
166
167 phy_ctrl = ioremap(EXYNOS4_PA_SATAPHY_CTRL, SZ_16);
168 if (!phy_ctrl) {
169 dev_err(dev, "failed to allocate memory for SATA PHY CTRL\n");
170 ret = -ENOMEM;
171 goto err1;
172 }
173
174 clk_sata = clk_get(dev, "sata");
175 if (IS_ERR(clk_sata)) {
176 dev_err(dev, "failed to get sata clock\n");
177 ret = PTR_ERR(clk_sata);
178 clk_sata = NULL;
179 goto err2;
180
181 }
182 clk_enable(clk_sata);
183
184 clk_sataphy = clk_get(dev, "sataphy");
185 if (IS_ERR(clk_sataphy)) {
186 dev_err(dev, "failed to get sataphy clock\n");
187 ret = PTR_ERR(clk_sataphy);
188 clk_sataphy = NULL;
189 goto err3;
190 }
191 clk_enable(clk_sataphy);
192
193 clk_sclk_sata = clk_get(dev, "sclk_sata");
194 if (IS_ERR(clk_sclk_sata)) {
195 dev_err(dev, "failed to get sclk_sata\n");
196 ret = PTR_ERR(clk_sclk_sata);
197 clk_sclk_sata = NULL;
198 goto err4;
199 }
200 clk_enable(clk_sclk_sata);
201 clk_set_rate(clk_sclk_sata, SCLK_SATA_FREQ);
202
203 __raw_writel(S5P_PMU_SATA_PHY_CONTROL_EN, S5P_PMU_SATA_PHY_CONTROL);
204
205 /* Enable PHY link control */
206 val = SATA_CTRL1_RST_PMALIVE_N | SATA_CTRL1_RST_RXOOB_N |
207 SATA_CTRL1_RST_RX_N | SATA_CTRL1_RST_TX_N;
208 __raw_writel(val, phy_ctrl + SATA_CTRL1);
209
210 /* Set communication speed as 3Gbps and enable PHY power */
211 val = SATA_CTRL0_RX_DATA_VALID(3) | SATA_CTRL0_SPEED_MODE |
212 SATA_CTRL0_PHY_POR_N;
213 __raw_writel(val, phy_ctrl + SATA_CTRL0);
214
215 /* Port0 is available */
216 __raw_writel(0x1, mmio + HOST_PORTS_IMPL);
217
218 return ahci_phy_init(mmio);
219
220err4:
221 clk_disable(clk_sataphy);
222 clk_put(clk_sataphy);
223err3:
224 clk_disable(clk_sata);
225 clk_put(clk_sata);
226err2:
227 iounmap(phy_ctrl);
228err1:
229 iounmap(phy_base);
230
231 return ret;
232}
233
234static struct ahci_platform_data exynos4_ahci_pdata = {
235 .init = exynos4_ahci_init,
236};
237
238static struct resource exynos4_ahci_resource[] = {
239 [0] = {
240 .start = EXYNOS4_PA_SATA,
241 .end = EXYNOS4_PA_SATA + SZ_64K - 1,
242 .flags = IORESOURCE_MEM,
243 },
244 [1] = {
245 .start = IRQ_SATA,
246 .end = IRQ_SATA,
247 .flags = IORESOURCE_IRQ,
248 },
249};
250
251static u64 exynos4_ahci_dmamask = DMA_BIT_MASK(32);
252
253struct platform_device exynos4_device_ahci = {
254 .name = "ahci",
255 .id = -1,
256 .resource = exynos4_ahci_resource,
257 .num_resources = ARRAY_SIZE(exynos4_ahci_resource),
258 .dev = {
259 .platform_data = &exynos4_ahci_pdata,
260 .dma_mask = &exynos4_ahci_dmamask,
261 .coherent_dma_mask = DMA_BIT_MASK(32),
262 },
263};
diff --git a/arch/arm/mach-s5pv310/dev-audio.c b/arch/arm/mach-exynos4/dev-audio.c
index a1964242f0fa..1eed5f9f7bd3 100644
--- a/arch/arm/mach-s5pv310/dev-audio.c
+++ b/arch/arm/mach-exynos4/dev-audio.c
@@ -1,4 +1,7 @@
1/* linux/arch/arm/mach-s5pv310/dev-audio.c 1/* linux/arch/arm/mach-exynos4/dev-audio.c
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
2 * 5 *
3 * Copyright (c) 2010 Samsung Electronics Co. Ltd 6 * Copyright (c) 2010 Samsung Electronics Co. Ltd
4 * Jaswinder Singh <jassi.brar@samsung.com> 7 * Jaswinder Singh <jassi.brar@samsung.com>
@@ -24,18 +27,18 @@ static const char *rclksrc[] = {
24 [1] = "i2sclk", 27 [1] = "i2sclk",
25}; 28};
26 29
27static int s5pv310_cfg_i2s(struct platform_device *pdev) 30static int exynos4_cfg_i2s(struct platform_device *pdev)
28{ 31{
29 /* configure GPIO for i2s port */ 32 /* configure GPIO for i2s port */
30 switch (pdev->id) { 33 switch (pdev->id) {
31 case 0: 34 case 0:
32 s3c_gpio_cfgpin_range(S5PV310_GPZ(0), 7, S3C_GPIO_SFN(2)); 35 s3c_gpio_cfgpin_range(EXYNOS4_GPZ(0), 7, S3C_GPIO_SFN(2));
33 break; 36 break;
34 case 1: 37 case 1:
35 s3c_gpio_cfgpin_range(S5PV310_GPC0(0), 5, S3C_GPIO_SFN(2)); 38 s3c_gpio_cfgpin_range(EXYNOS4_GPC0(0), 5, S3C_GPIO_SFN(2));
36 break; 39 break;
37 case 2: 40 case 2:
38 s3c_gpio_cfgpin_range(S5PV310_GPC1(0), 5, S3C_GPIO_SFN(4)); 41 s3c_gpio_cfgpin_range(EXYNOS4_GPC1(0), 5, S3C_GPIO_SFN(4));
39 break; 42 break;
40 default: 43 default:
41 printk(KERN_ERR "Invalid Device %d\n", pdev->id); 44 printk(KERN_ERR "Invalid Device %d\n", pdev->id);
@@ -46,7 +49,7 @@ static int s5pv310_cfg_i2s(struct platform_device *pdev)
46} 49}
47 50
48static struct s3c_audio_pdata i2sv5_pdata = { 51static struct s3c_audio_pdata i2sv5_pdata = {
49 .cfg_gpio = s5pv310_cfg_i2s, 52 .cfg_gpio = exynos4_cfg_i2s,
50 .type = { 53 .type = {
51 .i2s = { 54 .i2s = {
52 .quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI 55 .quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI
@@ -56,10 +59,10 @@ static struct s3c_audio_pdata i2sv5_pdata = {
56 }, 59 },
57}; 60};
58 61
59static struct resource s5pv310_i2s0_resource[] = { 62static struct resource exynos4_i2s0_resource[] = {
60 [0] = { 63 [0] = {
61 .start = S5PV310_PA_I2S0, 64 .start = EXYNOS4_PA_I2S0,
62 .end = S5PV310_PA_I2S0 + 0x100 - 1, 65 .end = EXYNOS4_PA_I2S0 + 0x100 - 1,
63 .flags = IORESOURCE_MEM, 66 .flags = IORESOURCE_MEM,
64 }, 67 },
65 [1] = { 68 [1] = {
@@ -79,11 +82,11 @@ static struct resource s5pv310_i2s0_resource[] = {
79 }, 82 },
80}; 83};
81 84
82struct platform_device s5pv310_device_i2s0 = { 85struct platform_device exynos4_device_i2s0 = {
83 .name = "samsung-i2s", 86 .name = "samsung-i2s",
84 .id = 0, 87 .id = 0,
85 .num_resources = ARRAY_SIZE(s5pv310_i2s0_resource), 88 .num_resources = ARRAY_SIZE(exynos4_i2s0_resource),
86 .resource = s5pv310_i2s0_resource, 89 .resource = exynos4_i2s0_resource,
87 .dev = { 90 .dev = {
88 .platform_data = &i2sv5_pdata, 91 .platform_data = &i2sv5_pdata,
89 }, 92 },
@@ -95,7 +98,7 @@ static const char *rclksrc_v3[] = {
95}; 98};
96 99
97static struct s3c_audio_pdata i2sv3_pdata = { 100static struct s3c_audio_pdata i2sv3_pdata = {
98 .cfg_gpio = s5pv310_cfg_i2s, 101 .cfg_gpio = exynos4_cfg_i2s,
99 .type = { 102 .type = {
100 .i2s = { 103 .i2s = {
101 .quirks = QUIRK_NO_MUXPSR, 104 .quirks = QUIRK_NO_MUXPSR,
@@ -104,10 +107,10 @@ static struct s3c_audio_pdata i2sv3_pdata = {
104 }, 107 },
105}; 108};
106 109
107static struct resource s5pv310_i2s1_resource[] = { 110static struct resource exynos4_i2s1_resource[] = {
108 [0] = { 111 [0] = {
109 .start = S5PV310_PA_I2S1, 112 .start = EXYNOS4_PA_I2S1,
110 .end = S5PV310_PA_I2S1 + 0x100 - 1, 113 .end = EXYNOS4_PA_I2S1 + 0x100 - 1,
111 .flags = IORESOURCE_MEM, 114 .flags = IORESOURCE_MEM,
112 }, 115 },
113 [1] = { 116 [1] = {
@@ -122,20 +125,20 @@ static struct resource s5pv310_i2s1_resource[] = {
122 }, 125 },
123}; 126};
124 127
125struct platform_device s5pv310_device_i2s1 = { 128struct platform_device exynos4_device_i2s1 = {
126 .name = "samsung-i2s", 129 .name = "samsung-i2s",
127 .id = 1, 130 .id = 1,
128 .num_resources = ARRAY_SIZE(s5pv310_i2s1_resource), 131 .num_resources = ARRAY_SIZE(exynos4_i2s1_resource),
129 .resource = s5pv310_i2s1_resource, 132 .resource = exynos4_i2s1_resource,
130 .dev = { 133 .dev = {
131 .platform_data = &i2sv3_pdata, 134 .platform_data = &i2sv3_pdata,
132 }, 135 },
133}; 136};
134 137
135static struct resource s5pv310_i2s2_resource[] = { 138static struct resource exynos4_i2s2_resource[] = {
136 [0] = { 139 [0] = {
137 .start = S5PV310_PA_I2S2, 140 .start = EXYNOS4_PA_I2S2,
138 .end = S5PV310_PA_I2S2 + 0x100 - 1, 141 .end = EXYNOS4_PA_I2S2 + 0x100 - 1,
139 .flags = IORESOURCE_MEM, 142 .flags = IORESOURCE_MEM,
140 }, 143 },
141 [1] = { 144 [1] = {
@@ -150,11 +153,11 @@ static struct resource s5pv310_i2s2_resource[] = {
150 }, 153 },
151}; 154};
152 155
153struct platform_device s5pv310_device_i2s2 = { 156struct platform_device exynos4_device_i2s2 = {
154 .name = "samsung-i2s", 157 .name = "samsung-i2s",
155 .id = 2, 158 .id = 2,
156 .num_resources = ARRAY_SIZE(s5pv310_i2s2_resource), 159 .num_resources = ARRAY_SIZE(exynos4_i2s2_resource),
157 .resource = s5pv310_i2s2_resource, 160 .resource = exynos4_i2s2_resource,
158 .dev = { 161 .dev = {
159 .platform_data = &i2sv3_pdata, 162 .platform_data = &i2sv3_pdata,
160 }, 163 },
@@ -162,17 +165,17 @@ struct platform_device s5pv310_device_i2s2 = {
162 165
163/* PCM Controller platform_devices */ 166/* PCM Controller platform_devices */
164 167
165static int s5pv310_pcm_cfg_gpio(struct platform_device *pdev) 168static int exynos4_pcm_cfg_gpio(struct platform_device *pdev)
166{ 169{
167 switch (pdev->id) { 170 switch (pdev->id) {
168 case 0: 171 case 0:
169 s3c_gpio_cfgpin_range(S5PV310_GPZ(0), 5, S3C_GPIO_SFN(3)); 172 s3c_gpio_cfgpin_range(EXYNOS4_GPZ(0), 5, S3C_GPIO_SFN(3));
170 break; 173 break;
171 case 1: 174 case 1:
172 s3c_gpio_cfgpin_range(S5PV310_GPC0(0), 5, S3C_GPIO_SFN(3)); 175 s3c_gpio_cfgpin_range(EXYNOS4_GPC0(0), 5, S3C_GPIO_SFN(3));
173 break; 176 break;
174 case 2: 177 case 2:
175 s3c_gpio_cfgpin_range(S5PV310_GPC1(0), 5, S3C_GPIO_SFN(3)); 178 s3c_gpio_cfgpin_range(EXYNOS4_GPC1(0), 5, S3C_GPIO_SFN(3));
176 break; 179 break;
177 default: 180 default:
178 printk(KERN_DEBUG "Invalid PCM Controller number!"); 181 printk(KERN_DEBUG "Invalid PCM Controller number!");
@@ -183,13 +186,13 @@ static int s5pv310_pcm_cfg_gpio(struct platform_device *pdev)
183} 186}
184 187
185static struct s3c_audio_pdata s3c_pcm_pdata = { 188static struct s3c_audio_pdata s3c_pcm_pdata = {
186 .cfg_gpio = s5pv310_pcm_cfg_gpio, 189 .cfg_gpio = exynos4_pcm_cfg_gpio,
187}; 190};
188 191
189static struct resource s5pv310_pcm0_resource[] = { 192static struct resource exynos4_pcm0_resource[] = {
190 [0] = { 193 [0] = {
191 .start = S5PV310_PA_PCM0, 194 .start = EXYNOS4_PA_PCM0,
192 .end = S5PV310_PA_PCM0 + 0x100 - 1, 195 .end = EXYNOS4_PA_PCM0 + 0x100 - 1,
193 .flags = IORESOURCE_MEM, 196 .flags = IORESOURCE_MEM,
194 }, 197 },
195 [1] = { 198 [1] = {
@@ -204,20 +207,20 @@ static struct resource s5pv310_pcm0_resource[] = {
204 }, 207 },
205}; 208};
206 209
207struct platform_device s5pv310_device_pcm0 = { 210struct platform_device exynos4_device_pcm0 = {
208 .name = "samsung-pcm", 211 .name = "samsung-pcm",
209 .id = 0, 212 .id = 0,
210 .num_resources = ARRAY_SIZE(s5pv310_pcm0_resource), 213 .num_resources = ARRAY_SIZE(exynos4_pcm0_resource),
211 .resource = s5pv310_pcm0_resource, 214 .resource = exynos4_pcm0_resource,
212 .dev = { 215 .dev = {
213 .platform_data = &s3c_pcm_pdata, 216 .platform_data = &s3c_pcm_pdata,
214 }, 217 },
215}; 218};
216 219
217static struct resource s5pv310_pcm1_resource[] = { 220static struct resource exynos4_pcm1_resource[] = {
218 [0] = { 221 [0] = {
219 .start = S5PV310_PA_PCM1, 222 .start = EXYNOS4_PA_PCM1,
220 .end = S5PV310_PA_PCM1 + 0x100 - 1, 223 .end = EXYNOS4_PA_PCM1 + 0x100 - 1,
221 .flags = IORESOURCE_MEM, 224 .flags = IORESOURCE_MEM,
222 }, 225 },
223 [1] = { 226 [1] = {
@@ -232,20 +235,20 @@ static struct resource s5pv310_pcm1_resource[] = {
232 }, 235 },
233}; 236};
234 237
235struct platform_device s5pv310_device_pcm1 = { 238struct platform_device exynos4_device_pcm1 = {
236 .name = "samsung-pcm", 239 .name = "samsung-pcm",
237 .id = 1, 240 .id = 1,
238 .num_resources = ARRAY_SIZE(s5pv310_pcm1_resource), 241 .num_resources = ARRAY_SIZE(exynos4_pcm1_resource),
239 .resource = s5pv310_pcm1_resource, 242 .resource = exynos4_pcm1_resource,
240 .dev = { 243 .dev = {
241 .platform_data = &s3c_pcm_pdata, 244 .platform_data = &s3c_pcm_pdata,
242 }, 245 },
243}; 246};
244 247
245static struct resource s5pv310_pcm2_resource[] = { 248static struct resource exynos4_pcm2_resource[] = {
246 [0] = { 249 [0] = {
247 .start = S5PV310_PA_PCM2, 250 .start = EXYNOS4_PA_PCM2,
248 .end = S5PV310_PA_PCM2 + 0x100 - 1, 251 .end = EXYNOS4_PA_PCM2 + 0x100 - 1,
249 .flags = IORESOURCE_MEM, 252 .flags = IORESOURCE_MEM,
250 }, 253 },
251 [1] = { 254 [1] = {
@@ -260,11 +263,11 @@ static struct resource s5pv310_pcm2_resource[] = {
260 }, 263 },
261}; 264};
262 265
263struct platform_device s5pv310_device_pcm2 = { 266struct platform_device exynos4_device_pcm2 = {
264 .name = "samsung-pcm", 267 .name = "samsung-pcm",
265 .id = 2, 268 .id = 2,
266 .num_resources = ARRAY_SIZE(s5pv310_pcm2_resource), 269 .num_resources = ARRAY_SIZE(exynos4_pcm2_resource),
267 .resource = s5pv310_pcm2_resource, 270 .resource = exynos4_pcm2_resource,
268 .dev = { 271 .dev = {
269 .platform_data = &s3c_pcm_pdata, 272 .platform_data = &s3c_pcm_pdata,
270 }, 273 },
@@ -272,15 +275,15 @@ struct platform_device s5pv310_device_pcm2 = {
272 275
273/* AC97 Controller platform devices */ 276/* AC97 Controller platform devices */
274 277
275static int s5pv310_ac97_cfg_gpio(struct platform_device *pdev) 278static int exynos4_ac97_cfg_gpio(struct platform_device *pdev)
276{ 279{
277 return s3c_gpio_cfgpin_range(S5PV310_GPC0(0), 5, S3C_GPIO_SFN(4)); 280 return s3c_gpio_cfgpin_range(EXYNOS4_GPC0(0), 5, S3C_GPIO_SFN(4));
278} 281}
279 282
280static struct resource s5pv310_ac97_resource[] = { 283static struct resource exynos4_ac97_resource[] = {
281 [0] = { 284 [0] = {
282 .start = S5PV310_PA_AC97, 285 .start = EXYNOS4_PA_AC97,
283 .end = S5PV310_PA_AC97 + 0x100 - 1, 286 .end = EXYNOS4_PA_AC97 + 0x100 - 1,
284 .flags = IORESOURCE_MEM, 287 .flags = IORESOURCE_MEM,
285 }, 288 },
286 [1] = { 289 [1] = {
@@ -306,36 +309,36 @@ static struct resource s5pv310_ac97_resource[] = {
306}; 309};
307 310
308static struct s3c_audio_pdata s3c_ac97_pdata = { 311static struct s3c_audio_pdata s3c_ac97_pdata = {
309 .cfg_gpio = s5pv310_ac97_cfg_gpio, 312 .cfg_gpio = exynos4_ac97_cfg_gpio,
310}; 313};
311 314
312static u64 s5pv310_ac97_dmamask = DMA_BIT_MASK(32); 315static u64 exynos4_ac97_dmamask = DMA_BIT_MASK(32);
313 316
314struct platform_device s5pv310_device_ac97 = { 317struct platform_device exynos4_device_ac97 = {
315 .name = "samsung-ac97", 318 .name = "samsung-ac97",
316 .id = -1, 319 .id = -1,
317 .num_resources = ARRAY_SIZE(s5pv310_ac97_resource), 320 .num_resources = ARRAY_SIZE(exynos4_ac97_resource),
318 .resource = s5pv310_ac97_resource, 321 .resource = exynos4_ac97_resource,
319 .dev = { 322 .dev = {
320 .platform_data = &s3c_ac97_pdata, 323 .platform_data = &s3c_ac97_pdata,
321 .dma_mask = &s5pv310_ac97_dmamask, 324 .dma_mask = &exynos4_ac97_dmamask,
322 .coherent_dma_mask = DMA_BIT_MASK(32), 325 .coherent_dma_mask = DMA_BIT_MASK(32),
323 }, 326 },
324}; 327};
325 328
326/* S/PDIF Controller platform_device */ 329/* S/PDIF Controller platform_device */
327 330
328static int s5pv310_spdif_cfg_gpio(struct platform_device *pdev) 331static int exynos4_spdif_cfg_gpio(struct platform_device *pdev)
329{ 332{
330 s3c_gpio_cfgpin_range(S5PV310_GPC1(0), 2, S3C_GPIO_SFN(3)); 333 s3c_gpio_cfgpin_range(EXYNOS4_GPC1(0), 2, S3C_GPIO_SFN(3));
331 334
332 return 0; 335 return 0;
333} 336}
334 337
335static struct resource s5pv310_spdif_resource[] = { 338static struct resource exynos4_spdif_resource[] = {
336 [0] = { 339 [0] = {
337 .start = S5PV310_PA_SPDIF, 340 .start = EXYNOS4_PA_SPDIF,
338 .end = S5PV310_PA_SPDIF + 0x100 - 1, 341 .end = EXYNOS4_PA_SPDIF + 0x100 - 1,
339 .flags = IORESOURCE_MEM, 342 .flags = IORESOURCE_MEM,
340 }, 343 },
341 [1] = { 344 [1] = {
@@ -346,19 +349,19 @@ static struct resource s5pv310_spdif_resource[] = {
346}; 349};
347 350
348static struct s3c_audio_pdata samsung_spdif_pdata = { 351static struct s3c_audio_pdata samsung_spdif_pdata = {
349 .cfg_gpio = s5pv310_spdif_cfg_gpio, 352 .cfg_gpio = exynos4_spdif_cfg_gpio,
350}; 353};
351 354
352static u64 s5pv310_spdif_dmamask = DMA_BIT_MASK(32); 355static u64 exynos4_spdif_dmamask = DMA_BIT_MASK(32);
353 356
354struct platform_device s5pv310_device_spdif = { 357struct platform_device exynos4_device_spdif = {
355 .name = "samsung-spdif", 358 .name = "samsung-spdif",
356 .id = -1, 359 .id = -1,
357 .num_resources = ARRAY_SIZE(s5pv310_spdif_resource), 360 .num_resources = ARRAY_SIZE(exynos4_spdif_resource),
358 .resource = s5pv310_spdif_resource, 361 .resource = exynos4_spdif_resource,
359 .dev = { 362 .dev = {
360 .platform_data = &samsung_spdif_pdata, 363 .platform_data = &samsung_spdif_pdata,
361 .dma_mask = &s5pv310_spdif_dmamask, 364 .dma_mask = &exynos4_spdif_dmamask,
362 .coherent_dma_mask = DMA_BIT_MASK(32), 365 .coherent_dma_mask = DMA_BIT_MASK(32),
363 }, 366 },
364}; 367};
diff --git a/arch/arm/mach-s5pv310/dev-pd.c b/arch/arm/mach-exynos4/dev-pd.c
index 58a50c2d0b67..3273f25d6a75 100644
--- a/arch/arm/mach-s5pv310/dev-pd.c
+++ b/arch/arm/mach-exynos4/dev-pd.c
@@ -1,9 +1,9 @@
1/* linux/arch/arm/mach-s5pv310/dev-pd.c 1/* linux/arch/arm/mach-exynos4/dev-pd.c
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 4 * http://www.samsung.com
5 * 5 *
6 * S5PV310 - Power Domain support 6 * EXYNOS4 - Power Domain support
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -19,7 +19,7 @@
19 19
20#include <plat/pd.h> 20#include <plat/pd.h>
21 21
22static int s5pv310_pd_enable(struct device *dev) 22static int exynos4_pd_enable(struct device *dev)
23{ 23{
24 struct samsung_pd_info *pdata = dev->platform_data; 24 struct samsung_pd_info *pdata = dev->platform_data;
25 u32 timeout; 25 u32 timeout;
@@ -42,7 +42,7 @@ static int s5pv310_pd_enable(struct device *dev)
42 return 0; 42 return 0;
43} 43}
44 44
45static int s5pv310_pd_disable(struct device *dev) 45static int exynos4_pd_disable(struct device *dev)
46{ 46{
47 struct samsung_pd_info *pdata = dev->platform_data; 47 struct samsung_pd_info *pdata = dev->platform_data;
48 u32 timeout; 48 u32 timeout;
@@ -64,14 +64,14 @@ static int s5pv310_pd_disable(struct device *dev)
64 return 0; 64 return 0;
65} 65}
66 66
67struct platform_device s5pv310_device_pd[] = { 67struct platform_device exynos4_device_pd[] = {
68 { 68 {
69 .name = "samsung-pd", 69 .name = "samsung-pd",
70 .id = 0, 70 .id = 0,
71 .dev = { 71 .dev = {
72 .platform_data = &(struct samsung_pd_info) { 72 .platform_data = &(struct samsung_pd_info) {
73 .enable = s5pv310_pd_enable, 73 .enable = exynos4_pd_enable,
74 .disable = s5pv310_pd_disable, 74 .disable = exynos4_pd_disable,
75 .base = S5P_PMU_MFC_CONF, 75 .base = S5P_PMU_MFC_CONF,
76 }, 76 },
77 }, 77 },
@@ -80,8 +80,8 @@ struct platform_device s5pv310_device_pd[] = {
80 .id = 1, 80 .id = 1,
81 .dev = { 81 .dev = {
82 .platform_data = &(struct samsung_pd_info) { 82 .platform_data = &(struct samsung_pd_info) {
83 .enable = s5pv310_pd_enable, 83 .enable = exynos4_pd_enable,
84 .disable = s5pv310_pd_disable, 84 .disable = exynos4_pd_disable,
85 .base = S5P_PMU_G3D_CONF, 85 .base = S5P_PMU_G3D_CONF,
86 }, 86 },
87 }, 87 },
@@ -90,8 +90,8 @@ struct platform_device s5pv310_device_pd[] = {
90 .id = 2, 90 .id = 2,
91 .dev = { 91 .dev = {
92 .platform_data = &(struct samsung_pd_info) { 92 .platform_data = &(struct samsung_pd_info) {
93 .enable = s5pv310_pd_enable, 93 .enable = exynos4_pd_enable,
94 .disable = s5pv310_pd_disable, 94 .disable = exynos4_pd_disable,
95 .base = S5P_PMU_LCD0_CONF, 95 .base = S5P_PMU_LCD0_CONF,
96 }, 96 },
97 }, 97 },
@@ -100,8 +100,8 @@ struct platform_device s5pv310_device_pd[] = {
100 .id = 3, 100 .id = 3,
101 .dev = { 101 .dev = {
102 .platform_data = &(struct samsung_pd_info) { 102 .platform_data = &(struct samsung_pd_info) {
103 .enable = s5pv310_pd_enable, 103 .enable = exynos4_pd_enable,
104 .disable = s5pv310_pd_disable, 104 .disable = exynos4_pd_disable,
105 .base = S5P_PMU_LCD1_CONF, 105 .base = S5P_PMU_LCD1_CONF,
106 }, 106 },
107 }, 107 },
@@ -110,8 +110,8 @@ struct platform_device s5pv310_device_pd[] = {
110 .id = 4, 110 .id = 4,
111 .dev = { 111 .dev = {
112 .platform_data = &(struct samsung_pd_info) { 112 .platform_data = &(struct samsung_pd_info) {
113 .enable = s5pv310_pd_enable, 113 .enable = exynos4_pd_enable,
114 .disable = s5pv310_pd_disable, 114 .disable = exynos4_pd_disable,
115 .base = S5P_PMU_TV_CONF, 115 .base = S5P_PMU_TV_CONF,
116 }, 116 },
117 }, 117 },
@@ -120,8 +120,8 @@ struct platform_device s5pv310_device_pd[] = {
120 .id = 5, 120 .id = 5,
121 .dev = { 121 .dev = {
122 .platform_data = &(struct samsung_pd_info) { 122 .platform_data = &(struct samsung_pd_info) {
123 .enable = s5pv310_pd_enable, 123 .enable = exynos4_pd_enable,
124 .disable = s5pv310_pd_disable, 124 .disable = exynos4_pd_disable,
125 .base = S5P_PMU_CAM_CONF, 125 .base = S5P_PMU_CAM_CONF,
126 }, 126 },
127 }, 127 },
@@ -130,8 +130,8 @@ struct platform_device s5pv310_device_pd[] = {
130 .id = 6, 130 .id = 6,
131 .dev = { 131 .dev = {
132 .platform_data = &(struct samsung_pd_info) { 132 .platform_data = &(struct samsung_pd_info) {
133 .enable = s5pv310_pd_enable, 133 .enable = exynos4_pd_enable,
134 .disable = s5pv310_pd_disable, 134 .disable = exynos4_pd_disable,
135 .base = S5P_PMU_GPS_CONF, 135 .base = S5P_PMU_GPS_CONF,
136 }, 136 },
137 }, 137 },
diff --git a/arch/arm/mach-s5pv310/dev-sysmmu.c b/arch/arm/mach-exynos4/dev-sysmmu.c
index e1bb200ac0f0..3b7cae0fe23e 100644
--- a/arch/arm/mach-s5pv310/dev-sysmmu.c
+++ b/arch/arm/mach-exynos4/dev-sysmmu.c
@@ -1,8 +1,10 @@
1/* linux/arch/arm/mach-s5pv310/dev-sysmmu.c 1/* linux/arch/arm/mach-exynos4/dev-sysmmu.c
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 4 * http://www.samsung.com
5 * 5 *
6 * EXYNOS4 - System MMU support
7 *
6 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
@@ -13,11 +15,33 @@
13 15
14#include <mach/map.h> 16#include <mach/map.h>
15#include <mach/irqs.h> 17#include <mach/irqs.h>
18#include <mach/sysmmu.h>
19#include <plat/s5p-clock.h>
20
21/* These names must be equal to the clock names in mach-exynos4/clock.c */
22const char *sysmmu_ips_name[EXYNOS4_SYSMMU_TOTAL_IPNUM] = {
23 "SYSMMU_MDMA" ,
24 "SYSMMU_SSS" ,
25 "SYSMMU_FIMC0" ,
26 "SYSMMU_FIMC1" ,
27 "SYSMMU_FIMC2" ,
28 "SYSMMU_FIMC3" ,
29 "SYSMMU_JPEG" ,
30 "SYSMMU_FIMD0" ,
31 "SYSMMU_FIMD1" ,
32 "SYSMMU_PCIe" ,
33 "SYSMMU_G2D" ,
34 "SYSMMU_ROTATOR",
35 "SYSMMU_MDMA2" ,
36 "SYSMMU_TV" ,
37 "SYSMMU_MFC_L" ,
38 "SYSMMU_MFC_R" ,
39};
16 40
17static struct resource s5pv310_sysmmu_resource[] = { 41static struct resource exynos4_sysmmu_resource[] = {
18 [0] = { 42 [0] = {
19 .start = S5PV310_PA_SYSMMU_MDMA, 43 .start = EXYNOS4_PA_SYSMMU_MDMA,
20 .end = S5PV310_PA_SYSMMU_MDMA + SZ_64K - 1, 44 .end = EXYNOS4_PA_SYSMMU_MDMA + SZ_64K - 1,
21 .flags = IORESOURCE_MEM, 45 .flags = IORESOURCE_MEM,
22 }, 46 },
23 [1] = { 47 [1] = {
@@ -26,8 +50,8 @@ static struct resource s5pv310_sysmmu_resource[] = {
26 .flags = IORESOURCE_IRQ, 50 .flags = IORESOURCE_IRQ,
27 }, 51 },
28 [2] = { 52 [2] = {
29 .start = S5PV310_PA_SYSMMU_SSS, 53 .start = EXYNOS4_PA_SYSMMU_SSS,
30 .end = S5PV310_PA_SYSMMU_SSS + SZ_64K - 1, 54 .end = EXYNOS4_PA_SYSMMU_SSS + SZ_64K - 1,
31 .flags = IORESOURCE_MEM, 55 .flags = IORESOURCE_MEM,
32 }, 56 },
33 [3] = { 57 [3] = {
@@ -36,8 +60,8 @@ static struct resource s5pv310_sysmmu_resource[] = {
36 .flags = IORESOURCE_IRQ, 60 .flags = IORESOURCE_IRQ,
37 }, 61 },
38 [4] = { 62 [4] = {
39 .start = S5PV310_PA_SYSMMU_FIMC0, 63 .start = EXYNOS4_PA_SYSMMU_FIMC0,
40 .end = S5PV310_PA_SYSMMU_FIMC0 + SZ_64K - 1, 64 .end = EXYNOS4_PA_SYSMMU_FIMC0 + SZ_64K - 1,
41 .flags = IORESOURCE_MEM, 65 .flags = IORESOURCE_MEM,
42 }, 66 },
43 [5] = { 67 [5] = {
@@ -46,8 +70,8 @@ static struct resource s5pv310_sysmmu_resource[] = {
46 .flags = IORESOURCE_IRQ, 70 .flags = IORESOURCE_IRQ,
47 }, 71 },
48 [6] = { 72 [6] = {
49 .start = S5PV310_PA_SYSMMU_FIMC1, 73 .start = EXYNOS4_PA_SYSMMU_FIMC1,
50 .end = S5PV310_PA_SYSMMU_FIMC1 + SZ_64K - 1, 74 .end = EXYNOS4_PA_SYSMMU_FIMC1 + SZ_64K - 1,
51 .flags = IORESOURCE_MEM, 75 .flags = IORESOURCE_MEM,
52 }, 76 },
53 [7] = { 77 [7] = {
@@ -56,8 +80,8 @@ static struct resource s5pv310_sysmmu_resource[] = {
56 .flags = IORESOURCE_IRQ, 80 .flags = IORESOURCE_IRQ,
57 }, 81 },
58 [8] = { 82 [8] = {
59 .start = S5PV310_PA_SYSMMU_FIMC2, 83 .start = EXYNOS4_PA_SYSMMU_FIMC2,
60 .end = S5PV310_PA_SYSMMU_FIMC2 + SZ_64K - 1, 84 .end = EXYNOS4_PA_SYSMMU_FIMC2 + SZ_64K - 1,
61 .flags = IORESOURCE_MEM, 85 .flags = IORESOURCE_MEM,
62 }, 86 },
63 [9] = { 87 [9] = {
@@ -66,8 +90,8 @@ static struct resource s5pv310_sysmmu_resource[] = {
66 .flags = IORESOURCE_IRQ, 90 .flags = IORESOURCE_IRQ,
67 }, 91 },
68 [10] = { 92 [10] = {
69 .start = S5PV310_PA_SYSMMU_FIMC3, 93 .start = EXYNOS4_PA_SYSMMU_FIMC3,
70 .end = S5PV310_PA_SYSMMU_FIMC3 + SZ_64K - 1, 94 .end = EXYNOS4_PA_SYSMMU_FIMC3 + SZ_64K - 1,
71 .flags = IORESOURCE_MEM, 95 .flags = IORESOURCE_MEM,
72 }, 96 },
73 [11] = { 97 [11] = {
@@ -76,8 +100,8 @@ static struct resource s5pv310_sysmmu_resource[] = {
76 .flags = IORESOURCE_IRQ, 100 .flags = IORESOURCE_IRQ,
77 }, 101 },
78 [12] = { 102 [12] = {
79 .start = S5PV310_PA_SYSMMU_JPEG, 103 .start = EXYNOS4_PA_SYSMMU_JPEG,
80 .end = S5PV310_PA_SYSMMU_JPEG + SZ_64K - 1, 104 .end = EXYNOS4_PA_SYSMMU_JPEG + SZ_64K - 1,
81 .flags = IORESOURCE_MEM, 105 .flags = IORESOURCE_MEM,
82 }, 106 },
83 [13] = { 107 [13] = {
@@ -86,8 +110,8 @@ static struct resource s5pv310_sysmmu_resource[] = {
86 .flags = IORESOURCE_IRQ, 110 .flags = IORESOURCE_IRQ,
87 }, 111 },
88 [14] = { 112 [14] = {
89 .start = S5PV310_PA_SYSMMU_FIMD0, 113 .start = EXYNOS4_PA_SYSMMU_FIMD0,
90 .end = S5PV310_PA_SYSMMU_FIMD0 + SZ_64K - 1, 114 .end = EXYNOS4_PA_SYSMMU_FIMD0 + SZ_64K - 1,
91 .flags = IORESOURCE_MEM, 115 .flags = IORESOURCE_MEM,
92 }, 116 },
93 [15] = { 117 [15] = {
@@ -96,8 +120,8 @@ static struct resource s5pv310_sysmmu_resource[] = {
96 .flags = IORESOURCE_IRQ, 120 .flags = IORESOURCE_IRQ,
97 }, 121 },
98 [16] = { 122 [16] = {
99 .start = S5PV310_PA_SYSMMU_FIMD1, 123 .start = EXYNOS4_PA_SYSMMU_FIMD1,
100 .end = S5PV310_PA_SYSMMU_FIMD1 + SZ_64K - 1, 124 .end = EXYNOS4_PA_SYSMMU_FIMD1 + SZ_64K - 1,
101 .flags = IORESOURCE_MEM, 125 .flags = IORESOURCE_MEM,
102 }, 126 },
103 [17] = { 127 [17] = {
@@ -106,8 +130,8 @@ static struct resource s5pv310_sysmmu_resource[] = {
106 .flags = IORESOURCE_IRQ, 130 .flags = IORESOURCE_IRQ,
107 }, 131 },
108 [18] = { 132 [18] = {
109 .start = S5PV310_PA_SYSMMU_PCIe, 133 .start = EXYNOS4_PA_SYSMMU_PCIe,
110 .end = S5PV310_PA_SYSMMU_PCIe + SZ_64K - 1, 134 .end = EXYNOS4_PA_SYSMMU_PCIe + SZ_64K - 1,
111 .flags = IORESOURCE_MEM, 135 .flags = IORESOURCE_MEM,
112 }, 136 },
113 [19] = { 137 [19] = {
@@ -116,8 +140,8 @@ static struct resource s5pv310_sysmmu_resource[] = {
116 .flags = IORESOURCE_IRQ, 140 .flags = IORESOURCE_IRQ,
117 }, 141 },
118 [20] = { 142 [20] = {
119 .start = S5PV310_PA_SYSMMU_G2D, 143 .start = EXYNOS4_PA_SYSMMU_G2D,
120 .end = S5PV310_PA_SYSMMU_G2D + SZ_64K - 1, 144 .end = EXYNOS4_PA_SYSMMU_G2D + SZ_64K - 1,
121 .flags = IORESOURCE_MEM, 145 .flags = IORESOURCE_MEM,
122 }, 146 },
123 [21] = { 147 [21] = {
@@ -126,8 +150,8 @@ static struct resource s5pv310_sysmmu_resource[] = {
126 .flags = IORESOURCE_IRQ, 150 .flags = IORESOURCE_IRQ,
127 }, 151 },
128 [22] = { 152 [22] = {
129 .start = S5PV310_PA_SYSMMU_ROTATOR, 153 .start = EXYNOS4_PA_SYSMMU_ROTATOR,
130 .end = S5PV310_PA_SYSMMU_ROTATOR + SZ_64K - 1, 154 .end = EXYNOS4_PA_SYSMMU_ROTATOR + SZ_64K - 1,
131 .flags = IORESOURCE_MEM, 155 .flags = IORESOURCE_MEM,
132 }, 156 },
133 [23] = { 157 [23] = {
@@ -136,8 +160,8 @@ static struct resource s5pv310_sysmmu_resource[] = {
136 .flags = IORESOURCE_IRQ, 160 .flags = IORESOURCE_IRQ,
137 }, 161 },
138 [24] = { 162 [24] = {
139 .start = S5PV310_PA_SYSMMU_MDMA2, 163 .start = EXYNOS4_PA_SYSMMU_MDMA2,
140 .end = S5PV310_PA_SYSMMU_MDMA2 + SZ_64K - 1, 164 .end = EXYNOS4_PA_SYSMMU_MDMA2 + SZ_64K - 1,
141 .flags = IORESOURCE_MEM, 165 .flags = IORESOURCE_MEM,
142 }, 166 },
143 [25] = { 167 [25] = {
@@ -146,8 +170,8 @@ static struct resource s5pv310_sysmmu_resource[] = {
146 .flags = IORESOURCE_IRQ, 170 .flags = IORESOURCE_IRQ,
147 }, 171 },
148 [26] = { 172 [26] = {
149 .start = S5PV310_PA_SYSMMU_TV, 173 .start = EXYNOS4_PA_SYSMMU_TV,
150 .end = S5PV310_PA_SYSMMU_TV + SZ_64K - 1, 174 .end = EXYNOS4_PA_SYSMMU_TV + SZ_64K - 1,
151 .flags = IORESOURCE_MEM, 175 .flags = IORESOURCE_MEM,
152 }, 176 },
153 [27] = { 177 [27] = {
@@ -156,8 +180,8 @@ static struct resource s5pv310_sysmmu_resource[] = {
156 .flags = IORESOURCE_IRQ, 180 .flags = IORESOURCE_IRQ,
157 }, 181 },
158 [28] = { 182 [28] = {
159 .start = S5PV310_PA_SYSMMU_MFC_L, 183 .start = EXYNOS4_PA_SYSMMU_MFC_L,
160 .end = S5PV310_PA_SYSMMU_MFC_L + SZ_64K - 1, 184 .end = EXYNOS4_PA_SYSMMU_MFC_L + SZ_64K - 1,
161 .flags = IORESOURCE_MEM, 185 .flags = IORESOURCE_MEM,
162 }, 186 },
163 [29] = { 187 [29] = {
@@ -166,8 +190,8 @@ static struct resource s5pv310_sysmmu_resource[] = {
166 .flags = IORESOURCE_IRQ, 190 .flags = IORESOURCE_IRQ,
167 }, 191 },
168 [30] = { 192 [30] = {
169 .start = S5PV310_PA_SYSMMU_MFC_R, 193 .start = EXYNOS4_PA_SYSMMU_MFC_R,
170 .end = S5PV310_PA_SYSMMU_MFC_R + SZ_64K - 1, 194 .end = EXYNOS4_PA_SYSMMU_MFC_R + SZ_64K - 1,
171 .flags = IORESOURCE_MEM, 195 .flags = IORESOURCE_MEM,
172 }, 196 },
173 [31] = { 197 [31] = {
@@ -177,11 +201,32 @@ static struct resource s5pv310_sysmmu_resource[] = {
177 }, 201 },
178}; 202};
179 203
180struct platform_device s5pv310_device_sysmmu = { 204struct platform_device exynos4_device_sysmmu = {
181 .name = "s5p-sysmmu", 205 .name = "s5p-sysmmu",
182 .id = 32, 206 .id = 32,
183 .num_resources = ARRAY_SIZE(s5pv310_sysmmu_resource), 207 .num_resources = ARRAY_SIZE(exynos4_sysmmu_resource),
184 .resource = s5pv310_sysmmu_resource, 208 .resource = exynos4_sysmmu_resource,
185}; 209};
210EXPORT_SYMBOL(exynos4_device_sysmmu);
211
212static struct clk *sysmmu_clk[S5P_SYSMMU_TOTAL_IPNUM];
213void sysmmu_clk_init(struct device *dev, sysmmu_ips ips)
214{
215 sysmmu_clk[ips] = clk_get(dev, sysmmu_ips_name[ips]);
216 if (IS_ERR(sysmmu_clk[ips]))
217 sysmmu_clk[ips] = NULL;
218 else
219 clk_put(sysmmu_clk[ips]);
220}
221
222void sysmmu_clk_enable(sysmmu_ips ips)
223{
224 if (sysmmu_clk[ips])
225 clk_enable(sysmmu_clk[ips]);
226}
186 227
187EXPORT_SYMBOL(s5pv310_device_sysmmu); 228void sysmmu_clk_disable(sysmmu_ips ips)
229{
230 if (sysmmu_clk[ips])
231 clk_disable(sysmmu_clk[ips]);
232}
diff --git a/arch/arm/mach-s5pv310/dma.c b/arch/arm/mach-exynos4/dma.c
index 20066c7c9e56..564bb530f332 100644
--- a/arch/arm/mach-s5pv310/dma.c
+++ b/arch/arm/mach-exynos4/dma.c
@@ -1,4 +1,8 @@
1/* 1/* linux/arch/arm/mach-exynos4/dma.c
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
2 * Copyright (C) 2010 Samsung Electronics Co. Ltd. 6 * Copyright (C) 2010 Samsung Electronics Co. Ltd.
3 * Jaswinder Singh <jassi.brar@samsung.com> 7 * Jaswinder Singh <jassi.brar@samsung.com>
4 * 8 *
@@ -30,10 +34,10 @@
30 34
31static u64 dma_dmamask = DMA_BIT_MASK(32); 35static u64 dma_dmamask = DMA_BIT_MASK(32);
32 36
33static struct resource s5pv310_pdma0_resource[] = { 37static struct resource exynos4_pdma0_resource[] = {
34 [0] = { 38 [0] = {
35 .start = S5PV310_PA_PDMA0, 39 .start = EXYNOS4_PA_PDMA0,
36 .end = S5PV310_PA_PDMA0 + SZ_4K, 40 .end = EXYNOS4_PA_PDMA0 + SZ_4K,
37 .flags = IORESOURCE_MEM, 41 .flags = IORESOURCE_MEM,
38 }, 42 },
39 [1] = { 43 [1] = {
@@ -43,7 +47,7 @@ static struct resource s5pv310_pdma0_resource[] = {
43 }, 47 },
44}; 48};
45 49
46static struct s3c_pl330_platdata s5pv310_pdma0_pdata = { 50static struct s3c_pl330_platdata exynos4_pdma0_pdata = {
47 .peri = { 51 .peri = {
48 [0] = DMACH_PCM0_RX, 52 [0] = DMACH_PCM0_RX,
49 [1] = DMACH_PCM0_TX, 53 [1] = DMACH_PCM0_TX,
@@ -80,22 +84,22 @@ static struct s3c_pl330_platdata s5pv310_pdma0_pdata = {
80 }, 84 },
81}; 85};
82 86
83static struct platform_device s5pv310_device_pdma0 = { 87static struct platform_device exynos4_device_pdma0 = {
84 .name = "s3c-pl330", 88 .name = "s3c-pl330",
85 .id = 0, 89 .id = 0,
86 .num_resources = ARRAY_SIZE(s5pv310_pdma0_resource), 90 .num_resources = ARRAY_SIZE(exynos4_pdma0_resource),
87 .resource = s5pv310_pdma0_resource, 91 .resource = exynos4_pdma0_resource,
88 .dev = { 92 .dev = {
89 .dma_mask = &dma_dmamask, 93 .dma_mask = &dma_dmamask,
90 .coherent_dma_mask = DMA_BIT_MASK(32), 94 .coherent_dma_mask = DMA_BIT_MASK(32),
91 .platform_data = &s5pv310_pdma0_pdata, 95 .platform_data = &exynos4_pdma0_pdata,
92 }, 96 },
93}; 97};
94 98
95static struct resource s5pv310_pdma1_resource[] = { 99static struct resource exynos4_pdma1_resource[] = {
96 [0] = { 100 [0] = {
97 .start = S5PV310_PA_PDMA1, 101 .start = EXYNOS4_PA_PDMA1,
98 .end = S5PV310_PA_PDMA1 + SZ_4K, 102 .end = EXYNOS4_PA_PDMA1 + SZ_4K,
99 .flags = IORESOURCE_MEM, 103 .flags = IORESOURCE_MEM,
100 }, 104 },
101 [1] = { 105 [1] = {
@@ -105,7 +109,7 @@ static struct resource s5pv310_pdma1_resource[] = {
105 }, 109 },
106}; 110};
107 111
108static struct s3c_pl330_platdata s5pv310_pdma1_pdata = { 112static struct s3c_pl330_platdata exynos4_pdma1_pdata = {
109 .peri = { 113 .peri = {
110 [0] = DMACH_PCM0_RX, 114 [0] = DMACH_PCM0_RX,
111 [1] = DMACH_PCM0_TX, 115 [1] = DMACH_PCM0_TX,
@@ -142,27 +146,27 @@ static struct s3c_pl330_platdata s5pv310_pdma1_pdata = {
142 }, 146 },
143}; 147};
144 148
145static struct platform_device s5pv310_device_pdma1 = { 149static struct platform_device exynos4_device_pdma1 = {
146 .name = "s3c-pl330", 150 .name = "s3c-pl330",
147 .id = 1, 151 .id = 1,
148 .num_resources = ARRAY_SIZE(s5pv310_pdma1_resource), 152 .num_resources = ARRAY_SIZE(exynos4_pdma1_resource),
149 .resource = s5pv310_pdma1_resource, 153 .resource = exynos4_pdma1_resource,
150 .dev = { 154 .dev = {
151 .dma_mask = &dma_dmamask, 155 .dma_mask = &dma_dmamask,
152 .coherent_dma_mask = DMA_BIT_MASK(32), 156 .coherent_dma_mask = DMA_BIT_MASK(32),
153 .platform_data = &s5pv310_pdma1_pdata, 157 .platform_data = &exynos4_pdma1_pdata,
154 }, 158 },
155}; 159};
156 160
157static struct platform_device *s5pv310_dmacs[] __initdata = { 161static struct platform_device *exynos4_dmacs[] __initdata = {
158 &s5pv310_device_pdma0, 162 &exynos4_device_pdma0,
159 &s5pv310_device_pdma1, 163 &exynos4_device_pdma1,
160}; 164};
161 165
162static int __init s5pv310_dma_init(void) 166static int __init exynos4_dma_init(void)
163{ 167{
164 platform_add_devices(s5pv310_dmacs, ARRAY_SIZE(s5pv310_dmacs)); 168 platform_add_devices(exynos4_dmacs, ARRAY_SIZE(exynos4_dmacs));
165 169
166 return 0; 170 return 0;
167} 171}
168arch_initcall(s5pv310_dma_init); 172arch_initcall(exynos4_dma_init);
diff --git a/arch/arm/mach-exynos4/gpiolib.c b/arch/arm/mach-exynos4/gpiolib.c
new file mode 100644
index 000000000000..d54ca6adb660
--- /dev/null
+++ b/arch/arm/mach-exynos4/gpiolib.c
@@ -0,0 +1,365 @@
1/* linux/arch/arm/mach-exynos4/gpiolib.c
2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * EXYNOS4 - GPIOlib support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/kernel.h>
14#include <linux/irq.h>
15#include <linux/io.h>
16#include <linux/gpio.h>
17
18#include <mach/map.h>
19
20#include <plat/gpio-core.h>
21#include <plat/gpio-cfg.h>
22#include <plat/gpio-cfg-helpers.h>
23
24static struct s3c_gpio_cfg gpio_cfg = {
25 .set_config = s3c_gpio_setcfg_s3c64xx_4bit,
26 .set_pull = s3c_gpio_setpull_updown,
27 .get_pull = s3c_gpio_getpull_updown,
28};
29
30static struct s3c_gpio_cfg gpio_cfg_noint = {
31 .set_config = s3c_gpio_setcfg_s3c64xx_4bit,
32 .set_pull = s3c_gpio_setpull_updown,
33 .get_pull = s3c_gpio_getpull_updown,
34};
35
36/*
37 * Following are the gpio banks in v310.
38 *
39 * The 'config' member when left to NULL, is initialized to the default
40 * structure gpio_cfg in the init function below.
41 *
42 * The 'base' member is also initialized in the init function below.
43 * Note: The initialization of 'base' member of s3c_gpio_chip structure
44 * uses the above macro and depends on the banks being listed in order here.
45 */
46static struct s3c_gpio_chip exynos4_gpio_part1_4bit[] = {
47 {
48 .chip = {
49 .base = EXYNOS4_GPA0(0),
50 .ngpio = EXYNOS4_GPIO_A0_NR,
51 .label = "GPA0",
52 },
53 }, {
54 .chip = {
55 .base = EXYNOS4_GPA1(0),
56 .ngpio = EXYNOS4_GPIO_A1_NR,
57 .label = "GPA1",
58 },
59 }, {
60 .chip = {
61 .base = EXYNOS4_GPB(0),
62 .ngpio = EXYNOS4_GPIO_B_NR,
63 .label = "GPB",
64 },
65 }, {
66 .chip = {
67 .base = EXYNOS4_GPC0(0),
68 .ngpio = EXYNOS4_GPIO_C0_NR,
69 .label = "GPC0",
70 },
71 }, {
72 .chip = {
73 .base = EXYNOS4_GPC1(0),
74 .ngpio = EXYNOS4_GPIO_C1_NR,
75 .label = "GPC1",
76 },
77 }, {
78 .chip = {
79 .base = EXYNOS4_GPD0(0),
80 .ngpio = EXYNOS4_GPIO_D0_NR,
81 .label = "GPD0",
82 },
83 }, {
84 .chip = {
85 .base = EXYNOS4_GPD1(0),
86 .ngpio = EXYNOS4_GPIO_D1_NR,
87 .label = "GPD1",
88 },
89 }, {
90 .chip = {
91 .base = EXYNOS4_GPE0(0),
92 .ngpio = EXYNOS4_GPIO_E0_NR,
93 .label = "GPE0",
94 },
95 }, {
96 .chip = {
97 .base = EXYNOS4_GPE1(0),
98 .ngpio = EXYNOS4_GPIO_E1_NR,
99 .label = "GPE1",
100 },
101 }, {
102 .chip = {
103 .base = EXYNOS4_GPE2(0),
104 .ngpio = EXYNOS4_GPIO_E2_NR,
105 .label = "GPE2",
106 },
107 }, {
108 .chip = {
109 .base = EXYNOS4_GPE3(0),
110 .ngpio = EXYNOS4_GPIO_E3_NR,
111 .label = "GPE3",
112 },
113 }, {
114 .chip = {
115 .base = EXYNOS4_GPE4(0),
116 .ngpio = EXYNOS4_GPIO_E4_NR,
117 .label = "GPE4",
118 },
119 }, {
120 .chip = {
121 .base = EXYNOS4_GPF0(0),
122 .ngpio = EXYNOS4_GPIO_F0_NR,
123 .label = "GPF0",
124 },
125 }, {
126 .chip = {
127 .base = EXYNOS4_GPF1(0),
128 .ngpio = EXYNOS4_GPIO_F1_NR,
129 .label = "GPF1",
130 },
131 }, {
132 .chip = {
133 .base = EXYNOS4_GPF2(0),
134 .ngpio = EXYNOS4_GPIO_F2_NR,
135 .label = "GPF2",
136 },
137 }, {
138 .chip = {
139 .base = EXYNOS4_GPF3(0),
140 .ngpio = EXYNOS4_GPIO_F3_NR,
141 .label = "GPF3",
142 },
143 },
144};
145
146static struct s3c_gpio_chip exynos4_gpio_part2_4bit[] = {
147 {
148 .chip = {
149 .base = EXYNOS4_GPJ0(0),
150 .ngpio = EXYNOS4_GPIO_J0_NR,
151 .label = "GPJ0",
152 },
153 }, {
154 .chip = {
155 .base = EXYNOS4_GPJ1(0),
156 .ngpio = EXYNOS4_GPIO_J1_NR,
157 .label = "GPJ1",
158 },
159 }, {
160 .chip = {
161 .base = EXYNOS4_GPK0(0),
162 .ngpio = EXYNOS4_GPIO_K0_NR,
163 .label = "GPK0",
164 },
165 }, {
166 .chip = {
167 .base = EXYNOS4_GPK1(0),
168 .ngpio = EXYNOS4_GPIO_K1_NR,
169 .label = "GPK1",
170 },
171 }, {
172 .chip = {
173 .base = EXYNOS4_GPK2(0),
174 .ngpio = EXYNOS4_GPIO_K2_NR,
175 .label = "GPK2",
176 },
177 }, {
178 .chip = {
179 .base = EXYNOS4_GPK3(0),
180 .ngpio = EXYNOS4_GPIO_K3_NR,
181 .label = "GPK3",
182 },
183 }, {
184 .chip = {
185 .base = EXYNOS4_GPL0(0),
186 .ngpio = EXYNOS4_GPIO_L0_NR,
187 .label = "GPL0",
188 },
189 }, {
190 .chip = {
191 .base = EXYNOS4_GPL1(0),
192 .ngpio = EXYNOS4_GPIO_L1_NR,
193 .label = "GPL1",
194 },
195 }, {
196 .chip = {
197 .base = EXYNOS4_GPL2(0),
198 .ngpio = EXYNOS4_GPIO_L2_NR,
199 .label = "GPL2",
200 },
201 }, {
202 .config = &gpio_cfg_noint,
203 .chip = {
204 .base = EXYNOS4_GPY0(0),
205 .ngpio = EXYNOS4_GPIO_Y0_NR,
206 .label = "GPY0",
207 },
208 }, {
209 .config = &gpio_cfg_noint,
210 .chip = {
211 .base = EXYNOS4_GPY1(0),
212 .ngpio = EXYNOS4_GPIO_Y1_NR,
213 .label = "GPY1",
214 },
215 }, {
216 .config = &gpio_cfg_noint,
217 .chip = {
218 .base = EXYNOS4_GPY2(0),
219 .ngpio = EXYNOS4_GPIO_Y2_NR,
220 .label = "GPY2",
221 },
222 }, {
223 .config = &gpio_cfg_noint,
224 .chip = {
225 .base = EXYNOS4_GPY3(0),
226 .ngpio = EXYNOS4_GPIO_Y3_NR,
227 .label = "GPY3",
228 },
229 }, {
230 .config = &gpio_cfg_noint,
231 .chip = {
232 .base = EXYNOS4_GPY4(0),
233 .ngpio = EXYNOS4_GPIO_Y4_NR,
234 .label = "GPY4",
235 },
236 }, {
237 .config = &gpio_cfg_noint,
238 .chip = {
239 .base = EXYNOS4_GPY5(0),
240 .ngpio = EXYNOS4_GPIO_Y5_NR,
241 .label = "GPY5",
242 },
243 }, {
244 .config = &gpio_cfg_noint,
245 .chip = {
246 .base = EXYNOS4_GPY6(0),
247 .ngpio = EXYNOS4_GPIO_Y6_NR,
248 .label = "GPY6",
249 },
250 }, {
251 .base = (S5P_VA_GPIO2 + 0xC00),
252 .config = &gpio_cfg_noint,
253 .irq_base = IRQ_EINT(0),
254 .chip = {
255 .base = EXYNOS4_GPX0(0),
256 .ngpio = EXYNOS4_GPIO_X0_NR,
257 .label = "GPX0",
258 .to_irq = samsung_gpiolib_to_irq,
259 },
260 }, {
261 .base = (S5P_VA_GPIO2 + 0xC20),
262 .config = &gpio_cfg_noint,
263 .irq_base = IRQ_EINT(8),
264 .chip = {
265 .base = EXYNOS4_GPX1(0),
266 .ngpio = EXYNOS4_GPIO_X1_NR,
267 .label = "GPX1",
268 .to_irq = samsung_gpiolib_to_irq,
269 },
270 }, {
271 .base = (S5P_VA_GPIO2 + 0xC40),
272 .config = &gpio_cfg_noint,
273 .irq_base = IRQ_EINT(16),
274 .chip = {
275 .base = EXYNOS4_GPX2(0),
276 .ngpio = EXYNOS4_GPIO_X2_NR,
277 .label = "GPX2",
278 .to_irq = samsung_gpiolib_to_irq,
279 },
280 }, {
281 .base = (S5P_VA_GPIO2 + 0xC60),
282 .config = &gpio_cfg_noint,
283 .irq_base = IRQ_EINT(24),
284 .chip = {
285 .base = EXYNOS4_GPX3(0),
286 .ngpio = EXYNOS4_GPIO_X3_NR,
287 .label = "GPX3",
288 .to_irq = samsung_gpiolib_to_irq,
289 },
290 },
291};
292
293static struct s3c_gpio_chip exynos4_gpio_part3_4bit[] = {
294 {
295 .chip = {
296 .base = EXYNOS4_GPZ(0),
297 .ngpio = EXYNOS4_GPIO_Z_NR,
298 .label = "GPZ",
299 },
300 },
301};
302
303static __init int exynos4_gpiolib_init(void)
304{
305 struct s3c_gpio_chip *chip;
306 int i;
307 int group = 0;
308 int nr_chips;
309
310 /* GPIO part 1 */
311
312 chip = exynos4_gpio_part1_4bit;
313 nr_chips = ARRAY_SIZE(exynos4_gpio_part1_4bit);
314
315 for (i = 0; i < nr_chips; i++, chip++) {
316 if (chip->config == NULL) {
317 chip->config = &gpio_cfg;
318 /* Assign the GPIO interrupt group */
319 chip->group = group++;
320 }
321 if (chip->base == NULL)
322 chip->base = S5P_VA_GPIO1 + (i) * 0x20;
323 }
324
325 samsung_gpiolib_add_4bit_chips(exynos4_gpio_part1_4bit, nr_chips);
326
327 /* GPIO part 2 */
328
329 chip = exynos4_gpio_part2_4bit;
330 nr_chips = ARRAY_SIZE(exynos4_gpio_part2_4bit);
331
332 for (i = 0; i < nr_chips; i++, chip++) {
333 if (chip->config == NULL) {
334 chip->config = &gpio_cfg;
335 /* Assign the GPIO interrupt group */
336 chip->group = group++;
337 }
338 if (chip->base == NULL)
339 chip->base = S5P_VA_GPIO2 + (i) * 0x20;
340 }
341
342 samsung_gpiolib_add_4bit_chips(exynos4_gpio_part2_4bit, nr_chips);
343
344 /* GPIO part 3 */
345
346 chip = exynos4_gpio_part3_4bit;
347 nr_chips = ARRAY_SIZE(exynos4_gpio_part3_4bit);
348
349 for (i = 0; i < nr_chips; i++, chip++) {
350 if (chip->config == NULL) {
351 chip->config = &gpio_cfg;
352 /* Assign the GPIO interrupt group */
353 chip->group = group++;
354 }
355 if (chip->base == NULL)
356 chip->base = S5P_VA_GPIO3 + (i) * 0x20;
357 }
358
359 samsung_gpiolib_add_4bit_chips(exynos4_gpio_part3_4bit, nr_chips);
360 s5p_register_gpioint_bank(IRQ_GPIO_XA, 0, IRQ_GPIO1_NR_GROUPS);
361 s5p_register_gpioint_bank(IRQ_GPIO_XB, IRQ_GPIO1_NR_GROUPS, IRQ_GPIO2_NR_GROUPS);
362
363 return 0;
364}
365core_initcall(exynos4_gpiolib_init);
diff --git a/arch/arm/mach-s5pv310/headsmp.S b/arch/arm/mach-exynos4/headsmp.S
index 164b7b045713..6c6cfc50c46b 100644
--- a/arch/arm/mach-s5pv310/headsmp.S
+++ b/arch/arm/mach-exynos4/headsmp.S
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-s5pv310/headsmp.S 2 * linux/arch/arm/mach-exynos4/headsmp.S
3 * 3 *
4 * Cloned from linux/arch/arm/mach-realview/headsmp.S 4 * Cloned from linux/arch/arm/mach-realview/headsmp.S
5 * 5 *
@@ -16,11 +16,11 @@
16 __INIT 16 __INIT
17 17
18/* 18/*
19 * s5pv310 specific entry point for secondary CPUs. This provides 19 * exynos4 specific entry point for secondary CPUs. This provides
20 * a "holding pen" into which all secondary cores are held until we're 20 * a "holding pen" into which all secondary cores are held until we're
21 * ready for them to initialise. 21 * ready for them to initialise.
22 */ 22 */
23ENTRY(s5pv310_secondary_startup) 23ENTRY(exynos4_secondary_startup)
24 mrc p15, 0, r0, c0, c0, 5 24 mrc p15, 0, r0, c0, c0, 5
25 and r0, r0, #15 25 and r0, r0, #15
26 adr r4, 1f 26 adr r4, 1f
diff --git a/arch/arm/mach-s5pv310/hotplug.c b/arch/arm/mach-exynos4/hotplug.c
index c24235c89eed..2b5909e2ccd3 100644
--- a/arch/arm/mach-s5pv310/hotplug.c
+++ b/arch/arm/mach-exynos4/hotplug.c
@@ -1,4 +1,4 @@
1/* linux arch/arm/mach-s5pv310/hotplug.c 1/* linux arch/arm/mach-exynos4/hotplug.c
2 * 2 *
3 * Cloned from linux/arch/arm/mach-realview/hotplug.c 3 * Cloned from linux/arch/arm/mach-realview/hotplug.c
4 * 4 *
@@ -30,13 +30,13 @@ static inline void cpu_enter_lowpower(void)
30 * Turn off coherency 30 * Turn off coherency
31 */ 31 */
32 " mrc p15, 0, %0, c1, c0, 1\n" 32 " mrc p15, 0, %0, c1, c0, 1\n"
33 " bic %0, %0, #0x20\n" 33 " bic %0, %0, %3\n"
34 " mcr p15, 0, %0, c1, c0, 1\n" 34 " mcr p15, 0, %0, c1, c0, 1\n"
35 " mrc p15, 0, %0, c1, c0, 0\n" 35 " mrc p15, 0, %0, c1, c0, 0\n"
36 " bic %0, %0, %2\n" 36 " bic %0, %0, %2\n"
37 " mcr p15, 0, %0, c1, c0, 0\n" 37 " mcr p15, 0, %0, c1, c0, 0\n"
38 : "=&r" (v) 38 : "=&r" (v)
39 : "r" (0), "Ir" (CR_C) 39 : "r" (0), "Ir" (CR_C), "Ir" (0x40)
40 : "cc"); 40 : "cc");
41} 41}
42 42
@@ -49,10 +49,10 @@ static inline void cpu_leave_lowpower(void)
49 " orr %0, %0, %1\n" 49 " orr %0, %0, %1\n"
50 " mcr p15, 0, %0, c1, c0, 0\n" 50 " mcr p15, 0, %0, c1, c0, 0\n"
51 " mrc p15, 0, %0, c1, c0, 1\n" 51 " mrc p15, 0, %0, c1, c0, 1\n"
52 " orr %0, %0, #0x20\n" 52 " orr %0, %0, %2\n"
53 " mcr p15, 0, %0, c1, c0, 1\n" 53 " mcr p15, 0, %0, c1, c0, 1\n"
54 : "=&r" (v) 54 : "=&r" (v)
55 : "Ir" (CR_C) 55 : "Ir" (CR_C), "Ir" (0x40)
56 : "cc"); 56 : "cc");
57} 57}
58 58
diff --git a/arch/arm/mach-s5pv310/include/mach/debug-macro.S b/arch/arm/mach-exynos4/include/mach/debug-macro.S
index b0d920c474d3..58bbd049a6c4 100644
--- a/arch/arm/mach-s5pv310/include/mach/debug-macro.S
+++ b/arch/arm/mach-exynos4/include/mach/debug-macro.S
@@ -1,7 +1,7 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/debug-macro.S 1/* linux/arch/arm/mach-exynos4/include/mach/debug-macro.S
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * Based on arch/arm/mach-s3c6400/include/mach/debug-macro.S 6 * Based on arch/arm/mach-s3c6400/include/mach/debug-macro.S
7 * 7 *
diff --git a/arch/arm/mach-s5pv310/include/mach/dma.h b/arch/arm/mach-exynos4/include/mach/dma.h
index 81209eb1409b..81209eb1409b 100644
--- a/arch/arm/mach-s5pv310/include/mach/dma.h
+++ b/arch/arm/mach-exynos4/include/mach/dma.h
diff --git a/arch/arm/mach-s5pv310/include/mach/entry-macro.S b/arch/arm/mach-exynos4/include/mach/entry-macro.S
index e600e1d522df..d8f38c2e5654 100644
--- a/arch/arm/mach-s5pv310/include/mach/entry-macro.S
+++ b/arch/arm/mach-exynos4/include/mach/entry-macro.S
@@ -1,8 +1,8 @@
1/* arch/arm/mach-s5pv310/include/mach/entry-macro.S 1/* arch/arm/mach-exynos4/include/mach/entry-macro.S
2 * 2 *
3 * Cloned from arch/arm/mach-realview/include/mach/entry-macro.S 3 * Cloned from arch/arm/mach-realview/include/mach/entry-macro.S
4 * 4 *
5 * Low-level IRQ helper macros for S5PV310 platforms 5 * Low-level IRQ helper macros for EXYNOS4 platforms
6 * 6 *
7 * This file is licensed under the terms of the GNU General Public 7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any 8 * License version 2. This program is licensed "as is" without any
diff --git a/arch/arm/mach-exynos4/include/mach/gpio.h b/arch/arm/mach-exynos4/include/mach/gpio.h
new file mode 100644
index 000000000000..939728b38d48
--- /dev/null
+++ b/arch/arm/mach-exynos4/include/mach/gpio.h
@@ -0,0 +1,156 @@
1/* linux/arch/arm/mach-exynos4/include/mach/gpio.h
2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * EXYNOS4 - GPIO lib support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_GPIO_H
14#define __ASM_ARCH_GPIO_H __FILE__
15
16#define gpio_get_value __gpio_get_value
17#define gpio_set_value __gpio_set_value
18#define gpio_cansleep __gpio_cansleep
19#define gpio_to_irq __gpio_to_irq
20
21/* Practically, GPIO banks upto GPZ are the configurable gpio banks */
22
23/* GPIO bank sizes */
24#define EXYNOS4_GPIO_A0_NR (8)
25#define EXYNOS4_GPIO_A1_NR (6)
26#define EXYNOS4_GPIO_B_NR (8)
27#define EXYNOS4_GPIO_C0_NR (5)
28#define EXYNOS4_GPIO_C1_NR (5)
29#define EXYNOS4_GPIO_D0_NR (4)
30#define EXYNOS4_GPIO_D1_NR (4)
31#define EXYNOS4_GPIO_E0_NR (5)
32#define EXYNOS4_GPIO_E1_NR (8)
33#define EXYNOS4_GPIO_E2_NR (6)
34#define EXYNOS4_GPIO_E3_NR (8)
35#define EXYNOS4_GPIO_E4_NR (8)
36#define EXYNOS4_GPIO_F0_NR (8)
37#define EXYNOS4_GPIO_F1_NR (8)
38#define EXYNOS4_GPIO_F2_NR (8)
39#define EXYNOS4_GPIO_F3_NR (6)
40#define EXYNOS4_GPIO_J0_NR (8)
41#define EXYNOS4_GPIO_J1_NR (5)
42#define EXYNOS4_GPIO_K0_NR (7)
43#define EXYNOS4_GPIO_K1_NR (7)
44#define EXYNOS4_GPIO_K2_NR (7)
45#define EXYNOS4_GPIO_K3_NR (7)
46#define EXYNOS4_GPIO_L0_NR (8)
47#define EXYNOS4_GPIO_L1_NR (3)
48#define EXYNOS4_GPIO_L2_NR (8)
49#define EXYNOS4_GPIO_X0_NR (8)
50#define EXYNOS4_GPIO_X1_NR (8)
51#define EXYNOS4_GPIO_X2_NR (8)
52#define EXYNOS4_GPIO_X3_NR (8)
53#define EXYNOS4_GPIO_Y0_NR (6)
54#define EXYNOS4_GPIO_Y1_NR (4)
55#define EXYNOS4_GPIO_Y2_NR (6)
56#define EXYNOS4_GPIO_Y3_NR (8)
57#define EXYNOS4_GPIO_Y4_NR (8)
58#define EXYNOS4_GPIO_Y5_NR (8)
59#define EXYNOS4_GPIO_Y6_NR (8)
60#define EXYNOS4_GPIO_Z_NR (7)
61
62/* GPIO bank numbers */
63
64#define EXYNOS4_GPIO_NEXT(__gpio) \
65 ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1)
66
67enum s5p_gpio_number {
68 EXYNOS4_GPIO_A0_START = 0,
69 EXYNOS4_GPIO_A1_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_A0),
70 EXYNOS4_GPIO_B_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_A1),
71 EXYNOS4_GPIO_C0_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_B),
72 EXYNOS4_GPIO_C1_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_C0),
73 EXYNOS4_GPIO_D0_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_C1),
74 EXYNOS4_GPIO_D1_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_D0),
75 EXYNOS4_GPIO_E0_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_D1),
76 EXYNOS4_GPIO_E1_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_E0),
77 EXYNOS4_GPIO_E2_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_E1),
78 EXYNOS4_GPIO_E3_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_E2),
79 EXYNOS4_GPIO_E4_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_E3),
80 EXYNOS4_GPIO_F0_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_E4),
81 EXYNOS4_GPIO_F1_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_F0),
82 EXYNOS4_GPIO_F2_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_F1),
83 EXYNOS4_GPIO_F3_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_F2),
84 EXYNOS4_GPIO_J0_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_F3),
85 EXYNOS4_GPIO_J1_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_J0),
86 EXYNOS4_GPIO_K0_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_J1),
87 EXYNOS4_GPIO_K1_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_K0),
88 EXYNOS4_GPIO_K2_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_K1),
89 EXYNOS4_GPIO_K3_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_K2),
90 EXYNOS4_GPIO_L0_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_K3),
91 EXYNOS4_GPIO_L1_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_L0),
92 EXYNOS4_GPIO_L2_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_L1),
93 EXYNOS4_GPIO_X0_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_L2),
94 EXYNOS4_GPIO_X1_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_X0),
95 EXYNOS4_GPIO_X2_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_X1),
96 EXYNOS4_GPIO_X3_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_X2),
97 EXYNOS4_GPIO_Y0_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_X3),
98 EXYNOS4_GPIO_Y1_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_Y0),
99 EXYNOS4_GPIO_Y2_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_Y1),
100 EXYNOS4_GPIO_Y3_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_Y2),
101 EXYNOS4_GPIO_Y4_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_Y3),
102 EXYNOS4_GPIO_Y5_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_Y4),
103 EXYNOS4_GPIO_Y6_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_Y5),
104 EXYNOS4_GPIO_Z_START = EXYNOS4_GPIO_NEXT(EXYNOS4_GPIO_Y6),
105};
106
107/* EXYNOS4 GPIO number definitions */
108#define EXYNOS4_GPA0(_nr) (EXYNOS4_GPIO_A0_START + (_nr))
109#define EXYNOS4_GPA1(_nr) (EXYNOS4_GPIO_A1_START + (_nr))
110#define EXYNOS4_GPB(_nr) (EXYNOS4_GPIO_B_START + (_nr))
111#define EXYNOS4_GPC0(_nr) (EXYNOS4_GPIO_C0_START + (_nr))
112#define EXYNOS4_GPC1(_nr) (EXYNOS4_GPIO_C1_START + (_nr))
113#define EXYNOS4_GPD0(_nr) (EXYNOS4_GPIO_D0_START + (_nr))
114#define EXYNOS4_GPD1(_nr) (EXYNOS4_GPIO_D1_START + (_nr))
115#define EXYNOS4_GPE0(_nr) (EXYNOS4_GPIO_E0_START + (_nr))
116#define EXYNOS4_GPE1(_nr) (EXYNOS4_GPIO_E1_START + (_nr))
117#define EXYNOS4_GPE2(_nr) (EXYNOS4_GPIO_E2_START + (_nr))
118#define EXYNOS4_GPE3(_nr) (EXYNOS4_GPIO_E3_START + (_nr))
119#define EXYNOS4_GPE4(_nr) (EXYNOS4_GPIO_E4_START + (_nr))
120#define EXYNOS4_GPF0(_nr) (EXYNOS4_GPIO_F0_START + (_nr))
121#define EXYNOS4_GPF1(_nr) (EXYNOS4_GPIO_F1_START + (_nr))
122#define EXYNOS4_GPF2(_nr) (EXYNOS4_GPIO_F2_START + (_nr))
123#define EXYNOS4_GPF3(_nr) (EXYNOS4_GPIO_F3_START + (_nr))
124#define EXYNOS4_GPJ0(_nr) (EXYNOS4_GPIO_J0_START + (_nr))
125#define EXYNOS4_GPJ1(_nr) (EXYNOS4_GPIO_J1_START + (_nr))
126#define EXYNOS4_GPK0(_nr) (EXYNOS4_GPIO_K0_START + (_nr))
127#define EXYNOS4_GPK1(_nr) (EXYNOS4_GPIO_K1_START + (_nr))
128#define EXYNOS4_GPK2(_nr) (EXYNOS4_GPIO_K2_START + (_nr))
129#define EXYNOS4_GPK3(_nr) (EXYNOS4_GPIO_K3_START + (_nr))
130#define EXYNOS4_GPL0(_nr) (EXYNOS4_GPIO_L0_START + (_nr))
131#define EXYNOS4_GPL1(_nr) (EXYNOS4_GPIO_L1_START + (_nr))
132#define EXYNOS4_GPL2(_nr) (EXYNOS4_GPIO_L2_START + (_nr))
133#define EXYNOS4_GPX0(_nr) (EXYNOS4_GPIO_X0_START + (_nr))
134#define EXYNOS4_GPX1(_nr) (EXYNOS4_GPIO_X1_START + (_nr))
135#define EXYNOS4_GPX2(_nr) (EXYNOS4_GPIO_X2_START + (_nr))
136#define EXYNOS4_GPX3(_nr) (EXYNOS4_GPIO_X3_START + (_nr))
137#define EXYNOS4_GPY0(_nr) (EXYNOS4_GPIO_Y0_START + (_nr))
138#define EXYNOS4_GPY1(_nr) (EXYNOS4_GPIO_Y1_START + (_nr))
139#define EXYNOS4_GPY2(_nr) (EXYNOS4_GPIO_Y2_START + (_nr))
140#define EXYNOS4_GPY3(_nr) (EXYNOS4_GPIO_Y3_START + (_nr))
141#define EXYNOS4_GPY4(_nr) (EXYNOS4_GPIO_Y4_START + (_nr))
142#define EXYNOS4_GPY5(_nr) (EXYNOS4_GPIO_Y5_START + (_nr))
143#define EXYNOS4_GPY6(_nr) (EXYNOS4_GPIO_Y6_START + (_nr))
144#define EXYNOS4_GPZ(_nr) (EXYNOS4_GPIO_Z_START + (_nr))
145
146/* the end of the EXYNOS4 specific gpios */
147#define EXYNOS4_GPIO_END (EXYNOS4_GPZ(EXYNOS4_GPIO_Z_NR) + 1)
148#define S3C_GPIO_END EXYNOS4_GPIO_END
149
150/* define the number of gpios we need to the one after the GPZ() range */
151#define ARCH_NR_GPIOS (EXYNOS4_GPZ(EXYNOS4_GPIO_Z_NR) + \
152 CONFIG_SAMSUNG_GPIO_EXTRA + 1)
153
154#include <asm-generic/gpio.h>
155
156#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-s5pv310/include/mach/hardware.h b/arch/arm/mach-exynos4/include/mach/hardware.h
index 28ff9881f1a6..5109eb232f23 100644
--- a/arch/arm/mach-s5pv310/include/mach/hardware.h
+++ b/arch/arm/mach-exynos4/include/mach/hardware.h
@@ -1,9 +1,9 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/hardware.h 1/* linux/arch/arm/mach-exynos4/include/mach/hardware.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * S5PV310 - Hardware support 6 * EXYNOS4 - Hardware support
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/mach-s5pv310/include/mach/io.h b/arch/arm/mach-exynos4/include/mach/io.h
index 8a7f9128391f..d5478d247535 100644
--- a/arch/arm/mach-s5pv310/include/mach/io.h
+++ b/arch/arm/mach-exynos4/include/mach/io.h
@@ -1,13 +1,13 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/io.h 1/* linux/arch/arm/mach-exynos4/include/mach/io.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * Copyright 2008-2010 Ben Dooks <ben-linux@fluff.org> 6 * Copyright 2008-2010 Ben Dooks <ben-linux@fluff.org>
7 * 7 *
8 * Based on arch/arm/mach-s5p6442/include/mach/io.h 8 * Based on arch/arm/mach-s5p6442/include/mach/io.h
9 * 9 *
10 * Default IO routines for S5PV310 10 * Default IO routines for EXYNOS4
11 * 11 *
12 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as 13 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/mach-s5pv310/include/mach/irqs.h b/arch/arm/mach-exynos4/include/mach/irqs.h
index 536b0b59fc83..5d037301d21a 100644
--- a/arch/arm/mach-s5pv310/include/mach/irqs.h
+++ b/arch/arm/mach-exynos4/include/mach/irqs.h
@@ -1,9 +1,9 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/irqs.h 1/* linux/arch/arm/mach-exynos4/include/mach/irqs.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * S5PV310 - IRQ definitions 6 * EXYNOS4 - IRQ definitions
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -85,6 +85,9 @@
85#define IRQ_RTC_ALARM COMBINER_IRQ(23, 0) 85#define IRQ_RTC_ALARM COMBINER_IRQ(23, 0)
86#define IRQ_RTC_TIC COMBINER_IRQ(23, 1) 86#define IRQ_RTC_TIC COMBINER_IRQ(23, 1)
87 87
88#define IRQ_GPIO_XB COMBINER_IRQ(24, 0)
89#define IRQ_GPIO_XA COMBINER_IRQ(24, 1)
90
88#define IRQ_UART0 COMBINER_IRQ(26, 0) 91#define IRQ_UART0 COMBINER_IRQ(26, 0)
89#define IRQ_UART1 COMBINER_IRQ(26, 1) 92#define IRQ_UART1 COMBINER_IRQ(26, 1)
90#define IRQ_UART2 COMBINER_IRQ(26, 2) 93#define IRQ_UART2 COMBINER_IRQ(26, 2)
@@ -108,6 +111,11 @@
108#define IRQ_MIPI_CSIS0 COMBINER_IRQ(30, 0) 111#define IRQ_MIPI_CSIS0 COMBINER_IRQ(30, 0)
109#define IRQ_MIPI_CSIS1 COMBINER_IRQ(30, 1) 112#define IRQ_MIPI_CSIS1 COMBINER_IRQ(30, 1)
110 113
114#define IRQ_FIMC0 COMBINER_IRQ(32, 0)
115#define IRQ_FIMC1 COMBINER_IRQ(32, 1)
116#define IRQ_FIMC2 COMBINER_IRQ(33, 0)
117#define IRQ_FIMC3 COMBINER_IRQ(33, 1)
118
111#define IRQ_ONENAND_AUDI COMBINER_IRQ(34, 0) 119#define IRQ_ONENAND_AUDI COMBINER_IRQ(34, 0)
112 120
113#define IRQ_MCT_L1 COMBINER_IRQ(35, 3) 121#define IRQ_MCT_L1 COMBINER_IRQ(35, 3)
@@ -131,6 +139,7 @@
131#define IRQ_MCT_L0 COMBINER_IRQ(51, 0) 139#define IRQ_MCT_L0 COMBINER_IRQ(51, 0)
132 140
133#define IRQ_WDT COMBINER_IRQ(53, 0) 141#define IRQ_WDT COMBINER_IRQ(53, 0)
142#define IRQ_MCT_G0 COMBINER_IRQ(53, 4)
134 143
135#define MAX_COMBINER_NR 54 144#define MAX_COMBINER_NR 54
136 145
@@ -139,8 +148,13 @@
139#define S5P_EINT_BASE1 (S5P_IRQ_EINT_BASE + 0) 148#define S5P_EINT_BASE1 (S5P_IRQ_EINT_BASE + 0)
140#define S5P_EINT_BASE2 (S5P_IRQ_EINT_BASE + 16) 149#define S5P_EINT_BASE2 (S5P_IRQ_EINT_BASE + 16)
141 150
142/* Set the default NR_IRQS */ 151/* optional GPIO interrupts */
152#define S5P_GPIOINT_BASE (S5P_IRQ_EINT_BASE + 32)
153#define IRQ_GPIO1_NR_GROUPS 16
154#define IRQ_GPIO2_NR_GROUPS 9
155#define IRQ_GPIO_END (S5P_GPIOINT_BASE + S5P_GPIOINT_COUNT)
143 156
144#define NR_IRQS (S5P_IRQ_EINT_BASE + 32) 157/* Set the default NR_IRQS */
158#define NR_IRQS (IRQ_GPIO_END)
145 159
146#endif /* __ASM_ARCH_IRQS_H */ 160#endif /* __ASM_ARCH_IRQS_H */
diff --git a/arch/arm/mach-exynos4/include/mach/map.h b/arch/arm/mach-exynos4/include/mach/map.h
new file mode 100644
index 000000000000..6330b73b9ea7
--- /dev/null
+++ b/arch/arm/mach-exynos4/include/mach/map.h
@@ -0,0 +1,162 @@
1/* linux/arch/arm/mach-exynos4/include/mach/map.h
2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * EXYNOS4 - Memory map definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_MAP_H
14#define __ASM_ARCH_MAP_H __FILE__
15
16#include <plat/map-base.h>
17
18/*
19 * EXYNOS4 UART offset is 0x10000 but the older S5P SoCs are 0x400.
20 * So need to define it, and here is to avoid redefinition warning.
21 */
22#define S3C_UART_OFFSET (0x10000)
23
24#include <plat/map-s5p.h>
25
26#define EXYNOS4_PA_SYSRAM 0x02020000
27
28#define EXYNOS4_PA_FIMC0 0x11800000
29#define EXYNOS4_PA_FIMC1 0x11810000
30#define EXYNOS4_PA_FIMC2 0x11820000
31#define EXYNOS4_PA_FIMC3 0x11830000
32
33#define EXYNOS4_PA_I2S0 0x03830000
34#define EXYNOS4_PA_I2S1 0xE3100000
35#define EXYNOS4_PA_I2S2 0xE2A00000
36
37#define EXYNOS4_PA_PCM0 0x03840000
38#define EXYNOS4_PA_PCM1 0x13980000
39#define EXYNOS4_PA_PCM2 0x13990000
40
41#define EXYNOS4_PA_SROM_BANK(x) (0x04000000 + ((x) * 0x01000000))
42
43#define EXYNOS4_PA_ONENAND 0x0C000000
44#define EXYNOS4_PA_ONENAND_DMA 0x0C600000
45
46#define EXYNOS4_PA_CHIPID 0x10000000
47
48#define EXYNOS4_PA_SYSCON 0x10010000
49#define EXYNOS4_PA_PMU 0x10020000
50#define EXYNOS4_PA_CMU 0x10030000
51
52#define EXYNOS4_PA_SYSTIMER 0x10050000
53#define EXYNOS4_PA_WATCHDOG 0x10060000
54#define EXYNOS4_PA_RTC 0x10070000
55
56#define EXYNOS4_PA_KEYPAD 0x100A0000
57
58#define EXYNOS4_PA_DMC0 0x10400000
59
60#define EXYNOS4_PA_COMBINER 0x10448000
61
62#define EXYNOS4_PA_COREPERI 0x10500000
63#define EXYNOS4_PA_GIC_CPU 0x10500100
64#define EXYNOS4_PA_TWD 0x10500600
65#define EXYNOS4_PA_GIC_DIST 0x10501000
66#define EXYNOS4_PA_L2CC 0x10502000
67
68#define EXYNOS4_PA_MDMA 0x10810000
69#define EXYNOS4_PA_PDMA0 0x12680000
70#define EXYNOS4_PA_PDMA1 0x12690000
71
72#define EXYNOS4_PA_SYSMMU_MDMA 0x10A40000
73#define EXYNOS4_PA_SYSMMU_SSS 0x10A50000
74#define EXYNOS4_PA_SYSMMU_FIMC0 0x11A20000
75#define EXYNOS4_PA_SYSMMU_FIMC1 0x11A30000
76#define EXYNOS4_PA_SYSMMU_FIMC2 0x11A40000
77#define EXYNOS4_PA_SYSMMU_FIMC3 0x11A50000
78#define EXYNOS4_PA_SYSMMU_JPEG 0x11A60000
79#define EXYNOS4_PA_SYSMMU_FIMD0 0x11E20000
80#define EXYNOS4_PA_SYSMMU_FIMD1 0x12220000
81#define EXYNOS4_PA_SYSMMU_PCIe 0x12620000
82#define EXYNOS4_PA_SYSMMU_G2D 0x12A20000
83#define EXYNOS4_PA_SYSMMU_ROTATOR 0x12A30000
84#define EXYNOS4_PA_SYSMMU_MDMA2 0x12A40000
85#define EXYNOS4_PA_SYSMMU_TV 0x12E20000
86#define EXYNOS4_PA_SYSMMU_MFC_L 0x13620000
87#define EXYNOS4_PA_SYSMMU_MFC_R 0x13630000
88
89#define EXYNOS4_PA_GPIO1 0x11400000
90#define EXYNOS4_PA_GPIO2 0x11000000
91#define EXYNOS4_PA_GPIO3 0x03860000
92
93#define EXYNOS4_PA_MIPI_CSIS0 0x11880000
94#define EXYNOS4_PA_MIPI_CSIS1 0x11890000
95
96#define EXYNOS4_PA_HSMMC(x) (0x12510000 + ((x) * 0x10000))
97
98#define EXYNOS4_PA_SATA 0x12560000
99#define EXYNOS4_PA_SATAPHY 0x125D0000
100#define EXYNOS4_PA_SATAPHY_CTRL 0x126B0000
101
102#define EXYNOS4_PA_SROMC 0x12570000
103
104#define EXYNOS4_PA_UART 0x13800000
105
106#define EXYNOS4_PA_IIC(x) (0x13860000 + ((x) * 0x10000))
107
108#define EXYNOS4_PA_AC97 0x139A0000
109
110#define EXYNOS4_PA_SPDIF 0x139B0000
111
112#define EXYNOS4_PA_TIMER 0x139D0000
113
114#define EXYNOS4_PA_SDRAM 0x40000000
115
116/* Compatibiltiy Defines */
117
118#define S3C_PA_HSMMC0 EXYNOS4_PA_HSMMC(0)
119#define S3C_PA_HSMMC1 EXYNOS4_PA_HSMMC(1)
120#define S3C_PA_HSMMC2 EXYNOS4_PA_HSMMC(2)
121#define S3C_PA_HSMMC3 EXYNOS4_PA_HSMMC(3)
122#define S3C_PA_IIC EXYNOS4_PA_IIC(0)
123#define S3C_PA_IIC1 EXYNOS4_PA_IIC(1)
124#define S3C_PA_IIC2 EXYNOS4_PA_IIC(2)
125#define S3C_PA_IIC3 EXYNOS4_PA_IIC(3)
126#define S3C_PA_IIC4 EXYNOS4_PA_IIC(4)
127#define S3C_PA_IIC5 EXYNOS4_PA_IIC(5)
128#define S3C_PA_IIC6 EXYNOS4_PA_IIC(6)
129#define S3C_PA_IIC7 EXYNOS4_PA_IIC(7)
130#define S3C_PA_RTC EXYNOS4_PA_RTC
131#define S3C_PA_WDT EXYNOS4_PA_WATCHDOG
132
133#define S5P_PA_CHIPID EXYNOS4_PA_CHIPID
134#define S5P_PA_FIMC0 EXYNOS4_PA_FIMC0
135#define S5P_PA_FIMC1 EXYNOS4_PA_FIMC1
136#define S5P_PA_FIMC2 EXYNOS4_PA_FIMC2
137#define S5P_PA_FIMC3 EXYNOS4_PA_FIMC3
138#define S5P_PA_MIPI_CSIS0 EXYNOS4_PA_MIPI_CSIS0
139#define S5P_PA_MIPI_CSIS1 EXYNOS4_PA_MIPI_CSIS1
140#define S5P_PA_ONENAND EXYNOS4_PA_ONENAND
141#define S5P_PA_ONENAND_DMA EXYNOS4_PA_ONENAND_DMA
142#define S5P_PA_SDRAM EXYNOS4_PA_SDRAM
143#define S5P_PA_SROMC EXYNOS4_PA_SROMC
144#define S5P_PA_SYSCON EXYNOS4_PA_SYSCON
145#define S5P_PA_TIMER EXYNOS4_PA_TIMER
146
147#define SAMSUNG_PA_KEYPAD EXYNOS4_PA_KEYPAD
148
149/* UART */
150
151#define S3C_PA_UART EXYNOS4_PA_UART
152
153#define S5P_PA_UART(x) (S3C_PA_UART + ((x) * S3C_UART_OFFSET))
154#define S5P_PA_UART0 S5P_PA_UART(0)
155#define S5P_PA_UART1 S5P_PA_UART(1)
156#define S5P_PA_UART2 S5P_PA_UART(2)
157#define S5P_PA_UART3 S5P_PA_UART(3)
158#define S5P_PA_UART4 S5P_PA_UART(4)
159
160#define S5P_SZ_UART SZ_256
161
162#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-s5pv310/include/mach/memory.h b/arch/arm/mach-exynos4/include/mach/memory.h
index 1dffb4823245..374ef2cf7152 100644
--- a/arch/arm/mach-s5pv310/include/mach/memory.h
+++ b/arch/arm/mach-exynos4/include/mach/memory.h
@@ -1,9 +1,9 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/memory.h 1/* linux/arch/arm/mach-exynos4/include/mach/memory.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * S5PV310 - Memory definitions 6 * EXYNOS4 - Memory definitions
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -13,7 +13,7 @@
13#ifndef __ASM_ARCH_MEMORY_H 13#ifndef __ASM_ARCH_MEMORY_H
14#define __ASM_ARCH_MEMORY_H __FILE__ 14#define __ASM_ARCH_MEMORY_H __FILE__
15 15
16#define PHYS_OFFSET UL(0x40000000) 16#define PLAT_PHYS_OFFSET UL(0x40000000)
17 17
18/* Maximum of 256MiB in one bank */ 18/* Maximum of 256MiB in one bank */
19#define MAX_PHYSMEM_BITS 32 19#define MAX_PHYSMEM_BITS 32
diff --git a/arch/arm/mach-exynos4/include/mach/pm-core.h b/arch/arm/mach-exynos4/include/mach/pm-core.h
new file mode 100644
index 000000000000..f26e46bc06ca
--- /dev/null
+++ b/arch/arm/mach-exynos4/include/mach/pm-core.h
@@ -0,0 +1,49 @@
1/* linux/arch/arm/mach-exynos4/include/mach/pm-core.h
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Based on arch/arm/mach-s3c2410/include/mach/pm-core.h,
7 * Copyright 2008 Simtec Electronics
8 * Ben Dooks <ben@simtec.co.uk>
9 * http://armlinux.simtec.co.uk/
10 *
11 * EXYNOS4210 - PM core support for arch/arm/plat-s5p/pm.c
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#include <mach/regs-pmu.h>
18
19static inline void s3c_pm_debug_init_uart(void)
20{
21 /* nothing here yet */
22}
23
24static inline void s3c_pm_arch_prepare_irqs(void)
25{
26 unsigned int tmp;
27 tmp = __raw_readl(S5P_WAKEUP_MASK);
28 tmp &= ~(1 << 31);
29 __raw_writel(tmp, S5P_WAKEUP_MASK);
30
31 __raw_writel(s3c_irqwake_intmask, S5P_WAKEUP_MASK);
32 __raw_writel(s3c_irqwake_eintmask, S5P_EINT_WAKEUP_MASK);
33}
34
35static inline void s3c_pm_arch_stop_clocks(void)
36{
37 /* nothing here yet */
38}
39
40static inline void s3c_pm_arch_show_resume_irqs(void)
41{
42 /* nothing here yet */
43}
44
45static inline void s3c_pm_arch_update_uart(void __iomem *regs,
46 struct pm_uart_save *save)
47{
48 /* nothing here yet */
49}
diff --git a/arch/arm/mach-s5pv310/include/mach/pwm-clock.h b/arch/arm/mach-exynos4/include/mach/pwm-clock.h
index 7e6da2701088..8e12090287bb 100644
--- a/arch/arm/mach-s5pv310/include/mach/pwm-clock.h
+++ b/arch/arm/mach-exynos4/include/mach/pwm-clock.h
@@ -1,7 +1,7 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/pwm-clock.h 1/* linux/arch/arm/mach-exynos4/include/mach/pwm-clock.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * Copyright 2008 Openmoko, Inc. 6 * Copyright 2008 Openmoko, Inc.
7 * Copyright 2008 Simtec Electronics 7 * Copyright 2008 Simtec Electronics
@@ -10,7 +10,7 @@
10 * 10 *
11 * Based on arch/arm/mach-s3c64xx/include/mach/pwm-clock.h 11 * Based on arch/arm/mach-s3c64xx/include/mach/pwm-clock.h
12 * 12 *
13 * S5PV310 - pwm clock and timer support 13 * EXYNOS4 - pwm clock and timer support
14 * 14 *
15 * This program is free software; you can redistribute it and/or modify 15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License version 2 as 16 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/mach-s5pv310/include/mach/regs-clock.h b/arch/arm/mach-exynos4/include/mach/regs-clock.h
index b5c4ada1cff5..6e311c1157f5 100644
--- a/arch/arm/mach-s5pv310/include/mach/regs-clock.h
+++ b/arch/arm/mach-exynos4/include/mach/regs-clock.h
@@ -1,9 +1,9 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/regs-clock.h 1/* linux/arch/arm/mach-exynos4/include/mach/regs-clock.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * S5PV310 - Clock register definitions 6 * EXYNOS4 - Clock register definitions
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -17,13 +17,13 @@
17 17
18#define S5P_CLKREG(x) (S5P_VA_CMU + (x)) 18#define S5P_CLKREG(x) (S5P_VA_CMU + (x))
19 19
20#define S5P_INFORM0 S5P_CLKREG(0x800)
21
22#define S5P_CLKDIV_LEFTBUS S5P_CLKREG(0x04500) 20#define S5P_CLKDIV_LEFTBUS S5P_CLKREG(0x04500)
23#define S5P_CLKDIV_STAT_LEFTBUS S5P_CLKREG(0x04600) 21#define S5P_CLKDIV_STAT_LEFTBUS S5P_CLKREG(0x04600)
22#define S5P_CLKGATE_IP_LEFTBUS S5P_CLKREG(0x04800)
24 23
25#define S5P_CLKDIV_RIGHTBUS S5P_CLKREG(0x08500) 24#define S5P_CLKDIV_RIGHTBUS S5P_CLKREG(0x08500)
26#define S5P_CLKDIV_STAT_RIGHTBUS S5P_CLKREG(0x08600) 25#define S5P_CLKDIV_STAT_RIGHTBUS S5P_CLKREG(0x08600)
26#define S5P_CLKGATE_IP_RIGHTBUS S5P_CLKREG(0x08800)
27 27
28#define S5P_EPLL_CON0 S5P_CLKREG(0x0C110) 28#define S5P_EPLL_CON0 S5P_CLKREG(0x0C110)
29#define S5P_EPLL_CON1 S5P_CLKREG(0x0C114) 29#define S5P_EPLL_CON1 S5P_CLKREG(0x0C114)
@@ -33,18 +33,24 @@
33#define S5P_CLKSRC_TOP0 S5P_CLKREG(0x0C210) 33#define S5P_CLKSRC_TOP0 S5P_CLKREG(0x0C210)
34#define S5P_CLKSRC_TOP1 S5P_CLKREG(0x0C214) 34#define S5P_CLKSRC_TOP1 S5P_CLKREG(0x0C214)
35#define S5P_CLKSRC_CAM S5P_CLKREG(0x0C220) 35#define S5P_CLKSRC_CAM S5P_CLKREG(0x0C220)
36#define S5P_CLKSRC_MFC S5P_CLKREG(0x0C228)
36#define S5P_CLKSRC_IMAGE S5P_CLKREG(0x0C230) 37#define S5P_CLKSRC_IMAGE S5P_CLKREG(0x0C230)
37#define S5P_CLKSRC_LCD0 S5P_CLKREG(0x0C234) 38#define S5P_CLKSRC_LCD0 S5P_CLKREG(0x0C234)
38#define S5P_CLKSRC_LCD1 S5P_CLKREG(0x0C238) 39#define S5P_CLKSRC_LCD1 S5P_CLKREG(0x0C238)
40#define S5P_CLKSRC_MAUDIO S5P_CLKREG(0x0C23C)
39#define S5P_CLKSRC_FSYS S5P_CLKREG(0x0C240) 41#define S5P_CLKSRC_FSYS S5P_CLKREG(0x0C240)
40#define S5P_CLKSRC_PERIL0 S5P_CLKREG(0x0C250) 42#define S5P_CLKSRC_PERIL0 S5P_CLKREG(0x0C250)
41#define S5P_CLKSRC_PERIL1 S5P_CLKREG(0x0C254) 43#define S5P_CLKSRC_PERIL1 S5P_CLKREG(0x0C254)
42 44
43#define S5P_CLKDIV_TOP S5P_CLKREG(0x0C510) 45#define S5P_CLKDIV_TOP S5P_CLKREG(0x0C510)
44#define S5P_CLKDIV_CAM S5P_CLKREG(0x0C520) 46#define S5P_CLKDIV_CAM S5P_CLKREG(0x0C520)
47#define S5P_CLKDIV_TV S5P_CLKREG(0x0C524)
48#define S5P_CLKDIV_MFC S5P_CLKREG(0x0C528)
49#define S5P_CLKDIV_G3D S5P_CLKREG(0x0C52C)
45#define S5P_CLKDIV_IMAGE S5P_CLKREG(0x0C530) 50#define S5P_CLKDIV_IMAGE S5P_CLKREG(0x0C530)
46#define S5P_CLKDIV_LCD0 S5P_CLKREG(0x0C534) 51#define S5P_CLKDIV_LCD0 S5P_CLKREG(0x0C534)
47#define S5P_CLKDIV_LCD1 S5P_CLKREG(0x0C538) 52#define S5P_CLKDIV_LCD1 S5P_CLKREG(0x0C538)
53#define S5P_CLKDIV_MAUDIO S5P_CLKREG(0x0C53C)
48#define S5P_CLKDIV_FSYS0 S5P_CLKREG(0x0C540) 54#define S5P_CLKDIV_FSYS0 S5P_CLKREG(0x0C540)
49#define S5P_CLKDIV_FSYS1 S5P_CLKREG(0x0C544) 55#define S5P_CLKDIV_FSYS1 S5P_CLKREG(0x0C544)
50#define S5P_CLKDIV_FSYS2 S5P_CLKREG(0x0C548) 56#define S5P_CLKDIV_FSYS2 S5P_CLKREG(0x0C548)
@@ -58,25 +64,36 @@
58 64
59#define S5P_CLKSRC_MASK_TOP S5P_CLKREG(0x0C310) 65#define S5P_CLKSRC_MASK_TOP S5P_CLKREG(0x0C310)
60#define S5P_CLKSRC_MASK_CAM S5P_CLKREG(0x0C320) 66#define S5P_CLKSRC_MASK_CAM S5P_CLKREG(0x0C320)
67#define S5P_CLKSRC_MASK_TV S5P_CLKREG(0x0C324)
61#define S5P_CLKSRC_MASK_LCD0 S5P_CLKREG(0x0C334) 68#define S5P_CLKSRC_MASK_LCD0 S5P_CLKREG(0x0C334)
62#define S5P_CLKSRC_MASK_LCD1 S5P_CLKREG(0x0C338) 69#define S5P_CLKSRC_MASK_LCD1 S5P_CLKREG(0x0C338)
70#define S5P_CLKSRC_MASK_MAUDIO S5P_CLKREG(0x0C33C)
63#define S5P_CLKSRC_MASK_FSYS S5P_CLKREG(0x0C340) 71#define S5P_CLKSRC_MASK_FSYS S5P_CLKREG(0x0C340)
64#define S5P_CLKSRC_MASK_PERIL0 S5P_CLKREG(0x0C350) 72#define S5P_CLKSRC_MASK_PERIL0 S5P_CLKREG(0x0C350)
65#define S5P_CLKSRC_MASK_PERIL1 S5P_CLKREG(0x0C354) 73#define S5P_CLKSRC_MASK_PERIL1 S5P_CLKREG(0x0C354)
66 74
67#define S5P_CLKDIV_STAT_TOP S5P_CLKREG(0x0C610) 75#define S5P_CLKDIV_STAT_TOP S5P_CLKREG(0x0C610)
68 76
77#define S5P_CLKGATE_SCLKCAM S5P_CLKREG(0x0C820)
69#define S5P_CLKGATE_IP_CAM S5P_CLKREG(0x0C920) 78#define S5P_CLKGATE_IP_CAM S5P_CLKREG(0x0C920)
79#define S5P_CLKGATE_IP_TV S5P_CLKREG(0x0C924)
80#define S5P_CLKGATE_IP_MFC S5P_CLKREG(0x0C928)
81#define S5P_CLKGATE_IP_G3D S5P_CLKREG(0x0C92C)
70#define S5P_CLKGATE_IP_IMAGE S5P_CLKREG(0x0C930) 82#define S5P_CLKGATE_IP_IMAGE S5P_CLKREG(0x0C930)
71#define S5P_CLKGATE_IP_LCD0 S5P_CLKREG(0x0C934) 83#define S5P_CLKGATE_IP_LCD0 S5P_CLKREG(0x0C934)
72#define S5P_CLKGATE_IP_LCD1 S5P_CLKREG(0x0C938) 84#define S5P_CLKGATE_IP_LCD1 S5P_CLKREG(0x0C938)
73#define S5P_CLKGATE_IP_FSYS S5P_CLKREG(0x0C940) 85#define S5P_CLKGATE_IP_FSYS S5P_CLKREG(0x0C940)
86#define S5P_CLKGATE_IP_GPS S5P_CLKREG(0x0C94C)
74#define S5P_CLKGATE_IP_PERIL S5P_CLKREG(0x0C950) 87#define S5P_CLKGATE_IP_PERIL S5P_CLKREG(0x0C950)
75#define S5P_CLKGATE_IP_PERIR S5P_CLKREG(0x0C960) 88#define S5P_CLKGATE_IP_PERIR S5P_CLKREG(0x0C960)
89#define S5P_CLKGATE_BLOCK S5P_CLKREG(0x0C970)
76 90
91#define S5P_CLKSRC_MASK_DMC S5P_CLKREG(0x10300)
77#define S5P_CLKSRC_DMC S5P_CLKREG(0x10200) 92#define S5P_CLKSRC_DMC S5P_CLKREG(0x10200)
78#define S5P_CLKDIV_DMC0 S5P_CLKREG(0x10500) 93#define S5P_CLKDIV_DMC0 S5P_CLKREG(0x10500)
94#define S5P_CLKDIV_DMC1 S5P_CLKREG(0x10504)
79#define S5P_CLKDIV_STAT_DMC0 S5P_CLKREG(0x10600) 95#define S5P_CLKDIV_STAT_DMC0 S5P_CLKREG(0x10600)
96#define S5P_CLKGATE_IP_DMC S5P_CLKREG(0x10900)
80 97
81#define S5P_APLL_LOCK S5P_CLKREG(0x14000) 98#define S5P_APLL_LOCK S5P_CLKREG(0x14000)
82#define S5P_MPLL_LOCK S5P_CLKREG(0x14004) 99#define S5P_MPLL_LOCK S5P_CLKREG(0x14004)
@@ -94,21 +111,18 @@
94#define S5P_CLKDIV_STATCPU1 S5P_CLKREG(0x14604) 111#define S5P_CLKDIV_STATCPU1 S5P_CLKREG(0x14604)
95 112
96#define S5P_CLKGATE_SCLKCPU S5P_CLKREG(0x14800) 113#define S5P_CLKGATE_SCLKCPU S5P_CLKREG(0x14800)
114#define S5P_CLKGATE_IP_CPU S5P_CLKREG(0x14900)
97 115
98/* APLL_LOCK */
99#define S5P_APLL_LOCKTIME (0x1C20) /* 300us */ 116#define S5P_APLL_LOCKTIME (0x1C20) /* 300us */
100 117
101/* APLL_CON0 */
102#define S5P_APLLCON0_ENABLE_SHIFT (31) 118#define S5P_APLLCON0_ENABLE_SHIFT (31)
103#define S5P_APLLCON0_LOCKED_SHIFT (29) 119#define S5P_APLLCON0_LOCKED_SHIFT (29)
104#define S5P_APLL_VAL_1000 ((250 << 16) | (6 << 8) | 1) 120#define S5P_APLL_VAL_1000 ((250 << 16) | (6 << 8) | 1)
105#define S5P_APLL_VAL_800 ((200 << 16) | (6 << 8) | 1) 121#define S5P_APLL_VAL_800 ((200 << 16) | (6 << 8) | 1)
106 122
107/* CLK_SRC_CPU */
108#define S5P_CLKSRC_CPU_MUXCORE_SHIFT (16) 123#define S5P_CLKSRC_CPU_MUXCORE_SHIFT (16)
109#define S5P_CLKMUX_STATCPU_MUXCORE_MASK (0x7 << S5P_CLKSRC_CPU_MUXCORE_SHIFT) 124#define S5P_CLKMUX_STATCPU_MUXCORE_MASK (0x7 << S5P_CLKSRC_CPU_MUXCORE_SHIFT)
110 125
111/* CLKDIV_CPU0 */
112#define S5P_CLKDIV_CPU0_CORE_SHIFT (0) 126#define S5P_CLKDIV_CPU0_CORE_SHIFT (0)
113#define S5P_CLKDIV_CPU0_CORE_MASK (0x7 << S5P_CLKDIV_CPU0_CORE_SHIFT) 127#define S5P_CLKDIV_CPU0_CORE_MASK (0x7 << S5P_CLKDIV_CPU0_CORE_SHIFT)
114#define S5P_CLKDIV_CPU0_COREM0_SHIFT (4) 128#define S5P_CLKDIV_CPU0_COREM0_SHIFT (4)
@@ -124,7 +138,6 @@
124#define S5P_CLKDIV_CPU0_APLL_SHIFT (24) 138#define S5P_CLKDIV_CPU0_APLL_SHIFT (24)
125#define S5P_CLKDIV_CPU0_APLL_MASK (0x7 << S5P_CLKDIV_CPU0_APLL_SHIFT) 139#define S5P_CLKDIV_CPU0_APLL_MASK (0x7 << S5P_CLKDIV_CPU0_APLL_SHIFT)
126 140
127/* CLKDIV_DMC0 */
128#define S5P_CLKDIV_DMC0_ACP_SHIFT (0) 141#define S5P_CLKDIV_DMC0_ACP_SHIFT (0)
129#define S5P_CLKDIV_DMC0_ACP_MASK (0x7 << S5P_CLKDIV_DMC0_ACP_SHIFT) 142#define S5P_CLKDIV_DMC0_ACP_MASK (0x7 << S5P_CLKDIV_DMC0_ACP_SHIFT)
130#define S5P_CLKDIV_DMC0_ACPPCLK_SHIFT (4) 143#define S5P_CLKDIV_DMC0_ACPPCLK_SHIFT (4)
@@ -142,7 +155,6 @@
142#define S5P_CLKDIV_DMC0_CORETI_SHIFT (28) 155#define S5P_CLKDIV_DMC0_CORETI_SHIFT (28)
143#define S5P_CLKDIV_DMC0_CORETI_MASK (0x7 << S5P_CLKDIV_DMC0_CORETI_SHIFT) 156#define S5P_CLKDIV_DMC0_CORETI_MASK (0x7 << S5P_CLKDIV_DMC0_CORETI_SHIFT)
144 157
145/* CLKDIV_TOP */
146#define S5P_CLKDIV_TOP_ACLK200_SHIFT (0) 158#define S5P_CLKDIV_TOP_ACLK200_SHIFT (0)
147#define S5P_CLKDIV_TOP_ACLK200_MASK (0x7 << S5P_CLKDIV_TOP_ACLK200_SHIFT) 159#define S5P_CLKDIV_TOP_ACLK200_MASK (0x7 << S5P_CLKDIV_TOP_ACLK200_SHIFT)
148#define S5P_CLKDIV_TOP_ACLK100_SHIFT (4) 160#define S5P_CLKDIV_TOP_ACLK100_SHIFT (4)
@@ -154,13 +166,14 @@
154#define S5P_CLKDIV_TOP_ONENAND_SHIFT (16) 166#define S5P_CLKDIV_TOP_ONENAND_SHIFT (16)
155#define S5P_CLKDIV_TOP_ONENAND_MASK (0x7 << S5P_CLKDIV_TOP_ONENAND_SHIFT) 167#define S5P_CLKDIV_TOP_ONENAND_MASK (0x7 << S5P_CLKDIV_TOP_ONENAND_SHIFT)
156 168
157/* CLKDIV_LEFTBUS / CLKDIV_RIGHTBUS*/
158#define S5P_CLKDIV_BUS_GDLR_SHIFT (0) 169#define S5P_CLKDIV_BUS_GDLR_SHIFT (0)
159#define S5P_CLKDIV_BUS_GDLR_MASK (0x7 << S5P_CLKDIV_BUS_GDLR_SHIFT) 170#define S5P_CLKDIV_BUS_GDLR_MASK (0x7 << S5P_CLKDIV_BUS_GDLR_SHIFT)
160#define S5P_CLKDIV_BUS_GPLR_SHIFT (4) 171#define S5P_CLKDIV_BUS_GPLR_SHIFT (4)
161#define S5P_CLKDIV_BUS_GPLR_MASK (0x7 << S5P_CLKDIV_BUS_GPLR_SHIFT) 172#define S5P_CLKDIV_BUS_GPLR_MASK (0x7 << S5P_CLKDIV_BUS_GPLR_SHIFT)
162 173
163/* Compatibility defines */ 174/* Compatibility defines and inclusion */
175
176#include <mach/regs-pmu.h>
164 177
165#define S5P_EPLL_CON S5P_EPLL_CON0 178#define S5P_EPLL_CON S5P_EPLL_CON0
166 179
diff --git a/arch/arm/mach-exynos4/include/mach/regs-gpio.h b/arch/arm/mach-exynos4/include/mach/regs-gpio.h
new file mode 100644
index 000000000000..1401b21663a5
--- /dev/null
+++ b/arch/arm/mach-exynos4/include/mach/regs-gpio.h
@@ -0,0 +1,42 @@
1/* linux/arch/arm/mach-exynos4/include/mach/regs-gpio.h
2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * EXYNOS4 - GPIO (including EINT) register definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_REGS_GPIO_H
14#define __ASM_ARCH_REGS_GPIO_H __FILE__
15
16#include <mach/map.h>
17#include <mach/irqs.h>
18
19#define EXYNOS4_EINT40CON (S5P_VA_GPIO2 + 0xE00)
20#define S5P_EINT_CON(x) (EXYNOS4_EINT40CON + ((x) * 0x4))
21
22#define EXYNOS4_EINT40FLTCON0 (S5P_VA_GPIO2 + 0xE80)
23#define S5P_EINT_FLTCON(x) (EXYNOS4_EINT40FLTCON0 + ((x) * 0x4))
24
25#define EXYNOS4_EINT40MASK (S5P_VA_GPIO2 + 0xF00)
26#define S5P_EINT_MASK(x) (EXYNOS4_EINT40MASK + ((x) * 0x4))
27
28#define EXYNOS4_EINT40PEND (S5P_VA_GPIO2 + 0xF40)
29#define S5P_EINT_PEND(x) (EXYNOS4_EINT40PEND + ((x) * 0x4))
30
31#define EINT_REG_NR(x) (EINT_OFFSET(x) >> 3)
32
33#define eint_irq_to_bit(irq) (1 << (EINT_OFFSET(irq) & 0x7))
34
35#define EINT_MODE S3C_GPIO_SFN(0xf)
36
37#define EINT_GPIO_0(x) EXYNOS4_GPX0(x)
38#define EINT_GPIO_1(x) EXYNOS4_GPX1(x)
39#define EINT_GPIO_2(x) EXYNOS4_GPX2(x)
40#define EINT_GPIO_3(x) EXYNOS4_GPX3(x)
41
42#endif /* __ASM_ARCH_REGS_GPIO_H */
diff --git a/arch/arm/mach-s5pv310/include/mach/regs-irq.h b/arch/arm/mach-exynos4/include/mach/regs-irq.h
index c6e09c7f9161..9c7b4bfd546f 100644
--- a/arch/arm/mach-s5pv310/include/mach/regs-irq.h
+++ b/arch/arm/mach-exynos4/include/mach/regs-irq.h
@@ -1,9 +1,9 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/regs-irq.h 1/* linux/arch/arm/mach-exynos4/include/mach/regs-irq.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * S5PV310 - IRQ register definitions 6 * EXYNOS4 - IRQ register definitions
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/mach-exynos4/include/mach/regs-mct.h b/arch/arm/mach-exynos4/include/mach/regs-mct.h
new file mode 100644
index 000000000000..ca9c8434b023
--- /dev/null
+++ b/arch/arm/mach-exynos4/include/mach/regs-mct.h
@@ -0,0 +1,52 @@
1/* arch/arm/mach-exynos4/include/mach/regs-mct.h
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * EXYNOS4 MCT configutation
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_REGS_MCT_H
14#define __ASM_ARCH_REGS_MCT_H __FILE__
15
16#include <mach/map.h>
17
18#define EXYNOS4_MCTREG(x) (S5P_VA_SYSTIMER + (x))
19
20#define EXYNOS4_MCT_G_CNT_L EXYNOS4_MCTREG(0x100)
21#define EXYNOS4_MCT_G_CNT_U EXYNOS4_MCTREG(0x104)
22#define EXYNOS4_MCT_G_CNT_WSTAT EXYNOS4_MCTREG(0x110)
23
24#define EXYNOS4_MCT_G_COMP0_L EXYNOS4_MCTREG(0x200)
25#define EXYNOS4_MCT_G_COMP0_U EXYNOS4_MCTREG(0x204)
26#define EXYNOS4_MCT_G_COMP0_ADD_INCR EXYNOS4_MCTREG(0x208)
27
28#define EXYNOS4_MCT_G_TCON EXYNOS4_MCTREG(0x240)
29
30#define EXYNOS4_MCT_G_INT_CSTAT EXYNOS4_MCTREG(0x244)
31#define EXYNOS4_MCT_G_INT_ENB EXYNOS4_MCTREG(0x248)
32#define EXYNOS4_MCT_G_WSTAT EXYNOS4_MCTREG(0x24C)
33
34#define EXYNOS4_MCT_L0_BASE EXYNOS4_MCTREG(0x300)
35#define EXYNOS4_MCT_L1_BASE EXYNOS4_MCTREG(0x400)
36
37#define MCT_L_TCNTB_OFFSET (0x00)
38#define MCT_L_ICNTB_OFFSET (0x08)
39#define MCT_L_TCON_OFFSET (0x20)
40#define MCT_L_INT_CSTAT_OFFSET (0x30)
41#define MCT_L_INT_ENB_OFFSET (0x34)
42#define MCT_L_WSTAT_OFFSET (0x40)
43
44#define MCT_G_TCON_START (1 << 8)
45#define MCT_G_TCON_COMP0_AUTO_INC (1 << 1)
46#define MCT_G_TCON_COMP0_ENABLE (1 << 0)
47
48#define MCT_L_TCON_INTERVAL_MODE (1 << 2)
49#define MCT_L_TCON_INT_START (1 << 1)
50#define MCT_L_TCON_TIMER_START (1 << 0)
51
52#endif /* __ASM_ARCH_REGS_MCT_H */
diff --git a/arch/arm/mach-s5pv310/include/mach/regs-mem.h b/arch/arm/mach-exynos4/include/mach/regs-mem.h
index 834227140eaa..0368b5a27252 100644
--- a/arch/arm/mach-s5pv310/include/mach/regs-mem.h
+++ b/arch/arm/mach-exynos4/include/mach/regs-mem.h
@@ -1,9 +1,9 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/regs-mem.h 1/* linux/arch/arm/mach-exynos4/include/mach/regs-mem.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 4 * http://www.samsung.com
5 * 5 *
6 * S5PV310 - SROMC and DMC register definitions 6 * EXYNOS4 - SROMC and DMC register definitions
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/mach-exynos4/include/mach/regs-pmu.h b/arch/arm/mach-exynos4/include/mach/regs-pmu.h
new file mode 100644
index 000000000000..62b0014d05e0
--- /dev/null
+++ b/arch/arm/mach-exynos4/include/mach/regs-pmu.h
@@ -0,0 +1,162 @@
1/* linux/arch/arm/mach-exynos4/include/mach/regs-pmu.h
2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * EXYNOS4 - Power management unit definition
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_REGS_PMU_H
14#define __ASM_ARCH_REGS_PMU_H __FILE__
15
16#include <mach/map.h>
17
18#define S5P_PMUREG(x) (S5P_VA_PMU + (x))
19
20#define S5P_CENTRAL_SEQ_CONFIGURATION S5P_PMUREG(0x0200)
21
22#define S5P_CENTRAL_LOWPWR_CFG (1 << 16)
23
24#define S5P_CENTRAL_SEQ_OPTION S5P_PMUREG(0x0208)
25
26#define S5P_USE_STANDBY_WFI0 (1 << 16)
27#define S5P_USE_STANDBY_WFI1 (1 << 17)
28#define S5P_USE_STANDBY_WFE0 (1 << 24)
29#define S5P_USE_STANDBY_WFE1 (1 << 25)
30#define S5P_USE_MASK ((0x3 << 16) | (0x3 << 24))
31
32#define S5P_WAKEUP_STAT S5P_PMUREG(0x0600)
33#define S5P_EINT_WAKEUP_MASK S5P_PMUREG(0x0604)
34#define S5P_WAKEUP_MASK S5P_PMUREG(0x0608)
35
36#define S5P_MIPI_DPHY_CONTROL(n) S5P_PMUREG(0x0710 + (n) * 4)
37#define S5P_MIPI_DPHY_ENABLE (1 << 0)
38#define S5P_MIPI_DPHY_SRESETN (1 << 1)
39#define S5P_MIPI_DPHY_MRESETN (1 << 2)
40
41#define S5P_PMU_SATA_PHY_CONTROL S5P_PMUREG(0x0720)
42#define S5P_INFORM0 S5P_PMUREG(0x0800)
43#define S5P_INFORM1 S5P_PMUREG(0x0804)
44#define S5P_INFORM2 S5P_PMUREG(0x0808)
45#define S5P_INFORM3 S5P_PMUREG(0x080C)
46#define S5P_INFORM4 S5P_PMUREG(0x0810)
47#define S5P_INFORM5 S5P_PMUREG(0x0814)
48#define S5P_INFORM6 S5P_PMUREG(0x0818)
49#define S5P_INFORM7 S5P_PMUREG(0x081C)
50
51#define S5P_ARM_CORE0_LOWPWR S5P_PMUREG(0x1000)
52#define S5P_DIS_IRQ_CORE0 S5P_PMUREG(0x1004)
53#define S5P_DIS_IRQ_CENTRAL0 S5P_PMUREG(0x1008)
54#define S5P_ARM_CORE1_LOWPWR S5P_PMUREG(0x1010)
55#define S5P_DIS_IRQ_CORE1 S5P_PMUREG(0x1014)
56#define S5P_DIS_IRQ_CENTRAL1 S5P_PMUREG(0x1018)
57#define S5P_ARM_COMMON_LOWPWR S5P_PMUREG(0x1080)
58#define S5P_L2_0_LOWPWR S5P_PMUREG(0x10C0)
59#define S5P_L2_1_LOWPWR S5P_PMUREG(0x10C4)
60#define S5P_CMU_ACLKSTOP_LOWPWR S5P_PMUREG(0x1100)
61#define S5P_CMU_SCLKSTOP_LOWPWR S5P_PMUREG(0x1104)
62#define S5P_CMU_RESET_LOWPWR S5P_PMUREG(0x110C)
63#define S5P_APLL_SYSCLK_LOWPWR S5P_PMUREG(0x1120)
64#define S5P_MPLL_SYSCLK_LOWPWR S5P_PMUREG(0x1124)
65#define S5P_VPLL_SYSCLK_LOWPWR S5P_PMUREG(0x1128)
66#define S5P_EPLL_SYSCLK_LOWPWR S5P_PMUREG(0x112C)
67#define S5P_CMU_CLKSTOP_GPS_ALIVE_LOWPWR S5P_PMUREG(0x1138)
68#define S5P_CMU_RESET_GPSALIVE_LOWPWR S5P_PMUREG(0x113C)
69#define S5P_CMU_CLKSTOP_CAM_LOWPWR S5P_PMUREG(0x1140)
70#define S5P_CMU_CLKSTOP_TV_LOWPWR S5P_PMUREG(0x1144)
71#define S5P_CMU_CLKSTOP_MFC_LOWPWR S5P_PMUREG(0x1148)
72#define S5P_CMU_CLKSTOP_G3D_LOWPWR S5P_PMUREG(0x114C)
73#define S5P_CMU_CLKSTOP_LCD0_LOWPWR S5P_PMUREG(0x1150)
74#define S5P_CMU_CLKSTOP_LCD1_LOWPWR S5P_PMUREG(0x1154)
75#define S5P_CMU_CLKSTOP_MAUDIO_LOWPWR S5P_PMUREG(0x1158)
76#define S5P_CMU_CLKSTOP_GPS_LOWPWR S5P_PMUREG(0x115C)
77#define S5P_CMU_RESET_CAM_LOWPWR S5P_PMUREG(0x1160)
78#define S5P_CMU_RESET_TV_LOWPWR S5P_PMUREG(0x1164)
79#define S5P_CMU_RESET_MFC_LOWPWR S5P_PMUREG(0x1168)
80#define S5P_CMU_RESET_G3D_LOWPWR S5P_PMUREG(0x116C)
81#define S5P_CMU_RESET_LCD0_LOWPWR S5P_PMUREG(0x1170)
82#define S5P_CMU_RESET_LCD1_LOWPWR S5P_PMUREG(0x1174)
83#define S5P_CMU_RESET_MAUDIO_LOWPWR S5P_PMUREG(0x1178)
84#define S5P_CMU_RESET_GPS_LOWPWR S5P_PMUREG(0x117C)
85#define S5P_TOP_BUS_LOWPWR S5P_PMUREG(0x1180)
86#define S5P_TOP_RETENTION_LOWPWR S5P_PMUREG(0x1184)
87#define S5P_TOP_PWR_LOWPWR S5P_PMUREG(0x1188)
88#define S5P_LOGIC_RESET_LOWPWR S5P_PMUREG(0x11A0)
89#define S5P_ONENAND_MEM_LOWPWR S5P_PMUREG(0x11C0)
90#define S5P_MODIMIF_MEM_LOWPWR S5P_PMUREG(0x11C4)
91#define S5P_G2D_ACP_MEM_LOWPWR S5P_PMUREG(0x11C8)
92#define S5P_USBOTG_MEM_LOWPWR S5P_PMUREG(0x11CC)
93#define S5P_HSMMC_MEM_LOWPWR S5P_PMUREG(0x11D0)
94#define S5P_CSSYS_MEM_LOWPWR S5P_PMUREG(0x11D4)
95#define S5P_SECSS_MEM_LOWPWR S5P_PMUREG(0x11D8)
96#define S5P_PCIE_MEM_LOWPWR S5P_PMUREG(0x11E0)
97#define S5P_SATA_MEM_LOWPWR S5P_PMUREG(0x11E4)
98#define S5P_PAD_RETENTION_DRAM_LOWPWR S5P_PMUREG(0x1200)
99#define S5P_PAD_RETENTION_MAUDIO_LOWPWR S5P_PMUREG(0x1204)
100#define S5P_PAD_RETENTION_GPIO_LOWPWR S5P_PMUREG(0x1220)
101#define S5P_PAD_RETENTION_UART_LOWPWR S5P_PMUREG(0x1224)
102#define S5P_PAD_RETENTION_MMCA_LOWPWR S5P_PMUREG(0x1228)
103#define S5P_PAD_RETENTION_MMCB_LOWPWR S5P_PMUREG(0x122C)
104#define S5P_PAD_RETENTION_EBIA_LOWPWR S5P_PMUREG(0x1230)
105#define S5P_PAD_RETENTION_EBIB_LOWPWR S5P_PMUREG(0x1234)
106#define S5P_PAD_RETENTION_ISOLATION_LOWPWR S5P_PMUREG(0x1240)
107#define S5P_PAD_RETENTION_ALV_SEL_LOWPWR S5P_PMUREG(0x1260)
108#define S5P_XUSBXTI_LOWPWR S5P_PMUREG(0x1280)
109#define S5P_XXTI_LOWPWR S5P_PMUREG(0x1284)
110#define S5P_EXT_REGULATOR_LOWPWR S5P_PMUREG(0x12C0)
111#define S5P_GPIO_MODE_LOWPWR S5P_PMUREG(0x1300)
112#define S5P_GPIO_MODE_MAUDIO_LOWPWR S5P_PMUREG(0x1340)
113#define S5P_CAM_LOWPWR S5P_PMUREG(0x1380)
114#define S5P_TV_LOWPWR S5P_PMUREG(0x1384)
115#define S5P_MFC_LOWPWR S5P_PMUREG(0x1388)
116#define S5P_G3D_LOWPWR S5P_PMUREG(0x138C)
117#define S5P_LCD0_LOWPWR S5P_PMUREG(0x1390)
118#define S5P_LCD1_LOWPWR S5P_PMUREG(0x1394)
119#define S5P_MAUDIO_LOWPWR S5P_PMUREG(0x1398)
120#define S5P_GPS_LOWPWR S5P_PMUREG(0x139C)
121#define S5P_GPS_ALIVE_LOWPWR S5P_PMUREG(0x13A0)
122
123#define S5P_ARM_CORE0_CONFIGURATION S5P_PMUREG(0x2000)
124#define S5P_ARM_CORE0_OPTION S5P_PMUREG(0x2008)
125#define S5P_ARM_CORE1_CONFIGURATION S5P_PMUREG(0x2080)
126#define S5P_ARM_CORE1_STATUS S5P_PMUREG(0x2084)
127#define S5P_ARM_CORE1_OPTION S5P_PMUREG(0x2088)
128
129#define S5P_ARM_COMMON_OPTION S5P_PMUREG(0x2408)
130#define S5P_TOP_PWR_OPTION S5P_PMUREG(0x2C48)
131#define S5P_CAM_OPTION S5P_PMUREG(0x3C08)
132#define S5P_TV_OPTION S5P_PMUREG(0x3C28)
133#define S5P_MFC_OPTION S5P_PMUREG(0x3C48)
134#define S5P_G3D_OPTION S5P_PMUREG(0x3C68)
135#define S5P_LCD0_OPTION S5P_PMUREG(0x3C88)
136#define S5P_LCD1_OPTION S5P_PMUREG(0x3CA8)
137#define S5P_MAUDIO_OPTION S5P_PMUREG(0x3CC8)
138#define S5P_GPS_OPTION S5P_PMUREG(0x3CE8)
139#define S5P_GPS_ALIVE_OPTION S5P_PMUREG(0x3D08)
140
141#define S5P_PAD_RET_MAUDIO_OPTION S5P_PMUREG(0x3028)
142#define S5P_PAD_RET_GPIO_OPTION S5P_PMUREG(0x3108)
143#define S5P_PAD_RET_UART_OPTION S5P_PMUREG(0x3128)
144#define S5P_PAD_RET_MMCA_OPTION S5P_PMUREG(0x3148)
145#define S5P_PAD_RET_MMCB_OPTION S5P_PMUREG(0x3168)
146#define S5P_PAD_RET_EBIA_OPTION S5P_PMUREG(0x3188)
147#define S5P_PAD_RET_EBIB_OPTION S5P_PMUREG(0x31A8)
148
149#define S5P_PMU_CAM_CONF S5P_PMUREG(0x3C00)
150#define S5P_PMU_TV_CONF S5P_PMUREG(0x3C20)
151#define S5P_PMU_MFC_CONF S5P_PMUREG(0x3C40)
152#define S5P_PMU_G3D_CONF S5P_PMUREG(0x3C60)
153#define S5P_PMU_LCD0_CONF S5P_PMUREG(0x3C80)
154#define S5P_PMU_LCD1_CONF S5P_PMUREG(0x3CA0)
155#define S5P_PMU_GPS_CONF S5P_PMUREG(0x3CE0)
156
157#define S5P_PMU_SATA_PHY_CONTROL_EN 0x1
158#define S5P_INT_LOCAL_PWR_EN 0x7
159
160#define S5P_CHECK_SLEEP 0x00000BAD
161
162#endif /* __ASM_ARCH_REGS_PMU_H */
diff --git a/arch/arm/mach-s5pv310/include/mach/regs-sysmmu.h b/arch/arm/mach-exynos4/include/mach/regs-sysmmu.h
index 0b28e81a16f7..68ff6ad08a2b 100644
--- a/arch/arm/mach-s5pv310/include/mach/regs-sysmmu.h
+++ b/arch/arm/mach-exynos4/include/mach/regs-sysmmu.h
@@ -1,9 +1,9 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/regs-sysmmu.h 1/* linux/arch/arm/mach-exynos4/include/mach/regs-sysmmu.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 4 * http://www.samsung.com
5 * 5 *
6 * S5PV310 - System MMU register 6 * EXYNOS4 - System MMU register
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -19,6 +19,10 @@
19#define S5P_MMU_FLUSH 0x00C 19#define S5P_MMU_FLUSH 0x00C
20#define S5P_PT_BASE_ADDR 0x014 20#define S5P_PT_BASE_ADDR 0x014
21#define S5P_INT_STATUS 0x018 21#define S5P_INT_STATUS 0x018
22#define S5P_INT_CLEAR 0x01C
22#define S5P_PAGE_FAULT_ADDR 0x024 23#define S5P_PAGE_FAULT_ADDR 0x024
24#define S5P_AW_FAULT_ADDR 0x028
25#define S5P_AR_FAULT_ADDR 0x02C
26#define S5P_DEFAULT_SLAVE_ADDR 0x030
23 27
24#endif /* __ASM_ARCH_REGS_SYSMMU_H */ 28#endif /* __ASM_ARCH_REGS_SYSMMU_H */
diff --git a/arch/arm/mach-s5pv310/include/mach/smp.h b/arch/arm/mach-exynos4/include/mach/smp.h
index 393ccbd52c4a..a463dcebcfd3 100644
--- a/arch/arm/mach-s5pv310/include/mach/smp.h
+++ b/arch/arm/mach-exynos4/include/mach/smp.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/smp.h 1/* linux/arch/arm/mach-exynos4/include/mach/smp.h
2 * 2 *
3 * Cloned from arch/arm/mach-realview/include/mach/smp.h 3 * Cloned from arch/arm/mach-realview/include/mach/smp.h
4*/ 4*/
diff --git a/arch/arm/mach-exynos4/include/mach/sysmmu.h b/arch/arm/mach-exynos4/include/mach/sysmmu.h
new file mode 100644
index 000000000000..6a5fbb534e82
--- /dev/null
+++ b/arch/arm/mach-exynos4/include/mach/sysmmu.h
@@ -0,0 +1,46 @@
1/* linux/arch/arm/mach-exynos4/include/mach/sysmmu.h
2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Samsung sysmmu driver for EXYNOS4
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARM_ARCH_SYSMMU_H
14#define __ASM_ARM_ARCH_SYSMMU_H __FILE__
15
16enum exynos4_sysmmu_ips {
17 SYSMMU_MDMA,
18 SYSMMU_SSS,
19 SYSMMU_FIMC0,
20 SYSMMU_FIMC1,
21 SYSMMU_FIMC2,
22 SYSMMU_FIMC3,
23 SYSMMU_JPEG,
24 SYSMMU_FIMD0,
25 SYSMMU_FIMD1,
26 SYSMMU_PCIe,
27 SYSMMU_G2D,
28 SYSMMU_ROTATOR,
29 SYSMMU_MDMA2,
30 SYSMMU_TV,
31 SYSMMU_MFC_L,
32 SYSMMU_MFC_R,
33 EXYNOS4_SYSMMU_TOTAL_IPNUM,
34};
35
36#define S5P_SYSMMU_TOTAL_IPNUM EXYNOS4_SYSMMU_TOTAL_IPNUM
37
38extern const char *sysmmu_ips_name[EXYNOS4_SYSMMU_TOTAL_IPNUM];
39
40typedef enum exynos4_sysmmu_ips sysmmu_ips;
41
42void sysmmu_clk_init(struct device *dev, sysmmu_ips ips);
43void sysmmu_clk_enable(sysmmu_ips ips);
44void sysmmu_clk_disable(sysmmu_ips ips);
45
46#endif /* __ASM_ARM_ARCH_SYSMMU_H */
diff --git a/arch/arm/mach-s5pv310/include/mach/system.h b/arch/arm/mach-exynos4/include/mach/system.h
index d10c009cf0f1..5e3220c18fc7 100644
--- a/arch/arm/mach-s5pv310/include/mach/system.h
+++ b/arch/arm/mach-exynos4/include/mach/system.h
@@ -1,9 +1,9 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/system.h 1/* linux/arch/arm/mach-exynos4/include/mach/system.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * S5PV310 - system support header 6 * EXYNOS4 - system support header
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/mach-s5pv310/include/mach/timex.h b/arch/arm/mach-exynos4/include/mach/timex.h
index bd2359b952b4..6d138750a708 100644
--- a/arch/arm/mach-s5pv310/include/mach/timex.h
+++ b/arch/arm/mach-exynos4/include/mach/timex.h
@@ -1,14 +1,14 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/timex.h 1/* linux/arch/arm/mach-exynos4/include/mach/timex.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * Copyright (c) 2003-2010 Simtec Electronics 6 * Copyright (c) 2003-2010 Simtec Electronics
7 * Ben Dooks <ben@simtec.co.uk> 7 * Ben Dooks <ben@simtec.co.uk>
8 * 8 *
9 * Based on arch/arm/mach-s5p6442/include/mach/timex.h 9 * Based on arch/arm/mach-s5p6442/include/mach/timex.h
10 * 10 *
11 * S5PV310 - time parameters 11 * EXYNOS4 - time parameters
12 * 12 *
13 * This program is free software; you can redistribute it and/or modify 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 14 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/mach-s5pv310/include/mach/uncompress.h b/arch/arm/mach-exynos4/include/mach/uncompress.h
index 59593c1e2416..21d97bcd9acb 100644
--- a/arch/arm/mach-s5pv310/include/mach/uncompress.h
+++ b/arch/arm/mach-exynos4/include/mach/uncompress.h
@@ -1,9 +1,9 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/uncompress.h 1/* linux/arch/arm/mach-exynos4/include/mach/uncompress.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * S5PV310 - uncompress code 6 * EXYNOS4 - uncompress code
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/mach-s5pv310/include/mach/vmalloc.h b/arch/arm/mach-exynos4/include/mach/vmalloc.h
index 65759fb97581..284330e571d2 100644
--- a/arch/arm/mach-s5pv310/include/mach/vmalloc.h
+++ b/arch/arm/mach-exynos4/include/mach/vmalloc.h
@@ -1,7 +1,7 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/vmalloc.h 1/* linux/arch/arm/mach-exynos4/include/mach/vmalloc.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * Copyright 2010 Ben Dooks <ben-linux@fluff.org> 6 * Copyright 2010 Ben Dooks <ben-linux@fluff.org>
7 * 7 *
@@ -11,7 +11,7 @@
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 * 13 *
14 * S5PV310 vmalloc definition 14 * EXYNOS4 vmalloc definition
15*/ 15*/
16 16
17#ifndef __ASM_ARCH_VMALLOC_H 17#ifndef __ASM_ARCH_VMALLOC_H
diff --git a/arch/arm/mach-s5pv310/init.c b/arch/arm/mach-exynos4/init.c
index 182dcf42cfb4..cf91f50e43ab 100644
--- a/arch/arm/mach-s5pv310/init.c
+++ b/arch/arm/mach-exynos4/init.c
@@ -1,4 +1,4 @@
1/* linux/arch/arm/mach-s5pv310/init.c 1/* linux/arch/arm/mach-exynos4/init.c
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com/
@@ -14,7 +14,7 @@
14#include <plat/devs.h> 14#include <plat/devs.h>
15#include <plat/regs-serial.h> 15#include <plat/regs-serial.h>
16 16
17static struct s3c24xx_uart_clksrc s5pv310_serial_clocks[] = { 17static struct s3c24xx_uart_clksrc exynos4_serial_clocks[] = {
18 [0] = { 18 [0] = {
19 .name = "uclk1", 19 .name = "uclk1",
20 .divisor = 1, 20 .divisor = 1,
@@ -24,7 +24,7 @@ static struct s3c24xx_uart_clksrc s5pv310_serial_clocks[] = {
24}; 24};
25 25
26/* uart registration process */ 26/* uart registration process */
27void __init s5pv310_common_init_uarts(struct s3c2410_uartcfg *cfg, int no) 27void __init exynos4_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
28{ 28{
29 struct s3c2410_uartcfg *tcfg = cfg; 29 struct s3c2410_uartcfg *tcfg = cfg;
30 u32 ucnt; 30 u32 ucnt;
@@ -32,8 +32,8 @@ void __init s5pv310_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
32 for (ucnt = 0; ucnt < no; ucnt++, tcfg++) { 32 for (ucnt = 0; ucnt < no; ucnt++, tcfg++) {
33 if (!tcfg->clocks) { 33 if (!tcfg->clocks) {
34 tcfg->has_fracval = 1; 34 tcfg->has_fracval = 1;
35 tcfg->clocks = s5pv310_serial_clocks; 35 tcfg->clocks = exynos4_serial_clocks;
36 tcfg->clocks_size = ARRAY_SIZE(s5pv310_serial_clocks); 36 tcfg->clocks_size = ARRAY_SIZE(exynos4_serial_clocks);
37 } 37 }
38 } 38 }
39 39
diff --git a/arch/arm/mach-s5pv310/irq-combiner.c b/arch/arm/mach-exynos4/irq-combiner.c
index 1ea4a9e83bbe..31618d91ce15 100644
--- a/arch/arm/mach-s5pv310/irq-combiner.c
+++ b/arch/arm/mach-exynos4/irq-combiner.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s5pv310/irq-combiner.c 1/* linux/arch/arm/mach-exynos4/irq-combiner.c
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 4 * http://www.samsung.com
5 * 5 *
6 * Based on arch/arm/common/gic.c 6 * Based on arch/arm/common/gic.c
diff --git a/arch/arm/mach-s5pv310/irq-eint.c b/arch/arm/mach-exynos4/irq-eint.c
index 477bd9e97f0f..4f7ad4a796e4 100644
--- a/arch/arm/mach-s5pv310/irq-eint.c
+++ b/arch/arm/mach-exynos4/irq-eint.c
@@ -1,9 +1,9 @@
1/* linux/arch/arm/mach-s5pv310/irq-eint.c 1/* linux/arch/arm/mach-exynos4/irq-eint.c
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 4 * http://www.samsung.com
5 * 5 *
6 * S5PV310 - IRQ EINT support 6 * EXYNOS4 - IRQ EINT support
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -27,7 +27,7 @@ static DEFINE_SPINLOCK(eint_lock);
27 27
28static unsigned int eint0_15_data[16]; 28static unsigned int eint0_15_data[16];
29 29
30static unsigned int s5pv310_get_irq_nr(unsigned int number) 30static unsigned int exynos4_get_irq_nr(unsigned int number)
31{ 31{
32 u32 ret = 0; 32 u32 ret = 0;
33 33
@@ -48,7 +48,7 @@ static unsigned int s5pv310_get_irq_nr(unsigned int number)
48 return ret; 48 return ret;
49} 49}
50 50
51static inline void s5pv310_irq_eint_mask(struct irq_data *data) 51static inline void exynos4_irq_eint_mask(struct irq_data *data)
52{ 52{
53 u32 mask; 53 u32 mask;
54 54
@@ -59,7 +59,7 @@ static inline void s5pv310_irq_eint_mask(struct irq_data *data)
59 spin_unlock(&eint_lock); 59 spin_unlock(&eint_lock);
60} 60}
61 61
62static void s5pv310_irq_eint_unmask(struct irq_data *data) 62static void exynos4_irq_eint_unmask(struct irq_data *data)
63{ 63{
64 u32 mask; 64 u32 mask;
65 65
@@ -70,19 +70,19 @@ static void s5pv310_irq_eint_unmask(struct irq_data *data)
70 spin_unlock(&eint_lock); 70 spin_unlock(&eint_lock);
71} 71}
72 72
73static inline void s5pv310_irq_eint_ack(struct irq_data *data) 73static inline void exynos4_irq_eint_ack(struct irq_data *data)
74{ 74{
75 __raw_writel(eint_irq_to_bit(data->irq), 75 __raw_writel(eint_irq_to_bit(data->irq),
76 S5P_EINT_PEND(EINT_REG_NR(data->irq))); 76 S5P_EINT_PEND(EINT_REG_NR(data->irq)));
77} 77}
78 78
79static void s5pv310_irq_eint_maskack(struct irq_data *data) 79static void exynos4_irq_eint_maskack(struct irq_data *data)
80{ 80{
81 s5pv310_irq_eint_mask(data); 81 exynos4_irq_eint_mask(data);
82 s5pv310_irq_eint_ack(data); 82 exynos4_irq_eint_ack(data);
83} 83}
84 84
85static int s5pv310_irq_eint_set_type(struct irq_data *data, unsigned int type) 85static int exynos4_irq_eint_set_type(struct irq_data *data, unsigned int type)
86{ 86{
87 int offs = EINT_OFFSET(data->irq); 87 int offs = EINT_OFFSET(data->irq);
88 int shift; 88 int shift;
@@ -145,19 +145,19 @@ static int s5pv310_irq_eint_set_type(struct irq_data *data, unsigned int type)
145 return 0; 145 return 0;
146} 146}
147 147
148static struct irq_chip s5pv310_irq_eint = { 148static struct irq_chip exynos4_irq_eint = {
149 .name = "s5pv310-eint", 149 .name = "exynos4-eint",
150 .irq_mask = s5pv310_irq_eint_mask, 150 .irq_mask = exynos4_irq_eint_mask,
151 .irq_unmask = s5pv310_irq_eint_unmask, 151 .irq_unmask = exynos4_irq_eint_unmask,
152 .irq_mask_ack = s5pv310_irq_eint_maskack, 152 .irq_mask_ack = exynos4_irq_eint_maskack,
153 .irq_ack = s5pv310_irq_eint_ack, 153 .irq_ack = exynos4_irq_eint_ack,
154 .irq_set_type = s5pv310_irq_eint_set_type, 154 .irq_set_type = exynos4_irq_eint_set_type,
155#ifdef CONFIG_PM 155#ifdef CONFIG_PM
156 .irq_set_wake = s3c_irqext_wake, 156 .irq_set_wake = s3c_irqext_wake,
157#endif 157#endif
158}; 158};
159 159
160/* s5pv310_irq_demux_eint 160/* exynos4_irq_demux_eint
161 * 161 *
162 * This function demuxes the IRQ from from EINTs 16 to 31. 162 * This function demuxes the IRQ from from EINTs 16 to 31.
163 * It is designed to be inlined into the specific handler 163 * It is designed to be inlined into the specific handler
@@ -165,7 +165,7 @@ static struct irq_chip s5pv310_irq_eint = {
165 * 165 *
166 * Each EINT pend/mask registers handle eight of them. 166 * Each EINT pend/mask registers handle eight of them.
167 */ 167 */
168static inline void s5pv310_irq_demux_eint(unsigned int start) 168static inline void exynos4_irq_demux_eint(unsigned int start)
169{ 169{
170 unsigned int irq; 170 unsigned int irq;
171 171
@@ -182,13 +182,13 @@ static inline void s5pv310_irq_demux_eint(unsigned int start)
182 } 182 }
183} 183}
184 184
185static void s5pv310_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc) 185static void exynos4_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc)
186{ 186{
187 s5pv310_irq_demux_eint(IRQ_EINT(16)); 187 exynos4_irq_demux_eint(IRQ_EINT(16));
188 s5pv310_irq_demux_eint(IRQ_EINT(24)); 188 exynos4_irq_demux_eint(IRQ_EINT(24));
189} 189}
190 190
191static void s5pv310_irq_eint0_15(unsigned int irq, struct irq_desc *desc) 191static void exynos4_irq_eint0_15(unsigned int irq, struct irq_desc *desc)
192{ 192{
193 u32 *irq_data = get_irq_data(irq); 193 u32 *irq_data = get_irq_data(irq);
194 struct irq_chip *chip = get_irq_chip(irq); 194 struct irq_chip *chip = get_irq_chip(irq);
@@ -203,27 +203,27 @@ static void s5pv310_irq_eint0_15(unsigned int irq, struct irq_desc *desc)
203 chip->irq_unmask(&desc->irq_data); 203 chip->irq_unmask(&desc->irq_data);
204} 204}
205 205
206int __init s5pv310_init_irq_eint(void) 206int __init exynos4_init_irq_eint(void)
207{ 207{
208 int irq; 208 int irq;
209 209
210 for (irq = 0 ; irq <= 31 ; irq++) { 210 for (irq = 0 ; irq <= 31 ; irq++) {
211 set_irq_chip(IRQ_EINT(irq), &s5pv310_irq_eint); 211 set_irq_chip(IRQ_EINT(irq), &exynos4_irq_eint);
212 set_irq_handler(IRQ_EINT(irq), handle_level_irq); 212 set_irq_handler(IRQ_EINT(irq), handle_level_irq);
213 set_irq_flags(IRQ_EINT(irq), IRQF_VALID); 213 set_irq_flags(IRQ_EINT(irq), IRQF_VALID);
214 } 214 }
215 215
216 set_irq_chained_handler(IRQ_EINT16_31, s5pv310_irq_demux_eint16_31); 216 set_irq_chained_handler(IRQ_EINT16_31, exynos4_irq_demux_eint16_31);
217 217
218 for (irq = 0 ; irq <= 15 ; irq++) { 218 for (irq = 0 ; irq <= 15 ; irq++) {
219 eint0_15_data[irq] = IRQ_EINT(irq); 219 eint0_15_data[irq] = IRQ_EINT(irq);
220 220
221 set_irq_data(s5pv310_get_irq_nr(irq), &eint0_15_data[irq]); 221 set_irq_data(exynos4_get_irq_nr(irq), &eint0_15_data[irq]);
222 set_irq_chained_handler(s5pv310_get_irq_nr(irq), 222 set_irq_chained_handler(exynos4_get_irq_nr(irq),
223 s5pv310_irq_eint0_15); 223 exynos4_irq_eint0_15);
224 } 224 }
225 225
226 return 0; 226 return 0;
227} 227}
228 228
229arch_initcall(s5pv310_init_irq_eint); 229arch_initcall(exynos4_init_irq_eint);
diff --git a/arch/arm/mach-s5pv310/localtimer.c b/arch/arm/mach-exynos4/localtimer.c
index 2784036cd8b1..6bf3d0ab9627 100644
--- a/arch/arm/mach-s5pv310/localtimer.c
+++ b/arch/arm/mach-exynos4/localtimer.c
@@ -1,4 +1,4 @@
1/* linux/arch/arm/mach-s5pv310/localtimer.c 1/* linux/arch/arm/mach-exynos4/localtimer.c
2 * 2 *
3 * Cloned from linux/arch/arm/mach-realview/localtimer.c 3 * Cloned from linux/arch/arm/mach-realview/localtimer.c
4 * 4 *
@@ -18,8 +18,9 @@
18/* 18/*
19 * Setup the local clock events for a CPU. 19 * Setup the local clock events for a CPU.
20 */ 20 */
21void __cpuinit local_timer_setup(struct clock_event_device *evt) 21int __cpuinit local_timer_setup(struct clock_event_device *evt)
22{ 22{
23 evt->irq = IRQ_LOCALTIMER; 23 evt->irq = IRQ_LOCALTIMER;
24 twd_timer_setup(evt); 24 twd_timer_setup(evt);
25 return 0;
25} 26}
diff --git a/arch/arm/mach-exynos4/mach-armlex4210.c b/arch/arm/mach-exynos4/mach-armlex4210.c
new file mode 100644
index 000000000000..b482c6285fc4
--- /dev/null
+++ b/arch/arm/mach-exynos4/mach-armlex4210.c
@@ -0,0 +1,215 @@
1/* linux/arch/arm/mach-exynos4/mach-armlex4210.c
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11#include <linux/gpio.h>
12#include <linux/io.h>
13#include <linux/mmc/host.h>
14#include <linux/platform_device.h>
15#include <linux/serial_core.h>
16#include <linux/smsc911x.h>
17
18#include <asm/mach/arch.h>
19#include <asm/mach-types.h>
20
21#include <plat/cpu.h>
22#include <plat/devs.h>
23#include <plat/exynos4.h>
24#include <plat/gpio-cfg.h>
25#include <plat/regs-serial.h>
26#include <plat/regs-srom.h>
27#include <plat/sdhci.h>
28
29#include <mach/map.h>
30
31/* Following are default values for UCON, ULCON and UFCON UART registers */
32#define ARMLEX4210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
33 S3C2410_UCON_RXILEVEL | \
34 S3C2410_UCON_TXIRQMODE | \
35 S3C2410_UCON_RXIRQMODE | \
36 S3C2410_UCON_RXFIFO_TOI | \
37 S3C2443_UCON_RXERR_IRQEN)
38
39#define ARMLEX4210_ULCON_DEFAULT S3C2410_LCON_CS8
40
41#define ARMLEX4210_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
42 S5PV210_UFCON_TXTRIG4 | \
43 S5PV210_UFCON_RXTRIG4)
44
45static struct s3c2410_uartcfg armlex4210_uartcfgs[] __initdata = {
46 [0] = {
47 .hwport = 0,
48 .flags = 0,
49 .ucon = ARMLEX4210_UCON_DEFAULT,
50 .ulcon = ARMLEX4210_ULCON_DEFAULT,
51 .ufcon = ARMLEX4210_UFCON_DEFAULT,
52 },
53 [1] = {
54 .hwport = 1,
55 .flags = 0,
56 .ucon = ARMLEX4210_UCON_DEFAULT,
57 .ulcon = ARMLEX4210_ULCON_DEFAULT,
58 .ufcon = ARMLEX4210_UFCON_DEFAULT,
59 },
60 [2] = {
61 .hwport = 2,
62 .flags = 0,
63 .ucon = ARMLEX4210_UCON_DEFAULT,
64 .ulcon = ARMLEX4210_ULCON_DEFAULT,
65 .ufcon = ARMLEX4210_UFCON_DEFAULT,
66 },
67 [3] = {
68 .hwport = 3,
69 .flags = 0,
70 .ucon = ARMLEX4210_UCON_DEFAULT,
71 .ulcon = ARMLEX4210_ULCON_DEFAULT,
72 .ufcon = ARMLEX4210_UFCON_DEFAULT,
73 },
74};
75
76static struct s3c_sdhci_platdata armlex4210_hsmmc0_pdata __initdata = {
77 .cd_type = S3C_SDHCI_CD_PERMANENT,
78 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
79#ifdef CONFIG_EXYNOS4_SDHCI_CH0_8BIT
80 .max_width = 8,
81 .host_caps = MMC_CAP_8_BIT_DATA,
82#endif
83};
84
85static struct s3c_sdhci_platdata armlex4210_hsmmc2_pdata __initdata = {
86 .cd_type = S3C_SDHCI_CD_GPIO,
87 .ext_cd_gpio = EXYNOS4_GPX2(5),
88 .ext_cd_gpio_invert = 1,
89 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
90 .max_width = 4,
91};
92
93static struct s3c_sdhci_platdata armlex4210_hsmmc3_pdata __initdata = {
94 .cd_type = S3C_SDHCI_CD_PERMANENT,
95 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
96 .max_width = 4,
97};
98
99static void __init armlex4210_sdhci_init(void)
100{
101 s3c_sdhci0_set_platdata(&armlex4210_hsmmc0_pdata);
102 s3c_sdhci2_set_platdata(&armlex4210_hsmmc2_pdata);
103 s3c_sdhci3_set_platdata(&armlex4210_hsmmc3_pdata);
104}
105
106static void __init armlex4210_wlan_init(void)
107{
108 /* enable */
109 s3c_gpio_cfgpin(EXYNOS4_GPX2(0), S3C_GPIO_SFN(0xf));
110 s3c_gpio_setpull(EXYNOS4_GPX2(0), S3C_GPIO_PULL_UP);
111
112 /* reset */
113 s3c_gpio_cfgpin(EXYNOS4_GPX1(6), S3C_GPIO_SFN(0xf));
114 s3c_gpio_setpull(EXYNOS4_GPX1(6), S3C_GPIO_PULL_UP);
115
116 /* wakeup */
117 s3c_gpio_cfgpin(EXYNOS4_GPX1(5), S3C_GPIO_SFN(0xf));
118 s3c_gpio_setpull(EXYNOS4_GPX1(5), S3C_GPIO_PULL_UP);
119}
120
121static struct resource armlex4210_smsc911x_resources[] = {
122 [0] = {
123 .start = EXYNOS4_PA_SROM_BANK(3),
124 .end = EXYNOS4_PA_SROM_BANK(3) + SZ_64K - 1,
125 .flags = IORESOURCE_MEM,
126 },
127 [1] = {
128 .start = IRQ_EINT(27),
129 .end = IRQ_EINT(27),
130 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,
131 },
132};
133
134static struct smsc911x_platform_config smsc9215_config = {
135 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
136 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
137 .flags = SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY,
138 .phy_interface = PHY_INTERFACE_MODE_MII,
139 .mac = {0x00, 0x80, 0x00, 0x23, 0x45, 0x67},
140};
141
142static struct platform_device armlex4210_smsc911x = {
143 .name = "smsc911x",
144 .id = -1,
145 .num_resources = ARRAY_SIZE(armlex4210_smsc911x_resources),
146 .resource = armlex4210_smsc911x_resources,
147 .dev = {
148 .platform_data = &smsc9215_config,
149 },
150};
151
152static struct platform_device *armlex4210_devices[] __initdata = {
153 &s3c_device_hsmmc0,
154 &s3c_device_hsmmc2,
155 &s3c_device_hsmmc3,
156 &s3c_device_rtc,
157 &s3c_device_wdt,
158 &exynos4_device_sysmmu,
159 &samsung_asoc_dma,
160 &armlex4210_smsc911x,
161 &exynos4_device_ahci,
162};
163
164static void __init armlex4210_smsc911x_init(void)
165{
166 u32 cs1;
167
168 /* configure nCS1 width to 16 bits */
169 cs1 = __raw_readl(S5P_SROM_BW) &
170 ~(S5P_SROM_BW__CS_MASK << S5P_SROM_BW__NCS1__SHIFT);
171 cs1 |= ((1 << S5P_SROM_BW__DATAWIDTH__SHIFT) |
172 (0 << S5P_SROM_BW__WAITENABLE__SHIFT) |
173 (1 << S5P_SROM_BW__ADDRMODE__SHIFT) |
174 (1 << S5P_SROM_BW__BYTEENABLE__SHIFT)) <<
175 S5P_SROM_BW__NCS1__SHIFT;
176 __raw_writel(cs1, S5P_SROM_BW);
177
178 /* set timing for nCS1 suitable for ethernet chip */
179 __raw_writel((0x1 << S5P_SROM_BCX__PMC__SHIFT) |
180 (0x9 << S5P_SROM_BCX__TACP__SHIFT) |
181 (0xc << S5P_SROM_BCX__TCAH__SHIFT) |
182 (0x1 << S5P_SROM_BCX__TCOH__SHIFT) |
183 (0x6 << S5P_SROM_BCX__TACC__SHIFT) |
184 (0x1 << S5P_SROM_BCX__TCOS__SHIFT) |
185 (0x1 << S5P_SROM_BCX__TACS__SHIFT), S5P_SROM_BC1);
186}
187
188static void __init armlex4210_map_io(void)
189{
190 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
191 s3c24xx_init_clocks(24000000);
192 s3c24xx_init_uarts(armlex4210_uartcfgs,
193 ARRAY_SIZE(armlex4210_uartcfgs));
194}
195
196static void __init armlex4210_machine_init(void)
197{
198 armlex4210_smsc911x_init();
199
200 armlex4210_sdhci_init();
201
202 armlex4210_wlan_init();
203
204 platform_add_devices(armlex4210_devices,
205 ARRAY_SIZE(armlex4210_devices));
206}
207
208MACHINE_START(ARMLEX4210, "ARMLEX4210")
209 /* Maintainer: Alim Akhtar <alim.akhtar@samsung.com> */
210 .boot_params = S5P_PA_SDRAM + 0x100,
211 .init_irq = exynos4_init_irq,
212 .map_io = armlex4210_map_io,
213 .init_machine = armlex4210_machine_init,
214 .timer = &exynos4_timer,
215MACHINE_END
diff --git a/arch/arm/mach-exynos4/mach-nuri.c b/arch/arm/mach-exynos4/mach-nuri.c
new file mode 100644
index 000000000000..b79ad010d194
--- /dev/null
+++ b/arch/arm/mach-exynos4/mach-nuri.c
@@ -0,0 +1,305 @@
1/*
2 * linux/arch/arm/mach-exynos4/mach-nuri.c
3 *
4 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/platform_device.h>
12#include <linux/serial_core.h>
13#include <linux/input.h>
14#include <linux/i2c.h>
15#include <linux/gpio_keys.h>
16#include <linux/gpio.h>
17#include <linux/regulator/machine.h>
18#include <linux/regulator/fixed.h>
19#include <linux/mmc/host.h>
20#include <linux/fb.h>
21#include <linux/pwm_backlight.h>
22
23#include <video/platform_lcd.h>
24
25#include <asm/mach/arch.h>
26#include <asm/mach-types.h>
27
28#include <plat/regs-serial.h>
29#include <plat/exynos4.h>
30#include <plat/cpu.h>
31#include <plat/devs.h>
32#include <plat/sdhci.h>
33
34#include <mach/map.h>
35
36/* Following are default values for UCON, ULCON and UFCON UART registers */
37#define NURI_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
38 S3C2410_UCON_RXILEVEL | \
39 S3C2410_UCON_TXIRQMODE | \
40 S3C2410_UCON_RXIRQMODE | \
41 S3C2410_UCON_RXFIFO_TOI | \
42 S3C2443_UCON_RXERR_IRQEN)
43
44#define NURI_ULCON_DEFAULT S3C2410_LCON_CS8
45
46#define NURI_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
47 S5PV210_UFCON_TXTRIG256 | \
48 S5PV210_UFCON_RXTRIG256)
49
50enum fixed_regulator_id {
51 FIXED_REG_ID_MMC = 0,
52};
53
54static struct s3c2410_uartcfg nuri_uartcfgs[] __initdata = {
55 {
56 .hwport = 0,
57 .ucon = NURI_UCON_DEFAULT,
58 .ulcon = NURI_ULCON_DEFAULT,
59 .ufcon = NURI_UFCON_DEFAULT,
60 },
61 {
62 .hwport = 1,
63 .ucon = NURI_UCON_DEFAULT,
64 .ulcon = NURI_ULCON_DEFAULT,
65 .ufcon = NURI_UFCON_DEFAULT,
66 },
67 {
68 .hwport = 2,
69 .ucon = NURI_UCON_DEFAULT,
70 .ulcon = NURI_ULCON_DEFAULT,
71 .ufcon = NURI_UFCON_DEFAULT,
72 },
73 {
74 .hwport = 3,
75 .ucon = NURI_UCON_DEFAULT,
76 .ulcon = NURI_ULCON_DEFAULT,
77 .ufcon = NURI_UFCON_DEFAULT,
78 },
79};
80
81/* eMMC */
82static struct s3c_sdhci_platdata nuri_hsmmc0_data __initdata = {
83 .max_width = 8,
84 .host_caps = (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA |
85 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
86 MMC_CAP_DISABLE | MMC_CAP_ERASE),
87 .cd_type = S3C_SDHCI_CD_PERMANENT,
88 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
89};
90
91static struct regulator_consumer_supply emmc_supplies[] = {
92 REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"),
93 REGULATOR_SUPPLY("vmmc", "dw_mmc"),
94};
95
96static struct regulator_init_data emmc_fixed_voltage_init_data = {
97 .constraints = {
98 .name = "VMEM_VDD_2.8V",
99 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
100 },
101 .num_consumer_supplies = ARRAY_SIZE(emmc_supplies),
102 .consumer_supplies = emmc_supplies,
103};
104
105static struct fixed_voltage_config emmc_fixed_voltage_config = {
106 .supply_name = "MASSMEMORY_EN (inverted)",
107 .microvolts = 2800000,
108 .gpio = EXYNOS4_GPL1(1),
109 .enable_high = false,
110 .init_data = &emmc_fixed_voltage_init_data,
111};
112
113static struct platform_device emmc_fixed_voltage = {
114 .name = "reg-fixed-voltage",
115 .id = FIXED_REG_ID_MMC,
116 .dev = {
117 .platform_data = &emmc_fixed_voltage_config,
118 },
119};
120
121/* SD */
122static struct s3c_sdhci_platdata nuri_hsmmc2_data __initdata = {
123 .max_width = 4,
124 .host_caps = MMC_CAP_4_BIT_DATA |
125 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
126 MMC_CAP_DISABLE,
127 .ext_cd_gpio = EXYNOS4_GPX3(3), /* XEINT_27 */
128 .ext_cd_gpio_invert = 1,
129 .cd_type = S3C_SDHCI_CD_GPIO,
130 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
131};
132
133/* WLAN */
134static struct s3c_sdhci_platdata nuri_hsmmc3_data __initdata = {
135 .max_width = 4,
136 .host_caps = MMC_CAP_4_BIT_DATA |
137 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
138 .cd_type = S3C_SDHCI_CD_EXTERNAL,
139 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
140};
141
142static void __init nuri_sdhci_init(void)
143{
144 s3c_sdhci0_set_platdata(&nuri_hsmmc0_data);
145 s3c_sdhci2_set_platdata(&nuri_hsmmc2_data);
146 s3c_sdhci3_set_platdata(&nuri_hsmmc3_data);
147}
148
149/* GPIO KEYS */
150static struct gpio_keys_button nuri_gpio_keys_tables[] = {
151 {
152 .code = KEY_VOLUMEUP,
153 .gpio = EXYNOS4_GPX2(0), /* XEINT16 */
154 .desc = "gpio-keys: KEY_VOLUMEUP",
155 .type = EV_KEY,
156 .active_low = 1,
157 .debounce_interval = 1,
158 }, {
159 .code = KEY_VOLUMEDOWN,
160 .gpio = EXYNOS4_GPX2(1), /* XEINT17 */
161 .desc = "gpio-keys: KEY_VOLUMEDOWN",
162 .type = EV_KEY,
163 .active_low = 1,
164 .debounce_interval = 1,
165 }, {
166 .code = KEY_POWER,
167 .gpio = EXYNOS4_GPX2(7), /* XEINT23 */
168 .desc = "gpio-keys: KEY_POWER",
169 .type = EV_KEY,
170 .active_low = 1,
171 .wakeup = 1,
172 .debounce_interval = 1,
173 },
174};
175
176static struct gpio_keys_platform_data nuri_gpio_keys_data = {
177 .buttons = nuri_gpio_keys_tables,
178 .nbuttons = ARRAY_SIZE(nuri_gpio_keys_tables),
179};
180
181static struct platform_device nuri_gpio_keys = {
182 .name = "gpio-keys",
183 .dev = {
184 .platform_data = &nuri_gpio_keys_data,
185 },
186};
187
188static void nuri_lcd_power_on(struct plat_lcd_data *pd, unsigned int power)
189{
190 int gpio = EXYNOS4_GPE1(5);
191
192 gpio_request(gpio, "LVDS_nSHDN");
193 gpio_direction_output(gpio, power);
194 gpio_free(gpio);
195}
196
197static int nuri_bl_init(struct device *dev)
198{
199 int ret, gpio = EXYNOS4_GPE2(3);
200
201 ret = gpio_request(gpio, "LCD_LDO_EN");
202 if (!ret)
203 gpio_direction_output(gpio, 0);
204
205 return ret;
206}
207
208static int nuri_bl_notify(struct device *dev, int brightness)
209{
210 if (brightness < 1)
211 brightness = 0;
212
213 gpio_set_value(EXYNOS4_GPE2(3), 1);
214
215 return brightness;
216}
217
218static void nuri_bl_exit(struct device *dev)
219{
220 gpio_free(EXYNOS4_GPE2(3));
221}
222
223/* nuri pwm backlight */
224static struct platform_pwm_backlight_data nuri_backlight_data = {
225 .pwm_id = 0,
226 .pwm_period_ns = 30000,
227 .max_brightness = 100,
228 .dft_brightness = 50,
229 .init = nuri_bl_init,
230 .notify = nuri_bl_notify,
231 .exit = nuri_bl_exit,
232};
233
234static struct platform_device nuri_backlight_device = {
235 .name = "pwm-backlight",
236 .id = -1,
237 .dev = {
238 .parent = &s3c_device_timer[0].dev,
239 .platform_data = &nuri_backlight_data,
240 },
241};
242
243static struct plat_lcd_data nuri_lcd_platform_data = {
244 .set_power = nuri_lcd_power_on,
245};
246
247static struct platform_device nuri_lcd_device = {
248 .name = "platform-lcd",
249 .id = -1,
250 .dev = {
251 .platform_data = &nuri_lcd_platform_data,
252 },
253};
254
255/* I2C1 */
256static struct i2c_board_info i2c1_devs[] __initdata = {
257 /* Gyro, To be updated */
258};
259
260/* GPIO I2C 5 (PMIC) */
261static struct i2c_board_info i2c5_devs[] __initdata = {
262 /* max8997, To be updated */
263};
264
265static struct platform_device *nuri_devices[] __initdata = {
266 /* Samsung Platform Devices */
267 &emmc_fixed_voltage,
268 &s3c_device_hsmmc0,
269 &s3c_device_hsmmc2,
270 &s3c_device_hsmmc3,
271 &s3c_device_wdt,
272 &s3c_device_timer[0],
273
274 /* NURI Devices */
275 &nuri_gpio_keys,
276 &nuri_lcd_device,
277 &nuri_backlight_device,
278};
279
280static void __init nuri_map_io(void)
281{
282 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
283 s3c24xx_init_clocks(24000000);
284 s3c24xx_init_uarts(nuri_uartcfgs, ARRAY_SIZE(nuri_uartcfgs));
285}
286
287static void __init nuri_machine_init(void)
288{
289 nuri_sdhci_init();
290
291 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
292 i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs));
293
294 /* Last */
295 platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices));
296}
297
298MACHINE_START(NURI, "NURI")
299 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
300 .boot_params = S5P_PA_SDRAM + 0x100,
301 .init_irq = exynos4_init_irq,
302 .map_io = nuri_map_io,
303 .init_machine = nuri_machine_init,
304 .timer = &exynos4_timer,
305MACHINE_END
diff --git a/arch/arm/mach-s5pv310/mach-smdkc210.c b/arch/arm/mach-exynos4/mach-smdkc210.c
index d9cab02e23ca..25a256818122 100644
--- a/arch/arm/mach-s5pv310/mach-smdkc210.c
+++ b/arch/arm/mach-exynos4/mach-smdkc210.c
@@ -1,7 +1,7 @@
1/* linux/arch/arm/mach-s5pv310/mach-smdkc210.c 1/* linux/arch/arm/mach-exynos4/mach-smdkc210.c
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
@@ -21,7 +21,7 @@
21 21
22#include <plat/regs-serial.h> 22#include <plat/regs-serial.h>
23#include <plat/regs-srom.h> 23#include <plat/regs-srom.h>
24#include <plat/s5pv310.h> 24#include <plat/exynos4.h>
25#include <plat/cpu.h> 25#include <plat/cpu.h>
26#include <plat/devs.h> 26#include <plat/devs.h>
27#include <plat/sdhci.h> 27#include <plat/sdhci.h>
@@ -77,10 +77,10 @@ static struct s3c2410_uartcfg smdkc210_uartcfgs[] __initdata = {
77 77
78static struct s3c_sdhci_platdata smdkc210_hsmmc0_pdata __initdata = { 78static struct s3c_sdhci_platdata smdkc210_hsmmc0_pdata __initdata = {
79 .cd_type = S3C_SDHCI_CD_GPIO, 79 .cd_type = S3C_SDHCI_CD_GPIO,
80 .ext_cd_gpio = S5PV310_GPK0(2), 80 .ext_cd_gpio = EXYNOS4_GPK0(2),
81 .ext_cd_gpio_invert = 1, 81 .ext_cd_gpio_invert = 1,
82 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, 82 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
83#ifdef CONFIG_S5PV310_SDHCI_CH0_8BIT 83#ifdef CONFIG_EXYNOS4_SDHCI_CH0_8BIT
84 .max_width = 8, 84 .max_width = 8,
85 .host_caps = MMC_CAP_8_BIT_DATA, 85 .host_caps = MMC_CAP_8_BIT_DATA,
86#endif 86#endif
@@ -88,17 +88,17 @@ static struct s3c_sdhci_platdata smdkc210_hsmmc0_pdata __initdata = {
88 88
89static struct s3c_sdhci_platdata smdkc210_hsmmc1_pdata __initdata = { 89static struct s3c_sdhci_platdata smdkc210_hsmmc1_pdata __initdata = {
90 .cd_type = S3C_SDHCI_CD_GPIO, 90 .cd_type = S3C_SDHCI_CD_GPIO,
91 .ext_cd_gpio = S5PV310_GPK0(2), 91 .ext_cd_gpio = EXYNOS4_GPK0(2),
92 .ext_cd_gpio_invert = 1, 92 .ext_cd_gpio_invert = 1,
93 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, 93 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
94}; 94};
95 95
96static struct s3c_sdhci_platdata smdkc210_hsmmc2_pdata __initdata = { 96static struct s3c_sdhci_platdata smdkc210_hsmmc2_pdata __initdata = {
97 .cd_type = S3C_SDHCI_CD_GPIO, 97 .cd_type = S3C_SDHCI_CD_GPIO,
98 .ext_cd_gpio = S5PV310_GPK2(2), 98 .ext_cd_gpio = EXYNOS4_GPK2(2),
99 .ext_cd_gpio_invert = 1, 99 .ext_cd_gpio_invert = 1,
100 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, 100 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
101#ifdef CONFIG_S5PV310_SDHCI_CH2_8BIT 101#ifdef CONFIG_EXYNOS4_SDHCI_CH2_8BIT
102 .max_width = 8, 102 .max_width = 8,
103 .host_caps = MMC_CAP_8_BIT_DATA, 103 .host_caps = MMC_CAP_8_BIT_DATA,
104#endif 104#endif
@@ -106,15 +106,15 @@ static struct s3c_sdhci_platdata smdkc210_hsmmc2_pdata __initdata = {
106 106
107static struct s3c_sdhci_platdata smdkc210_hsmmc3_pdata __initdata = { 107static struct s3c_sdhci_platdata smdkc210_hsmmc3_pdata __initdata = {
108 .cd_type = S3C_SDHCI_CD_GPIO, 108 .cd_type = S3C_SDHCI_CD_GPIO,
109 .ext_cd_gpio = S5PV310_GPK2(2), 109 .ext_cd_gpio = EXYNOS4_GPK2(2),
110 .ext_cd_gpio_invert = 1, 110 .ext_cd_gpio_invert = 1,
111 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, 111 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
112}; 112};
113 113
114static struct resource smdkc210_smsc911x_resources[] = { 114static struct resource smdkc210_smsc911x_resources[] = {
115 [0] = { 115 [0] = {
116 .start = S5PV310_PA_SROM_BANK(1), 116 .start = EXYNOS4_PA_SROM_BANK(1),
117 .end = S5PV310_PA_SROM_BANK(1) + SZ_64K - 1, 117 .end = EXYNOS4_PA_SROM_BANK(1) + SZ_64K - 1,
118 .flags = IORESOURCE_MEM, 118 .flags = IORESOURCE_MEM,
119 }, 119 },
120 [1] = { 120 [1] = {
@@ -154,16 +154,16 @@ static struct platform_device *smdkc210_devices[] __initdata = {
154 &s3c_device_i2c1, 154 &s3c_device_i2c1,
155 &s3c_device_rtc, 155 &s3c_device_rtc,
156 &s3c_device_wdt, 156 &s3c_device_wdt,
157 &s5pv310_device_ac97, 157 &exynos4_device_ac97,
158 &s5pv310_device_i2s0, 158 &exynos4_device_i2s0,
159 &s5pv310_device_pd[PD_MFC], 159 &exynos4_device_pd[PD_MFC],
160 &s5pv310_device_pd[PD_G3D], 160 &exynos4_device_pd[PD_G3D],
161 &s5pv310_device_pd[PD_LCD0], 161 &exynos4_device_pd[PD_LCD0],
162 &s5pv310_device_pd[PD_LCD1], 162 &exynos4_device_pd[PD_LCD1],
163 &s5pv310_device_pd[PD_CAM], 163 &exynos4_device_pd[PD_CAM],
164 &s5pv310_device_pd[PD_TV], 164 &exynos4_device_pd[PD_TV],
165 &s5pv310_device_pd[PD_GPS], 165 &exynos4_device_pd[PD_GPS],
166 &s5pv310_device_sysmmu, 166 &exynos4_device_sysmmu,
167 &samsung_asoc_dma, 167 &samsung_asoc_dma,
168 &smdkc210_smsc911x, 168 &smdkc210_smsc911x,
169}; 169};
@@ -216,8 +216,8 @@ static void __init smdkc210_machine_init(void)
216MACHINE_START(SMDKC210, "SMDKC210") 216MACHINE_START(SMDKC210, "SMDKC210")
217 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 217 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
218 .boot_params = S5P_PA_SDRAM + 0x100, 218 .boot_params = S5P_PA_SDRAM + 0x100,
219 .init_irq = s5pv310_init_irq, 219 .init_irq = exynos4_init_irq,
220 .map_io = smdkc210_map_io, 220 .map_io = smdkc210_map_io,
221 .init_machine = smdkc210_machine_init, 221 .init_machine = smdkc210_machine_init,
222 .timer = &s5pv310_timer, 222 .timer = &exynos4_timer,
223MACHINE_END 223MACHINE_END
diff --git a/arch/arm/mach-s5pv310/mach-smdkv310.c b/arch/arm/mach-exynos4/mach-smdkv310.c
index b1cddbf3c616..88e0275143be 100644
--- a/arch/arm/mach-s5pv310/mach-smdkv310.c
+++ b/arch/arm/mach-exynos4/mach-smdkv310.c
@@ -1,7 +1,7 @@
1/* linux/arch/arm/mach-s5pv310/mach-smdkv310.c 1/* linux/arch/arm/mach-exynos4/mach-smdkv310.c
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
@@ -15,15 +15,17 @@
15#include <linux/smsc911x.h> 15#include <linux/smsc911x.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/i2c.h> 17#include <linux/i2c.h>
18#include <linux/input.h>
18 19
19#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
20#include <asm/mach-types.h> 21#include <asm/mach-types.h>
21 22
22#include <plat/regs-serial.h> 23#include <plat/regs-serial.h>
23#include <plat/regs-srom.h> 24#include <plat/regs-srom.h>
24#include <plat/s5pv310.h> 25#include <plat/exynos4.h>
25#include <plat/cpu.h> 26#include <plat/cpu.h>
26#include <plat/devs.h> 27#include <plat/devs.h>
28#include <plat/keypad.h>
27#include <plat/sdhci.h> 29#include <plat/sdhci.h>
28#include <plat/iic.h> 30#include <plat/iic.h>
29#include <plat/pd.h> 31#include <plat/pd.h>
@@ -77,10 +79,10 @@ static struct s3c2410_uartcfg smdkv310_uartcfgs[] __initdata = {
77 79
78static struct s3c_sdhci_platdata smdkv310_hsmmc0_pdata __initdata = { 80static struct s3c_sdhci_platdata smdkv310_hsmmc0_pdata __initdata = {
79 .cd_type = S3C_SDHCI_CD_GPIO, 81 .cd_type = S3C_SDHCI_CD_GPIO,
80 .ext_cd_gpio = S5PV310_GPK0(2), 82 .ext_cd_gpio = EXYNOS4_GPK0(2),
81 .ext_cd_gpio_invert = 1, 83 .ext_cd_gpio_invert = 1,
82 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, 84 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
83#ifdef CONFIG_S5PV310_SDHCI_CH0_8BIT 85#ifdef CONFIG_EXYNOS4_SDHCI_CH0_8BIT
84 .max_width = 8, 86 .max_width = 8,
85 .host_caps = MMC_CAP_8_BIT_DATA, 87 .host_caps = MMC_CAP_8_BIT_DATA,
86#endif 88#endif
@@ -88,17 +90,17 @@ static struct s3c_sdhci_platdata smdkv310_hsmmc0_pdata __initdata = {
88 90
89static struct s3c_sdhci_platdata smdkv310_hsmmc1_pdata __initdata = { 91static struct s3c_sdhci_platdata smdkv310_hsmmc1_pdata __initdata = {
90 .cd_type = S3C_SDHCI_CD_GPIO, 92 .cd_type = S3C_SDHCI_CD_GPIO,
91 .ext_cd_gpio = S5PV310_GPK0(2), 93 .ext_cd_gpio = EXYNOS4_GPK0(2),
92 .ext_cd_gpio_invert = 1, 94 .ext_cd_gpio_invert = 1,
93 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, 95 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
94}; 96};
95 97
96static struct s3c_sdhci_platdata smdkv310_hsmmc2_pdata __initdata = { 98static struct s3c_sdhci_platdata smdkv310_hsmmc2_pdata __initdata = {
97 .cd_type = S3C_SDHCI_CD_GPIO, 99 .cd_type = S3C_SDHCI_CD_GPIO,
98 .ext_cd_gpio = S5PV310_GPK2(2), 100 .ext_cd_gpio = EXYNOS4_GPK2(2),
99 .ext_cd_gpio_invert = 1, 101 .ext_cd_gpio_invert = 1,
100 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, 102 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
101#ifdef CONFIG_S5PV310_SDHCI_CH2_8BIT 103#ifdef CONFIG_EXYNOS4_SDHCI_CH2_8BIT
102 .max_width = 8, 104 .max_width = 8,
103 .host_caps = MMC_CAP_8_BIT_DATA, 105 .host_caps = MMC_CAP_8_BIT_DATA,
104#endif 106#endif
@@ -106,15 +108,15 @@ static struct s3c_sdhci_platdata smdkv310_hsmmc2_pdata __initdata = {
106 108
107static struct s3c_sdhci_platdata smdkv310_hsmmc3_pdata __initdata = { 109static struct s3c_sdhci_platdata smdkv310_hsmmc3_pdata __initdata = {
108 .cd_type = S3C_SDHCI_CD_GPIO, 110 .cd_type = S3C_SDHCI_CD_GPIO,
109 .ext_cd_gpio = S5PV310_GPK2(2), 111 .ext_cd_gpio = EXYNOS4_GPK2(2),
110 .ext_cd_gpio_invert = 1, 112 .ext_cd_gpio_invert = 1,
111 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, 113 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
112}; 114};
113 115
114static struct resource smdkv310_smsc911x_resources[] = { 116static struct resource smdkv310_smsc911x_resources[] = {
115 [0] = { 117 [0] = {
116 .start = S5PV310_PA_SROM_BANK(1), 118 .start = EXYNOS4_PA_SROM_BANK(1),
117 .end = S5PV310_PA_SROM_BANK(1) + SZ_64K - 1, 119 .end = EXYNOS4_PA_SROM_BANK(1) + SZ_64K - 1,
118 .flags = IORESOURCE_MEM, 120 .flags = IORESOURCE_MEM,
119 }, 121 },
120 [1] = { 122 [1] = {
@@ -142,6 +144,25 @@ static struct platform_device smdkv310_smsc911x = {
142 }, 144 },
143}; 145};
144 146
147static uint32_t smdkv310_keymap[] __initdata = {
148 /* KEY(row, col, keycode) */
149 KEY(0, 3, KEY_1), KEY(0, 4, KEY_2), KEY(0, 5, KEY_3),
150 KEY(0, 6, KEY_4), KEY(0, 7, KEY_5),
151 KEY(1, 3, KEY_A), KEY(1, 4, KEY_B), KEY(1, 5, KEY_C),
152 KEY(1, 6, KEY_D), KEY(1, 7, KEY_E)
153};
154
155static struct matrix_keymap_data smdkv310_keymap_data __initdata = {
156 .keymap = smdkv310_keymap,
157 .keymap_size = ARRAY_SIZE(smdkv310_keymap),
158};
159
160static struct samsung_keypad_platdata smdkv310_keypad_data __initdata = {
161 .keymap_data = &smdkv310_keymap_data,
162 .rows = 2,
163 .cols = 8,
164};
165
145static struct i2c_board_info i2c_devs1[] __initdata = { 166static struct i2c_board_info i2c_devs1[] __initdata = {
146 {I2C_BOARD_INFO("wm8994", 0x1a),}, 167 {I2C_BOARD_INFO("wm8994", 0x1a),},
147}; 168};
@@ -154,16 +175,17 @@ static struct platform_device *smdkv310_devices[] __initdata = {
154 &s3c_device_i2c1, 175 &s3c_device_i2c1,
155 &s3c_device_rtc, 176 &s3c_device_rtc,
156 &s3c_device_wdt, 177 &s3c_device_wdt,
157 &s5pv310_device_ac97, 178 &exynos4_device_ac97,
158 &s5pv310_device_i2s0, 179 &exynos4_device_i2s0,
159 &s5pv310_device_pd[PD_MFC], 180 &samsung_device_keypad,
160 &s5pv310_device_pd[PD_G3D], 181 &exynos4_device_pd[PD_MFC],
161 &s5pv310_device_pd[PD_LCD0], 182 &exynos4_device_pd[PD_G3D],
162 &s5pv310_device_pd[PD_LCD1], 183 &exynos4_device_pd[PD_LCD0],
163 &s5pv310_device_pd[PD_CAM], 184 &exynos4_device_pd[PD_LCD1],
164 &s5pv310_device_pd[PD_TV], 185 &exynos4_device_pd[PD_CAM],
165 &s5pv310_device_pd[PD_GPS], 186 &exynos4_device_pd[PD_TV],
166 &s5pv310_device_sysmmu, 187 &exynos4_device_pd[PD_GPS],
188 &exynos4_device_sysmmu,
167 &samsung_asoc_dma, 189 &samsung_asoc_dma,
168 &smdkv310_smsc911x, 190 &smdkv310_smsc911x,
169}; 191};
@@ -210,6 +232,8 @@ static void __init smdkv310_machine_init(void)
210 s3c_sdhci2_set_platdata(&smdkv310_hsmmc2_pdata); 232 s3c_sdhci2_set_platdata(&smdkv310_hsmmc2_pdata);
211 s3c_sdhci3_set_platdata(&smdkv310_hsmmc3_pdata); 233 s3c_sdhci3_set_platdata(&smdkv310_hsmmc3_pdata);
212 234
235 samsung_keypad_set_platdata(&smdkv310_keypad_data);
236
213 platform_add_devices(smdkv310_devices, ARRAY_SIZE(smdkv310_devices)); 237 platform_add_devices(smdkv310_devices, ARRAY_SIZE(smdkv310_devices));
214} 238}
215 239
@@ -217,8 +241,8 @@ MACHINE_START(SMDKV310, "SMDKV310")
217 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ 241 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
218 /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */ 242 /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */
219 .boot_params = S5P_PA_SDRAM + 0x100, 243 .boot_params = S5P_PA_SDRAM + 0x100,
220 .init_irq = s5pv310_init_irq, 244 .init_irq = exynos4_init_irq,
221 .map_io = smdkv310_map_io, 245 .map_io = smdkv310_map_io,
222 .init_machine = smdkv310_machine_init, 246 .init_machine = smdkv310_machine_init,
223 .timer = &s5pv310_timer, 247 .timer = &exynos4_timer,
224MACHINE_END 248MACHINE_END
diff --git a/arch/arm/mach-exynos4/mach-universal_c210.c b/arch/arm/mach-exynos4/mach-universal_c210.c
new file mode 100644
index 000000000000..97d329fff2cf
--- /dev/null
+++ b/arch/arm/mach-exynos4/mach-universal_c210.c
@@ -0,0 +1,650 @@
1/* linux/arch/arm/mach-exynos4/mach-universal_c210.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8*/
9
10#include <linux/platform_device.h>
11#include <linux/serial_core.h>
12#include <linux/input.h>
13#include <linux/i2c.h>
14#include <linux/gpio_keys.h>
15#include <linux/gpio.h>
16#include <linux/mfd/max8998.h>
17#include <linux/regulator/machine.h>
18#include <linux/regulator/fixed.h>
19#include <linux/regulator/max8952.h>
20#include <linux/mmc/host.h>
21
22#include <asm/mach/arch.h>
23#include <asm/mach-types.h>
24
25#include <plat/regs-serial.h>
26#include <plat/exynos4.h>
27#include <plat/cpu.h>
28#include <plat/devs.h>
29#include <plat/iic.h>
30#include <plat/sdhci.h>
31
32#include <mach/map.h>
33
34/* Following are default values for UCON, ULCON and UFCON UART registers */
35#define UNIVERSAL_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
36 S3C2410_UCON_RXILEVEL | \
37 S3C2410_UCON_TXIRQMODE | \
38 S3C2410_UCON_RXIRQMODE | \
39 S3C2410_UCON_RXFIFO_TOI | \
40 S3C2443_UCON_RXERR_IRQEN)
41
42#define UNIVERSAL_ULCON_DEFAULT S3C2410_LCON_CS8
43
44#define UNIVERSAL_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
45 S5PV210_UFCON_TXTRIG256 | \
46 S5PV210_UFCON_RXTRIG256)
47
48static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = {
49 [0] = {
50 .hwport = 0,
51 .ucon = UNIVERSAL_UCON_DEFAULT,
52 .ulcon = UNIVERSAL_ULCON_DEFAULT,
53 .ufcon = UNIVERSAL_UFCON_DEFAULT,
54 },
55 [1] = {
56 .hwport = 1,
57 .ucon = UNIVERSAL_UCON_DEFAULT,
58 .ulcon = UNIVERSAL_ULCON_DEFAULT,
59 .ufcon = UNIVERSAL_UFCON_DEFAULT,
60 },
61 [2] = {
62 .hwport = 2,
63 .ucon = UNIVERSAL_UCON_DEFAULT,
64 .ulcon = UNIVERSAL_ULCON_DEFAULT,
65 .ufcon = UNIVERSAL_UFCON_DEFAULT,
66 },
67 [3] = {
68 .hwport = 3,
69 .ucon = UNIVERSAL_UCON_DEFAULT,
70 .ulcon = UNIVERSAL_ULCON_DEFAULT,
71 .ufcon = UNIVERSAL_UFCON_DEFAULT,
72 },
73};
74
75static struct regulator_consumer_supply max8952_consumer =
76 REGULATOR_SUPPLY("vddarm", NULL);
77
78static struct max8952_platform_data universal_max8952_pdata __initdata = {
79 .gpio_vid0 = EXYNOS4_GPX0(3),
80 .gpio_vid1 = EXYNOS4_GPX0(4),
81 .gpio_en = -1, /* Not controllable, set "Always High" */
82 .default_mode = 0, /* vid0 = 0, vid1 = 0 */
83 .dvs_mode = { 48, 32, 28, 18 }, /* 1.25, 1.20, 1.05, 0.95V */
84 .sync_freq = 0, /* default: fastest */
85 .ramp_speed = 0, /* default: fastest */
86
87 .reg_data = {
88 .constraints = {
89 .name = "VARM_1.2V",
90 .min_uV = 770000,
91 .max_uV = 1400000,
92 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
93 .always_on = 1,
94 .boot_on = 1,
95 },
96 .num_consumer_supplies = 1,
97 .consumer_supplies = &max8952_consumer,
98 },
99};
100
101static struct regulator_consumer_supply lp3974_buck1_consumer =
102 REGULATOR_SUPPLY("vddint", NULL);
103
104static struct regulator_consumer_supply lp3974_buck2_consumer =
105 REGULATOR_SUPPLY("vddg3d", NULL);
106
107static struct regulator_init_data lp3974_buck1_data = {
108 .constraints = {
109 .name = "VINT_1.1V",
110 .min_uV = 750000,
111 .max_uV = 1500000,
112 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
113 REGULATOR_CHANGE_STATUS,
114 .boot_on = 1,
115 .state_mem = {
116 .disabled = 1,
117 },
118 },
119 .num_consumer_supplies = 1,
120 .consumer_supplies = &lp3974_buck1_consumer,
121};
122
123static struct regulator_init_data lp3974_buck2_data = {
124 .constraints = {
125 .name = "VG3D_1.1V",
126 .min_uV = 750000,
127 .max_uV = 1500000,
128 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
129 REGULATOR_CHANGE_STATUS,
130 .boot_on = 1,
131 .state_mem = {
132 .disabled = 1,
133 },
134 },
135 .num_consumer_supplies = 1,
136 .consumer_supplies = &lp3974_buck2_consumer,
137};
138
139static struct regulator_init_data lp3974_buck3_data = {
140 .constraints = {
141 .name = "VCC_1.8V",
142 .min_uV = 1800000,
143 .max_uV = 1800000,
144 .apply_uV = 1,
145 .always_on = 1,
146 .state_mem = {
147 .enabled = 1,
148 },
149 },
150};
151
152static struct regulator_init_data lp3974_buck4_data = {
153 .constraints = {
154 .name = "VMEM_1.2V",
155 .min_uV = 1200000,
156 .max_uV = 1200000,
157 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
158 .apply_uV = 1,
159 .state_mem = {
160 .disabled = 1,
161 },
162 },
163};
164
165static struct regulator_init_data lp3974_ldo2_data = {
166 .constraints = {
167 .name = "VALIVE_1.2V",
168 .min_uV = 1200000,
169 .max_uV = 1200000,
170 .apply_uV = 1,
171 .always_on = 1,
172 .state_mem = {
173 .enabled = 1,
174 },
175 },
176};
177
178static struct regulator_init_data lp3974_ldo3_data = {
179 .constraints = {
180 .name = "VUSB+MIPI_1.1V",
181 .min_uV = 1100000,
182 .max_uV = 1100000,
183 .apply_uV = 1,
184 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
185 .state_mem = {
186 .disabled = 1,
187 },
188 },
189};
190
191static struct regulator_init_data lp3974_ldo4_data = {
192 .constraints = {
193 .name = "VADC_3.3V",
194 .min_uV = 3300000,
195 .max_uV = 3300000,
196 .apply_uV = 1,
197 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
198 .state_mem = {
199 .disabled = 1,
200 },
201 },
202};
203
204static struct regulator_init_data lp3974_ldo5_data = {
205 .constraints = {
206 .name = "VTF_2.8V",
207 .min_uV = 2800000,
208 .max_uV = 2800000,
209 .apply_uV = 1,
210 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
211 .state_mem = {
212 .disabled = 1,
213 },
214 },
215};
216
217static struct regulator_init_data lp3974_ldo6_data = {
218 .constraints = {
219 .name = "LDO6",
220 .min_uV = 2000000,
221 .max_uV = 2000000,
222 .apply_uV = 1,
223 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
224 .state_mem = {
225 .disabled = 1,
226 },
227 },
228};
229
230static struct regulator_init_data lp3974_ldo7_data = {
231 .constraints = {
232 .name = "VLCD+VMIPI_1.8V",
233 .min_uV = 1800000,
234 .max_uV = 1800000,
235 .apply_uV = 1,
236 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
237 .state_mem = {
238 .disabled = 1,
239 },
240 },
241};
242
243static struct regulator_init_data lp3974_ldo8_data = {
244 .constraints = {
245 .name = "VUSB+VDAC_3.3V",
246 .min_uV = 3300000,
247 .max_uV = 3300000,
248 .apply_uV = 1,
249 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
250 .state_mem = {
251 .disabled = 1,
252 },
253 },
254};
255
256static struct regulator_init_data lp3974_ldo9_data = {
257 .constraints = {
258 .name = "VCC_2.8V",
259 .min_uV = 2800000,
260 .max_uV = 2800000,
261 .apply_uV = 1,
262 .always_on = 1,
263 .state_mem = {
264 .enabled = 1,
265 },
266 },
267};
268
269static struct regulator_init_data lp3974_ldo10_data = {
270 .constraints = {
271 .name = "VPLL_1.1V",
272 .min_uV = 1100000,
273 .max_uV = 1100000,
274 .boot_on = 1,
275 .apply_uV = 1,
276 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
277 .state_mem = {
278 .disabled = 1,
279 },
280 },
281};
282
283static struct regulator_init_data lp3974_ldo11_data = {
284 .constraints = {
285 .name = "CAM_AF_3.3V",
286 .min_uV = 3300000,
287 .max_uV = 3300000,
288 .apply_uV = 1,
289 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
290 .state_mem = {
291 .disabled = 1,
292 },
293 },
294};
295
296static struct regulator_init_data lp3974_ldo12_data = {
297 .constraints = {
298 .name = "PS_2.8V",
299 .min_uV = 2800000,
300 .max_uV = 2800000,
301 .apply_uV = 1,
302 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
303 .state_mem = {
304 .disabled = 1,
305 },
306 },
307};
308
309static struct regulator_init_data lp3974_ldo13_data = {
310 .constraints = {
311 .name = "VHIC_1.2V",
312 .min_uV = 1200000,
313 .max_uV = 1200000,
314 .apply_uV = 1,
315 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
316 .state_mem = {
317 .disabled = 1,
318 },
319 },
320};
321
322static struct regulator_init_data lp3974_ldo14_data = {
323 .constraints = {
324 .name = "CAM_I_HOST_1.8V",
325 .min_uV = 1800000,
326 .max_uV = 1800000,
327 .apply_uV = 1,
328 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
329 .state_mem = {
330 .disabled = 1,
331 },
332 },
333};
334
335static struct regulator_init_data lp3974_ldo15_data = {
336 .constraints = {
337 .name = "CAM_S_DIG+FM33_CORE_1.2V",
338 .min_uV = 1200000,
339 .max_uV = 1200000,
340 .apply_uV = 1,
341 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
342 .state_mem = {
343 .disabled = 1,
344 },
345 },
346};
347
348static struct regulator_init_data lp3974_ldo16_data = {
349 .constraints = {
350 .name = "CAM_S_ANA_2.8V",
351 .min_uV = 2800000,
352 .max_uV = 2800000,
353 .apply_uV = 1,
354 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
355 .state_mem = {
356 .disabled = 1,
357 },
358 },
359};
360
361static struct regulator_init_data lp3974_ldo17_data = {
362 .constraints = {
363 .name = "VCC_3.0V_LCD",
364 .min_uV = 3000000,
365 .max_uV = 3000000,
366 .apply_uV = 1,
367 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
368 .boot_on = 1,
369 .state_mem = {
370 .disabled = 1,
371 },
372 },
373};
374
375static struct regulator_init_data lp3974_32khz_ap_data = {
376 .constraints = {
377 .name = "32KHz AP",
378 .always_on = 1,
379 .state_mem = {
380 .enabled = 1,
381 },
382 },
383};
384
385static struct regulator_init_data lp3974_32khz_cp_data = {
386 .constraints = {
387 .name = "32KHz CP",
388 .state_mem = {
389 .disabled = 1,
390 },
391 },
392};
393
394static struct regulator_init_data lp3974_vichg_data = {
395 .constraints = {
396 .name = "VICHG",
397 .state_mem = {
398 .disabled = 1,
399 },
400 },
401};
402
403static struct regulator_init_data lp3974_esafeout1_data = {
404 .constraints = {
405 .name = "SAFEOUT1",
406 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
407 .state_mem = {
408 .enabled = 1,
409 },
410 },
411};
412
413static struct regulator_init_data lp3974_esafeout2_data = {
414 .constraints = {
415 .name = "SAFEOUT2",
416 .boot_on = 1,
417 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
418 .state_mem = {
419 .enabled = 1,
420 },
421 },
422};
423
424static struct max8998_regulator_data lp3974_regulators[] = {
425 { MAX8998_LDO2, &lp3974_ldo2_data },
426 { MAX8998_LDO3, &lp3974_ldo3_data },
427 { MAX8998_LDO4, &lp3974_ldo4_data },
428 { MAX8998_LDO5, &lp3974_ldo5_data },
429 { MAX8998_LDO6, &lp3974_ldo6_data },
430 { MAX8998_LDO7, &lp3974_ldo7_data },
431 { MAX8998_LDO8, &lp3974_ldo8_data },
432 { MAX8998_LDO9, &lp3974_ldo9_data },
433 { MAX8998_LDO10, &lp3974_ldo10_data },
434 { MAX8998_LDO11, &lp3974_ldo11_data },
435 { MAX8998_LDO12, &lp3974_ldo12_data },
436 { MAX8998_LDO13, &lp3974_ldo13_data },
437 { MAX8998_LDO14, &lp3974_ldo14_data },
438 { MAX8998_LDO15, &lp3974_ldo15_data },
439 { MAX8998_LDO16, &lp3974_ldo16_data },
440 { MAX8998_LDO17, &lp3974_ldo17_data },
441 { MAX8998_BUCK1, &lp3974_buck1_data },
442 { MAX8998_BUCK2, &lp3974_buck2_data },
443 { MAX8998_BUCK3, &lp3974_buck3_data },
444 { MAX8998_BUCK4, &lp3974_buck4_data },
445 { MAX8998_EN32KHZ_AP, &lp3974_32khz_ap_data },
446 { MAX8998_EN32KHZ_CP, &lp3974_32khz_cp_data },
447 { MAX8998_ENVICHG, &lp3974_vichg_data },
448 { MAX8998_ESAFEOUT1, &lp3974_esafeout1_data },
449 { MAX8998_ESAFEOUT2, &lp3974_esafeout2_data },
450};
451
452static struct max8998_platform_data universal_lp3974_pdata = {
453 .num_regulators = ARRAY_SIZE(lp3974_regulators),
454 .regulators = lp3974_regulators,
455 .buck1_voltage1 = 1100000, /* INT */
456 .buck1_voltage2 = 1000000,
457 .buck1_voltage3 = 1100000,
458 .buck1_voltage4 = 1000000,
459 .buck1_set1 = EXYNOS4_GPX0(5),
460 .buck1_set2 = EXYNOS4_GPX0(6),
461 .buck2_voltage1 = 1200000, /* G3D */
462 .buck2_voltage2 = 1100000,
463 .buck1_default_idx = 0,
464 .buck2_set3 = EXYNOS4_GPE2(0),
465 .buck2_default_idx = 0,
466 .wakeup = true,
467};
468
469/* GPIO I2C 5 (PMIC) */
470static struct i2c_board_info i2c5_devs[] __initdata = {
471 {
472 I2C_BOARD_INFO("max8952", 0xC0 >> 1),
473 .platform_data = &universal_max8952_pdata,
474 }, {
475 I2C_BOARD_INFO("lp3974", 0xCC >> 1),
476 .platform_data = &universal_lp3974_pdata,
477 },
478};
479
480/* GPIO KEYS */
481static struct gpio_keys_button universal_gpio_keys_tables[] = {
482 {
483 .code = KEY_VOLUMEUP,
484 .gpio = EXYNOS4_GPX2(0), /* XEINT16 */
485 .desc = "gpio-keys: KEY_VOLUMEUP",
486 .type = EV_KEY,
487 .active_low = 1,
488 .debounce_interval = 1,
489 }, {
490 .code = KEY_VOLUMEDOWN,
491 .gpio = EXYNOS4_GPX2(1), /* XEINT17 */
492 .desc = "gpio-keys: KEY_VOLUMEDOWN",
493 .type = EV_KEY,
494 .active_low = 1,
495 .debounce_interval = 1,
496 }, {
497 .code = KEY_CONFIG,
498 .gpio = EXYNOS4_GPX2(2), /* XEINT18 */
499 .desc = "gpio-keys: KEY_CONFIG",
500 .type = EV_KEY,
501 .active_low = 1,
502 .debounce_interval = 1,
503 }, {
504 .code = KEY_CAMERA,
505 .gpio = EXYNOS4_GPX2(3), /* XEINT19 */
506 .desc = "gpio-keys: KEY_CAMERA",
507 .type = EV_KEY,
508 .active_low = 1,
509 .debounce_interval = 1,
510 }, {
511 .code = KEY_OK,
512 .gpio = EXYNOS4_GPX3(5), /* XEINT29 */
513 .desc = "gpio-keys: KEY_OK",
514 .type = EV_KEY,
515 .active_low = 1,
516 .debounce_interval = 1,
517 },
518};
519
520static struct gpio_keys_platform_data universal_gpio_keys_data = {
521 .buttons = universal_gpio_keys_tables,
522 .nbuttons = ARRAY_SIZE(universal_gpio_keys_tables),
523};
524
525static struct platform_device universal_gpio_keys = {
526 .name = "gpio-keys",
527 .dev = {
528 .platform_data = &universal_gpio_keys_data,
529 },
530};
531
532/* eMMC */
533static struct s3c_sdhci_platdata universal_hsmmc0_data __initdata = {
534 .max_width = 8,
535 .host_caps = (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA |
536 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
537 MMC_CAP_DISABLE),
538 .cd_type = S3C_SDHCI_CD_PERMANENT,
539 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
540};
541
542static struct regulator_consumer_supply mmc0_supplies[] = {
543 REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"),
544};
545
546static struct regulator_init_data mmc0_fixed_voltage_init_data = {
547 .constraints = {
548 .name = "VMEM_VDD_2.8V",
549 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
550 },
551 .num_consumer_supplies = ARRAY_SIZE(mmc0_supplies),
552 .consumer_supplies = mmc0_supplies,
553};
554
555static struct fixed_voltage_config mmc0_fixed_voltage_config = {
556 .supply_name = "MASSMEMORY_EN",
557 .microvolts = 2800000,
558 .gpio = EXYNOS4_GPE1(3),
559 .enable_high = true,
560 .init_data = &mmc0_fixed_voltage_init_data,
561};
562
563static struct platform_device mmc0_fixed_voltage = {
564 .name = "reg-fixed-voltage",
565 .id = 0,
566 .dev = {
567 .platform_data = &mmc0_fixed_voltage_config,
568 },
569};
570
571/* SD */
572static struct s3c_sdhci_platdata universal_hsmmc2_data __initdata = {
573 .max_width = 4,
574 .host_caps = MMC_CAP_4_BIT_DATA |
575 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
576 MMC_CAP_DISABLE,
577 .ext_cd_gpio = EXYNOS4_GPX3(4), /* XEINT_28 */
578 .ext_cd_gpio_invert = 1,
579 .cd_type = S3C_SDHCI_CD_GPIO,
580 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
581};
582
583/* WiFi */
584static struct s3c_sdhci_platdata universal_hsmmc3_data __initdata = {
585 .max_width = 4,
586 .host_caps = MMC_CAP_4_BIT_DATA |
587 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
588 MMC_CAP_DISABLE,
589 .cd_type = S3C_SDHCI_CD_EXTERNAL,
590};
591
592static void __init universal_sdhci_init(void)
593{
594 s3c_sdhci0_set_platdata(&universal_hsmmc0_data);
595 s3c_sdhci2_set_platdata(&universal_hsmmc2_data);
596 s3c_sdhci3_set_platdata(&universal_hsmmc3_data);
597}
598
599/* I2C0 */
600static struct i2c_board_info i2c0_devs[] __initdata = {
601 /* Camera, To be updated */
602};
603
604/* I2C1 */
605static struct i2c_board_info i2c1_devs[] __initdata = {
606 /* Gyro, To be updated */
607};
608
609static struct platform_device *universal_devices[] __initdata = {
610 /* Samsung Platform Devices */
611 &mmc0_fixed_voltage,
612 &s3c_device_hsmmc0,
613 &s3c_device_hsmmc2,
614 &s3c_device_hsmmc3,
615 &s3c_device_i2c5,
616
617 /* Universal Devices */
618 &universal_gpio_keys,
619 &s5p_device_onenand,
620};
621
622static void __init universal_map_io(void)
623{
624 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
625 s3c24xx_init_clocks(24000000);
626 s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs));
627}
628
629static void __init universal_machine_init(void)
630{
631 universal_sdhci_init();
632
633 i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs));
634 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
635
636 s3c_i2c5_set_platdata(NULL);
637 i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs));
638
639 /* Last */
640 platform_add_devices(universal_devices, ARRAY_SIZE(universal_devices));
641}
642
643MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
644 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
645 .boot_params = S5P_PA_SDRAM + 0x100,
646 .init_irq = exynos4_init_irq,
647 .map_io = universal_map_io,
648 .init_machine = universal_machine_init,
649 .timer = &exynos4_timer,
650MACHINE_END
diff --git a/arch/arm/mach-exynos4/mct.c b/arch/arm/mach-exynos4/mct.c
new file mode 100644
index 000000000000..af82a8fbb68b
--- /dev/null
+++ b/arch/arm/mach-exynos4/mct.c
@@ -0,0 +1,421 @@
1/* linux/arch/arm/mach-exynos4/mct.c
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * EXYNOS4 MCT(Multi-Core Timer) support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/sched.h>
14#include <linux/interrupt.h>
15#include <linux/irq.h>
16#include <linux/err.h>
17#include <linux/clk.h>
18#include <linux/clockchips.h>
19#include <linux/platform_device.h>
20#include <linux/delay.h>
21#include <linux/percpu.h>
22
23#include <mach/map.h>
24#include <mach/regs-mct.h>
25#include <asm/mach/time.h>
26
27static unsigned long clk_cnt_per_tick;
28static unsigned long clk_rate;
29
30struct mct_clock_event_device {
31 struct clock_event_device *evt;
32 void __iomem *base;
33};
34
35struct mct_clock_event_device mct_tick[2];
36
37static void exynos4_mct_write(unsigned int value, void *addr)
38{
39 void __iomem *stat_addr;
40 u32 mask;
41 u32 i;
42
43 __raw_writel(value, addr);
44
45 switch ((u32) addr) {
46 case (u32) EXYNOS4_MCT_G_TCON:
47 stat_addr = EXYNOS4_MCT_G_WSTAT;
48 mask = 1 << 16; /* G_TCON write status */
49 break;
50 case (u32) EXYNOS4_MCT_G_COMP0_L:
51 stat_addr = EXYNOS4_MCT_G_WSTAT;
52 mask = 1 << 0; /* G_COMP0_L write status */
53 break;
54 case (u32) EXYNOS4_MCT_G_COMP0_U:
55 stat_addr = EXYNOS4_MCT_G_WSTAT;
56 mask = 1 << 1; /* G_COMP0_U write status */
57 break;
58 case (u32) EXYNOS4_MCT_G_COMP0_ADD_INCR:
59 stat_addr = EXYNOS4_MCT_G_WSTAT;
60 mask = 1 << 2; /* G_COMP0_ADD_INCR write status */
61 break;
62 case (u32) EXYNOS4_MCT_G_CNT_L:
63 stat_addr = EXYNOS4_MCT_G_CNT_WSTAT;
64 mask = 1 << 0; /* G_CNT_L write status */
65 break;
66 case (u32) EXYNOS4_MCT_G_CNT_U:
67 stat_addr = EXYNOS4_MCT_G_CNT_WSTAT;
68 mask = 1 << 1; /* G_CNT_U write status */
69 break;
70 case (u32)(EXYNOS4_MCT_L0_BASE + MCT_L_TCON_OFFSET):
71 stat_addr = EXYNOS4_MCT_L0_BASE + MCT_L_WSTAT_OFFSET;
72 mask = 1 << 3; /* L0_TCON write status */
73 break;
74 case (u32)(EXYNOS4_MCT_L1_BASE + MCT_L_TCON_OFFSET):
75 stat_addr = EXYNOS4_MCT_L1_BASE + MCT_L_WSTAT_OFFSET;
76 mask = 1 << 3; /* L1_TCON write status */
77 break;
78 case (u32)(EXYNOS4_MCT_L0_BASE + MCT_L_TCNTB_OFFSET):
79 stat_addr = EXYNOS4_MCT_L0_BASE + MCT_L_WSTAT_OFFSET;
80 mask = 1 << 0; /* L0_TCNTB write status */
81 break;
82 case (u32)(EXYNOS4_MCT_L1_BASE + MCT_L_TCNTB_OFFSET):
83 stat_addr = EXYNOS4_MCT_L1_BASE + MCT_L_WSTAT_OFFSET;
84 mask = 1 << 0; /* L1_TCNTB write status */
85 break;
86 case (u32)(EXYNOS4_MCT_L0_BASE + MCT_L_ICNTB_OFFSET):
87 stat_addr = EXYNOS4_MCT_L0_BASE + MCT_L_WSTAT_OFFSET;
88 mask = 1 << 1; /* L0_ICNTB write status */
89 break;
90 case (u32)(EXYNOS4_MCT_L1_BASE + MCT_L_ICNTB_OFFSET):
91 stat_addr = EXYNOS4_MCT_L1_BASE + MCT_L_WSTAT_OFFSET;
92 mask = 1 << 1; /* L1_ICNTB write status */
93 break;
94 default:
95 return;
96 }
97
98 /* Wait maximum 1 ms until written values are applied */
99 for (i = 0; i < loops_per_jiffy / 1000 * HZ; i++)
100 if (__raw_readl(stat_addr) & mask) {
101 __raw_writel(mask, stat_addr);
102 return;
103 }
104
105 panic("MCT hangs after writing %d (addr:0x%08x)\n", value, (u32)addr);
106}
107
108/* Clocksource handling */
109static void exynos4_mct_frc_start(u32 hi, u32 lo)
110{
111 u32 reg;
112
113 exynos4_mct_write(lo, EXYNOS4_MCT_G_CNT_L);
114 exynos4_mct_write(hi, EXYNOS4_MCT_G_CNT_U);
115
116 reg = __raw_readl(EXYNOS4_MCT_G_TCON);
117 reg |= MCT_G_TCON_START;
118 exynos4_mct_write(reg, EXYNOS4_MCT_G_TCON);
119}
120
121static cycle_t exynos4_frc_read(struct clocksource *cs)
122{
123 unsigned int lo, hi;
124 u32 hi2 = __raw_readl(EXYNOS4_MCT_G_CNT_U);
125
126 do {
127 hi = hi2;
128 lo = __raw_readl(EXYNOS4_MCT_G_CNT_L);
129 hi2 = __raw_readl(EXYNOS4_MCT_G_CNT_U);
130 } while (hi != hi2);
131
132 return ((cycle_t)hi << 32) | lo;
133}
134
135struct clocksource mct_frc = {
136 .name = "mct-frc",
137 .rating = 400,
138 .read = exynos4_frc_read,
139 .mask = CLOCKSOURCE_MASK(64),
140 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
141};
142
143static void __init exynos4_clocksource_init(void)
144{
145 exynos4_mct_frc_start(0, 0);
146
147 if (clocksource_register_hz(&mct_frc, clk_rate))
148 panic("%s: can't register clocksource\n", mct_frc.name);
149}
150
151static void exynos4_mct_comp0_stop(void)
152{
153 unsigned int tcon;
154
155 tcon = __raw_readl(EXYNOS4_MCT_G_TCON);
156 tcon &= ~(MCT_G_TCON_COMP0_ENABLE | MCT_G_TCON_COMP0_AUTO_INC);
157
158 exynos4_mct_write(tcon, EXYNOS4_MCT_G_TCON);
159 exynos4_mct_write(0, EXYNOS4_MCT_G_INT_ENB);
160}
161
162static void exynos4_mct_comp0_start(enum clock_event_mode mode,
163 unsigned long cycles)
164{
165 unsigned int tcon;
166 cycle_t comp_cycle;
167
168 tcon = __raw_readl(EXYNOS4_MCT_G_TCON);
169
170 if (mode == CLOCK_EVT_MODE_PERIODIC) {
171 tcon |= MCT_G_TCON_COMP0_AUTO_INC;
172 exynos4_mct_write(cycles, EXYNOS4_MCT_G_COMP0_ADD_INCR);
173 }
174
175 comp_cycle = exynos4_frc_read(&mct_frc) + cycles;
176 exynos4_mct_write((u32)comp_cycle, EXYNOS4_MCT_G_COMP0_L);
177 exynos4_mct_write((u32)(comp_cycle >> 32), EXYNOS4_MCT_G_COMP0_U);
178
179 exynos4_mct_write(0x1, EXYNOS4_MCT_G_INT_ENB);
180
181 tcon |= MCT_G_TCON_COMP0_ENABLE;
182 exynos4_mct_write(tcon , EXYNOS4_MCT_G_TCON);
183}
184
185static int exynos4_comp_set_next_event(unsigned long cycles,
186 struct clock_event_device *evt)
187{
188 exynos4_mct_comp0_start(evt->mode, cycles);
189
190 return 0;
191}
192
193static void exynos4_comp_set_mode(enum clock_event_mode mode,
194 struct clock_event_device *evt)
195{
196 exynos4_mct_comp0_stop();
197
198 switch (mode) {
199 case CLOCK_EVT_MODE_PERIODIC:
200 exynos4_mct_comp0_start(mode, clk_cnt_per_tick);
201 break;
202
203 case CLOCK_EVT_MODE_ONESHOT:
204 case CLOCK_EVT_MODE_UNUSED:
205 case CLOCK_EVT_MODE_SHUTDOWN:
206 case CLOCK_EVT_MODE_RESUME:
207 break;
208 }
209}
210
211static struct clock_event_device mct_comp_device = {
212 .name = "mct-comp",
213 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
214 .rating = 250,
215 .set_next_event = exynos4_comp_set_next_event,
216 .set_mode = exynos4_comp_set_mode,
217};
218
219static irqreturn_t exynos4_mct_comp_isr(int irq, void *dev_id)
220{
221 struct clock_event_device *evt = dev_id;
222
223 exynos4_mct_write(0x1, EXYNOS4_MCT_G_INT_CSTAT);
224
225 evt->event_handler(evt);
226
227 return IRQ_HANDLED;
228}
229
230static struct irqaction mct_comp_event_irq = {
231 .name = "mct_comp_irq",
232 .flags = IRQF_TIMER | IRQF_IRQPOLL,
233 .handler = exynos4_mct_comp_isr,
234 .dev_id = &mct_comp_device,
235};
236
237static void exynos4_clockevent_init(void)
238{
239 clk_cnt_per_tick = clk_rate / 2 / HZ;
240
241 clockevents_calc_mult_shift(&mct_comp_device, clk_rate / 2, 5);
242 mct_comp_device.max_delta_ns =
243 clockevent_delta2ns(0xffffffff, &mct_comp_device);
244 mct_comp_device.min_delta_ns =
245 clockevent_delta2ns(0xf, &mct_comp_device);
246 mct_comp_device.cpumask = cpumask_of(0);
247 clockevents_register_device(&mct_comp_device);
248
249 setup_irq(IRQ_MCT_G0, &mct_comp_event_irq);
250}
251
252#ifdef CONFIG_LOCAL_TIMERS
253/* Clock event handling */
254static void exynos4_mct_tick_stop(struct mct_clock_event_device *mevt)
255{
256 unsigned long tmp;
257 unsigned long mask = MCT_L_TCON_INT_START | MCT_L_TCON_TIMER_START;
258 void __iomem *addr = mevt->base + MCT_L_TCON_OFFSET;
259
260 tmp = __raw_readl(addr);
261 if (tmp & mask) {
262 tmp &= ~mask;
263 exynos4_mct_write(tmp, addr);
264 }
265}
266
267static void exynos4_mct_tick_start(unsigned long cycles,
268 struct mct_clock_event_device *mevt)
269{
270 unsigned long tmp;
271
272 exynos4_mct_tick_stop(mevt);
273
274 tmp = (1 << 31) | cycles; /* MCT_L_UPDATE_ICNTB */
275
276 /* update interrupt count buffer */
277 exynos4_mct_write(tmp, mevt->base + MCT_L_ICNTB_OFFSET);
278
279 /* enable MCT tick interupt */
280 exynos4_mct_write(0x1, mevt->base + MCT_L_INT_ENB_OFFSET);
281
282 tmp = __raw_readl(mevt->base + MCT_L_TCON_OFFSET);
283 tmp |= MCT_L_TCON_INT_START | MCT_L_TCON_TIMER_START |
284 MCT_L_TCON_INTERVAL_MODE;
285 exynos4_mct_write(tmp, mevt->base + MCT_L_TCON_OFFSET);
286}
287
288static int exynos4_tick_set_next_event(unsigned long cycles,
289 struct clock_event_device *evt)
290{
291 struct mct_clock_event_device *mevt = &mct_tick[smp_processor_id()];
292
293 exynos4_mct_tick_start(cycles, mevt);
294
295 return 0;
296}
297
298static inline void exynos4_tick_set_mode(enum clock_event_mode mode,
299 struct clock_event_device *evt)
300{
301 struct mct_clock_event_device *mevt = &mct_tick[smp_processor_id()];
302
303 exynos4_mct_tick_stop(mevt);
304
305 switch (mode) {
306 case CLOCK_EVT_MODE_PERIODIC:
307 exynos4_mct_tick_start(clk_cnt_per_tick, mevt);
308 break;
309
310 case CLOCK_EVT_MODE_ONESHOT:
311 case CLOCK_EVT_MODE_UNUSED:
312 case CLOCK_EVT_MODE_SHUTDOWN:
313 case CLOCK_EVT_MODE_RESUME:
314 break;
315 }
316}
317
318static irqreturn_t exynos4_mct_tick_isr(int irq, void *dev_id)
319{
320 struct mct_clock_event_device *mevt = dev_id;
321 struct clock_event_device *evt = mevt->evt;
322
323 /*
324 * This is for supporting oneshot mode.
325 * Mct would generate interrupt periodically
326 * without explicit stopping.
327 */
328 if (evt->mode != CLOCK_EVT_MODE_PERIODIC)
329 exynos4_mct_tick_stop(mevt);
330
331 /* Clear the MCT tick interrupt */
332 exynos4_mct_write(0x1, mevt->base + MCT_L_INT_CSTAT_OFFSET);
333
334 evt->event_handler(evt);
335
336 return IRQ_HANDLED;
337}
338
339static struct irqaction mct_tick0_event_irq = {
340 .name = "mct_tick0_irq",
341 .flags = IRQF_TIMER | IRQF_NOBALANCING,
342 .handler = exynos4_mct_tick_isr,
343};
344
345static struct irqaction mct_tick1_event_irq = {
346 .name = "mct_tick1_irq",
347 .flags = IRQF_TIMER | IRQF_NOBALANCING,
348 .handler = exynos4_mct_tick_isr,
349};
350
351static void exynos4_mct_tick_init(struct clock_event_device *evt)
352{
353 unsigned int cpu = smp_processor_id();
354
355 mct_tick[cpu].evt = evt;
356
357 if (cpu == 0) {
358 mct_tick[cpu].base = EXYNOS4_MCT_L0_BASE;
359 evt->name = "mct_tick0";
360 } else {
361 mct_tick[cpu].base = EXYNOS4_MCT_L1_BASE;
362 evt->name = "mct_tick1";
363 }
364
365 evt->cpumask = cpumask_of(cpu);
366 evt->set_next_event = exynos4_tick_set_next_event;
367 evt->set_mode = exynos4_tick_set_mode;
368 evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
369 evt->rating = 450;
370
371 clockevents_calc_mult_shift(evt, clk_rate / 2, 5);
372 evt->max_delta_ns =
373 clockevent_delta2ns(0x7fffffff, evt);
374 evt->min_delta_ns =
375 clockevent_delta2ns(0xf, evt);
376
377 clockevents_register_device(evt);
378
379 exynos4_mct_write(0x1, mct_tick[cpu].base + MCT_L_TCNTB_OFFSET);
380
381 if (cpu == 0) {
382 mct_tick0_event_irq.dev_id = &mct_tick[cpu];
383 setup_irq(IRQ_MCT_L0, &mct_tick0_event_irq);
384 } else {
385 mct_tick1_event_irq.dev_id = &mct_tick[cpu];
386 irq_set_affinity(IRQ_MCT1, cpumask_of(1));
387 setup_irq(IRQ_MCT_L1, &mct_tick1_event_irq);
388 }
389}
390
391/* Setup the local clock events for a CPU */
392void __cpuinit local_timer_setup(struct clock_event_device *evt)
393{
394 exynos4_mct_tick_init(evt);
395}
396
397int local_timer_ack(void)
398{
399 return 0;
400}
401
402#endif /* CONFIG_LOCAL_TIMERS */
403
404static void __init exynos4_timer_resources(void)
405{
406 struct clk *mct_clk;
407 mct_clk = clk_get(NULL, "xtal");
408
409 clk_rate = clk_get_rate(mct_clk);
410}
411
412static void __init exynos4_timer_init(void)
413{
414 exynos4_timer_resources();
415 exynos4_clocksource_init();
416 exynos4_clockevent_init();
417}
418
419struct sys_timer exynos4_timer = {
420 .init = exynos4_timer_init,
421};
diff --git a/arch/arm/mach-s5pv310/platsmp.c b/arch/arm/mach-exynos4/platsmp.c
index 34093b069f67..6d35878ec1aa 100644
--- a/arch/arm/mach-s5pv310/platsmp.c
+++ b/arch/arm/mach-exynos4/platsmp.c
@@ -1,7 +1,7 @@
1/* linux/arch/arm/mach-s5pv310/platsmp.c 1/* linux/arch/arm/mach-exynos4/platsmp.c
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * Cloned from linux/arch/arm/mach-vexpress/platsmp.c 6 * Cloned from linux/arch/arm/mach-vexpress/platsmp.c
7 * 7 *
@@ -28,7 +28,7 @@
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <mach/regs-clock.h> 29#include <mach/regs-clock.h>
30 30
31extern void s5pv310_secondary_startup(void); 31extern void exynos4_secondary_startup(void);
32 32
33/* 33/*
34 * control for which core is the next to come out of the secondary 34 * control for which core is the next to come out of the secondary
@@ -139,7 +139,7 @@ void __init smp_init_cpus(void)
139 /* sanity check */ 139 /* sanity check */
140 if (ncores > NR_CPUS) { 140 if (ncores > NR_CPUS) {
141 printk(KERN_WARNING 141 printk(KERN_WARNING
142 "S5PV310: no. of cores (%d) greater than configured " 142 "EXYNOS4: no. of cores (%d) greater than configured "
143 "maximum of %d - clipping\n", 143 "maximum of %d - clipping\n",
144 ncores, NR_CPUS); 144 ncores, NR_CPUS);
145 ncores = NR_CPUS; 145 ncores = NR_CPUS;
@@ -168,5 +168,5 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
168 * until it receives a soft interrupt, and then the 168 * until it receives a soft interrupt, and then the
169 * secondary CPU branches to this address. 169 * secondary CPU branches to this address.
170 */ 170 */
171 __raw_writel(BSYM(virt_to_phys(s5pv310_secondary_startup)), S5P_VA_SYSRAM); 171 __raw_writel(BSYM(virt_to_phys(exynos4_secondary_startup)), S5P_VA_SYSRAM);
172} 172}
diff --git a/arch/arm/mach-exynos4/pm.c b/arch/arm/mach-exynos4/pm.c
new file mode 100644
index 000000000000..10d917d9e3ad
--- /dev/null
+++ b/arch/arm/mach-exynos4/pm.c
@@ -0,0 +1,420 @@
1/* linux/arch/arm/mach-exynos4/pm.c
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * EXYNOS4210 - Power Management support
7 *
8 * Based on arch/arm/mach-s3c2410/pm.c
9 * Copyright (c) 2006 Simtec Electronics
10 * Ben Dooks <ben@simtec.co.uk>
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15*/
16
17#include <linux/init.h>
18#include <linux/suspend.h>
19#include <linux/io.h>
20
21#include <asm/cacheflush.h>
22#include <asm/hardware/cache-l2x0.h>
23
24#include <plat/cpu.h>
25#include <plat/pm.h>
26
27#include <mach/regs-irq.h>
28#include <mach/regs-gpio.h>
29#include <mach/regs-clock.h>
30#include <mach/regs-pmu.h>
31#include <mach/pm-core.h>
32
33static struct sleep_save exynos4_sleep[] = {
34 { .reg = S5P_ARM_CORE0_LOWPWR , .val = 0x2, },
35 { .reg = S5P_DIS_IRQ_CORE0 , .val = 0x0, },
36 { .reg = S5P_DIS_IRQ_CENTRAL0 , .val = 0x0, },
37 { .reg = S5P_ARM_CORE1_LOWPWR , .val = 0x2, },
38 { .reg = S5P_DIS_IRQ_CORE1 , .val = 0x0, },
39 { .reg = S5P_DIS_IRQ_CENTRAL1 , .val = 0x0, },
40 { .reg = S5P_ARM_COMMON_LOWPWR , .val = 0x2, },
41 { .reg = S5P_L2_0_LOWPWR , .val = 0x3, },
42 { .reg = S5P_L2_1_LOWPWR , .val = 0x3, },
43 { .reg = S5P_CMU_ACLKSTOP_LOWPWR , .val = 0x0, },
44 { .reg = S5P_CMU_SCLKSTOP_LOWPWR , .val = 0x0, },
45 { .reg = S5P_CMU_RESET_LOWPWR , .val = 0x0, },
46 { .reg = S5P_APLL_SYSCLK_LOWPWR , .val = 0x0, },
47 { .reg = S5P_MPLL_SYSCLK_LOWPWR , .val = 0x0, },
48 { .reg = S5P_VPLL_SYSCLK_LOWPWR , .val = 0x0, },
49 { .reg = S5P_EPLL_SYSCLK_LOWPWR , .val = 0x0, },
50 { .reg = S5P_CMU_CLKSTOP_GPS_ALIVE_LOWPWR , .val = 0x0, },
51 { .reg = S5P_CMU_RESET_GPSALIVE_LOWPWR , .val = 0x0, },
52 { .reg = S5P_CMU_CLKSTOP_CAM_LOWPWR , .val = 0x0, },
53 { .reg = S5P_CMU_CLKSTOP_TV_LOWPWR , .val = 0x0, },
54 { .reg = S5P_CMU_CLKSTOP_MFC_LOWPWR , .val = 0x0, },
55 { .reg = S5P_CMU_CLKSTOP_G3D_LOWPWR , .val = 0x0, },
56 { .reg = S5P_CMU_CLKSTOP_LCD0_LOWPWR , .val = 0x0, },
57 { .reg = S5P_CMU_CLKSTOP_LCD1_LOWPWR , .val = 0x0, },
58 { .reg = S5P_CMU_CLKSTOP_MAUDIO_LOWPWR , .val = 0x0, },
59 { .reg = S5P_CMU_CLKSTOP_GPS_LOWPWR , .val = 0x0, },
60 { .reg = S5P_CMU_RESET_CAM_LOWPWR , .val = 0x0, },
61 { .reg = S5P_CMU_RESET_TV_LOWPWR , .val = 0x0, },
62 { .reg = S5P_CMU_RESET_MFC_LOWPWR , .val = 0x0, },
63 { .reg = S5P_CMU_RESET_G3D_LOWPWR , .val = 0x0, },
64 { .reg = S5P_CMU_RESET_LCD0_LOWPWR , .val = 0x0, },
65 { .reg = S5P_CMU_RESET_LCD1_LOWPWR , .val = 0x0, },
66 { .reg = S5P_CMU_RESET_MAUDIO_LOWPWR , .val = 0x0, },
67 { .reg = S5P_CMU_RESET_GPS_LOWPWR , .val = 0x0, },
68 { .reg = S5P_TOP_BUS_LOWPWR , .val = 0x0, },
69 { .reg = S5P_TOP_RETENTION_LOWPWR , .val = 0x1, },
70 { .reg = S5P_TOP_PWR_LOWPWR , .val = 0x3, },
71 { .reg = S5P_LOGIC_RESET_LOWPWR , .val = 0x0, },
72 { .reg = S5P_ONENAND_MEM_LOWPWR , .val = 0x0, },
73 { .reg = S5P_MODIMIF_MEM_LOWPWR , .val = 0x0, },
74 { .reg = S5P_G2D_ACP_MEM_LOWPWR , .val = 0x0, },
75 { .reg = S5P_USBOTG_MEM_LOWPWR , .val = 0x0, },
76 { .reg = S5P_HSMMC_MEM_LOWPWR , .val = 0x0, },
77 { .reg = S5P_CSSYS_MEM_LOWPWR , .val = 0x0, },
78 { .reg = S5P_SECSS_MEM_LOWPWR , .val = 0x0, },
79 { .reg = S5P_PCIE_MEM_LOWPWR , .val = 0x0, },
80 { .reg = S5P_SATA_MEM_LOWPWR , .val = 0x0, },
81 { .reg = S5P_PAD_RETENTION_DRAM_LOWPWR , .val = 0x0, },
82 { .reg = S5P_PAD_RETENTION_MAUDIO_LOWPWR , .val = 0x0, },
83 { .reg = S5P_PAD_RETENTION_GPIO_LOWPWR , .val = 0x0, },
84 { .reg = S5P_PAD_RETENTION_UART_LOWPWR , .val = 0x0, },
85 { .reg = S5P_PAD_RETENTION_MMCA_LOWPWR , .val = 0x0, },
86 { .reg = S5P_PAD_RETENTION_MMCB_LOWPWR , .val = 0x0, },
87 { .reg = S5P_PAD_RETENTION_EBIA_LOWPWR , .val = 0x0, },
88 { .reg = S5P_PAD_RETENTION_EBIB_LOWPWR , .val = 0x0, },
89 { .reg = S5P_PAD_RETENTION_ISOLATION_LOWPWR , .val = 0x0, },
90 { .reg = S5P_PAD_RETENTION_ALV_SEL_LOWPWR , .val = 0x0, },
91 { .reg = S5P_XUSBXTI_LOWPWR , .val = 0x0, },
92 { .reg = S5P_XXTI_LOWPWR , .val = 0x0, },
93 { .reg = S5P_EXT_REGULATOR_LOWPWR , .val = 0x0, },
94 { .reg = S5P_GPIO_MODE_LOWPWR , .val = 0x0, },
95 { .reg = S5P_GPIO_MODE_MAUDIO_LOWPWR , .val = 0x0, },
96 { .reg = S5P_CAM_LOWPWR , .val = 0x0, },
97 { .reg = S5P_TV_LOWPWR , .val = 0x0, },
98 { .reg = S5P_MFC_LOWPWR , .val = 0x0, },
99 { .reg = S5P_G3D_LOWPWR , .val = 0x0, },
100 { .reg = S5P_LCD0_LOWPWR , .val = 0x0, },
101 { .reg = S5P_LCD1_LOWPWR , .val = 0x0, },
102 { .reg = S5P_MAUDIO_LOWPWR , .val = 0x0, },
103 { .reg = S5P_GPS_LOWPWR , .val = 0x0, },
104 { .reg = S5P_GPS_ALIVE_LOWPWR , .val = 0x0, },
105};
106
107static struct sleep_save exynos4_set_clksrc[] = {
108 { .reg = S5P_CLKSRC_MASK_TOP , .val = 0x00000001, },
109 { .reg = S5P_CLKSRC_MASK_CAM , .val = 0x11111111, },
110 { .reg = S5P_CLKSRC_MASK_TV , .val = 0x00000111, },
111 { .reg = S5P_CLKSRC_MASK_LCD0 , .val = 0x00001111, },
112 { .reg = S5P_CLKSRC_MASK_LCD1 , .val = 0x00001111, },
113 { .reg = S5P_CLKSRC_MASK_MAUDIO , .val = 0x00000001, },
114 { .reg = S5P_CLKSRC_MASK_FSYS , .val = 0x01011111, },
115 { .reg = S5P_CLKSRC_MASK_PERIL0 , .val = 0x01111111, },
116 { .reg = S5P_CLKSRC_MASK_PERIL1 , .val = 0x01110111, },
117 { .reg = S5P_CLKSRC_MASK_DMC , .val = 0x00010000, },
118};
119
120static struct sleep_save exynos4_core_save[] = {
121 /* CMU side */
122 SAVE_ITEM(S5P_CLKDIV_LEFTBUS),
123 SAVE_ITEM(S5P_CLKGATE_IP_LEFTBUS),
124 SAVE_ITEM(S5P_CLKDIV_RIGHTBUS),
125 SAVE_ITEM(S5P_CLKGATE_IP_RIGHTBUS),
126 SAVE_ITEM(S5P_EPLL_CON0),
127 SAVE_ITEM(S5P_EPLL_CON1),
128 SAVE_ITEM(S5P_VPLL_CON0),
129 SAVE_ITEM(S5P_VPLL_CON1),
130 SAVE_ITEM(S5P_CLKSRC_TOP0),
131 SAVE_ITEM(S5P_CLKSRC_TOP1),
132 SAVE_ITEM(S5P_CLKSRC_CAM),
133 SAVE_ITEM(S5P_CLKSRC_MFC),
134 SAVE_ITEM(S5P_CLKSRC_IMAGE),
135 SAVE_ITEM(S5P_CLKSRC_LCD0),
136 SAVE_ITEM(S5P_CLKSRC_LCD1),
137 SAVE_ITEM(S5P_CLKSRC_MAUDIO),
138 SAVE_ITEM(S5P_CLKSRC_FSYS),
139 SAVE_ITEM(S5P_CLKSRC_PERIL0),
140 SAVE_ITEM(S5P_CLKSRC_PERIL1),
141 SAVE_ITEM(S5P_CLKDIV_CAM),
142 SAVE_ITEM(S5P_CLKDIV_TV),
143 SAVE_ITEM(S5P_CLKDIV_MFC),
144 SAVE_ITEM(S5P_CLKDIV_G3D),
145 SAVE_ITEM(S5P_CLKDIV_IMAGE),
146 SAVE_ITEM(S5P_CLKDIV_LCD0),
147 SAVE_ITEM(S5P_CLKDIV_LCD1),
148 SAVE_ITEM(S5P_CLKDIV_MAUDIO),
149 SAVE_ITEM(S5P_CLKDIV_FSYS0),
150 SAVE_ITEM(S5P_CLKDIV_FSYS1),
151 SAVE_ITEM(S5P_CLKDIV_FSYS2),
152 SAVE_ITEM(S5P_CLKDIV_FSYS3),
153 SAVE_ITEM(S5P_CLKDIV_PERIL0),
154 SAVE_ITEM(S5P_CLKDIV_PERIL1),
155 SAVE_ITEM(S5P_CLKDIV_PERIL2),
156 SAVE_ITEM(S5P_CLKDIV_PERIL3),
157 SAVE_ITEM(S5P_CLKDIV_PERIL4),
158 SAVE_ITEM(S5P_CLKDIV_PERIL5),
159 SAVE_ITEM(S5P_CLKDIV_TOP),
160 SAVE_ITEM(S5P_CLKSRC_MASK_CAM),
161 SAVE_ITEM(S5P_CLKSRC_MASK_TV),
162 SAVE_ITEM(S5P_CLKSRC_MASK_LCD0),
163 SAVE_ITEM(S5P_CLKSRC_MASK_LCD1),
164 SAVE_ITEM(S5P_CLKSRC_MASK_MAUDIO),
165 SAVE_ITEM(S5P_CLKSRC_MASK_FSYS),
166 SAVE_ITEM(S5P_CLKSRC_MASK_PERIL0),
167 SAVE_ITEM(S5P_CLKSRC_MASK_PERIL1),
168 SAVE_ITEM(S5P_CLKGATE_SCLKCAM),
169 SAVE_ITEM(S5P_CLKGATE_IP_CAM),
170 SAVE_ITEM(S5P_CLKGATE_IP_TV),
171 SAVE_ITEM(S5P_CLKGATE_IP_MFC),
172 SAVE_ITEM(S5P_CLKGATE_IP_G3D),
173 SAVE_ITEM(S5P_CLKGATE_IP_IMAGE),
174 SAVE_ITEM(S5P_CLKGATE_IP_LCD0),
175 SAVE_ITEM(S5P_CLKGATE_IP_LCD1),
176 SAVE_ITEM(S5P_CLKGATE_IP_FSYS),
177 SAVE_ITEM(S5P_CLKGATE_IP_GPS),
178 SAVE_ITEM(S5P_CLKGATE_IP_PERIL),
179 SAVE_ITEM(S5P_CLKGATE_IP_PERIR),
180 SAVE_ITEM(S5P_CLKGATE_BLOCK),
181 SAVE_ITEM(S5P_CLKSRC_MASK_DMC),
182 SAVE_ITEM(S5P_CLKSRC_DMC),
183 SAVE_ITEM(S5P_CLKDIV_DMC0),
184 SAVE_ITEM(S5P_CLKDIV_DMC1),
185 SAVE_ITEM(S5P_CLKGATE_IP_DMC),
186 SAVE_ITEM(S5P_CLKSRC_CPU),
187 SAVE_ITEM(S5P_CLKDIV_CPU),
188 SAVE_ITEM(S5P_CLKGATE_SCLKCPU),
189 SAVE_ITEM(S5P_CLKGATE_IP_CPU),
190 /* GIC side */
191 SAVE_ITEM(S5P_VA_GIC_CPU + 0x000),
192 SAVE_ITEM(S5P_VA_GIC_CPU + 0x004),
193 SAVE_ITEM(S5P_VA_GIC_CPU + 0x008),
194 SAVE_ITEM(S5P_VA_GIC_CPU + 0x00C),
195 SAVE_ITEM(S5P_VA_GIC_CPU + 0x014),
196 SAVE_ITEM(S5P_VA_GIC_CPU + 0x018),
197 SAVE_ITEM(S5P_VA_GIC_DIST + 0x000),
198 SAVE_ITEM(S5P_VA_GIC_DIST + 0x004),
199 SAVE_ITEM(S5P_VA_GIC_DIST + 0x100),
200 SAVE_ITEM(S5P_VA_GIC_DIST + 0x104),
201 SAVE_ITEM(S5P_VA_GIC_DIST + 0x108),
202 SAVE_ITEM(S5P_VA_GIC_DIST + 0x300),
203 SAVE_ITEM(S5P_VA_GIC_DIST + 0x304),
204 SAVE_ITEM(S5P_VA_GIC_DIST + 0x308),
205 SAVE_ITEM(S5P_VA_GIC_DIST + 0x400),
206 SAVE_ITEM(S5P_VA_GIC_DIST + 0x404),
207 SAVE_ITEM(S5P_VA_GIC_DIST + 0x408),
208 SAVE_ITEM(S5P_VA_GIC_DIST + 0x40C),
209 SAVE_ITEM(S5P_VA_GIC_DIST + 0x410),
210 SAVE_ITEM(S5P_VA_GIC_DIST + 0x414),
211 SAVE_ITEM(S5P_VA_GIC_DIST + 0x418),
212 SAVE_ITEM(S5P_VA_GIC_DIST + 0x41C),
213 SAVE_ITEM(S5P_VA_GIC_DIST + 0x420),
214 SAVE_ITEM(S5P_VA_GIC_DIST + 0x424),
215 SAVE_ITEM(S5P_VA_GIC_DIST + 0x428),
216 SAVE_ITEM(S5P_VA_GIC_DIST + 0x42C),
217 SAVE_ITEM(S5P_VA_GIC_DIST + 0x430),
218 SAVE_ITEM(S5P_VA_GIC_DIST + 0x434),
219 SAVE_ITEM(S5P_VA_GIC_DIST + 0x438),
220 SAVE_ITEM(S5P_VA_GIC_DIST + 0x43C),
221 SAVE_ITEM(S5P_VA_GIC_DIST + 0x440),
222 SAVE_ITEM(S5P_VA_GIC_DIST + 0x444),
223 SAVE_ITEM(S5P_VA_GIC_DIST + 0x448),
224 SAVE_ITEM(S5P_VA_GIC_DIST + 0x44C),
225 SAVE_ITEM(S5P_VA_GIC_DIST + 0x450),
226 SAVE_ITEM(S5P_VA_GIC_DIST + 0x454),
227 SAVE_ITEM(S5P_VA_GIC_DIST + 0x458),
228 SAVE_ITEM(S5P_VA_GIC_DIST + 0x45C),
229
230 SAVE_ITEM(S5P_VA_GIC_DIST + 0x800),
231 SAVE_ITEM(S5P_VA_GIC_DIST + 0x804),
232 SAVE_ITEM(S5P_VA_GIC_DIST + 0x808),
233 SAVE_ITEM(S5P_VA_GIC_DIST + 0x80C),
234 SAVE_ITEM(S5P_VA_GIC_DIST + 0x810),
235 SAVE_ITEM(S5P_VA_GIC_DIST + 0x814),
236 SAVE_ITEM(S5P_VA_GIC_DIST + 0x818),
237 SAVE_ITEM(S5P_VA_GIC_DIST + 0x81C),
238 SAVE_ITEM(S5P_VA_GIC_DIST + 0x820),
239 SAVE_ITEM(S5P_VA_GIC_DIST + 0x824),
240 SAVE_ITEM(S5P_VA_GIC_DIST + 0x828),
241 SAVE_ITEM(S5P_VA_GIC_DIST + 0x82C),
242 SAVE_ITEM(S5P_VA_GIC_DIST + 0x830),
243 SAVE_ITEM(S5P_VA_GIC_DIST + 0x834),
244 SAVE_ITEM(S5P_VA_GIC_DIST + 0x838),
245 SAVE_ITEM(S5P_VA_GIC_DIST + 0x83C),
246 SAVE_ITEM(S5P_VA_GIC_DIST + 0x840),
247 SAVE_ITEM(S5P_VA_GIC_DIST + 0x844),
248 SAVE_ITEM(S5P_VA_GIC_DIST + 0x848),
249 SAVE_ITEM(S5P_VA_GIC_DIST + 0x84C),
250 SAVE_ITEM(S5P_VA_GIC_DIST + 0x850),
251 SAVE_ITEM(S5P_VA_GIC_DIST + 0x854),
252 SAVE_ITEM(S5P_VA_GIC_DIST + 0x858),
253 SAVE_ITEM(S5P_VA_GIC_DIST + 0x85C),
254
255 SAVE_ITEM(S5P_VA_GIC_DIST + 0xC00),
256 SAVE_ITEM(S5P_VA_GIC_DIST + 0xC04),
257 SAVE_ITEM(S5P_VA_GIC_DIST + 0xC08),
258 SAVE_ITEM(S5P_VA_GIC_DIST + 0xC0C),
259 SAVE_ITEM(S5P_VA_GIC_DIST + 0xC10),
260 SAVE_ITEM(S5P_VA_GIC_DIST + 0xC14),
261
262 SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x000),
263 SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x010),
264 SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x020),
265 SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x030),
266 SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x040),
267 SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x050),
268 SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x060),
269 SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x070),
270 SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x080),
271 SAVE_ITEM(S5P_VA_COMBINER_BASE + 0x090),
272};
273
274static struct sleep_save exynos4_l2cc_save[] = {
275 SAVE_ITEM(S5P_VA_L2CC + L2X0_TAG_LATENCY_CTRL),
276 SAVE_ITEM(S5P_VA_L2CC + L2X0_DATA_LATENCY_CTRL),
277 SAVE_ITEM(S5P_VA_L2CC + L2X0_PREFETCH_CTRL),
278 SAVE_ITEM(S5P_VA_L2CC + L2X0_POWER_CTRL),
279 SAVE_ITEM(S5P_VA_L2CC + L2X0_AUX_CTRL),
280};
281
282void exynos4_cpu_suspend(void)
283{
284 unsigned long tmp;
285 unsigned long mask = 0xFFFFFFFF;
286
287 /* Setting Central Sequence Register for power down mode */
288
289 tmp = __raw_readl(S5P_CENTRAL_SEQ_CONFIGURATION);
290 tmp &= ~(S5P_CENTRAL_LOWPWR_CFG);
291 __raw_writel(tmp, S5P_CENTRAL_SEQ_CONFIGURATION);
292
293 /* Setting Central Sequence option Register */
294
295 tmp = __raw_readl(S5P_CENTRAL_SEQ_OPTION);
296 tmp &= ~(S5P_USE_MASK);
297 tmp |= S5P_USE_STANDBY_WFI0;
298 __raw_writel(tmp, S5P_CENTRAL_SEQ_OPTION);
299
300 /* Clear all interrupt pending to avoid early wakeup */
301
302 __raw_writel(mask, (S5P_VA_GIC_DIST + 0x280));
303 __raw_writel(mask, (S5P_VA_GIC_DIST + 0x284));
304 __raw_writel(mask, (S5P_VA_GIC_DIST + 0x288));
305
306 /* Disable all interrupt */
307
308 __raw_writel(0x0, (S5P_VA_GIC_CPU + 0x000));
309 __raw_writel(0x0, (S5P_VA_GIC_DIST + 0x000));
310 __raw_writel(mask, (S5P_VA_GIC_DIST + 0x184));
311 __raw_writel(mask, (S5P_VA_GIC_DIST + 0x188));
312
313 outer_flush_all();
314
315 /* issue the standby signal into the pm unit. */
316 cpu_do_idle();
317
318 /* we should never get past here */
319 panic("sleep resumed to originator?");
320}
321
322static void exynos4_pm_prepare(void)
323{
324 u32 tmp;
325
326 s3c_pm_do_save(exynos4_core_save, ARRAY_SIZE(exynos4_core_save));
327 s3c_pm_do_save(exynos4_l2cc_save, ARRAY_SIZE(exynos4_l2cc_save));
328
329 tmp = __raw_readl(S5P_INFORM1);
330
331 /* Set value of power down register for sleep mode */
332
333 s3c_pm_do_restore_core(exynos4_sleep, ARRAY_SIZE(exynos4_sleep));
334 __raw_writel(S5P_CHECK_SLEEP, S5P_INFORM1);
335
336 /* ensure at least INFORM0 has the resume address */
337
338 __raw_writel(virt_to_phys(s3c_cpu_resume), S5P_INFORM0);
339
340 /* Before enter central sequence mode, clock src register have to set */
341
342 s3c_pm_do_restore_core(exynos4_set_clksrc, ARRAY_SIZE(exynos4_set_clksrc));
343
344}
345
346static int exynos4_pm_add(struct sys_device *sysdev)
347{
348 pm_cpu_prep = exynos4_pm_prepare;
349 pm_cpu_sleep = exynos4_cpu_suspend;
350
351 return 0;
352}
353
354/* This function copy from linux/arch/arm/kernel/smp_scu.c */
355
356void exynos4_scu_enable(void __iomem *scu_base)
357{
358 u32 scu_ctrl;
359
360 scu_ctrl = __raw_readl(scu_base);
361 /* already enabled? */
362 if (scu_ctrl & 1)
363 return;
364
365 scu_ctrl |= 1;
366 __raw_writel(scu_ctrl, scu_base);
367
368 /*
369 * Ensure that the data accessed by CPU0 before the SCU was
370 * initialised is visible to the other CPUs.
371 */
372 flush_cache_all();
373}
374
375static int exynos4_pm_resume(struct sys_device *dev)
376{
377 /* For release retention */
378
379 __raw_writel((1 << 28), S5P_PAD_RET_MAUDIO_OPTION);
380 __raw_writel((1 << 28), S5P_PAD_RET_GPIO_OPTION);
381 __raw_writel((1 << 28), S5P_PAD_RET_UART_OPTION);
382 __raw_writel((1 << 28), S5P_PAD_RET_MMCA_OPTION);
383 __raw_writel((1 << 28), S5P_PAD_RET_MMCB_OPTION);
384 __raw_writel((1 << 28), S5P_PAD_RET_EBIA_OPTION);
385 __raw_writel((1 << 28), S5P_PAD_RET_EBIB_OPTION);
386
387 s3c_pm_do_restore_core(exynos4_core_save, ARRAY_SIZE(exynos4_core_save));
388
389 exynos4_scu_enable(S5P_VA_SCU);
390
391#ifdef CONFIG_CACHE_L2X0
392 s3c_pm_do_restore_core(exynos4_l2cc_save, ARRAY_SIZE(exynos4_l2cc_save));
393 outer_inv_all();
394 /* enable L2X0*/
395 writel_relaxed(1, S5P_VA_L2CC + L2X0_CTRL);
396#endif
397
398 return 0;
399}
400
401static struct sysdev_driver exynos4_pm_driver = {
402 .add = exynos4_pm_add,
403 .resume = exynos4_pm_resume,
404};
405
406static __init int exynos4_pm_drvinit(void)
407{
408 unsigned int tmp;
409
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}
420arch_initcall(exynos4_pm_drvinit);
diff --git a/arch/arm/mach-exynos4/setup-fimc.c b/arch/arm/mach-exynos4/setup-fimc.c
new file mode 100644
index 000000000000..6a45078d9d12
--- /dev/null
+++ b/arch/arm/mach-exynos4/setup-fimc.c
@@ -0,0 +1,44 @@
1/*
2 * Copyright (C) 2011 Samsung Electronics Co., Ltd.
3 *
4 * Exynos4 camera interface GPIO configuration.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/gpio.h>
12#include <plat/gpio-cfg.h>
13#include <plat/camport.h>
14
15int exynos4_fimc_setup_gpio(enum s5p_camport_id id)
16{
17 u32 gpio8, gpio5;
18 u32 sfn;
19 int ret;
20
21 switch (id) {
22 case S5P_CAMPORT_A:
23 gpio8 = EXYNOS4_GPJ0(0); /* PCLK, VSYNC, HREF, DATA[0:4] */
24 gpio5 = EXYNOS4_GPJ1(0); /* DATA[5:7], CLKOUT, FIELD */
25 sfn = S3C_GPIO_SFN(2);
26 break;
27
28 case S5P_CAMPORT_B:
29 gpio8 = EXYNOS4_GPE0(0); /* DATA[0:7] */
30 gpio5 = EXYNOS4_GPE1(0); /* PCLK, VSYNC, HREF, CLKOUT, FIELD */
31 sfn = S3C_GPIO_SFN(3);
32 break;
33
34 default:
35 WARN(1, "Wrong camport id: %d\n", id);
36 return -EINVAL;
37 }
38
39 ret = s3c_gpio_cfgall_range(gpio8, 8, sfn, S3C_GPIO_PULL_UP);
40 if (ret)
41 return ret;
42
43 return s3c_gpio_cfgall_range(gpio5, 5, sfn, S3C_GPIO_PULL_UP);
44}
diff --git a/arch/arm/mach-s5pv310/setup-i2c0.c b/arch/arm/mach-exynos4/setup-i2c0.c
index f47f8f3152ec..d395bd17c38b 100644
--- a/arch/arm/mach-s5pv310/setup-i2c0.c
+++ b/arch/arm/mach-exynos4/setup-i2c0.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-s5pv310/setup-i2c0.c 2 * linux/arch/arm/mach-exynos4/setup-i2c0.c
3 * 3 *
4 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd. 4 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/ 5 * http://www.samsung.com/
@@ -21,6 +21,6 @@ struct platform_device; /* don't need the contents */
21 21
22void s3c_i2c0_cfg_gpio(struct platform_device *dev) 22void s3c_i2c0_cfg_gpio(struct platform_device *dev)
23{ 23{
24 s3c_gpio_cfgall_range(S5PV310_GPD1(0), 2, 24 s3c_gpio_cfgall_range(EXYNOS4_GPD1(0), 2,
25 S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); 25 S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
26} 26}
diff --git a/arch/arm/mach-s5pv310/setup-i2c1.c b/arch/arm/mach-exynos4/setup-i2c1.c
index 9d07e4e2f14c..fd7235a43f6e 100644
--- a/arch/arm/mach-s5pv310/setup-i2c1.c
+++ b/arch/arm/mach-exynos4/setup-i2c1.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-s5pv310/setup-i2c1.c 2 * linux/arch/arm/mach-exynos4/setup-i2c1.c
3 * 3 *
4 * Copyright (C) 2010 Samsung Electronics Co., Ltd. 4 * Copyright (C) 2010 Samsung Electronics Co., Ltd.
5 * 5 *
@@ -18,6 +18,6 @@ struct platform_device; /* don't need the contents */
18 18
19void s3c_i2c1_cfg_gpio(struct platform_device *dev) 19void s3c_i2c1_cfg_gpio(struct platform_device *dev)
20{ 20{
21 s3c_gpio_cfgall_range(S5PV310_GPD1(2), 2, 21 s3c_gpio_cfgall_range(EXYNOS4_GPD1(2), 2,
22 S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); 22 S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
23} 23}
diff --git a/arch/arm/mach-s5pv310/setup-i2c2.c b/arch/arm/mach-exynos4/setup-i2c2.c
index 4163b1233daf..2694b19e8b37 100644
--- a/arch/arm/mach-s5pv310/setup-i2c2.c
+++ b/arch/arm/mach-exynos4/setup-i2c2.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-s5pv310/setup-i2c2.c 2 * linux/arch/arm/mach-exynos4/setup-i2c2.c
3 * 3 *
4 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd. 4 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
5 * 5 *
@@ -18,6 +18,6 @@ struct platform_device; /* don't need the contents */
18 18
19void s3c_i2c2_cfg_gpio(struct platform_device *dev) 19void s3c_i2c2_cfg_gpio(struct platform_device *dev)
20{ 20{
21 s3c_gpio_cfgall_range(S5PV310_GPA0(6), 2, 21 s3c_gpio_cfgall_range(EXYNOS4_GPA0(6), 2,
22 S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP); 22 S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP);
23} 23}
diff --git a/arch/arm/mach-s5pv310/setup-i2c3.c b/arch/arm/mach-exynos4/setup-i2c3.c
index 180f153d2a20..379bd306993f 100644
--- a/arch/arm/mach-s5pv310/setup-i2c3.c
+++ b/arch/arm/mach-exynos4/setup-i2c3.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-s5pv310/setup-i2c3.c 2 * linux/arch/arm/mach-exynos4/setup-i2c3.c
3 * 3 *
4 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
5 * 5 *
@@ -18,6 +18,6 @@ struct platform_device; /* don't need the contents */
18 18
19void s3c_i2c3_cfg_gpio(struct platform_device *dev) 19void s3c_i2c3_cfg_gpio(struct platform_device *dev)
20{ 20{
21 s3c_gpio_cfgall_range(S5PV310_GPA1(2), 2, 21 s3c_gpio_cfgall_range(EXYNOS4_GPA1(2), 2,
22 S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP); 22 S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP);
23} 23}
diff --git a/arch/arm/mach-s5pv310/setup-i2c4.c b/arch/arm/mach-exynos4/setup-i2c4.c
index 909e8dfc5316..9f3c04855b76 100644
--- a/arch/arm/mach-s5pv310/setup-i2c4.c
+++ b/arch/arm/mach-exynos4/setup-i2c4.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-s5pv310/setup-i2c4.c 2 * linux/arch/arm/mach-exynos4/setup-i2c4.c
3 * 3 *
4 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
5 * 5 *
@@ -18,6 +18,6 @@ struct platform_device; /* don't need the contents */
18 18
19void s3c_i2c4_cfg_gpio(struct platform_device *dev) 19void s3c_i2c4_cfg_gpio(struct platform_device *dev)
20{ 20{
21 s3c_gpio_cfgall_range(S5PV310_GPB(2), 2, 21 s3c_gpio_cfgall_range(EXYNOS4_GPB(2), 2,
22 S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP); 22 S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP);
23} 23}
diff --git a/arch/arm/mach-s5pv310/setup-i2c5.c b/arch/arm/mach-exynos4/setup-i2c5.c
index 5d0fa4ac0283..77e1a1e57c76 100644
--- a/arch/arm/mach-s5pv310/setup-i2c5.c
+++ b/arch/arm/mach-exynos4/setup-i2c5.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-s5pv310/setup-i2c5.c 2 * linux/arch/arm/mach-exynos4/setup-i2c5.c
3 * 3 *
4 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
5 * 5 *
@@ -18,6 +18,6 @@ struct platform_device; /* don't need the contents */
18 18
19void s3c_i2c5_cfg_gpio(struct platform_device *dev) 19void s3c_i2c5_cfg_gpio(struct platform_device *dev)
20{ 20{
21 s3c_gpio_cfgall_range(S5PV310_GPB(6), 2, 21 s3c_gpio_cfgall_range(EXYNOS4_GPB(6), 2,
22 S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP); 22 S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP);
23} 23}
diff --git a/arch/arm/mach-s5pv310/setup-i2c6.c b/arch/arm/mach-exynos4/setup-i2c6.c
index 34aafab92ac4..284d12b7af0e 100644
--- a/arch/arm/mach-s5pv310/setup-i2c6.c
+++ b/arch/arm/mach-exynos4/setup-i2c6.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-s5pv310/setup-i2c6.c 2 * linux/arch/arm/mach-exynos4/setup-i2c6.c
3 * 3 *
4 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
5 * 5 *
@@ -18,6 +18,6 @@ struct platform_device; /* don't need the contents */
18 18
19void s3c_i2c6_cfg_gpio(struct platform_device *dev) 19void s3c_i2c6_cfg_gpio(struct platform_device *dev)
20{ 20{
21 s3c_gpio_cfgall_range(S5PV310_GPC1(3), 2, 21 s3c_gpio_cfgall_range(EXYNOS4_GPC1(3), 2,
22 S3C_GPIO_SFN(4), S3C_GPIO_PULL_UP); 22 S3C_GPIO_SFN(4), S3C_GPIO_PULL_UP);
23} 23}
diff --git a/arch/arm/mach-s5pv310/setup-i2c7.c b/arch/arm/mach-exynos4/setup-i2c7.c
index 9b25b8d18920..b7611ee359a2 100644
--- a/arch/arm/mach-s5pv310/setup-i2c7.c
+++ b/arch/arm/mach-exynos4/setup-i2c7.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-s5pv310/setup-i2c7.c 2 * linux/arch/arm/mach-exynos4/setup-i2c7.c
3 * 3 *
4 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
5 * 5 *
@@ -18,6 +18,6 @@ struct platform_device; /* don't need the contents */
18 18
19void s3c_i2c7_cfg_gpio(struct platform_device *dev) 19void s3c_i2c7_cfg_gpio(struct platform_device *dev)
20{ 20{
21 s3c_gpio_cfgall_range(S5PV310_GPD0(2), 2, 21 s3c_gpio_cfgall_range(EXYNOS4_GPD0(2), 2,
22 S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP); 22 S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP);
23} 23}
diff --git a/arch/arm/mach-exynos4/setup-keypad.c b/arch/arm/mach-exynos4/setup-keypad.c
new file mode 100644
index 000000000000..1ee0ebff111f
--- /dev/null
+++ b/arch/arm/mach-exynos4/setup-keypad.c
@@ -0,0 +1,35 @@
1/* linux/arch/arm/mach-exynos4/setup-keypad.c
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * GPIO configuration for Exynos4 KeyPad device
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/gpio.h>
14#include <plat/gpio-cfg.h>
15
16void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)
17{
18 /* Keypads can be of various combinations, Just making sure */
19
20 if (rows > 8) {
21 /* Set all the necessary GPX2 pins: KP_ROW[0~7] */
22 s3c_gpio_cfgrange_nopull(EXYNOS4_GPX2(0), 8, S3C_GPIO_SFN(3));
23
24 /* Set all the necessary GPX3 pins: KP_ROW[8~] */
25 s3c_gpio_cfgrange_nopull(EXYNOS4_GPX3(0), (rows - 8),
26 S3C_GPIO_SFN(3));
27 } else {
28 /* Set all the necessary GPX2 pins: KP_ROW[x] */
29 s3c_gpio_cfgrange_nopull(EXYNOS4_GPX2(0), rows,
30 S3C_GPIO_SFN(3));
31 }
32
33 /* Set all the necessary GPX1 pins to special-function 3: KP_COL[x] */
34 s3c_gpio_cfgrange_nopull(EXYNOS4_GPX1(0), cols, S3C_GPIO_SFN(3));
35}
diff --git a/arch/arm/mach-s5pv310/setup-sdhci-gpio.c b/arch/arm/mach-exynos4/setup-sdhci-gpio.c
index 86d38cc49135..1b3d3a2de95c 100644
--- a/arch/arm/mach-s5pv310/setup-sdhci-gpio.c
+++ b/arch/arm/mach-exynos4/setup-sdhci-gpio.c
@@ -1,9 +1,9 @@
1/* linux/arch/arm/mach-s5pv310/setup-sdhci-gpio.c 1/* linux/arch/arm/mach-exynos4/setup-sdhci-gpio.c
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * S5PV310 - Helper functions for setting up SDHCI device(s) GPIO (HSMMC) 6 * EXYNOS4 - Helper functions for setting up SDHCI device(s) GPIO (HSMMC)
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -23,13 +23,13 @@
23#include <plat/regs-sdhci.h> 23#include <plat/regs-sdhci.h>
24#include <plat/sdhci.h> 24#include <plat/sdhci.h>
25 25
26void s5pv310_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) 26void exynos4_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
27{ 27{
28 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; 28 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
29 unsigned int gpio; 29 unsigned int gpio;
30 30
31 /* Set all the necessary GPK0[0:1] pins to special-function 2 */ 31 /* Set all the necessary GPK0[0:1] pins to special-function 2 */
32 for (gpio = S5PV310_GPK0(0); gpio < S5PV310_GPK0(2); gpio++) { 32 for (gpio = EXYNOS4_GPK0(0); gpio < EXYNOS4_GPK0(2); gpio++) {
33 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); 33 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
34 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); 34 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
35 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4); 35 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
@@ -37,14 +37,14 @@ void s5pv310_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
37 37
38 switch (width) { 38 switch (width) {
39 case 8: 39 case 8:
40 for (gpio = S5PV310_GPK1(3); gpio <= S5PV310_GPK1(6); gpio++) { 40 for (gpio = EXYNOS4_GPK1(3); gpio <= EXYNOS4_GPK1(6); gpio++) {
41 /* Data pin GPK1[3:6] to special-funtion 3 */ 41 /* Data pin GPK1[3:6] to special-funtion 3 */
42 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3)); 42 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
43 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP); 43 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
44 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4); 44 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
45 } 45 }
46 case 4: 46 case 4:
47 for (gpio = S5PV310_GPK0(3); gpio <= S5PV310_GPK0(6); gpio++) { 47 for (gpio = EXYNOS4_GPK0(3); gpio <= EXYNOS4_GPK0(6); gpio++) {
48 /* Data pin GPK0[3:6] to special-funtion 2 */ 48 /* Data pin GPK0[3:6] to special-funtion 2 */
49 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); 49 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
50 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP); 50 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
@@ -55,25 +55,25 @@ void s5pv310_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
55 } 55 }
56 56
57 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { 57 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
58 s3c_gpio_cfgpin(S5PV310_GPK0(2), S3C_GPIO_SFN(2)); 58 s3c_gpio_cfgpin(EXYNOS4_GPK0(2), S3C_GPIO_SFN(2));
59 s3c_gpio_setpull(S5PV310_GPK0(2), S3C_GPIO_PULL_UP); 59 s3c_gpio_setpull(EXYNOS4_GPK0(2), S3C_GPIO_PULL_UP);
60 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4); 60 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
61 } 61 }
62} 62}
63 63
64void s5pv310_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) 64void exynos4_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
65{ 65{
66 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; 66 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
67 unsigned int gpio; 67 unsigned int gpio;
68 68
69 /* Set all the necessary GPK1[0:1] pins to special-function 2 */ 69 /* Set all the necessary GPK1[0:1] pins to special-function 2 */
70 for (gpio = S5PV310_GPK1(0); gpio < S5PV310_GPK1(2); gpio++) { 70 for (gpio = EXYNOS4_GPK1(0); gpio < EXYNOS4_GPK1(2); gpio++) {
71 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); 71 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
72 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); 72 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
73 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4); 73 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
74 } 74 }
75 75
76 for (gpio = S5PV310_GPK1(3); gpio <= S5PV310_GPK1(6); gpio++) { 76 for (gpio = EXYNOS4_GPK1(3); gpio <= EXYNOS4_GPK1(6); gpio++) {
77 /* Data pin GPK1[3:6] to special-function 2 */ 77 /* Data pin GPK1[3:6] to special-function 2 */
78 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); 78 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
79 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP); 79 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
@@ -81,19 +81,19 @@ void s5pv310_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
81 } 81 }
82 82
83 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { 83 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
84 s3c_gpio_cfgpin(S5PV310_GPK1(2), S3C_GPIO_SFN(2)); 84 s3c_gpio_cfgpin(EXYNOS4_GPK1(2), S3C_GPIO_SFN(2));
85 s3c_gpio_setpull(S5PV310_GPK1(2), S3C_GPIO_PULL_UP); 85 s3c_gpio_setpull(EXYNOS4_GPK1(2), S3C_GPIO_PULL_UP);
86 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4); 86 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
87 } 87 }
88} 88}
89 89
90void s5pv310_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width) 90void exynos4_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
91{ 91{
92 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; 92 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
93 unsigned int gpio; 93 unsigned int gpio;
94 94
95 /* Set all the necessary GPK2[0:1] pins to special-function 2 */ 95 /* Set all the necessary GPK2[0:1] pins to special-function 2 */
96 for (gpio = S5PV310_GPK2(0); gpio < S5PV310_GPK2(2); gpio++) { 96 for (gpio = EXYNOS4_GPK2(0); gpio < EXYNOS4_GPK2(2); gpio++) {
97 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); 97 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
98 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); 98 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
99 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4); 99 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
@@ -101,14 +101,14 @@ void s5pv310_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
101 101
102 switch (width) { 102 switch (width) {
103 case 8: 103 case 8:
104 for (gpio = S5PV310_GPK3(3); gpio <= S5PV310_GPK3(6); gpio++) { 104 for (gpio = EXYNOS4_GPK3(3); gpio <= EXYNOS4_GPK3(6); gpio++) {
105 /* Data pin GPK3[3:6] to special-function 3 */ 105 /* Data pin GPK3[3:6] to special-function 3 */
106 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3)); 106 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
107 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP); 107 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
108 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4); 108 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
109 } 109 }
110 case 4: 110 case 4:
111 for (gpio = S5PV310_GPK2(3); gpio <= S5PV310_GPK2(6); gpio++) { 111 for (gpio = EXYNOS4_GPK2(3); gpio <= EXYNOS4_GPK2(6); gpio++) {
112 /* Data pin GPK2[3:6] to special-function 2 */ 112 /* Data pin GPK2[3:6] to special-function 2 */
113 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); 113 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
114 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP); 114 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
@@ -119,25 +119,25 @@ void s5pv310_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
119 } 119 }
120 120
121 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { 121 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
122 s3c_gpio_cfgpin(S5PV310_GPK2(2), S3C_GPIO_SFN(2)); 122 s3c_gpio_cfgpin(EXYNOS4_GPK2(2), S3C_GPIO_SFN(2));
123 s3c_gpio_setpull(S5PV310_GPK2(2), S3C_GPIO_PULL_UP); 123 s3c_gpio_setpull(EXYNOS4_GPK2(2), S3C_GPIO_PULL_UP);
124 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4); 124 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
125 } 125 }
126} 126}
127 127
128void s5pv310_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width) 128void exynos4_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width)
129{ 129{
130 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; 130 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
131 unsigned int gpio; 131 unsigned int gpio;
132 132
133 /* Set all the necessary GPK3[0:1] pins to special-function 2 */ 133 /* Set all the necessary GPK3[0:1] pins to special-function 2 */
134 for (gpio = S5PV310_GPK3(0); gpio < S5PV310_GPK3(2); gpio++) { 134 for (gpio = EXYNOS4_GPK3(0); gpio < EXYNOS4_GPK3(2); gpio++) {
135 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); 135 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
136 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); 136 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
137 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4); 137 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
138 } 138 }
139 139
140 for (gpio = S5PV310_GPK3(3); gpio <= S5PV310_GPK3(6); gpio++) { 140 for (gpio = EXYNOS4_GPK3(3); gpio <= EXYNOS4_GPK3(6); gpio++) {
141 /* Data pin GPK3[3:6] to special-function 2 */ 141 /* Data pin GPK3[3:6] to special-function 2 */
142 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); 142 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
143 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP); 143 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);
@@ -145,8 +145,8 @@ void s5pv310_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width)
145 } 145 }
146 146
147 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { 147 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
148 s3c_gpio_cfgpin(S5PV310_GPK3(2), S3C_GPIO_SFN(2)); 148 s3c_gpio_cfgpin(EXYNOS4_GPK3(2), S3C_GPIO_SFN(2));
149 s3c_gpio_setpull(S5PV310_GPK3(2), S3C_GPIO_PULL_UP); 149 s3c_gpio_setpull(EXYNOS4_GPK3(2), S3C_GPIO_PULL_UP);
150 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4); 150 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
151 } 151 }
152} 152}
diff --git a/arch/arm/mach-s5pv310/setup-sdhci.c b/arch/arm/mach-exynos4/setup-sdhci.c
index db8358fc4662..85f9433d4836 100644
--- a/arch/arm/mach-s5pv310/setup-sdhci.c
+++ b/arch/arm/mach-exynos4/setup-sdhci.c
@@ -1,9 +1,9 @@
1/* linux/arch/arm/mach-s5pv310/setup-sdhci.c 1/* linux/arch/arm/mach-exynos4/setup-sdhci.c
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * S5PV310 - Helper functions for settign up SDHCI device(s) (HSMMC) 6 * EXYNOS4 - Helper functions for settign up SDHCI device(s) (HSMMC)
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -23,14 +23,14 @@
23 23
24/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */ 24/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
25 25
26char *s5pv310_hsmmc_clksrcs[4] = { 26char *exynos4_hsmmc_clksrcs[4] = {
27 [0] = NULL, 27 [0] = NULL,
28 [1] = NULL, 28 [1] = NULL,
29 [2] = "sclk_mmc", /* mmc_bus */ 29 [2] = "sclk_mmc", /* mmc_bus */
30 [3] = NULL, 30 [3] = NULL,
31}; 31};
32 32
33void s5pv310_setup_sdhci_cfg_card(struct platform_device *dev, void __iomem *r, 33void exynos4_setup_sdhci_cfg_card(struct platform_device *dev, void __iomem *r,
34 struct mmc_ios *ios, struct mmc_card *card) 34 struct mmc_ios *ios, struct mmc_card *card)
35{ 35{
36 u32 ctrl2, ctrl3; 36 u32 ctrl2, ctrl3;
diff --git a/arch/arm/mach-exynos4/sleep.S b/arch/arm/mach-exynos4/sleep.S
new file mode 100644
index 000000000000..6b62425417a6
--- /dev/null
+++ b/arch/arm/mach-exynos4/sleep.S
@@ -0,0 +1,76 @@
1/* linux/arch/arm/mach-exynos4/sleep.S
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * EXYNOS4210 power Manager (Suspend-To-RAM) support
7 * Based on S3C2410 sleep code by:
8 * Ben Dooks, (c) 2004 Simtec Electronics
9 *
10 * Based on PXA/SA1100 sleep code by:
11 * Nicolas Pitre, (c) 2002 Monta Vista Software Inc
12 * Cliff Brake, (c) 2001
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27*/
28
29#include <linux/linkage.h>
30#include <asm/assembler.h>
31#include <asm/memory.h>
32
33 .text
34
35 /*
36 * s3c_cpu_save
37 *
38 * entry:
39 * r1 = v:p offset
40 */
41
42ENTRY(s3c_cpu_save)
43
44 stmfd sp!, { r3 - r12, lr }
45 ldr r3, =resume_with_mmu
46 bl cpu_suspend
47
48 ldr r0, =pm_cpu_sleep
49 ldr r0, [ r0 ]
50 mov pc, r0
51
52resume_with_mmu:
53 ldmfd sp!, { r3 - r12, pc }
54
55 .ltorg
56
57 /*
58 * sleep magic, to allow the bootloader to check for an valid
59 * image to resume to. Must be the first word before the
60 * s3c_cpu_resume entry.
61 */
62
63 .word 0x2bedf00d
64
65 /*
66 * s3c_cpu_resume
67 *
68 * resume code entry for bootloader to call
69 *
70 * we must put this code here in the data segment as we have no
71 * other way of restoring the stack pointer after sleep, and we
72 * must not write to the code segment (code is read-only)
73 */
74
75ENTRY(s3c_cpu_resume)
76 b cpu_resume
diff --git a/arch/arm/mach-s5pv310/time.c b/arch/arm/mach-exynos4/time.c
index b262d4615331..86b9fa0d3639 100644
--- a/arch/arm/mach-s5pv310/time.c
+++ b/arch/arm/mach-exynos4/time.c
@@ -1,9 +1,9 @@
1/* linux/arch/arm/mach-s5pv310/time.c 1/* linux/arch/arm/mach-exynos4/time.c
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 4 * http://www.samsung.com
5 * 5 *
6 * S5PV310 (and compatible) HRT support 6 * EXYNOS4 (and compatible) HRT support
7 * PWM 2/4 is used for this feature 7 * PWM 2/4 is used for this feature
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -33,7 +33,7 @@ static struct clk *tdiv2;
33static struct clk *tdiv4; 33static struct clk *tdiv4;
34static struct clk *timerclk; 34static struct clk *timerclk;
35 35
36static void s5pv310_pwm_stop(unsigned int pwm_id) 36static void exynos4_pwm_stop(unsigned int pwm_id)
37{ 37{
38 unsigned long tcon; 38 unsigned long tcon;
39 39
@@ -52,7 +52,7 @@ static void s5pv310_pwm_stop(unsigned int pwm_id)
52 __raw_writel(tcon, S3C2410_TCON); 52 __raw_writel(tcon, S3C2410_TCON);
53} 53}
54 54
55static void s5pv310_pwm_init(unsigned int pwm_id, unsigned long tcnt) 55static void exynos4_pwm_init(unsigned int pwm_id, unsigned long tcnt)
56{ 56{
57 unsigned long tcon; 57 unsigned long tcon;
58 58
@@ -86,7 +86,7 @@ static void s5pv310_pwm_init(unsigned int pwm_id, unsigned long tcnt)
86 } 86 }
87} 87}
88 88
89static inline void s5pv310_pwm_start(unsigned int pwm_id, bool periodic) 89static inline void exynos4_pwm_start(unsigned int pwm_id, bool periodic)
90{ 90{
91 unsigned long tcon; 91 unsigned long tcon;
92 92
@@ -117,23 +117,23 @@ static inline void s5pv310_pwm_start(unsigned int pwm_id, bool periodic)
117 __raw_writel(tcon, S3C2410_TCON); 117 __raw_writel(tcon, S3C2410_TCON);
118} 118}
119 119
120static int s5pv310_pwm_set_next_event(unsigned long cycles, 120static int exynos4_pwm_set_next_event(unsigned long cycles,
121 struct clock_event_device *evt) 121 struct clock_event_device *evt)
122{ 122{
123 s5pv310_pwm_init(2, cycles); 123 exynos4_pwm_init(2, cycles);
124 s5pv310_pwm_start(2, 0); 124 exynos4_pwm_start(2, 0);
125 return 0; 125 return 0;
126} 126}
127 127
128static void s5pv310_pwm_set_mode(enum clock_event_mode mode, 128static void exynos4_pwm_set_mode(enum clock_event_mode mode,
129 struct clock_event_device *evt) 129 struct clock_event_device *evt)
130{ 130{
131 s5pv310_pwm_stop(2); 131 exynos4_pwm_stop(2);
132 132
133 switch (mode) { 133 switch (mode) {
134 case CLOCK_EVT_MODE_PERIODIC: 134 case CLOCK_EVT_MODE_PERIODIC:
135 s5pv310_pwm_init(2, clock_count_per_tick); 135 exynos4_pwm_init(2, clock_count_per_tick);
136 s5pv310_pwm_start(2, 1); 136 exynos4_pwm_start(2, 1);
137 break; 137 break;
138 case CLOCK_EVT_MODE_ONESHOT: 138 case CLOCK_EVT_MODE_ONESHOT:
139 break; 139 break;
@@ -149,11 +149,11 @@ static struct clock_event_device pwm_event_device = {
149 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 149 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
150 .rating = 200, 150 .rating = 200,
151 .shift = 32, 151 .shift = 32,
152 .set_next_event = s5pv310_pwm_set_next_event, 152 .set_next_event = exynos4_pwm_set_next_event,
153 .set_mode = s5pv310_pwm_set_mode, 153 .set_mode = exynos4_pwm_set_mode,
154}; 154};
155 155
156irqreturn_t s5pv310_clock_event_isr(int irq, void *dev_id) 156irqreturn_t exynos4_clock_event_isr(int irq, void *dev_id)
157{ 157{
158 struct clock_event_device *evt = &pwm_event_device; 158 struct clock_event_device *evt = &pwm_event_device;
159 159
@@ -162,13 +162,13 @@ irqreturn_t s5pv310_clock_event_isr(int irq, void *dev_id)
162 return IRQ_HANDLED; 162 return IRQ_HANDLED;
163} 163}
164 164
165static struct irqaction s5pv310_clock_event_irq = { 165static struct irqaction exynos4_clock_event_irq = {
166 .name = "pwm_timer2_irq", 166 .name = "pwm_timer2_irq",
167 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 167 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
168 .handler = s5pv310_clock_event_isr, 168 .handler = exynos4_clock_event_isr,
169}; 169};
170 170
171static void __init s5pv310_clockevent_init(void) 171static void __init exynos4_clockevent_init(void)
172{ 172{
173 unsigned long pclk; 173 unsigned long pclk;
174 unsigned long clock_rate; 174 unsigned long clock_rate;
@@ -198,23 +198,39 @@ static void __init s5pv310_clockevent_init(void)
198 pwm_event_device.cpumask = cpumask_of(0); 198 pwm_event_device.cpumask = cpumask_of(0);
199 clockevents_register_device(&pwm_event_device); 199 clockevents_register_device(&pwm_event_device);
200 200
201 setup_irq(IRQ_TIMER2, &s5pv310_clock_event_irq); 201 setup_irq(IRQ_TIMER2, &exynos4_clock_event_irq);
202} 202}
203 203
204static cycle_t s5pv310_pwm4_read(struct clocksource *cs) 204static cycle_t exynos4_pwm4_read(struct clocksource *cs)
205{ 205{
206 return (cycle_t) ~__raw_readl(S3C_TIMERREG(0x40)); 206 return (cycle_t) ~__raw_readl(S3C_TIMERREG(0x40));
207} 207}
208 208
209static void exynos4_pwm4_resume(struct clocksource *cs)
210{
211 unsigned long pclk;
212
213 pclk = clk_get_rate(timerclk);
214
215 clk_set_rate(tdiv4, pclk / 2);
216 clk_set_parent(tin4, tdiv4);
217
218 exynos4_pwm_init(4, ~0);
219 exynos4_pwm_start(4, 1);
220}
221
209struct clocksource pwm_clocksource = { 222struct clocksource pwm_clocksource = {
210 .name = "pwm_timer4", 223 .name = "pwm_timer4",
211 .rating = 250, 224 .rating = 250,
212 .read = s5pv310_pwm4_read, 225 .read = exynos4_pwm4_read,
213 .mask = CLOCKSOURCE_MASK(32), 226 .mask = CLOCKSOURCE_MASK(32),
214 .flags = CLOCK_SOURCE_IS_CONTINUOUS , 227 .flags = CLOCK_SOURCE_IS_CONTINUOUS ,
228#ifdef CONFIG_PM
229 .resume = exynos4_pwm4_resume,
230#endif
215}; 231};
216 232
217static void __init s5pv310_clocksource_init(void) 233static void __init exynos4_clocksource_init(void)
218{ 234{
219 unsigned long pclk; 235 unsigned long pclk;
220 unsigned long clock_rate; 236 unsigned long clock_rate;
@@ -226,14 +242,14 @@ static void __init s5pv310_clocksource_init(void)
226 242
227 clock_rate = clk_get_rate(tin4); 243 clock_rate = clk_get_rate(tin4);
228 244
229 s5pv310_pwm_init(4, ~0); 245 exynos4_pwm_init(4, ~0);
230 s5pv310_pwm_start(4, 1); 246 exynos4_pwm_start(4, 1);
231 247
232 if (clocksource_register_hz(&pwm_clocksource, clock_rate)) 248 if (clocksource_register_hz(&pwm_clocksource, clock_rate))
233 panic("%s: can't register clocksource\n", pwm_clocksource.name); 249 panic("%s: can't register clocksource\n", pwm_clocksource.name);
234} 250}
235 251
236static void __init s5pv310_timer_resources(void) 252static void __init exynos4_timer_resources(void)
237{ 253{
238 struct platform_device tmpdev; 254 struct platform_device tmpdev;
239 255
@@ -267,17 +283,17 @@ static void __init s5pv310_timer_resources(void)
267 clk_enable(tin4); 283 clk_enable(tin4);
268} 284}
269 285
270static void __init s5pv310_timer_init(void) 286static void __init exynos4_timer_init(void)
271{ 287{
272#ifdef CONFIG_LOCAL_TIMERS 288#ifdef CONFIG_LOCAL_TIMERS
273 twd_base = S5P_VA_TWD; 289 twd_base = S5P_VA_TWD;
274#endif 290#endif
275 291
276 s5pv310_timer_resources(); 292 exynos4_timer_resources();
277 s5pv310_clockevent_init(); 293 exynos4_clockevent_init();
278 s5pv310_clocksource_init(); 294 exynos4_clocksource_init();
279} 295}
280 296
281struct sys_timer s5pv310_timer = { 297struct sys_timer exynos4_timer = {
282 .init = s5pv310_timer_init, 298 .init = exynos4_timer_init,
283}; 299};
diff --git a/arch/arm/mach-footbridge/dc21285-timer.c b/arch/arm/mach-footbridge/dc21285-timer.c
index bc5e83fb5819..a921fe92b858 100644
--- a/arch/arm/mach-footbridge/dc21285-timer.c
+++ b/arch/arm/mach-footbridge/dc21285-timer.c
@@ -4,10 +4,11 @@
4 * Copyright (C) 1998 Russell King. 4 * Copyright (C) 1998 Russell King.
5 * Copyright (C) 1998 Phil Blundell 5 * Copyright (C) 1998 Phil Blundell
6 */ 6 */
7#include <linux/clockchips.h>
8#include <linux/clocksource.h>
7#include <linux/init.h> 9#include <linux/init.h>
8#include <linux/interrupt.h> 10#include <linux/interrupt.h>
9#include <linux/irq.h> 11#include <linux/irq.h>
10#include <linux/spinlock.h>
11 12
12#include <asm/irq.h> 13#include <asm/irq.h>
13 14
@@ -16,32 +17,76 @@
16 17
17#include "common.h" 18#include "common.h"
18 19
19/* 20static cycle_t cksrc_dc21285_read(struct clocksource *cs)
20 * Footbridge timer 1 support. 21{
21 */ 22 return cs->mask - *CSR_TIMER2_VALUE;
22static unsigned long timer1_latch; 23}
23 24
24static unsigned long timer1_gettimeoffset (void) 25static int cksrc_dc21285_enable(struct clocksource *cs)
25{ 26{
26 unsigned long value = timer1_latch - *CSR_TIMER1_VALUE; 27 *CSR_TIMER2_LOAD = cs->mask;
28 *CSR_TIMER2_CLR = 0;
29 *CSR_TIMER2_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_DIV16;
30 return 0;
31}
27 32
28 return ((tick_nsec / 1000) * value) / timer1_latch; 33static int cksrc_dc21285_disable(struct clocksource *cs)
34{
35 *CSR_TIMER2_CNTL = 0;
29} 36}
30 37
31static irqreturn_t 38static struct clocksource cksrc_dc21285 = {
32timer1_interrupt(int irq, void *dev_id) 39 .name = "dc21285_timer2",
40 .rating = 200,
41 .read = cksrc_dc21285_read,
42 .enable = cksrc_dc21285_enable,
43 .disable = cksrc_dc21285_disable,
44 .mask = CLOCKSOURCE_MASK(24),
45 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
46};
47
48static void ckevt_dc21285_set_mode(enum clock_event_mode mode,
49 struct clock_event_device *c)
33{ 50{
51 switch (mode) {
52 case CLOCK_EVT_MODE_RESUME:
53 case CLOCK_EVT_MODE_PERIODIC:
54 *CSR_TIMER1_CLR = 0;
55 *CSR_TIMER1_LOAD = (mem_fclk_21285 + 8 * HZ) / (16 * HZ);
56 *CSR_TIMER1_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD |
57 TIMER_CNTL_DIV16;
58 break;
59
60 default:
61 *CSR_TIMER1_CNTL = 0;
62 break;
63 }
64}
65
66static struct clock_event_device ckevt_dc21285 = {
67 .name = "dc21285_timer1",
68 .features = CLOCK_EVT_FEAT_PERIODIC,
69 .rating = 200,
70 .irq = IRQ_TIMER1,
71 .set_mode = ckevt_dc21285_set_mode,
72};
73
74static irqreturn_t timer1_interrupt(int irq, void *dev_id)
75{
76 struct clock_event_device *ce = dev_id;
77
34 *CSR_TIMER1_CLR = 0; 78 *CSR_TIMER1_CLR = 0;
35 79
36 timer_tick(); 80 ce->event_handler(ce);
37 81
38 return IRQ_HANDLED; 82 return IRQ_HANDLED;
39} 83}
40 84
41static struct irqaction footbridge_timer_irq = { 85static struct irqaction footbridge_timer_irq = {
42 .name = "Timer1 timer tick", 86 .name = "dc21285_timer1",
43 .handler = timer1_interrupt, 87 .handler = timer1_interrupt,
44 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 88 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
89 .dev_id = &ckevt_dc21285,
45}; 90};
46 91
47/* 92/*
@@ -49,16 +94,19 @@ static struct irqaction footbridge_timer_irq = {
49 */ 94 */
50static void __init footbridge_timer_init(void) 95static void __init footbridge_timer_init(void)
51{ 96{
52 timer1_latch = (mem_fclk_21285 + 8 * HZ) / (16 * HZ); 97 struct clock_event_device *ce = &ckevt_dc21285;
98
99 clocksource_register_hz(&cksrc_dc21285, (mem_fclk_21285 + 8) / 16);
100
101 setup_irq(ce->irq, &footbridge_timer_irq);
53 102
54 *CSR_TIMER1_CLR = 0; 103 clockevents_calc_mult_shift(ce, mem_fclk_21285, 5);
55 *CSR_TIMER1_LOAD = timer1_latch; 104 ce->max_delta_ns = clockevent_delta2ns(0xffffff, ce);
56 *CSR_TIMER1_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD | TIMER_CNTL_DIV16; 105 ce->min_delta_ns = clockevent_delta2ns(0x000004, ce);
57 106
58 setup_irq(IRQ_TIMER1, &footbridge_timer_irq); 107 clockevents_register_device(ce);
59} 108}
60 109
61struct sys_timer footbridge_timer = { 110struct sys_timer footbridge_timer = {
62 .init = footbridge_timer_init, 111 .init = footbridge_timer_init,
63 .offset = timer1_gettimeoffset,
64}; 112};
diff --git a/arch/arm/mach-footbridge/include/mach/debug-macro.S b/arch/arm/mach-footbridge/include/mach/debug-macro.S
index 3c9e0c40c679..30b971d65815 100644
--- a/arch/arm/mach-footbridge/include/mach/debug-macro.S
+++ b/arch/arm/mach-footbridge/include/mach/debug-macro.S
@@ -17,8 +17,8 @@
17 /* For NetWinder debugging */ 17 /* For NetWinder debugging */
18 .macro addruart, rp, rv 18 .macro addruart, rp, rv
19 mov \rp, #0x000003f8 19 mov \rp, #0x000003f8
20 orr \rv, \rp, #0x7c000000 @ physical 20 orr \rv, \rp, #0xff000000 @ virtual
21 orr \rp, \rp, #0xff000000 @ virtual 21 orr \rp, \rp, #0x7c000000 @ physical
22 .endm 22 .endm
23 23
24#define UART_SHIFT 0 24#define UART_SHIFT 0
diff --git a/arch/arm/mach-footbridge/include/mach/hardware.h b/arch/arm/mach-footbridge/include/mach/hardware.h
index 51dd902043ad..b6fdf23ecf6c 100644
--- a/arch/arm/mach-footbridge/include/mach/hardware.h
+++ b/arch/arm/mach-footbridge/include/mach/hardware.h
@@ -23,26 +23,33 @@
23 * 0xf9000000 0x50000000 1MB Cache flush 23 * 0xf9000000 0x50000000 1MB Cache flush
24 * 0xf0000000 0x80000000 16MB ISA memory 24 * 0xf0000000 0x80000000 16MB ISA memory
25 */ 25 */
26
27#ifdef CONFIG_MMU
28#define MMU_IO(a, b) (a)
29#else
30#define MMU_IO(a, b) (b)
31#endif
32
26#define XBUS_SIZE 0x00100000 33#define XBUS_SIZE 0x00100000
27#define XBUS_BASE 0xff800000 34#define XBUS_BASE MMU_IO(0xff800000, 0x40000000)
28 35
29#define ARMCSR_SIZE 0x00100000 36#define ARMCSR_SIZE 0x00100000
30#define ARMCSR_BASE 0xfe000000 37#define ARMCSR_BASE MMU_IO(0xfe000000, 0x42000000)
31 38
32#define WFLUSH_SIZE 0x00100000 39#define WFLUSH_SIZE 0x00100000
33#define WFLUSH_BASE 0xfd000000 40#define WFLUSH_BASE MMU_IO(0xfd000000, 0x78000000)
34 41
35#define PCIIACK_SIZE 0x00100000 42#define PCIIACK_SIZE 0x00100000
36#define PCIIACK_BASE 0xfc000000 43#define PCIIACK_BASE MMU_IO(0xfc000000, 0x79000000)
37 44
38#define PCICFG1_SIZE 0x01000000 45#define PCICFG1_SIZE 0x01000000
39#define PCICFG1_BASE 0xfb000000 46#define PCICFG1_BASE MMU_IO(0xfb000000, 0x7a000000)
40 47
41#define PCICFG0_SIZE 0x01000000 48#define PCICFG0_SIZE 0x01000000
42#define PCICFG0_BASE 0xfa000000 49#define PCICFG0_BASE MMU_IO(0xfa000000, 0x7b000000)
43 50
44#define PCIMEM_SIZE 0x01000000 51#define PCIMEM_SIZE 0x01000000
45#define PCIMEM_BASE 0xf0000000 52#define PCIMEM_BASE MMU_IO(0xf0000000, 0x80000000)
46 53
47#define XBUS_LEDS ((volatile unsigned char *)(XBUS_BASE + 0x12000)) 54#define XBUS_LEDS ((volatile unsigned char *)(XBUS_BASE + 0x12000))
48#define XBUS_LED_AMBER (1 << 0) 55#define XBUS_LED_AMBER (1 << 0)
diff --git a/arch/arm/mach-footbridge/include/mach/io.h b/arch/arm/mach-footbridge/include/mach/io.h
index 101a4fe90bde..32e4cc397c28 100644
--- a/arch/arm/mach-footbridge/include/mach/io.h
+++ b/arch/arm/mach-footbridge/include/mach/io.h
@@ -14,8 +14,14 @@
14#ifndef __ASM_ARM_ARCH_IO_H 14#ifndef __ASM_ARM_ARCH_IO_H
15#define __ASM_ARM_ARCH_IO_H 15#define __ASM_ARM_ARCH_IO_H
16 16
17#define PCIO_SIZE 0x00100000 17#ifdef CONFIG_MMU
18#define PCIO_BASE 0xff000000 18#define MMU_IO(a, b) (a)
19#else
20#define MMU_IO(a, b) (b)
21#endif
22
23#define PCIO_SIZE 0x00100000
24#define PCIO_BASE MMU_IO(0xff000000, 0x7c000000)
19 25
20#define IO_SPACE_LIMIT 0xffff 26#define IO_SPACE_LIMIT 0xffff
21 27
diff --git a/arch/arm/mach-footbridge/include/mach/memory.h b/arch/arm/mach-footbridge/include/mach/memory.h
index 8d64f4574087..5c6df377f969 100644
--- a/arch/arm/mach-footbridge/include/mach/memory.h
+++ b/arch/arm/mach-footbridge/include/mach/memory.h
@@ -62,7 +62,7 @@ extern unsigned long __bus_to_pfn(unsigned long);
62/* 62/*
63 * Physical DRAM offset. 63 * Physical DRAM offset.
64 */ 64 */
65#define PHYS_OFFSET UL(0x00000000) 65#define PLAT_PHYS_OFFSET UL(0x00000000)
66 66
67#define FLUSH_BASE_PHYS 0x50000000 67#define FLUSH_BASE_PHYS 0x50000000
68 68
diff --git a/arch/arm/mach-footbridge/isa-timer.c b/arch/arm/mach-footbridge/isa-timer.c
index f488fa2082d7..441c6ce0d555 100644
--- a/arch/arm/mach-footbridge/isa-timer.c
+++ b/arch/arm/mach-footbridge/isa-timer.c
@@ -4,10 +4,13 @@
4 * Copyright (C) 1998 Russell King. 4 * Copyright (C) 1998 Russell King.
5 * Copyright (C) 1998 Phil Blundell 5 * Copyright (C) 1998 Phil Blundell
6 */ 6 */
7#include <linux/clockchips.h>
8#include <linux/clocksource.h>
7#include <linux/init.h> 9#include <linux/init.h>
8#include <linux/interrupt.h> 10#include <linux/interrupt.h>
9#include <linux/irq.h> 11#include <linux/irq.h>
10#include <linux/io.h> 12#include <linux/io.h>
13#include <linux/timex.h>
11 14
12#include <asm/irq.h> 15#include <asm/irq.h>
13 16
@@ -15,77 +18,115 @@
15 18
16#include "common.h" 19#include "common.h"
17 20
18/* 21#define PIT_MODE 0x43
19 * ISA timer tick support 22#define PIT_CH0 0x40
20 */ 23
21#define mSEC_10_from_14 ((14318180 + 100) / 200) 24#define PIT_LATCH ((PIT_TICK_RATE + HZ / 2) / HZ)
22 25
23static unsigned long isa_gettimeoffset(void) 26static cycle_t pit_read(struct clocksource *cs)
24{ 27{
28 unsigned long flags;
29 static int old_count;
30 static u32 old_jifs;
25 int count; 31 int count;
32 u32 jifs;
26 33
27 static int count_p = (mSEC_10_from_14/6); /* for the first call after boot */ 34 raw_local_irq_save(flags);
28 static unsigned long jiffies_p = 0;
29 35
30 /* 36 jifs = jiffies;
31 * cache volatile jiffies temporarily; we have IRQs turned off. 37 outb_p(0x00, PIT_MODE); /* latch the count */
32 */ 38 count = inb_p(PIT_CH0); /* read the latched count */
33 unsigned long jiffies_t; 39 count |= inb_p(PIT_CH0) << 8;
34 40
35 /* timer count may underflow right here */ 41 if (count > old_count && jifs == old_jifs)
36 outb_p(0x00, 0x43); /* latch the count ASAP */ 42 count = old_count;
37 43
38 count = inb_p(0x40); /* read the latched count */ 44 old_count = count;
45 old_jifs = jifs;
39 46
40 /* 47 raw_local_irq_restore(flags);
41 * We do this guaranteed double memory access instead of a _p
42 * postfix in the previous port access. Wheee, hackady hack
43 */
44 jiffies_t = jiffies;
45 48
46 count |= inb_p(0x40) << 8; 49 count = (PIT_LATCH - 1) - count;
47 50
48 /* Detect timer underflows. If we haven't had a timer tick since 51 return (cycle_t)(jifs * PIT_LATCH) + count;
49 the last time we were called, and time is apparently going 52}
50 backwards, the counter must have wrapped during this routine. */
51 if ((jiffies_t == jiffies_p) && (count > count_p))
52 count -= (mSEC_10_from_14/6);
53 else
54 jiffies_p = jiffies_t;
55 53
56 count_p = count; 54static struct clocksource pit_cs = {
55 .name = "pit",
56 .rating = 110,
57 .read = pit_read,
58 .mask = CLOCKSOURCE_MASK(32),
59};
57 60
58 count = (((mSEC_10_from_14/6)-1) - count) * (tick_nsec / 1000); 61static void pit_set_mode(enum clock_event_mode mode,
59 count = (count + (mSEC_10_from_14/6)/2) / (mSEC_10_from_14/6); 62 struct clock_event_device *evt)
63{
64 unsigned long flags;
65
66 raw_local_irq_save(flags);
67
68 switch (mode) {
69 case CLOCK_EVT_MODE_PERIODIC:
70 outb_p(0x34, PIT_MODE);
71 outb_p(PIT_LATCH & 0xff, PIT_CH0);
72 outb_p(PIT_LATCH >> 8, PIT_CH0);
73 break;
74
75 case CLOCK_EVT_MODE_SHUTDOWN:
76 case CLOCK_EVT_MODE_UNUSED:
77 outb_p(0x30, PIT_MODE);
78 outb_p(0, PIT_CH0);
79 outb_p(0, PIT_CH0);
80 break;
81
82 case CLOCK_EVT_MODE_ONESHOT:
83 case CLOCK_EVT_MODE_RESUME:
84 break;
85 }
86 local_irq_restore(flags);
87}
60 88
61 return count; 89static int pit_set_next_event(unsigned long delta,
90 struct clock_event_device *evt)
91{
92 return 0;
62} 93}
63 94
64static irqreturn_t 95static struct clock_event_device pit_ce = {
65isa_timer_interrupt(int irq, void *dev_id) 96 .name = "pit",
97 .features = CLOCK_EVT_FEAT_PERIODIC,
98 .set_mode = pit_set_mode,
99 .set_next_event = pit_set_next_event,
100 .shift = 32,
101};
102
103static irqreturn_t pit_timer_interrupt(int irq, void *dev_id)
66{ 104{
67 timer_tick(); 105 struct clock_event_device *ce = dev_id;
106 ce->event_handler(ce);
68 return IRQ_HANDLED; 107 return IRQ_HANDLED;
69} 108}
70 109
71static struct irqaction isa_timer_irq = { 110static struct irqaction pit_timer_irq = {
72 .name = "ISA timer tick", 111 .name = "pit",
73 .handler = isa_timer_interrupt, 112 .handler = pit_timer_interrupt,
74 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 113 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
114 .dev_id = &pit_ce,
75}; 115};
76 116
77static void __init isa_timer_init(void) 117static void __init isa_timer_init(void)
78{ 118{
79 /* enable PIT timer */ 119 pit_ce.cpumask = cpumask_of(smp_processor_id());
80 /* set for periodic (4) and LSB/MSB write (0x30) */ 120 pit_ce.mult = div_sc(PIT_TICK_RATE, NSEC_PER_SEC, pit_ce.shift);
81 outb(0x34, 0x43); 121 pit_ce.max_delta_ns = clockevent_delta2ns(0x7fff, &pit_ce);
82 outb((mSEC_10_from_14/6) & 0xFF, 0x40); 122 pit_ce.min_delta_ns = clockevent_delta2ns(0x000f, &pit_ce);
83 outb((mSEC_10_from_14/6) >> 8, 0x40); 123
124 clocksource_register_hz(&pit_cs, PIT_TICK_RATE);
84 125
85 setup_irq(IRQ_ISA_TIMER, &isa_timer_irq); 126 setup_irq(pit_ce.irq, &pit_timer_irq);
127 clockevents_register_device(&pit_ce);
86} 128}
87 129
88struct sys_timer isa_timer = { 130struct sys_timer isa_timer = {
89 .init = isa_timer_init, 131 .init = isa_timer_init,
90 .offset = isa_gettimeoffset,
91}; 132};
diff --git a/arch/arm/mach-gemini/board-nas4220b.c b/arch/arm/mach-gemini/board-nas4220b.c
index 2ba096de0034..0cf7a07c3f3f 100644
--- a/arch/arm/mach-gemini/board-nas4220b.c
+++ b/arch/arm/mach-gemini/board-nas4220b.c
@@ -98,6 +98,7 @@ static void __init ib4220b_init(void)
98 platform_register_pflash(SZ_16M, NULL, 0); 98 platform_register_pflash(SZ_16M, NULL, 0);
99 platform_device_register(&ib4220b_led_device); 99 platform_device_register(&ib4220b_led_device);
100 platform_device_register(&ib4220b_key_device); 100 platform_device_register(&ib4220b_key_device);
101 platform_register_rtc();
101} 102}
102 103
103MACHINE_START(NAS4220B, "Raidsonic NAS IB-4220-B") 104MACHINE_START(NAS4220B, "Raidsonic NAS IB-4220-B")
diff --git a/arch/arm/mach-gemini/board-rut1xx.c b/arch/arm/mach-gemini/board-rut1xx.c
index a9a0d8b01942..4fa09af99495 100644
--- a/arch/arm/mach-gemini/board-rut1xx.c
+++ b/arch/arm/mach-gemini/board-rut1xx.c
@@ -82,6 +82,7 @@ static void __init rut1xx_init(void)
82 platform_register_pflash(SZ_8M, NULL, 0); 82 platform_register_pflash(SZ_8M, NULL, 0);
83 platform_device_register(&rut1xx_leds); 83 platform_device_register(&rut1xx_leds);
84 platform_device_register(&rut1xx_keys_device); 84 platform_device_register(&rut1xx_keys_device);
85 platform_register_rtc();
85} 86}
86 87
87MACHINE_START(RUT100, "Teltonika RUT100") 88MACHINE_START(RUT100, "Teltonika RUT100")
diff --git a/arch/arm/mach-gemini/board-wbd111.c b/arch/arm/mach-gemini/board-wbd111.c
index 8b88d50d4337..af7b68a6b258 100644
--- a/arch/arm/mach-gemini/board-wbd111.c
+++ b/arch/arm/mach-gemini/board-wbd111.c
@@ -130,6 +130,7 @@ static void __init wbd111_init(void)
130 wbd111_num_partitions); 130 wbd111_num_partitions);
131 platform_device_register(&wbd111_leds_device); 131 platform_device_register(&wbd111_leds_device);
132 platform_device_register(&wbd111_keys_device); 132 platform_device_register(&wbd111_keys_device);
133 platform_register_rtc();
133} 134}
134 135
135MACHINE_START(WBD111, "Wiliboard WBD-111") 136MACHINE_START(WBD111, "Wiliboard WBD-111")
diff --git a/arch/arm/mach-gemini/board-wbd222.c b/arch/arm/mach-gemini/board-wbd222.c
index 1eebcecd1c33..99e5bbecf923 100644
--- a/arch/arm/mach-gemini/board-wbd222.c
+++ b/arch/arm/mach-gemini/board-wbd222.c
@@ -130,6 +130,7 @@ static void __init wbd222_init(void)
130 wbd222_num_partitions); 130 wbd222_num_partitions);
131 platform_device_register(&wbd222_leds_device); 131 platform_device_register(&wbd222_leds_device);
132 platform_device_register(&wbd222_keys_device); 132 platform_device_register(&wbd222_keys_device);
133 platform_register_rtc();
133} 134}
134 135
135MACHINE_START(WBD222, "Wiliboard WBD-222") 136MACHINE_START(WBD222, "Wiliboard WBD-222")
diff --git a/arch/arm/mach-gemini/common.h b/arch/arm/mach-gemini/common.h
index 9392834a214f..7670c39acb2f 100644
--- a/arch/arm/mach-gemini/common.h
+++ b/arch/arm/mach-gemini/common.h
@@ -18,6 +18,7 @@ extern void gemini_map_io(void);
18extern void gemini_init_irq(void); 18extern void gemini_init_irq(void);
19extern void gemini_timer_init(void); 19extern void gemini_timer_init(void);
20extern void gemini_gpio_init(void); 20extern void gemini_gpio_init(void);
21extern void platform_register_rtc(void);
21 22
22/* Common platform devices registration functions */ 23/* Common platform devices registration functions */
23extern int platform_register_uart(void); 24extern int platform_register_uart(void);
diff --git a/arch/arm/mach-gemini/devices.c b/arch/arm/mach-gemini/devices.c
index 6b525253d027..5cff29818b73 100644
--- a/arch/arm/mach-gemini/devices.c
+++ b/arch/arm/mach-gemini/devices.c
@@ -90,3 +90,29 @@ int platform_register_pflash(unsigned int size, struct mtd_partition *parts,
90 90
91 return platform_device_register(&pflash_device); 91 return platform_device_register(&pflash_device);
92} 92}
93
94static struct resource gemini_rtc_resources[] = {
95 [0] = {
96 .start = GEMINI_RTC_BASE,
97 .end = GEMINI_RTC_BASE + 0x24,
98 .flags = IORESOURCE_MEM,
99 },
100 [1] = {
101 .start = IRQ_RTC,
102 .end = IRQ_RTC,
103 .flags = IORESOURCE_IRQ,
104 },
105};
106
107static struct platform_device gemini_rtc_device = {
108 .name = "rtc-gemini",
109 .id = 0,
110 .num_resources = ARRAY_SIZE(gemini_rtc_resources),
111 .resource = gemini_rtc_resources,
112};
113
114int __init platform_register_rtc(void)
115{
116 return platform_device_register(&gemini_rtc_device);
117}
118
diff --git a/arch/arm/mach-gemini/include/mach/memory.h b/arch/arm/mach-gemini/include/mach/memory.h
index 2d14d5bf1f9f..a50915f764d8 100644
--- a/arch/arm/mach-gemini/include/mach/memory.h
+++ b/arch/arm/mach-gemini/include/mach/memory.h
@@ -11,9 +11,9 @@
11#define __MACH_MEMORY_H 11#define __MACH_MEMORY_H
12 12
13#ifdef CONFIG_GEMINI_MEM_SWAP 13#ifdef CONFIG_GEMINI_MEM_SWAP
14# define PHYS_OFFSET UL(0x00000000) 14# define PLAT_PHYS_OFFSET UL(0x00000000)
15#else 15#else
16# define PHYS_OFFSET UL(0x10000000) 16# define PLAT_PHYS_OFFSET UL(0x10000000)
17#endif 17#endif
18 18
19#endif /* __MACH_MEMORY_H */ 19#endif /* __MACH_MEMORY_H */
diff --git a/arch/arm/mach-h720x/include/mach/memory.h b/arch/arm/mach-h720x/include/mach/memory.h
index ef4c1e26f18e..9d3687651462 100644
--- a/arch/arm/mach-h720x/include/mach/memory.h
+++ b/arch/arm/mach-h720x/include/mach/memory.h
@@ -7,7 +7,7 @@
7#ifndef __ASM_ARCH_MEMORY_H 7#ifndef __ASM_ARCH_MEMORY_H
8#define __ASM_ARCH_MEMORY_H 8#define __ASM_ARCH_MEMORY_H
9 9
10#define PHYS_OFFSET UL(0x40000000) 10#define PLAT_PHYS_OFFSET UL(0x40000000)
11/* 11/*
12 * This is the maximum DMA address that can be DMAd to. 12 * This is the maximum DMA address that can be DMAd to.
13 * There should not be more than (0xd0000000 - 0xc0000000) 13 * There should not be more than (0xd0000000 - 0xc0000000)
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 56684b517070..5eec099e0c72 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -100,6 +100,7 @@ config MACH_MX25_3DS
100 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 100 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
101 select IMX_HAVE_PLATFORM_IMX2_WDT 101 select IMX_HAVE_PLATFORM_IMX2_WDT
102 select IMX_HAVE_PLATFORM_IMXDI_RTC 102 select IMX_HAVE_PLATFORM_IMXDI_RTC
103 select IMX_HAVE_PLATFORM_IMX_I2C
103 select IMX_HAVE_PLATFORM_IMX_FB 104 select IMX_HAVE_PLATFORM_IMX_FB
104 select IMX_HAVE_PLATFORM_IMX_KEYPAD 105 select IMX_HAVE_PLATFORM_IMX_KEYPAD
105 select IMX_HAVE_PLATFORM_IMX_UART 106 select IMX_HAVE_PLATFORM_IMX_UART
@@ -238,6 +239,7 @@ config MACH_MX27_3DS
238 select SOC_IMX27 239 select SOC_IMX27
239 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 240 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
240 select IMX_HAVE_PLATFORM_IMX2_WDT 241 select IMX_HAVE_PLATFORM_IMX2_WDT
242 select IMX_HAVE_PLATFORM_IMX_I2C
241 select IMX_HAVE_PLATFORM_IMX_KEYPAD 243 select IMX_HAVE_PLATFORM_IMX_KEYPAD
242 select IMX_HAVE_PLATFORM_IMX_UART 244 select IMX_HAVE_PLATFORM_IMX_UART
243 select IMX_HAVE_PLATFORM_MXC_EHCI 245 select IMX_HAVE_PLATFORM_MXC_EHCI
@@ -265,6 +267,7 @@ config MACH_IMX27LITE
265 bool "LogicPD MX27 LITEKIT platform" 267 bool "LogicPD MX27 LITEKIT platform"
266 select SOC_IMX27 268 select SOC_IMX27
267 select IMX_HAVE_PLATFORM_IMX_UART 269 select IMX_HAVE_PLATFORM_IMX_UART
270 select IMX_HAVE_PLATFORM_IMX_SSI
268 help 271 help
269 Include support for MX27 LITEKIT platform. This includes specific 272 Include support for MX27 LITEKIT platform. This includes specific
270 configurations for the board and its peripherals. 273 configurations for the board and its peripherals.
@@ -300,4 +303,13 @@ config MACH_MXT_TD60
300 Include support for i-MXT (aka td60) platform. This 303 Include support for i-MXT (aka td60) platform. This
301 includes specific configurations for the module and its peripherals. 304 includes specific configurations for the module and its peripherals.
302 305
306config MACH_IMX27IPCAM
307 bool "IMX27 IPCAM platform"
308 select SOC_IMX27
309 select IMX_HAVE_PLATFORM_IMX2_WDT
310 select IMX_HAVE_PLATFORM_IMX_UART
311 help
312 Include support for IMX27 IPCAM platform. This includes specific
313 configurations for the board and its peripherals.
314
303endif 315endif
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 77100bf26153..b85794d27991 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -9,10 +9,10 @@ obj-$(CONFIG_IMX_HAVE_DMA_V1) += dma-v1.o
9obj-$(CONFIG_ARCH_MX1) += clock-imx1.o mm-imx1.o 9obj-$(CONFIG_ARCH_MX1) += clock-imx1.o mm-imx1.o
10obj-$(CONFIG_MACH_MX21) += clock-imx21.o mm-imx21.o 10obj-$(CONFIG_MACH_MX21) += clock-imx21.o mm-imx21.o
11 11
12obj-$(CONFIG_ARCH_MX25) += clock-imx25.o mm-imx25.o 12obj-$(CONFIG_ARCH_MX25) += clock-imx25.o mm-imx25.o ehci-imx25.o
13 13
14obj-$(CONFIG_MACH_MX27) += cpu-imx27.o pm-imx27.o 14obj-$(CONFIG_MACH_MX27) += cpu-imx27.o pm-imx27.o
15obj-$(CONFIG_MACH_MX27) += clock-imx27.o mm-imx27.o 15obj-$(CONFIG_MACH_MX27) += clock-imx27.o mm-imx27.o ehci-imx27.o
16 16
17# Support for CMOS sensor interface 17# Support for CMOS sensor interface
18obj-$(CONFIG_MX1_VIDEO) += mx1-camera-fiq.o mx1-camera-fiq-ksym.o 18obj-$(CONFIG_MX1_VIDEO) += mx1-camera-fiq.o mx1-camera-fiq-ksym.o
@@ -36,3 +36,4 @@ obj-$(CONFIG_MACH_CPUIMX27) += mach-cpuimx27.o
36obj-$(CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD) += eukrea_mbimx27-baseboard.o 36obj-$(CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD) += eukrea_mbimx27-baseboard.o
37obj-$(CONFIG_MACH_PCA100) += mach-pca100.o 37obj-$(CONFIG_MACH_PCA100) += mach-pca100.o
38obj-$(CONFIG_MACH_MXT_TD60) += mach-mxt_td60.o 38obj-$(CONFIG_MACH_MXT_TD60) += mach-mxt_td60.o
39obj-$(CONFIG_MACH_IMX27IPCAM) += mach-imx27ipcam.o
diff --git a/arch/arm/mach-imx/clock-imx1.c b/arch/arm/mach-imx/clock-imx1.c
index 3938a563b280..dcc41728fe72 100644
--- a/arch/arm/mach-imx/clock-imx1.c
+++ b/arch/arm/mach-imx/clock-imx1.c
@@ -592,6 +592,7 @@ static struct clk_lookup lookups[] __initdata = {
592 _REGISTER_CLOCK("imx-uart.2", NULL, uart_clk) 592 _REGISTER_CLOCK("imx-uart.2", NULL, uart_clk)
593 _REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk) 593 _REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk)
594 _REGISTER_CLOCK("imx1-cspi.0", NULL, spi_clk) 594 _REGISTER_CLOCK("imx1-cspi.0", NULL, spi_clk)
595 _REGISTER_CLOCK("imx1-cspi.1", NULL, spi_clk)
595 _REGISTER_CLOCK("imx-mmc.0", NULL, sdhc_clk) 596 _REGISTER_CLOCK("imx-mmc.0", NULL, sdhc_clk)
596 _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk) 597 _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk)
597 _REGISTER_CLOCK(NULL, "mshc", mshc_clk) 598 _REGISTER_CLOCK(NULL, "mshc", mshc_clk)
diff --git a/arch/arm/mach-imx/clock-imx25.c b/arch/arm/mach-imx/clock-imx25.c
index daa0165b6772..a65838fc061c 100644
--- a/arch/arm/mach-imx/clock-imx25.c
+++ b/arch/arm/mach-imx/clock-imx25.c
@@ -228,6 +228,7 @@ DEFINE_CLOCK(esdhc1_per_clk, 0, CCM_CGCR0, 3, get_rate_esdhc1, NULL,
228DEFINE_CLOCK(esdhc2_ahb_clk, 0, CCM_CGCR0, 22, get_rate_esdhc2, NULL, NULL); 228DEFINE_CLOCK(esdhc2_ahb_clk, 0, CCM_CGCR0, 22, get_rate_esdhc2, NULL, NULL);
229DEFINE_CLOCK(esdhc2_per_clk, 0, CCM_CGCR0, 4, get_rate_esdhc2, NULL, 229DEFINE_CLOCK(esdhc2_per_clk, 0, CCM_CGCR0, 4, get_rate_esdhc2, NULL,
230 &esdhc2_ahb_clk); 230 &esdhc2_ahb_clk);
231DEFINE_CLOCK(sdma_ahb_clk, 0, CCM_CGCR0, 26, NULL, NULL, NULL);
231DEFINE_CLOCK(fec_ahb_clk, 0, CCM_CGCR0, 23, NULL, NULL, NULL); 232DEFINE_CLOCK(fec_ahb_clk, 0, CCM_CGCR0, 23, NULL, NULL, NULL);
232DEFINE_CLOCK(lcdc_ahb_clk, 0, CCM_CGCR0, 24, NULL, NULL, NULL); 233DEFINE_CLOCK(lcdc_ahb_clk, 0, CCM_CGCR0, 24, NULL, NULL, NULL);
233DEFINE_CLOCK(lcdc_per_clk, 0, CCM_CGCR0, 7, NULL, NULL, &lcdc_ahb_clk); 234DEFINE_CLOCK(lcdc_per_clk, 0, CCM_CGCR0, 7, NULL, NULL, &lcdc_ahb_clk);
@@ -253,6 +254,7 @@ DEFINE_CLOCK(lcdc_clk, 0, CCM_CGCR1, 29, get_rate_lcdc, NULL, &lcdc_per_clk);
253DEFINE_CLOCK(wdt_clk, 0, CCM_CGCR2, 19, get_rate_ipg, NULL, NULL); 254DEFINE_CLOCK(wdt_clk, 0, CCM_CGCR2, 19, get_rate_ipg, NULL, NULL);
254DEFINE_CLOCK(ssi1_clk, 0, CCM_CGCR2, 11, get_rate_ssi1, NULL, &ssi1_per_clk); 255DEFINE_CLOCK(ssi1_clk, 0, CCM_CGCR2, 11, get_rate_ssi1, NULL, &ssi1_per_clk);
255DEFINE_CLOCK(ssi2_clk, 1, CCM_CGCR2, 12, get_rate_ssi2, NULL, &ssi2_per_clk); 256DEFINE_CLOCK(ssi2_clk, 1, CCM_CGCR2, 12, get_rate_ssi2, NULL, &ssi2_per_clk);
257DEFINE_CLOCK(sdma_clk, 0, CCM_CGCR2, 6, get_rate_ipg, NULL, &sdma_ahb_clk);
256DEFINE_CLOCK(esdhc1_clk, 0, CCM_CGCR1, 13, get_rate_esdhc1, NULL, 258DEFINE_CLOCK(esdhc1_clk, 0, CCM_CGCR1, 13, get_rate_esdhc1, NULL,
257 &esdhc1_per_clk); 259 &esdhc1_per_clk);
258DEFINE_CLOCK(esdhc2_clk, 1, CCM_CGCR1, 14, get_rate_esdhc2, NULL, 260DEFINE_CLOCK(esdhc2_clk, 1, CCM_CGCR1, 14, get_rate_esdhc2, NULL,
@@ -304,6 +306,7 @@ static struct clk_lookup lookups[] = {
304 _REGISTER_CLOCK(NULL, "audmux", audmux_clk) 306 _REGISTER_CLOCK(NULL, "audmux", audmux_clk)
305 _REGISTER_CLOCK("flexcan.0", NULL, can1_clk) 307 _REGISTER_CLOCK("flexcan.0", NULL, can1_clk)
306 _REGISTER_CLOCK("flexcan.1", NULL, can2_clk) 308 _REGISTER_CLOCK("flexcan.1", NULL, can2_clk)
309 _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk)
307}; 310};
308 311
309int __init mx25_clocks_init(void) 312int __init mx25_clocks_init(void)
diff --git a/arch/arm/mach-imx/devices-imx1.h b/arch/arm/mach-imx/devices-imx1.h
index 81979486218e..da593657ff3f 100644
--- a/arch/arm/mach-imx/devices-imx1.h
+++ b/arch/arm/mach-imx/devices-imx1.h
@@ -9,6 +9,10 @@
9#include <mach/mx1.h> 9#include <mach/mx1.h>
10#include <mach/devices-common.h> 10#include <mach/devices-common.h>
11 11
12extern const struct imx_imx_fb_data imx1_imx_fb_data __initconst;
13#define imx1_add_imx_fb(pdata) \
14 imx_add_imx_fb(&imx1_imx_fb_data, pdata)
15
12extern const struct imx_imx_i2c_data imx1_imx_i2c_data __initconst; 16extern const struct imx_imx_i2c_data imx1_imx_i2c_data __initconst;
13#define imx1_add_imx_i2c(pdata) \ 17#define imx1_add_imx_i2c(pdata) \
14 imx_add_imx_i2c(&imx1_imx_i2c_data, pdata) 18 imx_add_imx_i2c(&imx1_imx_i2c_data, pdata)
@@ -18,3 +22,10 @@ extern const struct imx_imx_uart_3irq_data imx1_imx_uart_data[] __initconst;
18 imx_add_imx_uart_3irq(&imx1_imx_uart_data[id], pdata) 22 imx_add_imx_uart_3irq(&imx1_imx_uart_data[id], pdata)
19#define imx1_add_imx_uart0(pdata) imx1_add_imx_uart(0, pdata) 23#define imx1_add_imx_uart0(pdata) imx1_add_imx_uart(0, pdata)
20#define imx1_add_imx_uart1(pdata) imx1_add_imx_uart(1, pdata) 24#define imx1_add_imx_uart1(pdata) imx1_add_imx_uart(1, pdata)
25
26extern const struct imx_spi_imx_data imx1_cspi_data[] __initconst;
27#define imx1_add_cspi(id, pdata) \
28 imx_add_spi_imx(&imx1_cspi_data[id], pdata)
29
30#define imx1_add_spi_imx0(pdata) imx1_add_cspi(0, pdata)
31#define imx1_add_spi_imx1(pdata) imx1_add_cspi(1, pdata)
diff --git a/arch/arm/mach-imx/devices-imx25.h b/arch/arm/mach-imx/devices-imx25.h
index bde33caf1b90..b591d72f6037 100644
--- a/arch/arm/mach-imx/devices-imx25.h
+++ b/arch/arm/mach-imx/devices-imx25.h
@@ -81,7 +81,11 @@ imx25_sdhci_esdhc_imx_data[] __initconst;
81 81
82extern const struct imx_spi_imx_data imx25_cspi_data[] __initconst; 82extern const struct imx_spi_imx_data imx25_cspi_data[] __initconst;
83#define imx25_add_spi_imx(id, pdata) \ 83#define imx25_add_spi_imx(id, pdata) \
84 imx_add_spi_imx(&imx25_spi_imx_data[id], pdata) 84 imx_add_spi_imx(&imx25_cspi_data[id], pdata)
85#define imx25_add_spi_imx0(pdata) imx25_add_spi_imx(0, pdata) 85#define imx25_add_spi_imx0(pdata) imx25_add_spi_imx(0, pdata)
86#define imx25_add_spi_imx1(pdata) imx25_add_spi_imx(1, pdata) 86#define imx25_add_spi_imx1(pdata) imx25_add_spi_imx(1, pdata)
87#define imx25_add_spi_imx2(pdata) imx25_add_spi_imx(2, pdata) 87#define imx25_add_spi_imx2(pdata) imx25_add_spi_imx(2, pdata)
88
89extern struct imx_mxc_pwm_data imx25_mxc_pwm_data[] __initconst;
90#define imx25_add_mxc_pwm(id) \
91 imx_add_mxc_pwm(&imx25_mxc_pwm_data[id])
diff --git a/arch/arm/mach-imx/dma-v1.c b/arch/arm/mach-imx/dma-v1.c
index e9f1769b49f5..236f1495efad 100644
--- a/arch/arm/mach-imx/dma-v1.c
+++ b/arch/arm/mach-imx/dma-v1.c
@@ -699,7 +699,7 @@ int imx_dma_request(int channel, const char *name)
699 local_irq_restore(flags); 699 local_irq_restore(flags);
700 return -EBUSY; 700 return -EBUSY;
701 } 701 }
702 memset(imxdma, 0, sizeof(imxdma)); 702 memset(imxdma, 0, sizeof(*imxdma));
703 imxdma->name = name; 703 imxdma->name = name;
704 local_irq_restore(flags); /* request_irq() can block */ 704 local_irq_restore(flags); /* request_irq() can block */
705 705
diff --git a/arch/arm/mach-imx/ehci-imx25.c b/arch/arm/mach-imx/ehci-imx25.c
new file mode 100644
index 000000000000..865daf0b09e9
--- /dev/null
+++ b/arch/arm/mach-imx/ehci-imx25.c
@@ -0,0 +1,80 @@
1/*
2 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
3 * Copyright (C) 2010 Freescale Semiconductor, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16#include <linux/platform_device.h>
17#include <linux/io.h>
18
19#include <mach/hardware.h>
20#include <mach/mxc_ehci.h>
21
22#define USBCTRL_OTGBASE_OFFSET 0x600
23
24#define MX25_OTG_SIC_SHIFT 29
25#define MX25_OTG_SIC_MASK (0x3 << MX25_OTG_SIC_SHIFT)
26#define MX25_OTG_PM_BIT (1 << 24)
27
28#define MX25_H1_SIC_SHIFT 21
29#define MX25_H1_SIC_MASK (0x3 << MX25_H1_SIC_SHIFT)
30#define MX25_H1_PM_BIT (1 << 8)
31#define MX25_H1_IPPUE_UP_BIT (1 << 7)
32#define MX25_H1_IPPUE_DOWN_BIT (1 << 6)
33#define MX25_H1_TLL_BIT (1 << 5)
34#define MX25_H1_USBTE_BIT (1 << 4)
35
36int mx25_initialize_usb_hw(int port, unsigned int flags)
37{
38 unsigned int v;
39
40 v = readl(MX25_IO_ADDRESS(MX25_USB_BASE_ADDR + USBCTRL_OTGBASE_OFFSET));
41
42 switch (port) {
43 case 0: /* OTG port */
44 v &= ~(MX25_OTG_SIC_MASK | MX25_OTG_PM_BIT);
45 v |= (flags & MXC_EHCI_INTERFACE_MASK) << MX25_OTG_SIC_SHIFT;
46
47 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
48 v |= MX25_OTG_PM_BIT;
49
50 break;
51 case 1: /* H1 port */
52 v &= ~(MX25_H1_SIC_MASK | MX25_H1_PM_BIT | MX25_H1_TLL_BIT |
53 MX25_H1_USBTE_BIT | MX25_H1_IPPUE_DOWN_BIT | MX25_H1_IPPUE_UP_BIT);
54 v |= (flags & MXC_EHCI_INTERFACE_MASK) << MX25_H1_SIC_SHIFT;
55
56 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
57 v |= MX25_H1_PM_BIT;
58
59 if (!(flags & MXC_EHCI_TTL_ENABLED))
60 v |= MX25_H1_TLL_BIT;
61
62 if (flags & MXC_EHCI_INTERNAL_PHY)
63 v |= MX25_H1_USBTE_BIT;
64
65 if (flags & MXC_EHCI_IPPUE_DOWN)
66 v |= MX25_H1_IPPUE_DOWN_BIT;
67
68 if (flags & MXC_EHCI_IPPUE_UP)
69 v |= MX25_H1_IPPUE_UP_BIT;
70
71 break;
72 default:
73 return -EINVAL;
74 }
75
76 writel(v, MX25_IO_ADDRESS(MX25_USB_BASE_ADDR + USBCTRL_OTGBASE_OFFSET));
77
78 return 0;
79}
80
diff --git a/arch/arm/mach-imx/ehci-imx27.c b/arch/arm/mach-imx/ehci-imx27.c
new file mode 100644
index 000000000000..fa69419eabdd
--- /dev/null
+++ b/arch/arm/mach-imx/ehci-imx27.c
@@ -0,0 +1,82 @@
1/*
2 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
3 * Copyright (C) 2010 Freescale Semiconductor, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16#include <linux/platform_device.h>
17#include <linux/io.h>
18
19#include <mach/hardware.h>
20#include <mach/mxc_ehci.h>
21
22#define USBCTRL_OTGBASE_OFFSET 0x600
23
24#define MX27_OTG_SIC_SHIFT 29
25#define MX27_OTG_SIC_MASK (0x3 << MX27_OTG_SIC_SHIFT)
26#define MX27_OTG_PM_BIT (1 << 24)
27
28#define MX27_H2_SIC_SHIFT 21
29#define MX27_H2_SIC_MASK (0x3 << MX27_H2_SIC_SHIFT)
30#define MX27_H2_PM_BIT (1 << 16)
31#define MX27_H2_DT_BIT (1 << 5)
32
33#define MX27_H1_SIC_SHIFT 13
34#define MX27_H1_SIC_MASK (0x3 << MX27_H1_SIC_SHIFT)
35#define MX27_H1_PM_BIT (1 << 8)
36#define MX27_H1_DT_BIT (1 << 4)
37
38int mx27_initialize_usb_hw(int port, unsigned int flags)
39{
40 unsigned int v;
41
42 v = readl(MX27_IO_ADDRESS(MX27_USB_BASE_ADDR + USBCTRL_OTGBASE_OFFSET));
43
44 switch (port) {
45 case 0: /* OTG port */
46 v &= ~(MX27_OTG_SIC_MASK | MX27_OTG_PM_BIT);
47 v |= (flags & MXC_EHCI_INTERFACE_MASK) << MX27_OTG_SIC_SHIFT;
48
49 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
50 v |= MX27_OTG_PM_BIT;
51 break;
52 case 1: /* H1 port */
53 v &= ~(MX27_H1_SIC_MASK | MX27_H1_PM_BIT | MX27_H1_DT_BIT);
54 v |= (flags & MXC_EHCI_INTERFACE_MASK) << MX27_H1_SIC_SHIFT;
55
56 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
57 v |= MX27_H1_PM_BIT;
58
59 if (!(flags & MXC_EHCI_TTL_ENABLED))
60 v |= MX27_H1_DT_BIT;
61
62 break;
63 case 2: /* H2 port */
64 v &= ~(MX27_H2_SIC_MASK | MX27_H2_PM_BIT | MX27_H2_DT_BIT);
65 v |= (flags & MXC_EHCI_INTERFACE_MASK) << MX27_H2_SIC_SHIFT;
66
67 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
68 v |= MX27_H2_PM_BIT;
69
70 if (!(flags & MXC_EHCI_TTL_ENABLED))
71 v |= MX27_H2_DT_BIT;
72
73 break;
74 default:
75 return -EINVAL;
76 }
77
78 writel(v, MX27_IO_ADDRESS(MX27_USB_BASE_ADDR + USBCTRL_OTGBASE_OFFSET));
79
80 return 0;
81}
82
diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
index 275c8589d797..fa5288018ba7 100644
--- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
@@ -249,7 +249,7 @@ static const struct imxuart_platform_data uart_pdata __initconst = {
249 249
250#define ADS7846_PENDOWN (GPIO_PORTD | 25) 250#define ADS7846_PENDOWN (GPIO_PORTD | 25)
251 251
252static void ads7846_dev_init(void) 252static void __maybe_unused ads7846_dev_init(void)
253{ 253{
254 if (gpio_request(ADS7846_PENDOWN, "ADS7846 pendown") < 0) { 254 if (gpio_request(ADS7846_PENDOWN, "ADS7846 pendown") < 0) {
255 printk(KERN_ERR "can't get ads746 pen down GPIO\n"); 255 printk(KERN_ERR "can't get ads746 pen down GPIO\n");
@@ -268,7 +268,8 @@ static struct ads7846_platform_data ads7846_config __initdata = {
268 .keep_vref_on = 1, 268 .keep_vref_on = 1,
269}; 269};
270 270
271static struct spi_board_info eukrea_mbimx27_spi_board_info[] __initdata = { 271static struct spi_board_info __maybe_unused
272 eukrea_mbimx27_spi_board_info[] __initdata = {
272 [0] = { 273 [0] = {
273 .modalias = "ads7846", 274 .modalias = "ads7846",
274 .bus_num = 0, 275 .bus_num = 0,
@@ -357,13 +358,11 @@ void __init eukrea_mbimx27_baseboard_init(void)
357 ads7846_dev_init(); 358 ads7846_dev_init();
358#endif 359#endif
359 360
360#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
361 /* SPI_CS0 init */ 361 /* SPI_CS0 init */
362 mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT); 362 mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT);
363 imx27_add_spi_imx0(&eukrea_mbimx27_spi0_data); 363 imx27_add_spi_imx0(&eukrea_mbimx27_spi0_data);
364 spi_register_board_info(eukrea_mbimx27_spi_board_info, 364 spi_register_board_info(eukrea_mbimx27_spi_board_info,
365 ARRAY_SIZE(eukrea_mbimx27_spi_board_info)); 365 ARRAY_SIZE(eukrea_mbimx27_spi_board_info));
366#endif
367 366
368 /* Leds configuration */ 367 /* Leds configuration */
369 mxc_gpio_mode(GPIO_PORTF | 16 | GPIO_GPIO | GPIO_OUT); 368 mxc_gpio_mode(GPIO_PORTF | 16 | GPIO_GPIO | GPIO_OUT);
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c
index 6cf04da2456a..759299bb035b 100644
--- a/arch/arm/mach-imx/mach-cpuimx27.c
+++ b/arch/arm/mach-imx/mach-cpuimx27.c
@@ -209,17 +209,25 @@ static struct platform_device serial_device = {
209}; 209};
210#endif 210#endif
211 211
212#if defined(CONFIG_USB_ULPI) 212static int eukrea_cpuimx27_otg_init(struct platform_device *pdev)
213{
214 return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI);
215}
216
213static struct mxc_usbh_platform_data otg_pdata __initdata = { 217static struct mxc_usbh_platform_data otg_pdata __initdata = {
218 .init = eukrea_cpuimx27_otg_init,
214 .portsc = MXC_EHCI_MODE_ULPI, 219 .portsc = MXC_EHCI_MODE_ULPI,
215 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
216}; 220};
217 221
222static int eukrea_cpuimx27_usbh2_init(struct platform_device *pdev)
223{
224 return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI);
225}
226
218static struct mxc_usbh_platform_data usbh2_pdata __initdata = { 227static struct mxc_usbh_platform_data usbh2_pdata __initdata = {
228 .init = eukrea_cpuimx27_usbh2_init,
219 .portsc = MXC_EHCI_MODE_ULPI, 229 .portsc = MXC_EHCI_MODE_ULPI,
220 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
221}; 230};
222#endif
223 231
224static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { 232static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
225 .operating_mode = FSL_USB2_DR_DEVICE, 233 .operating_mode = FSL_USB2_DR_DEVICE,
@@ -273,21 +281,19 @@ static void __init eukrea_cpuimx27_init(void)
273 platform_device_register(&serial_device); 281 platform_device_register(&serial_device);
274#endif 282#endif
275 283
276#if defined(CONFIG_USB_ULPI)
277 if (otg_mode_host) { 284 if (otg_mode_host) {
278 otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 285 otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
279 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); 286 ULPI_OTG_DRVVBUS_EXT);
280 287 if (otg_pdata.otg)
281 imx27_add_mxc_ehci_otg(&otg_pdata); 288 imx27_add_mxc_ehci_otg(&otg_pdata);
289 } else {
290 imx27_add_fsl_usb2_udc(&otg_device_pdata);
282 } 291 }
283 292
284 usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 293 usbh2_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
285 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); 294 ULPI_OTG_DRVVBUS_EXT);
286 295 if (usbh2_pdata.otg)
287 imx27_add_mxc_ehci_hs(2, &usbh2_pdata); 296 imx27_add_mxc_ehci_hs(2, &usbh2_pdata);
288#endif
289 if (!otg_mode_host)
290 imx27_add_fsl_usb2_udc(&otg_device_pdata);
291 297
292#ifdef CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD 298#ifdef CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD
293 eukrea_mbimx27_baseboard_init(); 299 eukrea_mbimx27_baseboard_init();
@@ -304,9 +310,10 @@ static struct sys_timer eukrea_cpuimx27_timer = {
304}; 310};
305 311
306MACHINE_START(CPUIMX27, "EUKREA CPUIMX27") 312MACHINE_START(CPUIMX27, "EUKREA CPUIMX27")
307 .boot_params = MX27_PHYS_OFFSET + 0x100, 313 .boot_params = MX27_PHYS_OFFSET + 0x100,
308 .map_io = mx27_map_io, 314 .map_io = mx27_map_io,
309 .init_irq = mx27_init_irq, 315 .init_early = imx27_init_early,
310 .init_machine = eukrea_cpuimx27_init, 316 .init_irq = mx27_init_irq,
311 .timer = &eukrea_cpuimx27_timer, 317 .timer = &eukrea_cpuimx27_timer,
318 .init_machine = eukrea_cpuimx27_init,
312MACHINE_END 319MACHINE_END
diff --git a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
index eb395aba9237..9da8d18eeb00 100644
--- a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
+++ b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
@@ -84,15 +84,25 @@ static struct i2c_board_info eukrea_cpuimx25_i2c_devices[] = {
84 }, 84 },
85}; 85};
86 86
87static int eukrea_cpuimx25_otg_init(struct platform_device *pdev)
88{
89 return mx25_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI);
90}
91
87static const struct mxc_usbh_platform_data otg_pdata __initconst = { 92static const struct mxc_usbh_platform_data otg_pdata __initconst = {
93 .init = eukrea_cpuimx25_otg_init,
88 .portsc = MXC_EHCI_MODE_UTMI, 94 .portsc = MXC_EHCI_MODE_UTMI,
89 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
90}; 95};
91 96
97static int eukrea_cpuimx25_usbh2_init(struct platform_device *pdev)
98{
99 return mx25_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_SINGLE_UNI |
100 MXC_EHCI_INTERNAL_PHY | MXC_EHCI_IPPUE_DOWN);
101}
102
92static const struct mxc_usbh_platform_data usbh2_pdata __initconst = { 103static const struct mxc_usbh_platform_data usbh2_pdata __initconst = {
104 .init = eukrea_cpuimx25_usbh2_init,
93 .portsc = MXC_EHCI_MODE_SERIAL, 105 .portsc = MXC_EHCI_MODE_SERIAL,
94 .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY |
95 MXC_EHCI_IPPUE_DOWN,
96}; 106};
97 107
98static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { 108static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
@@ -153,9 +163,10 @@ static struct sys_timer eukrea_cpuimx25_timer = {
153 163
154MACHINE_START(EUKREA_CPUIMX25, "Eukrea CPUIMX25") 164MACHINE_START(EUKREA_CPUIMX25, "Eukrea CPUIMX25")
155 /* Maintainer: Eukrea Electromatique */ 165 /* Maintainer: Eukrea Electromatique */
156 .boot_params = MX25_PHYS_OFFSET + 0x100, 166 .boot_params = MX25_PHYS_OFFSET + 0x100,
157 .map_io = mx25_map_io, 167 .map_io = mx25_map_io,
158 .init_irq = mx25_init_irq, 168 .init_early = imx25_init_early,
159 .init_machine = eukrea_cpuimx25_init, 169 .init_irq = mx25_init_irq,
160 .timer = &eukrea_cpuimx25_timer, 170 .timer = &eukrea_cpuimx25_timer,
171 .init_machine = eukrea_cpuimx25_init,
161MACHINE_END 172MACHINE_END
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
index 40a3666ea632..d7e0d219726a 100644
--- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
+++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
@@ -30,6 +30,7 @@
30#include <linux/gpio_keys.h> 30#include <linux/gpio_keys.h>
31#include <linux/input.h> 31#include <linux/input.h>
32#include <linux/gpio.h> 32#include <linux/gpio.h>
33#include <linux/delay.h>
33#include <asm/mach-types.h> 34#include <asm/mach-types.h>
34#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
35#include <asm/mach/time.h> 36#include <asm/mach/time.h>
@@ -66,6 +67,11 @@ static const int visstrim_m10_pins[] __initconst = {
66 PD15_AOUT_FEC_COL, 67 PD15_AOUT_FEC_COL,
67 PD16_AIN_FEC_TX_ER, 68 PD16_AIN_FEC_TX_ER,
68 PF23_AIN_FEC_TX_EN, 69 PF23_AIN_FEC_TX_EN,
70 /* SSI1 */
71 PC20_PF_SSI1_FS,
72 PC21_PF_SSI1_RXD,
73 PC22_PF_SSI1_TXD,
74 PC23_PF_SSI1_CLK,
69 /* SDHC1 */ 75 /* SDHC1 */
70 PE18_PF_SD1_D0, 76 PE18_PF_SD1_D0,
71 PE19_PF_SD1_D1, 77 PE19_PF_SD1_D1,
@@ -204,20 +210,30 @@ static struct i2c_board_info visstrim_m10_i2c_devices[] = {
204 I2C_BOARD_INFO("pca9555", 0x20), 210 I2C_BOARD_INFO("pca9555", 0x20),
205 .platform_data = &visstrim_m10_pca9555_pdata, 211 .platform_data = &visstrim_m10_pca9555_pdata,
206 }, 212 },
213 {
214 I2C_BOARD_INFO("tlv320aic32x4", 0x18),
215 }
207}; 216};
208 217
209/* USB OTG */ 218/* USB OTG */
210static int otg_phy_init(struct platform_device *pdev) 219static int otg_phy_init(struct platform_device *pdev)
211{ 220{
212 gpio_set_value(OTG_PHY_CS_GPIO, 0); 221 gpio_set_value(OTG_PHY_CS_GPIO, 0);
213 return 0; 222
223 mdelay(10);
224
225 return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED);
214} 226}
215 227
216static const struct mxc_usbh_platform_data 228static const struct mxc_usbh_platform_data
217visstrim_m10_usbotg_pdata __initconst = { 229visstrim_m10_usbotg_pdata __initconst = {
218 .init = otg_phy_init, 230 .init = otg_phy_init,
219 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, 231 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT,
220 .flags = MXC_EHCI_POWER_PINS_ENABLED, 232};
233
234/* SSI */
235static const struct imx_ssi_platform_data visstrim_m10_ssi_pdata __initconst = {
236 .flags = IMX_SSI_DMA | IMX_SSI_SYN,
221}; 237};
222 238
223static void __init visstrim_m10_board_init(void) 239static void __init visstrim_m10_board_init(void)
@@ -229,6 +245,7 @@ static void __init visstrim_m10_board_init(void)
229 if (ret) 245 if (ret)
230 pr_err("Failed to setup pins (%d)\n", ret); 246 pr_err("Failed to setup pins (%d)\n", ret);
231 247
248 imx27_add_imx_ssi(0, &visstrim_m10_ssi_pdata);
232 imx27_add_imx_uart0(&uart_pdata); 249 imx27_add_imx_uart0(&uart_pdata);
233 250
234 i2c_register_board_info(0, visstrim_m10_i2c_devices, 251 i2c_register_board_info(0, visstrim_m10_i2c_devices,
@@ -251,9 +268,10 @@ static struct sys_timer visstrim_m10_timer = {
251}; 268};
252 269
253MACHINE_START(IMX27_VISSTRIM_M10, "Vista Silicon Visstrim_M10") 270MACHINE_START(IMX27_VISSTRIM_M10, "Vista Silicon Visstrim_M10")
254 .boot_params = MX27_PHYS_OFFSET + 0x100, 271 .boot_params = MX27_PHYS_OFFSET + 0x100,
255 .map_io = mx27_map_io, 272 .map_io = mx27_map_io,
256 .init_irq = mx27_init_irq, 273 .init_early = imx27_init_early,
257 .init_machine = visstrim_m10_board_init, 274 .init_irq = mx27_init_irq,
258 .timer = &visstrim_m10_timer, 275 .timer = &visstrim_m10_timer,
276 .init_machine = visstrim_m10_board_init,
259MACHINE_END 277MACHINE_END
diff --git a/arch/arm/mach-imx/mach-imx27ipcam.c b/arch/arm/mach-imx/mach-imx27ipcam.c
new file mode 100644
index 000000000000..9be6cd6fbf8c
--- /dev/null
+++ b/arch/arm/mach-imx/mach-imx27ipcam.c
@@ -0,0 +1,78 @@
1/*
2 * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * Author: Fabio Estevam <fabio.estevam@freescale.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#include <asm/mach-types.h>
18#include <asm/mach/arch.h>
19#include <asm/mach/time.h>
20#include <mach/hardware.h>
21#include <mach/common.h>
22#include <mach/iomux-mx27.h>
23
24#include "devices-imx27.h"
25
26static const int mx27ipcam_pins[] __initconst = {
27 /* UART1 */
28 PE12_PF_UART1_TXD,
29 PE13_PF_UART1_RXD,
30 /* FEC */
31 PD0_AIN_FEC_TXD0,
32 PD1_AIN_FEC_TXD1,
33 PD2_AIN_FEC_TXD2,
34 PD3_AIN_FEC_TXD3,
35 PD4_AOUT_FEC_RX_ER,
36 PD5_AOUT_FEC_RXD1,
37 PD6_AOUT_FEC_RXD2,
38 PD7_AOUT_FEC_RXD3,
39 PD8_AF_FEC_MDIO,
40 PD9_AIN_FEC_MDC,
41 PD10_AOUT_FEC_CRS,
42 PD11_AOUT_FEC_TX_CLK,
43 PD12_AOUT_FEC_RXD0,
44 PD13_AOUT_FEC_RX_DV,
45 PD14_AOUT_FEC_RX_CLK,
46 PD15_AOUT_FEC_COL,
47 PD16_AIN_FEC_TX_ER,
48 PF23_AIN_FEC_TX_EN,
49};
50
51static void __init mx27ipcam_init(void)
52{
53 mxc_gpio_setup_multiple_pins(mx27ipcam_pins, ARRAY_SIZE(mx27ipcam_pins),
54 "mx27ipcam");
55
56 imx27_add_imx_uart0(NULL);
57 imx27_add_fec(NULL);
58 imx27_add_imx2_wdt(NULL);
59}
60
61static void __init mx27ipcam_timer_init(void)
62{
63 mx27_clocks_init(25000000);
64}
65
66static struct sys_timer mx27ipcam_timer = {
67 .init = mx27ipcam_timer_init,
68};
69
70MACHINE_START(IMX27IPCAM, "Freescale IMX27IPCAM")
71 /* maintainer: Freescale Semiconductor, Inc. */
72 .boot_params = MX27_PHYS_OFFSET + 0x100,
73 .map_io = mx27_map_io,
74 .init_early = imx27_init_early,
75 .init_irq = mx27_init_irq,
76 .timer = &mx27ipcam_timer,
77 .init_machine = mx27ipcam_init,
78MACHINE_END
diff --git a/arch/arm/mach-imx/mach-imx27lite.c b/arch/arm/mach-imx/mach-imx27lite.c
index 3a1202e47212..841140516ede 100644
--- a/arch/arm/mach-imx/mach-imx27lite.c
+++ b/arch/arm/mach-imx/mach-imx27lite.c
@@ -75,9 +75,10 @@ static struct sys_timer mx27lite_timer = {
75}; 75};
76 76
77MACHINE_START(IMX27LITE, "LogicPD i.MX27LITE") 77MACHINE_START(IMX27LITE, "LogicPD i.MX27LITE")
78 .boot_params = MX27_PHYS_OFFSET + 0x100, 78 .boot_params = MX27_PHYS_OFFSET + 0x100,
79 .map_io = mx27_map_io, 79 .map_io = mx27_map_io,
80 .init_irq = mx27_init_irq, 80 .init_early = imx27_init_early,
81 .init_machine = mx27lite_init, 81 .init_irq = mx27_init_irq,
82 .timer = &mx27lite_timer, 82 .timer = &mx27lite_timer,
83 .init_machine = mx27lite_init,
83MACHINE_END 84MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx1ads.c b/arch/arm/mach-imx/mach-mx1ads.c
index 1f446e5eb636..47cf56ac6d5b 100644
--- a/arch/arm/mach-imx/mach-mx1ads.c
+++ b/arch/arm/mach-imx/mach-mx1ads.c
@@ -144,17 +144,19 @@ struct sys_timer mx1ads_timer = {
144 144
145MACHINE_START(MX1ADS, "Freescale MX1ADS") 145MACHINE_START(MX1ADS, "Freescale MX1ADS")
146 /* Maintainer: Sascha Hauer, Pengutronix */ 146 /* Maintainer: Sascha Hauer, Pengutronix */
147 .boot_params = MX1_PHYS_OFFSET + 0x100, 147 .boot_params = MX1_PHYS_OFFSET + 0x100,
148 .map_io = mx1_map_io, 148 .map_io = mx1_map_io,
149 .init_irq = mx1_init_irq, 149 .init_early = imx1_init_early,
150 .timer = &mx1ads_timer, 150 .init_irq = mx1_init_irq,
151 .init_machine = mx1ads_init, 151 .timer = &mx1ads_timer,
152 .init_machine = mx1ads_init,
152MACHINE_END 153MACHINE_END
153 154
154MACHINE_START(MXLADS, "Freescale MXLADS") 155MACHINE_START(MXLADS, "Freescale MXLADS")
155 .boot_params = MX1_PHYS_OFFSET + 0x100, 156 .boot_params = MX1_PHYS_OFFSET + 0x100,
156 .map_io = mx1_map_io, 157 .map_io = mx1_map_io,
157 .init_irq = mx1_init_irq, 158 .init_early = imx1_init_early,
158 .timer = &mx1ads_timer, 159 .init_irq = mx1_init_irq,
159 .init_machine = mx1ads_init, 160 .timer = &mx1ads_timer,
161 .init_machine = mx1ads_init,
160MACHINE_END 162MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx21ads.c b/arch/arm/mach-imx/mach-mx21ads.c
index 0a372577c2ac..fa52a1086eae 100644
--- a/arch/arm/mach-imx/mach-mx21ads.c
+++ b/arch/arm/mach-imx/mach-mx21ads.c
@@ -304,9 +304,10 @@ static struct sys_timer mx21ads_timer = {
304 304
305MACHINE_START(MX21ADS, "Freescale i.MX21ADS") 305MACHINE_START(MX21ADS, "Freescale i.MX21ADS")
306 /* maintainer: Freescale Semiconductor, Inc. */ 306 /* maintainer: Freescale Semiconductor, Inc. */
307 .boot_params = MX21_PHYS_OFFSET + 0x100, 307 .boot_params = MX21_PHYS_OFFSET + 0x100,
308 .map_io = mx21ads_map_io, 308 .map_io = mx21ads_map_io,
309 .init_irq = mx21_init_irq, 309 .init_early = imx21_init_early,
310 .init_machine = mx21ads_board_init, 310 .init_irq = mx21_init_irq,
311 .timer = &mx21ads_timer, 311 .timer = &mx21ads_timer,
312 .init_machine = mx21ads_board_init,
312MACHINE_END 313MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx25_3ds.c b/arch/arm/mach-imx/mach-mx25_3ds.c
index aa76cfd9f348..06da438282aa 100644
--- a/arch/arm/mach-imx/mach-mx25_3ds.c
+++ b/arch/arm/mach-imx/mach-mx25_3ds.c
@@ -103,14 +103,18 @@ static iomux_v3_cfg_t mx25pdk_pads[] = {
103 MX25_PAD_SD1_DATA1__SD1_DATA1, 103 MX25_PAD_SD1_DATA1__SD1_DATA1,
104 MX25_PAD_SD1_DATA2__SD1_DATA2, 104 MX25_PAD_SD1_DATA2__SD1_DATA2,
105 MX25_PAD_SD1_DATA3__SD1_DATA3, 105 MX25_PAD_SD1_DATA3__SD1_DATA3,
106
107 /* I2C1 */
108 MX25_PAD_I2C1_CLK__I2C1_CLK,
109 MX25_PAD_I2C1_DAT__I2C1_DAT,
106}; 110};
107 111
108static const struct fec_platform_data mx25_fec_pdata __initconst = { 112static const struct fec_platform_data mx25_fec_pdata __initconst = {
109 .phy = PHY_INTERFACE_MODE_RMII, 113 .phy = PHY_INTERFACE_MODE_RMII,
110}; 114};
111 115
112#define FEC_ENABLE_GPIO 35 116#define FEC_ENABLE_GPIO IMX_GPIO_NR(2, 3)
113#define FEC_RESET_B_GPIO 104 117#define FEC_RESET_B_GPIO IMX_GPIO_NR(4, 8)
114 118
115static void __init mx25pdk_fec_reset(void) 119static void __init mx25pdk_fec_reset(void)
116{ 120{
@@ -180,14 +184,19 @@ static const uint32_t mx25pdk_keymap[] = {
180 KEY(3, 3, KEY_POWER), 184 KEY(3, 3, KEY_POWER),
181}; 185};
182 186
183static const struct matrix_keymap_data mx25pdk_keymap_data __initdata = { 187static const struct matrix_keymap_data mx25pdk_keymap_data __initconst = {
184 .keymap = mx25pdk_keymap, 188 .keymap = mx25pdk_keymap,
185 .keymap_size = ARRAY_SIZE(mx25pdk_keymap), 189 .keymap_size = ARRAY_SIZE(mx25pdk_keymap),
186}; 190};
187 191
192static int mx25pdk_usbh2_init(struct platform_device *pdev)
193{
194 return mx25_initialize_usb_hw(pdev->id, MXC_EHCI_INTERNAL_PHY);
195}
196
188static const struct mxc_usbh_platform_data usbh2_pdata __initconst = { 197static const struct mxc_usbh_platform_data usbh2_pdata __initconst = {
198 .init = mx25pdk_usbh2_init,
189 .portsc = MXC_EHCI_MODE_SERIAL, 199 .portsc = MXC_EHCI_MODE_SERIAL,
190 .flags = MXC_EHCI_INTERNAL_PHY,
191}; 200};
192 201
193static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { 202static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
@@ -195,6 +204,10 @@ static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
195 .phy_mode = FSL_USB2_PHY_UTMI, 204 .phy_mode = FSL_USB2_PHY_UTMI,
196}; 205};
197 206
207static const struct imxi2c_platform_data mx25_3ds_i2c0_data __initconst = {
208 .bitrate = 100000,
209};
210
198static void __init mx25pdk_init(void) 211static void __init mx25pdk_init(void)
199{ 212{
200 mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads, 213 mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads,
@@ -213,6 +226,7 @@ static void __init mx25pdk_init(void)
213 imx25_add_imx_keypad(&mx25pdk_keymap_data); 226 imx25_add_imx_keypad(&mx25pdk_keymap_data);
214 227
215 imx25_add_sdhci_esdhc_imx(0, NULL); 228 imx25_add_sdhci_esdhc_imx(0, NULL);
229 imx25_add_imx_i2c0(&mx25_3ds_i2c0_data);
216} 230}
217 231
218static void __init mx25pdk_timer_init(void) 232static void __init mx25pdk_timer_init(void)
@@ -226,10 +240,10 @@ static struct sys_timer mx25pdk_timer = {
226 240
227MACHINE_START(MX25_3DS, "Freescale MX25PDK (3DS)") 241MACHINE_START(MX25_3DS, "Freescale MX25PDK (3DS)")
228 /* Maintainer: Freescale Semiconductor, Inc. */ 242 /* Maintainer: Freescale Semiconductor, Inc. */
229 .boot_params = MX25_PHYS_OFFSET + 0x100, 243 .boot_params = MX25_PHYS_OFFSET + 0x100,
230 .map_io = mx25_map_io, 244 .map_io = mx25_map_io,
231 .init_irq = mx25_init_irq, 245 .init_early = imx25_init_early,
232 .init_machine = mx25pdk_init, 246 .init_irq = mx25_init_irq,
233 .timer = &mx25pdk_timer, 247 .timer = &mx25pdk_timer,
248 .init_machine = mx25pdk_init,
234MACHINE_END 249MACHINE_END
235
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index 164331518bdd..6e1accf93f81 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -98,6 +98,9 @@ static const int mx27pdk_pins[] __initconst = {
98 PD22_PF_CSPI2_SCLK, 98 PD22_PF_CSPI2_SCLK,
99 PD23_PF_CSPI2_MISO, 99 PD23_PF_CSPI2_MISO,
100 PD24_PF_CSPI2_MOSI, 100 PD24_PF_CSPI2_MOSI,
101 /* I2C1 */
102 PD17_PF_I2C_DATA,
103 PD18_PF_I2C_CLK,
101}; 104};
102 105
103static const struct imxuart_platform_data uart_pdata __initconst = { 106static const struct imxuart_platform_data uart_pdata __initconst = {
@@ -159,13 +162,15 @@ static int otg_phy_init(void)
159 return 0; 162 return 0;
160} 163}
161 164
162#if defined(CONFIG_USB_ULPI) 165static int mx27_3ds_otg_init(struct platform_device *pdev)
166{
167 return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI);
168}
163 169
164static struct mxc_usbh_platform_data otg_pdata __initdata = { 170static struct mxc_usbh_platform_data otg_pdata __initdata = {
171 .init = mx27_3ds_otg_init,
165 .portsc = MXC_EHCI_MODE_ULPI, 172 .portsc = MXC_EHCI_MODE_ULPI,
166 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
167}; 173};
168#endif
169 174
170static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { 175static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
171 .operating_mode = FSL_USB2_DR_DEVICE, 176 .operating_mode = FSL_USB2_DR_DEVICE,
@@ -216,7 +221,7 @@ static struct regulator_init_data vgen_init = {
216 .consumer_supplies = vgen_consumers, 221 .consumer_supplies = vgen_consumers,
217}; 222};
218 223
219static struct mc13783_regulator_init_data mx27_3ds_regulators[] = { 224static struct mc13xxx_regulator_init_data mx27_3ds_regulators[] = {
220 { 225 {
221 .id = MC13783_REG_VMMC1, 226 .id = MC13783_REG_VMMC1,
222 .init_data = &vmmc1_init, 227 .init_data = &vmmc1_init,
@@ -227,9 +232,12 @@ static struct mc13783_regulator_init_data mx27_3ds_regulators[] = {
227}; 232};
228 233
229/* MC13783 */ 234/* MC13783 */
230static struct mc13783_platform_data mc13783_pdata __initdata = { 235static struct mc13xxx_platform_data mc13783_pdata = {
231 .regulators = mx27_3ds_regulators, 236 .regulators = {
232 .num_regulators = ARRAY_SIZE(mx27_3ds_regulators), 237 .regulators = mx27_3ds_regulators,
238 .num_regulators = ARRAY_SIZE(mx27_3ds_regulators),
239
240 },
233 .flags = MC13783_USE_REGULATOR, 241 .flags = MC13783_USE_REGULATOR,
234}; 242};
235 243
@@ -253,6 +261,9 @@ static struct spi_board_info mx27_3ds_spi_devs[] __initdata = {
253 }, 261 },
254}; 262};
255 263
264static const struct imxi2c_platform_data mx27_3ds_i2c0_data __initconst = {
265 .bitrate = 100000,
266};
256 267
257static void __init mx27pdk_init(void) 268static void __init mx27pdk_init(void)
258{ 269{
@@ -265,14 +276,15 @@ static void __init mx27pdk_init(void)
265 imx27_add_mxc_mmc(0, &sdhc1_pdata); 276 imx27_add_mxc_mmc(0, &sdhc1_pdata);
266 imx27_add_imx2_wdt(NULL); 277 imx27_add_imx2_wdt(NULL);
267 otg_phy_init(); 278 otg_phy_init();
268#if defined(CONFIG_USB_ULPI) 279
269 if (otg_mode_host) { 280 if (otg_mode_host) {
270 otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 281 otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
271 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); 282 ULPI_OTG_DRVVBUS_EXT);
272 283
273 imx27_add_mxc_ehci_otg(&otg_pdata); 284 if (otg_pdata.otg)
285 imx27_add_mxc_ehci_otg(&otg_pdata);
274 } 286 }
275#endif 287
276 if (!otg_mode_host) 288 if (!otg_mode_host)
277 imx27_add_fsl_usb2_udc(&otg_device_pdata); 289 imx27_add_fsl_usb2_udc(&otg_device_pdata);
278 290
@@ -282,6 +294,7 @@ static void __init mx27pdk_init(void)
282 294
283 if (mxc_expio_init(MX27_CS5_BASE_ADDR, EXPIO_PARENT_INT)) 295 if (mxc_expio_init(MX27_CS5_BASE_ADDR, EXPIO_PARENT_INT))
284 pr_warn("Init of the debugboard failed, all devices on the debugboard are unusable.\n"); 296 pr_warn("Init of the debugboard failed, all devices on the debugboard are unusable.\n");
297 imx27_add_imx_i2c(0, &mx27_3ds_i2c0_data);
285} 298}
286 299
287static void __init mx27pdk_timer_init(void) 300static void __init mx27pdk_timer_init(void)
@@ -295,9 +308,10 @@ static struct sys_timer mx27pdk_timer = {
295 308
296MACHINE_START(MX27_3DS, "Freescale MX27PDK") 309MACHINE_START(MX27_3DS, "Freescale MX27PDK")
297 /* maintainer: Freescale Semiconductor, Inc. */ 310 /* maintainer: Freescale Semiconductor, Inc. */
298 .boot_params = MX27_PHYS_OFFSET + 0x100, 311 .boot_params = MX27_PHYS_OFFSET + 0x100,
299 .map_io = mx27_map_io, 312 .map_io = mx27_map_io,
300 .init_irq = mx27_init_irq, 313 .init_early = imx27_init_early,
301 .init_machine = mx27pdk_init, 314 .init_irq = mx27_init_irq,
302 .timer = &mx27pdk_timer, 315 .timer = &mx27pdk_timer,
316 .init_machine = mx27pdk_init,
303MACHINE_END 317MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
index b832f960fec4..367d1e4384c7 100644
--- a/arch/arm/mach-imx/mach-mx27ads.c
+++ b/arch/arm/mach-imx/mach-mx27ads.c
@@ -344,9 +344,10 @@ static void __init mx27ads_map_io(void)
344 344
345MACHINE_START(MX27ADS, "Freescale i.MX27ADS") 345MACHINE_START(MX27ADS, "Freescale i.MX27ADS")
346 /* maintainer: Freescale Semiconductor, Inc. */ 346 /* maintainer: Freescale Semiconductor, Inc. */
347 .boot_params = MX27_PHYS_OFFSET + 0x100, 347 .boot_params = MX27_PHYS_OFFSET + 0x100,
348 .map_io = mx27ads_map_io, 348 .map_io = mx27ads_map_io,
349 .init_irq = mx27_init_irq, 349 .init_early = imx27_init_early,
350 .init_machine = mx27ads_board_init, 350 .init_irq = mx27_init_irq,
351 .timer = &mx27ads_timer, 351 .timer = &mx27ads_timer,
352 .init_machine = mx27ads_board_init,
352MACHINE_END 353MACHINE_END
diff --git a/arch/arm/mach-imx/mach-mxt_td60.c b/arch/arm/mach-imx/mach-mxt_td60.c
index 4ce71b0401db..69787c30c320 100644
--- a/arch/arm/mach-imx/mach-mxt_td60.c
+++ b/arch/arm/mach-imx/mach-mxt_td60.c
@@ -266,10 +266,10 @@ static struct sys_timer mxt_td60_timer = {
266 266
267MACHINE_START(MXT_TD60, "Maxtrack i-MXT TD60") 267MACHINE_START(MXT_TD60, "Maxtrack i-MXT TD60")
268 /* maintainer: Maxtrack Industrial */ 268 /* maintainer: Maxtrack Industrial */
269 .boot_params = MX27_PHYS_OFFSET + 0x100, 269 .boot_params = MX27_PHYS_OFFSET + 0x100,
270 .map_io = mx27_map_io, 270 .map_io = mx27_map_io,
271 .init_irq = mx27_init_irq, 271 .init_early = imx27_init_early,
272 .init_machine = mxt_td60_board_init, 272 .init_irq = mx27_init_irq,
273 .timer = &mxt_td60_timer, 273 .timer = &mxt_td60_timer,
274 .init_machine = mxt_td60_board_init,
274MACHINE_END 275MACHINE_END
275
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c
index cccc0a0a9c72..63e182556778 100644
--- a/arch/arm/mach-imx/mach-pca100.c
+++ b/arch/arm/mach-imx/mach-pca100.c
@@ -187,7 +187,6 @@ static struct i2c_board_info pca100_i2c_devices[] = {
187 } 187 }
188}; 188};
189 189
190#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
191static struct spi_eeprom at25320 = { 190static struct spi_eeprom at25320 = {
192 .name = "at25320an", 191 .name = "at25320an",
193 .byte_len = 4096, 192 .byte_len = 4096,
@@ -211,7 +210,6 @@ static const struct spi_imx_master pca100_spi0_data __initconst = {
211 .chipselect = pca100_spi_cs, 210 .chipselect = pca100_spi_cs,
212 .num_chipselect = ARRAY_SIZE(pca100_spi_cs), 211 .num_chipselect = ARRAY_SIZE(pca100_spi_cs),
213}; 212};
214#endif
215 213
216static void pca100_ac97_warm_reset(struct snd_ac97 *ac97) 214static void pca100_ac97_warm_reset(struct snd_ac97 *ac97)
217{ 215{
@@ -269,31 +267,33 @@ static const struct imxmmc_platform_data sdhc_pdata __initconst = {
269 .exit = pca100_sdhc2_exit, 267 .exit = pca100_sdhc2_exit,
270}; 268};
271 269
272#if defined(CONFIG_USB_ULPI)
273static int otg_phy_init(struct platform_device *pdev) 270static int otg_phy_init(struct platform_device *pdev)
274{ 271{
275 gpio_set_value(OTG_PHY_CS_GPIO, 0); 272 gpio_set_value(OTG_PHY_CS_GPIO, 0);
276 return 0; 273
274 mdelay(10);
275
276 return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI);
277} 277}
278 278
279static struct mxc_usbh_platform_data otg_pdata __initdata = { 279static struct mxc_usbh_platform_data otg_pdata __initdata = {
280 .init = otg_phy_init, 280 .init = otg_phy_init,
281 .portsc = MXC_EHCI_MODE_ULPI, 281 .portsc = MXC_EHCI_MODE_ULPI,
282 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
283}; 282};
284 283
285static int usbh2_phy_init(struct platform_device *pdev) 284static int usbh2_phy_init(struct platform_device *pdev)
286{ 285{
287 gpio_set_value(USBH2_PHY_CS_GPIO, 0); 286 gpio_set_value(USBH2_PHY_CS_GPIO, 0);
288 return 0; 287
288 mdelay(10);
289
290 return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI);
289} 291}
290 292
291static struct mxc_usbh_platform_data usbh2_pdata __initdata = { 293static struct mxc_usbh_platform_data usbh2_pdata __initdata = {
292 .init = usbh2_phy_init, 294 .init = usbh2_phy_init,
293 .portsc = MXC_EHCI_MODE_ULPI, 295 .portsc = MXC_EHCI_MODE_ULPI,
294 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
295}; 296};
296#endif
297 297
298static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { 298static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
299 .operating_mode = FSL_USB2_DR_DEVICE, 299 .operating_mode = FSL_USB2_DR_DEVICE,
@@ -389,36 +389,33 @@ static void __init pca100_init(void)
389 389
390 imx27_add_imx_i2c(1, &pca100_i2c1_data); 390 imx27_add_imx_i2c(1, &pca100_i2c1_data);
391 391
392#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
393 mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_IN); 392 mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_IN);
394 mxc_gpio_mode(GPIO_PORTD | 27 | GPIO_GPIO | GPIO_IN); 393 mxc_gpio_mode(GPIO_PORTD | 27 | GPIO_GPIO | GPIO_IN);
395 spi_register_board_info(pca100_spi_board_info, 394 spi_register_board_info(pca100_spi_board_info,
396 ARRAY_SIZE(pca100_spi_board_info)); 395 ARRAY_SIZE(pca100_spi_board_info));
397 imx27_add_spi_imx0(&pca100_spi0_data); 396 imx27_add_spi_imx0(&pca100_spi0_data);
398#endif
399 397
400 gpio_request(OTG_PHY_CS_GPIO, "usb-otg-cs"); 398 gpio_request(OTG_PHY_CS_GPIO, "usb-otg-cs");
401 gpio_direction_output(OTG_PHY_CS_GPIO, 1); 399 gpio_direction_output(OTG_PHY_CS_GPIO, 1);
402 gpio_request(USBH2_PHY_CS_GPIO, "usb-host2-cs"); 400 gpio_request(USBH2_PHY_CS_GPIO, "usb-host2-cs");
403 gpio_direction_output(USBH2_PHY_CS_GPIO, 1); 401 gpio_direction_output(USBH2_PHY_CS_GPIO, 1);
404 402
405#if defined(CONFIG_USB_ULPI)
406 if (otg_mode_host) { 403 if (otg_mode_host) {
407 otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 404 otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
408 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); 405 ULPI_OTG_DRVVBUS_EXT);
409 406
410 imx27_add_mxc_ehci_otg(&otg_pdata); 407 if (otg_pdata.otg)
408 imx27_add_mxc_ehci_otg(&otg_pdata);
409 } else {
410 gpio_set_value(OTG_PHY_CS_GPIO, 0);
411 imx27_add_fsl_usb2_udc(&otg_device_pdata);
411 } 412 }
412 413
413 usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 414 usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
414 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); 415 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT);
415 416
416 imx27_add_mxc_ehci_hs(2, &usbh2_pdata); 417 if (usbh2_pdata.otg)
417#endif 418 imx27_add_mxc_ehci_hs(2, &usbh2_pdata);
418 if (!otg_mode_host) {
419 gpio_set_value(OTG_PHY_CS_GPIO, 0);
420 imx27_add_fsl_usb2_udc(&otg_device_pdata);
421 }
422 419
423 imx27_add_imx_fb(&pca100_fb_data); 420 imx27_add_imx_fb(&pca100_fb_data);
424 421
@@ -437,10 +434,10 @@ static struct sys_timer pca100_timer = {
437}; 434};
438 435
439MACHINE_START(PCA100, "phyCARD-i.MX27") 436MACHINE_START(PCA100, "phyCARD-i.MX27")
440 .boot_params = MX27_PHYS_OFFSET + 0x100, 437 .boot_params = MX27_PHYS_OFFSET + 0x100,
441 .map_io = mx27_map_io, 438 .map_io = mx27_map_io,
442 .init_irq = mx27_init_irq, 439 .init_early = imx27_init_early,
443 .init_machine = pca100_init, 440 .init_irq = mx27_init_irq,
444 .timer = &pca100_timer, 441 .init_machine = pca100_init,
442 .timer = &pca100_timer,
445MACHINE_END 443MACHINE_END
446
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c
index 505614803bc6..4cbce6d0fef1 100644
--- a/arch/arm/mach-imx/mach-pcm038.c
+++ b/arch/arm/mach-imx/mach-pcm038.c
@@ -252,7 +252,7 @@ static struct regulator_init_data cam_data = {
252 .consumer_supplies = cam_consumers, 252 .consumer_supplies = cam_consumers,
253}; 253};
254 254
255static struct mc13783_regulator_init_data pcm038_regulators[] = { 255static struct mc13xxx_regulator_init_data pcm038_regulators[] = {
256 { 256 {
257 .id = MC13783_REG_VCAM, 257 .id = MC13783_REG_VCAM,
258 .init_data = &cam_data, 258 .init_data = &cam_data,
@@ -262,9 +262,11 @@ static struct mc13783_regulator_init_data pcm038_regulators[] = {
262 }, 262 },
263}; 263};
264 264
265static struct mc13783_platform_data pcm038_pmic = { 265static struct mc13xxx_platform_data pcm038_pmic = {
266 .regulators = pcm038_regulators, 266 .regulators = {
267 .num_regulators = ARRAY_SIZE(pcm038_regulators), 267 .regulators = pcm038_regulators,
268 .num_regulators = ARRAY_SIZE(pcm038_regulators),
269 },
268 .flags = MC13783_USE_ADC | MC13783_USE_REGULATOR | 270 .flags = MC13783_USE_ADC | MC13783_USE_REGULATOR |
269 MC13783_USE_TOUCHSCREEN, 271 MC13783_USE_TOUCHSCREEN,
270}; 272};
@@ -281,9 +283,15 @@ static struct spi_board_info pcm038_spi_board_info[] __initdata = {
281 } 283 }
282}; 284};
283 285
286static int pcm038_usbh2_init(struct platform_device *pdev)
287{
288 return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED |
289 MXC_EHCI_INTERFACE_DIFF_UNI);
290}
291
284static const struct mxc_usbh_platform_data usbh2_pdata __initconst = { 292static const struct mxc_usbh_platform_data usbh2_pdata __initconst = {
293 .init = pcm038_usbh2_init,
285 .portsc = MXC_EHCI_MODE_ULPI, 294 .portsc = MXC_EHCI_MODE_ULPI,
286 .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI,
287}; 295};
288 296
289static void __init pcm038_init(void) 297static void __init pcm038_init(void)
@@ -340,9 +348,10 @@ static struct sys_timer pcm038_timer = {
340}; 348};
341 349
342MACHINE_START(PCM038, "phyCORE-i.MX27") 350MACHINE_START(PCM038, "phyCORE-i.MX27")
343 .boot_params = MX27_PHYS_OFFSET + 0x100, 351 .boot_params = MX27_PHYS_OFFSET + 0x100,
344 .map_io = mx27_map_io, 352 .map_io = mx27_map_io,
345 .init_irq = mx27_init_irq, 353 .init_early = imx27_init_early,
346 .init_machine = pcm038_init, 354 .init_irq = mx27_init_irq,
347 .timer = &pcm038_timer, 355 .timer = &pcm038_timer,
356 .init_machine = pcm038_init,
348MACHINE_END 357MACHINE_END
diff --git a/arch/arm/mach-imx/mach-scb9328.c b/arch/arm/mach-imx/mach-scb9328.c
index eae878f306c6..dcaee043628e 100644
--- a/arch/arm/mach-imx/mach-scb9328.c
+++ b/arch/arm/mach-imx/mach-scb9328.c
@@ -145,10 +145,11 @@ static struct sys_timer scb9328_timer = {
145}; 145};
146 146
147MACHINE_START(SCB9328, "Synertronixx scb9328") 147MACHINE_START(SCB9328, "Synertronixx scb9328")
148 /* Sascha Hauer */ 148 /* Sascha Hauer */
149 .boot_params = 0x08000100, 149 .boot_params = 0x08000100,
150 .map_io = mx1_map_io, 150 .map_io = mx1_map_io,
151 .init_irq = mx1_init_irq, 151 .init_early = imx1_init_early,
152 .timer = &scb9328_timer, 152 .init_irq = mx1_init_irq,
153 .init_machine = scb9328_init, 153 .timer = &scb9328_timer,
154 .init_machine = scb9328_init,
154MACHINE_END 155MACHINE_END
diff --git a/arch/arm/mach-imx/mm-imx1.c b/arch/arm/mach-imx/mm-imx1.c
index 729ae0915af8..2e482ba5a0e7 100644
--- a/arch/arm/mach-imx/mm-imx1.c
+++ b/arch/arm/mach-imx/mm-imx1.c
@@ -23,6 +23,9 @@
23 23
24#include <mach/common.h> 24#include <mach/common.h>
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26#include <mach/gpio.h>
27#include <mach/irqs.h>
28#include <mach/iomux-v1.h>
26 29
27static struct map_desc imx_io_desc[] __initdata = { 30static struct map_desc imx_io_desc[] __initdata = {
28 imx_map_entry(MX1, IO, MT_DEVICE), 31 imx_map_entry(MX1, IO, MT_DEVICE),
@@ -30,16 +33,26 @@ static struct map_desc imx_io_desc[] __initdata = {
30 33
31void __init mx1_map_io(void) 34void __init mx1_map_io(void)
32{ 35{
36 iotable_init(imx_io_desc, ARRAY_SIZE(imx_io_desc));
37}
38
39void __init imx1_init_early(void)
40{
33 mxc_set_cpu_type(MXC_CPU_MX1); 41 mxc_set_cpu_type(MXC_CPU_MX1);
34 mxc_arch_reset_init(MX1_IO_ADDRESS(MX1_WDT_BASE_ADDR)); 42 mxc_arch_reset_init(MX1_IO_ADDRESS(MX1_WDT_BASE_ADDR));
35 43 imx_iomuxv1_init(MX1_IO_ADDRESS(MX1_GPIO_BASE_ADDR),
36 iotable_init(imx_io_desc, ARRAY_SIZE(imx_io_desc)); 44 MX1_NUM_GPIO_PORT);
37} 45}
38 46
39int imx1_register_gpios(void); 47static struct mxc_gpio_port imx1_gpio_ports[] = {
48 DEFINE_IMX_GPIO_PORT_IRQ(MX1, 0, 1, MX1_GPIO_INT_PORTA),
49 DEFINE_IMX_GPIO_PORT_IRQ(MX1, 1, 2, MX1_GPIO_INT_PORTB),
50 DEFINE_IMX_GPIO_PORT_IRQ(MX1, 2, 3, MX1_GPIO_INT_PORTC),
51 DEFINE_IMX_GPIO_PORT_IRQ(MX1, 3, 4, MX1_GPIO_INT_PORTD),
52};
40 53
41void __init mx1_init_irq(void) 54void __init mx1_init_irq(void)
42{ 55{
43 mxc_init_irq(MX1_IO_ADDRESS(MX1_AVIC_BASE_ADDR)); 56 mxc_init_irq(MX1_IO_ADDRESS(MX1_AVIC_BASE_ADDR));
44 imx1_register_gpios(); 57 mxc_gpio_init(imx1_gpio_ports, ARRAY_SIZE(imx1_gpio_ports));
45} 58}
diff --git a/arch/arm/mach-imx/mm-imx21.c b/arch/arm/mach-imx/mm-imx21.c
index e728af81d1b1..7a0c500ac2c8 100644
--- a/arch/arm/mach-imx/mm-imx21.c
+++ b/arch/arm/mach-imx/mm-imx21.c
@@ -24,6 +24,9 @@
24#include <mach/common.h> 24#include <mach/common.h>
25#include <asm/pgtable.h> 25#include <asm/pgtable.h>
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27#include <mach/gpio.h>
28#include <mach/irqs.h>
29#include <mach/iomux-v1.h>
27 30
28/* MX21 memory map definition */ 31/* MX21 memory map definition */
29static struct map_desc imx21_io_desc[] __initdata = { 32static struct map_desc imx21_io_desc[] __initdata = {
@@ -56,16 +59,28 @@ static struct map_desc imx21_io_desc[] __initdata = {
56 */ 59 */
57void __init mx21_map_io(void) 60void __init mx21_map_io(void)
58{ 61{
62 iotable_init(imx21_io_desc, ARRAY_SIZE(imx21_io_desc));
63}
64
65void __init imx21_init_early(void)
66{
59 mxc_set_cpu_type(MXC_CPU_MX21); 67 mxc_set_cpu_type(MXC_CPU_MX21);
60 mxc_arch_reset_init(MX21_IO_ADDRESS(MX21_WDOG_BASE_ADDR)); 68 mxc_arch_reset_init(MX21_IO_ADDRESS(MX21_WDOG_BASE_ADDR));
61 69 imx_iomuxv1_init(MX21_IO_ADDRESS(MX21_GPIO_BASE_ADDR),
62 iotable_init(imx21_io_desc, ARRAY_SIZE(imx21_io_desc)); 70 MX21_NUM_GPIO_PORT);
63} 71}
64 72
65int imx21_register_gpios(void); 73static struct mxc_gpio_port imx21_gpio_ports[] = {
74 DEFINE_IMX_GPIO_PORT_IRQ(MX21, 0, 1, MX21_INT_GPIO),
75 DEFINE_IMX_GPIO_PORT(MX21, 1, 2),
76 DEFINE_IMX_GPIO_PORT(MX21, 2, 3),
77 DEFINE_IMX_GPIO_PORT(MX21, 3, 4),
78 DEFINE_IMX_GPIO_PORT(MX21, 4, 5),
79 DEFINE_IMX_GPIO_PORT(MX21, 5, 6),
80};
66 81
67void __init mx21_init_irq(void) 82void __init mx21_init_irq(void)
68{ 83{
69 mxc_init_irq(MX21_IO_ADDRESS(MX21_AVIC_BASE_ADDR)); 84 mxc_init_irq(MX21_IO_ADDRESS(MX21_AVIC_BASE_ADDR));
70 imx21_register_gpios(); 85 mxc_gpio_init(imx21_gpio_ports, ARRAY_SIZE(imx21_gpio_ports));
71} 86}
diff --git a/arch/arm/mach-imx/mm-imx25.c b/arch/arm/mach-imx/mm-imx25.c
index 2edec6ce8fe7..02f7b5c7fa8e 100644
--- a/arch/arm/mach-imx/mm-imx25.c
+++ b/arch/arm/mach-imx/mm-imx25.c
@@ -27,6 +27,8 @@
27#include <mach/hardware.h> 27#include <mach/hardware.h>
28#include <mach/mx25.h> 28#include <mach/mx25.h>
29#include <mach/iomux-v3.h> 29#include <mach/iomux-v3.h>
30#include <mach/gpio.h>
31#include <mach/irqs.h>
30 32
31/* 33/*
32 * This table defines static virtual address mappings for I/O regions. 34 * This table defines static virtual address mappings for I/O regions.
@@ -45,18 +47,26 @@ static struct map_desc mx25_io_desc[] __initdata = {
45 */ 47 */
46void __init mx25_map_io(void) 48void __init mx25_map_io(void)
47{ 49{
50 iotable_init(mx25_io_desc, ARRAY_SIZE(mx25_io_desc));
51}
52
53void __init imx25_init_early(void)
54{
48 mxc_set_cpu_type(MXC_CPU_MX25); 55 mxc_set_cpu_type(MXC_CPU_MX25);
49 mxc_iomux_v3_init(MX25_IO_ADDRESS(MX25_IOMUXC_BASE_ADDR)); 56 mxc_iomux_v3_init(MX25_IO_ADDRESS(MX25_IOMUXC_BASE_ADDR));
50 mxc_arch_reset_init(MX25_IO_ADDRESS(MX25_WDOG_BASE_ADDR)); 57 mxc_arch_reset_init(MX25_IO_ADDRESS(MX25_WDOG_BASE_ADDR));
51
52 iotable_init(mx25_io_desc, ARRAY_SIZE(mx25_io_desc));
53} 58}
54 59
55int imx25_register_gpios(void); 60static struct mxc_gpio_port imx25_gpio_ports[] = {
61 DEFINE_IMX_GPIO_PORT_IRQ(MX25, 0, 1, MX25_INT_GPIO1),
62 DEFINE_IMX_GPIO_PORT_IRQ(MX25, 1, 2, MX25_INT_GPIO2),
63 DEFINE_IMX_GPIO_PORT_IRQ(MX25, 2, 3, MX25_INT_GPIO3),
64 DEFINE_IMX_GPIO_PORT_IRQ(MX25, 3, 4, MX25_INT_GPIO4),
65};
56 66
57void __init mx25_init_irq(void) 67void __init mx25_init_irq(void)
58{ 68{
59 mxc_init_irq(MX25_IO_ADDRESS(MX25_AVIC_BASE_ADDR)); 69 mxc_init_irq(MX25_IO_ADDRESS(MX25_AVIC_BASE_ADDR));
60 imx25_register_gpios(); 70 mxc_gpio_init(imx25_gpio_ports, ARRAY_SIZE(imx25_gpio_ports));
61} 71}
62 72
diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c
index 374e48b7a412..a6761a39f08c 100644
--- a/arch/arm/mach-imx/mm-imx27.c
+++ b/arch/arm/mach-imx/mm-imx27.c
@@ -24,6 +24,9 @@
24#include <mach/common.h> 24#include <mach/common.h>
25#include <asm/pgtable.h> 25#include <asm/pgtable.h>
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27#include <mach/gpio.h>
28#include <mach/irqs.h>
29#include <mach/iomux-v1.h>
27 30
28/* MX27 memory map definition */ 31/* MX27 memory map definition */
29static struct map_desc imx27_io_desc[] __initdata = { 32static struct map_desc imx27_io_desc[] __initdata = {
@@ -56,16 +59,28 @@ static struct map_desc imx27_io_desc[] __initdata = {
56 */ 59 */
57void __init mx27_map_io(void) 60void __init mx27_map_io(void)
58{ 61{
62 iotable_init(imx27_io_desc, ARRAY_SIZE(imx27_io_desc));
63}
64
65void __init imx27_init_early(void)
66{
59 mxc_set_cpu_type(MXC_CPU_MX27); 67 mxc_set_cpu_type(MXC_CPU_MX27);
60 mxc_arch_reset_init(MX27_IO_ADDRESS(MX27_WDOG_BASE_ADDR)); 68 mxc_arch_reset_init(MX27_IO_ADDRESS(MX27_WDOG_BASE_ADDR));
61 69 imx_iomuxv1_init(MX27_IO_ADDRESS(MX27_GPIO_BASE_ADDR),
62 iotable_init(imx27_io_desc, ARRAY_SIZE(imx27_io_desc)); 70 MX27_NUM_GPIO_PORT);
63} 71}
64 72
65int imx27_register_gpios(void); 73static struct mxc_gpio_port imx27_gpio_ports[] = {
74 DEFINE_IMX_GPIO_PORT_IRQ(MX27, 0, 1, MX27_INT_GPIO),
75 DEFINE_IMX_GPIO_PORT(MX27, 1, 2),
76 DEFINE_IMX_GPIO_PORT(MX27, 2, 3),
77 DEFINE_IMX_GPIO_PORT(MX27, 3, 4),
78 DEFINE_IMX_GPIO_PORT(MX27, 4, 5),
79 DEFINE_IMX_GPIO_PORT(MX27, 5, 6),
80};
66 81
67void __init mx27_init_irq(void) 82void __init mx27_init_irq(void)
68{ 83{
69 mxc_init_irq(MX27_IO_ADDRESS(MX27_AVIC_BASE_ADDR)); 84 mxc_init_irq(MX27_IO_ADDRESS(MX27_AVIC_BASE_ADDR));
70 imx27_register_gpios(); 85 mxc_gpio_init(imx27_gpio_ports, ARRAY_SIZE(imx27_gpio_ports));
71} 86}
diff --git a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig
index 769b0f10c834..d701d32a07f1 100644
--- a/arch/arm/mach-integrator/Kconfig
+++ b/arch/arm/mach-integrator/Kconfig
@@ -13,6 +13,7 @@ config ARCH_INTEGRATOR_CP
13 bool "Support Integrator/CP platform" 13 bool "Support Integrator/CP platform"
14 select ARCH_CINTEGRATOR 14 select ARCH_CINTEGRATOR
15 select ARM_TIMER_SP804 15 select ARM_TIMER_SP804
16 select PLAT_VERSATILE_CLCD
16 help 17 help
17 Include support for the ARM(R) Integrator CP platform. 18 Include support for the ARM(R) Integrator CP platform.
18 19
diff --git a/arch/arm/mach-integrator/common.h b/arch/arm/mach-integrator/common.h
index 5f96e1518aa9..a08f9b0299df 100644
--- a/arch/arm/mach-integrator/common.h
+++ b/arch/arm/mach-integrator/common.h
@@ -1 +1,2 @@
1void integrator_init_early(void);
1void integrator_reserve(void); 2void integrator_reserve(void);
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index b8e884b450da..77315b995681 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -144,12 +144,15 @@ static struct clk_lookup lookups[] = {
144 } 144 }
145}; 145};
146 146
147void __init integrator_init_early(void)
148{
149 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
150}
151
147static int __init integrator_init(void) 152static int __init integrator_init(void)
148{ 153{
149 int i; 154 int i;
150 155
151 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
152
153 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 156 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
154 struct amba_device *d = amba_devs[i]; 157 struct amba_device *d = amba_devs[i];
155 amba_device_register(d, &iomem_resource); 158 amba_device_register(d, &iomem_resource);
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c
index 5db574f8ae3f..8cbb75a96bd4 100644
--- a/arch/arm/mach-integrator/impd1.c
+++ b/arch/arm/mach-integrator/impd1.c
@@ -121,6 +121,7 @@ static struct clcd_panel vga = {
121 .height = -1, 121 .height = -1,
122 .tim2 = TIM2_BCD | TIM2_IPC, 122 .tim2 = TIM2_BCD | TIM2_IPC,
123 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1), 123 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
124 .caps = CLCD_CAP_5551,
124 .connector = IMPD1_CTRL_DISP_VGA, 125 .connector = IMPD1_CTRL_DISP_VGA,
125 .bpp = 16, 126 .bpp = 16,
126 .grayscale = 0, 127 .grayscale = 0,
@@ -149,6 +150,7 @@ static struct clcd_panel svga = {
149 .tim2 = TIM2_BCD, 150 .tim2 = TIM2_BCD,
150 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1), 151 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
151 .connector = IMPD1_CTRL_DISP_VGA, 152 .connector = IMPD1_CTRL_DISP_VGA,
153 .caps = CLCD_CAP_5551,
152 .bpp = 16, 154 .bpp = 16,
153 .grayscale = 0, 155 .grayscale = 0,
154}; 156};
@@ -175,6 +177,7 @@ static struct clcd_panel prospector = {
175 .height = -1, 177 .height = -1,
176 .tim2 = TIM2_BCD, 178 .tim2 = TIM2_BCD,
177 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1), 179 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
180 .caps = CLCD_CAP_5551,
178 .fixedtimings = 1, 181 .fixedtimings = 1,
179 .connector = IMPD1_CTRL_DISP_LCD, 182 .connector = IMPD1_CTRL_DISP_LCD,
180 .bpp = 16, 183 .bpp = 16,
@@ -206,6 +209,7 @@ static struct clcd_panel ltm10c209 = {
206 .height = -1, 209 .height = -1,
207 .tim2 = TIM2_BCD, 210 .tim2 = TIM2_BCD,
208 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1), 211 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
212 .caps = CLCD_CAP_5551,
209 .fixedtimings = 1, 213 .fixedtimings = 1,
210 .connector = IMPD1_CTRL_DISP_LCD, 214 .connector = IMPD1_CTRL_DISP_LCD,
211 .bpp = 16, 215 .bpp = 16,
@@ -279,6 +283,7 @@ static void impd1fb_clcd_remove(struct clcd_fb *fb)
279 283
280static struct clcd_board impd1_clcd_data = { 284static struct clcd_board impd1_clcd_data = {
281 .name = "IM-PD/1", 285 .name = "IM-PD/1",
286 .caps = CLCD_CAP_5551 | CLCD_CAP_888,
282 .check = clcdfb_check, 287 .check = clcdfb_check,
283 .decode = clcdfb_decode, 288 .decode = clcdfb_decode,
284 .disable = impd1fb_clcd_disable, 289 .disable = impd1fb_clcd_disable,
diff --git a/arch/arm/mach-integrator/include/mach/cm.h b/arch/arm/mach-integrator/include/mach/cm.h
index 1ab353e23595..445d57adb043 100644
--- a/arch/arm/mach-integrator/include/mach/cm.h
+++ b/arch/arm/mach-integrator/include/mach/cm.h
@@ -24,9 +24,9 @@ void cm_control(u32, u32);
24#define CM_CTRL_LCDBIASDN (1 << 10) 24#define CM_CTRL_LCDBIASDN (1 << 10)
25#define CM_CTRL_LCDMUXSEL_MASK (7 << 11) 25#define CM_CTRL_LCDMUXSEL_MASK (7 << 11)
26#define CM_CTRL_LCDMUXSEL_GENLCD (1 << 11) 26#define CM_CTRL_LCDMUXSEL_GENLCD (1 << 11)
27#define CM_CTRL_LCDMUXSEL_VGA_16BPP (2 << 11) 27#define CM_CTRL_LCDMUXSEL_VGA565_TFT555 (2 << 11)
28#define CM_CTRL_LCDMUXSEL_SHARPLCD (3 << 11) 28#define CM_CTRL_LCDMUXSEL_SHARPLCD (3 << 11)
29#define CM_CTRL_LCDMUXSEL_VGA_8421BPP (4 << 11) 29#define CM_CTRL_LCDMUXSEL_VGA555_TFT555 (4 << 11)
30#define CM_CTRL_LCDEN0 (1 << 14) 30#define CM_CTRL_LCDEN0 (1 << 14)
31#define CM_CTRL_LCDEN1 (1 << 15) 31#define CM_CTRL_LCDEN1 (1 << 15)
32#define CM_CTRL_STATIC1 (1 << 16) 32#define CM_CTRL_STATIC1 (1 << 16)
diff --git a/arch/arm/mach-integrator/include/mach/memory.h b/arch/arm/mach-integrator/include/mach/memory.h
index 991f24d2c115..334d5e271889 100644
--- a/arch/arm/mach-integrator/include/mach/memory.h
+++ b/arch/arm/mach-integrator/include/mach/memory.h
@@ -23,7 +23,7 @@
23/* 23/*
24 * Physical DRAM offset. 24 * Physical DRAM offset.
25 */ 25 */
26#define PHYS_OFFSET UL(0x00000000) 26#define PLAT_PHYS_OFFSET UL(0x00000000)
27 27
28#define BUS_OFFSET UL(0x80000000) 28#define BUS_OFFSET UL(0x80000000)
29#define __virt_to_bus(x) ((x) - PAGE_OFFSET + BUS_OFFSET) 29#define __virt_to_bus(x) ((x) - PAGE_OFFSET + BUS_OFFSET)
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index b666443b5cbb..980803ff348c 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -48,6 +48,8 @@
48#include <asm/mach/map.h> 48#include <asm/mach/map.h>
49#include <asm/mach/time.h> 49#include <asm/mach/time.h>
50 50
51#include <plat/fpga-irq.h>
52
51#include "common.h" 53#include "common.h"
52 54
53/* 55/*
@@ -57,10 +59,10 @@
57 * Setup a VA for the Integrator interrupt controller (for header #0, 59 * Setup a VA for the Integrator interrupt controller (for header #0,
58 * just for now). 60 * just for now).
59 */ 61 */
60#define VA_IC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE) 62#define VA_IC_BASE __io_address(INTEGRATOR_IC_BASE)
61#define VA_SC_BASE IO_ADDRESS(INTEGRATOR_SC_BASE) 63#define VA_SC_BASE __io_address(INTEGRATOR_SC_BASE)
62#define VA_EBI_BASE IO_ADDRESS(INTEGRATOR_EBI_BASE) 64#define VA_EBI_BASE __io_address(INTEGRATOR_EBI_BASE)
63#define VA_CMIC_BASE IO_ADDRESS(INTEGRATOR_HDR_IC) 65#define VA_CMIC_BASE __io_address(INTEGRATOR_HDR_IC)
64 66
65/* 67/*
66 * Logical Physical 68 * Logical Physical
@@ -156,27 +158,14 @@ static void __init ap_map_io(void)
156 158
157#define INTEGRATOR_SC_VALID_INT 0x003fffff 159#define INTEGRATOR_SC_VALID_INT 0x003fffff
158 160
159static void sc_mask_irq(struct irq_data *d) 161static struct fpga_irq_data sc_irq_data = {
160{ 162 .base = VA_IC_BASE,
161 writel(1 << d->irq, VA_IC_BASE + IRQ_ENABLE_CLEAR); 163 .irq_start = 0,
162} 164 .chip.name = "SC",
163
164static void sc_unmask_irq(struct irq_data *d)
165{
166 writel(1 << d->irq, VA_IC_BASE + IRQ_ENABLE_SET);
167}
168
169static struct irq_chip sc_chip = {
170 .name = "SC",
171 .irq_ack = sc_mask_irq,
172 .irq_mask = sc_mask_irq,
173 .irq_unmask = sc_unmask_irq,
174}; 165};
175 166
176static void __init ap_init_irq(void) 167static void __init ap_init_irq(void)
177{ 168{
178 unsigned int i;
179
180 /* Disable all interrupts initially. */ 169 /* Disable all interrupts initially. */
181 /* Do the core module ones */ 170 /* Do the core module ones */
182 writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR); 171 writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR);
@@ -185,13 +174,7 @@ static void __init ap_init_irq(void)
185 writel(-1, VA_IC_BASE + IRQ_ENABLE_CLEAR); 174 writel(-1, VA_IC_BASE + IRQ_ENABLE_CLEAR);
186 writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR); 175 writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR);
187 176
188 for (i = 0; i < NR_IRQS; i++) { 177 fpga_irq_init(-1, INTEGRATOR_SC_VALID_INT, &sc_irq_data);
189 if (((1 << i) & INTEGRATOR_SC_VALID_INT) != 0) {
190 set_irq_chip(i, &sc_chip);
191 set_irq_handler(i, handle_level_irq);
192 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
193 }
194 }
195} 178}
196 179
197#ifdef CONFIG_PM 180#ifdef CONFIG_PM
@@ -282,7 +265,7 @@ static void ap_flash_exit(void)
282 265
283static void ap_flash_set_vpp(int on) 266static void ap_flash_set_vpp(int on)
284{ 267{
285 unsigned long reg = on ? SC_CTRLS : SC_CTRLC; 268 void __iomem *reg = on ? SC_CTRLS : SC_CTRLC;
286 269
287 writel(INTEGRATOR_SC_CTRL_nFLVPPEN, reg); 270 writel(INTEGRATOR_SC_CTRL_nFLVPPEN, reg);
288} 271}
@@ -499,8 +482,9 @@ static struct sys_timer ap_timer = {
499MACHINE_START(INTEGRATOR, "ARM-Integrator") 482MACHINE_START(INTEGRATOR, "ARM-Integrator")
500 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 483 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
501 .boot_params = 0x00000100, 484 .boot_params = 0x00000100,
502 .map_io = ap_map_io,
503 .reserve = integrator_reserve, 485 .reserve = integrator_reserve,
486 .map_io = ap_map_io,
487 .init_early = integrator_init_early,
504 .init_irq = ap_init_irq, 488 .init_irq = ap_init_irq,
505 .timer = &ap_timer, 489 .timer = &ap_timer,
506 .init_machine = ap_init, 490 .init_machine = ap_init,
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index e9327da1382e..9e3ce26023e8 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -42,6 +42,10 @@
42 42
43#include <asm/hardware/timer-sp.h> 43#include <asm/hardware/timer-sp.h>
44 44
45#include <plat/clcd.h>
46#include <plat/fpga-irq.h>
47#include <plat/sched_clock.h>
48
45#include "common.h" 49#include "common.h"
46 50
47#define INTCP_PA_FLASH_BASE 0x24000000 51#define INTCP_PA_FLASH_BASE 0x24000000
@@ -49,9 +53,9 @@
49 53
50#define INTCP_PA_CLCD_BASE 0xc0000000 54#define INTCP_PA_CLCD_BASE 0xc0000000
51 55
52#define INTCP_VA_CIC_BASE IO_ADDRESS(INTEGRATOR_HDR_BASE + 0x40) 56#define INTCP_VA_CIC_BASE __io_address(INTEGRATOR_HDR_BASE + 0x40)
53#define INTCP_VA_PIC_BASE IO_ADDRESS(INTEGRATOR_IC_BASE) 57#define INTCP_VA_PIC_BASE __io_address(INTEGRATOR_IC_BASE)
54#define INTCP_VA_SIC_BASE IO_ADDRESS(INTEGRATOR_CP_SIC_BASE) 58#define INTCP_VA_SIC_BASE __io_address(INTEGRATOR_CP_SIC_BASE)
55 59
56#define INTCP_ETH_SIZE 0x10 60#define INTCP_ETH_SIZE 0x10
57 61
@@ -139,129 +143,48 @@ static void __init intcp_map_io(void)
139 iotable_init(intcp_io_desc, ARRAY_SIZE(intcp_io_desc)); 143 iotable_init(intcp_io_desc, ARRAY_SIZE(intcp_io_desc));
140} 144}
141 145
142#define cic_writel __raw_writel 146static struct fpga_irq_data cic_irq_data = {
143#define cic_readl __raw_readl 147 .base = INTCP_VA_CIC_BASE,
144#define pic_writel __raw_writel 148 .irq_start = IRQ_CIC_START,
145#define pic_readl __raw_readl 149 .chip.name = "CIC",
146#define sic_writel __raw_writel
147#define sic_readl __raw_readl
148
149static void cic_mask_irq(struct irq_data *d)
150{
151 unsigned int irq = d->irq - IRQ_CIC_START;
152 cic_writel(1 << irq, INTCP_VA_CIC_BASE + IRQ_ENABLE_CLEAR);
153}
154
155static void cic_unmask_irq(struct irq_data *d)
156{
157 unsigned int irq = d->irq - IRQ_CIC_START;
158 cic_writel(1 << irq, INTCP_VA_CIC_BASE + IRQ_ENABLE_SET);
159}
160
161static struct irq_chip cic_chip = {
162 .name = "CIC",
163 .irq_ack = cic_mask_irq,
164 .irq_mask = cic_mask_irq,
165 .irq_unmask = cic_unmask_irq,
166}; 150};
167 151
168static void pic_mask_irq(struct irq_data *d) 152static struct fpga_irq_data pic_irq_data = {
169{ 153 .base = INTCP_VA_PIC_BASE,
170 unsigned int irq = d->irq - IRQ_PIC_START; 154 .irq_start = IRQ_PIC_START,
171 pic_writel(1 << irq, INTCP_VA_PIC_BASE + IRQ_ENABLE_CLEAR); 155 .chip.name = "PIC",
172}
173
174static void pic_unmask_irq(struct irq_data *d)
175{
176 unsigned int irq = d->irq - IRQ_PIC_START;
177 pic_writel(1 << irq, INTCP_VA_PIC_BASE + IRQ_ENABLE_SET);
178}
179
180static struct irq_chip pic_chip = {
181 .name = "PIC",
182 .irq_ack = pic_mask_irq,
183 .irq_mask = pic_mask_irq,
184 .irq_unmask = pic_unmask_irq,
185}; 156};
186 157
187static void sic_mask_irq(struct irq_data *d) 158static struct fpga_irq_data sic_irq_data = {
188{ 159 .base = INTCP_VA_SIC_BASE,
189 unsigned int irq = d->irq - IRQ_SIC_START; 160 .irq_start = IRQ_SIC_START,
190 sic_writel(1 << irq, INTCP_VA_SIC_BASE + IRQ_ENABLE_CLEAR); 161 .chip.name = "SIC",
191}
192
193static void sic_unmask_irq(struct irq_data *d)
194{
195 unsigned int irq = d->irq - IRQ_SIC_START;
196 sic_writel(1 << irq, INTCP_VA_SIC_BASE + IRQ_ENABLE_SET);
197}
198
199static struct irq_chip sic_chip = {
200 .name = "SIC",
201 .irq_ack = sic_mask_irq,
202 .irq_mask = sic_mask_irq,
203 .irq_unmask = sic_unmask_irq,
204}; 162};
205 163
206static void
207sic_handle_irq(unsigned int irq, struct irq_desc *desc)
208{
209 unsigned long status = sic_readl(INTCP_VA_SIC_BASE + IRQ_STATUS);
210
211 if (status == 0) {
212 do_bad_IRQ(irq, desc);
213 return;
214 }
215
216 do {
217 irq = ffs(status) - 1;
218 status &= ~(1 << irq);
219
220 irq += IRQ_SIC_START;
221
222 generic_handle_irq(irq);
223 } while (status);
224}
225
226static void __init intcp_init_irq(void) 164static void __init intcp_init_irq(void)
227{ 165{
228 unsigned int i; 166 u32 pic_mask, sic_mask;
167
168 pic_mask = ~((~0u) << (11 - IRQ_PIC_START));
169 pic_mask |= (~((~0u) << (29 - 22))) << 22;
170 sic_mask = ~((~0u) << (1 + IRQ_SIC_END - IRQ_SIC_START));
229 171
230 /* 172 /*
231 * Disable all interrupt sources 173 * Disable all interrupt sources
232 */ 174 */
233 pic_writel(0xffffffff, INTCP_VA_PIC_BASE + IRQ_ENABLE_CLEAR); 175 writel(0xffffffff, INTCP_VA_PIC_BASE + IRQ_ENABLE_CLEAR);
234 pic_writel(0xffffffff, INTCP_VA_PIC_BASE + FIQ_ENABLE_CLEAR); 176 writel(0xffffffff, INTCP_VA_PIC_BASE + FIQ_ENABLE_CLEAR);
235 177 writel(0xffffffff, INTCP_VA_CIC_BASE + IRQ_ENABLE_CLEAR);
236 for (i = IRQ_PIC_START; i <= IRQ_PIC_END; i++) { 178 writel(0xffffffff, INTCP_VA_CIC_BASE + FIQ_ENABLE_CLEAR);
237 if (i == 11) 179 writel(sic_mask, INTCP_VA_SIC_BASE + IRQ_ENABLE_CLEAR);
238 i = 22; 180 writel(sic_mask, INTCP_VA_SIC_BASE + FIQ_ENABLE_CLEAR);
239 if (i == 29)
240 break;
241 set_irq_chip(i, &pic_chip);
242 set_irq_handler(i, handle_level_irq);
243 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
244 }
245 181
246 cic_writel(0xffffffff, INTCP_VA_CIC_BASE + IRQ_ENABLE_CLEAR); 182 fpga_irq_init(-1, pic_mask, &pic_irq_data);
247 cic_writel(0xffffffff, INTCP_VA_CIC_BASE + FIQ_ENABLE_CLEAR);
248 183
249 for (i = IRQ_CIC_START; i <= IRQ_CIC_END; i++) { 184 fpga_irq_init(-1, ~((~0u) << (1 + IRQ_CIC_END - IRQ_CIC_START)),
250 set_irq_chip(i, &cic_chip); 185 &cic_irq_data);
251 set_irq_handler(i, handle_level_irq);
252 set_irq_flags(i, IRQF_VALID);
253 }
254
255 sic_writel(0x00000fff, INTCP_VA_SIC_BASE + IRQ_ENABLE_CLEAR);
256 sic_writel(0x00000fff, INTCP_VA_SIC_BASE + FIQ_ENABLE_CLEAR);
257
258 for (i = IRQ_SIC_START; i <= IRQ_SIC_END; i++) {
259 set_irq_chip(i, &sic_chip);
260 set_irq_handler(i, handle_level_irq);
261 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
262 }
263 186
264 set_irq_chained_handler(IRQ_CP_CPPLDINT, sic_handle_irq); 187 fpga_irq_init(IRQ_CP_CPPLDINT, sic_mask, &sic_irq_data);
265} 188}
266 189
267/* 190/*
@@ -449,43 +372,21 @@ static struct amba_device aaci_device = {
449/* 372/*
450 * CLCD support 373 * CLCD support
451 */ 374 */
452static struct clcd_panel vga = {
453 .mode = {
454 .name = "VGA",
455 .refresh = 60,
456 .xres = 640,
457 .yres = 480,
458 .pixclock = 39721,
459 .left_margin = 40,
460 .right_margin = 24,
461 .upper_margin = 32,
462 .lower_margin = 11,
463 .hsync_len = 96,
464 .vsync_len = 2,
465 .sync = 0,
466 .vmode = FB_VMODE_NONINTERLACED,
467 },
468 .width = -1,
469 .height = -1,
470 .tim2 = TIM2_BCD | TIM2_IPC,
471 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
472 .bpp = 16,
473 .grayscale = 0,
474};
475
476/* 375/*
477 * Ensure VGA is selected. 376 * Ensure VGA is selected.
478 */ 377 */
479static void cp_clcd_enable(struct clcd_fb *fb) 378static void cp_clcd_enable(struct clcd_fb *fb)
480{ 379{
481 u32 val; 380 struct fb_var_screeninfo *var = &fb->fb.var;
381 u32 val = CM_CTRL_STATIC1 | CM_CTRL_STATIC2;
482 382
483 if (fb->fb.var.bits_per_pixel <= 8) 383 if (var->bits_per_pixel <= 8 ||
484 val = CM_CTRL_LCDMUXSEL_VGA_8421BPP; 384 (var->bits_per_pixel == 16 && var->green.length == 5))
385 /* Pseudocolor, RGB555, BGR555 */
386 val |= CM_CTRL_LCDMUXSEL_VGA555_TFT555;
485 else if (fb->fb.var.bits_per_pixel <= 16) 387 else if (fb->fb.var.bits_per_pixel <= 16)
486 val = CM_CTRL_LCDMUXSEL_VGA_16BPP 388 /* truecolor RGB565 */
487 | CM_CTRL_LCDEN0 | CM_CTRL_LCDEN1 389 val |= CM_CTRL_LCDMUXSEL_VGA565_TFT555;
488 | CM_CTRL_STATIC1 | CM_CTRL_STATIC2;
489 else 390 else
490 val = 0; /* no idea for this, don't trust the docs */ 391 val = 0; /* no idea for this, don't trust the docs */
491 392
@@ -498,49 +399,24 @@ static void cp_clcd_enable(struct clcd_fb *fb)
498 CM_CTRL_n24BITEN, val); 399 CM_CTRL_n24BITEN, val);
499} 400}
500 401
501static unsigned long framesize = SZ_1M;
502
503static int cp_clcd_setup(struct clcd_fb *fb) 402static int cp_clcd_setup(struct clcd_fb *fb)
504{ 403{
505 dma_addr_t dma; 404 fb->panel = versatile_clcd_get_panel("VGA");
506 405 if (!fb->panel)
507 fb->panel = &vga; 406 return -EINVAL;
508
509 fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize,
510 &dma, GFP_KERNEL);
511 if (!fb->fb.screen_base) {
512 printk(KERN_ERR "CLCD: unable to map framebuffer\n");
513 return -ENOMEM;
514 }
515
516 fb->fb.fix.smem_start = dma;
517 fb->fb.fix.smem_len = framesize;
518
519 return 0;
520}
521
522static int cp_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma)
523{
524 return dma_mmap_writecombine(&fb->dev->dev, vma,
525 fb->fb.screen_base,
526 fb->fb.fix.smem_start,
527 fb->fb.fix.smem_len);
528}
529 407
530static void cp_clcd_remove(struct clcd_fb *fb) 408 return versatile_clcd_setup_dma(fb, SZ_1M);
531{
532 dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len,
533 fb->fb.screen_base, fb->fb.fix.smem_start);
534} 409}
535 410
536static struct clcd_board clcd_data = { 411static struct clcd_board clcd_data = {
537 .name = "Integrator/CP", 412 .name = "Integrator/CP",
413 .caps = CLCD_CAP_5551 | CLCD_CAP_RGB565 | CLCD_CAP_888,
538 .check = clcdfb_check, 414 .check = clcdfb_check,
539 .decode = clcdfb_decode, 415 .decode = clcdfb_decode,
540 .enable = cp_clcd_enable, 416 .enable = cp_clcd_enable,
541 .setup = cp_clcd_setup, 417 .setup = cp_clcd_setup,
542 .mmap = cp_clcd_mmap, 418 .mmap = versatile_clcd_mmap_dma,
543 .remove = cp_clcd_remove, 419 .remove = versatile_clcd_remove_dma,
544}; 420};
545 421
546static struct amba_device clcd_device = { 422static struct amba_device clcd_device = {
@@ -565,11 +441,23 @@ static struct amba_device *amba_devs[] __initdata = {
565 &clcd_device, 441 &clcd_device,
566}; 442};
567 443
444#define REFCOUNTER (__io_address(INTEGRATOR_HDR_BASE) + 0x28)
445
446static void __init intcp_init_early(void)
447{
448 clkdev_add_table(cp_lookups, ARRAY_SIZE(cp_lookups));
449
450 integrator_init_early();
451
452#ifdef CONFIG_PLAT_VERSATILE_SCHED_CLOCK
453 versatile_sched_clock_init(REFCOUNTER, 24000000);
454#endif
455}
456
568static void __init intcp_init(void) 457static void __init intcp_init(void)
569{ 458{
570 int i; 459 int i;
571 460
572 clkdev_add_table(cp_lookups, ARRAY_SIZE(cp_lookups));
573 platform_add_devices(intcp_devs, ARRAY_SIZE(intcp_devs)); 461 platform_add_devices(intcp_devs, ARRAY_SIZE(intcp_devs));
574 462
575 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 463 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
@@ -599,8 +487,9 @@ static struct sys_timer cp_timer = {
599MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP") 487MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP")
600 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 488 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
601 .boot_params = 0x00000100, 489 .boot_params = 0x00000100,
602 .map_io = intcp_map_io,
603 .reserve = integrator_reserve, 490 .reserve = integrator_reserve,
491 .map_io = intcp_map_io,
492 .init_early = intcp_init_early,
604 .init_irq = intcp_init_irq, 493 .init_irq = intcp_init_irq,
605 .timer = &cp_timer, 494 .timer = &cp_timer,
606 .init_machine = intcp_init, 495 .init_machine = intcp_init,
diff --git a/arch/arm/mach-iop13xx/include/mach/memory.h b/arch/arm/mach-iop13xx/include/mach/memory.h
index 3ad455318868..1afa99ef97fa 100644
--- a/arch/arm/mach-iop13xx/include/mach/memory.h
+++ b/arch/arm/mach-iop13xx/include/mach/memory.h
@@ -6,7 +6,7 @@
6/* 6/*
7 * Physical DRAM offset. 7 * Physical DRAM offset.
8 */ 8 */
9#define PHYS_OFFSET UL(0x00000000) 9#define PLAT_PHYS_OFFSET UL(0x00000000)
10 10
11#ifndef __ASSEMBLY__ 11#ifndef __ASSEMBLY__
12 12
diff --git a/arch/arm/mach-iop32x/include/mach/memory.h b/arch/arm/mach-iop32x/include/mach/memory.h
index c30f6450ad50..169cc239f76c 100644
--- a/arch/arm/mach-iop32x/include/mach/memory.h
+++ b/arch/arm/mach-iop32x/include/mach/memory.h
@@ -8,6 +8,6 @@
8/* 8/*
9 * Physical DRAM offset. 9 * Physical DRAM offset.
10 */ 10 */
11#define PHYS_OFFSET UL(0xa0000000) 11#define PLAT_PHYS_OFFSET UL(0xa0000000)
12 12
13#endif 13#endif
diff --git a/arch/arm/mach-iop33x/include/mach/memory.h b/arch/arm/mach-iop33x/include/mach/memory.h
index a30a96aa6d2d..8e1daf7006b6 100644
--- a/arch/arm/mach-iop33x/include/mach/memory.h
+++ b/arch/arm/mach-iop33x/include/mach/memory.h
@@ -8,6 +8,6 @@
8/* 8/*
9 * Physical DRAM offset. 9 * Physical DRAM offset.
10 */ 10 */
11#define PHYS_OFFSET UL(0x00000000) 11#define PLAT_PHYS_OFFSET UL(0x00000000)
12 12
13#endif 13#endif
diff --git a/arch/arm/mach-ixp2000/include/mach/memory.h b/arch/arm/mach-ixp2000/include/mach/memory.h
index 98e3471be15b..5f0c4fd4076a 100644
--- a/arch/arm/mach-ixp2000/include/mach/memory.h
+++ b/arch/arm/mach-ixp2000/include/mach/memory.h
@@ -13,7 +13,7 @@
13#ifndef __ASM_ARCH_MEMORY_H 13#ifndef __ASM_ARCH_MEMORY_H
14#define __ASM_ARCH_MEMORY_H 14#define __ASM_ARCH_MEMORY_H
15 15
16#define PHYS_OFFSET UL(0x00000000) 16#define PLAT_PHYS_OFFSET UL(0x00000000)
17 17
18#include <mach/ixp2000-regs.h> 18#include <mach/ixp2000-regs.h>
19 19
diff --git a/arch/arm/mach-ixp23xx/include/mach/memory.h b/arch/arm/mach-ixp23xx/include/mach/memory.h
index 6ef65d813f16..6cf0704e946a 100644
--- a/arch/arm/mach-ixp23xx/include/mach/memory.h
+++ b/arch/arm/mach-ixp23xx/include/mach/memory.h
@@ -17,7 +17,7 @@
17/* 17/*
18 * Physical DRAM offset. 18 * Physical DRAM offset.
19 */ 19 */
20#define PHYS_OFFSET (0x00000000) 20#define PLAT_PHYS_OFFSET (0x00000000)
21 21
22#define IXP23XX_PCI_SDRAM_OFFSET (*((volatile int *)IXP23XX_PCI_SDRAM_BAR) & 0xfffffff0) 22#define IXP23XX_PCI_SDRAM_OFFSET (*((volatile int *)IXP23XX_PCI_SDRAM_BAR) & 0xfffffff0)
23 23
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 4dc68d6bb6be..9fd894271d5d 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -432,7 +432,7 @@ static struct clocksource clocksource_ixp4xx = {
432 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 432 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
433}; 433};
434 434
435unsigned long ixp4xx_timer_freq = FREQ; 435unsigned long ixp4xx_timer_freq = IXP4XX_TIMER_FREQ;
436EXPORT_SYMBOL(ixp4xx_timer_freq); 436EXPORT_SYMBOL(ixp4xx_timer_freq);
437static void __init ixp4xx_clocksource_init(void) 437static void __init ixp4xx_clocksource_init(void)
438{ 438{
@@ -496,7 +496,7 @@ static struct clock_event_device clockevent_ixp4xx = {
496 496
497static void __init ixp4xx_clockevent_init(void) 497static void __init ixp4xx_clockevent_init(void)
498{ 498{
499 clockevent_ixp4xx.mult = div_sc(FREQ, NSEC_PER_SEC, 499 clockevent_ixp4xx.mult = div_sc(IXP4XX_TIMER_FREQ, NSEC_PER_SEC,
500 clockevent_ixp4xx.shift); 500 clockevent_ixp4xx.shift);
501 clockevent_ixp4xx.max_delta_ns = 501 clockevent_ixp4xx.max_delta_ns =
502 clockevent_delta2ns(0xfffffffe, &clockevent_ixp4xx); 502 clockevent_delta2ns(0xfffffffe, &clockevent_ixp4xx);
diff --git a/arch/arm/mach-ixp4xx/include/mach/memory.h b/arch/arm/mach-ixp4xx/include/mach/memory.h
index 0136eaa29224..6d388c9d0e20 100644
--- a/arch/arm/mach-ixp4xx/include/mach/memory.h
+++ b/arch/arm/mach-ixp4xx/include/mach/memory.h
@@ -12,7 +12,7 @@
12/* 12/*
13 * Physical DRAM offset. 13 * Physical DRAM offset.
14 */ 14 */
15#define PHYS_OFFSET UL(0x00000000) 15#define PLAT_PHYS_OFFSET UL(0x00000000)
16 16
17#if !defined(__ASSEMBLY__) && defined(CONFIG_PCI) 17#if !defined(__ASSEMBLY__) && defined(CONFIG_PCI)
18 18
diff --git a/arch/arm/mach-ixp4xx/include/mach/timex.h b/arch/arm/mach-ixp4xx/include/mach/timex.h
index 2c3f93c3eb79..c9e930f29339 100644
--- a/arch/arm/mach-ixp4xx/include/mach/timex.h
+++ b/arch/arm/mach-ixp4xx/include/mach/timex.h
@@ -10,6 +10,7 @@
10 * 66.66... MHz. We do a convulted calculation of CLOCK_TICK_RATE b/c the 10 * 66.66... MHz. We do a convulted calculation of CLOCK_TICK_RATE b/c the
11 * timer register ignores the bottom 2 bits of the LATCH value. 11 * timer register ignores the bottom 2 bits of the LATCH value.
12 */ 12 */
13#define FREQ 66666000 13#define IXP4XX_TIMER_FREQ 66666000
14#define CLOCK_TICK_RATE (((FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ) 14#define CLOCK_TICK_RATE \
15 (((IXP4XX_TIMER_FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ)
15 16
diff --git a/arch/arm/mach-ixp4xx/ixp4xx_qmgr.c b/arch/arm/mach-ixp4xx/ixp4xx_qmgr.c
index bfdbe4b5a3cc..852f7c9f87d0 100644
--- a/arch/arm/mach-ixp4xx/ixp4xx_qmgr.c
+++ b/arch/arm/mach-ixp4xx/ixp4xx_qmgr.c
@@ -265,6 +265,11 @@ void qmgr_release_queue(unsigned int queue)
265 qmgr_queue_descs[queue], queue); 265 qmgr_queue_descs[queue], queue);
266 qmgr_queue_descs[queue][0] = '\x0'; 266 qmgr_queue_descs[queue][0] = '\x0';
267#endif 267#endif
268
269 while ((addr = qmgr_get_entry(queue)))
270 printk(KERN_ERR "qmgr: released queue %i not empty: 0x%08X\n",
271 queue, addr);
272
268 __raw_writel(0, &qmgr_regs->sram[queue]); 273 __raw_writel(0, &qmgr_regs->sram[queue]);
269 274
270 used_sram_bitmap[0] &= ~mask[0]; 275 used_sram_bitmap[0] &= ~mask[0];
@@ -275,10 +280,6 @@ void qmgr_release_queue(unsigned int queue)
275 spin_unlock_irq(&qmgr_lock); 280 spin_unlock_irq(&qmgr_lock);
276 281
277 module_put(THIS_MODULE); 282 module_put(THIS_MODULE);
278
279 while ((addr = qmgr_get_entry(queue)))
280 printk(KERN_ERR "qmgr: released queue %i not empty: 0x%08X\n",
281 queue, addr);
282} 283}
283 284
284static int qmgr_init(void) 285static int qmgr_init(void)
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 3688123b5ad8..20e71df3e3bb 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -21,6 +21,7 @@
21#include <net/dsa.h> 21#include <net/dsa.h>
22#include <asm/page.h> 22#include <asm/page.h>
23#include <asm/timex.h> 23#include <asm/timex.h>
24#include <asm/kexec.h>
24#include <asm/mach/map.h> 25#include <asm/mach/map.h>
25#include <asm/mach/time.h> 26#include <asm/mach/time.h>
26#include <mach/kirkwood.h> 27#include <mach/kirkwood.h>
@@ -846,9 +847,14 @@ static void __init kirkwood_wdt_init(void)
846/***************************************************************************** 847/*****************************************************************************
847 * Time handling 848 * Time handling
848 ****************************************************************************/ 849 ****************************************************************************/
850void __init kirkwood_init_early(void)
851{
852 orion_time_set_base(TIMER_VIRT_BASE);
853}
854
849int kirkwood_tclk; 855int kirkwood_tclk;
850 856
851int __init kirkwood_find_tclk(void) 857static int __init kirkwood_find_tclk(void)
852{ 858{
853 u32 dev, rev; 859 u32 dev, rev;
854 860
@@ -864,7 +870,9 @@ int __init kirkwood_find_tclk(void)
864static void __init kirkwood_timer_init(void) 870static void __init kirkwood_timer_init(void)
865{ 871{
866 kirkwood_tclk = kirkwood_find_tclk(); 872 kirkwood_tclk = kirkwood_find_tclk();
867 orion_time_init(IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk); 873
874 orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR,
875 IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk);
868} 876}
869 877
870struct sys_timer kirkwood_timer = { 878struct sys_timer kirkwood_timer = {
@@ -1003,6 +1011,10 @@ void __init kirkwood_init(void)
1003 kirkwood_xor0_init(); 1011 kirkwood_xor0_init();
1004 kirkwood_xor1_init(); 1012 kirkwood_xor1_init();
1005 kirkwood_crypto_init(); 1013 kirkwood_crypto_init();
1014
1015#ifdef CONFIG_KEXEC
1016 kexec_reinit = kirkwood_enable_pcie;
1017#endif
1006} 1018}
1007 1019
1008static int __init kirkwood_clock_gate(void) 1020static int __init kirkwood_clock_gate(void)
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 95bb0a73adfb..b9b0f0968a36 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -27,11 +27,13 @@ struct kirkwood_asoc_platform_data;
27 */ 27 */
28void kirkwood_map_io(void); 28void kirkwood_map_io(void);
29void kirkwood_init(void); 29void kirkwood_init(void);
30void kirkwood_init_early(void);
30void kirkwood_init_irq(void); 31void kirkwood_init_irq(void);
31 32
32extern struct mbus_dram_target_info kirkwood_mbus_dram_info; 33extern struct mbus_dram_target_info kirkwood_mbus_dram_info;
33void kirkwood_setup_cpu_mbus(void); 34void kirkwood_setup_cpu_mbus(void);
34 35
36void kirkwood_enable_pcie(void);
35void kirkwood_pcie_id(u32 *dev, u32 *rev); 37void kirkwood_pcie_id(u32 *dev, u32 *rev);
36 38
37void kirkwood_ehci_init(void); 39void kirkwood_ehci_init(void);
diff --git a/arch/arm/mach-kirkwood/d2net_v2-setup.c b/arch/arm/mach-kirkwood/d2net_v2-setup.c
index a31c9499ab36..043cfd5e140b 100644
--- a/arch/arm/mach-kirkwood/d2net_v2-setup.c
+++ b/arch/arm/mach-kirkwood/d2net_v2-setup.c
@@ -224,6 +224,7 @@ MACHINE_START(D2NET_V2, "LaCie d2 Network v2")
224 .boot_params = 0x00000100, 224 .boot_params = 0x00000100,
225 .init_machine = d2net_v2_init, 225 .init_machine = d2net_v2_init,
226 .map_io = kirkwood_map_io, 226 .map_io = kirkwood_map_io,
227 .init_early = kirkwood_init_early,
227 .init_irq = kirkwood_init_irq, 228 .init_irq = kirkwood_init_irq,
228 .timer = &kirkwood_timer, 229 .timer = &kirkwood_timer,
229MACHINE_END 230MACHINE_END
diff --git a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
index 9ea71182d31a..bff04e04d679 100644
--- a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
+++ b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
@@ -100,6 +100,7 @@ MACHINE_START(DB88F6281_BP, "Marvell DB-88F6281-BP Development Board")
100 .boot_params = 0x00000100, 100 .boot_params = 0x00000100,
101 .init_machine = db88f6281_init, 101 .init_machine = db88f6281_init,
102 .map_io = kirkwood_map_io, 102 .map_io = kirkwood_map_io,
103 .init_early = kirkwood_init_early,
103 .init_irq = kirkwood_init_irq, 104 .init_irq = kirkwood_init_irq,
104 .timer = &kirkwood_timer, 105 .timer = &kirkwood_timer,
105MACHINE_END 106MACHINE_END
diff --git a/arch/arm/mach-kirkwood/dockstar-setup.c b/arch/arm/mach-kirkwood/dockstar-setup.c
index 433ea368c060..f14dfb8508c5 100644
--- a/arch/arm/mach-kirkwood/dockstar-setup.c
+++ b/arch/arm/mach-kirkwood/dockstar-setup.c
@@ -105,6 +105,7 @@ MACHINE_START(DOCKSTAR, "Seagate FreeAgent DockStar")
105 .boot_params = 0x00000100, 105 .boot_params = 0x00000100,
106 .init_machine = dockstar_init, 106 .init_machine = dockstar_init,
107 .map_io = kirkwood_map_io, 107 .map_io = kirkwood_map_io,
108 .init_early = kirkwood_init_early,
108 .init_irq = kirkwood_init_irq, 109 .init_irq = kirkwood_init_irq,
109 .timer = &kirkwood_timer, 110 .timer = &kirkwood_timer,
110MACHINE_END 111MACHINE_END
diff --git a/arch/arm/mach-kirkwood/guruplug-setup.c b/arch/arm/mach-kirkwood/guruplug-setup.c
index 8f47dc0a2fef..41d1b40696a3 100644
--- a/arch/arm/mach-kirkwood/guruplug-setup.c
+++ b/arch/arm/mach-kirkwood/guruplug-setup.c
@@ -124,6 +124,7 @@ MACHINE_START(GURUPLUG, "Marvell GuruPlug Reference Board")
124 .boot_params = 0x00000100, 124 .boot_params = 0x00000100,
125 .init_machine = guruplug_init, 125 .init_machine = guruplug_init,
126 .map_io = kirkwood_map_io, 126 .map_io = kirkwood_map_io,
127 .init_early = kirkwood_init_early,
127 .init_irq = kirkwood_init_irq, 128 .init_irq = kirkwood_init_irq,
128 .timer = &kirkwood_timer, 129 .timer = &kirkwood_timer,
129MACHINE_END 130MACHINE_END
diff --git a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
index aff0e1327e38..957bd7997d7e 100644
--- a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
+++ b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
@@ -29,9 +29,6 @@
29#define BRIDGE_CAUSE (BRIDGE_VIRT_BASE | 0x0110) 29#define BRIDGE_CAUSE (BRIDGE_VIRT_BASE | 0x0110)
30#define WDT_INT_REQ 0x0008 30#define WDT_INT_REQ 0x0008
31 31
32#define BRIDGE_MASK (BRIDGE_VIRT_BASE | 0x0114)
33#define BRIDGE_INT_TIMER0 0x0002
34#define BRIDGE_INT_TIMER1 0x0004
35#define BRIDGE_INT_TIMER1_CLR (~0x0004) 32#define BRIDGE_INT_TIMER1_CLR (~0x0004)
36 33
37#define IRQ_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0200) 34#define IRQ_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0200)
diff --git a/arch/arm/mach-kirkwood/include/mach/gpio.h b/arch/arm/mach-kirkwood/include/mach/gpio.h
index 81b335eb62ec..84f340b546c0 100644
--- a/arch/arm/mach-kirkwood/include/mach/gpio.h
+++ b/arch/arm/mach-kirkwood/include/mach/gpio.h
@@ -6,33 +6,4 @@
6 * warranty of any kind, whether express or implied. 6 * warranty of any kind, whether express or implied.
7 */ 7 */
8 8
9#ifndef __ASM_ARCH_GPIO_H
10#define __ASM_ARCH_GPIO_H
11
12#include <mach/irqs.h>
13#include <plat/gpio.h> 9#include <plat/gpio.h>
14#include <asm-generic/gpio.h> /* cansleep wrappers */
15
16#define GPIO_MAX 50
17#define GPIO_OFF(pin) (((pin) >> 5) ? 0x0140 : 0x0100)
18#define GPIO_OUT(pin) (DEV_BUS_VIRT_BASE + GPIO_OFF(pin) + 0x00)
19#define GPIO_IO_CONF(pin) (DEV_BUS_VIRT_BASE + GPIO_OFF(pin) + 0x04)
20#define GPIO_BLINK_EN(pin) (DEV_BUS_VIRT_BASE + GPIO_OFF(pin) + 0x08)
21#define GPIO_IN_POL(pin) (DEV_BUS_VIRT_BASE + GPIO_OFF(pin) + 0x0c)
22#define GPIO_DATA_IN(pin) (DEV_BUS_VIRT_BASE + GPIO_OFF(pin) + 0x10)
23#define GPIO_EDGE_CAUSE(pin) (DEV_BUS_VIRT_BASE + GPIO_OFF(pin) + 0x14)
24#define GPIO_EDGE_MASK(pin) (DEV_BUS_VIRT_BASE + GPIO_OFF(pin) + 0x18)
25#define GPIO_LEVEL_MASK(pin) (DEV_BUS_VIRT_BASE + GPIO_OFF(pin) + 0x1c)
26
27static inline int gpio_to_irq(int pin)
28{
29 return pin + IRQ_KIRKWOOD_GPIO_START;
30}
31
32static inline int irq_to_gpio(int irq)
33{
34 return irq - IRQ_KIRKWOOD_GPIO_START;
35}
36
37
38#endif
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
index 6e924b398919..010bdeb4ac5f 100644
--- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h
+++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
@@ -69,6 +69,8 @@
69#define DEV_BUS_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x10000) 69#define DEV_BUS_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x10000)
70#define SAMPLE_AT_RESET (DEV_BUS_VIRT_BASE | 0x0030) 70#define SAMPLE_AT_RESET (DEV_BUS_VIRT_BASE | 0x0030)
71#define DEVICE_ID (DEV_BUS_VIRT_BASE | 0x0034) 71#define DEVICE_ID (DEV_BUS_VIRT_BASE | 0x0034)
72#define GPIO_LOW_VIRT_BASE (DEV_BUS_VIRT_BASE | 0x0100)
73#define GPIO_HIGH_VIRT_BASE (DEV_BUS_VIRT_BASE | 0x0140)
72#define RTC_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x0300) 74#define RTC_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x0300)
73#define SPI_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x0600) 75#define SPI_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x0600)
74#define I2C_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x1000) 76#define I2C_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x1000)
diff --git a/arch/arm/mach-kirkwood/include/mach/memory.h b/arch/arm/mach-kirkwood/include/mach/memory.h
index 45431e131465..4600b44e3ad3 100644
--- a/arch/arm/mach-kirkwood/include/mach/memory.h
+++ b/arch/arm/mach-kirkwood/include/mach/memory.h
@@ -5,6 +5,6 @@
5#ifndef __ASM_ARCH_MEMORY_H 5#ifndef __ASM_ARCH_MEMORY_H
6#define __ASM_ARCH_MEMORY_H 6#define __ASM_ARCH_MEMORY_H
7 7
8#define PHYS_OFFSET UL(0x00000000) 8#define PLAT_PHYS_OFFSET UL(0x00000000)
9 9
10#endif 10#endif
diff --git a/arch/arm/mach-kirkwood/irq.c b/arch/arm/mach-kirkwood/irq.c
index 28020abf49e1..cbdb5863d13b 100644
--- a/arch/arm/mach-kirkwood/irq.c
+++ b/arch/arm/mach-kirkwood/irq.c
@@ -27,31 +27,21 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
27 27
28void __init kirkwood_init_irq(void) 28void __init kirkwood_init_irq(void)
29{ 29{
30 int i;
31
32 orion_irq_init(0, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF)); 30 orion_irq_init(0, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF));
33 orion_irq_init(32, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF)); 31 orion_irq_init(32, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF));
34 32
35 /* 33 /*
36 * Mask and clear GPIO IRQ interrupts. 34 * Initialize gpiolib for GPIOs 0-49.
37 */ 35 */
38 writel(0, GPIO_LEVEL_MASK(0)); 36 orion_gpio_init(0, 32, GPIO_LOW_VIRT_BASE, 0,
39 writel(0, GPIO_EDGE_MASK(0)); 37 IRQ_KIRKWOOD_GPIO_START);
40 writel(0, GPIO_EDGE_CAUSE(0));
41 writel(0, GPIO_LEVEL_MASK(32));
42 writel(0, GPIO_EDGE_MASK(32));
43 writel(0, GPIO_EDGE_CAUSE(32));
44
45 for (i = IRQ_KIRKWOOD_GPIO_START; i < NR_IRQS; i++) {
46 set_irq_chip(i, &orion_gpio_irq_chip);
47 set_irq_handler(i, handle_level_irq);
48 irq_desc[i].status |= IRQ_LEVEL;
49 set_irq_flags(i, IRQF_VALID);
50 }
51 set_irq_chained_handler(IRQ_KIRKWOOD_GPIO_LOW_0_7, gpio_irq_handler); 38 set_irq_chained_handler(IRQ_KIRKWOOD_GPIO_LOW_0_7, gpio_irq_handler);
52 set_irq_chained_handler(IRQ_KIRKWOOD_GPIO_LOW_8_15, gpio_irq_handler); 39 set_irq_chained_handler(IRQ_KIRKWOOD_GPIO_LOW_8_15, gpio_irq_handler);
53 set_irq_chained_handler(IRQ_KIRKWOOD_GPIO_LOW_16_23, gpio_irq_handler); 40 set_irq_chained_handler(IRQ_KIRKWOOD_GPIO_LOW_16_23, gpio_irq_handler);
54 set_irq_chained_handler(IRQ_KIRKWOOD_GPIO_LOW_24_31, gpio_irq_handler); 41 set_irq_chained_handler(IRQ_KIRKWOOD_GPIO_LOW_24_31, gpio_irq_handler);
42
43 orion_gpio_init(32, 18, GPIO_HIGH_VIRT_BASE, 0,
44 IRQ_KIRKWOOD_GPIO_START + 32);
55 set_irq_chained_handler(IRQ_KIRKWOOD_GPIO_HIGH_0_7, gpio_irq_handler); 45 set_irq_chained_handler(IRQ_KIRKWOOD_GPIO_HIGH_0_7, gpio_irq_handler);
56 set_irq_chained_handler(IRQ_KIRKWOOD_GPIO_HIGH_8_15, gpio_irq_handler); 46 set_irq_chained_handler(IRQ_KIRKWOOD_GPIO_HIGH_8_15, gpio_irq_handler);
57 set_irq_chained_handler(IRQ_KIRKWOOD_GPIO_HIGH_16_23, gpio_irq_handler); 47 set_irq_chained_handler(IRQ_KIRKWOOD_GPIO_HIGH_16_23, gpio_irq_handler);
diff --git a/arch/arm/mach-kirkwood/mpp.c b/arch/arm/mach-kirkwood/mpp.c
index 27901f702feb..7ce201848067 100644
--- a/arch/arm/mach-kirkwood/mpp.c
+++ b/arch/arm/mach-kirkwood/mpp.c
@@ -49,9 +49,6 @@ void __init kirkwood_mpp_conf(unsigned int *mpp_list)
49 if (!variant_mask) 49 if (!variant_mask)
50 return; 50 return;
51 51
52 /* Initialize gpiolib. */
53 orion_gpio_init();
54
55 printk(KERN_DEBUG "initial MPP regs:"); 52 printk(KERN_DEBUG "initial MPP regs:");
56 for (i = 0; i < MPP_NR_REGS; i++) { 53 for (i = 0; i < MPP_NR_REGS; i++) {
57 mpp_ctrl[i] = readl(MPP_CTRL(i)); 54 mpp_ctrl[i] = readl(MPP_CTRL(i));
diff --git a/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c b/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
index 1e5266f57e2a..00cca22eca6f 100644
--- a/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
+++ b/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
@@ -166,6 +166,7 @@ MACHINE_START(MV88F6281GTW_GE, "Marvell 88F6281 GTW GE Board")
166 .boot_params = 0x00000100, 166 .boot_params = 0x00000100,
167 .init_machine = mv88f6281gtw_ge_init, 167 .init_machine = mv88f6281gtw_ge_init,
168 .map_io = kirkwood_map_io, 168 .map_io = kirkwood_map_io,
169 .init_early = kirkwood_init_early,
169 .init_irq = kirkwood_init_irq, 170 .init_irq = kirkwood_init_irq,
170 .timer = &kirkwood_timer, 171 .timer = &kirkwood_timer,
171MACHINE_END 172MACHINE_END
diff --git a/arch/arm/mach-kirkwood/netspace_v2-setup.c b/arch/arm/mach-kirkwood/netspace_v2-setup.c
index 65ee21fd2f3b..7cdab5776452 100644
--- a/arch/arm/mach-kirkwood/netspace_v2-setup.c
+++ b/arch/arm/mach-kirkwood/netspace_v2-setup.c
@@ -261,6 +261,7 @@ MACHINE_START(NETSPACE_V2, "LaCie Network Space v2")
261 .boot_params = 0x00000100, 261 .boot_params = 0x00000100,
262 .init_machine = netspace_v2_init, 262 .init_machine = netspace_v2_init,
263 .map_io = kirkwood_map_io, 263 .map_io = kirkwood_map_io,
264 .init_early = kirkwood_init_early,
264 .init_irq = kirkwood_init_irq, 265 .init_irq = kirkwood_init_irq,
265 .timer = &kirkwood_timer, 266 .timer = &kirkwood_timer,
266MACHINE_END 267MACHINE_END
@@ -271,6 +272,7 @@ MACHINE_START(INETSPACE_V2, "LaCie Internet Space v2")
271 .boot_params = 0x00000100, 272 .boot_params = 0x00000100,
272 .init_machine = netspace_v2_init, 273 .init_machine = netspace_v2_init,
273 .map_io = kirkwood_map_io, 274 .map_io = kirkwood_map_io,
275 .init_early = kirkwood_init_early,
274 .init_irq = kirkwood_init_irq, 276 .init_irq = kirkwood_init_irq,
275 .timer = &kirkwood_timer, 277 .timer = &kirkwood_timer,
276MACHINE_END 278MACHINE_END
@@ -281,6 +283,7 @@ MACHINE_START(NETSPACE_MAX_V2, "LaCie Network Space Max v2")
281 .boot_params = 0x00000100, 283 .boot_params = 0x00000100,
282 .init_machine = netspace_v2_init, 284 .init_machine = netspace_v2_init,
283 .map_io = kirkwood_map_io, 285 .map_io = kirkwood_map_io,
286 .init_early = kirkwood_init_early,
284 .init_irq = kirkwood_init_irq, 287 .init_irq = kirkwood_init_irq,
285 .timer = &kirkwood_timer, 288 .timer = &kirkwood_timer,
286MACHINE_END 289MACHINE_END
diff --git a/arch/arm/mach-kirkwood/netxbig_v2-setup.c b/arch/arm/mach-kirkwood/netxbig_v2-setup.c
index 93afd3c8bfd8..6be627deb0fc 100644
--- a/arch/arm/mach-kirkwood/netxbig_v2-setup.c
+++ b/arch/arm/mach-kirkwood/netxbig_v2-setup.c
@@ -402,6 +402,7 @@ MACHINE_START(NET2BIG_V2, "LaCie 2Big Network v2")
402 .boot_params = 0x00000100, 402 .boot_params = 0x00000100,
403 .init_machine = netxbig_v2_init, 403 .init_machine = netxbig_v2_init,
404 .map_io = kirkwood_map_io, 404 .map_io = kirkwood_map_io,
405 .init_early = kirkwood_init_early,
405 .init_irq = kirkwood_init_irq, 406 .init_irq = kirkwood_init_irq,
406 .timer = &kirkwood_timer, 407 .timer = &kirkwood_timer,
407MACHINE_END 408MACHINE_END
@@ -412,6 +413,7 @@ MACHINE_START(NET5BIG_V2, "LaCie 5Big Network v2")
412 .boot_params = 0x00000100, 413 .boot_params = 0x00000100,
413 .init_machine = netxbig_v2_init, 414 .init_machine = netxbig_v2_init,
414 .map_io = kirkwood_map_io, 415 .map_io = kirkwood_map_io,
416 .init_early = kirkwood_init_early,
415 .init_irq = kirkwood_init_irq, 417 .init_irq = kirkwood_init_irq,
416 .timer = &kirkwood_timer, 418 .timer = &kirkwood_timer,
417MACHINE_END 419MACHINE_END
diff --git a/arch/arm/mach-kirkwood/openrd-setup.c b/arch/arm/mach-kirkwood/openrd-setup.c
index cfcca4174e25..f69beeff4450 100644
--- a/arch/arm/mach-kirkwood/openrd-setup.c
+++ b/arch/arm/mach-kirkwood/openrd-setup.c
@@ -217,6 +217,7 @@ MACHINE_START(OPENRD_BASE, "Marvell OpenRD Base Board")
217 .boot_params = 0x00000100, 217 .boot_params = 0x00000100,
218 .init_machine = openrd_init, 218 .init_machine = openrd_init,
219 .map_io = kirkwood_map_io, 219 .map_io = kirkwood_map_io,
220 .init_early = kirkwood_init_early,
220 .init_irq = kirkwood_init_irq, 221 .init_irq = kirkwood_init_irq,
221 .timer = &kirkwood_timer, 222 .timer = &kirkwood_timer,
222MACHINE_END 223MACHINE_END
@@ -228,6 +229,7 @@ MACHINE_START(OPENRD_CLIENT, "Marvell OpenRD Client Board")
228 .boot_params = 0x00000100, 229 .boot_params = 0x00000100,
229 .init_machine = openrd_init, 230 .init_machine = openrd_init,
230 .map_io = kirkwood_map_io, 231 .map_io = kirkwood_map_io,
232 .init_early = kirkwood_init_early,
231 .init_irq = kirkwood_init_irq, 233 .init_irq = kirkwood_init_irq,
232 .timer = &kirkwood_timer, 234 .timer = &kirkwood_timer,
233MACHINE_END 235MACHINE_END
@@ -239,6 +241,7 @@ MACHINE_START(OPENRD_ULTIMATE, "Marvell OpenRD Ultimate Board")
239 .boot_params = 0x00000100, 241 .boot_params = 0x00000100,
240 .init_machine = openrd_init, 242 .init_machine = openrd_init,
241 .map_io = kirkwood_map_io, 243 .map_io = kirkwood_map_io,
244 .init_early = kirkwood_init_early,
242 .init_irq = kirkwood_init_irq, 245 .init_irq = kirkwood_init_irq,
243 .timer = &kirkwood_timer, 246 .timer = &kirkwood_timer,
244MACHINE_END 247MACHINE_END
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c
index 513ad3102d7c..ca294ff6d5be 100644
--- a/arch/arm/mach-kirkwood/pcie.c
+++ b/arch/arm/mach-kirkwood/pcie.c
@@ -18,8 +18,16 @@
18#include <mach/bridge-regs.h> 18#include <mach/bridge-regs.h>
19#include "common.h" 19#include "common.h"
20 20
21void kirkwood_enable_pcie(void)
22{
23 u32 curr = readl(CLOCK_GATING_CTRL);
24 if (!(curr & CGC_PEX0))
25 writel(curr | CGC_PEX0, CLOCK_GATING_CTRL);
26}
27
21void __init kirkwood_pcie_id(u32 *dev, u32 *rev) 28void __init kirkwood_pcie_id(u32 *dev, u32 *rev)
22{ 29{
30 kirkwood_enable_pcie();
23 *dev = orion_pcie_dev_id((void __iomem *)PCIE_VIRT_BASE); 31 *dev = orion_pcie_dev_id((void __iomem *)PCIE_VIRT_BASE);
24 *rev = orion_pcie_rev((void __iomem *)PCIE_VIRT_BASE); 32 *rev = orion_pcie_rev((void __iomem *)PCIE_VIRT_BASE);
25} 33}
diff --git a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
index 0049614cd324..75c6601b8d87 100644
--- a/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
+++ b/arch/arm/mach-kirkwood/rd88f6192-nas-setup.c
@@ -82,6 +82,7 @@ MACHINE_START(RD88F6192_NAS, "Marvell RD-88F6192-NAS Development Board")
82 .boot_params = 0x00000100, 82 .boot_params = 0x00000100,
83 .init_machine = rd88f6192_init, 83 .init_machine = rd88f6192_init,
84 .map_io = kirkwood_map_io, 84 .map_io = kirkwood_map_io,
85 .init_early = kirkwood_init_early,
85 .init_irq = kirkwood_init_irq, 86 .init_irq = kirkwood_init_irq,
86 .timer = &kirkwood_timer, 87 .timer = &kirkwood_timer,
87MACHINE_END 88MACHINE_END
diff --git a/arch/arm/mach-kirkwood/rd88f6281-setup.c b/arch/arm/mach-kirkwood/rd88f6281-setup.c
index 0998a08cf42d..0f75494d5902 100644
--- a/arch/arm/mach-kirkwood/rd88f6281-setup.c
+++ b/arch/arm/mach-kirkwood/rd88f6281-setup.c
@@ -118,6 +118,7 @@ MACHINE_START(RD88F6281, "Marvell RD-88F6281 Reference Board")
118 .boot_params = 0x00000100, 118 .boot_params = 0x00000100,
119 .init_machine = rd88f6281_init, 119 .init_machine = rd88f6281_init,
120 .map_io = kirkwood_map_io, 120 .map_io = kirkwood_map_io,
121 .init_early = kirkwood_init_early,
121 .init_irq = kirkwood_init_irq, 122 .init_irq = kirkwood_init_irq,
122 .timer = &kirkwood_timer, 123 .timer = &kirkwood_timer,
123MACHINE_END 124MACHINE_END
diff --git a/arch/arm/mach-kirkwood/sheevaplug-setup.c b/arch/arm/mach-kirkwood/sheevaplug-setup.c
index d2eec35dfe0f..0a95063f6d32 100644
--- a/arch/arm/mach-kirkwood/sheevaplug-setup.c
+++ b/arch/arm/mach-kirkwood/sheevaplug-setup.c
@@ -134,6 +134,7 @@ MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board")
134 .boot_params = 0x00000100, 134 .boot_params = 0x00000100,
135 .init_machine = sheevaplug_init, 135 .init_machine = sheevaplug_init,
136 .map_io = kirkwood_map_io, 136 .map_io = kirkwood_map_io,
137 .init_early = kirkwood_init_early,
137 .init_irq = kirkwood_init_irq, 138 .init_irq = kirkwood_init_irq,
138 .timer = &kirkwood_timer, 139 .timer = &kirkwood_timer,
139MACHINE_END 140MACHINE_END
@@ -144,6 +145,7 @@ MACHINE_START(ESATA_SHEEVAPLUG, "Marvell eSATA SheevaPlug Reference Board")
144 .boot_params = 0x00000100, 145 .boot_params = 0x00000100,
145 .init_machine = sheevaplug_init, 146 .init_machine = sheevaplug_init,
146 .map_io = kirkwood_map_io, 147 .map_io = kirkwood_map_io,
148 .init_early = kirkwood_init_early,
147 .init_irq = kirkwood_init_irq, 149 .init_irq = kirkwood_init_irq,
148 .timer = &kirkwood_timer, 150 .timer = &kirkwood_timer,
149MACHINE_END 151MACHINE_END
diff --git a/arch/arm/mach-kirkwood/t5325-setup.c b/arch/arm/mach-kirkwood/t5325-setup.c
index ce50e61aac9f..e6b9b1b22a35 100644
--- a/arch/arm/mach-kirkwood/t5325-setup.c
+++ b/arch/arm/mach-kirkwood/t5325-setup.c
@@ -23,6 +23,7 @@
23#include <linux/gpio.h> 23#include <linux/gpio.h>
24#include <linux/gpio_keys.h> 24#include <linux/gpio_keys.h>
25#include <linux/input.h> 25#include <linux/input.h>
26#include <sound/alc5623.h>
26#include <asm/mach-types.h> 27#include <asm/mach-types.h>
27#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
28#include <mach/kirkwood.h> 29#include <mach/kirkwood.h>
@@ -134,6 +135,7 @@ static unsigned int hp_t5325_mpp_config[] __initdata = {
134 MPP33_GE1_TXCTL, 135 MPP33_GE1_TXCTL,
135 MPP39_AU_I2SBCLK, 136 MPP39_AU_I2SBCLK,
136 MPP40_AU_I2SDO, 137 MPP40_AU_I2SDO,
138 MPP43_AU_I2SDI,
137 MPP41_AU_I2SLRCLK, 139 MPP41_AU_I2SLRCLK,
138 MPP42_AU_I2SMCLK, 140 MPP42_AU_I2SMCLK,
139 MPP45_GPIO, /* Power button */ 141 MPP45_GPIO, /* Power button */
@@ -141,6 +143,18 @@ static unsigned int hp_t5325_mpp_config[] __initdata = {
141 0 143 0
142}; 144};
143 145
146static struct alc5623_platform_data alc5621_data = {
147 .add_ctrl = 0x3700,
148 .jack_det_ctrl = 0x4810,
149};
150
151static struct i2c_board_info i2c_board_info[] __initdata = {
152 {
153 I2C_BOARD_INFO("alc5621", 0x1a),
154 .platform_data = &alc5621_data,
155 },
156};
157
144#define HP_T5325_GPIO_POWER_OFF 48 158#define HP_T5325_GPIO_POWER_OFF 48
145 159
146static void hp_t5325_power_off(void) 160static void hp_t5325_power_off(void)
@@ -166,6 +180,9 @@ static void __init hp_t5325_init(void)
166 kirkwood_ehci_init(); 180 kirkwood_ehci_init();
167 platform_device_register(&hp_t5325_button_device); 181 platform_device_register(&hp_t5325_button_device);
168 182
183 i2c_register_board_info(0, i2c_board_info, ARRAY_SIZE(i2c_board_info));
184 kirkwood_audio_init();
185
169 if (gpio_request(HP_T5325_GPIO_POWER_OFF, "power-off") == 0 && 186 if (gpio_request(HP_T5325_GPIO_POWER_OFF, "power-off") == 0 &&
170 gpio_direction_output(HP_T5325_GPIO_POWER_OFF, 0) == 0) 187 gpio_direction_output(HP_T5325_GPIO_POWER_OFF, 0) == 0)
171 pm_power_off = hp_t5325_power_off; 188 pm_power_off = hp_t5325_power_off;
@@ -187,6 +204,7 @@ MACHINE_START(T5325, "HP t5325 Thin Client")
187 .boot_params = 0x00000100, 204 .boot_params = 0x00000100,
188 .init_machine = hp_t5325_init, 205 .init_machine = hp_t5325_init,
189 .map_io = kirkwood_map_io, 206 .map_io = kirkwood_map_io,
207 .init_early = kirkwood_init_early,
190 .init_irq = kirkwood_init_irq, 208 .init_irq = kirkwood_init_irq,
191 .timer = &kirkwood_timer, 209 .timer = &kirkwood_timer,
192MACHINE_END 210MACHINE_END
diff --git a/arch/arm/mach-kirkwood/ts219-setup.c b/arch/arm/mach-kirkwood/ts219-setup.c
index dc999c4c5806..68f32f2bf552 100644
--- a/arch/arm/mach-kirkwood/ts219-setup.c
+++ b/arch/arm/mach-kirkwood/ts219-setup.c
@@ -135,6 +135,7 @@ MACHINE_START(TS219, "QNAP TS-119/TS-219")
135 .boot_params = 0x00000100, 135 .boot_params = 0x00000100,
136 .init_machine = qnap_ts219_init, 136 .init_machine = qnap_ts219_init,
137 .map_io = kirkwood_map_io, 137 .map_io = kirkwood_map_io,
138 .init_early = kirkwood_init_early,
138 .init_irq = kirkwood_init_irq, 139 .init_irq = kirkwood_init_irq,
139 .timer = &kirkwood_timer, 140 .timer = &kirkwood_timer,
140MACHINE_END 141MACHINE_END
diff --git a/arch/arm/mach-kirkwood/ts41x-setup.c b/arch/arm/mach-kirkwood/ts41x-setup.c
index 9a44029915e2..d5d009970705 100644
--- a/arch/arm/mach-kirkwood/ts41x-setup.c
+++ b/arch/arm/mach-kirkwood/ts41x-setup.c
@@ -154,6 +154,8 @@ static void __init qnap_ts41x_init(void)
154static int __init ts41x_pci_init(void) 154static int __init ts41x_pci_init(void)
155{ 155{
156 if (machine_is_ts41x()) { 156 if (machine_is_ts41x()) {
157 u32 dev, rev;
158
157 /* 159 /*
158 * Without this explicit reset, the PCIe SATA controller 160 * Without this explicit reset, the PCIe SATA controller
159 * (Marvell 88sx7042/sata_mv) is known to stop working 161 * (Marvell 88sx7042/sata_mv) is known to stop working
@@ -161,7 +163,11 @@ static int __init ts41x_pci_init(void)
161 */ 163 */
162 orion_pcie_reset((void __iomem *)PCIE_VIRT_BASE); 164 orion_pcie_reset((void __iomem *)PCIE_VIRT_BASE);
163 165
164 kirkwood_pcie_init(KW_PCIE0); 166 kirkwood_pcie_id(&dev, &rev);
167 if (dev == MV88F6282_DEV_ID)
168 kirkwood_pcie_init(KW_PCIE1 | KW_PCIE0);
169 else
170 kirkwood_pcie_init(KW_PCIE0);
165 } 171 }
166 172
167 return 0; 173 return 0;
@@ -173,6 +179,7 @@ MACHINE_START(TS41X, "QNAP TS-41x")
173 .boot_params = 0x00000100, 179 .boot_params = 0x00000100,
174 .init_machine = qnap_ts41x_init, 180 .init_machine = qnap_ts41x_init,
175 .map_io = kirkwood_map_io, 181 .map_io = kirkwood_map_io,
182 .init_early = kirkwood_init_early,
176 .init_irq = kirkwood_init_irq, 183 .init_irq = kirkwood_init_irq,
177 .timer = &kirkwood_timer, 184 .timer = &kirkwood_timer,
178MACHINE_END 185MACHINE_END
diff --git a/arch/arm/mach-ks8695/include/mach/memory.h b/arch/arm/mach-ks8695/include/mach/memory.h
index bace9a681adc..f7e1b9bce345 100644
--- a/arch/arm/mach-ks8695/include/mach/memory.h
+++ b/arch/arm/mach-ks8695/include/mach/memory.h
@@ -18,7 +18,7 @@
18/* 18/*
19 * Physical SRAM offset. 19 * Physical SRAM offset.
20 */ 20 */
21#define PHYS_OFFSET KS8695_SDRAM_PA 21#define PLAT_PHYS_OFFSET KS8695_SDRAM_PA
22 22
23#ifndef __ASSEMBLY__ 23#ifndef __ASSEMBLY__
24 24
diff --git a/arch/arm/mach-lh7a40x/Kconfig b/arch/arm/mach-lh7a40x/Kconfig
deleted file mode 100644
index 9be7466e346c..000000000000
--- a/arch/arm/mach-lh7a40x/Kconfig
+++ /dev/null
@@ -1,74 +0,0 @@
1if ARCH_LH7A40X
2
3menu "LH7A40X Implementations"
4
5config MACH_KEV7A400
6 bool "KEV7A400"
7 select ARCH_LH7A400
8 help
9 Say Y here if you are using the Sharp KEV7A400 development
10 board. This hardware is discontinued, so I'd be very
11 surprised if you wanted this option.
12
13config MACH_LPD7A400
14 bool "LPD7A400 Card Engine"
15 select ARCH_LH7A400
16# select IDE_POLL
17# select HAS_TOUCHSCREEN_ADS7843_LH7
18 help
19 Say Y here if you are using Logic Product Development's
20 LPD7A400 CardEngine. For the time being, the LPD7A400 and
21 LPD7A404 options are mutually exclusive.
22
23config MACH_LPD7A404
24 bool "LPD7A404 Card Engine"
25 select ARCH_LH7A404
26# select IDE_POLL
27# select HAS_TOUCHSCREEN_ADC_LH7
28 help
29 Say Y here if you are using Logic Product Development's
30 LPD7A404 CardEngine. For the time being, the LPD7A400 and
31 LPD7A404 options are mutually exclusive.
32
33config ARCH_LH7A400
34 bool
35
36config ARCH_LH7A404
37 bool
38
39config LPD7A40X_CPLD_SSP
40 bool
41
42config LH7A40X_CONTIGMEM
43 bool "Disable NUMA/SparseMEM Support"
44 help
45 Say Y here if your bootloader sets the SROMLL bit(s) in
46 the SDRAM controller, organizing memory as a contiguous
47 array. This option will disable sparse memory support
48 and force the kernel to manage all memory in one node.
49
50 Setting this option incorrectly may prevent the kernel
51 from booting. It is OK to leave it N.
52
53 For more information, consult
54 <file:Documentation/arm/Sharp-LH/SDRAM>.
55
56config LH7A40X_ONE_BANK_PER_NODE
57 bool "Optimize NUMA Node Tables for Size"
58 depends on !LH7A40X_CONTIGMEM
59 help
60 Say Y here to produce compact memory node tables. By
61 default pairs of adjacent physical RAM banks are managed
62 together in a single node, incurring some wasted overhead
63 in the node tables, however also maintaining compatibility
64 with systems where physical memory is truly contiguous.
65
66 Setting this option incorrectly may prevent the kernel from
67 booting. It is OK to leave it N.
68
69 For more information, consult
70 <file:Documentation/arm/Sharp-LH/SDRAM>.
71
72endmenu
73
74endif
diff --git a/arch/arm/mach-lh7a40x/Makefile b/arch/arm/mach-lh7a40x/Makefile
deleted file mode 100644
index 94b8615fb3c3..000000000000
--- a/arch/arm/mach-lh7a40x/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6
7obj-y := time.o clocks.o
8obj-m :=
9obj-n :=
10obj- :=
11
12obj-$(CONFIG_MACH_KEV7A400) += arch-kev7a400.o irq-lh7a400.o
13obj-$(CONFIG_MACH_LPD7A400) += arch-lpd7a40x.o irq-lh7a400.o
14obj-$(CONFIG_MACH_LPD7A404) += arch-lpd7a40x.o irq-lh7a404.o
15obj-$(CONFIG_LPD7A40X_CPLD_SSP) += ssp-cpld.o
16obj-$(CONFIG_FB_ARMCLCD) += clcd.o
17
diff --git a/arch/arm/mach-lh7a40x/Makefile.boot b/arch/arm/mach-lh7a40x/Makefile.boot
deleted file mode 100644
index af941be076eb..000000000000
--- a/arch/arm/mach-lh7a40x/Makefile.boot
+++ /dev/null
@@ -1,4 +0,0 @@
1 zreladdr-y := 0xc0008000
2params_phys-y := 0xc0000100
3initrd_phys-y := 0xc4000000
4
diff --git a/arch/arm/mach-lh7a40x/arch-kev7a400.c b/arch/arm/mach-lh7a40x/arch-kev7a400.c
deleted file mode 100644
index 71129c33c7d2..000000000000
--- a/arch/arm/mach-lh7a40x/arch-kev7a400.c
+++ /dev/null
@@ -1,118 +0,0 @@
1/* arch/arm/mach-lh7a40x/arch-kev7a400.c
2 *
3 * Copyright (C) 2004 Logic Product Development
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 */
10
11#include <linux/tty.h>
12#include <linux/init.h>
13#include <linux/device.h>
14#include <linux/interrupt.h>
15
16#include <mach/hardware.h>
17#include <asm/setup.h>
18#include <asm/mach-types.h>
19#include <asm/mach/arch.h>
20#include <asm/irq.h>
21#include <asm/mach/irq.h>
22#include <asm/mach/map.h>
23
24#include "common.h"
25
26 /* This function calls the board specific IRQ initialization function. */
27
28static struct map_desc kev7a400_io_desc[] __initdata = {
29 {
30 .virtual = IO_VIRT,
31 .pfn = __phys_to_pfn(IO_PHYS),
32 .length = IO_SIZE,
33 .type = MT_DEVICE
34 }, {
35 .virtual = CPLD_VIRT,
36 .pfn = __phys_to_pfn(CPLD_PHYS),
37 .length = CPLD_SIZE,
38 .type = MT_DEVICE
39 }
40};
41
42void __init kev7a400_map_io(void)
43{
44 iotable_init (kev7a400_io_desc, ARRAY_SIZE (kev7a400_io_desc));
45}
46
47static u16 CPLD_IRQ_mask; /* Mask for CPLD IRQs, 1 == unmasked */
48
49static void kev7a400_ack_cpld_irq(struct irq_data *d)
50{
51 CPLD_CL_INT = 1 << (d->irq - IRQ_KEV7A400_CPLD);
52}
53
54static void kev7a400_mask_cpld_irq(struct irq_data *d)
55{
56 CPLD_IRQ_mask &= ~(1 << (d->irq - IRQ_KEV7A400_CPLD));
57 CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask;
58}
59
60static void kev7a400_unmask_cpld_irq(struct irq_data *d)
61{
62 CPLD_IRQ_mask |= 1 << (d->irq - IRQ_KEV7A400_CPLD);
63 CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask;
64}
65
66static struct irq_chip kev7a400_cpld_chip = {
67 .name = "CPLD",
68 .irq_ack = kev7a400_ack_cpld_irq,
69 .irq_mask = kev7a400_mask_cpld_irq,
70 .irq_unmask = kev7a400_unmask_cpld_irq,
71};
72
73
74static void kev7a400_cpld_handler (unsigned int irq, struct irq_desc *desc)
75{
76 u32 mask = CPLD_LATCHED_INTS;
77 irq = IRQ_KEV7A400_CPLD;
78 for (; mask; mask >>= 1, ++irq)
79 if (mask & 1)
80 generic_handle_irq(irq);
81}
82
83void __init lh7a40x_init_board_irq (void)
84{
85 int irq;
86
87 for (irq = IRQ_KEV7A400_CPLD;
88 irq < IRQ_KEV7A400_CPLD + NR_IRQ_BOARD; ++irq) {
89 set_irq_chip (irq, &kev7a400_cpld_chip);
90 set_irq_handler (irq, handle_edge_irq);
91 set_irq_flags (irq, IRQF_VALID);
92 }
93 set_irq_chained_handler (IRQ_CPLD, kev7a400_cpld_handler);
94
95 /* Clear all CPLD interrupts */
96 CPLD_CL_INT = 0xff; /* CPLD_INTR_MMC_CD | CPLD_INTR_ETH_INT; */
97
98 GPIO_GPIOINTEN = 0; /* Disable all GPIO interrupts */
99 barrier();
100
101#if 0
102 GPIO_INTTYPE1
103 = (GPIO_INTR_PCC1_CD | GPIO_INTR_PCC1_CD); /* Edge trig. */
104 GPIO_INTTYPE2 = 0; /* Falling edge & low-level */
105 GPIO_GPIOFEOI = 0xff; /* Clear all GPIO interrupts */
106 GPIO_GPIOINTEN = 0xff; /* Enable all GPIO interrupts */
107
108 init_FIQ();
109#endif
110}
111
112MACHINE_START (KEV7A400, "Sharp KEV7a400")
113 /* Maintainer: Marc Singer */
114 .boot_params = 0xc0000100,
115 .map_io = kev7a400_map_io,
116 .init_irq = lh7a400_init_irq,
117 .timer = &lh7a40x_timer,
118MACHINE_END
diff --git a/arch/arm/mach-lh7a40x/arch-lpd7a40x.c b/arch/arm/mach-lh7a40x/arch-lpd7a40x.c
deleted file mode 100644
index e735546181ad..000000000000
--- a/arch/arm/mach-lh7a40x/arch-lpd7a40x.c
+++ /dev/null
@@ -1,422 +0,0 @@
1/* arch/arm/mach-lh7a40x/arch-lpd7a40x.c
2 *
3 * Copyright (C) 2004 Logic Product Development
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 */
10
11#include <linux/tty.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/interrupt.h>
15#include <linux/irq.h>
16
17#include <mach/hardware.h>
18#include <asm/setup.h>
19#include <asm/mach-types.h>
20#include <asm/mach/arch.h>
21#include <asm/irq.h>
22#include <asm/mach/irq.h>
23#include <asm/mach/map.h>
24
25#include "common.h"
26
27#define CPLD_INT_NETHERNET (1<<0)
28#define CPLD_INTMASK_ETHERNET (1<<2)
29#if defined (CONFIG_MACH_LPD7A400)
30# define CPLD_INT_NTOUCH (1<<1)
31# define CPLD_INTMASK_TOUCH (1<<3)
32# define CPLD_INT_PEN (1<<4)
33# define CPLD_INTMASK_PEN (1<<4)
34# define CPLD_INT_PIRQ (1<<4)
35#endif
36#define CPLD_INTMASK_CPLD (1<<7)
37#define CPLD_INT_CPLD (1<<6)
38
39#define CPLD_CONTROL_SWINT (1<<7) /* Disable all CPLD IRQs */
40#define CPLD_CONTROL_OCMSK (1<<6) /* Mask USB1 connect IRQ */
41#define CPLD_CONTROL_PDRV (1<<5) /* PCC_nDRV high */
42#define CPLD_CONTROL_USB1C (1<<4) /* USB1 connect IRQ active */
43#define CPLD_CONTROL_USB1P (1<<3) /* USB1 power disable */
44#define CPLD_CONTROL_AWKP (1<<2) /* Auto-wakeup disabled */
45#define CPLD_CONTROL_LCD_ENABLE (1<<1) /* LCD Vee enable */
46#define CPLD_CONTROL_WRLAN_NENABLE (1<<0) /* SMC91x power disable */
47
48
49static struct resource smc91x_resources[] = {
50 [0] = {
51 .start = CPLD00_PHYS,
52 .end = CPLD00_PHYS + CPLD00_SIZE - 1, /* Only needs 16B */
53 .flags = IORESOURCE_MEM,
54 },
55
56 [1] = {
57 .start = IRQ_LPD7A40X_ETH_INT,
58 .end = IRQ_LPD7A40X_ETH_INT,
59 .flags = IORESOURCE_IRQ,
60 },
61
62};
63
64static struct platform_device smc91x_device = {
65 .name = "smc91x",
66 .id = 0,
67 .num_resources = ARRAY_SIZE(smc91x_resources),
68 .resource = smc91x_resources,
69};
70
71static struct resource lh7a40x_usbclient_resources[] = {
72 [0] = {
73 .start = USB_PHYS,
74 .end = (USB_PHYS + PAGE_SIZE),
75 .flags = IORESOURCE_MEM,
76 },
77 [1] = {
78 .start = IRQ_USB,
79 .end = IRQ_USB,
80 .flags = IORESOURCE_IRQ,
81 },
82};
83
84static u64 lh7a40x_usbclient_dma_mask = 0xffffffffUL;
85
86static struct platform_device lh7a40x_usbclient_device = {
87// .name = "lh7a40x_udc",
88 .name = "lh7-udc",
89 .id = 0,
90 .dev = {
91 .dma_mask = &lh7a40x_usbclient_dma_mask,
92 .coherent_dma_mask = 0xffffffffUL,
93 },
94 .num_resources = ARRAY_SIZE (lh7a40x_usbclient_resources),
95 .resource = lh7a40x_usbclient_resources,
96};
97
98#if defined (CONFIG_ARCH_LH7A404)
99
100static struct resource lh7a404_usbhost_resources [] = {
101 [0] = {
102 .start = USBH_PHYS,
103 .end = (USBH_PHYS + 0xFF),
104 .flags = IORESOURCE_MEM,
105 },
106 [1] = {
107 .start = IRQ_USHINTR,
108 .end = IRQ_USHINTR,
109 .flags = IORESOURCE_IRQ,
110 },
111};
112
113static u64 lh7a404_usbhost_dma_mask = 0xffffffffUL;
114
115static struct platform_device lh7a404_usbhost_device = {
116 .name = "lh7a404-ohci",
117 .id = 0,
118 .dev = {
119 .dma_mask = &lh7a404_usbhost_dma_mask,
120 .coherent_dma_mask = 0xffffffffUL,
121 },
122 .num_resources = ARRAY_SIZE (lh7a404_usbhost_resources),
123 .resource = lh7a404_usbhost_resources,
124};
125
126#endif
127
128static struct platform_device* lpd7a40x_devs[] __initdata = {
129 &smc91x_device,
130 &lh7a40x_usbclient_device,
131#if defined (CONFIG_ARCH_LH7A404)
132 &lh7a404_usbhost_device,
133#endif
134};
135
136extern void lpd7a400_map_io (void);
137
138static void __init lpd7a40x_init (void)
139{
140#if defined (CONFIG_MACH_LPD7A400)
141 CPLD_CONTROL |= 0
142 | CPLD_CONTROL_SWINT /* Disable software interrupt */
143 | CPLD_CONTROL_OCMSK; /* Mask USB1 connection IRQ */
144 CPLD_CONTROL &= ~(0
145 | CPLD_CONTROL_LCD_ENABLE /* Disable LCD */
146 | CPLD_CONTROL_WRLAN_NENABLE /* Enable SMC91x */
147 );
148#endif
149
150#if defined (CONFIG_MACH_LPD7A404)
151 CPLD_CONTROL &= ~(0
152 | CPLD_CONTROL_WRLAN_NENABLE /* Enable SMC91x */
153 );
154#endif
155
156 platform_add_devices (lpd7a40x_devs, ARRAY_SIZE (lpd7a40x_devs));
157#if defined (CONFIG_FB_ARMCLCD)
158 lh7a40x_clcd_init ();
159#endif
160}
161
162static void lh7a40x_ack_cpld_irq(struct irq_data *d)
163{
164 /* CPLD doesn't have ack capability, but some devices may */
165
166#if defined (CPLD_INTMASK_TOUCH)
167 /* The touch control *must* mask the interrupt because the
168 * interrupt bit is read by the driver to determine if the pen
169 * is still down. */
170 if (d->irq == IRQ_TOUCH)
171 CPLD_INTERRUPTS |= CPLD_INTMASK_TOUCH;
172#endif
173}
174
175static void lh7a40x_mask_cpld_irq(struct irq_data *d)
176{
177 switch (d->irq) {
178 case IRQ_LPD7A40X_ETH_INT:
179 CPLD_INTERRUPTS |= CPLD_INTMASK_ETHERNET;
180 break;
181#if defined (IRQ_TOUCH)
182 case IRQ_TOUCH:
183 CPLD_INTERRUPTS |= CPLD_INTMASK_TOUCH;
184 break;
185#endif
186 }
187}
188
189static void lh7a40x_unmask_cpld_irq(struct irq_data *d)
190{
191 switch (d->irq) {
192 case IRQ_LPD7A40X_ETH_INT:
193 CPLD_INTERRUPTS &= ~CPLD_INTMASK_ETHERNET;
194 break;
195#if defined (IRQ_TOUCH)
196 case IRQ_TOUCH:
197 CPLD_INTERRUPTS &= ~CPLD_INTMASK_TOUCH;
198 break;
199#endif
200 }
201}
202
203static struct irq_chip lpd7a40x_cpld_chip = {
204 .name = "CPLD",
205 .irq_ack = lh7a40x_ack_cpld_irq,
206 .irq_mask = lh7a40x_mask_cpld_irq,
207 .irq_unmask = lh7a40x_unmask_cpld_irq,
208};
209
210static void lpd7a40x_cpld_handler (unsigned int irq, struct irq_desc *desc)
211{
212 unsigned int mask = CPLD_INTERRUPTS;
213
214 desc->irq_data.chip->irq_ack(&desc->irq_data);
215
216 if ((mask & (1<<0)) == 0) /* WLAN */
217 generic_handle_irq(IRQ_LPD7A40X_ETH_INT);
218
219#if defined (IRQ_TOUCH)
220 if ((mask & (1<<1)) == 0) /* Touch */
221 generic_handle_irq(IRQ_TOUCH);
222#endif
223
224 /* Level-triggered need this */
225 desc->irq_data.chip->irq_unmask(&desc->irq_data);
226}
227
228
229void __init lh7a40x_init_board_irq (void)
230{
231 int irq;
232
233 /* Rev A (v2.8): PF0, PF1, PF2, and PF3 are available IRQs.
234 PF7 supports the CPLD.
235 Rev B (v3.4): PF0, PF1, and PF2 are available IRQs.
236 PF3 supports the CPLD.
237 (Some) LPD7A404 prerelease boards report a version
238 number of 0x16, but we force an override since the
239 hardware is of the newer variety.
240 */
241
242 unsigned char cpld_version = CPLD_REVISION;
243 int pinCPLD = (cpld_version == 0x28) ? 7 : 3;
244
245#if defined CONFIG_MACH_LPD7A404
246 cpld_version = 0x34; /* Coerce LPD7A404 to RevB */
247#endif
248
249 /* First, configure user controlled GPIOF interrupts */
250
251 GPIO_PFDD &= ~0x0f; /* PF0-3 are inputs */
252 GPIO_INTTYPE1 &= ~0x0f; /* PF0-3 are level triggered */
253 GPIO_INTTYPE2 &= ~0x0f; /* PF0-3 are active low */
254 barrier ();
255 GPIO_GPIOFINTEN |= 0x0f; /* Enable PF0, PF1, PF2, and PF3 IRQs */
256
257 /* Then, configure CPLD interrupt */
258
259 /* Disable all CPLD interrupts */
260#if defined (CONFIG_MACH_LPD7A400)
261 CPLD_INTERRUPTS = CPLD_INTMASK_TOUCH | CPLD_INTMASK_PEN
262 | CPLD_INTMASK_ETHERNET;
263 /* *** FIXME: don't know why we need 7 and 4. 7 is way wrong
264 and 4 is uncefined. */
265 // (1<<7)|(1<<4)|(1<<3)|(1<<2);
266#endif
267#if defined (CONFIG_MACH_LPD7A404)
268 CPLD_INTERRUPTS = CPLD_INTMASK_ETHERNET;
269 /* *** FIXME: don't know why we need 6 and 5, neither is defined. */
270 // (1<<6)|(1<<5)|(1<<3);
271#endif
272 GPIO_PFDD &= ~(1 << pinCPLD); /* Make input */
273 GPIO_INTTYPE1 &= ~(1 << pinCPLD); /* Level triggered */
274 GPIO_INTTYPE2 &= ~(1 << pinCPLD); /* Active low */
275 barrier ();
276 GPIO_GPIOFINTEN |= (1 << pinCPLD); /* Enable */
277
278 /* Cascade CPLD interrupts */
279
280 for (irq = IRQ_BOARD_START;
281 irq < IRQ_BOARD_START + NR_IRQ_BOARD; ++irq) {
282 set_irq_chip (irq, &lpd7a40x_cpld_chip);
283 set_irq_handler (irq, handle_level_irq);
284 set_irq_flags (irq, IRQF_VALID);
285 }
286
287 set_irq_chained_handler ((cpld_version == 0x28)
288 ? IRQ_CPLD_V28
289 : IRQ_CPLD_V34,
290 lpd7a40x_cpld_handler);
291}
292
293static struct map_desc lpd7a40x_io_desc[] __initdata = {
294 {
295 .virtual = IO_VIRT,
296 .pfn = __phys_to_pfn(IO_PHYS),
297 .length = IO_SIZE,
298 .type = MT_DEVICE
299 },
300 { /* Mapping added to work around chip select problems */
301 .virtual = IOBARRIER_VIRT,
302 .pfn = __phys_to_pfn(IOBARRIER_PHYS),
303 .length = IOBARRIER_SIZE,
304 .type = MT_DEVICE
305 },
306 {
307 .virtual = CF_VIRT,
308 .pfn = __phys_to_pfn(CF_PHYS),
309 .length = CF_SIZE,
310 .type = MT_DEVICE
311 },
312 {
313 .virtual = CPLD02_VIRT,
314 .pfn = __phys_to_pfn(CPLD02_PHYS),
315 .length = CPLD02_SIZE,
316 .type = MT_DEVICE
317 },
318 {
319 .virtual = CPLD06_VIRT,
320 .pfn = __phys_to_pfn(CPLD06_PHYS),
321 .length = CPLD06_SIZE,
322 .type = MT_DEVICE
323 },
324 {
325 .virtual = CPLD08_VIRT,
326 .pfn = __phys_to_pfn(CPLD08_PHYS),
327 .length = CPLD08_SIZE,
328 .type = MT_DEVICE
329 },
330 {
331 .virtual = CPLD08_VIRT,
332 .pfn = __phys_to_pfn(CPLD08_PHYS),
333 .length = CPLD08_SIZE,
334 .type = MT_DEVICE
335 },
336 {
337 .virtual = CPLD0A_VIRT,
338 .pfn = __phys_to_pfn(CPLD0A_PHYS),
339 .length = CPLD0A_SIZE,
340 .type = MT_DEVICE
341 },
342 {
343 .virtual = CPLD0C_VIRT,
344 .pfn = __phys_to_pfn(CPLD0C_PHYS),
345 .length = CPLD0C_SIZE,
346 .type = MT_DEVICE
347 },
348 {
349 .virtual = CPLD0E_VIRT,
350 .pfn = __phys_to_pfn(CPLD0E_PHYS),
351 .length = CPLD0E_SIZE,
352 .type = MT_DEVICE
353 },
354 {
355 .virtual = CPLD10_VIRT,
356 .pfn = __phys_to_pfn(CPLD10_PHYS),
357 .length = CPLD10_SIZE,
358 .type = MT_DEVICE
359 },
360 {
361 .virtual = CPLD12_VIRT,
362 .pfn = __phys_to_pfn(CPLD12_PHYS),
363 .length = CPLD12_SIZE,
364 .type = MT_DEVICE
365 },
366 {
367 .virtual = CPLD14_VIRT,
368 .pfn = __phys_to_pfn(CPLD14_PHYS),
369 .length = CPLD14_SIZE,
370 .type = MT_DEVICE
371 },
372 {
373 .virtual = CPLD16_VIRT,
374 .pfn = __phys_to_pfn(CPLD16_PHYS),
375 .length = CPLD16_SIZE,
376 .type = MT_DEVICE
377 },
378 {
379 .virtual = CPLD18_VIRT,
380 .pfn = __phys_to_pfn(CPLD18_PHYS),
381 .length = CPLD18_SIZE,
382 .type = MT_DEVICE
383 },
384 {
385 .virtual = CPLD1A_VIRT,
386 .pfn = __phys_to_pfn(CPLD1A_PHYS),
387 .length = CPLD1A_SIZE,
388 .type = MT_DEVICE
389 },
390};
391
392void __init
393lpd7a40x_map_io(void)
394{
395 iotable_init (lpd7a40x_io_desc, ARRAY_SIZE (lpd7a40x_io_desc));
396}
397
398#ifdef CONFIG_MACH_LPD7A400
399
400MACHINE_START (LPD7A400, "Logic Product Development LPD7A400-10")
401 /* Maintainer: Marc Singer */
402 .boot_params = 0xc0000100,
403 .map_io = lpd7a40x_map_io,
404 .init_irq = lh7a400_init_irq,
405 .timer = &lh7a40x_timer,
406 .init_machine = lpd7a40x_init,
407MACHINE_END
408
409#endif
410
411#ifdef CONFIG_MACH_LPD7A404
412
413MACHINE_START (LPD7A404, "Logic Product Development LPD7A404-10")
414 /* Maintainer: Marc Singer */
415 .boot_params = 0xc0000100,
416 .map_io = lpd7a40x_map_io,
417 .init_irq = lh7a404_init_irq,
418 .timer = &lh7a40x_timer,
419 .init_machine = lpd7a40x_init,
420MACHINE_END
421
422#endif
diff --git a/arch/arm/mach-lh7a40x/clcd.c b/arch/arm/mach-lh7a40x/clcd.c
deleted file mode 100644
index 7fe4fd347c82..000000000000
--- a/arch/arm/mach-lh7a40x/clcd.c
+++ /dev/null
@@ -1,241 +0,0 @@
1/*
2 * arch/arm/mach-lh7a40x/clcd.c
3 *
4 * Copyright (C) 2004 Marc Singer
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 *
10 */
11
12#include <linux/init.h>
13#include <linux/gfp.h>
14#include <linux/device.h>
15#include <linux/dma-mapping.h>
16#include <linux/sysdev.h>
17#include <linux/interrupt.h>
18
19//#include <linux/module.h>
20//#include <linux/time.h>
21
22//#include <asm/mach/time.h>
23#include <asm/irq.h>
24#include <asm/mach/irq.h>
25
26#include <asm/system.h>
27#include <mach/hardware.h>
28#include <linux/amba/bus.h>
29#include <linux/amba/clcd.h>
30
31#define HRTFTC_HRSETUP __REG(HRTFTC_PHYS + 0x00)
32#define HRTFTC_HRCON __REG(HRTFTC_PHYS + 0x04)
33#define HRTFTC_HRTIMING1 __REG(HRTFTC_PHYS + 0x08)
34#define HRTFTC_HRTIMING2 __REG(HRTFTC_PHYS + 0x0c)
35
36#define ALI_SETUP __REG(ALI_PHYS + 0x00)
37#define ALI_CONTROL __REG(ALI_PHYS + 0x04)
38#define ALI_TIMING1 __REG(ALI_PHYS + 0x08)
39#define ALI_TIMING2 __REG(ALI_PHYS + 0x0c)
40
41#include "lcd-panel.h"
42
43static void lh7a40x_clcd_disable (struct clcd_fb *fb)
44{
45#if defined (CONFIG_MACH_LPD7A400)
46 CPLD_CONTROL &= ~(1<<1); /* Disable LCD Vee */
47#endif
48
49#if defined (CONFIG_MACH_LPD7A404)
50 GPIO_PCD &= ~(1<<3); /* Disable LCD Vee */
51#endif
52
53#if defined (CONFIG_ARCH_LH7A400)
54 HRTFTC_HRSETUP &= ~(1<<13); /* Disable HRTFT controller */
55#endif
56
57#if defined (CONFIG_ARCH_LH7A404)
58 ALI_SETUP &= ~(1<<13); /* Disable ALI */
59#endif
60}
61
62static void lh7a40x_clcd_enable (struct clcd_fb *fb)
63{
64 struct clcd_panel_extra* extra
65 = (struct clcd_panel_extra*) fb->board_data;
66
67#if defined (CONFIG_MACH_LPD7A400)
68 CPLD_CONTROL |= (1<<1); /* Enable LCD Vee */
69#endif
70
71#if defined (CONFIG_MACH_LPD7A404)
72 GPIO_PCDD &= ~(1<<3); /* Enable LCD Vee */
73 GPIO_PCD |= (1<<3);
74#endif
75
76#if defined (CONFIG_ARCH_LH7A400)
77
78 if (extra) {
79 HRTFTC_HRSETUP
80 = (1 << 13)
81 | ((fb->fb.var.xres - 1) << 4)
82 | 0xc
83 | (extra->hrmode ? 1 : 0);
84 HRTFTC_HRCON
85 = ((extra->clsen ? 1 : 0) << 1)
86 | ((extra->spsen ? 1 : 0) << 0);
87 HRTFTC_HRTIMING1
88 = (extra->pcdel << 8)
89 | (extra->revdel << 4)
90 | (extra->lpdel << 0);
91 HRTFTC_HRTIMING2
92 = (extra->spldel << 9)
93 | (extra->pc2del << 0);
94 }
95 else
96 HRTFTC_HRSETUP
97 = (1 << 13)
98 | 0xc;
99#endif
100
101#if defined (CONFIG_ARCH_LH7A404)
102
103 if (extra) {
104 ALI_SETUP
105 = (1 << 13)
106 | ((fb->fb.var.xres - 1) << 4)
107 | 0xc
108 | (extra->hrmode ? 1 : 0);
109 ALI_CONTROL
110 = ((extra->clsen ? 1 : 0) << 1)
111 | ((extra->spsen ? 1 : 0) << 0);
112 ALI_TIMING1
113 = (extra->pcdel << 8)
114 | (extra->revdel << 4)
115 | (extra->lpdel << 0);
116 ALI_TIMING2
117 = (extra->spldel << 9)
118 | (extra->pc2del << 0);
119 }
120 else
121 ALI_SETUP
122 = (1 << 13)
123 | 0xc;
124#endif
125
126}
127
128#define FRAMESIZE(s) (((s) + PAGE_SIZE - 1)&PAGE_MASK)
129
130static int lh7a40x_clcd_setup (struct clcd_fb *fb)
131{
132 dma_addr_t dma;
133 u32 len = FRAMESIZE (lcd_panel.mode.xres*lcd_panel.mode.yres
134 *(lcd_panel.bpp/8));
135
136 fb->panel = &lcd_panel;
137
138 /* Enforce the sync polarity defaults */
139 if (!(fb->panel->tim2 & TIM2_IHS))
140 fb->fb.var.sync |= FB_SYNC_HOR_HIGH_ACT;
141 if (!(fb->panel->tim2 & TIM2_IVS))
142 fb->fb.var.sync |= FB_SYNC_VERT_HIGH_ACT;
143
144#if defined (HAS_LCD_PANEL_EXTRA)
145 fb->board_data = &lcd_panel_extra;
146#endif
147
148 fb->fb.screen_base
149 = dma_alloc_writecombine (&fb->dev->dev, len,
150 &dma, GFP_KERNEL);
151 printk ("CLCD: LCD setup fb virt 0x%p phys 0x%p l %x io 0x%p \n",
152 fb->fb.screen_base, (void*) dma, len,
153 (void*) io_p2v (CLCDC_PHYS));
154 printk ("CLCD: pixclock %d\n", lcd_panel.mode.pixclock);
155
156 if (!fb->fb.screen_base) {
157 printk(KERN_ERR "CLCD: unable to map framebuffer\n");
158 return -ENOMEM;
159 }
160
161#if defined (USE_RGB555)
162 fb->fb.var.green.length = 5; /* Panel uses RGB 5:5:5 */
163#endif
164
165 fb->fb.fix.smem_start = dma;
166 fb->fb.fix.smem_len = len;
167
168 /* Drive PE4 high to prevent CPLD crash */
169 GPIO_PEDD |= (1<<4);
170 GPIO_PED |= (1<<4);
171
172 GPIO_PINMUX |= (1<<1) | (1<<0); /* LCDVD[15:4] */
173
174// fb->fb.fbops->fb_check_var (&fb->fb.var, &fb->fb);
175// fb->fb.fbops->fb_set_par (&fb->fb);
176
177 return 0;
178}
179
180static int lh7a40x_clcd_mmap (struct clcd_fb *fb, struct vm_area_struct *vma)
181{
182 return dma_mmap_writecombine(&fb->dev->dev, vma,
183 fb->fb.screen_base,
184 fb->fb.fix.smem_start,
185 fb->fb.fix.smem_len);
186}
187
188static void lh7a40x_clcd_remove (struct clcd_fb *fb)
189{
190 dma_free_writecombine (&fb->dev->dev, fb->fb.fix.smem_len,
191 fb->fb.screen_base, fb->fb.fix.smem_start);
192}
193
194static struct clcd_board clcd_platform_data = {
195 .name = "lh7a40x FB",
196 .check = clcdfb_check,
197 .decode = clcdfb_decode,
198 .enable = lh7a40x_clcd_enable,
199 .setup = lh7a40x_clcd_setup,
200 .mmap = lh7a40x_clcd_mmap,
201 .remove = lh7a40x_clcd_remove,
202 .disable = lh7a40x_clcd_disable,
203};
204
205#define IRQ_CLCDC (IRQ_LCDINTR)
206
207#define AMBA_DEVICE(name,busid,base,plat,pid) \
208static struct amba_device name##_device = { \
209 .dev = { \
210 .coherent_dma_mask = ~0, \
211 .init_name = busid, \
212 .platform_data = plat, \
213 }, \
214 .res = { \
215 .start = base##_PHYS, \
216 .end = (base##_PHYS) + (4*1024) - 1, \
217 .flags = IORESOURCE_MEM, \
218 }, \
219 .dma_mask = ~0, \
220 .irq = { IRQ_##base, }, \
221 /* .dma = base##_DMA,*/ \
222 .periphid = pid, \
223}
224
225AMBA_DEVICE(clcd, "cldc-lh7a40x", CLCDC, &clcd_platform_data, 0x41110);
226
227static struct amba_device *amba_devs[] __initdata = {
228 &clcd_device,
229};
230
231void __init lh7a40x_clcd_init (void)
232{
233 int i;
234 int result;
235 printk ("CLCD: registering amba devices\n");
236 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
237 struct amba_device *d = amba_devs[i];
238 result = amba_device_register(d, &iomem_resource);
239 printk (" %d -> %d\n", i ,result);
240 }
241}
diff --git a/arch/arm/mach-lh7a40x/clocks.c b/arch/arm/mach-lh7a40x/clocks.c
deleted file mode 100644
index 0651f96653f9..000000000000
--- a/arch/arm/mach-lh7a40x/clocks.c
+++ /dev/null
@@ -1,108 +0,0 @@
1/* arch/arm/mach-lh7a40x/clocks.c
2 *
3 * Copyright (C) 2004 Marc Singer
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 */
10#include <mach/hardware.h>
11#include <mach/clocks.h>
12#include <linux/err.h>
13#include <linux/device.h>
14#include <linux/string.h>
15
16struct module;
17
18struct clk {
19 struct list_head node;
20 unsigned long rate;
21 struct module *owner;
22 const char *name;
23};
24
25/* ----- */
26
27#define MAINDIV1(c) (((c) >> 7) & 0x0f)
28#define MAINDIV2(c) (((c) >> 11) & 0x1f)
29#define PS(c) (((c) >> 18) & 0x03)
30#define PREDIV(c) (((c) >> 2) & 0x1f)
31#define HCLKDIV(c) (((c) >> 0) & 0x02)
32#define PCLKDIV(c) (((c) >> 16) & 0x03)
33
34unsigned int fclkfreq_get (void)
35{
36 unsigned int clkset = CSC_CLKSET;
37 unsigned int gclk
38 = XTAL_IN
39 / (1 << PS(clkset))
40 * (MAINDIV1(clkset) + 2)
41 / (PREDIV(clkset) + 2)
42 * (MAINDIV2(clkset) + 2)
43 ;
44 return gclk;
45}
46
47unsigned int hclkfreq_get (void)
48{
49 unsigned int clkset = CSC_CLKSET;
50 unsigned int hclk = fclkfreq_get () / (HCLKDIV(clkset) + 1);
51
52 return hclk;
53}
54
55unsigned int pclkfreq_get (void)
56{
57 unsigned int clkset = CSC_CLKSET;
58 int pclkdiv = PCLKDIV(clkset);
59 unsigned int pclk;
60 if (pclkdiv == 0x3)
61 pclkdiv = 0x2;
62 pclk = hclkfreq_get () / (1 << pclkdiv);
63
64 return pclk;
65}
66
67/* ----- */
68
69struct clk *clk_get (struct device *dev, const char *id)
70{
71 return dev && strcmp(dev_name(dev), "cldc-lh7a40x") == 0
72 ? NULL : ERR_PTR(-ENOENT);
73}
74EXPORT_SYMBOL(clk_get);
75
76void clk_put (struct clk *clk)
77{
78}
79EXPORT_SYMBOL(clk_put);
80
81int clk_enable (struct clk *clk)
82{
83 return 0;
84}
85EXPORT_SYMBOL(clk_enable);
86
87void clk_disable (struct clk *clk)
88{
89}
90EXPORT_SYMBOL(clk_disable);
91
92unsigned long clk_get_rate (struct clk *clk)
93{
94 return 0;
95}
96EXPORT_SYMBOL(clk_get_rate);
97
98long clk_round_rate (struct clk *clk, unsigned long rate)
99{
100 return rate;
101}
102EXPORT_SYMBOL(clk_round_rate);
103
104int clk_set_rate (struct clk *clk, unsigned long rate)
105{
106 return -EIO;
107}
108EXPORT_SYMBOL(clk_set_rate);
diff --git a/arch/arm/mach-lh7a40x/common.h b/arch/arm/mach-lh7a40x/common.h
deleted file mode 100644
index 6ed3f6b6db76..000000000000
--- a/arch/arm/mach-lh7a40x/common.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/* arch/arm/mach-lh7a40x/common.h
2 *
3 * Copyright (C) 2004 Marc Singer
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 */
10
11extern struct sys_timer lh7a40x_timer;
12
13extern void lh7a400_init_irq (void);
14extern void lh7a404_init_irq (void);
15extern void lh7a40x_clcd_init (void);
16extern void lh7a40x_init_board_irq (void);
17
diff --git a/arch/arm/mach-lh7a40x/include/mach/clocks.h b/arch/arm/mach-lh7a40x/include/mach/clocks.h
deleted file mode 100644
index fe2e0255c084..000000000000
--- a/arch/arm/mach-lh7a40x/include/mach/clocks.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/* arch/arm/mach-lh7a40x/include/mach/clocks.h
2 *
3 * Copyright (C) 2004 Marc Singer
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 */
10
11#ifndef __ASM_ARCH_CLOCKS_H
12#define __ASM_ARCH_CLOCKS_H
13
14unsigned int fclkfreq_get (void);
15unsigned int hclkfreq_get (void);
16unsigned int pclkfreq_get (void);
17
18#endif /* _ASM_ARCH_CLOCKS_H */
diff --git a/arch/arm/mach-lh7a40x/include/mach/constants.h b/arch/arm/mach-lh7a40x/include/mach/constants.h
deleted file mode 100644
index 55c6edbc2dfd..000000000000
--- a/arch/arm/mach-lh7a40x/include/mach/constants.h
+++ /dev/null
@@ -1,91 +0,0 @@
1/* arch/arm/mach-lh7a40x/include/mach/constants.h
2 *
3 * Copyright (C) 2004 Coastal Environmental Systems
4 * Copyright (C) 2004 Logic Product Development
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 *
10 */
11
12#ifndef __ASM_ARCH_CONSTANTS_H
13#define __ASM_ARCH_CONSTANTS_H
14
15
16/* Addressing constants */
17
18 /* SoC CPU IO addressing */
19#define IO_PHYS (0x80000000)
20#define IO_VIRT (0xf8000000)
21#define IO_SIZE (0x0000B000)
22
23#ifdef CONFIG_MACH_KEV7A400
24# define CPLD_PHYS (0x20000000)
25# define CPLD_VIRT (0xf2000000)
26# define CPLD_SIZE PAGE_SIZE
27#endif
28
29#if defined (CONFIG_MACH_LPD7A400) || defined (CONFIG_MACH_LPD7A404)
30
31# define IOBARRIER_PHYS 0x10000000 /* Second bank, fastest timing */
32# define IOBARRIER_VIRT 0xf0000000
33# define IOBARRIER_SIZE PAGE_SIZE
34
35# define CF_PHYS 0x60200000
36# define CF_VIRT 0xf6020000
37# define CF_SIZE (8*1024)
38
39 /* The IO mappings for the LPD CPLD are, unfortunately, sparse. */
40# define CPLDX_PHYS(x) (0x70000000 | ((x) << 20))
41# define CPLDX_VIRT(x) (0xf7000000 | ((x) << 16))
42# define CPLD00_PHYS CPLDX_PHYS (0x00) /* Wired LAN */
43# define CPLD00_VIRT CPLDX_VIRT (0x00)
44# define CPLD00_SIZE PAGE_SIZE
45# define CPLD02_PHYS CPLDX_PHYS (0x02)
46# define CPLD02_VIRT CPLDX_VIRT (0x02)
47# define CPLD02_SIZE PAGE_SIZE
48# define CPLD06_PHYS CPLDX_PHYS (0x06)
49# define CPLD06_VIRT CPLDX_VIRT (0x06)
50# define CPLD06_SIZE PAGE_SIZE
51# define CPLD08_PHYS CPLDX_PHYS (0x08)
52# define CPLD08_VIRT CPLDX_VIRT (0x08)
53# define CPLD08_SIZE PAGE_SIZE
54# define CPLD0A_PHYS CPLDX_PHYS (0x0a)
55# define CPLD0A_VIRT CPLDX_VIRT (0x0a)
56# define CPLD0A_SIZE PAGE_SIZE
57# define CPLD0C_PHYS CPLDX_PHYS (0x0c)
58# define CPLD0C_VIRT CPLDX_VIRT (0x0c)
59# define CPLD0C_SIZE PAGE_SIZE
60# define CPLD0E_PHYS CPLDX_PHYS (0x0e)
61# define CPLD0E_VIRT CPLDX_VIRT (0x0e)
62# define CPLD0E_SIZE PAGE_SIZE
63# define CPLD10_PHYS CPLDX_PHYS (0x10)
64# define CPLD10_VIRT CPLDX_VIRT (0x10)
65# define CPLD10_SIZE PAGE_SIZE
66# define CPLD12_PHYS CPLDX_PHYS (0x12)
67# define CPLD12_VIRT CPLDX_VIRT (0x12)
68# define CPLD12_SIZE PAGE_SIZE
69# define CPLD14_PHYS CPLDX_PHYS (0x14)
70# define CPLD14_VIRT CPLDX_VIRT (0x14)
71# define CPLD14_SIZE PAGE_SIZE
72# define CPLD16_PHYS CPLDX_PHYS (0x16)
73# define CPLD16_VIRT CPLDX_VIRT (0x16)
74# define CPLD16_SIZE PAGE_SIZE
75# define CPLD18_PHYS CPLDX_PHYS (0x18)
76# define CPLD18_VIRT CPLDX_VIRT (0x18)
77# define CPLD18_SIZE PAGE_SIZE
78# define CPLD1A_PHYS CPLDX_PHYS (0x1a)
79# define CPLD1A_VIRT CPLDX_VIRT (0x1a)
80# define CPLD1A_SIZE PAGE_SIZE
81#endif
82
83 /* Timing constants */
84
85#define XTAL_IN 14745600 /* 14.7456 MHz crystal */
86#define PLL_CLOCK (XTAL_IN * 21) /* 309 MHz PLL clock */
87#define MAX_HCLK_KHZ 100000 /* HCLK max limit ~100MHz */
88#define HCLK (99993600)
89//#define HCLK (119808000)
90
91#endif /* __ASM_ARCH_CONSTANTS_H */
diff --git a/arch/arm/mach-lh7a40x/include/mach/debug-macro.S b/arch/arm/mach-lh7a40x/include/mach/debug-macro.S
deleted file mode 100644
index cff33625276f..000000000000
--- a/arch/arm/mach-lh7a40x/include/mach/debug-macro.S
+++ /dev/null
@@ -1,37 +0,0 @@
1/* arch/arm/mach-lh7a40x/include/mach/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12*/
13
14 @ It is not known if this will be appropriate for every 40x
15 @ board.
16
17 .macro addruart, rp, rv
18 mov \rp, #0x00000700 @ offset from base
19 orr \rv, \rp, #0xf8000000 @ virtual base
20 orr \rp, \rp, #0x80000000 @ physical base
21 .endm
22
23 .macro senduart,rd,rx
24 strb \rd, [\rx] @ DATA
25 .endm
26
27 .macro busyuart,rd,rx @ spin while busy
281001: ldr \rd, [\rx, #0x10] @ STATUS
29 tst \rd, #1 << 3 @ BUSY (TX FIFO not empty)
30 bne 1001b @ yes, spin
31 .endm
32
33 .macro waituart,rd,rx @ wait for Tx FIFO room
341001: ldrb \rd, [\rx, #0x10] @ STATUS
35 tst \rd, #1 << 5 @ TXFF (TX FIFO full)
36 bne 1001b @ yes, spin
37 .endm
diff --git a/arch/arm/mach-lh7a40x/include/mach/dma.h b/arch/arm/mach-lh7a40x/include/mach/dma.h
deleted file mode 100644
index baa3f8dbd04b..000000000000
--- a/arch/arm/mach-lh7a40x/include/mach/dma.h
+++ /dev/null
@@ -1,86 +0,0 @@
1/* arch/arm/mach-lh7a40x/include/mach/dma.h
2 *
3 * Copyright (C) 2005 Marc Singer
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 */
10
11typedef enum {
12 DMA_M2M0 = 0,
13 DMA_M2M1 = 1,
14 DMA_M2P0 = 2, /* Tx */
15 DMA_M2P1 = 3, /* Rx */
16 DMA_M2P2 = 4, /* Tx */
17 DMA_M2P3 = 5, /* Rx */
18 DMA_M2P4 = 6, /* Tx - AC97 */
19 DMA_M2P5 = 7, /* Rx - AC97 */
20 DMA_M2P6 = 8, /* Tx */
21 DMA_M2P7 = 9, /* Rx */
22} dma_device_t;
23
24#define DMA_LENGTH_MAX ((64*1024) - 4) /* bytes */
25
26#define DMAC_GCA __REG(DMAC_PHYS + 0x2b80)
27#define DMAC_GIR __REG(DMAC_PHYS + 0x2bc0)
28
29#define DMAC_GIR_MMI1 (1<<11)
30#define DMAC_GIR_MMI0 (1<<10)
31#define DMAC_GIR_MPI8 (1<<9)
32#define DMAC_GIR_MPI9 (1<<8)
33#define DMAC_GIR_MPI6 (1<<7)
34#define DMAC_GIR_MPI7 (1<<6)
35#define DMAC_GIR_MPI4 (1<<5)
36#define DMAC_GIR_MPI5 (1<<4)
37#define DMAC_GIR_MPI2 (1<<3)
38#define DMAC_GIR_MPI3 (1<<2)
39#define DMAC_GIR_MPI0 (1<<1)
40#define DMAC_GIR_MPI1 (1<<0)
41
42#define DMAC_M2P0 0x0000
43#define DMAC_M2P1 0x0040
44#define DMAC_M2P2 0x0080
45#define DMAC_M2P3 0x00c0
46#define DMAC_M2P4 0x0240
47#define DMAC_M2P5 0x0200
48#define DMAC_M2P6 0x02c0
49#define DMAC_M2P7 0x0280
50#define DMAC_M2P8 0x0340
51#define DMAC_M2P9 0x0300
52#define DMAC_M2M0 0x0100
53#define DMAC_M2M1 0x0140
54
55#define DMAC_P_PCONTROL(c) __REG(DMAC_PHYS + (c) + 0x00)
56#define DMAC_P_PINTERRUPT(c) __REG(DMAC_PHYS + (c) + 0x04)
57#define DMAC_P_PPALLOC(c) __REG(DMAC_PHYS + (c) + 0x08)
58#define DMAC_P_PSTATUS(c) __REG(DMAC_PHYS + (c) + 0x0c)
59#define DMAC_P_REMAIN(c) __REG(DMAC_PHYS + (c) + 0x14)
60#define DMAC_P_MAXCNT0(c) __REG(DMAC_PHYS + (c) + 0x20)
61#define DMAC_P_BASE0(c) __REG(DMAC_PHYS + (c) + 0x24)
62#define DMAC_P_CURRENT0(c) __REG(DMAC_PHYS + (c) + 0x28)
63#define DMAC_P_MAXCNT1(c) __REG(DMAC_PHYS + (c) + 0x30)
64#define DMAC_P_BASE1(c) __REG(DMAC_PHYS + (c) + 0x34)
65#define DMAC_P_CURRENT1(c) __REG(DMAC_PHYS + (c) + 0x38)
66
67#define DMAC_PCONTROL_ENABLE (1<<4)
68
69#define DMAC_PORT_USB 0
70#define DMAC_PORT_SDMMC 1
71#define DMAC_PORT_AC97_1 2
72#define DMAC_PORT_AC97_2 3
73#define DMAC_PORT_AC97_3 4
74#define DMAC_PORT_UART1 6
75#define DMAC_PORT_UART2 7
76#define DMAC_PORT_UART3 8
77
78#define DMAC_PSTATUS_CURRSTATE_SHIFT 4
79#define DMAC_PSTATUS_CURRSTATE_MASK 0x3
80
81#define DMAC_PSTATUS_NEXTBUF (1<<6)
82#define DMAC_PSTATUS_STALLRINT (1<<0)
83
84#define DMAC_INT_CHE (1<<3)
85#define DMAC_INT_NFB (1<<1)
86#define DMAC_INT_STALL (1<<0)
diff --git a/arch/arm/mach-lh7a40x/include/mach/entry-macro.S b/arch/arm/mach-lh7a40x/include/mach/entry-macro.S
deleted file mode 100644
index 069bb4cefff7..000000000000
--- a/arch/arm/mach-lh7a40x/include/mach/entry-macro.S
+++ /dev/null
@@ -1,149 +0,0 @@
1/*
2 * arch/arm/mach-lh7a40x/include/mach/entry-macro.S
3 *
4 * Low-level IRQ helper macros for LH7A40x platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10#include <mach/hardware.h>
11#include <mach/irqs.h>
12
13/* In order to allow there to be support for both of the processor
14 classes at the same time, we make a hack here that isn't very
15 pretty. At startup, the link pointed to with the
16 branch_irq_lh7a400 symbol is replaced with a NOP when the CPU is
17 detected as a lh7a404.
18
19 *** FIXME: we should clean this up so that there is only one
20 implementation for each CPU's design.
21
22*/
23
24#if defined (CONFIG_ARCH_LH7A400) && defined (CONFIG_ARCH_LH7A404)
25
26 .macro disable_fiq
27 .endm
28
29 .macro get_irqnr_preamble, base, tmp
30 .endm
31
32 .macro arch_ret_to_user, tmp1, tmp2
33 .endm
34
35 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
36
37branch_irq_lh7a400: b 1000f
38
39@ Implementation of the LH7A404 get_irqnr_and_base.
40
41 mov \irqnr, #0 @ VIC1 irq base
42 mov \base, #io_p2v(0x80000000) @ APB registers
43 add \base, \base, #0x8000
44 ldr \tmp, [\base, #0x0030] @ VIC1_VECTADDR
45 tst \tmp, #VA_VECTORED @ Direct vectored
46 bne 1002f
47 tst \tmp, #VA_VIC1DEFAULT @ Default vectored VIC1
48 ldrne \irqstat, [\base, #0] @ VIC1_IRQSTATUS
49 bne 1001f
50 add \base, \base, #(0xa000 - 0x8000)
51 ldr \tmp, [\base, #0x0030] @ VIC2_VECTADDR
52 tst \tmp, #VA_VECTORED @ Direct vectored
53 bne 1002f
54 ldr \irqstat, [\base, #0] @ VIC2_IRQSTATUS
55 mov \irqnr, #32 @ VIC2 irq base
56
571001: movs \irqstat, \irqstat, lsr #1 @ Shift into carry
58 bcs 1008f @ Bit set; irq found
59 add \irqnr, \irqnr, #1
60 bne 1001b @ Until no bits
61 b 1009f @ Nothing? Hmm.
621002: and \irqnr, \tmp, #0x3f @ Mask for valid bits
631008: movs \irqstat, #1 @ Force !Z
64 str \tmp, [\base, #0x0030] @ Clear vector
65 b 1009f
66
67@ Implementation of the LH7A400 get_irqnr_and_base.
68
691000: mov \irqnr, #0
70 mov \base, #io_p2v(0x80000000) @ APB registers
71 ldr \irqstat, [\base, #0x500] @ PIC INTSR
72
731001: movs \irqstat, \irqstat, lsr #1 @ Shift into carry
74 bcs 1008f @ Bit set; irq found
75 add \irqnr, \irqnr, #1
76 bne 1001b @ Until no bits
77 b 1009f @ Nothing? Hmm.
781008: movs \irqstat, #1 @ Force !Z
79
801009:
81 .endm
82
83
84
85#elif defined (CONFIG_ARCH_LH7A400)
86 .macro disable_fiq
87 .endm
88
89 .macro get_irqnr_preamble, base, tmp
90 .endm
91
92 .macro arch_ret_to_user, tmp1, tmp2
93 .endm
94
95 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
96 mov \irqnr, #0
97 mov \base, #io_p2v(0x80000000) @ APB registers
98 ldr \irqstat, [\base, #0x500] @ PIC INTSR
99
1001001: movs \irqstat, \irqstat, lsr #1 @ Shift into carry
101 bcs 1008f @ Bit set; irq found
102 add \irqnr, \irqnr, #1
103 bne 1001b @ Until no bits
104 b 1009f @ Nothing? Hmm.
1051008: movs \irqstat, #1 @ Force !Z
1061009:
107 .endm
108
109#elif defined(CONFIG_ARCH_LH7A404)
110
111 .macro disable_fiq
112 .endm
113
114 .macro get_irqnr_preamble, base, tmp
115 .endm
116
117 .macro arch_ret_to_user, tmp1, tmp2
118 .endm
119
120 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
121 mov \irqnr, #0 @ VIC1 irq base
122 mov \base, #io_p2v(0x80000000) @ APB registers
123 add \base, \base, #0x8000
124 ldr \tmp, [\base, #0x0030] @ VIC1_VECTADDR
125 tst \tmp, #VA_VECTORED @ Direct vectored
126 bne 1002f
127 tst \tmp, #VA_VIC1DEFAULT @ Default vectored VIC1
128 ldrne \irqstat, [\base, #0] @ VIC1_IRQSTATUS
129 bne 1001f
130 add \base, \base, #(0xa000 - 0x8000)
131 ldr \tmp, [\base, #0x0030] @ VIC2_VECTADDR
132 tst \tmp, #VA_VECTORED @ Direct vectored
133 bne 1002f
134 ldr \irqstat, [\base, #0] @ VIC2_IRQSTATUS
135 mov \irqnr, #32 @ VIC2 irq base
136
1371001: movs \irqstat, \irqstat, lsr #1 @ Shift into carry
138 bcs 1008f @ Bit set; irq found
139 add \irqnr, \irqnr, #1
140 bne 1001b @ Until no bits
141 b 1009f @ Nothing? Hmm.
1421002: and \irqnr, \tmp, #0x3f @ Mask for valid bits
1431008: movs \irqstat, #1 @ Force !Z
144 str \tmp, [\base, #0x0030] @ Clear vector
1451009:
146 .endm
147#endif
148
149
diff --git a/arch/arm/mach-lh7a40x/include/mach/hardware.h b/arch/arm/mach-lh7a40x/include/mach/hardware.h
deleted file mode 100644
index 59d2ace35217..000000000000
--- a/arch/arm/mach-lh7a40x/include/mach/hardware.h
+++ /dev/null
@@ -1,62 +0,0 @@
1/* arch/arm/mach-lh7a40x/include/mach/hardware.h
2 *
3 * Copyright (C) 2004 Coastal Environmental Systems
4 *
5 * [ Substantially cribbed from arch/arm/mach-pxa/include/mach/hardware.h ]
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
10 *
11 */
12
13#ifndef __ASM_ARCH_HARDWARE_H
14#define __ASM_ARCH_HARDWARE_H
15
16#include <asm/sizes.h> /* Added for the sake of amba-clcd driver */
17
18#define io_p2v(x) (0xf0000000 | (((x) & 0xfff00000) >> 4) | ((x) & 0x0000ffff))
19#define io_v2p(x) ( (((x) & 0x0fff0000) << 4) | ((x) & 0x0000ffff))
20
21#ifdef __ASSEMBLY__
22
23# define __REG(x) io_p2v(x)
24# define __PREG(x) io_v2p(x)
25
26#else
27
28# if 0
29# define __REG(x) (*((volatile u32 *)io_p2v(x)))
30# else
31/*
32 * This __REG() version gives the same results as the one above, except
33 * that we are fooling gcc somehow so it generates far better and smaller
34 * assembly code for access to contiguous registers. It's a shame that gcc
35 * doesn't guess this by itself.
36 */
37#include <asm/types.h>
38typedef struct { volatile u32 offset[4096]; } __regbase;
39# define __REGP(x) ((__regbase *)((x)&~4095))->offset[((x)&4095)>>2]
40# define __REG(x) __REGP(io_p2v(x))
41typedef struct { volatile u16 offset[4096]; } __regbase16;
42# define __REGP16(x) ((__regbase16 *)((x)&~4095))->offset[((x)&4095)>>1]
43# define __REG16(x) __REGP16(io_p2v(x))
44typedef struct { volatile u8 offset[4096]; } __regbase8;
45# define __REGP8(x) ((__regbase8 *)((x)&~4095))->offset[(x)&4095]
46# define __REG8(x) __REGP8(io_p2v(x))
47#endif
48
49/* Let's kick gcc's ass again... */
50# define __REG2(x,y) \
51 ( __builtin_constant_p(y) ? (__REG((x) + (y))) \
52 : (*(volatile u32 *)((u32)&__REG(x) + (y))) )
53
54# define __PREG(x) (io_v2p((u32)&(x)))
55
56#endif
57
58#define MASK_AND_SET(v,m,s) (v) = ((v)&~(m))|(s)
59
60#include "registers.h"
61
62#endif /* _ASM_ARCH_HARDWARE_H */
diff --git a/arch/arm/mach-lh7a40x/include/mach/io.h b/arch/arm/mach-lh7a40x/include/mach/io.h
deleted file mode 100644
index 6ece45911cbc..000000000000
--- a/arch/arm/mach-lh7a40x/include/mach/io.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/* arch/arm/mach-lh7a40x/include/mach/io.h
2 *
3 * Copyright (C) 2004 Coastal Environmental Systems
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 */
10
11#ifndef __ASM_ARCH_IO_H
12#define __ASM_ARCH_IO_H
13
14#define IO_SPACE_LIMIT 0xffffffff
15
16/* No ISA or PCI bus on this machine. */
17#define __io(a) __typesafe_io(a)
18#define __mem_pci(a) (a)
19
20#endif /* __ASM_ARCH_IO_H */
diff --git a/arch/arm/mach-lh7a40x/include/mach/irqs.h b/arch/arm/mach-lh7a40x/include/mach/irqs.h
deleted file mode 100644
index 0f9b83675935..000000000000
--- a/arch/arm/mach-lh7a40x/include/mach/irqs.h
+++ /dev/null
@@ -1,200 +0,0 @@
1/* arch/arm/mach-lh7a40x/include/mach/irqs.h
2 *
3 * Copyright (C) 2004 Coastal Environmental Systems
4 * Copyright (C) 2004 Logic Product Development
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 *
10 */
11
12/* It is to be seen whether or not we can build a kernel for more than
13 * one board. For the time being, these macros assume that we cannot.
14 * Thus, it is OK to ifdef machine/board specific IRQ assignments.
15 */
16
17
18#ifndef __ASM_ARCH_IRQS_H
19#define __ASM_ARCH_IRQS_H
20
21
22#define FIQ_START 80
23
24#if defined (CONFIG_ARCH_LH7A400)
25
26 /* FIQs */
27
28# define IRQ_GPIO0FIQ 0 /* GPIO External FIQ Interrupt on F0 */
29# define IRQ_BLINT 1 /* Battery Low */
30# define IRQ_WEINT 2 /* Watchdog Timer, WDT overflow */
31# define IRQ_MCINT 3 /* Media Change, MEDCHG pin rising */
32
33 /* IRQs */
34
35# define IRQ_CSINT 4 /* Audio Codec (ACI) */
36# define IRQ_GPIO1INTR 5 /* GPIO External IRQ Interrupt on F1 */
37# define IRQ_GPIO2INTR 6 /* GPIO External IRQ Interrupt on F2 */
38# define IRQ_GPIO3INTR 7 /* GPIO External IRQ Interrupt on F3 */
39# define IRQ_T1UI 8 /* Timer 1 underflow */
40# define IRQ_T2UI 9 /* Timer 2 underflow */
41# define IRQ_RTCMI 10
42# define IRQ_TINTR 11 /* Clock State Controller 64 Hz tick (CSC) */
43# define IRQ_UART1INTR 12
44# define IRQ_UART2INTR 13
45# define IRQ_LCDINTR 14
46# define IRQ_SSIEOT 15 /* Synchronous Serial Interface (SSI) */
47# define IRQ_UART3INTR 16
48# define IRQ_SCIINTR 17 /* Smart Card Interface (SCI) */
49# define IRQ_AACINTR 18 /* Advanced Audio Codec (AAC) */
50# define IRQ_MMCINTR 19 /* Multimedia Card (MMC) */
51# define IRQ_USBINTR 20
52# define IRQ_DMAINTR 21
53# define IRQ_T3UI 22 /* Timer 3 underflow */
54# define IRQ_GPIO4INTR 23 /* GPIO External IRQ Interrupt on F4 */
55# define IRQ_GPIO5INTR 24 /* GPIO External IRQ Interrupt on F5 */
56# define IRQ_GPIO6INTR 25 /* GPIO External IRQ Interrupt on F6 */
57# define IRQ_GPIO7INTR 26 /* GPIO External IRQ Interrupt on F7 */
58# define IRQ_BMIINTR 27 /* Battery Monitor Interface (BMI) */
59
60# define NR_IRQ_CPU 28 /* IRQs directly recognized by CPU */
61
62 /* Given IRQ, return GPIO interrupt number 0-7 */
63# define IRQ_TO_GPIO(i) ((i) \
64 - (((i) > IRQ_GPIO3INTR) ? IRQ_GPIO4INTR - IRQ_GPIO3INTR - 1 : 0)\
65 - (((i) > IRQ_GPIO0INTR) ? IRQ_GPIO1INTR - IRQ_GPIO0INTR - 1 : 0))
66
67#endif
68
69#if defined (CONFIG_ARCH_LH7A404)
70
71# define IRQ_BROWN 0 /* Brownout */
72# define IRQ_WDTINTR 1 /* Watchdog Timer */
73# define IRQ_COMMRX 2 /* ARM Comm Rx for Debug */
74# define IRQ_COMMTX 3 /* ARM Comm Tx for Debug */
75# define IRQ_T1UI 4 /* Timer 1 underflow */
76# define IRQ_T2UI 5 /* Timer 2 underflow */
77# define IRQ_CSINT 6 /* Codec Interrupt (shared by AAC on 404) */
78# define IRQ_DMAM2P0 7 /* -- DMA Memory to Peripheral */
79# define IRQ_DMAM2P1 8
80# define IRQ_DMAM2P2 9
81# define IRQ_DMAM2P3 10
82# define IRQ_DMAM2P4 11
83# define IRQ_DMAM2P5 12
84# define IRQ_DMAM2P6 13
85# define IRQ_DMAM2P7 14
86# define IRQ_DMAM2P8 15
87# define IRQ_DMAM2P9 16
88# define IRQ_DMAM2M0 17 /* -- DMA Memory to Memory */
89# define IRQ_DMAM2M1 18
90# define IRQ_GPIO0INTR 19 /* -- GPIOF Interrupt */
91# define IRQ_GPIO1INTR 20
92# define IRQ_GPIO2INTR 21
93# define IRQ_GPIO3INTR 22
94# define IRQ_SOFT_V1_23 23 /* -- Unassigned */
95# define IRQ_SOFT_V1_24 24
96# define IRQ_SOFT_V1_25 25
97# define IRQ_SOFT_V1_26 26
98# define IRQ_SOFT_V1_27 27
99# define IRQ_SOFT_V1_28 28
100# define IRQ_SOFT_V1_29 29
101# define IRQ_SOFT_V1_30 30
102# define IRQ_SOFT_V1_31 31
103
104# define IRQ_BLINT 32 /* Battery Low */
105# define IRQ_BMIINTR 33 /* Battery Monitor */
106# define IRQ_MCINTR 34 /* Media Change */
107# define IRQ_TINTR 35 /* 64Hz Tick */
108# define IRQ_WEINT 36 /* Watchdog Expired */
109# define IRQ_RTCMI 37 /* Real-time Clock Match */
110# define IRQ_UART1INTR 38 /* UART1 Interrupt (including error) */
111# define IRQ_UART1ERR 39 /* UART1 Error */
112# define IRQ_UART2INTR 40 /* UART2 Interrupt (including error) */
113# define IRQ_UART2ERR 41 /* UART2 Error */
114# define IRQ_UART3INTR 42 /* UART3 Interrupt (including error) */
115# define IRQ_UART3ERR 43 /* UART3 Error */
116# define IRQ_SCIINTR 44 /* Smart Card */
117# define IRQ_TSCINTR 45 /* Touchscreen */
118# define IRQ_KMIINTR 46 /* Keyboard/Mouse (PS/2) */
119# define IRQ_GPIO4INTR 47 /* -- GPIOF Interrupt */
120# define IRQ_GPIO5INTR 48
121# define IRQ_GPIO6INTR 49
122# define IRQ_GPIO7INTR 50
123# define IRQ_T3UI 51 /* Timer 3 underflow */
124# define IRQ_LCDINTR 52 /* LCD Controller */
125# define IRQ_SSPINTR 53 /* Synchronous Serial Port */
126# define IRQ_SDINTR 54 /* Secure Digital Port (MMC) */
127# define IRQ_USBINTR 55 /* USB Device Port */
128# define IRQ_USHINTR 56 /* USB Host Port */
129# define IRQ_SOFT_V2_25 57 /* -- Unassigned */
130# define IRQ_SOFT_V2_26 58
131# define IRQ_SOFT_V2_27 59
132# define IRQ_SOFT_V2_28 60
133# define IRQ_SOFT_V2_29 61
134# define IRQ_SOFT_V2_30 62
135# define IRQ_SOFT_V2_31 63
136
137# define NR_IRQ_CPU 64 /* IRQs directly recognized by CPU */
138
139 /* Given IRQ, return GPIO interrupt number 0-7 */
140# define IRQ_TO_GPIO(i) ((i) \
141 - (((i) > IRQ_GPIO3INTR) ? IRQ_GPIO4INTR - IRQ_GPIO3INTR - 1 : 0)\
142 - IRQ_GPIO0INTR)
143
144 /* Vector Address constants */
145# define VA_VECTORED 0x100 /* Set for vectored interrupt */
146# define VA_VIC1DEFAULT 0x200 /* Set as default VECTADDR for VIC1 */
147# define VA_VIC2DEFAULT 0x400 /* Set as default VECTADDR for VIC2 */
148
149#endif
150
151 /* IRQ aliases */
152
153#if !defined (IRQ_GPIO0INTR)
154# define IRQ_GPIO0INTR IRQ_GPIO0FIQ
155#endif
156#define IRQ_TICK IRQ_TINTR
157#define IRQ_PCC1_RDY IRQ_GPIO6INTR /* PCCard 1 ready */
158#define IRQ_PCC2_RDY IRQ_GPIO7INTR /* PCCard 2 ready */
159#define IRQ_USB IRQ_USBINTR /* USB device */
160
161#ifdef CONFIG_MACH_KEV7A400
162# define IRQ_TS IRQ_GPIOFIQ /* Touchscreen */
163# define IRQ_CPLD IRQ_GPIO1INTR /* CPLD cascade */
164# define IRQ_PCC1_CD IRQ_GPIO_F2 /* PCCard 1 card detect */
165# define IRQ_PCC2_CD IRQ_GPIO_F3 /* PCCard 2 card detect */
166#endif
167
168#if defined (CONFIG_MACH_LPD7A400) || defined (CONFIG_MACH_LPD7A404)
169# define IRQ_CPLD_V28 IRQ_GPIO7INTR /* CPLD cascade through GPIO_PF7 */
170# define IRQ_CPLD_V34 IRQ_GPIO3INTR /* CPLD cascade through GPIO_PF3 */
171#endif
172
173 /* System specific IRQs */
174
175#define IRQ_BOARD_START NR_IRQ_CPU
176
177#ifdef CONFIG_MACH_KEV7A400
178# define IRQ_KEV7A400_CPLD IRQ_BOARD_START
179# define NR_IRQ_BOARD 5
180# define IRQ_KEV7A400_MMC_CD IRQ_KEV7A400_CPLD + 0 /* MMC Card Detect */
181# define IRQ_KEV7A400_RI2 IRQ_KEV7A400_CPLD + 1 /* Ring Indicator 2 */
182# define IRQ_KEV7A400_IDE_CF IRQ_KEV7A400_CPLD + 2 /* Compact Flash (?) */
183# define IRQ_KEV7A400_ETH_INT IRQ_KEV7A400_CPLD + 3 /* Ethernet chip */
184# define IRQ_KEV7A400_INT IRQ_KEV7A400_CPLD + 4
185#endif
186
187#if defined (CONFIG_MACH_LPD7A400) || defined (CONFIG_MACH_LPD7A404)
188# define IRQ_LPD7A40X_CPLD IRQ_BOARD_START
189# define NR_IRQ_BOARD 2
190# define IRQ_LPD7A40X_ETH_INT IRQ_LPD7A40X_CPLD + 0 /* Ethernet chip */
191# define IRQ_LPD7A400_TS IRQ_LPD7A40X_CPLD + 1 /* Touch screen */
192#endif
193
194#if defined (CONFIG_MACH_LPD7A400)
195# define IRQ_TOUCH IRQ_LPD7A400_TS
196#endif
197
198#define NR_IRQS (NR_IRQ_CPU + NR_IRQ_BOARD)
199
200#endif
diff --git a/arch/arm/mach-lh7a40x/include/mach/memory.h b/arch/arm/mach-lh7a40x/include/mach/memory.h
deleted file mode 100644
index edb8f5faf5d5..000000000000
--- a/arch/arm/mach-lh7a40x/include/mach/memory.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/* arch/arm/mach-lh7a40x/include/mach/memory.h
2 *
3 * Copyright (C) 2004 Coastal Environmental Systems
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 *
10 * Refer to <file:Documentation/arm/Sharp-LH/SDRAM> for more information.
11 *
12 */
13
14#ifndef __ASM_ARCH_MEMORY_H
15#define __ASM_ARCH_MEMORY_H
16
17/*
18 * Physical DRAM offset.
19 */
20#define PHYS_OFFSET UL(0xc0000000)
21
22/*
23 * Sparsemem version of the above
24 */
25#define MAX_PHYSMEM_BITS 32
26#define SECTION_SIZE_BITS 24
27
28#endif
diff --git a/arch/arm/mach-lh7a40x/include/mach/registers.h b/arch/arm/mach-lh7a40x/include/mach/registers.h
deleted file mode 100644
index ea44396383a7..000000000000
--- a/arch/arm/mach-lh7a40x/include/mach/registers.h
+++ /dev/null
@@ -1,224 +0,0 @@
1/* arch/arm/mach-lh7a40x/include/mach/registers.h
2 *
3 * Copyright (C) 2004 Coastal Environmental Systems
4 * Copyright (C) 2004 Logic Product Development
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 *
10 */
11
12#include <mach/constants.h>
13
14#ifndef __ASM_ARCH_REGISTERS_H
15#define __ASM_ARCH_REGISTERS_H
16
17
18 /* Physical register base addresses */
19
20#define AC97C_PHYS (0x80000000) /* AC97 Controller */
21#define MMC_PHYS (0x80000100) /* Multimedia Card Controller */
22#define USB_PHYS (0x80000200) /* USB Client */
23#define SCI_PHYS (0x80000300) /* Secure Card Interface */
24#define CSC_PHYS (0x80000400) /* Clock/State Controller */
25#define INTC_PHYS (0x80000500) /* Interrupt Controller */
26#define UART1_PHYS (0x80000600) /* UART1 Controller */
27#define SIR_PHYS (0x80000600) /* IR Controller, same are UART1 */
28#define UART2_PHYS (0x80000700) /* UART2 Controller */
29#define UART3_PHYS (0x80000800) /* UART3 Controller */
30#define DCDC_PHYS (0x80000900) /* DC to DC Controller */
31#define ACI_PHYS (0x80000a00) /* Audio Codec Interface */
32#define SSP_PHYS (0x80000b00) /* Synchronous ... */
33#define TIMER_PHYS (0x80000c00) /* Timer Controller */
34#define RTC_PHYS (0x80000d00) /* Real-time Clock */
35#define GPIO_PHYS (0x80000e00) /* General Purpose IO */
36#define BMI_PHYS (0x80000f00) /* Battery Monitor Interface */
37#define HRTFTC_PHYS (0x80001000) /* High-res TFT Controller (LH7A400) */
38#define ALI_PHYS (0x80001000) /* Advanced LCD Interface (LH7A404) */
39#define WDT_PHYS (0x80001400) /* Watchdog Timer */
40#define SMC_PHYS (0x80002000) /* Static Memory Controller */
41#define SDRC_PHYS (0x80002400) /* SDRAM Controller */
42#define DMAC_PHYS (0x80002800) /* DMA Controller */
43#define CLCDC_PHYS (0x80003000) /* Color LCD Controller */
44
45 /* Physical registers of the LH7A404 */
46
47#define ADC_PHYS (0x80001300) /* A/D & Touchscreen Controller */
48#define VIC1_PHYS (0x80008000) /* Vectored Interrupt Controller 1 */
49#define USBH_PHYS (0x80009000) /* USB OHCI host controller */
50#define VIC2_PHYS (0x8000a000) /* Vectored Interrupt Controller 2 */
51
52/*#define KBD_PHYS (0x80000e00) */
53/*#define LCDICP_PHYS (0x80001000) */
54
55
56 /* Clock/State Controller register */
57
58#define CSC_PWRSR __REG(CSC_PHYS + 0x00) /* Reset register & ID */
59#define CSC_PWRCNT __REG(CSC_PHYS + 0x04) /* Power control */
60#define CSC_CLKSET __REG(CSC_PHYS + 0x20) /* Clock speed control */
61#define CSC_USBDRESET __REG(CSC_PHYS + 0x4c) /* USB Device resets */
62
63#define CSC_PWRCNT_USBH_EN (1<<28) /* USB Host power enable */
64#define CSC_PWRCNT_DMAC_M2M1_EN (1<<27)
65#define CSC_PWRCNT_DMAC_M2M0_EN (1<<26)
66#define CSC_PWRCNT_DMAC_M2P8_EN (1<<25)
67#define CSC_PWRCNT_DMAC_M2P9_EN (1<<24)
68#define CSC_PWRCNT_DMAC_M2P6_EN (1<<23)
69#define CSC_PWRCNT_DMAC_M2P7_EN (1<<22)
70#define CSC_PWRCNT_DMAC_M2P4_EN (1<<21)
71#define CSC_PWRCNT_DMAC_M2P5_EN (1<<20)
72#define CSC_PWRCNT_DMAC_M2P2_EN (1<<19)
73#define CSC_PWRCNT_DMAC_M2P3_EN (1<<18)
74#define CSC_PWRCNT_DMAC_M2P0_EN (1<<17)
75#define CSC_PWRCNT_DMAC_M2P1_EN (1<<16)
76
77#define CSC_PWRSR_CHIPMAN_SHIFT (24)
78#define CSC_PWRSR_CHIPMAN_MASK (0xff)
79#define CSC_PWRSR_CHIPID_SHIFT (16)
80#define CSC_PWRSR_CHIPID_MASK (0xff)
81
82#define CSC_USBDRESET_APBRESETREG (1<<1)
83#define CSC_USBDRESET_IORESETREG (1<<0)
84
85 /* Interrupt Controller registers */
86
87#define INTC_INTSR __REG(INTC_PHYS + 0x00) /* Status */
88#define INTC_INTRSR __REG(INTC_PHYS + 0x04) /* Raw Status */
89#define INTC_INTENS __REG(INTC_PHYS + 0x08) /* Enable Set */
90#define INTC_INTENC __REG(INTC_PHYS + 0x0c) /* Enable Clear */
91
92
93 /* Vectored Interrupted Controller registers */
94
95#define VIC1_IRQSTATUS __REG(VIC1_PHYS + 0x00)
96#define VIC1_FIQSTATUS __REG(VIC1_PHYS + 0x04)
97#define VIC1_RAWINTR __REG(VIC1_PHYS + 0x08)
98#define VIC1_INTSEL __REG(VIC1_PHYS + 0x0c)
99#define VIC1_INTEN __REG(VIC1_PHYS + 0x10)
100#define VIC1_INTENCLR __REG(VIC1_PHYS + 0x14)
101#define VIC1_SOFTINT __REG(VIC1_PHYS + 0x18)
102#define VIC1_SOFTINTCLR __REG(VIC1_PHYS + 0x1c)
103#define VIC1_PROTECT __REG(VIC1_PHYS + 0x20)
104#define VIC1_VECTADDR __REG(VIC1_PHYS + 0x30)
105#define VIC1_NVADDR __REG(VIC1_PHYS + 0x34)
106#define VIC1_VAD0 __REG(VIC1_PHYS + 0x100)
107#define VIC1_VECTCNTL0 __REG(VIC1_PHYS + 0x200)
108#define VIC2_IRQSTATUS __REG(VIC2_PHYS + 0x00)
109#define VIC2_FIQSTATUS __REG(VIC2_PHYS + 0x04)
110#define VIC2_RAWINTR __REG(VIC2_PHYS + 0x08)
111#define VIC2_INTSEL __REG(VIC2_PHYS + 0x0c)
112#define VIC2_INTEN __REG(VIC2_PHYS + 0x10)
113#define VIC2_INTENCLR __REG(VIC2_PHYS + 0x14)
114#define VIC2_SOFTINT __REG(VIC2_PHYS + 0x18)
115#define VIC2_SOFTINTCLR __REG(VIC2_PHYS + 0x1c)
116#define VIC2_PROTECT __REG(VIC2_PHYS + 0x20)
117#define VIC2_VECTADDR __REG(VIC2_PHYS + 0x30)
118#define VIC2_NVADDR __REG(VIC2_PHYS + 0x34)
119#define VIC2_VAD0 __REG(VIC2_PHYS + 0x100)
120#define VIC2_VECTCNTL0 __REG(VIC2_PHYS + 0x200)
121
122#define VIC_CNTL_ENABLE (0x20)
123
124 /* USB Host registers (Open HCI compatible) */
125
126#define USBH_CMDSTATUS __REG(USBH_PHYS + 0x08)
127
128
129 /* GPIO registers */
130
131#define GPIO_INTTYPE1 __REG(GPIO_PHYS + 0x4c) /* Interrupt Type 1 (Edge) */
132#define GPIO_INTTYPE2 __REG(GPIO_PHYS + 0x50) /* Interrupt Type 2 */
133#define GPIO_GPIOFEOI __REG(GPIO_PHYS + 0x54) /* GPIO End-of-Interrupt */
134#define GPIO_GPIOINTEN __REG(GPIO_PHYS + 0x58) /* GPIO Interrupt Enable */
135#define GPIO_INTSTATUS __REG(GPIO_PHYS + 0x5c) /* GPIO Interrupt Status */
136#define GPIO_PINMUX __REG(GPIO_PHYS + 0x2c)
137#define GPIO_PADD __REG(GPIO_PHYS + 0x10)
138#define GPIO_PAD __REG(GPIO_PHYS + 0x00)
139#define GPIO_PCD __REG(GPIO_PHYS + 0x08)
140#define GPIO_PCDD __REG(GPIO_PHYS + 0x18)
141#define GPIO_PEDD __REG(GPIO_PHYS + 0x24)
142#define GPIO_PED __REG(GPIO_PHYS + 0x20)
143
144
145 /* Static Memory Controller registers */
146
147#define SMC_BCR0 __REG(SMC_PHYS + 0x00) /* Bank 0 Configuration */
148#define SMC_BCR1 __REG(SMC_PHYS + 0x04) /* Bank 1 Configuration */
149#define SMC_BCR2 __REG(SMC_PHYS + 0x08) /* Bank 2 Configuration */
150#define SMC_BCR3 __REG(SMC_PHYS + 0x0C) /* Bank 3 Configuration */
151#define SMC_BCR6 __REG(SMC_PHYS + 0x18) /* Bank 6 Configuration */
152#define SMC_BCR7 __REG(SMC_PHYS + 0x1c) /* Bank 7 Configuration */
153
154
155#ifdef CONFIG_MACH_KEV7A400
156# define CPLD_RD_OPT_DIP_SW __REG16(CPLD_PHYS + 0x00) /* Read Option SW */
157# define CPLD_WR_IO_BRD_CTL __REG16(CPLD_PHYS + 0x00) /* Write Control */
158# define CPLD_RD_PB_KEYS __REG16(CPLD_PHYS + 0x02) /* Read Btn Keys */
159# define CPLD_LATCHED_INTS __REG16(CPLD_PHYS + 0x04) /* Read INTR stat. */
160# define CPLD_CL_INT __REG16(CPLD_PHYS + 0x04) /* Clear INTR stat */
161# define CPLD_BOOT_MMC_STATUS __REG16(CPLD_PHYS + 0x06) /* R/O */
162# define CPLD_RD_KPD_ROW_SENSE __REG16(CPLD_PHYS + 0x08)
163# define CPLD_WR_PB_INT_MASK __REG16(CPLD_PHYS + 0x08)
164# define CPLD_RD_BRD_DISP_SW __REG16(CPLD_PHYS + 0x0a)
165# define CPLD_WR_EXT_INT_MASK __REG16(CPLD_PHYS + 0x0a)
166# define CPLD_LCD_PWR_CNTL __REG16(CPLD_PHYS + 0x0c)
167# define CPLD_SEVEN_SEG __REG16(CPLD_PHYS + 0x0e) /* 7 seg. LED mask */
168
169#endif
170
171#if defined (CONFIG_MACH_LPD7A400) || defined (CONFIG_MACH_LPD7A404)
172
173# define CPLD_CONTROL __REG16(CPLD02_PHYS)
174# define CPLD_SPI_DATA __REG16(CPLD06_PHYS)
175# define CPLD_SPI_CONTROL __REG16(CPLD08_PHYS)
176# define CPLD_SPI_EEPROM __REG16(CPLD0A_PHYS)
177# define CPLD_INTERRUPTS __REG16(CPLD0C_PHYS) /* IRQ mask/status */
178# define CPLD_BOOT_MODE __REG16(CPLD0E_PHYS)
179# define CPLD_FLASH __REG16(CPLD10_PHYS)
180# define CPLD_POWER_MGMT __REG16(CPLD12_PHYS)
181# define CPLD_REVISION __REG16(CPLD14_PHYS)
182# define CPLD_GPIO_EXT __REG16(CPLD16_PHYS)
183# define CPLD_GPIO_DATA __REG16(CPLD18_PHYS)
184# define CPLD_GPIO_DIR __REG16(CPLD1A_PHYS)
185
186#endif
187
188 /* Timer registers */
189
190#define TIMER_LOAD1 __REG(TIMER_PHYS + 0x00) /* Timer 1 initial value */
191#define TIMER_VALUE1 __REG(TIMER_PHYS + 0x04) /* Timer 1 current value */
192#define TIMER_CONTROL1 __REG(TIMER_PHYS + 0x08) /* Timer 1 control word */
193#define TIMER_EOI1 __REG(TIMER_PHYS + 0x0c) /* Timer 1 interrupt clear */
194
195#define TIMER_LOAD2 __REG(TIMER_PHYS + 0x20) /* Timer 2 initial value */
196#define TIMER_VALUE2 __REG(TIMER_PHYS + 0x24) /* Timer 2 current value */
197#define TIMER_CONTROL2 __REG(TIMER_PHYS + 0x28) /* Timer 2 control word */
198#define TIMER_EOI2 __REG(TIMER_PHYS + 0x2c) /* Timer 2 interrupt clear */
199
200#define TIMER_BUZZCON __REG(TIMER_PHYS + 0x40) /* Buzzer configuration */
201
202#define TIMER_LOAD3 __REG(TIMER_PHYS + 0x80) /* Timer 3 initial value */
203#define TIMER_VALUE3 __REG(TIMER_PHYS + 0x84) /* Timer 3 current value */
204#define TIMER_CONTROL3 __REG(TIMER_PHYS + 0x88) /* Timer 3 control word */
205#define TIMER_EOI3 __REG(TIMER_PHYS + 0x8c) /* Timer 3 interrupt clear */
206
207#define TIMER_C_ENABLE (1<<7)
208#define TIMER_C_PERIODIC (1<<6)
209#define TIMER_C_FREERUNNING (0)
210#define TIMER_C_2KHZ (0x00) /* 1.986 kHz */
211#define TIMER_C_508KHZ (0x08)
212
213 /* GPIO registers */
214
215#define GPIO_PFDD __REG(GPIO_PHYS + 0x34) /* PF direction */
216#define GPIO_INTTYPE1 __REG(GPIO_PHYS + 0x4c) /* IRQ edge or lvl */
217#define GPIO_INTTYPE2 __REG(GPIO_PHYS + 0x50) /* IRQ activ hi/lo */
218#define GPIO_GPIOFEOI __REG(GPIO_PHYS + 0x54) /* GPIOF end of IRQ */
219#define GPIO_GPIOFINTEN __REG(GPIO_PHYS + 0x58) /* GPIOF IRQ enable */
220#define GPIO_INTSTATUS __REG(GPIO_PHYS + 0x5c) /* GPIOF IRQ latch */
221#define GPIO_RAWINTSTATUS __REG(GPIO_PHYS + 0x60) /* GPIOF IRQ raw */
222
223
224#endif /* _ASM_ARCH_REGISTERS_H */
diff --git a/arch/arm/mach-lh7a40x/include/mach/ssp.h b/arch/arm/mach-lh7a40x/include/mach/ssp.h
deleted file mode 100644
index 509916182e34..000000000000
--- a/arch/arm/mach-lh7a40x/include/mach/ssp.h
+++ /dev/null
@@ -1,70 +0,0 @@
1/* ssp.h
2
3 written by Marc Singer
4 6 Dec 2004
5
6 Copyright (C) 2004 Marc Singer
7
8 -----------
9 DESCRIPTION
10 -----------
11
12 This SSP header is available throughout the kernel, for this
13 machine/architecture, because drivers that use it may be dispersed.
14
15 This file was cloned from the 7952x implementation. It would be
16 better to share them, but we're taking an easier approach for the
17 time being.
18
19*/
20
21#if !defined (__SSP_H__)
22# define __SSP_H__
23
24/* ----- Includes */
25
26/* ----- Types */
27
28struct ssp_driver {
29 int (*init) (void);
30 void (*exit) (void);
31 void (*acquire) (void);
32 void (*release) (void);
33 int (*configure) (int device, int mode, int speed,
34 int frame_size_write, int frame_size_read);
35 void (*chip_select) (int enable);
36 void (*set_callbacks) (void* handle,
37 irqreturn_t (*callback_tx)(void*),
38 irqreturn_t (*callback_rx)(void*));
39 void (*enable) (void);
40 void (*disable) (void);
41// int (*save_state) (void*);
42// void (*restore_state) (void*);
43 int (*read) (void);
44 int (*write) (u16 data);
45 int (*write_read) (u16 data);
46 void (*flush) (void);
47 void (*write_async) (void* pv, size_t cb);
48 size_t (*write_pos) (void);
49};
50
51 /* These modes are only available on the LH79524 */
52#define SSP_MODE_SPI (1)
53#define SSP_MODE_SSI (2)
54#define SSP_MODE_MICROWIRE (3)
55#define SSP_MODE_I2S (4)
56
57 /* CPLD SPI devices */
58#define DEVICE_EEPROM 0 /* Configuration eeprom */
59#define DEVICE_MAC 1 /* MAC eeprom (LPD79524) */
60#define DEVICE_CODEC 2 /* Audio codec */
61#define DEVICE_TOUCH 3 /* Touch screen (LPD79520) */
62
63/* ----- Globals */
64
65/* ----- Prototypes */
66
67//extern struct ssp_driver lh79520_i2s_driver;
68extern struct ssp_driver lh7a400_cpld_ssp_driver;
69
70#endif /* __SSP_H__ */
diff --git a/arch/arm/mach-lh7a40x/include/mach/system.h b/arch/arm/mach-lh7a40x/include/mach/system.h
deleted file mode 100644
index 45a56d3b93d7..000000000000
--- a/arch/arm/mach-lh7a40x/include/mach/system.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/* arch/arm/mach-lh7a40x/include/mach/system.h
2 *
3 * Copyright (C) 2004 Coastal Environmental Systems
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 */
10
11static inline void arch_idle(void)
12{
13 cpu_do_idle ();
14}
15
16static inline void arch_reset(char mode, const char *cmd)
17{
18 cpu_reset (0);
19}
diff --git a/arch/arm/mach-lh7a40x/include/mach/timex.h b/arch/arm/mach-lh7a40x/include/mach/timex.h
deleted file mode 100644
index 08028cef1b3b..000000000000
--- a/arch/arm/mach-lh7a40x/include/mach/timex.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/* arch/arm/mach-lh7a40x/include/mach/timex.h
2 *
3 * Copyright (C) 2004 Coastal Environmental Systems
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 */
10
11#include <mach/constants.h>
12
13#define CLOCK_TICK_RATE (PLL_CLOCK/6/16)
14
15/*
16#define CLOCK_TICK_RATE 3686400
17*/
diff --git a/arch/arm/mach-lh7a40x/include/mach/uncompress.h b/arch/arm/mach-lh7a40x/include/mach/uncompress.h
deleted file mode 100644
index 55b80d479eb4..000000000000
--- a/arch/arm/mach-lh7a40x/include/mach/uncompress.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/* arch/arm/mach-lh7a40x/include/mach/uncompress.h
2 *
3 * Copyright (C) 2004 Coastal Environmental Systems
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 */
10
11#include <mach/registers.h>
12
13#ifndef UART_R_DATA
14# define UART_R_DATA (0x00)
15#endif
16#ifndef UART_R_STATUS
17# define UART_R_STATUS (0x10)
18#endif
19#define nTxRdy (0x20) /* Not TxReady (literally Tx FIFO full) */
20
21 /* Access UART with physical addresses before MMU is setup */
22#define UART_STATUS (*(volatile unsigned long*) (UART2_PHYS + UART_R_STATUS))
23#define UART_DATA (*(volatile unsigned long*) (UART2_PHYS + UART_R_DATA))
24
25static inline void putc(int ch)
26{
27 while (UART_STATUS & nTxRdy)
28 barrier();
29 UART_DATA = ch;
30}
31
32static inline void flush(void)
33{
34}
35
36 /* NULL functions; we don't presently need them */
37#define arch_decomp_setup()
38#define arch_decomp_wdog()
diff --git a/arch/arm/mach-lh7a40x/include/mach/vmalloc.h b/arch/arm/mach-lh7a40x/include/mach/vmalloc.h
deleted file mode 100644
index d62da7358b16..000000000000
--- a/arch/arm/mach-lh7a40x/include/mach/vmalloc.h
+++ /dev/null
@@ -1,10 +0,0 @@
1/* arch/arm/mach-lh7a40x/include/mach/vmalloc.h
2 *
3 * Copyright (C) 2004 Coastal Environmental Systems
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 */
10#define VMALLOC_END (0xe8000000UL)
diff --git a/arch/arm/mach-lh7a40x/irq-kev7a400.c b/arch/arm/mach-lh7a40x/irq-kev7a400.c
deleted file mode 100644
index c7433b3c5812..000000000000
--- a/arch/arm/mach-lh7a40x/irq-kev7a400.c
+++ /dev/null
@@ -1,93 +0,0 @@
1/* arch/arm/mach-lh7a40x/irq-kev7a400.c
2 *
3 * Copyright (C) 2004 Coastal Environmental Systems
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 */
10
11#include <linux/interrupt.h>
12#include <linux/init.h>
13
14#include <asm/irq.h>
15#include <asm/mach/irq.h>
16#include <asm/mach/hardware.h>
17#include <asm/mach/irqs.h>
18
19#include "common.h"
20
21 /* KEV7a400 CPLD IRQ handling */
22
23static u16 CPLD_IRQ_mask; /* Mask for CPLD IRQs, 1 == unmasked */
24
25static void
26lh7a400_ack_cpld_irq (u32 irq)
27{
28 CPLD_CL_INT = 1 << (irq - IRQ_KEV7A400_CPLD);
29}
30
31static void
32lh7a400_mask_cpld_irq (u32 irq)
33{
34 CPLD_IRQ_mask &= ~(1 << (irq - IRQ_KEV7A400_CPLD));
35 CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask;
36}
37
38static void
39lh7a400_unmask_cpld_irq (u32 irq)
40{
41 CPLD_IRQ_mask |= 1 << (irq - IRQ_KEV7A400_CPLD);
42 CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask;
43}
44
45static struct
46irq_chip lh7a400_cpld_chip = {
47 .name = "CPLD",
48 .ack = lh7a400_ack_cpld_irq,
49 .mask = lh7a400_mask_cpld_irq,
50 .unmask = lh7a400_unmask_cpld_irq,
51};
52
53static void
54lh7a400_cpld_handler (unsigned int irq, struct irq_desc *desc)
55{
56 u32 mask = CPLD_LATCHED_INTS;
57 irq = IRQ_KEV_7A400_CPLD;
58 for (; mask; mask >>= 1, ++irq) {
59 if (mask & 1)
60 desc[irq].handle (irq, desc);
61 }
62}
63
64 /* IRQ initialization */
65
66void __init
67lh7a400_init_board_irq (void)
68{
69 int irq;
70
71 for (irq = IRQ_KEV7A400_CPLD;
72 irq < IRQ_KEV7A400_CPLD + NR_IRQ_KEV7A400_CPLD; ++irq) {
73 set_irq_chip (irq, &lh7a400_cpld_chip);
74 set_irq_handler (irq, handle_edge_irq);
75 set_irq_flags (irq, IRQF_VALID);
76 }
77 set_irq_chained_handler (IRQ_CPLD, kev7a400_cpld_handler);
78
79 /* Clear all CPLD interrupts */
80 CPLD_CL_INT = 0xff; /* CPLD_INTR_MMC_CD | CPLD_INTR_ETH_INT; */
81
82 /* *** FIXME CF enabled in ide-probe.c */
83
84 GPIO_GPIOINTEN = 0; /* Disable all GPIO interrupts */
85 barrier();
86 GPIO_INTTYPE1
87 = (GPIO_INTR_PCC1_CD | GPIO_INTR_PCC1_CD); /* Edge trig. */
88 GPIO_INTTYPE2 = 0; /* Falling edge & low-level */
89 GPIO_GPIOFEOI = 0xff; /* Clear all GPIO interrupts */
90 GPIO_GPIOINTEN = 0xff; /* Enable all GPIO interrupts */
91
92 init_FIQ();
93}
diff --git a/arch/arm/mach-lh7a40x/irq-lh7a400.c b/arch/arm/mach-lh7a40x/irq-lh7a400.c
deleted file mode 100644
index f2e7e655ca35..000000000000
--- a/arch/arm/mach-lh7a40x/irq-lh7a400.c
+++ /dev/null
@@ -1,91 +0,0 @@
1/* arch/arm/mach-lh7a40x/irq-lh7a400.c
2 *
3 * Copyright (C) 2004 Coastal Environmental Systems
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 */
10
11#include <linux/init.h>
12#include <linux/module.h>
13#include <linux/interrupt.h>
14
15#include <mach/hardware.h>
16#include <asm/irq.h>
17#include <asm/mach/irq.h>
18#include <mach/irqs.h>
19
20#include "common.h"
21
22 /* CPU IRQ handling */
23
24static void lh7a400_mask_irq(struct irq_data *d)
25{
26 INTC_INTENC = (1 << d->irq);
27}
28
29static void lh7a400_unmask_irq(struct irq_data *d)
30{
31 INTC_INTENS = (1 << d->irq);
32}
33
34static void lh7a400_ack_gpio_irq(struct irq_data *d)
35{
36 GPIO_GPIOFEOI = (1 << IRQ_TO_GPIO (d->irq));
37 INTC_INTENC = (1 << d->irq);
38}
39
40static struct irq_chip lh7a400_internal_chip = {
41 .name = "MPU",
42 .irq_ack = lh7a400_mask_irq, /* Level triggering -> mask is ack */
43 .irq_mask = lh7a400_mask_irq,
44 .irq_unmask = lh7a400_unmask_irq,
45};
46
47static struct irq_chip lh7a400_gpio_chip = {
48 .name = "GPIO",
49 .irq_ack = lh7a400_ack_gpio_irq,
50 .irq_mask = lh7a400_mask_irq,
51 .irq_unmask = lh7a400_unmask_irq,
52};
53
54
55 /* IRQ initialization */
56
57void __init lh7a400_init_irq (void)
58{
59 int irq;
60
61 INTC_INTENC = 0xffffffff; /* Disable all interrupts */
62 GPIO_GPIOFINTEN = 0x00; /* Disable all GPIOF interrupts */
63 barrier ();
64
65 for (irq = 0; irq < NR_IRQS; ++irq) {
66 switch (irq) {
67 case IRQ_GPIO0INTR:
68 case IRQ_GPIO1INTR:
69 case IRQ_GPIO2INTR:
70 case IRQ_GPIO3INTR:
71 case IRQ_GPIO4INTR:
72 case IRQ_GPIO5INTR:
73 case IRQ_GPIO6INTR:
74 case IRQ_GPIO7INTR:
75 set_irq_chip (irq, &lh7a400_gpio_chip);
76 set_irq_handler (irq, handle_level_irq); /* OK default */
77 break;
78 default:
79 set_irq_chip (irq, &lh7a400_internal_chip);
80 set_irq_handler (irq, handle_level_irq);
81 }
82 set_irq_flags (irq, IRQF_VALID);
83 }
84
85 lh7a40x_init_board_irq ();
86
87/* *** FIXME: the LH7a400 does use FIQ interrupts in some cases. For
88 the time being, these are not initialized. */
89
90/* init_FIQ(); */
91}
diff --git a/arch/arm/mach-lh7a40x/irq-lh7a404.c b/arch/arm/mach-lh7a40x/irq-lh7a404.c
deleted file mode 100644
index 14b173389573..000000000000
--- a/arch/arm/mach-lh7a40x/irq-lh7a404.c
+++ /dev/null
@@ -1,175 +0,0 @@
1/* arch/arm/mach-lh7a40x/irq-lh7a404.c
2 *
3 * Copyright (C) 2004 Logic Product Development
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 */
10
11#include <linux/init.h>
12#include <linux/module.h>
13#include <linux/interrupt.h>
14
15#include <mach/hardware.h>
16#include <asm/irq.h>
17#include <asm/mach/irq.h>
18#include <mach/irqs.h>
19
20#include "common.h"
21
22#define USE_PRIORITIES
23
24/* See Documentation/arm/Sharp-LH/VectoredInterruptController for more
25 * information on using the vectored interrupt controller's
26 * prioritizing feature. */
27
28static unsigned char irq_pri_vic1[] = {
29#if defined (USE_PRIORITIES)
30 IRQ_GPIO3INTR, /* CPLD */
31 IRQ_DMAM2P4, IRQ_DMAM2P5, /* AC97 */
32#endif
33};
34static unsigned char irq_pri_vic2[] = {
35#if defined (USE_PRIORITIES)
36 IRQ_T3UI, /* Timer */
37 IRQ_GPIO7INTR, /* CPLD */
38 IRQ_UART1INTR, IRQ_UART2INTR, IRQ_UART3INTR,
39 IRQ_LCDINTR, /* LCD */
40 IRQ_TSCINTR, /* ADC/Touchscreen */
41#endif
42};
43
44 /* CPU IRQ handling */
45
46static void lh7a404_vic1_mask_irq(struct irq_data *d)
47{
48 VIC1_INTENCLR = (1 << d->irq);
49}
50
51static void lh7a404_vic1_unmask_irq(struct irq_data *d)
52{
53 VIC1_INTEN = (1 << d->irq);
54}
55
56static void lh7a404_vic2_mask_irq(struct irq_data *d)
57{
58 VIC2_INTENCLR = (1 << (d->irq - 32));
59}
60
61static void lh7a404_vic2_unmask_irq(struct irq_data *d)
62{
63 VIC2_INTEN = (1 << (d->irq - 32));
64}
65
66static void lh7a404_vic1_ack_gpio_irq(struct irq_data *d)
67{
68 GPIO_GPIOFEOI = (1 << IRQ_TO_GPIO (d->irq));
69 VIC1_INTENCLR = (1 << d->irq);
70}
71
72static void lh7a404_vic2_ack_gpio_irq(struct irq_data *d)
73{
74 GPIO_GPIOFEOI = (1 << IRQ_TO_GPIO (d->irq));
75 VIC2_INTENCLR = (1 << d->irq);
76}
77
78static struct irq_chip lh7a404_vic1_chip = {
79 .name = "VIC1",
80 .irq_ack = lh7a404_vic1_mask_irq, /* Because level-triggered */
81 .irq_mask = lh7a404_vic1_mask_irq,
82 .irq_unmask = lh7a404_vic1_unmask_irq,
83};
84
85static struct irq_chip lh7a404_vic2_chip = {
86 .name = "VIC2",
87 .irq_ack = lh7a404_vic2_mask_irq, /* Because level-triggered */
88 .irq_mask = lh7a404_vic2_mask_irq,
89 .irq_unmask = lh7a404_vic2_unmask_irq,
90};
91
92static struct irq_chip lh7a404_gpio_vic1_chip = {
93 .name = "GPIO-VIC1",
94 .irq_ack = lh7a404_vic1_ack_gpio_irq,
95 .irq_mask = lh7a404_vic1_mask_irq,
96 .irq_unmask = lh7a404_vic1_unmask_irq,
97};
98
99static struct irq_chip lh7a404_gpio_vic2_chip = {
100 .name = "GPIO-VIC2",
101 .irq_ack = lh7a404_vic2_ack_gpio_irq,
102 .irq_mask = lh7a404_vic2_mask_irq,
103 .irq_unmask = lh7a404_vic2_unmask_irq,
104};
105
106 /* IRQ initialization */
107
108#if defined (CONFIG_ARCH_LH7A400) && defined (CONFIG_ARCH_LH7A404)
109extern void* branch_irq_lh7a400;
110#endif
111
112void __init lh7a404_init_irq (void)
113{
114 int irq;
115
116#if defined (CONFIG_ARCH_LH7A400) && defined (CONFIG_ARCH_LH7A404)
117#define NOP 0xe1a00000 /* mov r0, r0 */
118 branch_irq_lh7a400 = NOP;
119#endif
120
121 VIC1_INTENCLR = 0xffffffff;
122 VIC2_INTENCLR = 0xffffffff;
123 VIC1_INTSEL = 0; /* All IRQs */
124 VIC2_INTSEL = 0; /* All IRQs */
125 VIC1_NVADDR = VA_VIC1DEFAULT;
126 VIC2_NVADDR = VA_VIC2DEFAULT;
127 VIC1_VECTADDR = 0;
128 VIC2_VECTADDR = 0;
129
130 GPIO_GPIOFINTEN = 0x00; /* Disable all GPIOF interrupts */
131 barrier ();
132
133 /* Install prioritized interrupts, if there are any. */
134 /* The | 0x20*/
135 for (irq = 0; irq < 16; ++irq) {
136 (&VIC1_VAD0)[irq]
137 = (irq < ARRAY_SIZE (irq_pri_vic1))
138 ? (irq_pri_vic1[irq] | VA_VECTORED) : 0;
139 (&VIC1_VECTCNTL0)[irq]
140 = (irq < ARRAY_SIZE (irq_pri_vic1))
141 ? (irq_pri_vic1[irq] | VIC_CNTL_ENABLE) : 0;
142 (&VIC2_VAD0)[irq]
143 = (irq < ARRAY_SIZE (irq_pri_vic2))
144 ? (irq_pri_vic2[irq] | VA_VECTORED) : 0;
145 (&VIC2_VECTCNTL0)[irq]
146 = (irq < ARRAY_SIZE (irq_pri_vic2))
147 ? (irq_pri_vic2[irq] | VIC_CNTL_ENABLE) : 0;
148 }
149
150 for (irq = 0; irq < NR_IRQS; ++irq) {
151 switch (irq) {
152 case IRQ_GPIO0INTR:
153 case IRQ_GPIO1INTR:
154 case IRQ_GPIO2INTR:
155 case IRQ_GPIO3INTR:
156 case IRQ_GPIO4INTR:
157 case IRQ_GPIO5INTR:
158 case IRQ_GPIO6INTR:
159 case IRQ_GPIO7INTR:
160 set_irq_chip (irq, irq < 32
161 ? &lh7a404_gpio_vic1_chip
162 : &lh7a404_gpio_vic2_chip);
163 set_irq_handler (irq, handle_level_irq); /* OK default */
164 break;
165 default:
166 set_irq_chip (irq, irq < 32
167 ? &lh7a404_vic1_chip
168 : &lh7a404_vic2_chip);
169 set_irq_handler (irq, handle_level_irq);
170 }
171 set_irq_flags (irq, IRQF_VALID);
172 }
173
174 lh7a40x_init_board_irq ();
175}
diff --git a/arch/arm/mach-lh7a40x/irq-lpd7a40x.c b/arch/arm/mach-lh7a40x/irq-lpd7a40x.c
deleted file mode 100644
index 1bfdcddcb93e..000000000000
--- a/arch/arm/mach-lh7a40x/irq-lpd7a40x.c
+++ /dev/null
@@ -1,128 +0,0 @@
1/* arch/arm/mach-lh7a40x/irq-lpd7a40x.c
2 *
3 * Copyright (C) 2004 Coastal Environmental Systems
4 * Copyright (C) 2004 Logic Product Development
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 *
10 */
11
12#include <linux/init.h>
13#include <linux/module.h>
14#include <linux/interrupt.h>
15
16#include <mach/hardware.h>
17#include <asm/irq.h>
18#include <asm/mach/irq.h>
19#include <mach/irqs.h>
20
21#include "common.h"
22
23static void lh7a40x_ack_cpld_irq(struct irq_data *d)
24{
25 /* CPLD doesn't have ack capability */
26}
27
28static void lh7a40x_mask_cpld_irq(struct irq_data *d)
29{
30 switch (d->irq) {
31 case IRQ_LPD7A40X_ETH_INT:
32 CPLD_INTERRUPTS = CPLD_INTERRUPTS | 0x4;
33 break;
34 case IRQ_LPD7A400_TS:
35 CPLD_INTERRUPTS = CPLD_INTERRUPTS | 0x8;
36 break;
37 }
38}
39
40static void lh7a40x_unmask_cpld_irq(struct irq_data *d)
41{
42 switch (d->irq) {
43 case IRQ_LPD7A40X_ETH_INT:
44 CPLD_INTERRUPTS = CPLD_INTERRUPTS & ~ 0x4;
45 break;
46 case IRQ_LPD7A400_TS:
47 CPLD_INTERRUPTS = CPLD_INTERRUPTS & ~ 0x8;
48 break;
49 }
50}
51
52static struct irq_chip lh7a40x_cpld_chip = {
53 .name = "CPLD",
54 .irq_ack = lh7a40x_ack_cpld_irq,
55 .irq_mask = lh7a40x_mask_cpld_irq,
56 .irq_unmask = lh7a40x_unmask_cpld_irq,
57};
58
59static void lh7a40x_cpld_handler (unsigned int irq, struct irq_desc *desc)
60{
61 unsigned int mask = CPLD_INTERRUPTS;
62
63 desc->irq_data.chip->ack (irq);
64
65 if ((mask & 0x1) == 0) /* WLAN */
66 generic_handle_irq(IRQ_LPD7A40X_ETH_INT);
67
68 if ((mask & 0x2) == 0) /* Touch */
69 generic_handle_irq(IRQ_LPD7A400_TS);
70
71 desc->irq_data.chip->unmask (irq); /* Level-triggered need this */
72}
73
74
75 /* IRQ initialization */
76
77void __init lh7a40x_init_board_irq (void)
78{
79 int irq;
80
81 /* Rev A (v2.8): PF0, PF1, PF2, and PF3 are available IRQs.
82 PF7 supports the CPLD.
83 Rev B (v3.4): PF0, PF1, and PF2 are available IRQs.
84 PF3 supports the CPLD.
85 (Some) LPD7A404 prerelease boards report a version
86 number of 0x16, but we force an override since the
87 hardware is of the newer variety.
88 */
89
90 unsigned char cpld_version = CPLD_REVISION;
91 int pinCPLD;
92
93#if defined CONFIG_MACH_LPD7A404
94 cpld_version = 0x34; /* Override, for now */
95#endif
96 pinCPLD = (cpld_version == 0x28) ? 7 : 3;
97
98 /* First, configure user controlled GPIOF interrupts */
99
100 GPIO_PFDD &= ~0x0f; /* PF0-3 are inputs */
101 GPIO_INTTYPE1 &= ~0x0f; /* PF0-3 are level triggered */
102 GPIO_INTTYPE2 &= ~0x0f; /* PF0-3 are active low */
103 barrier ();
104 GPIO_GPIOFINTEN |= 0x0f; /* Enable PF0, PF1, PF2, and PF3 IRQs */
105
106 /* Then, configure CPLD interrupt */
107
108 CPLD_INTERRUPTS = 0x0c; /* Disable all CPLD interrupts */
109 GPIO_PFDD &= ~(1 << pinCPLD); /* Make input */
110 GPIO_INTTYPE1 |= (1 << pinCPLD); /* Edge triggered */
111 GPIO_INTTYPE2 &= ~(1 << pinCPLD); /* Active low */
112 barrier ();
113 GPIO_GPIOFINTEN |= (1 << pinCPLD); /* Enable */
114
115 /* Cascade CPLD interrupts */
116
117 for (irq = IRQ_BOARD_START;
118 irq < IRQ_BOARD_START + NR_IRQ_BOARD; ++irq) {
119 set_irq_chip (irq, &lh7a40x_cpld_chip);
120 set_irq_handler (irq, handle_edge_irq);
121 set_irq_flags (irq, IRQF_VALID);
122 }
123
124 set_irq_chained_handler ((cpld_version == 0x28)
125 ? IRQ_CPLD_V28
126 : IRQ_CPLD_V34,
127 lh7a40x_cpld_handler);
128}
diff --git a/arch/arm/mach-lh7a40x/lcd-panel.h b/arch/arm/mach-lh7a40x/lcd-panel.h
deleted file mode 100644
index a7f5027b2f78..000000000000
--- a/arch/arm/mach-lh7a40x/lcd-panel.h
+++ /dev/null
@@ -1,345 +0,0 @@
1/* lcd-panel.h
2
3 written by Marc Singer
4 18 Jul 2005
5
6 Copyright (C) 2005 Marc Singer
7
8 -----------
9 DESCRIPTION
10 -----------
11
12 Only one panel may be defined at a time.
13
14 The pixel clock is calculated to be no greater than the target.
15
16 Each timing value is accompanied by a specification comment.
17
18 UNITS/MIN/TYP/MAX
19
20 Most of the units will be in clocks.
21
22 USE_RGB555
23
24 Define this macro to configure the AMBA LCD controller to use an
25 RGB555 encoding for the pels instead of the normal RGB565.
26
27 LPD9520, LPD79524, LPD7A400, LPD7A404-10, LPD7A404-11
28
29 These boards are best approximated by 555 for all panels. Some
30 can use an extra low-order bit of blue in bit 16 of the color
31 value, but we don't have a way to communicate this non-linear
32 mapping to the kernel.
33
34*/
35
36#if !defined (__LCD_PANEL_H__)
37# define __LCD_PANEL_H__
38
39#if defined (MACH_LPD79520)\
40 || defined (MACH_LPD79524)\
41 || defined (MACH_LPD7A400)\
42 || defined (MACH_LPD7A404)
43# define USE_RGB555
44#endif
45
46struct clcd_panel_extra {
47 unsigned int hrmode;
48 unsigned int clsen;
49 unsigned int spsen;
50 unsigned int pcdel;
51 unsigned int revdel;
52 unsigned int lpdel;
53 unsigned int spldel;
54 unsigned int pc2del;
55};
56
57#define NS_TO_CLOCK(ns,c) ((((ns)*((c)/1000) + (1000000 - 1))/1000000))
58#define CLOCK_TO_DIV(e,c) (((c) + (e) - 1)/(e))
59
60#if defined CONFIG_FB_ARMCLCD_SHARP_LQ035Q7DB02_HRTFT
61
62 /* Logic Product Development LCD 3.5" QVGA HRTFT -10 */
63 /* Sharp PN LQ035Q7DB02 w/HRTFT controller chip */
64
65#define PIX_CLOCK_TARGET (6800000)
66#define PIX_CLOCK_DIVIDER CLOCK_TO_DIV (PIX_CLOCK_TARGET, HCLK)
67#define PIX_CLOCK (HCLK/PIX_CLOCK_DIVIDER)
68
69static struct clcd_panel lcd_panel = {
70 .mode = {
71 .name = "3.5in QVGA (LQ035Q7DB02)",
72 .xres = 240,
73 .yres = 320,
74 .pixclock = PIX_CLOCK,
75 .left_margin = 16,
76 .right_margin = 21,
77 .upper_margin = 8, // line/8/8/8
78 .lower_margin = 5,
79 .hsync_len = 61,
80 .vsync_len = NS_TO_CLOCK (60, PIX_CLOCK),
81 .vmode = FB_VMODE_NONINTERLACED,
82 },
83 .width = -1,
84 .height = -1,
85 .tim2 = TIM2_IPC | (PIX_CLOCK_DIVIDER - 2),
86 .cntl = CNTL_LCDTFT | CNTL_WATERMARK,
87 .bpp = 16,
88};
89
90#define HAS_LCD_PANEL_EXTRA
91
92static struct clcd_panel_extra lcd_panel_extra = {
93 .hrmode = 1,
94 .clsen = 1,
95 .spsen = 1,
96 .pcdel = 8,
97 .revdel = 7,
98 .lpdel = 13,
99 .spldel = 77,
100 .pc2del = 208,
101};
102
103#endif
104
105#if defined CONFIG_FB_ARMCLCD_SHARP_LQ057Q3DC02
106
107 /* Logic Product Development LCD 5.7" QVGA -10 */
108 /* Sharp PN LQ057Q3DC02 */
109 /* QVGA mode, V/Q=LOW */
110
111/* From Sharp on 2006.1.3. I believe some of the values are incorrect
112 * based on the datasheet.
113
114 Timing0 TIMING1 TIMING2 CONTROL
115 0x140A0C4C 0x080504EF 0x013F380D 0x00000829
116 HBP= 20 VBP= 8 BCD= 0
117 HFP= 10 VFP= 5 CPL=319
118 HSW= 12 VSW= 1 IOE= 0
119 PPL= 19 LPP=239 IPC= 1
120 IHS= 1
121 IVS= 1
122 ACB= 0
123 CSEL= 0
124 PCD= 13
125
126 */
127
128/* The full horizontal cycle (Th) is clock/360/400/450. */
129/* The full vertical cycle (Tv) is line/251/262/280. */
130
131#define PIX_CLOCK_TARGET (6300000) /* -/6.3/7 MHz */
132#define PIX_CLOCK_DIVIDER CLOCK_TO_DIV (PIX_CLOCK_TARGET, HCLK)
133#define PIX_CLOCK (HCLK/PIX_CLOCK_DIVIDER)
134
135static struct clcd_panel lcd_panel = {
136 .mode = {
137 .name = "5.7in QVGA (LQ057Q3DC02)",
138 .xres = 320,
139 .yres = 240,
140 .pixclock = PIX_CLOCK,
141 .left_margin = 11,
142 .right_margin = 400-11-320-2,
143 .upper_margin = 7, // line/7/7/7
144 .lower_margin = 262-7-240-2,
145 .hsync_len = 2, // clk/2/96/200
146 .vsync_len = 2, // line/2/-/34
147 .vmode = FB_VMODE_NONINTERLACED,
148 },
149 .width = -1,
150 .height = -1,
151 .tim2 = TIM2_IHS | TIM2_IVS
152 | (PIX_CLOCK_DIVIDER - 2),
153 .cntl = CNTL_LCDTFT | CNTL_WATERMARK,
154 .bpp = 16,
155};
156
157#endif
158
159#if defined CONFIG_FB_ARMCLCD_SHARP_LQ64D343
160
161 /* Logic Product Development LCD 6.4" VGA -10 */
162 /* Sharp PN LQ64D343 */
163
164/* The full horizontal cycle (Th) is clock/750/800/900. */
165/* The full vertical cycle (Tv) is line/515/525/560. */
166
167#define PIX_CLOCK_TARGET (28330000)
168#define PIX_CLOCK_DIVIDER CLOCK_TO_DIV (PIX_CLOCK_TARGET, HCLK)
169#define PIX_CLOCK (HCLK/PIX_CLOCK_DIVIDER)
170
171static struct clcd_panel lcd_panel = {
172 .mode = {
173 .name = "6.4in QVGA (LQ64D343)",
174 .xres = 640,
175 .yres = 480,
176 .pixclock = PIX_CLOCK,
177 .left_margin = 32,
178 .right_margin = 800-32-640-96,
179 .upper_margin = 32, // line/34/34/34
180 .lower_margin = 540-32-480-2,
181 .hsync_len = 96, // clk/2/96/200
182 .vsync_len = 2, // line/2/-/34
183 .vmode = FB_VMODE_NONINTERLACED,
184 },
185 .width = -1,
186 .height = -1,
187 .tim2 = TIM2_IHS | TIM2_IVS
188 | (PIX_CLOCK_DIVIDER - 2),
189 .cntl = CNTL_LCDTFT | CNTL_WATERMARK,
190 .bpp = 16,
191};
192
193#endif
194
195#if defined CONFIG_FB_ARMCLCD_SHARP_LQ10D368
196
197 /* Logic Product Development LCD 10.4" VGA -10 */
198 /* Sharp PN LQ10D368 */
199
200#define PIX_CLOCK_TARGET (28330000)
201#define PIX_CLOCK_DIVIDER CLOCK_TO_DIV (PIX_CLOCK_TARGET, HCLK)
202#define PIX_CLOCK (HCLK/PIX_CLOCK_DIVIDER)
203
204static struct clcd_panel lcd_panel = {
205 .mode = {
206 .name = "10.4in VGA (LQ10D368)",
207 .xres = 640,
208 .yres = 480,
209 .pixclock = PIX_CLOCK,
210 .left_margin = 21,
211 .right_margin = 15,
212 .upper_margin = 34,
213 .lower_margin = 5,
214 .hsync_len = 96,
215 .vsync_len = 16,
216 .vmode = FB_VMODE_NONINTERLACED,
217 },
218 .width = -1,
219 .height = -1,
220 .tim2 = TIM2_IHS | TIM2_IVS
221 | (PIX_CLOCK_DIVIDER - 2),
222 .cntl = CNTL_LCDTFT | CNTL_WATERMARK,
223 .bpp = 16,
224};
225
226#endif
227
228#if defined CONFIG_FB_ARMCLCD_SHARP_LQ121S1DG41
229
230 /* Logic Product Development LCD 12.1" SVGA -10 */
231 /* Sharp PN LQ121S1DG41, was LQ121S1DG31 */
232
233/* Note that with a 99993900 Hz HCLK, it is not possible to hit the
234 * target clock frequency range of 35MHz to 42MHz. */
235
236/* If the target pixel clock is substantially lower than the panel
237 * spec, this is done to prevent the LCD display from glitching when
238 * the CPU is under load. A pixel clock higher than 25MHz
239 * (empirically determined) will compete with the CPU for bus cycles
240 * for the Ethernet chip. However, even a pixel clock of 10MHz
241 * competes with Compact Flash interface during some operations
242 * (fdisk, e2fsck). And, at that speed the display may have a visible
243 * flicker. */
244
245/* The full horizontal cycle (Th) is clock/832/1056/1395. */
246
247#define PIX_CLOCK_TARGET (20000000)
248#define PIX_CLOCK_DIVIDER CLOCK_TO_DIV (PIX_CLOCK_TARGET, HCLK)
249#define PIX_CLOCK (HCLK/PIX_CLOCK_DIVIDER)
250
251static struct clcd_panel lcd_panel = {
252 .mode = {
253 .name = "12.1in SVGA (LQ121S1DG41)",
254 .xres = 800,
255 .yres = 600,
256 .pixclock = PIX_CLOCK,
257 .left_margin = 89, // ns/5/-/(1/PIX_CLOCK)-10
258 .right_margin = 1056-800-89-128,
259 .upper_margin = 23, // line/23/23/23
260 .lower_margin = 44,
261 .hsync_len = 128, // clk/2/128/200
262 .vsync_len = 4, // line/2/4/6
263 .vmode = FB_VMODE_NONINTERLACED,
264 },
265 .width = -1,
266 .height = -1,
267 .tim2 = TIM2_IHS | TIM2_IVS
268 | (PIX_CLOCK_DIVIDER - 2),
269 .cntl = CNTL_LCDTFT | CNTL_WATERMARK,
270 .bpp = 16,
271};
272
273#endif
274
275#if defined CONFIG_FB_ARMCLCD_HITACHI
276
277 /* Hitachi*/
278 /* Submitted by Michele Da Rold <michele.darold@ecsproject.com> */
279
280#define PIX_CLOCK_TARGET (49000000)
281#define PIX_CLOCK_DIVIDER CLOCK_TO_DIV (PIX_CLOCK_TARGET, HCLK)
282#define PIX_CLOCK (HCLK/PIX_CLOCK_DIVIDER)
283
284static struct clcd_panel lcd_panel = {
285 .mode = {
286 .name = "Hitachi 800x480",
287 .xres = 800,
288 .yres = 480,
289 .pixclock = PIX_CLOCK,
290 .left_margin = 88,
291 .right_margin = 40,
292 .upper_margin = 32,
293 .lower_margin = 11,
294 .hsync_len = 128,
295 .vsync_len = 2,
296 .vmode = FB_VMODE_NONINTERLACED,
297 },
298 .width = -1,
299 .height = -1,
300 .tim2 = TIM2_IPC | TIM2_IHS | TIM2_IVS
301 | (PIX_CLOCK_DIVIDER - 2),
302 .cntl = CNTL_LCDTFT | CNTL_WATERMARK,
303 .bpp = 16,
304};
305
306#endif
307
308
309#if defined CONFIG_FB_ARMCLCD_AUO_A070VW01_WIDE
310
311 /* AU Optotronics A070VW01 7.0 Wide Screen color Display*/
312 /* Submitted by Michele Da Rold <michele.darold@ecsproject.com> */
313
314#define PIX_CLOCK_TARGET (10000000)
315#define PIX_CLOCK_DIVIDER CLOCK_TO_DIV (PIX_CLOCK_TARGET, HCLK)
316#define PIX_CLOCK (HCLK/PIX_CLOCK_DIVIDER)
317
318static struct clcd_panel lcd_panel = {
319 .mode = {
320 .name = "7.0in Wide (A070VW01)",
321 .xres = 480,
322 .yres = 234,
323 .pixclock = PIX_CLOCK,
324 .left_margin = 30,
325 .right_margin = 25,
326 .upper_margin = 14,
327 .lower_margin = 12,
328 .hsync_len = 100,
329 .vsync_len = 1,
330 .vmode = FB_VMODE_NONINTERLACED,
331 },
332 .width = -1,
333 .height = -1,
334 .tim2 = TIM2_IPC | TIM2_IHS | TIM2_IVS
335 | (PIX_CLOCK_DIVIDER - 2),
336 .cntl = CNTL_LCDTFT | CNTL_WATERMARK,
337 .bpp = 16,
338};
339
340#endif
341
342#undef NS_TO_CLOCK
343#undef CLOCK_TO_DIV
344
345#endif /* __LCD_PANEL_H__ */
diff --git a/arch/arm/mach-lh7a40x/ssp-cpld.c b/arch/arm/mach-lh7a40x/ssp-cpld.c
deleted file mode 100644
index 2901d49d1484..000000000000
--- a/arch/arm/mach-lh7a40x/ssp-cpld.c
+++ /dev/null
@@ -1,343 +0,0 @@
1/* arch/arm/mach-lh7a40x/ssp-cpld.c
2 *
3 * Copyright (C) 2004,2005 Marc Singer
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 * SSP/SPI driver for the CardEngine CPLD.
10 *
11 */
12
13/* NOTES
14 -----
15
16 o *** This driver is cribbed from the 7952x implementation.
17 Some comments may not apply.
18
19 o This driver contains sufficient logic to control either the
20 serial EEPROMs or the audio codec. It is included in the kernel
21 to support the codec. The EEPROMs are really the responsibility
22 of the boot loader and should probably be left alone.
23
24 o The code must be augmented to cope with multiple, simultaneous
25 clients.
26 o The audio codec writes to the codec chip whenever playback
27 starts.
28 o The touchscreen driver writes to the ads chip every time it
29 samples.
30 o The audio codec must write 16 bits, but the touch chip writes
31 are 8 bits long.
32 o We need to be able to keep these configurations separate while
33 simultaneously active.
34
35 */
36
37#include <linux/module.h>
38#include <linux/kernel.h>
39//#include <linux/sched.h>
40#include <linux/errno.h>
41#include <linux/interrupt.h>
42//#include <linux/ioport.h>
43#include <linux/init.h>
44#include <linux/delay.h>
45#include <linux/spinlock.h>
46#include <linux/io.h>
47
48#include <asm/irq.h>
49#include <mach/hardware.h>
50
51#include <mach/ssp.h>
52
53//#define TALK
54
55#if defined (TALK)
56#define PRINTK(f...) printk (f)
57#else
58#define PRINTK(f...) do {} while (0)
59#endif
60
61#if defined (CONFIG_ARCH_LH7A400)
62# define CPLD_SPID __REGP16(CPLD06_VIRT) /* SPI data */
63# define CPLD_SPIC __REGP16(CPLD08_VIRT) /* SPI control */
64# define CPLD_SPIC_CS_CODEC (1<<0)
65# define CPLD_SPIC_CS_TOUCH (1<<1)
66# define CPLD_SPIC_WRITE (0<<2)
67# define CPLD_SPIC_READ (1<<2)
68# define CPLD_SPIC_DONE (1<<3) /* r/o */
69# define CPLD_SPIC_LOAD (1<<4)
70# define CPLD_SPIC_START (1<<4)
71# define CPLD_SPIC_LOADED (1<<5) /* r/o */
72#endif
73
74#define CPLD_SPI __REGP16(CPLD0A_VIRT) /* SPI operation */
75#define CPLD_SPI_CS_EEPROM (1<<3)
76#define CPLD_SPI_SCLK (1<<2)
77#define CPLD_SPI_TX_SHIFT (1)
78#define CPLD_SPI_TX (1<<CPLD_SPI_TX_SHIFT)
79#define CPLD_SPI_RX_SHIFT (0)
80#define CPLD_SPI_RX (1<<CPLD_SPI_RX_SHIFT)
81
82/* *** FIXME: these timing values are substantially larger than the
83 *** chip requires. We may implement an nsleep () function. */
84#define T_SKH 1 /* Clock time high (us) */
85#define T_SKL 1 /* Clock time low (us) */
86#define T_CS 1 /* Minimum chip select low time (us) */
87#define T_CSS 1 /* Minimum chip select setup time (us) */
88#define T_DIS 1 /* Data setup time (us) */
89
90 /* EEPROM SPI bits */
91#define P_START (1<<9)
92#define P_WRITE (1<<7)
93#define P_READ (2<<7)
94#define P_ERASE (3<<7)
95#define P_EWDS (0<<7)
96#define P_WRAL (0<<7)
97#define P_ERAL (0<<7)
98#define P_EWEN (0<<7)
99#define P_A_EWDS (0<<5)
100#define P_A_WRAL (1<<5)
101#define P_A_ERAL (2<<5)
102#define P_A_EWEN (3<<5)
103
104struct ssp_configuration {
105 int device;
106 int mode;
107 int speed;
108 int frame_size_write;
109 int frame_size_read;
110};
111
112static struct ssp_configuration ssp_configuration;
113static spinlock_t ssp_lock;
114
115static void enable_cs (void)
116{
117 switch (ssp_configuration.device) {
118 case DEVICE_EEPROM:
119 CPLD_SPI |= CPLD_SPI_CS_EEPROM;
120 break;
121 }
122 udelay (T_CSS);
123}
124
125static void disable_cs (void)
126{
127 switch (ssp_configuration.device) {
128 case DEVICE_EEPROM:
129 CPLD_SPI &= ~CPLD_SPI_CS_EEPROM;
130 break;
131 }
132 udelay (T_CS);
133}
134
135static void pulse_clock (void)
136{
137 CPLD_SPI |= CPLD_SPI_SCLK;
138 udelay (T_SKH);
139 CPLD_SPI &= ~CPLD_SPI_SCLK;
140 udelay (T_SKL);
141}
142
143
144/* execute_spi_command
145
146 sends an spi command to a device. It first sends cwrite bits from
147 v. If cread is greater than zero it will read cread bits
148 (discarding the leading 0 bit) and return them. If cread is less
149 than zero it will check for completetion status and return 0 on
150 success or -1 on timeout. If cread is zero it does nothing other
151 than sending the command.
152
153 On the LPD7A400, we can only read or write multiples of 8 bits on
154 the codec and the touch screen device. Here, we round up.
155
156*/
157
158static int execute_spi_command (int v, int cwrite, int cread)
159{
160 unsigned long l = 0;
161
162#if defined (CONFIG_MACH_LPD7A400)
163 /* The codec and touch devices cannot be bit-banged. Instead,
164 * the CPLD provides an eight-bit shift register and a crude
165 * interface. */
166 if ( ssp_configuration.device == DEVICE_CODEC
167 || ssp_configuration.device == DEVICE_TOUCH) {
168 int select = 0;
169
170 PRINTK ("spi(%d %d.%d) 0x%04x",
171 ssp_configuration.device, cwrite, cread,
172 v);
173#if defined (TALK)
174 if (ssp_configuration.device == DEVICE_CODEC)
175 PRINTK (" 0x%03x -> %2d", v & 0x1ff, (v >> 9) & 0x7f);
176#endif
177 PRINTK ("\n");
178
179 if (ssp_configuration.device == DEVICE_CODEC)
180 select = CPLD_SPIC_CS_CODEC;
181 if (ssp_configuration.device == DEVICE_TOUCH)
182 select = CPLD_SPIC_CS_TOUCH;
183 if (cwrite) {
184 for (cwrite = (cwrite + 7)/8; cwrite-- > 0; ) {
185 CPLD_SPID = (v >> (8*cwrite)) & 0xff;
186 CPLD_SPIC = select | CPLD_SPIC_LOAD;
187 while (!(CPLD_SPIC & CPLD_SPIC_LOADED))
188 ;
189 CPLD_SPIC = select;
190 while (!(CPLD_SPIC & CPLD_SPIC_DONE))
191 ;
192 }
193 v = 0;
194 }
195 if (cread) {
196 mdelay (2); /* *** FIXME: required by ads7843? */
197 v = 0;
198 for (cread = (cread + 7)/8; cread-- > 0;) {
199 CPLD_SPID = 0;
200 CPLD_SPIC = select | CPLD_SPIC_READ
201 | CPLD_SPIC_START;
202 while (!(CPLD_SPIC & CPLD_SPIC_LOADED))
203 ;
204 CPLD_SPIC = select | CPLD_SPIC_READ;
205 while (!(CPLD_SPIC & CPLD_SPIC_DONE))
206 ;
207 v = (v << 8) | CPLD_SPID;
208 }
209 }
210 return v;
211 }
212#endif
213
214 PRINTK ("spi(%d) 0x%04x -> 0x%x\r\n", ssp_configuration.device,
215 v & 0x1ff, (v >> 9) & 0x7f);
216
217 enable_cs ();
218
219 v <<= CPLD_SPI_TX_SHIFT; /* Correction for position of SPI_TX bit */
220 while (cwrite--) {
221 CPLD_SPI
222 = (CPLD_SPI & ~CPLD_SPI_TX)
223 | ((v >> cwrite) & CPLD_SPI_TX);
224 udelay (T_DIS);
225 pulse_clock ();
226 }
227
228 if (cread < 0) {
229 int delay = 10;
230 disable_cs ();
231 udelay (1);
232 enable_cs ();
233
234 l = -1;
235 do {
236 if (CPLD_SPI & CPLD_SPI_RX) {
237 l = 0;
238 break;
239 }
240 } while (udelay (1), --delay);
241 }
242 else
243 /* We pulse the clock before the data to skip the leading zero. */
244 while (cread-- > 0) {
245 pulse_clock ();
246 l = (l<<1)
247 | (((CPLD_SPI & CPLD_SPI_RX)
248 >> CPLD_SPI_RX_SHIFT) & 0x1);
249 }
250
251 disable_cs ();
252 return l;
253}
254
255static int ssp_init (void)
256{
257 spin_lock_init (&ssp_lock);
258 memset (&ssp_configuration, 0, sizeof (ssp_configuration));
259 return 0;
260}
261
262
263/* ssp_chip_select
264
265 drops the chip select line for the CPLD shift-register controlled
266 devices. It doesn't enable chip
267
268*/
269
270static void ssp_chip_select (int enable)
271{
272#if defined (CONFIG_MACH_LPD7A400)
273 int select;
274
275 if (ssp_configuration.device == DEVICE_CODEC)
276 select = CPLD_SPIC_CS_CODEC;
277 else if (ssp_configuration.device == DEVICE_TOUCH)
278 select = CPLD_SPIC_CS_TOUCH;
279 else
280 return;
281
282 if (enable)
283 CPLD_SPIC = select;
284 else
285 CPLD_SPIC = 0;
286#endif
287}
288
289static void ssp_acquire (void)
290{
291 spin_lock (&ssp_lock);
292}
293
294static void ssp_release (void)
295{
296 ssp_chip_select (0); /* just in case */
297 spin_unlock (&ssp_lock);
298}
299
300static int ssp_configure (int device, int mode, int speed,
301 int frame_size_write, int frame_size_read)
302{
303 ssp_configuration.device = device;
304 ssp_configuration.mode = mode;
305 ssp_configuration.speed = speed;
306 ssp_configuration.frame_size_write = frame_size_write;
307 ssp_configuration.frame_size_read = frame_size_read;
308
309 return 0;
310}
311
312static int ssp_read (void)
313{
314 return execute_spi_command (0, 0, ssp_configuration.frame_size_read);
315}
316
317static int ssp_write (u16 data)
318{
319 execute_spi_command (data, ssp_configuration.frame_size_write, 0);
320 return 0;
321}
322
323static int ssp_write_read (u16 data)
324{
325 return execute_spi_command (data, ssp_configuration.frame_size_write,
326 ssp_configuration.frame_size_read);
327}
328
329struct ssp_driver lh7a40x_cpld_ssp_driver = {
330 .init = ssp_init,
331 .acquire = ssp_acquire,
332 .release = ssp_release,
333 .configure = ssp_configure,
334 .chip_select = ssp_chip_select,
335 .read = ssp_read,
336 .write = ssp_write,
337 .write_read = ssp_write_read,
338};
339
340
341MODULE_AUTHOR("Marc Singer");
342MODULE_DESCRIPTION("LPD7A40X CPLD SPI driver");
343MODULE_LICENSE("GPL");
diff --git a/arch/arm/mach-lh7a40x/time.c b/arch/arm/mach-lh7a40x/time.c
deleted file mode 100644
index 4601e425bae3..000000000000
--- a/arch/arm/mach-lh7a40x/time.c
+++ /dev/null
@@ -1,71 +0,0 @@
1/*
2 * arch/arm/mach-lh7a40x/time.c
3 *
4 * Copyright (C) 2004 Logic Product Development
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 *
10 */
11#include <linux/module.h>
12#include <linux/kernel.h>
13#include <linux/interrupt.h>
14#include <linux/irq.h>
15#include <linux/time.h>
16#include <linux/io.h>
17
18#include <mach/hardware.h>
19#include <asm/irq.h>
20#include <asm/leds.h>
21
22#include <asm/mach/time.h>
23#include "common.h"
24
25#if HZ < 100
26# define TIMER_CONTROL TIMER_CONTROL2
27# define TIMER_LOAD TIMER_LOAD2
28# define TIMER_CONSTANT (508469/HZ)
29# define TIMER_MODE (TIMER_C_ENABLE | TIMER_C_PERIODIC | TIMER_C_508KHZ)
30# define TIMER_EOI TIMER_EOI2
31# define TIMER_IRQ IRQ_T2UI
32#else
33# define TIMER_CONTROL TIMER_CONTROL3
34# define TIMER_LOAD TIMER_LOAD3
35# define TIMER_CONSTANT (3686400/HZ)
36# define TIMER_MODE (TIMER_C_ENABLE | TIMER_C_PERIODIC)
37# define TIMER_EOI TIMER_EOI3
38# define TIMER_IRQ IRQ_T3UI
39#endif
40
41static irqreturn_t
42lh7a40x_timer_interrupt(int irq, void *dev_id)
43{
44 TIMER_EOI = 0;
45 timer_tick();
46
47 return IRQ_HANDLED;
48}
49
50static struct irqaction lh7a40x_timer_irq = {
51 .name = "LHA740x Timer Tick",
52 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
53 .handler = lh7a40x_timer_interrupt,
54};
55
56static void __init lh7a40x_timer_init (void)
57{
58 /* Stop/disable all timers */
59 TIMER_CONTROL1 = 0;
60 TIMER_CONTROL2 = 0;
61 TIMER_CONTROL3 = 0;
62
63 setup_irq (TIMER_IRQ, &lh7a40x_timer_irq);
64
65 TIMER_LOAD = TIMER_CONSTANT;
66 TIMER_CONTROL = TIMER_MODE;
67}
68
69struct sys_timer lh7a40x_timer = {
70 .init = &lh7a40x_timer_init,
71};
diff --git a/arch/arm/mach-loki/common.c b/arch/arm/mach-loki/common.c
index 818f19d7ab1f..e41e909cf8f4 100644
--- a/arch/arm/mach-loki/common.c
+++ b/arch/arm/mach-loki/common.c
@@ -18,6 +18,7 @@
18#include <asm/timex.h> 18#include <asm/timex.h>
19#include <asm/mach/map.h> 19#include <asm/mach/map.h>
20#include <asm/mach/time.h> 20#include <asm/mach/time.h>
21#include <mach/bridge-regs.h>
21#include <mach/loki.h> 22#include <mach/loki.h>
22#include <plat/orion_nand.h> 23#include <plat/orion_nand.h>
23#include <plat/time.h> 24#include <plat/time.h>
@@ -290,9 +291,15 @@ void __init loki_uart1_init(void)
290/***************************************************************************** 291/*****************************************************************************
291 * Time handling 292 * Time handling
292 ****************************************************************************/ 293 ****************************************************************************/
294void __init loki_init_early(void)
295{
296 orion_time_set_base(TIMER_VIRT_BASE);
297}
298
293static void loki_timer_init(void) 299static void loki_timer_init(void)
294{ 300{
295 orion_time_init(IRQ_LOKI_BRIDGE, LOKI_TCLK); 301 orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR,
302 IRQ_LOKI_BRIDGE, LOKI_TCLK);
296} 303}
297 304
298struct sys_timer loki_timer = { 305struct sys_timer loki_timer = {
diff --git a/arch/arm/mach-loki/common.h b/arch/arm/mach-loki/common.h
index 26054fd0f05e..a315dcf8887c 100644
--- a/arch/arm/mach-loki/common.h
+++ b/arch/arm/mach-loki/common.h
@@ -18,6 +18,7 @@ struct mv643xx_eth_platform_data;
18 */ 18 */
19void loki_map_io(void); 19void loki_map_io(void);
20void loki_init(void); 20void loki_init(void);
21void loki_init_early(void);
21void loki_init_irq(void); 22void loki_init_irq(void);
22 23
23extern struct mbus_dram_target_info loki_mbus_dram_info; 24extern struct mbus_dram_target_info loki_mbus_dram_info;
diff --git a/arch/arm/mach-loki/include/mach/bridge-regs.h b/arch/arm/mach-loki/include/mach/bridge-regs.h
index a3fabf70044f..fd87732097cd 100644
--- a/arch/arm/mach-loki/include/mach/bridge-regs.h
+++ b/arch/arm/mach-loki/include/mach/bridge-regs.h
@@ -17,11 +17,6 @@
17#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE | 0x010c) 17#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE | 0x010c)
18#define SOFT_RESET 0x00000001 18#define SOFT_RESET 0x00000001
19 19
20#define BRIDGE_CAUSE (BRIDGE_VIRT_BASE | 0x0110)
21
22#define BRIDGE_MASK (BRIDGE_VIRT_BASE | 0x0114)
23#define BRIDGE_INT_TIMER0 0x0002
24#define BRIDGE_INT_TIMER1 0x0004
25#define BRIDGE_INT_TIMER1_CLR 0x0004 20#define BRIDGE_INT_TIMER1_CLR 0x0004
26 21
27#define IRQ_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0200) 22#define IRQ_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0200)
diff --git a/arch/arm/mach-loki/include/mach/memory.h b/arch/arm/mach-loki/include/mach/memory.h
index 2ed7e6e732c2..66366657a875 100644
--- a/arch/arm/mach-loki/include/mach/memory.h
+++ b/arch/arm/mach-loki/include/mach/memory.h
@@ -5,6 +5,6 @@
5#ifndef __ASM_ARCH_MEMORY_H 5#ifndef __ASM_ARCH_MEMORY_H
6#define __ASM_ARCH_MEMORY_H 6#define __ASM_ARCH_MEMORY_H
7 7
8#define PHYS_OFFSET UL(0x00000000) 8#define PLAT_PHYS_OFFSET UL(0x00000000)
9 9
10#endif 10#endif
diff --git a/arch/arm/mach-loki/lb88rc8480-setup.c b/arch/arm/mach-loki/lb88rc8480-setup.c
index a1e75e7fc500..35eae4e6abb2 100644
--- a/arch/arm/mach-loki/lb88rc8480-setup.c
+++ b/arch/arm/mach-loki/lb88rc8480-setup.c
@@ -93,6 +93,7 @@ MACHINE_START(LB88RC8480, "Marvell LB88RC8480 Development Board")
93 .boot_params = 0x00000100, 93 .boot_params = 0x00000100,
94 .init_machine = lb88rc8480_init, 94 .init_machine = lb88rc8480_init,
95 .map_io = loki_map_io, 95 .map_io = loki_map_io,
96 .init_early = loki_init_early,
96 .init_irq = loki_init_irq, 97 .init_irq = loki_init_irq,
97 .timer = &loki_timer, 98 .timer = &loki_timer,
98MACHINE_END 99MACHINE_END
diff --git a/arch/arm/mach-lpc32xx/include/mach/memory.h b/arch/arm/mach-lpc32xx/include/mach/memory.h
index 044e1acecbe6..a647dd624afa 100644
--- a/arch/arm/mach-lpc32xx/include/mach/memory.h
+++ b/arch/arm/mach-lpc32xx/include/mach/memory.h
@@ -22,6 +22,6 @@
22/* 22/*
23 * Physical DRAM offset of bank 0 23 * Physical DRAM offset of bank 0
24 */ 24 */
25#define PHYS_OFFSET UL(0x80000000) 25#define PLAT_PHYS_OFFSET UL(0x80000000)
26 26
27#endif 27#endif
diff --git a/arch/arm/mach-mmp/include/mach/memory.h b/arch/arm/mach-mmp/include/mach/memory.h
index bdb21d70714c..d68b50a2d6a0 100644
--- a/arch/arm/mach-mmp/include/mach/memory.h
+++ b/arch/arm/mach-mmp/include/mach/memory.h
@@ -9,6 +9,6 @@
9#ifndef __ASM_MACH_MEMORY_H 9#ifndef __ASM_MACH_MEMORY_H
10#define __ASM_MACH_MEMORY_H 10#define __ASM_MACH_MEMORY_H
11 11
12#define PHYS_OFFSET UL(0x00000000) 12#define PLAT_PHYS_OFFSET UL(0x00000000)
13 13
14#endif /* __ASM_MACH_MEMORY_H */ 14#endif /* __ASM_MACH_MEMORY_H */
diff --git a/arch/arm/mach-mmp/include/mach/mmp2.h b/arch/arm/mach-mmp/include/mach/mmp2.h
index 4aec493640b4..2cbf6df09b82 100644
--- a/arch/arm/mach-mmp/include/mach/mmp2.h
+++ b/arch/arm/mach-mmp/include/mach/mmp2.h
@@ -11,8 +11,8 @@ extern void __init mmp2_init_irq(void);
11extern void mmp2_clear_pmic_int(void); 11extern void mmp2_clear_pmic_int(void);
12 12
13#include <linux/i2c.h> 13#include <linux/i2c.h>
14#include <linux/i2c/pxa-i2c.h>
14#include <mach/devices.h> 15#include <mach/devices.h>
15#include <plat/i2c.h>
16 16
17extern struct pxa_device_desc mmp2_device_uart1; 17extern struct pxa_device_desc mmp2_device_uart1;
18extern struct pxa_device_desc mmp2_device_uart2; 18extern struct pxa_device_desc mmp2_device_uart2;
diff --git a/arch/arm/mach-mmp/include/mach/pxa168.h b/arch/arm/mach-mmp/include/mach/pxa168.h
index 1801e4206232..a52b3d2f325c 100644
--- a/arch/arm/mach-mmp/include/mach/pxa168.h
+++ b/arch/arm/mach-mmp/include/mach/pxa168.h
@@ -8,8 +8,8 @@ extern void __init pxa168_init_irq(void);
8extern void pxa168_clear_keypad_wakeup(void); 8extern void pxa168_clear_keypad_wakeup(void);
9 9
10#include <linux/i2c.h> 10#include <linux/i2c.h>
11#include <linux/i2c/pxa-i2c.h>
11#include <mach/devices.h> 12#include <mach/devices.h>
12#include <plat/i2c.h>
13#include <plat/pxa3xx_nand.h> 13#include <plat/pxa3xx_nand.h>
14#include <video/pxa168fb.h> 14#include <video/pxa168fb.h>
15#include <plat/pxa27x_keypad.h> 15#include <plat/pxa27x_keypad.h>
diff --git a/arch/arm/mach-mmp/include/mach/pxa910.h b/arch/arm/mach-mmp/include/mach/pxa910.h
index f13c49d6f8dc..91be75591398 100644
--- a/arch/arm/mach-mmp/include/mach/pxa910.h
+++ b/arch/arm/mach-mmp/include/mach/pxa910.h
@@ -7,8 +7,8 @@ extern struct sys_timer pxa910_timer;
7extern void __init pxa910_init_irq(void); 7extern void __init pxa910_init_irq(void);
8 8
9#include <linux/i2c.h> 9#include <linux/i2c.h>
10#include <linux/i2c/pxa-i2c.h>
10#include <mach/devices.h> 11#include <mach/devices.h>
11#include <plat/i2c.h>
12#include <plat/pxa3xx_nand.h> 12#include <plat/pxa3xx_nand.h>
13 13
14extern struct pxa_device_desc pxa910_device_uart1; 14extern struct pxa_device_desc pxa910_device_uart1;
diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
index 5d3d9ade12fb..1516896e8d17 100644
--- a/arch/arm/mach-msm/Kconfig
+++ b/arch/arm/mach-msm/Kconfig
@@ -45,7 +45,16 @@ config ARCH_MSM8X60
45 select CPU_V7 45 select CPU_V7
46 select MSM_V2_TLMM 46 select MSM_V2_TLMM
47 select MSM_GPIOMUX 47 select MSM_GPIOMUX
48 select IOMMU_API 48 select MSM_SCM if SMP
49
50config ARCH_MSM8960
51 bool "MSM8960"
52 select ARCH_MSM_SCORPIONMP
53 select MACH_MSM8960_SIM if (!MACH_MSM8960_RUMI3)
54 select ARM_GIC
55 select CPU_V7
56 select MSM_V2_TLMM
57 select MSM_GPIOMUX
49 select MSM_SCM if SMP 58 select MSM_SCM if SMP
50 59
51endchoice 60endchoice
@@ -125,11 +134,35 @@ config MACH_MSM8X60_FFA
125 help 134 help
126 Support for the Qualcomm MSM8x60 FFA eval board. 135 Support for the Qualcomm MSM8x60 FFA eval board.
127 136
137config MACH_MSM8960_SIM
138 depends on ARCH_MSM8960
139 bool "MSM8960 Simulator"
140 help
141 Support for the Qualcomm MSM8960 simulator.
142
143config MACH_MSM8960_RUMI3
144 depends on ARCH_MSM8960
145 bool "MSM8960 RUMI3"
146 help
147 Support for the Qualcomm MSM8960 RUMI3 emulator.
148
128endmenu 149endmenu
129 150
151config MSM_IOMMU
152 bool "MSM IOMMU Support"
153 depends on ARCH_MSM8X60 || ARCH_MSM8960
154 select IOMMU_API
155 default n
156 help
157 Support for the IOMMUs found on certain Qualcomm SOCs.
158 These IOMMUs allow virtualization of the address space used by most
159 cores within the multimedia subsystem.
160
161 If unsure, say N here.
162
130config IOMMU_PGTABLES_L2 163config IOMMU_PGTABLES_L2
131 def_bool y 164 def_bool y
132 depends on ARCH_MSM8X60 && MMU && SMP && CPU_DCACHE_DISABLE=n 165 depends on MSM_IOMMU && MMU && SMP && CPU_DCACHE_DISABLE=n
133 166
134config MSM_DEBUG_UART 167config MSM_DEBUG_UART
135 int 168 int
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
index 94195c190e13..9519fd28a025 100644
--- a/arch/arm/mach-msm/Makefile
+++ b/arch/arm/mach-msm/Makefile
@@ -1,21 +1,16 @@
1obj-y += io.o idle.o timer.o 1obj-y += io.o idle.o timer.o
2ifndef CONFIG_ARCH_MSM8X60 2obj-y += clock.o
3obj-y += acpuclock-arm11.o 3obj-$(CONFIG_DEBUG_FS) += clock-debug.o
4obj-y += dma.o
5endif
6 4
7ifdef CONFIG_MSM_VIC 5obj-$(CONFIG_MSM_VIC) += irq-vic.o
8obj-y += irq-vic.o 6obj-$(CONFIG_MSM_IOMMU) += iommu.o iommu_dev.o devices-iommu.o
9else 7
10ifndef CONFIG_ARCH_MSM8X60 8obj-$(CONFIG_ARCH_MSM7X00A) += dma.o irq.o acpuclock-arm11.o
11obj-y += irq.o 9obj-$(CONFIG_ARCH_MSM7X30) += dma.o
12endif 10obj-$(CONFIG_ARCH_QSD8X50) += dma.o sirc.o
13endif
14 11
15obj-$(CONFIG_ARCH_MSM8X60) += clock-dummy.o iommu.o iommu_dev.o devices-msm8x60-iommu.o
16obj-$(CONFIG_MSM_PROC_COMM) += proc_comm.o clock-pcom.o vreg.o 12obj-$(CONFIG_MSM_PROC_COMM) += proc_comm.o clock-pcom.o vreg.o
17obj-$(CONFIG_MSM_PROC_COMM) += clock.o 13
18obj-$(CONFIG_ARCH_QSD8X50) += sirc.o
19obj-$(CONFIG_MSM_SMD) += smd.o smd_debug.o 14obj-$(CONFIG_MSM_SMD) += smd.o smd_debug.o
20obj-$(CONFIG_MSM_SMD) += last_radio_log.o 15obj-$(CONFIG_MSM_SMD) += last_radio_log.o
21obj-$(CONFIG_MSM_SCM) += scm.o scm-boot.o 16obj-$(CONFIG_MSM_SCM) += scm.o scm-boot.o
@@ -29,12 +24,16 @@ obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o devices-msm7x00.o
29obj-$(CONFIG_ARCH_MSM7X30) += board-msm7x30.o devices-msm7x30.o 24obj-$(CONFIG_ARCH_MSM7X30) += board-msm7x30.o devices-msm7x30.o
30obj-$(CONFIG_ARCH_QSD8X50) += board-qsd8x50.o devices-qsd8x50.o 25obj-$(CONFIG_ARCH_QSD8X50) += board-qsd8x50.o devices-qsd8x50.o
31obj-$(CONFIG_ARCH_MSM8X60) += board-msm8x60.o 26obj-$(CONFIG_ARCH_MSM8X60) += board-msm8x60.o
27obj-$(CONFIG_ARCH_MSM8960) += board-msm8960.o devices-msm8960.o
32 28
33obj-$(CONFIG_ARCH_MSM7X30) += gpiomux-7x30.o gpiomux-v1.o gpiomux.o 29obj-$(CONFIG_ARCH_MSM7X30) += gpiomux-v1.o gpiomux.o
34obj-$(CONFIG_ARCH_QSD8X50) += gpiomux-8x50.o gpiomux-v1.o gpiomux.o 30obj-$(CONFIG_ARCH_QSD8X50) += gpiomux-8x50.o gpiomux-v1.o gpiomux.o
35obj-$(CONFIG_ARCH_MSM8X60) += gpiomux-8x60.o gpiomux-v2.o gpiomux.o 31obj-$(CONFIG_ARCH_MSM8X60) += gpiomux-8x60.o gpiomux-v2.o gpiomux.o
36ifdef CONFIG_MSM_V2_TLMM 32ifdef CONFIG_MSM_V2_TLMM
33ifndef CONFIG_ARCH_MSM8960
34# TODO: TLMM Mapping issues need to be resolved
37obj-y += gpio-v2.o 35obj-y += gpio-v2.o
36endif
38else 37else
39obj-y += gpio.o 38obj-y += gpio.o
40endif 39endif
diff --git a/arch/arm/mach-msm/board-halibut.c b/arch/arm/mach-msm/board-halibut.c
index 75dabb16c802..18a3c97bc863 100644
--- a/arch/arm/mach-msm/board-halibut.c
+++ b/arch/arm/mach-msm/board-halibut.c
@@ -93,8 +93,6 @@ static void __init halibut_map_io(void)
93} 93}
94 94
95MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)") 95MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)")
96#ifdef CONFIG_MSM_DEBUG_UART
97#endif
98 .boot_params = 0x10000100, 96 .boot_params = 0x10000100,
99 .fixup = halibut_fixup, 97 .fixup = halibut_fixup,
100 .map_io = halibut_map_io, 98 .map_io = halibut_map_io,
diff --git a/arch/arm/mach-msm/board-mahimahi.c b/arch/arm/mach-msm/board-mahimahi.c
index ef3ebf2f763b..7a9a03eb189c 100644
--- a/arch/arm/mach-msm/board-mahimahi.c
+++ b/arch/arm/mach-msm/board-mahimahi.c
@@ -74,8 +74,6 @@ static void __init mahimahi_map_io(void)
74extern struct sys_timer msm_timer; 74extern struct sys_timer msm_timer;
75 75
76MACHINE_START(MAHIMAHI, "mahimahi") 76MACHINE_START(MAHIMAHI, "mahimahi")
77#ifdef CONFIG_MSM_DEBUG_UART
78#endif
79 .boot_params = 0x20000100, 77 .boot_params = 0x20000100,
80 .fixup = mahimahi_fixup, 78 .fixup = mahimahi_fixup,
81 .map_io = mahimahi_map_io, 79 .map_io = mahimahi_map_io,
diff --git a/arch/arm/mach-msm/board-msm7x27.c b/arch/arm/mach-msm/board-msm7x27.c
index e7a76eff57d9..c03f269e2e4b 100644
--- a/arch/arm/mach-msm/board-msm7x27.c
+++ b/arch/arm/mach-msm/board-msm7x27.c
@@ -130,9 +130,7 @@ static void __init msm7x2x_map_io(void)
130} 130}
131 131
132MACHINE_START(MSM7X27_SURF, "QCT MSM7x27 SURF") 132MACHINE_START(MSM7X27_SURF, "QCT MSM7x27 SURF")
133#ifdef CONFIG_MSM_DEBUG_UART 133 .boot_params = PLAT_PHYS_OFFSET + 0x100,
134#endif
135 .boot_params = PHYS_OFFSET + 0x100,
136 .map_io = msm7x2x_map_io, 134 .map_io = msm7x2x_map_io,
137 .init_irq = msm7x2x_init_irq, 135 .init_irq = msm7x2x_init_irq,
138 .init_machine = msm7x2x_init, 136 .init_machine = msm7x2x_init,
@@ -140,9 +138,7 @@ MACHINE_START(MSM7X27_SURF, "QCT MSM7x27 SURF")
140MACHINE_END 138MACHINE_END
141 139
142MACHINE_START(MSM7X27_FFA, "QCT MSM7x27 FFA") 140MACHINE_START(MSM7X27_FFA, "QCT MSM7x27 FFA")
143#ifdef CONFIG_MSM_DEBUG_UART 141 .boot_params = PLAT_PHYS_OFFSET + 0x100,
144#endif
145 .boot_params = PHYS_OFFSET + 0x100,
146 .map_io = msm7x2x_map_io, 142 .map_io = msm7x2x_map_io,
147 .init_irq = msm7x2x_init_irq, 143 .init_irq = msm7x2x_init_irq,
148 .init_machine = msm7x2x_init, 144 .init_machine = msm7x2x_init,
@@ -150,9 +146,7 @@ MACHINE_START(MSM7X27_FFA, "QCT MSM7x27 FFA")
150MACHINE_END 146MACHINE_END
151 147
152MACHINE_START(MSM7X25_SURF, "QCT MSM7x25 SURF") 148MACHINE_START(MSM7X25_SURF, "QCT MSM7x25 SURF")
153#ifdef CONFIG_MSM_DEBUG_UART 149 .boot_params = PLAT_PHYS_OFFSET + 0x100,
154#endif
155 .boot_params = PHYS_OFFSET + 0x100,
156 .map_io = msm7x2x_map_io, 150 .map_io = msm7x2x_map_io,
157 .init_irq = msm7x2x_init_irq, 151 .init_irq = msm7x2x_init_irq,
158 .init_machine = msm7x2x_init, 152 .init_machine = msm7x2x_init,
@@ -160,9 +154,7 @@ MACHINE_START(MSM7X25_SURF, "QCT MSM7x25 SURF")
160MACHINE_END 154MACHINE_END
161 155
162MACHINE_START(MSM7X25_FFA, "QCT MSM7x25 FFA") 156MACHINE_START(MSM7X25_FFA, "QCT MSM7x25 FFA")
163#ifdef CONFIG_MSM_DEBUG_UART 157 .boot_params = PLAT_PHYS_OFFSET + 0x100,
164#endif
165 .boot_params = PHYS_OFFSET + 0x100,
166 .map_io = msm7x2x_map_io, 158 .map_io = msm7x2x_map_io,
167 .init_irq = msm7x2x_init_irq, 159 .init_irq = msm7x2x_init_irq,
168 .init_machine = msm7x2x_init, 160 .init_machine = msm7x2x_init,
diff --git a/arch/arm/mach-msm/board-msm7x30.c b/arch/arm/mach-msm/board-msm7x30.c
index 6f3b9735e970..b7a84966b711 100644
--- a/arch/arm/mach-msm/board-msm7x30.c
+++ b/arch/arm/mach-msm/board-msm7x30.c
@@ -23,19 +23,21 @@
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/smsc911x.h> 24#include <linux/smsc911x.h>
25#include <linux/usb/msm_hsusb.h> 25#include <linux/usb/msm_hsusb.h>
26#include <linux/clkdev.h>
26 27
27#include <asm/mach-types.h> 28#include <asm/mach-types.h>
28#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
30#include <asm/memory.h>
29#include <asm/setup.h> 31#include <asm/setup.h>
30 32
31#include <mach/gpio.h> 33#include <mach/gpio.h>
32#include <mach/board.h> 34#include <mach/board.h>
33#include <mach/memory.h>
34#include <mach/msm_iomap.h> 35#include <mach/msm_iomap.h>
35#include <mach/dma.h> 36#include <mach/dma.h>
36 37
37#include <mach/vreg.h> 38#include <mach/vreg.h>
38#include "devices.h" 39#include "devices.h"
40#include "gpiomux.h"
39#include "proc_comm.h" 41#include "proc_comm.h"
40 42
41extern struct sys_timer msm_timer; 43extern struct sys_timer msm_timer;
@@ -52,6 +54,27 @@ static struct msm_otg_platform_data msm_otg_pdata = {
52 .otg_control = OTG_PHY_CONTROL, 54 .otg_control = OTG_PHY_CONTROL,
53}; 55};
54 56
57struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] = {
58#ifdef CONFIG_SERIAL_MSM_CONSOLE
59 [49] = { /* UART2 RFR */
60 .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN |
61 GPIOMUX_FUNC_2 | GPIOMUX_VALID,
62 },
63 [50] = { /* UART2 CTS */
64 .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN |
65 GPIOMUX_FUNC_2 | GPIOMUX_VALID,
66 },
67 [51] = { /* UART2 RX */
68 .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN |
69 GPIOMUX_FUNC_2 | GPIOMUX_VALID,
70 },
71 [52] = { /* UART2 TX */
72 .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN |
73 GPIOMUX_FUNC_2 | GPIOMUX_VALID,
74 },
75#endif
76};
77
55static struct platform_device *devices[] __initdata = { 78static struct platform_device *devices[] __initdata = {
56#if defined(CONFIG_SERIAL_MSM) || defined(CONFIG_MSM_SERIAL_DEBUGGER) 79#if defined(CONFIG_SERIAL_MSM) || defined(CONFIG_MSM_SERIAL_DEBUGGER)
57 &msm_device_uart2, 80 &msm_device_uart2,
@@ -83,9 +106,7 @@ static void __init msm7x30_map_io(void)
83} 106}
84 107
85MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF") 108MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF")
86#ifdef CONFIG_MSM_DEBUG_UART 109 .boot_params = PLAT_PHYS_OFFSET + 0x100,
87#endif
88 .boot_params = PHYS_OFFSET + 0x100,
89 .map_io = msm7x30_map_io, 110 .map_io = msm7x30_map_io,
90 .init_irq = msm7x30_init_irq, 111 .init_irq = msm7x30_init_irq,
91 .init_machine = msm7x30_init, 112 .init_machine = msm7x30_init,
@@ -93,9 +114,7 @@ MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF")
93MACHINE_END 114MACHINE_END
94 115
95MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA") 116MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA")
96#ifdef CONFIG_MSM_DEBUG_UART 117 .boot_params = PLAT_PHYS_OFFSET + 0x100,
97#endif
98 .boot_params = PHYS_OFFSET + 0x100,
99 .map_io = msm7x30_map_io, 118 .map_io = msm7x30_map_io,
100 .init_irq = msm7x30_init_irq, 119 .init_irq = msm7x30_init_irq,
101 .init_machine = msm7x30_init, 120 .init_machine = msm7x30_init,
@@ -103,9 +122,7 @@ MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA")
103MACHINE_END 122MACHINE_END
104 123
105MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID") 124MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID")
106#ifdef CONFIG_MSM_DEBUG_UART 125 .boot_params = PLAT_PHYS_OFFSET + 0x100,
107#endif
108 .boot_params = PHYS_OFFSET + 0x100,
109 .map_io = msm7x30_map_io, 126 .map_io = msm7x30_map_io,
110 .init_irq = msm7x30_init_irq, 127 .init_irq = msm7x30_init_irq,
111 .init_machine = msm7x30_init, 128 .init_machine = msm7x30_init,
diff --git a/arch/arm/mach-msm/board-msm8960.c b/arch/arm/mach-msm/board-msm8960.c
new file mode 100644
index 000000000000..1993721d472e
--- /dev/null
+++ b/arch/arm/mach-msm/board-msm8960.c
@@ -0,0 +1,91 @@
1/* Copyright (c) 2011, 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 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15 * 02110-1301, USA.
16 *
17 */
18#include <linux/kernel.h>
19#include <linux/platform_device.h>
20#include <linux/io.h>
21#include <linux/irq.h>
22#include <linux/clkdev.h>
23
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26#include <asm/hardware/gic.h>
27
28#include <mach/board.h>
29#include <mach/msm_iomap.h>
30
31#include "devices.h"
32
33static void __init msm8960_map_io(void)
34{
35 msm_map_msm8960_io();
36}
37
38static void __init msm8960_init_irq(void)
39{
40 unsigned int i;
41 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
42 (void *)MSM_QGIC_CPU_BASE);
43
44 /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */
45 writel(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
46
47 if (machine_is_msm8960_rumi3())
48 writel(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET);
49
50 /* FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet
51 * as they are configured as level, which does not play nice with
52 * handle_percpu_irq.
53 */
54 for (i = GIC_PPI_START; i < GIC_SPI_START; i++) {
55 if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE)
56 set_irq_handler(i, handle_percpu_irq);
57 }
58}
59
60static struct platform_device *sim_devices[] __initdata = {
61 &msm8960_device_uart_gsbi2,
62};
63
64static struct platform_device *rumi3_devices[] __initdata = {
65 &msm8960_device_uart_gsbi5,
66};
67
68static void __init msm8960_sim_init(void)
69{
70 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
71}
72
73static void __init msm8960_rumi3_init(void)
74{
75 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
76}
77
78MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
79 .map_io = msm8960_map_io,
80 .init_irq = msm8960_init_irq,
81 .timer = &msm_timer,
82 .init_machine = msm8960_sim_init,
83MACHINE_END
84
85MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
86 .map_io = msm8960_map_io,
87 .init_irq = msm8960_init_irq,
88 .timer = &msm_timer,
89 .init_machine = msm8960_rumi3_init,
90MACHINE_END
91
diff --git a/arch/arm/mach-msm/board-msm8x60.c b/arch/arm/mach-msm/board-msm8x60.c
index 9b5eb2b4ae1b..b3c55f138fce 100644
--- a/arch/arm/mach-msm/board-msm8x60.c
+++ b/arch/arm/mach-msm/board-msm8x60.c
@@ -28,10 +28,6 @@
28#include <mach/board.h> 28#include <mach/board.h>
29#include <mach/msm_iomap.h> 29#include <mach/msm_iomap.h>
30 30
31unsigned long clk_get_max_axi_khz(void)
32{
33 return 0;
34}
35 31
36static void __init msm8x60_map_io(void) 32static void __init msm8x60_map_io(void)
37{ 33{
diff --git a/arch/arm/mach-msm/board-qsd8x50.c b/arch/arm/mach-msm/board-qsd8x50.c
index 6dde8185205f..7f568611547e 100644
--- a/arch/arm/mach-msm/board-qsd8x50.c
+++ b/arch/arm/mach-msm/board-qsd8x50.c
@@ -1,4 +1,4 @@
1/* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved. 1/* Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved.
2 * 2 *
3 * This program is free software; you can redistribute it and/or modify 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 4 * it under the terms of the GNU General Public License version 2 and
@@ -21,6 +21,8 @@
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/delay.h> 22#include <linux/delay.h>
23#include <linux/usb/msm_hsusb.h> 23#include <linux/usb/msm_hsusb.h>
24#include <linux/err.h>
25#include <linux/clkdev.h>
24 26
25#include <asm/mach-types.h> 27#include <asm/mach-types.h>
26#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
@@ -31,6 +33,8 @@
31#include <mach/irqs.h> 33#include <mach/irqs.h>
32#include <mach/sirc.h> 34#include <mach/sirc.h>
33#include <mach/gpio.h> 35#include <mach/gpio.h>
36#include <mach/vreg.h>
37#include <mach/mmc.h>
34 38
35#include "devices.h" 39#include "devices.h"
36 40
@@ -95,6 +99,81 @@ static struct platform_device *devices[] __initdata = {
95 &msm_device_hsusb_host, 99 &msm_device_hsusb_host,
96}; 100};
97 101
102static struct msm_mmc_gpio sdc1_gpio_cfg[] = {
103 {51, "sdc1_dat_3"},
104 {52, "sdc1_dat_2"},
105 {53, "sdc1_dat_1"},
106 {54, "sdc1_dat_0"},
107 {55, "sdc1_cmd"},
108 {56, "sdc1_clk"}
109};
110
111static struct vreg *vreg_mmc;
112static unsigned long vreg_sts;
113
114static uint32_t msm_sdcc_setup_power(struct device *dv, unsigned int vdd)
115{
116 int rc = 0;
117 struct platform_device *pdev;
118
119 pdev = container_of(dv, struct platform_device, dev);
120
121 if (vdd == 0) {
122 if (!vreg_sts)
123 return 0;
124
125 clear_bit(pdev->id, &vreg_sts);
126
127 if (!vreg_sts) {
128 rc = vreg_disable(vreg_mmc);
129 if (rc)
130 pr_err("vreg_mmc disable failed for slot "
131 "%d: %d\n", pdev->id, rc);
132 }
133 return 0;
134 }
135
136 if (!vreg_sts) {
137 rc = vreg_set_level(vreg_mmc, 2900);
138 if (rc)
139 pr_err("vreg_mmc set level failed for slot %d: %d\n",
140 pdev->id, rc);
141 rc = vreg_enable(vreg_mmc);
142 if (rc)
143 pr_err("vreg_mmc enable failed for slot %d: %d\n",
144 pdev->id, rc);
145 }
146 set_bit(pdev->id, &vreg_sts);
147 return 0;
148}
149
150static struct msm_mmc_gpio_data sdc1_gpio = {
151 .gpio = sdc1_gpio_cfg,
152 .size = ARRAY_SIZE(sdc1_gpio_cfg),
153};
154
155static struct msm_mmc_platform_data qsd8x50_sdc1_data = {
156 .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
157 .translate_vdd = msm_sdcc_setup_power,
158 .gpio_data = &sdc1_gpio,
159};
160
161static void __init qsd8x50_init_mmc(void)
162{
163 if (machine_is_qsd8x50_ffa() || machine_is_qsd8x50a_ffa())
164 vreg_mmc = vreg_get(NULL, "gp6");
165 else
166 vreg_mmc = vreg_get(NULL, "gp5");
167
168 if (IS_ERR(vreg_mmc)) {
169 pr_err("vreg get for vreg_mmc failed (%ld)\n",
170 PTR_ERR(vreg_mmc));
171 return;
172 }
173
174 msm_add_sdcc(1, &qsd8x50_sdc1_data, 0, 0);
175}
176
98static void __init qsd8x50_map_io(void) 177static void __init qsd8x50_map_io(void)
99{ 178{
100 msm_map_qsd8x50_io(); 179 msm_map_qsd8x50_io();
@@ -113,12 +192,11 @@ static void __init qsd8x50_init(void)
113 msm_device_hsusb.dev.parent = &msm_device_otg.dev; 192 msm_device_hsusb.dev.parent = &msm_device_otg.dev;
114 msm_device_hsusb_host.dev.parent = &msm_device_otg.dev; 193 msm_device_hsusb_host.dev.parent = &msm_device_otg.dev;
115 platform_add_devices(devices, ARRAY_SIZE(devices)); 194 platform_add_devices(devices, ARRAY_SIZE(devices));
195 qsd8x50_init_mmc();
116} 196}
117 197
118MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF") 198MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF")
119#ifdef CONFIG_MSM_DEBUG_UART 199 .boot_params = PLAT_PHYS_OFFSET + 0x100,
120#endif
121 .boot_params = PHYS_OFFSET + 0x100,
122 .map_io = qsd8x50_map_io, 200 .map_io = qsd8x50_map_io,
123 .init_irq = qsd8x50_init_irq, 201 .init_irq = qsd8x50_init_irq,
124 .init_machine = qsd8x50_init, 202 .init_machine = qsd8x50_init,
@@ -126,9 +204,7 @@ MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF")
126MACHINE_END 204MACHINE_END
127 205
128MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5") 206MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5")
129#ifdef CONFIG_MSM_DEBUG_UART 207 .boot_params = PLAT_PHYS_OFFSET + 0x100,
130#endif
131 .boot_params = PHYS_OFFSET + 0x100,
132 .map_io = qsd8x50_map_io, 208 .map_io = qsd8x50_map_io,
133 .init_irq = qsd8x50_init_irq, 209 .init_irq = qsd8x50_init_irq,
134 .init_machine = qsd8x50_init, 210 .init_machine = qsd8x50_init,
diff --git a/arch/arm/mach-msm/board-sapphire.c b/arch/arm/mach-msm/board-sapphire.c
index 8919ffb17196..68f930f07d77 100644
--- a/arch/arm/mach-msm/board-sapphire.c
+++ b/arch/arm/mach-msm/board-sapphire.c
@@ -105,9 +105,7 @@ static void __init sapphire_map_io(void)
105 105
106MACHINE_START(SAPPHIRE, "sapphire") 106MACHINE_START(SAPPHIRE, "sapphire")
107/* Maintainer: Brian Swetland <swetland@google.com> */ 107/* Maintainer: Brian Swetland <swetland@google.com> */
108#ifdef CONFIG_MSM_DEBUG_UART 108 .boot_params = PLAT_PHYS_OFFSET + 0x100,
109#endif
110 .boot_params = PHYS_OFFSET + 0x100,
111 .fixup = sapphire_fixup, 109 .fixup = sapphire_fixup,
112 .map_io = sapphire_map_io, 110 .map_io = sapphire_map_io,
113 .init_irq = sapphire_init_irq, 111 .init_irq = sapphire_init_irq,
diff --git a/arch/arm/mach-msm/board-trout-gpio.c b/arch/arm/mach-msm/board-trout-gpio.c
index a604ec1e44bf..31117a4499c4 100644
--- a/arch/arm/mach-msm/board-trout-gpio.c
+++ b/arch/arm/mach-msm/board-trout-gpio.c
@@ -74,8 +74,6 @@ static int msm_gpiolib_direction_output(struct gpio_chip *chip,
74 74
75static int trout_gpio_to_irq(struct gpio_chip *chip, unsigned offset) 75static int trout_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
76{ 76{
77 struct msm_gpio_chip *msm_gpio = to_msm_gpio_chip(chip);
78
79 return TROUT_GPIO_TO_INT(offset + chip->base); 77 return TROUT_GPIO_TO_INT(offset + chip->base);
80} 78}
81 79
diff --git a/arch/arm/mach-msm/board-trout.c b/arch/arm/mach-msm/board-trout.c
index 73f146066542..814386772c66 100644
--- a/arch/arm/mach-msm/board-trout.c
+++ b/arch/arm/mach-msm/board-trout.c
@@ -17,6 +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/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/clkdev.h>
20 21
21#include <asm/mach-types.h> 22#include <asm/mach-types.h>
22#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
@@ -92,8 +93,6 @@ static void __init trout_map_io(void)
92} 93}
93 94
94MACHINE_START(TROUT, "HTC Dream") 95MACHINE_START(TROUT, "HTC Dream")
95#ifdef CONFIG_MSM_DEBUG_UART
96#endif
97 .boot_params = 0x10000100, 96 .boot_params = 0x10000100,
98 .fixup = trout_fixup, 97 .fixup = trout_fixup,
99 .map_io = trout_map_io, 98 .map_io = trout_map_io,
diff --git a/arch/arm/mach-msm/clock-7x30.h b/arch/arm/mach-msm/clock-7x30.h
index e16f72f32829..14104453688b 100644
--- a/arch/arm/mach-msm/clock-7x30.h
+++ b/arch/arm/mach-msm/clock-7x30.h
@@ -1,30 +1,13 @@
1/* Copyright (c) 2009, Code Aurora Forum. All rights reserved. 1/* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
2 * 2 *
3 * Redistribution and use in source and binary forms, with or without 3 * This program is free software; you can redistribute it and/or modify
4 * modification, are permitted provided that the following conditions are 4 * it under the terms of the GNU General Public License version 2 and
5 * met: 5 * only version 2 as published by the Free Software Foundation.
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above
9 * copyright notice, this list of conditions and the following
10 * disclaimer in the documentation and/or other materials provided
11 * with the distribution.
12 * * Neither the name of Code Aurora Forum, Inc. nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * 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.
28 */ 11 */
29 12
30#ifndef __ARCH_ARM_MACH_MSM_CLOCK_7X30_H 13#ifndef __ARCH_ARM_MACH_MSM_CLOCK_7X30_H
@@ -147,22 +130,26 @@ void pll_disable(uint32_t pll);
147extern int internal_pwr_rail_ctl_auto(unsigned rail_id, bool enable); 130extern int internal_pwr_rail_ctl_auto(unsigned rail_id, bool enable);
148 131
149#define CLK_7X30(clk_name, clk_id, clk_dev, clk_flags) { \ 132#define CLK_7X30(clk_name, clk_id, clk_dev, clk_flags) { \
150 .name = clk_name, \ 133 .con_id = clk_name, \
151 .id = L_7X30_##clk_id, \ 134 .dev_id = clk_dev, \
152 .remote_id = P_##clk_id, \ 135 .clk = &(struct clk){ \
153 .flags = clk_flags, \ 136 .id = L_7X30_##clk_id, \
154 .dev = clk_dev, \ 137 .remote_id = P_##clk_id, \
155 .dbg_name = #clk_id, \ 138 .flags = clk_flags, \
139 .dbg_name = #clk_id, \
140 }, \
156 } 141 }
157 142
158#define CLK_7X30S(clk_name, l_id, r_id, clk_dev, clk_flags) { \ 143#define CLK_7X30S(clk_name, l_id, r_id, clk_dev, clk_flags) { \
159 .name = clk_name, \ 144 .con_id = clk_name, \
160 .id = L_7X30_##l_id, \ 145 .dev_id = clk_dev, \
161 .remote_id = P_##r_id, \ 146 .clk = &(struct clk){ \
162 .flags = clk_flags, \ 147 .id = L_7X30_##l_id, \
163 .dev = clk_dev, \ 148 .remote_id = P_##r_id, \
164 .dbg_name = #l_id, \ 149 .flags = clk_flags, \
150 .dbg_name = #l_id, \
151 .ops = &clk_ops_pcom, \
152 }, \
165 } 153 }
166 154
167#endif 155#endif
168
diff --git a/arch/arm/mach-msm/clock-debug.c b/arch/arm/mach-msm/clock-debug.c
new file mode 100644
index 000000000000..4886404d42f5
--- /dev/null
+++ b/arch/arm/mach-msm/clock-debug.c
@@ -0,0 +1,130 @@
1/*
2 * Copyright (C) 2007 Google, Inc.
3 * Copyright (c) 2007-2010, Code Aurora Forum. All rights reserved.
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#include <linux/kernel.h>
17#include <linux/module.h>
18#include <linux/ctype.h>
19#include <linux/debugfs.h>
20#include <linux/clk.h>
21#include "clock.h"
22
23static int clock_debug_rate_set(void *data, u64 val)
24{
25 struct clk *clock = data;
26 int ret;
27
28 /* Only increases to max rate will succeed, but that's actually good
29 * for debugging purposes so we don't check for error. */
30 if (clock->flags & CLK_MAX)
31 clk_set_max_rate(clock, val);
32 if (clock->flags & CLK_MIN)
33 ret = clk_set_min_rate(clock, val);
34 else
35 ret = clk_set_rate(clock, val);
36 if (ret != 0)
37 printk(KERN_ERR "clk_set%s_rate failed (%d)\n",
38 (clock->flags & CLK_MIN) ? "_min" : "", ret);
39 return ret;
40}
41
42static int clock_debug_rate_get(void *data, u64 *val)
43{
44 struct clk *clock = data;
45 *val = clk_get_rate(clock);
46 return 0;
47}
48
49DEFINE_SIMPLE_ATTRIBUTE(clock_rate_fops, clock_debug_rate_get,
50 clock_debug_rate_set, "%llu\n");
51
52static int clock_debug_enable_set(void *data, u64 val)
53{
54 struct clk *clock = data;
55 int rc = 0;
56
57 if (val)
58 rc = clock->ops->enable(clock->id);
59 else
60 clock->ops->disable(clock->id);
61
62 return rc;
63}
64
65static int clock_debug_enable_get(void *data, u64 *val)
66{
67 struct clk *clock = data;
68
69 *val = clock->ops->is_enabled(clock->id);
70
71 return 0;
72}
73
74DEFINE_SIMPLE_ATTRIBUTE(clock_enable_fops, clock_debug_enable_get,
75 clock_debug_enable_set, "%llu\n");
76
77static int clock_debug_local_get(void *data, u64 *val)
78{
79 struct clk *clock = data;
80
81 *val = clock->ops->is_local(clock->id);
82
83 return 0;
84}
85
86DEFINE_SIMPLE_ATTRIBUTE(clock_local_fops, clock_debug_local_get,
87 NULL, "%llu\n");
88
89static struct dentry *debugfs_base;
90
91int __init clock_debug_init(void)
92{
93 debugfs_base = debugfs_create_dir("clk", NULL);
94 if (!debugfs_base)
95 return -ENOMEM;
96 return 0;
97}
98
99int __init clock_debug_add(struct clk *clock)
100{
101 char temp[50], *ptr;
102 struct dentry *clk_dir;
103
104 if (!debugfs_base)
105 return -ENOMEM;
106
107 strncpy(temp, clock->dbg_name, ARRAY_SIZE(temp)-1);
108 for (ptr = temp; *ptr; ptr++)
109 *ptr = tolower(*ptr);
110
111 clk_dir = debugfs_create_dir(temp, debugfs_base);
112 if (!clk_dir)
113 return -ENOMEM;
114
115 if (!debugfs_create_file("rate", S_IRUGO | S_IWUSR, clk_dir,
116 clock, &clock_rate_fops))
117 goto error;
118
119 if (!debugfs_create_file("enable", S_IRUGO | S_IWUSR, clk_dir,
120 clock, &clock_enable_fops))
121 goto error;
122
123 if (!debugfs_create_file("is_local", S_IRUGO, clk_dir, clock,
124 &clock_local_fops))
125 goto error;
126 return 0;
127error:
128 debugfs_remove_recursive(clk_dir);
129 return -ENOMEM;
130}
diff --git a/arch/arm/mach-msm/clock-dummy.c b/arch/arm/mach-msm/clock-dummy.c
deleted file mode 100644
index 1250d22082ee..000000000000
--- a/arch/arm/mach-msm/clock-dummy.c
+++ /dev/null
@@ -1,54 +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 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15 * 02110-1301, USA.
16 *
17 */
18#include <linux/clk.h>
19#include <linux/err.h>
20#include <linux/module.h>
21
22struct clk *clk_get(struct device *dev, const char *id)
23{
24 return ERR_PTR(-ENOENT);
25}
26EXPORT_SYMBOL(clk_get);
27
28int clk_enable(struct clk *clk)
29{
30 return -ENOENT;
31}
32EXPORT_SYMBOL(clk_enable);
33
34void clk_disable(struct clk *clk)
35{
36}
37EXPORT_SYMBOL(clk_disable);
38
39unsigned long clk_get_rate(struct clk *clk)
40{
41 return 0;
42}
43EXPORT_SYMBOL(clk_get_rate);
44
45int clk_set_rate(struct clk *clk, unsigned long rate)
46{
47 return -ENOENT;
48}
49EXPORT_SYMBOL(clk_set_rate);
50
51void clk_put(struct clk *clk)
52{
53}
54EXPORT_SYMBOL(clk_put);
diff --git a/arch/arm/mach-msm/clock-pcom.c b/arch/arm/mach-msm/clock-pcom.c
index a3b45627eb4a..63b711311086 100644
--- a/arch/arm/mach-msm/clock-pcom.c
+++ b/arch/arm/mach-msm/clock-pcom.c
@@ -20,6 +20,7 @@
20 20
21#include "proc_comm.h" 21#include "proc_comm.h"
22#include "clock.h" 22#include "clock.h"
23#include "clock-pcom.h"
23 24
24/* 25/*
25 * glue for the proc_comm interface 26 * glue for the proc_comm interface
@@ -116,6 +117,11 @@ long pc_clk_round_rate(unsigned id, unsigned rate)
116 return rate; 117 return rate;
117} 118}
118 119
120static bool pc_clk_is_local(unsigned id)
121{
122 return false;
123}
124
119struct clk_ops clk_ops_pcom = { 125struct clk_ops clk_ops_pcom = {
120 .enable = pc_clk_enable, 126 .enable = pc_clk_enable,
121 .disable = pc_clk_disable, 127 .disable = pc_clk_disable,
@@ -128,4 +134,5 @@ struct clk_ops clk_ops_pcom = {
128 .get_rate = pc_clk_get_rate, 134 .get_rate = pc_clk_get_rate,
129 .is_enabled = pc_clk_is_enabled, 135 .is_enabled = pc_clk_is_enabled,
130 .round_rate = pc_clk_round_rate, 136 .round_rate = pc_clk_round_rate,
137 .is_local = pc_clk_is_local,
131}; 138};
diff --git a/arch/arm/mach-msm/clock-pcom.h b/arch/arm/mach-msm/clock-pcom.h
index 17d027b23501..974d0032f3a3 100644
--- a/arch/arm/mach-msm/clock-pcom.h
+++ b/arch/arm/mach-msm/clock-pcom.h
@@ -1,30 +1,13 @@
1/* Copyright (c) 2009, Code Aurora Forum. All rights reserved. 1/* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
2 * 2 *
3 * Redistribution and use in source and binary forms, with or without 3 * This program is free software; you can redistribute it and/or modify
4 * modification, are permitted provided that the following conditions are 4 * it under the terms of the GNU General Public License version 2 and
5 * met: 5 * only version 2 as published by the Free Software Foundation.
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above
9 * copyright notice, this list of conditions and the following
10 * disclaimer in the documentation and/or other materials provided
11 * with the distribution.
12 * * Neither the name of Code Aurora Forum, Inc. nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * 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.
28 */ 11 */
29 12
30#ifndef __ARCH_ARM_MACH_MSM_CLOCK_PCOM_H 13#ifndef __ARCH_ARM_MACH_MSM_CLOCK_PCOM_H
@@ -132,8 +115,10 @@
132#define P_CSI1_P_CLK 97 115#define P_CSI1_P_CLK 97
133#define P_GSBI_CLK 98 116#define P_GSBI_CLK 98
134#define P_GSBI_P_CLK 99 117#define P_GSBI_P_CLK 99
118#define P_CE_CLK 100 /* Crypto engine */
119#define P_CODEC_SSBI_CLK 101
135 120
136#define P_NR_CLKS 100 121#define P_NR_CLKS 102
137 122
138struct clk_ops; 123struct clk_ops;
139extern struct clk_ops clk_ops_pcom; 124extern struct clk_ops clk_ops_pcom;
@@ -141,13 +126,15 @@ extern struct clk_ops clk_ops_pcom;
141int pc_clk_reset(unsigned id, enum clk_reset_action action); 126int pc_clk_reset(unsigned id, enum clk_reset_action action);
142 127
143#define CLK_PCOM(clk_name, clk_id, clk_dev, clk_flags) { \ 128#define CLK_PCOM(clk_name, clk_id, clk_dev, clk_flags) { \
144 .name = clk_name, \ 129 .con_id = clk_name, \
145 .id = P_##clk_id, \ 130 .dev_id = clk_dev, \
146 .remote_id = P_##clk_id, \ 131 .clk = &(struct clk){ \
147 .ops = &clk_ops_pcom, \ 132 .id = P_##clk_id, \
148 .flags = clk_flags, \ 133 .remote_id = P_##clk_id, \
149 .dev = clk_dev, \ 134 .ops = &clk_ops_pcom, \
150 .dbg_name = #clk_id, \ 135 .flags = clk_flags, \
136 .dbg_name = #clk_id, \
137 }, \
151 } 138 }
152 139
153#endif 140#endif
diff --git a/arch/arm/mach-msm/clock.c b/arch/arm/mach-msm/clock.c
index 2069bfaa3a26..22a537669624 100644
--- a/arch/arm/mach-msm/clock.c
+++ b/arch/arm/mach-msm/clock.c
@@ -15,74 +15,32 @@
15 */ 15 */
16 16
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/init.h>
19#include <linux/module.h>
20#include <linux/list.h> 18#include <linux/list.h>
21#include <linux/err.h> 19#include <linux/err.h>
22#include <linux/clk.h>
23#include <linux/spinlock.h> 20#include <linux/spinlock.h>
24#include <linux/debugfs.h>
25#include <linux/ctype.h>
26#include <linux/pm_qos_params.h> 21#include <linux/pm_qos_params.h>
27#include <mach/clk.h> 22#include <linux/mutex.h>
23#include <linux/clk.h>
24#include <linux/string.h>
25#include <linux/module.h>
26#include <linux/clkdev.h>
28 27
29#include "clock.h" 28#include "clock.h"
30#include "proc_comm.h"
31#include "clock-7x30.h"
32 29
33static DEFINE_MUTEX(clocks_mutex); 30static DEFINE_MUTEX(clocks_mutex);
34static DEFINE_SPINLOCK(clocks_lock); 31static DEFINE_SPINLOCK(clocks_lock);
35static LIST_HEAD(clocks); 32static LIST_HEAD(clocks);
36struct clk *msm_clocks;
37unsigned msm_num_clocks;
38
39/*
40 * Bitmap of enabled clocks, excluding ACPU which is always
41 * enabled
42 */
43static DECLARE_BITMAP(clock_map_enabled, NR_CLKS);
44static DEFINE_SPINLOCK(clock_map_lock);
45 33
46/* 34/*
47 * Standard clock functions defined in include/linux/clk.h 35 * Standard clock functions defined in include/linux/clk.h
48 */ 36 */
49struct clk *clk_get(struct device *dev, const char *id)
50{
51 struct clk *clk;
52
53 mutex_lock(&clocks_mutex);
54
55 list_for_each_entry(clk, &clocks, list)
56 if (!strcmp(id, clk->name) && clk->dev == dev)
57 goto found_it;
58
59 list_for_each_entry(clk, &clocks, list)
60 if (!strcmp(id, clk->name) && clk->dev == NULL)
61 goto found_it;
62
63 clk = ERR_PTR(-ENOENT);
64found_it:
65 mutex_unlock(&clocks_mutex);
66 return clk;
67}
68EXPORT_SYMBOL(clk_get);
69
70void clk_put(struct clk *clk)
71{
72}
73EXPORT_SYMBOL(clk_put);
74
75int clk_enable(struct clk *clk) 37int clk_enable(struct clk *clk)
76{ 38{
77 unsigned long flags; 39 unsigned long flags;
78 spin_lock_irqsave(&clocks_lock, flags); 40 spin_lock_irqsave(&clocks_lock, flags);
79 clk->count++; 41 clk->count++;
80 if (clk->count == 1) { 42 if (clk->count == 1)
81 clk->ops->enable(clk->id); 43 clk->ops->enable(clk->id);
82 spin_lock(&clock_map_lock);
83 clock_map_enabled[BIT_WORD(clk->id)] |= BIT_MASK(clk->id);
84 spin_unlock(&clock_map_lock);
85 }
86 spin_unlock_irqrestore(&clocks_lock, flags); 44 spin_unlock_irqrestore(&clocks_lock, flags);
87 return 0; 45 return 0;
88} 46}
@@ -94,20 +52,14 @@ void clk_disable(struct clk *clk)
94 spin_lock_irqsave(&clocks_lock, flags); 52 spin_lock_irqsave(&clocks_lock, flags);
95 BUG_ON(clk->count == 0); 53 BUG_ON(clk->count == 0);
96 clk->count--; 54 clk->count--;
97 if (clk->count == 0) { 55 if (clk->count == 0)
98 clk->ops->disable(clk->id); 56 clk->ops->disable(clk->id);
99 spin_lock(&clock_map_lock);
100 clock_map_enabled[BIT_WORD(clk->id)] &= ~BIT_MASK(clk->id);
101 spin_unlock(&clock_map_lock);
102 }
103 spin_unlock_irqrestore(&clocks_lock, flags); 57 spin_unlock_irqrestore(&clocks_lock, flags);
104} 58}
105EXPORT_SYMBOL(clk_disable); 59EXPORT_SYMBOL(clk_disable);
106 60
107int clk_reset(struct clk *clk, enum clk_reset_action action) 61int clk_reset(struct clk *clk, enum clk_reset_action action)
108{ 62{
109 if (!clk->ops->reset)
110 clk->ops->reset = &pc_clk_reset;
111 return clk->ops->reset(clk->remote_id, action); 63 return clk->ops->reset(clk->remote_id, action);
112} 64}
113EXPORT_SYMBOL(clk_reset); 65EXPORT_SYMBOL(clk_reset);
@@ -184,25 +136,14 @@ EXPORT_SYMBOL(clk_set_flags);
184 */ 136 */
185static struct clk *ebi1_clk; 137static struct clk *ebi1_clk;
186 138
187static void __init set_clock_ops(struct clk *clk) 139void __init msm_clock_init(struct clk_lookup *clock_tbl, unsigned num_clocks)
188{
189 if (!clk->ops) {
190 clk->ops = &clk_ops_pcom;
191 clk->id = clk->remote_id;
192 }
193}
194
195void __init msm_clock_init(struct clk *clock_tbl, unsigned num_clocks)
196{ 140{
197 unsigned n; 141 unsigned n;
198 142
199 spin_lock_init(&clocks_lock);
200 mutex_lock(&clocks_mutex); 143 mutex_lock(&clocks_mutex);
201 msm_clocks = clock_tbl; 144 for (n = 0; n < num_clocks; n++) {
202 msm_num_clocks = num_clocks; 145 clkdev_add(&clock_tbl[n]);
203 for (n = 0; n < msm_num_clocks; n++) { 146 list_add_tail(&clock_tbl[n].clk->list, &clocks);
204 set_clock_ops(&msm_clocks[n]);
205 list_add_tail(&msm_clocks[n].list, &clocks);
206 } 147 }
207 mutex_unlock(&clocks_mutex); 148 mutex_unlock(&clocks_mutex);
208 149
@@ -211,115 +152,6 @@ void __init msm_clock_init(struct clk *clock_tbl, unsigned num_clocks)
211 152
212} 153}
213 154
214#if defined(CONFIG_DEBUG_FS)
215static struct clk *msm_clock_get_nth(unsigned index)
216{
217 if (index < msm_num_clocks)
218 return msm_clocks + index;
219 else
220 return 0;
221}
222
223static int clock_debug_rate_set(void *data, u64 val)
224{
225 struct clk *clock = data;
226 int ret;
227
228 /* Only increases to max rate will succeed, but that's actually good
229 * for debugging purposes. So we don't check for error. */
230 if (clock->flags & CLK_MAX)
231 clk_set_max_rate(clock, val);
232 if (clock->flags & CLK_MIN)
233 ret = clk_set_min_rate(clock, val);
234 else
235 ret = clk_set_rate(clock, val);
236 if (ret != 0)
237 printk(KERN_ERR "clk_set%s_rate failed (%d)\n",
238 (clock->flags & CLK_MIN) ? "_min" : "", ret);
239 return ret;
240}
241
242static int clock_debug_rate_get(void *data, u64 *val)
243{
244 struct clk *clock = data;
245 *val = clk_get_rate(clock);
246 return 0;
247}
248
249static int clock_debug_enable_set(void *data, u64 val)
250{
251 struct clk *clock = data;
252 int rc = 0;
253
254 if (val)
255 rc = clock->ops->enable(clock->id);
256 else
257 clock->ops->disable(clock->id);
258
259 return rc;
260}
261
262static int clock_debug_enable_get(void *data, u64 *val)
263{
264 struct clk *clock = data;
265
266 *val = clock->ops->is_enabled(clock->id);
267
268 return 0;
269}
270
271static int clock_debug_local_get(void *data, u64 *val)
272{
273 struct clk *clock = data;
274
275 *val = clock->ops != &clk_ops_pcom;
276
277 return 0;
278}
279
280DEFINE_SIMPLE_ATTRIBUTE(clock_rate_fops, clock_debug_rate_get,
281 clock_debug_rate_set, "%llu\n");
282DEFINE_SIMPLE_ATTRIBUTE(clock_enable_fops, clock_debug_enable_get,
283 clock_debug_enable_set, "%llu\n");
284DEFINE_SIMPLE_ATTRIBUTE(clock_local_fops, clock_debug_local_get,
285 NULL, "%llu\n");
286
287static int __init clock_debug_init(void)
288{
289 struct dentry *dent_rate, *dent_enable, *dent_local;
290 struct clk *clock;
291 unsigned n = 0;
292 char temp[50], *ptr;
293
294 dent_rate = debugfs_create_dir("clk_rate", 0);
295 if (IS_ERR(dent_rate))
296 return PTR_ERR(dent_rate);
297
298 dent_enable = debugfs_create_dir("clk_enable", 0);
299 if (IS_ERR(dent_enable))
300 return PTR_ERR(dent_enable);
301
302 dent_local = debugfs_create_dir("clk_local", NULL);
303 if (IS_ERR(dent_local))
304 return PTR_ERR(dent_local);
305
306 while ((clock = msm_clock_get_nth(n++)) != 0) {
307 strncpy(temp, clock->dbg_name, ARRAY_SIZE(temp)-1);
308 for (ptr = temp; *ptr; ptr++)
309 *ptr = tolower(*ptr);
310 debugfs_create_file(temp, 0644, dent_rate,
311 clock, &clock_rate_fops);
312 debugfs_create_file(temp, 0644, dent_enable,
313 clock, &clock_enable_fops);
314 debugfs_create_file(temp, S_IRUGO, dent_local,
315 clock, &clock_local_fops);
316 }
317 return 0;
318}
319
320device_initcall(clock_debug_init);
321#endif
322
323/* The bootloader and/or AMSS may have left various clocks enabled. 155/* The bootloader and/or AMSS may have left various clocks enabled.
324 * Disable any clocks that belong to us (CLKFLAG_AUTO_OFF) but have 156 * Disable any clocks that belong to us (CLKFLAG_AUTO_OFF) but have
325 * not been explicitly enabled by a clk_enable() call. 157 * not been explicitly enabled by a clk_enable() call.
@@ -330,8 +162,10 @@ static int __init clock_late_init(void)
330 struct clk *clk; 162 struct clk *clk;
331 unsigned count = 0; 163 unsigned count = 0;
332 164
165 clock_debug_init();
333 mutex_lock(&clocks_mutex); 166 mutex_lock(&clocks_mutex);
334 list_for_each_entry(clk, &clocks, list) { 167 list_for_each_entry(clk, &clocks, list) {
168 clock_debug_add(clk);
335 if (clk->flags & CLKFLAG_AUTO_OFF) { 169 if (clk->flags & CLKFLAG_AUTO_OFF) {
336 spin_lock_irqsave(&clocks_lock, flags); 170 spin_lock_irqsave(&clocks_lock, flags);
337 if (!clk->count) { 171 if (!clk->count) {
diff --git a/arch/arm/mach-msm/clock.h b/arch/arm/mach-msm/clock.h
index c270b552ed13..2c007f606d29 100644
--- a/arch/arm/mach-msm/clock.h
+++ b/arch/arm/mach-msm/clock.h
@@ -17,12 +17,10 @@
17#ifndef __ARCH_ARM_MACH_MSM_CLOCK_H 17#ifndef __ARCH_ARM_MACH_MSM_CLOCK_H
18#define __ARCH_ARM_MACH_MSM_CLOCK_H 18#define __ARCH_ARM_MACH_MSM_CLOCK_H
19 19
20#include <linux/init.h>
20#include <linux/list.h> 21#include <linux/list.h>
21#include <mach/clk.h> 22#include <mach/clk.h>
22 23
23#include "clock-pcom.h"
24#include "clock-7x30.h"
25
26#define CLKFLAG_INVERT 0x00000001 24#define CLKFLAG_INVERT 0x00000001
27#define CLKFLAG_NOINVERT 0x00000002 25#define CLKFLAG_NOINVERT 0x00000002
28#define CLKFLAG_NONEST 0x00000004 26#define CLKFLAG_NONEST 0x00000004
@@ -45,6 +43,7 @@ struct clk_ops {
45 unsigned (*get_rate)(unsigned id); 43 unsigned (*get_rate)(unsigned id);
46 unsigned (*is_enabled)(unsigned id); 44 unsigned (*is_enabled)(unsigned id);
47 long (*round_rate)(unsigned id, unsigned rate); 45 long (*round_rate)(unsigned id, unsigned rate);
46 bool (*is_local)(unsigned id);
48}; 47};
49 48
50struct clk { 49struct clk {
@@ -52,58 +51,22 @@ struct clk {
52 uint32_t remote_id; 51 uint32_t remote_id;
53 uint32_t count; 52 uint32_t count;
54 uint32_t flags; 53 uint32_t flags;
55 const char *name;
56 struct clk_ops *ops; 54 struct clk_ops *ops;
57 const char *dbg_name; 55 const char *dbg_name;
58 struct list_head list; 56 struct list_head list;
59 struct device *dev;
60}; 57};
61 58
62#define A11S_CLK_CNTL_ADDR (MSM_CSR_BASE + 0x100)
63#define A11S_CLK_SEL_ADDR (MSM_CSR_BASE + 0x104)
64#define A11S_VDD_SVS_PLEVEL_ADDR (MSM_CSR_BASE + 0x124)
65
66#ifdef CONFIG_DEBUG_FS
67#define CLOCK_DBG_NAME(x) .dbg_name = x,
68#else
69#define CLOCK_DBG_NAME(x)
70#endif
71
72#define CLOCK(clk_name, clk_id, clk_dev, clk_flags) { \
73 .name = clk_name, \
74 .id = clk_id, \
75 .flags = clk_flags, \
76 .dev = clk_dev, \
77 CLOCK_DBG_NAME(#clk_id) \
78 }
79
80#define OFF CLKFLAG_AUTO_OFF 59#define OFF CLKFLAG_AUTO_OFF
81#define CLK_MIN CLKFLAG_MIN 60#define CLK_MIN CLKFLAG_MIN
82#define CLK_MAX CLKFLAG_MAX 61#define CLK_MAX CLKFLAG_MAX
83#define CLK_MINMAX (CLK_MIN | CLK_MAX) 62#define CLK_MINMAX (CLK_MIN | CLK_MAX)
84#define NR_CLKS P_NR_CLKS
85
86enum {
87 PLL_0 = 0,
88 PLL_1,
89 PLL_2,
90 PLL_3,
91 PLL_4,
92 PLL_5,
93 PLL_6,
94 NUM_PLL
95};
96
97enum clkvote_client {
98 CLKVOTE_ACPUCLK = 0,
99 CLKVOTE_PMQOS,
100 CLKVOTE_MAX,
101};
102
103int msm_clock_require_tcxo(unsigned long *reason, int nbits);
104int msm_clock_get_name(uint32_t id, char *name, uint32_t size);
105int ebi1_clk_set_min_rate(enum clkvote_client client, unsigned long rate);
106unsigned long clk_get_max_axi_khz(void);
107 63
64#ifdef CONFIG_DEBUG_FS
65int __init clock_debug_init(void);
66int __init clock_debug_add(struct clk *clock);
67#else
68static inline int __init clock_debug_init(void) { return 0; }
69static inline int __init clock_debug_add(struct clk *clock) { return 0; }
108#endif 70#endif
109 71
72#endif
diff --git a/arch/arm/mach-msm/devices-msm8x60-iommu.c b/arch/arm/mach-msm/devices-iommu.c
index f9e7bd34ec59..24030d0da6e3 100644
--- a/arch/arm/mach-msm/devices-msm8x60-iommu.c
+++ b/arch/arm/mach-msm/devices-iommu.c
@@ -1,4 +1,4 @@
1/* Copyright (c) 2010, Code Aurora Forum. All rights reserved. 1/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
2 * 2 *
3 * This program is free software; you can redistribute it and/or modify 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 4 * it under the terms of the GNU General Public License version 2 and
@@ -18,15 +18,13 @@
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/bootmem.h> 20#include <linux/bootmem.h>
21 21#include <mach/irqs.h>
22#include <mach/msm_iomap-8x60.h>
23#include <mach/irqs-8x60.h>
24#include <mach/iommu.h> 22#include <mach/iommu.h>
25 23
26static struct resource msm_iommu_jpegd_resources[] = { 24static struct resource msm_iommu_jpegd_resources[] = {
27 { 25 {
28 .start = MSM_IOMMU_JPEGD_PHYS, 26 .start = 0x07300000,
29 .end = MSM_IOMMU_JPEGD_PHYS + MSM_IOMMU_JPEGD_SIZE - 1, 27 .end = 0x07300000 + SZ_1M - 1,
30 .name = "physbase", 28 .name = "physbase",
31 .flags = IORESOURCE_MEM, 29 .flags = IORESOURCE_MEM,
32 }, 30 },
@@ -46,8 +44,8 @@ static struct resource msm_iommu_jpegd_resources[] = {
46 44
47static struct resource msm_iommu_vpe_resources[] = { 45static struct resource msm_iommu_vpe_resources[] = {
48 { 46 {
49 .start = MSM_IOMMU_VPE_PHYS, 47 .start = 0x07400000,
50 .end = MSM_IOMMU_VPE_PHYS + MSM_IOMMU_VPE_SIZE - 1, 48 .end = 0x07400000 + SZ_1M - 1,
51 .name = "physbase", 49 .name = "physbase",
52 .flags = IORESOURCE_MEM, 50 .flags = IORESOURCE_MEM,
53 }, 51 },
@@ -67,8 +65,8 @@ static struct resource msm_iommu_vpe_resources[] = {
67 65
68static struct resource msm_iommu_mdp0_resources[] = { 66static struct resource msm_iommu_mdp0_resources[] = {
69 { 67 {
70 .start = MSM_IOMMU_MDP0_PHYS, 68 .start = 0x07500000,
71 .end = MSM_IOMMU_MDP0_PHYS + MSM_IOMMU_MDP0_SIZE - 1, 69 .end = 0x07500000 + SZ_1M - 1,
72 .name = "physbase", 70 .name = "physbase",
73 .flags = IORESOURCE_MEM, 71 .flags = IORESOURCE_MEM,
74 }, 72 },
@@ -88,8 +86,8 @@ static struct resource msm_iommu_mdp0_resources[] = {
88 86
89static struct resource msm_iommu_mdp1_resources[] = { 87static struct resource msm_iommu_mdp1_resources[] = {
90 { 88 {
91 .start = MSM_IOMMU_MDP1_PHYS, 89 .start = 0x07600000,
92 .end = MSM_IOMMU_MDP1_PHYS + MSM_IOMMU_MDP1_SIZE - 1, 90 .end = 0x07600000 + SZ_1M - 1,
93 .name = "physbase", 91 .name = "physbase",
94 .flags = IORESOURCE_MEM, 92 .flags = IORESOURCE_MEM,
95 }, 93 },
@@ -109,8 +107,8 @@ static struct resource msm_iommu_mdp1_resources[] = {
109 107
110static struct resource msm_iommu_rot_resources[] = { 108static struct resource msm_iommu_rot_resources[] = {
111 { 109 {
112 .start = MSM_IOMMU_ROT_PHYS, 110 .start = 0x07700000,
113 .end = MSM_IOMMU_ROT_PHYS + MSM_IOMMU_ROT_SIZE - 1, 111 .end = 0x07700000 + SZ_1M - 1,
114 .name = "physbase", 112 .name = "physbase",
115 .flags = IORESOURCE_MEM, 113 .flags = IORESOURCE_MEM,
116 }, 114 },
@@ -130,8 +128,8 @@ static struct resource msm_iommu_rot_resources[] = {
130 128
131static struct resource msm_iommu_ijpeg_resources[] = { 129static struct resource msm_iommu_ijpeg_resources[] = {
132 { 130 {
133 .start = MSM_IOMMU_IJPEG_PHYS, 131 .start = 0x07800000,
134 .end = MSM_IOMMU_IJPEG_PHYS + MSM_IOMMU_IJPEG_SIZE - 1, 132 .end = 0x07800000 + SZ_1M - 1,
135 .name = "physbase", 133 .name = "physbase",
136 .flags = IORESOURCE_MEM, 134 .flags = IORESOURCE_MEM,
137 }, 135 },
@@ -151,8 +149,8 @@ static struct resource msm_iommu_ijpeg_resources[] = {
151 149
152static struct resource msm_iommu_vfe_resources[] = { 150static struct resource msm_iommu_vfe_resources[] = {
153 { 151 {
154 .start = MSM_IOMMU_VFE_PHYS, 152 .start = 0x07900000,
155 .end = MSM_IOMMU_VFE_PHYS + MSM_IOMMU_VFE_SIZE - 1, 153 .end = 0x07900000 + SZ_1M - 1,
156 .name = "physbase", 154 .name = "physbase",
157 .flags = IORESOURCE_MEM, 155 .flags = IORESOURCE_MEM,
158 }, 156 },
@@ -172,8 +170,8 @@ static struct resource msm_iommu_vfe_resources[] = {
172 170
173static struct resource msm_iommu_vcodec_a_resources[] = { 171static struct resource msm_iommu_vcodec_a_resources[] = {
174 { 172 {
175 .start = MSM_IOMMU_VCODEC_A_PHYS, 173 .start = 0x07A00000,
176 .end = MSM_IOMMU_VCODEC_A_PHYS + MSM_IOMMU_VCODEC_A_SIZE - 1, 174 .end = 0x07A00000 + SZ_1M - 1,
177 .name = "physbase", 175 .name = "physbase",
178 .flags = IORESOURCE_MEM, 176 .flags = IORESOURCE_MEM,
179 }, 177 },
@@ -193,8 +191,8 @@ static struct resource msm_iommu_vcodec_a_resources[] = {
193 191
194static struct resource msm_iommu_vcodec_b_resources[] = { 192static struct resource msm_iommu_vcodec_b_resources[] = {
195 { 193 {
196 .start = MSM_IOMMU_VCODEC_B_PHYS, 194 .start = 0x07B00000,
197 .end = MSM_IOMMU_VCODEC_B_PHYS + MSM_IOMMU_VCODEC_B_SIZE - 1, 195 .end = 0x07B00000 + SZ_1M - 1,
198 .name = "physbase", 196 .name = "physbase",
199 .flags = IORESOURCE_MEM, 197 .flags = IORESOURCE_MEM,
200 }, 198 },
@@ -214,8 +212,8 @@ static struct resource msm_iommu_vcodec_b_resources[] = {
214 212
215static struct resource msm_iommu_gfx3d_resources[] = { 213static struct resource msm_iommu_gfx3d_resources[] = {
216 { 214 {
217 .start = MSM_IOMMU_GFX3D_PHYS, 215 .start = 0x07C00000,
218 .end = MSM_IOMMU_GFX3D_PHYS + MSM_IOMMU_GFX3D_SIZE - 1, 216 .end = 0x07C00000 + SZ_1M - 1,
219 .name = "physbase", 217 .name = "physbase",
220 .flags = IORESOURCE_MEM, 218 .flags = IORESOURCE_MEM,
221 }, 219 },
@@ -235,8 +233,8 @@ static struct resource msm_iommu_gfx3d_resources[] = {
235 233
236static struct resource msm_iommu_gfx2d0_resources[] = { 234static struct resource msm_iommu_gfx2d0_resources[] = {
237 { 235 {
238 .start = MSM_IOMMU_GFX2D0_PHYS, 236 .start = 0x07D00000,
239 .end = MSM_IOMMU_GFX2D0_PHYS + MSM_IOMMU_GFX2D0_SIZE - 1, 237 .end = 0x07D00000 + SZ_1M - 1,
240 .name = "physbase", 238 .name = "physbase",
241 .flags = IORESOURCE_MEM, 239 .flags = IORESOURCE_MEM,
242 }, 240 },
@@ -256,8 +254,8 @@ static struct resource msm_iommu_gfx2d0_resources[] = {
256 254
257static struct resource msm_iommu_gfx2d1_resources[] = { 255static struct resource msm_iommu_gfx2d1_resources[] = {
258 { 256 {
259 .start = MSM_IOMMU_GFX2D1_PHYS, 257 .start = 0x07E00000,
260 .end = MSM_IOMMU_GFX2D1_PHYS + MSM_IOMMU_GFX2D1_SIZE - 1, 258 .end = 0x07E00000 + SZ_1M - 1,
261 .name = "physbase", 259 .name = "physbase",
262 .flags = IORESOURCE_MEM, 260 .flags = IORESOURCE_MEM,
263 }, 261 },
@@ -282,55 +280,62 @@ static struct platform_device msm_root_iommu_dev = {
282 280
283static struct msm_iommu_dev jpegd_iommu = { 281static struct msm_iommu_dev jpegd_iommu = {
284 .name = "jpegd", 282 .name = "jpegd",
285 .clk_rate = -1 283 .ncb = 2,
286}; 284};
287 285
288static struct msm_iommu_dev vpe_iommu = { 286static struct msm_iommu_dev vpe_iommu = {
289 .name = "vpe" 287 .name = "vpe",
288 .ncb = 2,
290}; 289};
291 290
292static struct msm_iommu_dev mdp0_iommu = { 291static struct msm_iommu_dev mdp0_iommu = {
293 .name = "mdp0" 292 .name = "mdp0",
293 .ncb = 2,
294}; 294};
295 295
296static struct msm_iommu_dev mdp1_iommu = { 296static struct msm_iommu_dev mdp1_iommu = {
297 .name = "mdp1" 297 .name = "mdp1",
298 .ncb = 2,
298}; 299};
299 300
300static struct msm_iommu_dev rot_iommu = { 301static struct msm_iommu_dev rot_iommu = {
301 .name = "rot" 302 .name = "rot",
303 .ncb = 2,
302}; 304};
303 305
304static struct msm_iommu_dev ijpeg_iommu = { 306static struct msm_iommu_dev ijpeg_iommu = {
305 .name = "ijpeg" 307 .name = "ijpeg",
308 .ncb = 2,
306}; 309};
307 310
308static struct msm_iommu_dev vfe_iommu = { 311static struct msm_iommu_dev vfe_iommu = {
309 .name = "vfe", 312 .name = "vfe",
310 .clk_rate = -1 313 .ncb = 2,
311}; 314};
312 315
313static struct msm_iommu_dev vcodec_a_iommu = { 316static struct msm_iommu_dev vcodec_a_iommu = {
314 .name = "vcodec_a" 317 .name = "vcodec_a",
318 .ncb = 2,
315}; 319};
316 320
317static struct msm_iommu_dev vcodec_b_iommu = { 321static struct msm_iommu_dev vcodec_b_iommu = {
318 .name = "vcodec_b" 322 .name = "vcodec_b",
323 .ncb = 2,
319}; 324};
320 325
321static struct msm_iommu_dev gfx3d_iommu = { 326static struct msm_iommu_dev gfx3d_iommu = {
322 .name = "gfx3d", 327 .name = "gfx3d",
323 .clk_rate = 27000000 328 .ncb = 3,
324}; 329};
325 330
326static struct msm_iommu_dev gfx2d0_iommu = { 331static struct msm_iommu_dev gfx2d0_iommu = {
327 .name = "gfx2d0", 332 .name = "gfx2d0",
328 .clk_rate = 27000000 333 .ncb = 2,
329}; 334};
330 335
331static struct msm_iommu_dev gfx2d1_iommu = { 336static struct msm_iommu_dev gfx2d1_iommu = {
332 .name = "gfx2d1", 337 .name = "gfx2d1",
333 .clk_rate = 27000000 338 .ncb = 2,
334}; 339};
335 340
336static struct platform_device msm_device_iommu_jpegd = { 341static struct platform_device msm_device_iommu_jpegd = {
diff --git a/arch/arm/mach-msm/devices-msm7x00.c b/arch/arm/mach-msm/devices-msm7x00.c
index fb548a8a21db..c4f5e26feb4d 100644
--- a/arch/arm/mach-msm/devices-msm7x00.c
+++ b/arch/arm/mach-msm/devices-msm7x00.c
@@ -15,6 +15,7 @@
15 15
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/clkdev.h>
18 19
19#include <mach/irqs.h> 20#include <mach/irqs.h>
20#include <mach/msm_iomap.h> 21#include <mach/msm_iomap.h>
@@ -24,8 +25,8 @@
24#include <linux/mtd/nand.h> 25#include <linux/mtd/nand.h>
25#include <linux/mtd/partitions.h> 26#include <linux/mtd/partitions.h>
26 27
27
28#include "clock.h" 28#include "clock.h"
29#include "clock-pcom.h"
29#include <mach/mmc.h> 30#include <mach/mmc.h>
30 31
31static struct resource resources_uart1[] = { 32static struct resource resources_uart1[] = {
@@ -38,6 +39,7 @@ static struct resource resources_uart1[] = {
38 .start = MSM_UART1_PHYS, 39 .start = MSM_UART1_PHYS,
39 .end = MSM_UART1_PHYS + MSM_UART1_SIZE - 1, 40 .end = MSM_UART1_PHYS + MSM_UART1_SIZE - 1,
40 .flags = IORESOURCE_MEM, 41 .flags = IORESOURCE_MEM,
42 .name = "uart_resource"
41 }, 43 },
42}; 44};
43 45
@@ -51,6 +53,7 @@ static struct resource resources_uart2[] = {
51 .start = MSM_UART2_PHYS, 53 .start = MSM_UART2_PHYS,
52 .end = MSM_UART2_PHYS + MSM_UART2_SIZE - 1, 54 .end = MSM_UART2_PHYS + MSM_UART2_SIZE - 1,
53 .flags = IORESOURCE_MEM, 55 .flags = IORESOURCE_MEM,
56 .name = "uart_resource"
54 }, 57 },
55}; 58};
56 59
@@ -64,6 +67,7 @@ static struct resource resources_uart3[] = {
64 .start = MSM_UART3_PHYS, 67 .start = MSM_UART3_PHYS,
65 .end = MSM_UART3_PHYS + MSM_UART3_SIZE - 1, 68 .end = MSM_UART3_PHYS + MSM_UART3_SIZE - 1,
66 .flags = IORESOURCE_MEM, 69 .flags = IORESOURCE_MEM,
70 .name = "uart_resource"
67 }, 71 },
68}; 72};
69 73
@@ -414,7 +418,7 @@ struct platform_device msm_device_mdp = {
414 .resource = resources_mdp, 418 .resource = resources_mdp,
415}; 419};
416 420
417struct clk msm_clocks_7x01a[] = { 421struct clk_lookup msm_clocks_7x01a[] = {
418 CLK_PCOM("adm_clk", ADM_CLK, NULL, 0), 422 CLK_PCOM("adm_clk", ADM_CLK, NULL, 0),
419 CLK_PCOM("adsp_clk", ADSP_CLK, NULL, 0), 423 CLK_PCOM("adsp_clk", ADSP_CLK, NULL, 0),
420 CLK_PCOM("ebi1_clk", EBI1_CLK, NULL, 0), 424 CLK_PCOM("ebi1_clk", EBI1_CLK, NULL, 0),
@@ -423,7 +427,7 @@ struct clk msm_clocks_7x01a[] = {
423 CLK_PCOM("emdh_clk", EMDH_CLK, NULL, OFF), 427 CLK_PCOM("emdh_clk", EMDH_CLK, NULL, OFF),
424 CLK_PCOM("gp_clk", GP_CLK, NULL, 0), 428 CLK_PCOM("gp_clk", GP_CLK, NULL, 0),
425 CLK_PCOM("grp_clk", GRP_3D_CLK, NULL, OFF), 429 CLK_PCOM("grp_clk", GRP_3D_CLK, NULL, OFF),
426 CLK_PCOM("i2c_clk", I2C_CLK, &msm_device_i2c.dev, 0), 430 CLK_PCOM("i2c_clk", I2C_CLK, "msm_i2c.0", 0),
427 CLK_PCOM("icodec_rx_clk", ICODEC_RX_CLK, NULL, 0), 431 CLK_PCOM("icodec_rx_clk", ICODEC_RX_CLK, NULL, 0),
428 CLK_PCOM("icodec_tx_clk", ICODEC_TX_CLK, NULL, 0), 432 CLK_PCOM("icodec_tx_clk", ICODEC_TX_CLK, NULL, 0),
429 CLK_PCOM("imem_clk", IMEM_CLK, NULL, OFF), 433 CLK_PCOM("imem_clk", IMEM_CLK, NULL, OFF),
@@ -433,25 +437,25 @@ struct clk msm_clocks_7x01a[] = {
433 CLK_PCOM("pcm_clk", PCM_CLK, NULL, 0), 437 CLK_PCOM("pcm_clk", PCM_CLK, NULL, 0),
434 CLK_PCOM("mddi_clk", PMDH_CLK, NULL, OFF | CLK_MINMAX), 438 CLK_PCOM("mddi_clk", PMDH_CLK, NULL, OFF | CLK_MINMAX),
435 CLK_PCOM("sdac_clk", SDAC_CLK, NULL, OFF), 439 CLK_PCOM("sdac_clk", SDAC_CLK, NULL, OFF),
436 CLK_PCOM("sdc_clk", SDC1_CLK, &msm_device_sdc1.dev, OFF), 440 CLK_PCOM("sdc_clk", SDC1_CLK, "msm_sdcc.1", OFF),
437 CLK_PCOM("sdc_pclk", SDC1_P_CLK, &msm_device_sdc1.dev, OFF), 441 CLK_PCOM("sdc_pclk", SDC1_P_CLK, "msm_sdcc.1", OFF),
438 CLK_PCOM("sdc_clk", SDC2_CLK, &msm_device_sdc2.dev, OFF), 442 CLK_PCOM("sdc_clk", SDC2_CLK, "msm_sdcc.2", OFF),
439 CLK_PCOM("sdc_pclk", SDC2_P_CLK, &msm_device_sdc2.dev, OFF), 443 CLK_PCOM("sdc_pclk", SDC2_P_CLK, "msm_sdcc.2", OFF),
440 CLK_PCOM("sdc_clk", SDC3_CLK, &msm_device_sdc3.dev, OFF), 444 CLK_PCOM("sdc_clk", SDC3_CLK, "msm_sdcc.3", OFF),
441 CLK_PCOM("sdc_pclk", SDC3_P_CLK, &msm_device_sdc3.dev, OFF), 445 CLK_PCOM("sdc_pclk", SDC3_P_CLK, "msm_sdcc.3", OFF),
442 CLK_PCOM("sdc_clk", SDC4_CLK, &msm_device_sdc4.dev, OFF), 446 CLK_PCOM("sdc_clk", SDC4_CLK, "msm_sdcc.4", OFF),
443 CLK_PCOM("sdc_pclk", SDC4_P_CLK, &msm_device_sdc4.dev, OFF), 447 CLK_PCOM("sdc_pclk", SDC4_P_CLK, "msm_sdcc.4", OFF),
444 CLK_PCOM("tsif_clk", TSIF_CLK, NULL, 0), 448 CLK_PCOM("tsif_clk", TSIF_CLK, NULL, 0),
445 CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0), 449 CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0),
446 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), 450 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0),
447 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), 451 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0),
448 CLK_PCOM("uart_clk", UART1_CLK, &msm_device_uart1.dev, OFF), 452 CLK_PCOM("uart_clk", UART1_CLK, "msm_serial.0", OFF),
449 CLK_PCOM("uart_clk", UART2_CLK, &msm_device_uart2.dev, 0), 453 CLK_PCOM("uart_clk", UART2_CLK, "msm_serial.1", 0),
450 CLK_PCOM("uart_clk", UART3_CLK, &msm_device_uart3.dev, OFF), 454 CLK_PCOM("uart_clk", UART3_CLK, "msm_serial.2", OFF),
451 CLK_PCOM("uart1dm_clk", UART1DM_CLK, NULL, OFF), 455 CLK_PCOM("uart1dm_clk", UART1DM_CLK, NULL, OFF),
452 CLK_PCOM("uart2dm_clk", UART2DM_CLK, NULL, 0), 456 CLK_PCOM("uart2dm_clk", UART2DM_CLK, NULL, 0),
453 CLK_PCOM("usb_hs_clk", USB_HS_CLK, &msm_device_hsusb.dev, OFF), 457 CLK_PCOM("usb_hs_clk", USB_HS_CLK, "msm_hsusb", OFF),
454 CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, &msm_device_hsusb.dev, OFF), 458 CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, "msm_hsusb", OFF),
455 CLK_PCOM("usb_otg_clk", USB_OTG_CLK, NULL, 0), 459 CLK_PCOM("usb_otg_clk", USB_OTG_CLK, NULL, 0),
456 CLK_PCOM("vdc_clk", VDC_CLK, NULL, OFF ), 460 CLK_PCOM("vdc_clk", VDC_CLK, NULL, OFF ),
457 CLK_PCOM("vfe_clk", VFE_CLK, NULL, OFF), 461 CLK_PCOM("vfe_clk", VFE_CLK, NULL, OFF),
diff --git a/arch/arm/mach-msm/devices-msm7x30.c b/arch/arm/mach-msm/devices-msm7x30.c
index 4e9a0ab3e937..09b4f1403824 100644
--- a/arch/arm/mach-msm/devices-msm7x30.c
+++ b/arch/arm/mach-msm/devices-msm7x30.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2008 Google, Inc. 2 * Copyright (C) 2008 Google, Inc.
3 * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved. 3 * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved.
4 * 4 *
5 * This software is licensed under the terms of the GNU General Public 5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and 6 * License version 2, as published by the Free Software Foundation, and
@@ -17,6 +17,7 @@
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18 18
19#include <linux/dma-mapping.h> 19#include <linux/dma-mapping.h>
20#include <linux/clkdev.h>
20#include <mach/irqs.h> 21#include <mach/irqs.h>
21#include <mach/msm_iomap.h> 22#include <mach/msm_iomap.h>
22#include <mach/dma.h> 23#include <mach/dma.h>
@@ -28,6 +29,7 @@
28#include <asm/mach/flash.h> 29#include <asm/mach/flash.h>
29 30
30#include "clock-pcom.h" 31#include "clock-pcom.h"
32#include "clock-7x30.h"
31 33
32#include <mach/mmc.h> 34#include <mach/mmc.h>
33 35
@@ -41,6 +43,7 @@ static struct resource resources_uart2[] = {
41 .start = MSM_UART2_PHYS, 43 .start = MSM_UART2_PHYS,
42 .end = MSM_UART2_PHYS + MSM_UART2_SIZE - 1, 44 .end = MSM_UART2_PHYS + MSM_UART2_SIZE - 1,
43 .flags = IORESOURCE_MEM, 45 .flags = IORESOURCE_MEM,
46 .name = "uart_resource"
44 }, 47 },
45}; 48};
46 49
@@ -127,11 +130,13 @@ struct platform_device msm_device_hsusb_host = {
127 }, 130 },
128}; 131};
129 132
130struct clk msm_clocks_7x30[] = { 133struct clk_lookup msm_clocks_7x30[] = {
131 CLK_PCOM("adm_clk", ADM_CLK, NULL, 0), 134 CLK_PCOM("adm_clk", ADM_CLK, NULL, 0),
132 CLK_PCOM("adsp_clk", ADSP_CLK, NULL, 0), 135 CLK_PCOM("adsp_clk", ADSP_CLK, NULL, 0),
133 CLK_PCOM("cam_m_clk", CAM_M_CLK, NULL, 0), 136 CLK_PCOM("cam_m_clk", CAM_M_CLK, NULL, 0),
134 CLK_PCOM("camif_pad_pclk", CAMIF_PAD_P_CLK, NULL, OFF), 137 CLK_PCOM("camif_pad_pclk", CAMIF_PAD_P_CLK, NULL, OFF),
138 CLK_PCOM("ce_clk", CE_CLK, NULL, 0),
139 CLK_PCOM("codec_ssbi_clk", CODEC_SSBI_CLK, NULL, 0),
135 CLK_PCOM("ebi1_clk", EBI1_CLK, NULL, CLK_MIN), 140 CLK_PCOM("ebi1_clk", EBI1_CLK, NULL, CLK_MIN),
136 CLK_PCOM("ecodec_clk", ECODEC_CLK, NULL, 0), 141 CLK_PCOM("ecodec_clk", ECODEC_CLK, NULL, 0),
137 CLK_PCOM("emdh_clk", EMDH_CLK, NULL, OFF | CLK_MINMAX), 142 CLK_PCOM("emdh_clk", EMDH_CLK, NULL, OFF | CLK_MINMAX),
@@ -177,7 +182,7 @@ struct clk msm_clocks_7x30[] = {
177 CLK_7X30S("tv_src_clk", TV_CLK, TV_ENC_CLK, NULL, 0), 182 CLK_7X30S("tv_src_clk", TV_CLK, TV_ENC_CLK, NULL, 0),
178 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), 183 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0),
179 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), 184 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0),
180 CLK_PCOM("uart_clk", UART2_CLK, &msm_device_uart2.dev, 0), 185 CLK_PCOM("uart_clk", UART2_CLK, "msm_serial.1", 0),
181 CLK_PCOM("usb_phy_clk", USB_PHY_CLK, NULL, 0), 186 CLK_PCOM("usb_phy_clk", USB_PHY_CLK, NULL, 0),
182 CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF), 187 CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF),
183 CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, NULL, OFF), 188 CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, NULL, OFF),
diff --git a/arch/arm/mach-msm/devices-msm8960.c b/arch/arm/mach-msm/devices-msm8960.c
new file mode 100644
index 000000000000..d9e1f26475de
--- /dev/null
+++ b/arch/arm/mach-msm/devices-msm8960.c
@@ -0,0 +1,85 @@
1/* Copyright (c) 2011, 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 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15 * 02110-1301, USA.
16 */
17
18#include <linux/kernel.h>
19#include <linux/platform_device.h>
20
21#include <linux/dma-mapping.h>
22#include <mach/irqs-8960.h>
23#include <mach/board.h>
24
25#include "devices.h"
26
27#define MSM_GSBI2_PHYS 0x16100000
28#define MSM_UART2DM_PHYS (MSM_GSBI2_PHYS + 0x40000)
29
30#define MSM_GSBI5_PHYS 0x16400000
31#define MSM_UART5DM_PHYS (MSM_GSBI5_PHYS + 0x40000)
32
33static struct resource resources_uart_gsbi2[] = {
34 {
35 .start = GSBI2_UARTDM_IRQ,
36 .end = GSBI2_UARTDM_IRQ,
37 .flags = IORESOURCE_IRQ,
38 },
39 {
40 .start = MSM_UART2DM_PHYS,
41 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
42 .name = "uart_resource",
43 .flags = IORESOURCE_MEM,
44 },
45 {
46 .start = MSM_GSBI2_PHYS,
47 .end = MSM_GSBI2_PHYS + PAGE_SIZE - 1,
48 .name = "gsbi_resource",
49 .flags = IORESOURCE_MEM,
50 },
51};
52
53struct platform_device msm8960_device_uart_gsbi2 = {
54 .name = "msm_serial",
55 .id = 0,
56 .num_resources = ARRAY_SIZE(resources_uart_gsbi2),
57 .resource = resources_uart_gsbi2,
58};
59
60static struct resource resources_uart_gsbi5[] = {
61 {
62 .start = GSBI5_UARTDM_IRQ,
63 .end = GSBI5_UARTDM_IRQ,
64 .flags = IORESOURCE_IRQ,
65 },
66 {
67 .start = MSM_UART5DM_PHYS,
68 .end = MSM_UART5DM_PHYS + PAGE_SIZE - 1,
69 .name = "uart_resource",
70 .flags = IORESOURCE_MEM,
71 },
72 {
73 .start = MSM_GSBI5_PHYS,
74 .end = MSM_GSBI5_PHYS + PAGE_SIZE - 1,
75 .name = "gsbi_resource",
76 .flags = IORESOURCE_MEM,
77 },
78};
79
80struct platform_device msm8960_device_uart_gsbi5 = {
81 .name = "msm_serial",
82 .id = 0,
83 .num_resources = ARRAY_SIZE(resources_uart_gsbi5),
84 .resource = resources_uart_gsbi5,
85};
diff --git a/arch/arm/mach-msm/devices-qsd8x50.c b/arch/arm/mach-msm/devices-qsd8x50.c
index a4b798f20ccb..12d8deb78d9c 100644
--- a/arch/arm/mach-msm/devices-qsd8x50.c
+++ b/arch/arm/mach-msm/devices-qsd8x50.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2008 Google, Inc. 2 * Copyright (C) 2008 Google, Inc.
3 * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved. 3 * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved.
4 * 4 *
5 * This software is licensed under the terms of the GNU General Public 5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and 6 * License version 2, as published by the Free Software Foundation, and
@@ -15,8 +15,9 @@
15 15
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18 18#include <linux/clkdev.h>
19#include <linux/dma-mapping.h> 19#include <linux/dma-mapping.h>
20
20#include <mach/irqs.h> 21#include <mach/irqs.h>
21#include <mach/msm_iomap.h> 22#include <mach/msm_iomap.h>
22#include <mach/dma.h> 23#include <mach/dma.h>
@@ -27,6 +28,7 @@
27#include <asm/mach/flash.h> 28#include <asm/mach/flash.h>
28 29
29#include <mach/mmc.h> 30#include <mach/mmc.h>
31#include "clock-pcom.h"
30 32
31static struct resource resources_uart3[] = { 33static struct resource resources_uart3[] = {
32 { 34 {
@@ -38,6 +40,7 @@ static struct resource resources_uart3[] = {
38 .start = MSM_UART3_PHYS, 40 .start = MSM_UART3_PHYS,
39 .end = MSM_UART3_PHYS + MSM_UART3_SIZE - 1, 41 .end = MSM_UART3_PHYS + MSM_UART3_SIZE - 1,
40 .flags = IORESOURCE_MEM, 42 .flags = IORESOURCE_MEM,
43 .name = "uart_resource"
41 }, 44 },
42}; 45};
43 46
@@ -124,14 +127,204 @@ struct platform_device msm_device_hsusb_host = {
124 }, 127 },
125}; 128};
126 129
127struct clk msm_clocks_8x50[] = { 130static struct resource resources_sdc1[] = {
131 {
132 .start = MSM_SDC1_PHYS,
133 .end = MSM_SDC1_PHYS + MSM_SDC1_SIZE - 1,
134 .flags = IORESOURCE_MEM,
135 },
136 {
137 .start = INT_SDC1_0,
138 .end = INT_SDC1_0,
139 .flags = IORESOURCE_IRQ,
140 .name = "cmd_irq",
141 },
142 {
143 .start = INT_SDC1_1,
144 .end = INT_SDC1_1,
145 .flags = IORESOURCE_IRQ,
146 .name = "pio_irq",
147 },
148 {
149 .flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
150 .name = "status_irq"
151 },
152 {
153 .start = 8,
154 .end = 8,
155 .flags = IORESOURCE_DMA,
156 },
157};
158
159static struct resource resources_sdc2[] = {
160 {
161 .start = MSM_SDC2_PHYS,
162 .end = MSM_SDC2_PHYS + MSM_SDC2_SIZE - 1,
163 .flags = IORESOURCE_MEM,
164 },
165 {
166 .start = INT_SDC2_0,
167 .end = INT_SDC2_0,
168 .flags = IORESOURCE_IRQ,
169 .name = "cmd_irq",
170 },
171 {
172 .start = INT_SDC2_1,
173 .end = INT_SDC2_1,
174 .flags = IORESOURCE_IRQ,
175 .name = "pio_irq",
176 },
177 {
178 .flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
179 .name = "status_irq"
180 },
181 {
182 .start = 8,
183 .end = 8,
184 .flags = IORESOURCE_DMA,
185 },
186};
187
188static struct resource resources_sdc3[] = {
189 {
190 .start = MSM_SDC3_PHYS,
191 .end = MSM_SDC3_PHYS + MSM_SDC3_SIZE - 1,
192 .flags = IORESOURCE_MEM,
193 },
194 {
195 .start = INT_SDC3_0,
196 .end = INT_SDC3_0,
197 .flags = IORESOURCE_IRQ,
198 .name = "cmd_irq",
199 },
200 {
201 .start = INT_SDC3_1,
202 .end = INT_SDC3_1,
203 .flags = IORESOURCE_IRQ,
204 .name = "pio_irq",
205 },
206 {
207 .flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
208 .name = "status_irq"
209 },
210 {
211 .start = 8,
212 .end = 8,
213 .flags = IORESOURCE_DMA,
214 },
215};
216
217static struct resource resources_sdc4[] = {
218 {
219 .start = MSM_SDC4_PHYS,
220 .end = MSM_SDC4_PHYS + MSM_SDC4_SIZE - 1,
221 .flags = IORESOURCE_MEM,
222 },
223 {
224 .start = INT_SDC4_0,
225 .end = INT_SDC4_0,
226 .flags = IORESOURCE_IRQ,
227 .name = "cmd_irq",
228 },
229 {
230 .start = INT_SDC4_1,
231 .end = INT_SDC4_1,
232 .flags = IORESOURCE_IRQ,
233 .name = "pio_irq",
234 },
235 {
236 .flags = IORESOURCE_IRQ | IORESOURCE_DISABLED,
237 .name = "status_irq"
238 },
239 {
240 .start = 8,
241 .end = 8,
242 .flags = IORESOURCE_DMA,
243 },
244};
245
246struct platform_device msm_device_sdc1 = {
247 .name = "msm_sdcc",
248 .id = 1,
249 .num_resources = ARRAY_SIZE(resources_sdc1),
250 .resource = resources_sdc1,
251 .dev = {
252 .coherent_dma_mask = 0xffffffff,
253 },
254};
255
256struct platform_device msm_device_sdc2 = {
257 .name = "msm_sdcc",
258 .id = 2,
259 .num_resources = ARRAY_SIZE(resources_sdc2),
260 .resource = resources_sdc2,
261 .dev = {
262 .coherent_dma_mask = 0xffffffff,
263 },
264};
265
266struct platform_device msm_device_sdc3 = {
267 .name = "msm_sdcc",
268 .id = 3,
269 .num_resources = ARRAY_SIZE(resources_sdc3),
270 .resource = resources_sdc3,
271 .dev = {
272 .coherent_dma_mask = 0xffffffff,
273 },
274};
275
276struct platform_device msm_device_sdc4 = {
277 .name = "msm_sdcc",
278 .id = 4,
279 .num_resources = ARRAY_SIZE(resources_sdc4),
280 .resource = resources_sdc4,
281 .dev = {
282 .coherent_dma_mask = 0xffffffff,
283 },
284};
285
286static struct platform_device *msm_sdcc_devices[] __initdata = {
287 &msm_device_sdc1,
288 &msm_device_sdc2,
289 &msm_device_sdc3,
290 &msm_device_sdc4,
291};
292
293int __init msm_add_sdcc(unsigned int controller,
294 struct msm_mmc_platform_data *plat,
295 unsigned int stat_irq, unsigned long stat_irq_flags)
296{
297 struct platform_device *pdev;
298 struct resource *res;
299
300 if (controller < 1 || controller > 4)
301 return -EINVAL;
302
303 pdev = msm_sdcc_devices[controller-1];
304 pdev->dev.platform_data = plat;
305
306 res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "status_irq");
307 if (!res)
308 return -EINVAL;
309 else if (stat_irq) {
310 res->start = res->end = stat_irq;
311 res->flags &= ~IORESOURCE_DISABLED;
312 res->flags |= stat_irq_flags;
313 }
314
315 return platform_device_register(pdev);
316}
317
318struct clk_lookup msm_clocks_8x50[] = {
128 CLK_PCOM("adm_clk", ADM_CLK, NULL, 0), 319 CLK_PCOM("adm_clk", ADM_CLK, NULL, 0),
320 CLK_PCOM("ce_clk", CE_CLK, NULL, 0),
129 CLK_PCOM("ebi1_clk", EBI1_CLK, NULL, CLK_MIN), 321 CLK_PCOM("ebi1_clk", EBI1_CLK, NULL, CLK_MIN),
130 CLK_PCOM("ebi2_clk", EBI2_CLK, NULL, 0), 322 CLK_PCOM("ebi2_clk", EBI2_CLK, NULL, 0),
131 CLK_PCOM("ecodec_clk", ECODEC_CLK, NULL, 0), 323 CLK_PCOM("ecodec_clk", ECODEC_CLK, NULL, 0),
132 CLK_PCOM("emdh_clk", EMDH_CLK, NULL, OFF | CLK_MINMAX), 324 CLK_PCOM("emdh_clk", EMDH_CLK, NULL, OFF | CLK_MINMAX),
133 CLK_PCOM("gp_clk", GP_CLK, NULL, 0), 325 CLK_PCOM("gp_clk", GP_CLK, NULL, 0),
134 CLK_PCOM("grp_clk", GRP_3D_CLK, NULL, 0), 326 CLK_PCOM("grp_clk", GRP_3D_CLK, NULL, 0),
327 CLK_PCOM("i2c_clk", I2C_CLK, NULL, 0),
135 CLK_PCOM("icodec_rx_clk", ICODEC_RX_CLK, NULL, 0), 328 CLK_PCOM("icodec_rx_clk", ICODEC_RX_CLK, NULL, 0),
136 CLK_PCOM("icodec_tx_clk", ICODEC_TX_CLK, NULL, 0), 329 CLK_PCOM("icodec_tx_clk", ICODEC_TX_CLK, NULL, 0),
137 CLK_PCOM("imem_clk", IMEM_CLK, NULL, OFF), 330 CLK_PCOM("imem_clk", IMEM_CLK, NULL, OFF),
@@ -144,12 +337,24 @@ struct clk msm_clocks_8x50[] = {
144 CLK_PCOM("pbus_clk", PBUS_CLK, NULL, CLK_MIN), 337 CLK_PCOM("pbus_clk", PBUS_CLK, NULL, CLK_MIN),
145 CLK_PCOM("pcm_clk", PCM_CLK, NULL, 0), 338 CLK_PCOM("pcm_clk", PCM_CLK, NULL, 0),
146 CLK_PCOM("sdac_clk", SDAC_CLK, NULL, OFF), 339 CLK_PCOM("sdac_clk", SDAC_CLK, NULL, OFF),
340 CLK_PCOM("sdc_clk", SDC1_CLK, "msm_sdcc.1", OFF),
341 CLK_PCOM("sdc_pclk", SDC1_P_CLK, "msm_sdcc.1", OFF),
342 CLK_PCOM("sdc_clk", SDC2_CLK, "msm_sdcc.2", OFF),
343 CLK_PCOM("sdc_pclk", SDC2_P_CLK, "msm_sdcc.2", OFF),
344 CLK_PCOM("sdc_clk", SDC3_CLK, "msm_sdcc.3", OFF),
345 CLK_PCOM("sdc_pclk", SDC3_P_CLK, "msm_sdcc.3", OFF),
346 CLK_PCOM("sdc_clk", SDC4_CLK, "msm_sdcc.4", OFF),
347 CLK_PCOM("sdc_pclk", SDC4_P_CLK, "msm_sdcc.4", OFF),
147 CLK_PCOM("spi_clk", SPI_CLK, NULL, 0), 348 CLK_PCOM("spi_clk", SPI_CLK, NULL, 0),
148 CLK_PCOM("tsif_clk", TSIF_CLK, NULL, 0), 349 CLK_PCOM("tsif_clk", TSIF_CLK, NULL, 0),
149 CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0), 350 CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0),
150 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), 351 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0),
151 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), 352 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0),
152 CLK_PCOM("uart_clk", UART3_CLK, &msm_device_uart3.dev, OFF), 353 CLK_PCOM("uart_clk", UART1_CLK, NULL, OFF),
354 CLK_PCOM("uart_clk", UART2_CLK, NULL, 0),
355 CLK_PCOM("uart_clk", UART3_CLK, "msm_serial.2", OFF),
356 CLK_PCOM("uartdm_clk", UART1DM_CLK, NULL, OFF),
357 CLK_PCOM("uartdm_clk", UART2DM_CLK, NULL, 0),
153 CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF), 358 CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF),
154 CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, NULL, OFF), 359 CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, NULL, OFF),
155 CLK_PCOM("usb_otg_clk", USB_OTG_CLK, NULL, 0), 360 CLK_PCOM("usb_otg_clk", USB_OTG_CLK, NULL, 0),
diff --git a/arch/arm/mach-msm/devices.h b/arch/arm/mach-msm/devices.h
index 87c70bfce2bd..9545c196c6e8 100644
--- a/arch/arm/mach-msm/devices.h
+++ b/arch/arm/mach-msm/devices.h
@@ -16,12 +16,17 @@
16#ifndef __ARCH_ARM_MACH_MSM_DEVICES_H 16#ifndef __ARCH_ARM_MACH_MSM_DEVICES_H
17#define __ARCH_ARM_MACH_MSM_DEVICES_H 17#define __ARCH_ARM_MACH_MSM_DEVICES_H
18 18
19#include <linux/clkdev.h>
20
19#include "clock.h" 21#include "clock.h"
20 22
21extern struct platform_device msm_device_uart1; 23extern struct platform_device msm_device_uart1;
22extern struct platform_device msm_device_uart2; 24extern struct platform_device msm_device_uart2;
23extern struct platform_device msm_device_uart3; 25extern struct platform_device msm_device_uart3;
24 26
27extern struct platform_device msm8960_device_uart_gsbi2;
28extern struct platform_device msm8960_device_uart_gsbi5;
29
25extern struct platform_device msm_device_sdc1; 30extern struct platform_device msm_device_sdc1;
26extern struct platform_device msm_device_sdc2; 31extern struct platform_device msm_device_sdc2;
27extern struct platform_device msm_device_sdc3; 32extern struct platform_device msm_device_sdc3;
@@ -41,13 +46,13 @@ extern struct platform_device msm_device_mddi0;
41extern struct platform_device msm_device_mddi1; 46extern struct platform_device msm_device_mddi1;
42extern struct platform_device msm_device_mdp; 47extern struct platform_device msm_device_mdp;
43 48
44extern struct clk msm_clocks_7x01a[]; 49extern struct clk_lookup msm_clocks_7x01a[];
45extern unsigned msm_num_clocks_7x01a; 50extern unsigned msm_num_clocks_7x01a;
46 51
47extern struct clk msm_clocks_7x30[]; 52extern struct clk_lookup msm_clocks_7x30[];
48extern unsigned msm_num_clocks_7x30; 53extern unsigned msm_num_clocks_7x30;
49 54
50extern struct clk msm_clocks_8x50[]; 55extern struct clk_lookup msm_clocks_8x50[];
51extern unsigned msm_num_clocks_8x50; 56extern unsigned msm_num_clocks_8x50;
52 57
53#endif 58#endif
diff --git a/arch/arm/mach-msm/gpiomux-7x30.c b/arch/arm/mach-msm/gpiomux-7x30.c
deleted file mode 100644
index 6ce41c5241a5..000000000000
--- a/arch/arm/mach-msm/gpiomux-7x30.c
+++ /dev/null
@@ -1,38 +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 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15 * 02110-1301, USA.
16 */
17#include "gpiomux.h"
18
19struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] = {
20#ifdef CONFIG_SERIAL_MSM_CONSOLE
21 [49] = { /* UART2 RFR */
22 .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN |
23 GPIOMUX_FUNC_2 | GPIOMUX_VALID,
24 },
25 [50] = { /* UART2 CTS */
26 .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN |
27 GPIOMUX_FUNC_2 | GPIOMUX_VALID,
28 },
29 [51] = { /* UART2 RX */
30 .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN |
31 GPIOMUX_FUNC_2 | GPIOMUX_VALID,
32 },
33 [52] = { /* UART2 TX */
34 .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN |
35 GPIOMUX_FUNC_2 | GPIOMUX_VALID,
36 },
37#endif
38};
diff --git a/arch/arm/mach-msm/gpiomux-8x50.c b/arch/arm/mach-msm/gpiomux-8x50.c
index 4406e0f4ae95..f7a4ea593c95 100644
--- a/arch/arm/mach-msm/gpiomux-8x50.c
+++ b/arch/arm/mach-msm/gpiomux-8x50.c
@@ -16,6 +16,19 @@
16 */ 16 */
17#include "gpiomux.h" 17#include "gpiomux.h"
18 18
19#if defined(CONFIG_MMC_MSM) || defined(CONFIG_MMC_MSM_MODULE)
20 #define SDCC_DAT_0_3_CMD_ACTV_CFG (GPIOMUX_VALID | GPIOMUX_PULL_UP\
21 | GPIOMUX_FUNC_1 | GPIOMUX_DRV_8MA)
22 #define SDCC_CLK_ACTV_CFG (GPIOMUX_VALID | GPIOMUX_PULL_NONE\
23 | GPIOMUX_FUNC_1 | GPIOMUX_DRV_8MA)
24#else
25 #define SDCC_DAT_0_3_CMD_ACTV_CFG 0
26 #define SDCC_CLK_ACTV_CFG 0
27#endif
28
29#define SDC1_SUSPEND_CONFIG (GPIOMUX_VALID | GPIOMUX_PULL_DOWN\
30 | GPIOMUX_FUNC_GPIO | GPIOMUX_DRV_2MA)
31
19struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] = { 32struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] = {
20 [86] = { /* UART3 RX */ 33 [86] = { /* UART3 RX */
21 .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN | 34 .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN |
@@ -25,4 +38,14 @@ struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] = {
25 .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN | 38 .suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN |
26 GPIOMUX_FUNC_1 | GPIOMUX_VALID, 39 GPIOMUX_FUNC_1 | GPIOMUX_VALID,
27 }, 40 },
41 /* SDC1 data[3:0] & CMD */
42 [51 ... 55] = {
43 .active = SDCC_DAT_0_3_CMD_ACTV_CFG,
44 .suspended = SDC1_SUSPEND_CONFIG
45 },
46 /* SDC1 CLK */
47 [56] = {
48 .active = SDCC_CLK_ACTV_CFG,
49 .suspended = SDC1_SUSPEND_CONFIG
50 },
28}; 51};
diff --git a/arch/arm/mach-msm/headsmp.S b/arch/arm/mach-msm/headsmp.S
index d0c214338df9..0c631a9f8647 100644
--- a/arch/arm/mach-msm/headsmp.S
+++ b/arch/arm/mach-msm/headsmp.S
@@ -11,7 +11,7 @@
11#include <linux/linkage.h> 11#include <linux/linkage.h>
12#include <linux/init.h> 12#include <linux/init.h>
13 13
14 __INIT 14 __CPUINIT
15 15
16/* 16/*
17 * MSM specific entry point for secondary CPUs. This provides 17 * MSM specific entry point for secondary CPUs. This provides
diff --git a/arch/arm/mach-msm/include/mach/board.h b/arch/arm/mach-msm/include/mach/board.h
index 6abf4a6eadc1..2ce8f1f2fc4d 100644
--- a/arch/arm/mach-msm/include/mach/board.h
+++ b/arch/arm/mach-msm/include/mach/board.h
@@ -31,7 +31,7 @@ struct msm_acpu_clock_platform_data
31 unsigned long wait_for_irq_khz; 31 unsigned long wait_for_irq_khz;
32}; 32};
33 33
34struct clk; 34struct clk_lookup;
35 35
36extern struct sys_timer msm_timer; 36extern struct sys_timer msm_timer;
37 37
@@ -41,7 +41,7 @@ void __init msm_add_devices(void);
41void __init msm_map_common_io(void); 41void __init msm_map_common_io(void);
42void __init msm_init_irq(void); 42void __init msm_init_irq(void);
43void __init msm_init_gpio(void); 43void __init msm_init_gpio(void);
44void __init msm_clock_init(struct clk *clock_tbl, unsigned num_clocks); 44void __init msm_clock_init(struct clk_lookup *clock_tbl, unsigned num_clocks);
45void __init msm_acpu_clock_init(struct msm_acpu_clock_platform_data *); 45void __init msm_acpu_clock_init(struct msm_acpu_clock_platform_data *);
46int __init msm_add_sdcc(unsigned int controller, 46int __init msm_add_sdcc(unsigned int controller,
47 struct msm_mmc_platform_data *plat, 47 struct msm_mmc_platform_data *plat,
diff --git a/arch/arm/mach-msm/include/mach/clk.h b/arch/arm/mach-msm/include/mach/clk.h
index c05ca40478c7..e8d38428d813 100644
--- a/arch/arm/mach-msm/include/mach/clk.h
+++ b/arch/arm/mach-msm/include/mach/clk.h
@@ -1,30 +1,13 @@
1/* Copyright (c) 2009, Code Aurora Forum. All rights reserved. 1/* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
2 * 2 *
3 * Redistribution and use in source and binary forms, with or without 3 * This program is free software; you can redistribute it and/or modify
4 * modification, are permitted provided that the following conditions are 4 * it under the terms of the GNU General Public License version 2 and
5 * met: 5 * only version 2 as published by the Free Software Foundation.
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above
9 * copyright notice, this list of conditions and the following
10 * disclaimer in the documentation and/or other materials provided
11 * with the distribution.
12 * * Neither the name of Code Aurora Forum, Inc. nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * 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.
28 */ 11 */
29#ifndef __MACH_CLK_H 12#ifndef __MACH_CLK_H
30#define __MACH_CLK_H 13#define __MACH_CLK_H
diff --git a/arch/arm/mach-msm/include/mach/clkdev.h b/arch/arm/mach-msm/include/mach/clkdev.h
new file mode 100644
index 000000000000..f87a57b59534
--- /dev/null
+++ b/arch/arm/mach-msm/include/mach/clkdev.h
@@ -0,0 +1,19 @@
1/* Copyright (c) 2011, 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#ifndef __ASM_ARCH_MSM_CLKDEV_H
13#define __ASM_ARCH_MSM_CLKDEV_H
14
15struct clk;
16
17static inline int __clk_get(struct clk *clk) { return 1; }
18static inline void __clk_put(struct clk *clk) { }
19#endif
diff --git a/arch/arm/mach-msm/include/mach/cpu.h b/arch/arm/mach-msm/include/mach/cpu.h
new file mode 100644
index 000000000000..a9481b08d5c7
--- /dev/null
+++ b/arch/arm/mach-msm/include/mach/cpu.h
@@ -0,0 +1,54 @@
1/* Copyright (c) 2011, 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 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15 * 02110-1301, USA.
16 */
17
18#ifndef __ARCH_ARM_MACH_MSM_CPU_H__
19#define __ARCH_ARM_MACH_MSM_CPU_H__
20
21/* TODO: For now, only one CPU can be compiled at a time. */
22
23#define cpu_is_msm7x01() 0
24#define cpu_is_msm7x30() 0
25#define cpu_is_qsd8x50() 0
26#define cpu_is_msm8x60() 0
27#define cpu_is_msm8960() 0
28
29#ifdef CONFIG_ARCH_MSM7X00A
30# undef cpu_is_msm7x01
31# define cpu_is_msm7x01() 1
32#endif
33
34#ifdef CONFIG_ARCH_MSM7X30
35# undef cpu_is_msm7x30
36# define cpu_is_msm7x30() 1
37#endif
38
39#ifdef CONFIG_ARCH_QSD8X50
40# undef cpu_is_qsd8x50
41# define cpu_is_qsd8x50() 1
42#endif
43
44#ifdef CONFIG_ARCH_MSM8X60
45# undef cpu_is_msm8x60
46# define cpu_is_msm8x60() 1
47#endif
48
49#ifdef CONFIG_ARCH_MSM8960
50# undef cpu_is_msm8960
51# define cpu_is_msm8960() 1
52#endif
53
54#endif
diff --git a/arch/arm/mach-msm/include/mach/io.h b/arch/arm/mach-msm/include/mach/io.h
index 7386e732baad..dc1b928745e9 100644
--- a/arch/arm/mach-msm/include/mach/io.h
+++ b/arch/arm/mach-msm/include/mach/io.h
@@ -29,6 +29,7 @@ void __iomem *__msm_ioremap(unsigned long phys_addr, size_t size, unsigned int m
29void msm_map_qsd8x50_io(void); 29void msm_map_qsd8x50_io(void);
30void msm_map_msm7x30_io(void); 30void msm_map_msm7x30_io(void);
31void msm_map_msm8x60_io(void); 31void msm_map_msm8x60_io(void);
32void msm_map_msm8960_io(void);
32 33
33extern unsigned int msm_shared_ram_phys; 34extern unsigned int msm_shared_ram_phys;
34 35
diff --git a/arch/arm/mach-msm/include/mach/iommu.h b/arch/arm/mach-msm/include/mach/iommu.h
index 296c0f10f230..5c7c955e6d25 100644
--- a/arch/arm/mach-msm/include/mach/iommu.h
+++ b/arch/arm/mach-msm/include/mach/iommu.h
@@ -1,4 +1,4 @@
1/* Copyright (c) 2010, Code Aurora Forum. All rights reserved. 1/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
2 * 2 *
3 * This program is free software; you can redistribute it and/or modify 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 4 * it under the terms of the GNU General Public License version 2 and
@@ -19,6 +19,7 @@
19#define MSM_IOMMU_H 19#define MSM_IOMMU_H
20 20
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/clk.h>
22 23
23/* Sharability attributes of MSM IOMMU mappings */ 24/* Sharability attributes of MSM IOMMU mappings */
24#define MSM_IOMMU_ATTR_NON_SH 0x0 25#define MSM_IOMMU_ATTR_NON_SH 0x0
@@ -44,14 +45,11 @@
44/** 45/**
45 * struct msm_iommu_dev - a single IOMMU hardware instance 46 * struct msm_iommu_dev - a single IOMMU hardware instance
46 * name Human-readable name given to this IOMMU HW instance 47 * name Human-readable name given to this IOMMU HW instance
47 * clk_rate Rate to set for this IOMMU's clock, if applicable to this 48 * ncb Number of context banks present on this IOMMU HW instance
48 * particular IOMMU. 0 means don't set a rate.
49 * -1 means it is an AXI clock with no valid rate
50 *
51 */ 49 */
52struct msm_iommu_dev { 50struct msm_iommu_dev {
53 const char *name; 51 const char *name;
54 int clk_rate; 52 int ncb;
55}; 53};
56 54
57/** 55/**
@@ -73,14 +71,20 @@ struct msm_iommu_ctx_dev {
73/** 71/**
74 * struct msm_iommu_drvdata - A single IOMMU hardware instance 72 * struct msm_iommu_drvdata - A single IOMMU hardware instance
75 * @base: IOMMU config port base address (VA) 73 * @base: IOMMU config port base address (VA)
74 * @ncb The number of contexts on this IOMMU
76 * @irq: Interrupt number 75 * @irq: Interrupt number
77 * 76 * @clk: The bus clock for this IOMMU hardware instance
77 * @pclk: The clock for the IOMMU bus interconnect
78 *
78 * A msm_iommu_drvdata holds the global driver data about a single piece 79 * A msm_iommu_drvdata holds the global driver data about a single piece
79 * of an IOMMU hardware instance. 80 * of an IOMMU hardware instance.
80 */ 81 */
81struct msm_iommu_drvdata { 82struct msm_iommu_drvdata {
82 void __iomem *base; 83 void __iomem *base;
83 int irq; 84 int irq;
85 int ncb;
86 struct clk *clk;
87 struct clk *pclk;
84}; 88};
85 89
86/** 90/**
diff --git a/arch/arm/mach-msm/include/mach/iommu_hw-8xxx.h b/arch/arm/mach-msm/include/mach/iommu_hw-8xxx.h
index c2c3da9444f4..fc160101dead 100644
--- a/arch/arm/mach-msm/include/mach/iommu_hw-8xxx.h
+++ b/arch/arm/mach-msm/include/mach/iommu_hw-8xxx.h
@@ -1,4 +1,4 @@
1/* Copyright (c) 2010, Code Aurora Forum. All rights reserved. 1/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
2 * 2 *
3 * This program is free software; you can redistribute it and/or modify 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 4 * it under the terms of the GNU General Public License version 2 and
@@ -68,6 +68,7 @@ do { \
68#define FL_CACHEABLE (1 << 3) 68#define FL_CACHEABLE (1 << 3)
69#define FL_TEX0 (1 << 12) 69#define FL_TEX0 (1 << 12)
70#define FL_OFFSET(va) (((va) & 0xFFF00000) >> 20) 70#define FL_OFFSET(va) (((va) & 0xFFF00000) >> 20)
71#define FL_NG (1 << 17)
71 72
72/* Second-level page table bits */ 73/* Second-level page table bits */
73#define SL_BASE_MASK_LARGE 0xFFFF0000 74#define SL_BASE_MASK_LARGE 0xFFFF0000
@@ -81,6 +82,7 @@ do { \
81#define SL_CACHEABLE (1 << 3) 82#define SL_CACHEABLE (1 << 3)
82#define SL_TEX0 (1 << 6) 83#define SL_TEX0 (1 << 6)
83#define SL_OFFSET(va) (((va) & 0xFF000) >> 12) 84#define SL_OFFSET(va) (((va) & 0xFF000) >> 12)
85#define SL_NG (1 << 11)
84 86
85/* Memory type and cache policy attributes */ 87/* Memory type and cache policy attributes */
86#define MT_SO 0 88#define MT_SO 0
@@ -623,20 +625,6 @@ do { \
623#define SET_INDEX(b, c, v) SET_CONTEXT_FIELD(b, c, V2PSR, INDEX, v) 625#define SET_INDEX(b, c, v) SET_CONTEXT_FIELD(b, c, V2PSR, INDEX, v)
624 626
625 627
626/* V2Pxx UW UR PW PR */
627#define SET_V2PUW_INDEX(b, c, v) SET_CONTEXT_FIELD(b, c, V2PUW, V2Pxx_INDEX, v)
628#define SET_V2PUW_VA(b, c, v) SET_CONTEXT_FIELD(b, c, V2PUW, V2Pxx_VA, v)
629
630#define SET_V2PUR_INDEX(b, c, v) SET_CONTEXT_FIELD(b, c, V2PUR, V2Pxx_INDEX, v)
631#define SET_V2PUR_VA(b, c, v) SET_CONTEXT_FIELD(b, c, V2PUR, V2Pxx_VA, v)
632
633#define SET_V2PPW_INDEX(b, c, v) SET_CONTEXT_FIELD(b, c, V2PPW, V2Pxx_INDEX, v)
634#define SET_V2PPW_VA(b, c, v) SET_CONTEXT_FIELD(b, c, V2PPW, V2Pxx_VA, v)
635
636#define SET_V2PPR_INDEX(b, c, v) SET_CONTEXT_FIELD(b, c, V2PPR, V2Pxx_INDEX, v)
637#define SET_V2PPR_VA(b, c, v) SET_CONTEXT_FIELD(b, c, V2PPR, V2Pxx_VA, v)
638
639
640/* Context Register getters */ 628/* Context Register getters */
641/* ACTLR */ 629/* ACTLR */
642#define GET_CFERE(b, c) GET_CONTEXT_FIELD(b, c, ACTLR, CFERE) 630#define GET_CFERE(b, c) GET_CONTEXT_FIELD(b, c, ACTLR, CFERE)
@@ -824,20 +812,6 @@ do { \
824#define GET_INDEX(b, c) GET_CONTEXT_FIELD(b, c, V2PSR, INDEX) 812#define GET_INDEX(b, c) GET_CONTEXT_FIELD(b, c, V2PSR, INDEX)
825 813
826 814
827/* V2Pxx UW UR PW PR */
828#define GET_V2PUW_INDEX(b, c) GET_CONTEXT_FIELD(b, c, V2PUW, V2Pxx_INDEX)
829#define GET_V2PUW_VA(b, c) GET_CONTEXT_FIELD(b, c, V2PUW, V2Pxx_VA)
830
831#define GET_V2PUR_INDEX(b, c) GET_CONTEXT_FIELD(b, c, V2PUR, V2Pxx_INDEX)
832#define GET_V2PUR_VA(b, c) GET_CONTEXT_FIELD(b, c, V2PUR, V2Pxx_VA)
833
834#define GET_V2PPW_INDEX(b, c) GET_CONTEXT_FIELD(b, c, V2PPW, V2Pxx_INDEX)
835#define GET_V2PPW_VA(b, c) GET_CONTEXT_FIELD(b, c, V2PPW, V2Pxx_VA)
836
837#define GET_V2PPR_INDEX(b, c) GET_CONTEXT_FIELD(b, c, V2PPR, V2Pxx_INDEX)
838#define GET_V2PPR_VA(b, c) GET_CONTEXT_FIELD(b, c, V2PPR, V2Pxx_VA)
839
840
841/* Global Registers */ 815/* Global Registers */
842#define M2VCBR_N (0xFF000) 816#define M2VCBR_N (0xFF000)
843#define CBACR_N (0xFF800) 817#define CBACR_N (0xFF800)
diff --git a/arch/arm/mach-msm/include/mach/irqs-7x30.h b/arch/arm/mach-msm/include/mach/irqs-7x30.h
index 67c5396514fe..1f15902655fd 100644
--- a/arch/arm/mach-msm/include/mach/irqs-7x30.h
+++ b/arch/arm/mach-msm/include/mach/irqs-7x30.h
@@ -1,30 +1,13 @@
1/* Copyright (c) 2009, Code Aurora Forum. All rights reserved. 1/* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
2 * 2 *
3 * Redistribution and use in source and binary forms, with or without 3 * This program is free software; you can redistribute it and/or modify
4 * modification, are permitted provided that the following conditions are 4 * it under the terms of the GNU General Public License version 2 and
5 * met: 5 * only version 2 as published by the Free Software Foundation.
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above
9 * copyright notice, this list of conditions and the following
10 * disclaimer in the documentation and/or other materials provided
11 * with the distribution.
12 * * Neither the name of Code Aurora Forum, Inc. nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * 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.
28 */ 11 */
29 12
30#ifndef __ASM_ARCH_MSM_IRQS_7X30_H 13#ifndef __ASM_ARCH_MSM_IRQS_7X30_H
diff --git a/arch/arm/mach-msm/include/mach/irqs-8960.h b/arch/arm/mach-msm/include/mach/irqs-8960.h
new file mode 100644
index 000000000000..81ab2a6792bd
--- /dev/null
+++ b/arch/arm/mach-msm/include/mach/irqs-8960.h
@@ -0,0 +1,277 @@
1/* Copyright (c) 2011 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_IRQS_8960_H
14#define __ASM_ARCH_MSM_IRQS_8960_H
15
16/* MSM ACPU Interrupt Numbers */
17
18/* 0-15: STI/SGI (software triggered/generated interrupts)
19 16-31: PPI (private peripheral interrupts)
20 32+: SPI (shared peripheral interrupts) */
21
22#define GIC_PPI_START 16
23#define GIC_SPI_START 32
24
25#define INT_VGIC (GIC_PPI_START + 0)
26#define INT_DEBUG_TIMER_EXP (GIC_PPI_START + 1)
27#define INT_GP_TIMER_EXP (GIC_PPI_START + 2)
28#define INT_GP_TIMER2_EXP (GIC_PPI_START + 3)
29#define WDT0_ACCSCSSNBARK_INT (GIC_PPI_START + 4)
30#define WDT1_ACCSCSSNBARK_INT (GIC_PPI_START + 5)
31#define AVS_SVICINT (GIC_PPI_START + 6)
32#define AVS_SVICINTSWDONE (GIC_PPI_START + 7)
33#define CPU_DBGCPUXCOMMRXFULL (GIC_PPI_START + 8)
34#define CPU_DBGCPUXCOMMTXEMPTY (GIC_PPI_START + 9)
35#define CPU_SICCPUXPERFMONIRPTREQ (GIC_PPI_START + 10)
36#define SC_AVSCPUXDOWN (GIC_PPI_START + 11)
37#define SC_AVSCPUXUP (GIC_PPI_START + 12)
38#define SC_SICCPUXACGIRPTREQ (GIC_PPI_START + 13)
39#define SC_SICCPUXEXTFAULTIRPTREQ (GIC_PPI_START + 14)
40/* PPI 15 is unused */
41
42#define SC_SICMPUIRPTREQ (GIC_SPI_START + 0)
43#define SC_SICL2IRPTREQ (GIC_SPI_START + 1)
44#define SC_SICL2PERFMONIRPTREQ (GIC_SPI_START + 2)
45#define SC_SICAGCIRPTREQ (GIC_SPI_START + 3)
46#define TLMM_APCC_DIR_CONN_IRQ_0 (GIC_SPI_START + 4)
47#define TLMM_APCC_DIR_CONN_IRQ_1 (GIC_SPI_START + 5)
48#define TLMM_APCC_DIR_CONN_IRQ_2 (GIC_SPI_START + 6)
49#define TLMM_APCC_DIR_CONN_IRQ_3 (GIC_SPI_START + 7)
50#define TLMM_APCC_DIR_CONN_IRQ_4 (GIC_SPI_START + 8)
51#define TLMM_APCC_DIR_CONN_IRQ_5 (GIC_SPI_START + 9)
52#define TLMM_APCC_DIR_CONN_IRQ_6 (GIC_SPI_START + 10)
53#define TLMM_APCC_DIR_CONN_IRQ_7 (GIC_SPI_START + 11)
54#define TLMM_APCC_DIR_CONN_IRQ_8 (GIC_SPI_START + 12)
55#define TLMM_APCC_DIR_CONN_IRQ_9 (GIC_SPI_START + 13)
56#define PM8921_SEC_IRQ_103 (GIC_SPI_START + 14)
57#define PM8018_SEC_IRQ_106 (GIC_SPI_START + 15)
58#define TLMM_APCC_SUMMARY_IRQ (GIC_SPI_START + 16)
59#define SPDM_RT_1_IRQ (GIC_SPI_START + 17)
60#define SPDM_DIAG_IRQ (GIC_SPI_START + 18)
61#define RPM_APCC_CPU0_GP_HIGH_IRQ (GIC_SPI_START + 19)
62#define RPM_APCC_CPU0_GP_MEDIUM_IRQ (GIC_SPI_START + 20)
63#define RPM_APCC_CPU0_GP_LOW_IRQ (GIC_SPI_START + 21)
64#define RPM_APCC_CPU0_WAKE_UP_IRQ (GIC_SPI_START + 22)
65#define RPM_APCC_CPU1_GP_HIGH_IRQ (GIC_SPI_START + 23)
66#define RPM_APCC_CPU1_GP_MEDIUM_IRQ (GIC_SPI_START + 24)
67#define RPM_APCC_CPU1_GP_LOW_IRQ (GIC_SPI_START + 25)
68#define RPM_APCC_CPU1_WAKE_UP_IRQ (GIC_SPI_START + 26)
69#define SSBI2_2_SC_CPU0_SECURE_IRQ (GIC_SPI_START + 27)
70#define SSBI2_2_SC_CPU0_NON_SECURE_IRQ (GIC_SPI_START + 28)
71#define SSBI2_1_SC_CPU0_SECURE_IRQ (GIC_SPI_START + 29)
72#define SSBI2_1_SC_CPU0_NON_SECURE_IRQ (GIC_SPI_START + 30)
73#define MSMC_SC_SEC_CE_IRQ (GIC_SPI_START + 31)
74#define MSMC_SC_PRI_CE_IRQ (GIC_SPI_START + 32)
75#define SLIMBUS0_CORE_EE1_IRQ (GIC_SPI_START + 33)
76#define SLIMBUS0_BAM_EE1_IRQ (GIC_SPI_START + 34)
77#define Q6FW_WDOG_EXPIRED_IRQ (GIC_SPI_START + 35)
78#define Q6SW_WDOG_EXPIRED_IRQ (GIC_SPI_START + 36)
79#define MSS_TO_APPS_IRQ_0 (GIC_SPI_START + 37)
80#define MSS_TO_APPS_IRQ_1 (GIC_SPI_START + 38)
81#define MSS_TO_APPS_IRQ_2 (GIC_SPI_START + 39)
82#define MSS_TO_APPS_IRQ_3 (GIC_SPI_START + 40)
83#define MSS_TO_APPS_IRQ_4 (GIC_SPI_START + 41)
84#define MSS_TO_APPS_IRQ_5 (GIC_SPI_START + 42)
85#define MSS_TO_APPS_IRQ_6 (GIC_SPI_START + 43)
86#define MSS_TO_APPS_IRQ_7 (GIC_SPI_START + 44)
87#define MSS_TO_APPS_IRQ_8 (GIC_SPI_START + 45)
88#define MSS_TO_APPS_IRQ_9 (GIC_SPI_START + 46)
89#define VPE_IRQ (GIC_SPI_START + 47)
90#define VFE_IRQ (GIC_SPI_START + 48)
91#define VCODEC_IRQ (GIC_SPI_START + 49)
92#define TV_ENC_IRQ (GIC_SPI_START + 50)
93#define SMMU_VPE_CB_SC_SECURE_IRQ (GIC_SPI_START + 51)
94#define SMMU_VPE_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 52)
95#define SMMU_VFE_CB_SC_SECURE_IRQ (GIC_SPI_START + 53)
96#define SMMU_VFE_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 54)
97#define SMMU_VCODEC_B_CB_SC_SECURE_IRQ (GIC_SPI_START + 55)
98#define SMMU_VCODEC_B_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 56)
99#define SMMU_VCODEC_A_CB_SC_SECURE_IRQ (GIC_SPI_START + 57)
100#define SMMU_VCODEC_A_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 58)
101#define SMMU_ROT_CB_SC_SECURE_IRQ (GIC_SPI_START + 59)
102#define SMMU_ROT_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 60)
103#define SMMU_MDP1_CB_SC_SECURE_IRQ (GIC_SPI_START + 61)
104#define SMMU_MDP1_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 62)
105#define SMMU_MDP0_CB_SC_SECURE_IRQ (GIC_SPI_START + 63)
106#define SMMU_MDP0_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 64)
107#define SMMU_JPEGD_CB_SC_SECURE_IRQ (GIC_SPI_START + 65)
108#define SMMU_JPEGD_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 66)
109#define SMMU_IJPEG_CB_SC_SECURE_IRQ (GIC_SPI_START + 67)
110#define SMMU_IJPEG_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 68)
111#define SMMU_GFX3D_CB_SC_SECURE_IRQ (GIC_SPI_START + 69)
112#define SMMU_GFX3D_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 70)
113#define SMMU_GFX2D0_CB_SC_SECURE_IRQ (GIC_SPI_START + 71)
114#define SMMU_GFX2D0_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 72)
115#define ROT_IRQ (GIC_SPI_START + 73)
116#define MMSS_FABRIC_IRQ (GIC_SPI_START + 74)
117#define MDP_IRQ (GIC_SPI_START + 75)
118#define JPEGD_IRQ (GIC_SPI_START + 76)
119#define JPEG_IRQ (GIC_SPI_START + 77)
120#define MMSS_IMEM_IRQ (GIC_SPI_START + 78)
121#define HDMI_IRQ (GIC_SPI_START + 79)
122#define GFX3D_IRQ (GIC_SPI_START + 80)
123#define GFX2D0_IRQ (GIC_SPI_START + 81)
124#define DSI1_IRQ (GIC_SPI_START + 82)
125#define CSI_1_IRQ (GIC_SPI_START + 83)
126#define CSI_0_IRQ (GIC_SPI_START + 84)
127#define LPASS_SCSS_AUDIO_IF_OUT0_IRQ (GIC_SPI_START + 85)
128#define LPASS_SCSS_MIDI_IRQ (GIC_SPI_START + 86)
129#define LPASS_Q6SS_WDOG_EXPIRED (GIC_SPI_START + 87)
130#define LPASS_SCSS_GP_LOW_IRQ (GIC_SPI_START + 88)
131#define LPASS_SCSS_GP_MEDIUM_IRQ (GIC_SPI_START + 89)
132#define LPASS_SCSS_GP_HIGH_IRQ (GIC_SPI_START + 90)
133#define TOP_IMEM_IRQ (GIC_SPI_START + 91)
134#define FABRIC_SYS_IRQ (GIC_SPI_START + 92)
135#define FABRIC_APPS_IRQ (GIC_SPI_START + 93)
136#define USB1_HS_BAM_IRQ (GIC_SPI_START + 94)
137#define SDC4_BAM_IRQ (GIC_SPI_START + 95)
138#define SDC3_BAM_IRQ (GIC_SPI_START + 96)
139#define SDC2_BAM_IRQ (GIC_SPI_START + 97)
140#define SDC1_BAM_IRQ (GIC_SPI_START + 98)
141#define FABRIC_SPS_IRQ (GIC_SPI_START + 99)
142#define USB1_HS_IRQ (GIC_SPI_START + 100)
143#define SDC4_IRQ_0 (GIC_SPI_START + 101)
144#define SDC3_IRQ_0 (GIC_SPI_START + 102)
145#define SDC2_IRQ_0 (GIC_SPI_START + 103)
146#define SDC1_IRQ_0 (GIC_SPI_START + 104)
147#define SPS_BAM_DMA_IRQ (GIC_SPI_START + 105)
148#define SPS_SEC_VIOL_IRQ (GIC_SPI_START + 106)
149#define SPS_MTI_0 (GIC_SPI_START + 107)
150#define SPS_MTI_1 (GIC_SPI_START + 108)
151#define SPS_MTI_2 (GIC_SPI_START + 109)
152#define SPS_MTI_3 (GIC_SPI_START + 110)
153#define SPS_MTI_4 (GIC_SPI_START + 111)
154#define SPS_MTI_5 (GIC_SPI_START + 112)
155#define SPS_MTI_6 (GIC_SPI_START + 113)
156#define SPS_MTI_7 (GIC_SPI_START + 114)
157#define SPS_MTI_8 (GIC_SPI_START + 115)
158#define SPS_MTI_9 (GIC_SPI_START + 116)
159#define SPS_MTI_10 (GIC_SPI_START + 117)
160#define SPS_MTI_11 (GIC_SPI_START + 118)
161#define SPS_MTI_12 (GIC_SPI_START + 119)
162#define SPS_MTI_13 (GIC_SPI_START + 120)
163#define SPS_MTI_14 (GIC_SPI_START + 121)
164#define SPS_MTI_15 (GIC_SPI_START + 122)
165#define SPS_MTI_16 (GIC_SPI_START + 123)
166#define SPS_MTI_17 (GIC_SPI_START + 124)
167#define SPS_MTI_18 (GIC_SPI_START + 125)
168#define SPS_MTI_19 (GIC_SPI_START + 126)
169#define SPS_MTI_20 (GIC_SPI_START + 127)
170#define SPS_MTI_21 (GIC_SPI_START + 128)
171#define SPS_MTI_22 (GIC_SPI_START + 129)
172#define SPS_MTI_23 (GIC_SPI_START + 130)
173#define SPS_MTI_24 (GIC_SPI_START + 131)
174#define SPS_MTI_25 (GIC_SPI_START + 132)
175#define SPS_MTI_26 (GIC_SPI_START + 133)
176#define SPS_MTI_27 (GIC_SPI_START + 134)
177#define SPS_MTI_28 (GIC_SPI_START + 135)
178#define SPS_MTI_29 (GIC_SPI_START + 136)
179#define SPS_MTI_30 (GIC_SPI_START + 137)
180#define SPS_MTI_31 (GIC_SPI_START + 138)
181#define CSIPHY_4LN_IRQ (GIC_SPI_START + 139)
182#define CSIPHY_2LN_IRQ (GIC_SPI_START + 140)
183#define USB2_IRQ (GIC_SPI_START + 141)
184#define USB1_IRQ (GIC_SPI_START + 142)
185#define TSSC_SSBI_IRQ (GIC_SPI_START + 143)
186#define TSSC_SAMPLE_IRQ (GIC_SPI_START + 144)
187#define TSSC_PENUP_IRQ (GIC_SPI_START + 145)
188#define GSBI1_UARTDM_IRQ (GIC_SPI_START + 146)
189#define GSBI1_QUP_IRQ (GIC_SPI_START + 147)
190#define GSBI2_UARTDM_IRQ (GIC_SPI_START + 148)
191#define GSBI2_QUP_IRQ (GIC_SPI_START + 149)
192#define GSBI3_UARTDM_IRQ (GIC_SPI_START + 150)
193#define GSBI3_QUP_IRQ (GIC_SPI_START + 151)
194#define GSBI4_UARTDM_IRQ (GIC_SPI_START + 152)
195#define GSBI4_QUP_IRQ (GIC_SPI_START + 153)
196#define GSBI5_UARTDM_IRQ (GIC_SPI_START + 154)
197#define GSBI5_QUP_IRQ (GIC_SPI_START + 155)
198#define GSBI6_UARTDM_IRQ (GIC_SPI_START + 156)
199#define GSBI6_QUP_IRQ (GIC_SPI_START + 157)
200#define GSBI7_UARTDM_IRQ (GIC_SPI_START + 158)
201#define GSBI7_QUP_IRQ (GIC_SPI_START + 159)
202#define GSBI8_UARTDM_IRQ (GIC_SPI_START + 160)
203#define GSBI8_QUP_IRQ (GIC_SPI_START + 161)
204#define TSIF_TSPP_IRQ (GIC_SPI_START + 162)
205#define TSIF_BAM_IRQ (GIC_SPI_START + 163)
206#define TSIF2_IRQ (GIC_SPI_START + 164)
207#define TSIF1_IRQ (GIC_SPI_START + 165)
208#define DSI2_IRQ (GIC_SPI_START + 166)
209#define ISPIF_IRQ (GIC_SPI_START + 167)
210#define MSMC_SC_SEC_TMR_IRQ (GIC_SPI_START + 168)
211#define MSMC_SC_SEC_WDOG_BARK_IRQ (GIC_SPI_START + 169)
212#define INT_ADM0_SCSS_0_IRQ (GIC_SPI_START + 170)
213#define INT_ADM0_SCSS_1_IRQ (GIC_SPI_START + 171)
214#define INT_ADM0_SCSS_2_IRQ (GIC_SPI_START + 172)
215#define INT_ADM0_SCSS_3_IRQ (GIC_SPI_START + 173)
216#define CC_SCSS_WDT1CPU1BITEEXPIRED (GIC_SPI_START + 174)
217#define CC_SCSS_WDT1CPU0BITEEXPIRED (GIC_SPI_START + 175)
218#define CC_SCSS_WDT0CPU1BITEEXPIRED (GIC_SPI_START + 176)
219#define CC_SCSS_WDT0CPU0BITEEXPIRED (GIC_SPI_START + 177)
220#define TSENS_UPPER_LOWER_INT (GIC_SPI_START + 178)
221#define SSBI2_2_SC_CPU1_SECURE_INT (GIC_SPI_START + 179)
222#define SSBI2_2_SC_CPU1_NON_SECURE_INT (GIC_SPI_START + 180)
223#define SSBI2_1_SC_CPU1_SECURE_INT (GIC_SPI_START + 181)
224#define SSBI2_1_SC_CPU1_NON_SECURE_INT (GIC_SPI_START + 182)
225#define XPU_SUMMARY_IRQ (GIC_SPI_START + 183)
226#define BUS_EXCEPTION_SUMMARY_IRQ (GIC_SPI_START + 184)
227#define HSDDRX_EBI1CH0_IRQ (GIC_SPI_START + 185)
228#define HSDDRX_EBI1CH1_IRQ (GIC_SPI_START + 186)
229#define SDC5_BAM_IRQ (GIC_SPI_START + 187)
230#define SDC5_IRQ_0 (GIC_SPI_START + 188)
231#define GSBI9_UARTDM_IRQ (GIC_SPI_START + 189)
232#define GSBI9_QUP_IRQ (GIC_SPI_START + 190)
233#define GSBI10_UARTDM_IRQ (GIC_SPI_START + 191)
234#define GSBI10_QUP_IRQ (GIC_SPI_START + 192)
235#define GSBI11_UARTDM_IRQ (GIC_SPI_START + 193)
236#define GSBI11_QUP_IRQ (GIC_SPI_START + 194)
237#define GSBI12_UARTDM_IRQ (GIC_SPI_START + 195)
238#define GSBI12_QUP_IRQ (GIC_SPI_START + 196)
239#define RIVA_APSS_LTECOEX_IRQ (GIC_SPI_START + 197)
240#define RIVA_APSS_SPARE_IRQ (GIC_SPI_START + 198)
241#define RIVA_APSS_WDOG_BITE_RESET_RDY_IRQ (GIC_SPI_START + 199)
242#define RIVA_ASS_RESET_DONE_IRQ (GIC_SPI_START + 200)
243#define RIVA_APSS_ASIC_IRQ (GIC_SPI_START + 201)
244#define RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ (GIC_SPI_START + 202)
245#define RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ (GIC_SPI_START + 203)
246#define RIVA_APPS_WLAM_SMSM_IRQ (GIC_SPI_START + 204)
247#define RIVA_APPS_LOG_CTRL_IRQ (GIC_SPI_START + 205)
248#define RIVA_APPS_FM_CTRL_IRQ (GIC_SPI_START + 206)
249#define RIVA_APPS_HCI_IRQ (GIC_SPI_START + 207)
250#define RIVA_APPS_WLAN_CTRL_IRQ (GIC_SPI_START + 208)
251#define A2_BAM_IRQ (GIC_SPI_START + 209)
252#define SMMU_GFX2D1_CB_SC_SECURE_IRQ (GIC_SPI_START + 210)
253#define SMMU_GFX2D1_CB_SC_NON_SECURE_IRQ (GIC_SPI_START + 211)
254#define GFX2D1_IRQ (GIC_SPI_START + 212)
255#define PPSS_WDOG_TIMER_IRQ (GIC_SPI_START + 213)
256#define SPS_SLIMBUS_CORE_EE0_IRQ (GIC_SPI_START + 214)
257#define SPS_SLIMBUS_BAM_EE0_IRQ (GIC_SPI_START + 215)
258#define QDSS_ETB_IRQ (GIC_SPI_START + 216)
259#define QDSS_CTI2KPSS_CPU1_IRQ (GIC_SPI_START + 217)
260#define QDSS_CTI2KPSS_CPU0_IRQ (GIC_SPI_START + 218)
261#define TLMM_APCC_DIR_CONN_IRQ_16 (GIC_SPI_START + 219)
262#define TLMM_APCC_DIR_CONN_IRQ_17 (GIC_SPI_START + 220)
263#define TLMM_APCC_DIR_CONN_IRQ_18 (GIC_SPI_START + 221)
264#define TLMM_APCC_DIR_CONN_IRQ_19 (GIC_SPI_START + 222)
265#define TLMM_APCC_DIR_CONN_IRQ_20 (GIC_SPI_START + 223)
266#define TLMM_APCC_DIR_CONN_IRQ_21 (GIC_SPI_START + 224)
267#define PM8921_SEC_IRQ_104 (GIC_SPI_START + 225)
268#define PM8018_SEC_IRQ_107 (GIC_SPI_START + 226)
269
270/* For now, use the maximum number of interrupts until a pending GIC issue
271 * is sorted out */
272#define NR_MSM_IRQS 1020
273#define NR_BOARD_IRQS 0
274#define NR_GPIO_IRQS 0
275
276#endif
277
diff --git a/arch/arm/mach-msm/include/mach/irqs-8x50.h b/arch/arm/mach-msm/include/mach/irqs-8x50.h
index de3d8fe24e4e..26adbe0e9406 100644
--- a/arch/arm/mach-msm/include/mach/irqs-8x50.h
+++ b/arch/arm/mach-msm/include/mach/irqs-8x50.h
@@ -1,30 +1,13 @@
1/* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved. 1/* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved.
2 * 2 *
3 * Redistribution and use in source and binary forms, with or without 3 * This program is free software; you can redistribute it and/or modify
4 * modification, are permitted provided that the following conditions are 4 * it under the terms of the GNU General Public License version 2 and
5 * met: 5 * only version 2 as published by the Free Software Foundation.
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above
9 * copyright notice, this list of conditions and the following
10 * disclaimer in the documentation and/or other materials provided
11 * with the distribution.
12 * * Neither the name of Code Aurora Forum, Inc. nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * 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.
28 */ 11 */
29 12
30#ifndef __ASM_ARCH_MSM_IRQS_8XXX_H 13#ifndef __ASM_ARCH_MSM_IRQS_8XXX_H
diff --git a/arch/arm/mach-msm/include/mach/irqs.h b/arch/arm/mach-msm/include/mach/irqs.h
index 8679a4564744..3cd78b165abb 100644
--- a/arch/arm/mach-msm/include/mach/irqs.h
+++ b/arch/arm/mach-msm/include/mach/irqs.h
@@ -26,6 +26,9 @@
26#include "sirc.h" 26#include "sirc.h"
27#elif defined(CONFIG_ARCH_MSM8X60) 27#elif defined(CONFIG_ARCH_MSM8X60)
28#include "irqs-8x60.h" 28#include "irqs-8x60.h"
29#elif defined(CONFIG_ARCH_MSM8960)
30/* TODO: Make these not generic. */
31#include "irqs-8960.h"
29#elif defined(CONFIG_ARCH_MSM_ARM11) 32#elif defined(CONFIG_ARCH_MSM_ARM11)
30#include "irqs-7x00.h" 33#include "irqs-7x00.h"
31#else 34#else
diff --git a/arch/arm/mach-msm/include/mach/memory.h b/arch/arm/mach-msm/include/mach/memory.h
index 070e17d237f1..f2f8d299ba95 100644
--- a/arch/arm/mach-msm/include/mach/memory.h
+++ b/arch/arm/mach-msm/include/mach/memory.h
@@ -18,15 +18,17 @@
18 18
19/* physical offset of RAM */ 19/* physical offset of RAM */
20#if defined(CONFIG_ARCH_QSD8X50) && defined(CONFIG_MSM_SOC_REV_A) 20#if defined(CONFIG_ARCH_QSD8X50) && defined(CONFIG_MSM_SOC_REV_A)
21#define PHYS_OFFSET UL(0x00000000) 21#define PLAT_PHYS_OFFSET UL(0x00000000)
22#elif defined(CONFIG_ARCH_QSD8X50) 22#elif defined(CONFIG_ARCH_QSD8X50)
23#define PHYS_OFFSET UL(0x20000000) 23#define PLAT_PHYS_OFFSET UL(0x20000000)
24#elif defined(CONFIG_ARCH_MSM7X30) 24#elif defined(CONFIG_ARCH_MSM7X30)
25#define PHYS_OFFSET UL(0x00200000) 25#define PLAT_PHYS_OFFSET UL(0x00200000)
26#elif defined(CONFIG_ARCH_MSM8X60) 26#elif defined(CONFIG_ARCH_MSM8X60)
27#define PHYS_OFFSET UL(0x40200000) 27#define PLAT_PHYS_OFFSET UL(0x40200000)
28#elif defined(CONFIG_ARCH_MSM8960)
29#define PLAT_PHYS_OFFSET UL(0x40200000)
28#else 30#else
29#define PHYS_OFFSET UL(0x10000000) 31#define PLAT_PHYS_OFFSET UL(0x10000000)
30#endif 32#endif
31 33
32#endif 34#endif
diff --git a/arch/arm/mach-msm/include/mach/mmc.h b/arch/arm/mach-msm/include/mach/mmc.h
index d54b6b086cff..5631b51cec46 100644
--- a/arch/arm/mach-msm/include/mach/mmc.h
+++ b/arch/arm/mach-msm/include/mach/mmc.h
@@ -15,12 +15,23 @@ struct embedded_sdio_data {
15 int num_funcs; 15 int num_funcs;
16}; 16};
17 17
18struct msm_mmc_gpio {
19 unsigned no;
20 const char *name;
21};
22
23struct msm_mmc_gpio_data {
24 struct msm_mmc_gpio *gpio;
25 u8 size;
26};
27
18struct msm_mmc_platform_data { 28struct msm_mmc_platform_data {
19 unsigned int ocr_mask; /* available voltages */ 29 unsigned int ocr_mask; /* available voltages */
20 u32 (*translate_vdd)(struct device *, unsigned int); 30 u32 (*translate_vdd)(struct device *, unsigned int);
21 unsigned int (*status)(struct device *); 31 unsigned int (*status)(struct device *);
22 struct embedded_sdio_data *embedded_sdio; 32 struct embedded_sdio_data *embedded_sdio;
23 int (*register_status_notify)(void (*callback)(int card_present, void *dev_id), void *dev_id); 33 int (*register_status_notify)(void (*callback)(int card_present, void *dev_id), void *dev_id);
34 struct msm_mmc_gpio_data *gpio_data;
24}; 35};
25 36
26#endif 37#endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-7x00.h b/arch/arm/mach-msm/include/mach/msm_iomap-7x00.h
index cfff0e74f128..8f99d97615a0 100644
--- a/arch/arm/mach-msm/include/mach/msm_iomap-7x00.h
+++ b/arch/arm/mach-msm/include/mach/msm_iomap-7x00.h
@@ -1,6 +1,7 @@
1/* arch/arm/mach-msm/include/mach/msm_iomap.h 1/* arch/arm/mach-msm/include/mach/msm_iomap.h
2 * 2 *
3 * Copyright (C) 2007 Google, Inc. 3 * Copyright (C) 2007 Google, Inc.
4 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
4 * Author: Brian Swetland <swetland@google.com> 5 * Author: Brian Swetland <swetland@google.com>
5 * 6 *
6 * This software is licensed under the terms of the GNU General Public 7 * This software is licensed under the terms of the GNU General Public
@@ -47,13 +48,8 @@
47#define MSM_VIC_PHYS 0xC0000000 48#define MSM_VIC_PHYS 0xC0000000
48#define MSM_VIC_SIZE SZ_4K 49#define MSM_VIC_SIZE SZ_4K
49 50
50#define MSM_CSR_BASE IOMEM(0xE0001000) 51#define MSM7X00_CSR_PHYS 0xC0100000
51#define MSM_CSR_PHYS 0xC0100000 52#define MSM7X00_CSR_SIZE SZ_4K
52#define MSM_CSR_SIZE SZ_4K
53
54#define MSM_GPT_PHYS MSM_CSR_PHYS
55#define MSM_GPT_BASE MSM_CSR_BASE
56#define MSM_GPT_SIZE SZ_4K
57 53
58#define MSM_DMOV_BASE IOMEM(0xE0002000) 54#define MSM_DMOV_BASE IOMEM(0xE0002000)
59#define MSM_DMOV_PHYS 0xA9700000 55#define MSM_DMOV_PHYS 0xA9700000
@@ -130,10 +126,4 @@
130#define MSM_AD5_SIZE (SZ_1M*13) 126#define MSM_AD5_SIZE (SZ_1M*13)
131 127
132 128
133#if defined(CONFIG_ARCH_MSM7X30)
134#define MSM_GCC_BASE IOMEM(0xF8009000)
135#define MSM_GCC_PHYS 0xC0182000
136#define MSM_GCC_SIZE SZ_4K
137#endif
138
139#endif 129#endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-7x30.h b/arch/arm/mach-msm/include/mach/msm_iomap-7x30.h
index 0fd7b68ca114..4d84be15955e 100644
--- a/arch/arm/mach-msm/include/mach/msm_iomap-7x30.h
+++ b/arch/arm/mach-msm/include/mach/msm_iomap-7x30.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2007 Google, Inc. 2 * Copyright (C) 2007 Google, Inc.
3 * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved. 3 * Copyright (c) 2008-2011 Code Aurora Forum. All rights reserved.
4 * Author: Brian Swetland <swetland@google.com> 4 * Author: Brian Swetland <swetland@google.com>
5 * 5 *
6 * This software is licensed under the terms of the GNU General Public 6 * This software is licensed under the terms of the GNU General Public
@@ -39,16 +39,8 @@
39#define MSM_VIC_PHYS 0xC0080000 39#define MSM_VIC_PHYS 0xC0080000
40#define MSM_VIC_SIZE SZ_4K 40#define MSM_VIC_SIZE SZ_4K
41 41
42#define MSM_CSR_BASE IOMEM(0xE0001000) 42#define MSM7X30_CSR_PHYS 0xC0100000
43#define MSM_CSR_PHYS 0xC0100000 43#define MSM7X30_CSR_SIZE SZ_4K
44#define MSM_CSR_SIZE SZ_4K
45
46#define MSM_TMR_PHYS MSM_CSR_PHYS
47#define MSM_TMR_BASE MSM_CSR_BASE
48#define MSM_TMR_SIZE SZ_4K
49
50#define MSM_GPT_BASE (MSM_TMR_BASE + 0x4)
51#define MSM_DGT_BASE (MSM_TMR_BASE + 0x24)
52 44
53#define MSM_DMOV_BASE IOMEM(0xE0002000) 45#define MSM_DMOV_BASE IOMEM(0xE0002000)
54#define MSM_DMOV_PHYS 0xAC400000 46#define MSM_DMOV_PHYS 0xAC400000
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-8960.h b/arch/arm/mach-msm/include/mach/msm_iomap-8960.h
new file mode 100644
index 000000000000..3c9d9602a318
--- /dev/null
+++ b/arch/arm/mach-msm/include/mach/msm_iomap-8960.h
@@ -0,0 +1,48 @@
1/*
2 * Copyright (C) 2007 Google, Inc.
3 * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved.
4 * Author: Brian Swetland <swetland@google.com>
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 *
16 * The MSM peripherals are spread all over across 768MB of physical
17 * space, which makes just having a simple IO_ADDRESS macro to slide
18 * them into the right virtual location rough. Instead, we will
19 * provide a master phys->virt mapping for peripherals here.
20 *
21 */
22
23#ifndef __ASM_ARCH_MSM_IOMAP_8960_H
24#define __ASM_ARCH_MSM_IOMAP_8960_H
25
26/* Physical base address and size of peripherals.
27 * Ordered by the virtual base addresses they will be mapped at.
28 *
29 * If you add or remove entries here, you'll want to edit the
30 * msm_io_desc array in arch/arm/mach-msm/io.c to reflect your
31 * changes.
32 *
33 */
34
35
36#define MSM8960_QGIC_DIST_PHYS 0x02000000
37#define MSM8960_QGIC_DIST_SIZE SZ_4K
38
39#define MSM8960_QGIC_CPU_PHYS 0x02002000
40#define MSM8960_QGIC_CPU_SIZE SZ_4K
41
42#define MSM8960_TMR_PHYS 0x0200A000
43#define MSM8960_TMR_SIZE SZ_4K
44
45#define MSM8960_TMR0_PHYS 0x0208A000
46#define MSM8960_TMR0_SIZE SZ_4K
47
48#endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-8x50.h b/arch/arm/mach-msm/include/mach/msm_iomap-8x50.h
index acc819eb76e5..d4143201999f 100644
--- a/arch/arm/mach-msm/include/mach/msm_iomap-8x50.h
+++ b/arch/arm/mach-msm/include/mach/msm_iomap-8x50.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2007 Google, Inc. 2 * Copyright (C) 2007 Google, Inc.
3 * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved. 3 * Copyright (c) 2008-2011 Code Aurora Forum. All rights reserved.
4 * Author: Brian Swetland <swetland@google.com> 4 * Author: Brian Swetland <swetland@google.com>
5 * 5 *
6 * This software is licensed under the terms of the GNU General Public 6 * This software is licensed under the terms of the GNU General Public
@@ -39,16 +39,8 @@
39#define MSM_VIC_PHYS 0xAC000000 39#define MSM_VIC_PHYS 0xAC000000
40#define MSM_VIC_SIZE SZ_4K 40#define MSM_VIC_SIZE SZ_4K
41 41
42#define MSM_CSR_BASE IOMEM(0xE0001000) 42#define QSD8X50_CSR_PHYS 0xAC100000
43#define MSM_CSR_PHYS 0xAC100000 43#define QSD8X50_CSR_SIZE SZ_4K
44#define MSM_CSR_SIZE SZ_4K
45
46#define MSM_TMR_PHYS MSM_CSR_PHYS
47#define MSM_TMR_BASE MSM_CSR_BASE
48#define MSM_TMR_SIZE SZ_4K
49
50#define MSM_GPT_BASE MSM_TMR_BASE
51#define MSM_DGT_BASE (MSM_TMR_BASE + 0x10)
52 44
53#define MSM_DMOV_BASE IOMEM(0xE0002000) 45#define MSM_DMOV_BASE IOMEM(0xE0002000)
54#define MSM_DMOV_PHYS 0xA9700000 46#define MSM_DMOV_PHYS 0xA9700000
@@ -132,16 +124,16 @@
132#define MSM_UART2DM_PHYS 0xA0900000 124#define MSM_UART2DM_PHYS 0xA0900000
133 125
134 126
135#define MSM_SDC1_PHYS 0xA0400000 127#define MSM_SDC1_PHYS 0xA0300000
136#define MSM_SDC1_SIZE SZ_4K 128#define MSM_SDC1_SIZE SZ_4K
137 129
138#define MSM_SDC2_PHYS 0xA0500000 130#define MSM_SDC2_PHYS 0xA0400000
139#define MSM_SDC2_SIZE SZ_4K 131#define MSM_SDC2_SIZE SZ_4K
140 132
141#define MSM_SDC3_PHYS 0xA0600000 133#define MSM_SDC3_PHYS 0xA0500000
142#define MSM_SDC3_SIZE SZ_4K 134#define MSM_SDC3_SIZE SZ_4K
143 135
144#define MSM_SDC4_PHYS 0xA0700000 136#define MSM_SDC4_PHYS 0xA0600000
145#define MSM_SDC4_SIZE SZ_4K 137#define MSM_SDC4_SIZE SZ_4K
146 138
147#endif 139#endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h b/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h
index a54e33b0882e..3b19b8f244b8 100644
--- a/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h
+++ b/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2007 Google, Inc. 2 * Copyright (C) 2007 Google, Inc.
3 * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved. 3 * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved.
4 * Author: Brian Swetland <swetland@google.com> 4 * Author: Brian Swetland <swetland@google.com>
5 * 5 *
6 * This software is licensed under the terms of the GNU General Public 6 * This software is licensed under the terms of the GNU General Public
@@ -35,13 +35,11 @@
35 * 35 *
36 */ 36 */
37 37
38#define MSM_QGIC_DIST_BASE IOMEM(0xF0000000) 38#define MSM8X60_QGIC_DIST_PHYS 0x02080000
39#define MSM_QGIC_DIST_PHYS 0x02080000 39#define MSM8X60_QGIC_DIST_SIZE SZ_4K
40#define MSM_QGIC_DIST_SIZE SZ_4K
41 40
42#define MSM_QGIC_CPU_BASE IOMEM(0xF0001000) 41#define MSM8X60_QGIC_CPU_PHYS 0x02081000
43#define MSM_QGIC_CPU_PHYS 0x02081000 42#define MSM8X60_QGIC_CPU_SIZE SZ_4K
44#define MSM_QGIC_CPU_SIZE SZ_4K
45 43
46#define MSM_ACC_BASE IOMEM(0xF0002000) 44#define MSM_ACC_BASE IOMEM(0xF0002000)
47#define MSM_ACC_PHYS 0x02001000 45#define MSM_ACC_PHYS 0x02001000
@@ -58,51 +56,10 @@
58#define MSM_SHARED_RAM_BASE IOMEM(0xF0100000) 56#define MSM_SHARED_RAM_BASE IOMEM(0xF0100000)
59#define MSM_SHARED_RAM_SIZE SZ_1M 57#define MSM_SHARED_RAM_SIZE SZ_1M
60 58
61#define MSM_TMR_BASE IOMEM(0xF0200000) 59#define MSM8X60_TMR_PHYS 0x02000000
62#define MSM_TMR_PHYS 0x02000000 60#define MSM8X60_TMR_SIZE SZ_4K
63#define MSM_TMR_SIZE SZ_4K
64 61
65#define MSM_TMR0_BASE IOMEM(0xF0201000) 62#define MSM8X60_TMR0_PHYS 0x02040000
66#define MSM_TMR0_PHYS 0x02040000 63#define MSM8X60_TMR0_SIZE SZ_4K
67#define MSM_TMR0_SIZE SZ_4K
68
69#define MSM_GPT_BASE (MSM_TMR_BASE + 0x4)
70#define MSM_DGT_BASE (MSM_TMR_BASE + 0x24)
71
72#define MSM_IOMMU_JPEGD_PHYS 0x07300000
73#define MSM_IOMMU_JPEGD_SIZE SZ_1M
74
75#define MSM_IOMMU_VPE_PHYS 0x07400000
76#define MSM_IOMMU_VPE_SIZE SZ_1M
77
78#define MSM_IOMMU_MDP0_PHYS 0x07500000
79#define MSM_IOMMU_MDP0_SIZE SZ_1M
80
81#define MSM_IOMMU_MDP1_PHYS 0x07600000
82#define MSM_IOMMU_MDP1_SIZE SZ_1M
83
84#define MSM_IOMMU_ROT_PHYS 0x07700000
85#define MSM_IOMMU_ROT_SIZE SZ_1M
86
87#define MSM_IOMMU_IJPEG_PHYS 0x07800000
88#define MSM_IOMMU_IJPEG_SIZE SZ_1M
89
90#define MSM_IOMMU_VFE_PHYS 0x07900000
91#define MSM_IOMMU_VFE_SIZE SZ_1M
92
93#define MSM_IOMMU_VCODEC_A_PHYS 0x07A00000
94#define MSM_IOMMU_VCODEC_A_SIZE SZ_1M
95
96#define MSM_IOMMU_VCODEC_B_PHYS 0x07B00000
97#define MSM_IOMMU_VCODEC_B_SIZE SZ_1M
98
99#define MSM_IOMMU_GFX3D_PHYS 0x07C00000
100#define MSM_IOMMU_GFX3D_SIZE SZ_1M
101
102#define MSM_IOMMU_GFX2D0_PHYS 0x07D00000
103#define MSM_IOMMU_GFX2D0_SIZE SZ_1M
104
105#define MSM_IOMMU_GFX2D1_PHYS 0x07E00000
106#define MSM_IOMMU_GFX2D1_SIZE SZ_1M
107 64
108#endif 65#endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap.h b/arch/arm/mach-msm/include/mach/msm_iomap.h
index 8e24dd812139..c98c7591f3b8 100644
--- a/arch/arm/mach-msm/include/mach/msm_iomap.h
+++ b/arch/arm/mach-msm/include/mach/msm_iomap.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2007 Google, Inc. 2 * Copyright (C) 2007 Google, Inc.
3 * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved. 3 * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved.
4 * Author: Brian Swetland <swetland@google.com> 4 * Author: Brian Swetland <swetland@google.com>
5 * 5 *
6 * This software is licensed under the terms of the GNU General Public 6 * This software is licensed under the terms of the GNU General Public
@@ -53,6 +53,13 @@
53#include "msm_iomap-7x00.h" 53#include "msm_iomap-7x00.h"
54#endif 54#endif
55 55
56#include "msm_iomap-8960.h"
56 57
58/* Virtual addressses shared across all MSM targets. */
59#define MSM_CSR_BASE IOMEM(0xE0001000)
60#define MSM_QGIC_DIST_BASE IOMEM(0xF0000000)
61#define MSM_QGIC_CPU_BASE IOMEM(0xF0001000)
62#define MSM_TMR_BASE IOMEM(0xF0200000)
63#define MSM_TMR0_BASE IOMEM(0xF0201000)
57 64
58#endif 65#endif
diff --git a/arch/arm/mach-msm/include/mach/sirc.h b/arch/arm/mach-msm/include/mach/sirc.h
index 7281337ee28d..ef55868a5b8a 100644
--- a/arch/arm/mach-msm/include/mach/sirc.h
+++ b/arch/arm/mach-msm/include/mach/sirc.h
@@ -1,30 +1,13 @@
1/* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved. 1/* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved.
2 * 2 *
3 * Redistribution and use in source and binary forms, with or without 3 * This program is free software; you can redistribute it and/or modify
4 * modification, are permitted provided that the following conditions are 4 * it under the terms of the GNU General Public License version 2 and
5 * met: 5 * only version 2 as published by the Free Software Foundation.
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above
9 * copyright notice, this list of conditions and the following
10 * disclaimer in the documentation and/or other materials provided
11 * with the distribution.
12 * * Neither the name of Code Aurora Forum, Inc. nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * 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.
28 */ 11 */
29 12
30#ifndef __ASM_ARCH_MSM_SIRC_H 13#ifndef __ASM_ARCH_MSM_SIRC_H
diff --git a/arch/arm/mach-msm/include/mach/smp.h b/arch/arm/mach-msm/include/mach/smp.h
index a95f7b9efe31..3c01000ecc80 100644
--- a/arch/arm/mach-msm/include/mach/smp.h
+++ b/arch/arm/mach-msm/include/mach/smp.h
@@ -1,29 +1,13 @@
1/* Copyright (c) 2010, Code Aurora Forum. All rights reserved. 1/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
2 * 2 *
3 * Redistribution and use in source and binary forms, with or without 3 * This program is free software; you can redistribute it and/or modify
4 * modification, are permitted provided that the following conditions are met: 4 * it under the terms of the GNU General Public License version 2 and
5 * * Redistributions of source code must retain the above copyright 5 * only version 2 as published by the Free Software Foundation.
6 * notice, this list of conditions and the following disclaimer.
7 * * Redistributions in binary form must reproduce the above copyright
8 * notice, this list of conditions and the following disclaimer in the
9 * documentation and/or other materials provided with the distribution.
10 * * Neither the name of Code Aurora nor
11 * the names of its contributors may be used to endorse or promote
12 * products derived from this software without specific prior written
13 * permission.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
19 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 * 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.
27 */ 11 */
28 12
29#ifndef __ASM_ARCH_MSM_SMP_H 13#ifndef __ASM_ARCH_MSM_SMP_H
diff --git a/arch/arm/mach-msm/io.c b/arch/arm/mach-msm/io.c
index 1260007a9dd1..cec6ed1c91d3 100644
--- a/arch/arm/mach-msm/io.c
+++ b/arch/arm/mach-msm/io.c
@@ -3,7 +3,7 @@
3 * MSM7K, QSD io support 3 * MSM7K, QSD io support
4 * 4 *
5 * Copyright (C) 2007 Google, Inc. 5 * Copyright (C) 2007 Google, Inc.
6 * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved. 6 * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved.
7 * Author: Brian Swetland <swetland@google.com> 7 * Author: Brian Swetland <swetland@google.com>
8 * 8 *
9 * This software is licensed under the terms of the GNU General Public 9 * This software is licensed under the terms of the GNU General Public
@@ -28,19 +28,20 @@
28 28
29#include <mach/board.h> 29#include <mach/board.h>
30 30
31#define MSM_DEVICE(name) { \ 31#define MSM_CHIP_DEVICE(name, chip) { \
32 .virtual = (unsigned long) MSM_##name##_BASE, \ 32 .virtual = (unsigned long) MSM_##name##_BASE, \
33 .pfn = __phys_to_pfn(MSM_##name##_PHYS), \ 33 .pfn = __phys_to_pfn(chip##_##name##_PHYS), \
34 .length = MSM_##name##_SIZE, \ 34 .length = chip##_##name##_SIZE, \
35 .type = MT_DEVICE_NONSHARED, \ 35 .type = MT_DEVICE_NONSHARED, \
36 } 36 }
37 37
38#define MSM_DEVICE(name) MSM_CHIP_DEVICE(name, MSM)
39
38#if defined(CONFIG_ARCH_MSM7X00A) || defined(CONFIG_ARCH_MSM7X27) \ 40#if defined(CONFIG_ARCH_MSM7X00A) || defined(CONFIG_ARCH_MSM7X27) \
39 || defined(CONFIG_ARCH_MSM7X25) 41 || defined(CONFIG_ARCH_MSM7X25)
40static struct map_desc msm_io_desc[] __initdata = { 42static struct map_desc msm_io_desc[] __initdata = {
41 MSM_DEVICE(VIC), 43 MSM_DEVICE(VIC),
42 MSM_DEVICE(CSR), 44 MSM_CHIP_DEVICE(CSR, MSM7X00),
43 MSM_DEVICE(GPT),
44 MSM_DEVICE(DMOV), 45 MSM_DEVICE(DMOV),
45 MSM_DEVICE(GPIO1), 46 MSM_DEVICE(GPIO1),
46 MSM_DEVICE(GPIO2), 47 MSM_DEVICE(GPIO2),
@@ -73,8 +74,7 @@ void __init msm_map_common_io(void)
73#ifdef CONFIG_ARCH_QSD8X50 74#ifdef CONFIG_ARCH_QSD8X50
74static struct map_desc qsd8x50_io_desc[] __initdata = { 75static struct map_desc qsd8x50_io_desc[] __initdata = {
75 MSM_DEVICE(VIC), 76 MSM_DEVICE(VIC),
76 MSM_DEVICE(CSR), 77 MSM_CHIP_DEVICE(CSR, QSD8X50),
77 MSM_DEVICE(TMR),
78 MSM_DEVICE(DMOV), 78 MSM_DEVICE(DMOV),
79 MSM_DEVICE(GPIO1), 79 MSM_DEVICE(GPIO1),
80 MSM_DEVICE(GPIO2), 80 MSM_DEVICE(GPIO2),
@@ -102,10 +102,10 @@ void __init msm_map_qsd8x50_io(void)
102 102
103#ifdef CONFIG_ARCH_MSM8X60 103#ifdef CONFIG_ARCH_MSM8X60
104static struct map_desc msm8x60_io_desc[] __initdata = { 104static struct map_desc msm8x60_io_desc[] __initdata = {
105 MSM_DEVICE(QGIC_DIST), 105 MSM_CHIP_DEVICE(QGIC_DIST, MSM8X60),
106 MSM_DEVICE(QGIC_CPU), 106 MSM_CHIP_DEVICE(QGIC_CPU, MSM8X60),
107 MSM_DEVICE(TMR), 107 MSM_CHIP_DEVICE(TMR, MSM8X60),
108 MSM_DEVICE(TMR0), 108 MSM_CHIP_DEVICE(TMR0, MSM8X60),
109 MSM_DEVICE(ACC), 109 MSM_DEVICE(ACC),
110 MSM_DEVICE(GCC), 110 MSM_DEVICE(GCC),
111}; 111};
@@ -116,11 +116,24 @@ void __init msm_map_msm8x60_io(void)
116} 116}
117#endif /* CONFIG_ARCH_MSM8X60 */ 117#endif /* CONFIG_ARCH_MSM8X60 */
118 118
119#ifdef CONFIG_ARCH_MSM8960
120static struct map_desc msm8960_io_desc[] __initdata = {
121 MSM_CHIP_DEVICE(QGIC_DIST, MSM8960),
122 MSM_CHIP_DEVICE(QGIC_CPU, MSM8960),
123 MSM_CHIP_DEVICE(TMR, MSM8960),
124 MSM_CHIP_DEVICE(TMR0, MSM8960),
125};
126
127void __init msm_map_msm8960_io(void)
128{
129 iotable_init(msm8960_io_desc, ARRAY_SIZE(msm8960_io_desc));
130}
131#endif /* CONFIG_ARCH_MSM8960 */
132
119#ifdef CONFIG_ARCH_MSM7X30 133#ifdef CONFIG_ARCH_MSM7X30
120static struct map_desc msm7x30_io_desc[] __initdata = { 134static struct map_desc msm7x30_io_desc[] __initdata = {
121 MSM_DEVICE(VIC), 135 MSM_DEVICE(VIC),
122 MSM_DEVICE(CSR), 136 MSM_CHIP_DEVICE(CSR, MSM7X30),
123 MSM_DEVICE(TMR),
124 MSM_DEVICE(DMOV), 137 MSM_DEVICE(DMOV),
125 MSM_DEVICE(GPIO1), 138 MSM_DEVICE(GPIO1),
126 MSM_DEVICE(GPIO2), 139 MSM_DEVICE(GPIO2),
diff --git a/arch/arm/mach-msm/iommu.c b/arch/arm/mach-msm/iommu.c
index e2d58e4cb0d7..1a584e077c61 100644
--- a/arch/arm/mach-msm/iommu.c
+++ b/arch/arm/mach-msm/iommu.c
@@ -1,4 +1,4 @@
1/* Copyright (c) 2010, Code Aurora Forum. All rights reserved. 1/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
2 * 2 *
3 * This program is free software; you can redistribute it and/or modify 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 4 * it under the terms of the GNU General Public License version 2 and
@@ -26,6 +26,7 @@
26#include <linux/spinlock.h> 26#include <linux/spinlock.h>
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/iommu.h> 28#include <linux/iommu.h>
29#include <linux/clk.h>
29 30
30#include <asm/cacheflush.h> 31#include <asm/cacheflush.h>
31#include <asm/sizes.h> 32#include <asm/sizes.h>
@@ -50,6 +51,30 @@ struct msm_priv {
50 struct list_head list_attached; 51 struct list_head list_attached;
51}; 52};
52 53
54static int __enable_clocks(struct msm_iommu_drvdata *drvdata)
55{
56 int ret;
57
58 ret = clk_enable(drvdata->pclk);
59 if (ret)
60 goto fail;
61
62 if (drvdata->clk) {
63 ret = clk_enable(drvdata->clk);
64 if (ret)
65 clk_disable(drvdata->pclk);
66 }
67fail:
68 return ret;
69}
70
71static void __disable_clocks(struct msm_iommu_drvdata *drvdata)
72{
73 if (drvdata->clk)
74 clk_disable(drvdata->clk);
75 clk_disable(drvdata->pclk);
76}
77
53static int __flush_iotlb(struct iommu_domain *domain) 78static int __flush_iotlb(struct iommu_domain *domain)
54{ 79{
55 struct msm_priv *priv = domain->priv; 80 struct msm_priv *priv = domain->priv;
@@ -77,9 +102,16 @@ static int __flush_iotlb(struct iommu_domain *domain)
77 BUG(); 102 BUG();
78 103
79 iommu_drvdata = dev_get_drvdata(ctx_drvdata->pdev->dev.parent); 104 iommu_drvdata = dev_get_drvdata(ctx_drvdata->pdev->dev.parent);
105 BUG_ON(!iommu_drvdata);
106
107 ret = __enable_clocks(iommu_drvdata);
108 if (ret)
109 goto fail;
110
80 SET_CTX_TLBIALL(iommu_drvdata->base, ctx_drvdata->num, 0); 111 SET_CTX_TLBIALL(iommu_drvdata->base, ctx_drvdata->num, 0);
112 __disable_clocks(iommu_drvdata);
81 } 113 }
82 114fail:
83 return ret; 115 return ret;
84} 116}
85 117
@@ -105,7 +137,6 @@ static void __reset_context(void __iomem *base, int ctx)
105 SET_TLBLKCR(base, ctx, 0); 137 SET_TLBLKCR(base, ctx, 0);
106 SET_PRRR(base, ctx, 0); 138 SET_PRRR(base, ctx, 0);
107 SET_NMRR(base, ctx, 0); 139 SET_NMRR(base, ctx, 0);
108 SET_CONTEXTIDR(base, ctx, 0);
109} 140}
110 141
111static void __program_context(void __iomem *base, int ctx, phys_addr_t pgtable) 142static void __program_context(void __iomem *base, int ctx, phys_addr_t pgtable)
@@ -265,9 +296,14 @@ static int msm_iommu_attach_dev(struct iommu_domain *domain, struct device *dev)
265 goto fail; 296 goto fail;
266 } 297 }
267 298
299 ret = __enable_clocks(iommu_drvdata);
300 if (ret)
301 goto fail;
302
268 __program_context(iommu_drvdata->base, ctx_dev->num, 303 __program_context(iommu_drvdata->base, ctx_dev->num,
269 __pa(priv->pgtable)); 304 __pa(priv->pgtable));
270 305
306 __disable_clocks(iommu_drvdata);
271 list_add(&(ctx_drvdata->attached_elm), &priv->list_attached); 307 list_add(&(ctx_drvdata->attached_elm), &priv->list_attached);
272 ret = __flush_iotlb(domain); 308 ret = __flush_iotlb(domain);
273 309
@@ -303,7 +339,12 @@ static void msm_iommu_detach_dev(struct iommu_domain *domain,
303 if (ret) 339 if (ret)
304 goto fail; 340 goto fail;
305 341
342 ret = __enable_clocks(iommu_drvdata);
343 if (ret)
344 goto fail;
345
306 __reset_context(iommu_drvdata->base, ctx_dev->num); 346 __reset_context(iommu_drvdata->base, ctx_dev->num);
347 __disable_clocks(iommu_drvdata);
307 list_del_init(&ctx_drvdata->attached_elm); 348 list_del_init(&ctx_drvdata->attached_elm);
308 349
309fail: 350fail:
@@ -376,11 +417,11 @@ static int msm_iommu_map(struct iommu_domain *domain, unsigned long va,
376 for (i = 0; i < 16; i++) 417 for (i = 0; i < 16; i++)
377 *(fl_pte+i) = (pa & 0xFF000000) | FL_SUPERSECTION | 418 *(fl_pte+i) = (pa & 0xFF000000) | FL_SUPERSECTION |
378 FL_AP_READ | FL_AP_WRITE | FL_TYPE_SECT | 419 FL_AP_READ | FL_AP_WRITE | FL_TYPE_SECT |
379 FL_SHARED | pgprot; 420 FL_SHARED | FL_NG | pgprot;
380 } 421 }
381 422
382 if (len == SZ_1M) 423 if (len == SZ_1M)
383 *fl_pte = (pa & 0xFFF00000) | FL_AP_READ | FL_AP_WRITE | 424 *fl_pte = (pa & 0xFFF00000) | FL_AP_READ | FL_AP_WRITE | FL_NG |
384 FL_TYPE_SECT | FL_SHARED | pgprot; 425 FL_TYPE_SECT | FL_SHARED | pgprot;
385 426
386 /* Need a 2nd level table */ 427 /* Need a 2nd level table */
@@ -405,7 +446,7 @@ static int msm_iommu_map(struct iommu_domain *domain, unsigned long va,
405 446
406 447
407 if (len == SZ_4K) 448 if (len == SZ_4K)
408 *sl_pte = (pa & SL_BASE_MASK_SMALL) | SL_AP0 | SL_AP1 | 449 *sl_pte = (pa & SL_BASE_MASK_SMALL) | SL_AP0 | SL_AP1 | SL_NG |
409 SL_SHARED | SL_TYPE_SMALL | pgprot; 450 SL_SHARED | SL_TYPE_SMALL | pgprot;
410 451
411 if (len == SZ_64K) { 452 if (len == SZ_64K) {
@@ -413,7 +454,7 @@ static int msm_iommu_map(struct iommu_domain *domain, unsigned long va,
413 454
414 for (i = 0; i < 16; i++) 455 for (i = 0; i < 16; i++)
415 *(sl_pte+i) = (pa & SL_BASE_MASK_LARGE) | SL_AP0 | 456 *(sl_pte+i) = (pa & SL_BASE_MASK_LARGE) | SL_AP0 |
416 SL_AP1 | SL_SHARED | SL_TYPE_LARGE | pgprot; 457 SL_NG | SL_AP1 | SL_SHARED | SL_TYPE_LARGE | pgprot;
417 } 458 }
418 459
419 ret = __flush_iotlb(domain); 460 ret = __flush_iotlb(domain);
@@ -532,9 +573,13 @@ static phys_addr_t msm_iommu_iova_to_phys(struct iommu_domain *domain,
532 base = iommu_drvdata->base; 573 base = iommu_drvdata->base;
533 ctx = ctx_drvdata->num; 574 ctx = ctx_drvdata->num;
534 575
576 ret = __enable_clocks(iommu_drvdata);
577 if (ret)
578 goto fail;
579
535 /* Invalidate context TLB */ 580 /* Invalidate context TLB */
536 SET_CTX_TLBIALL(base, ctx, 0); 581 SET_CTX_TLBIALL(base, ctx, 0);
537 SET_V2PPR_VA(base, ctx, va >> V2Pxx_VA_SHIFT); 582 SET_V2PPR(base, ctx, va & V2Pxx_VA);
538 583
539 par = GET_PAR(base, ctx); 584 par = GET_PAR(base, ctx);
540 585
@@ -547,6 +592,7 @@ static phys_addr_t msm_iommu_iova_to_phys(struct iommu_domain *domain,
547 if (GET_FAULT(base, ctx)) 592 if (GET_FAULT(base, ctx))
548 ret = 0; 593 ret = 0;
549 594
595 __disable_clocks(iommu_drvdata);
550fail: 596fail:
551 spin_unlock_irqrestore(&msm_iommu_lock, flags); 597 spin_unlock_irqrestore(&msm_iommu_lock, flags);
552 return ret; 598 return ret;
@@ -590,7 +636,7 @@ irqreturn_t msm_iommu_fault_handler(int irq, void *dev_id)
590 struct msm_iommu_drvdata *drvdata = dev_id; 636 struct msm_iommu_drvdata *drvdata = dev_id;
591 void __iomem *base; 637 void __iomem *base;
592 unsigned int fsr; 638 unsigned int fsr;
593 int ncb, i; 639 int i, ret;
594 640
595 spin_lock(&msm_iommu_lock); 641 spin_lock(&msm_iommu_lock);
596 642
@@ -604,8 +650,11 @@ irqreturn_t msm_iommu_fault_handler(int irq, void *dev_id)
604 pr_err("Unexpected IOMMU page fault!\n"); 650 pr_err("Unexpected IOMMU page fault!\n");
605 pr_err("base = %08x\n", (unsigned int) base); 651 pr_err("base = %08x\n", (unsigned int) base);
606 652
607 ncb = GET_NCB(base)+1; 653 ret = __enable_clocks(drvdata);
608 for (i = 0; i < ncb; i++) { 654 if (ret)
655 goto fail;
656
657 for (i = 0; i < drvdata->ncb; i++) {
609 fsr = GET_FSR(base, i); 658 fsr = GET_FSR(base, i);
610 if (fsr) { 659 if (fsr) {
611 pr_err("Fault occurred in context %d.\n", i); 660 pr_err("Fault occurred in context %d.\n", i);
@@ -614,6 +663,7 @@ irqreturn_t msm_iommu_fault_handler(int irq, void *dev_id)
614 SET_FSR(base, i, 0x4000000F); 663 SET_FSR(base, i, 0x4000000F);
615 } 664 }
616 } 665 }
666 __disable_clocks(drvdata);
617fail: 667fail:
618 spin_unlock(&msm_iommu_lock); 668 spin_unlock(&msm_iommu_lock);
619 return 0; 669 return 0;
diff --git a/arch/arm/mach-msm/iommu_dev.c b/arch/arm/mach-msm/iommu_dev.c
index b83c73b41fd1..8e8fb079852d 100644
--- a/arch/arm/mach-msm/iommu_dev.c
+++ b/arch/arm/mach-msm/iommu_dev.c
@@ -1,4 +1,4 @@
1/* Copyright (c) 2010, Code Aurora Forum. All rights reserved. 1/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
2 * 2 *
3 * This program is free software; you can redistribute it and/or modify 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 4 * it under the terms of the GNU General Public License version 2 and
@@ -29,6 +29,7 @@
29 29
30#include <mach/iommu_hw-8xxx.h> 30#include <mach/iommu_hw-8xxx.h>
31#include <mach/iommu.h> 31#include <mach/iommu.h>
32#include <mach/clk.h>
32 33
33struct iommu_ctx_iter_data { 34struct iommu_ctx_iter_data {
34 /* input */ 35 /* input */
@@ -84,9 +85,9 @@ fail:
84} 85}
85EXPORT_SYMBOL(msm_iommu_get_ctx); 86EXPORT_SYMBOL(msm_iommu_get_ctx);
86 87
87static void msm_iommu_reset(void __iomem *base) 88static void msm_iommu_reset(void __iomem *base, int ncb)
88{ 89{
89 int ctx, ncb; 90 int ctx;
90 91
91 SET_RPUE(base, 0); 92 SET_RPUE(base, 0);
92 SET_RPUEIE(base, 0); 93 SET_RPUEIE(base, 0);
@@ -99,7 +100,6 @@ static void msm_iommu_reset(void __iomem *base)
99 SET_GLOBAL_TLBIALL(base, 0); 100 SET_GLOBAL_TLBIALL(base, 0);
100 SET_RPU_ACR(base, 0); 101 SET_RPU_ACR(base, 0);
101 SET_TLBLKCRWE(base, 1); 102 SET_TLBLKCRWE(base, 1);
102 ncb = GET_NCB(base)+1;
103 103
104 for (ctx = 0; ctx < ncb; ctx++) { 104 for (ctx = 0; ctx < ncb; ctx++) {
105 SET_BPRCOSH(base, ctx, 0); 105 SET_BPRCOSH(base, ctx, 0);
@@ -130,117 +130,140 @@ static int msm_iommu_probe(struct platform_device *pdev)
130{ 130{
131 struct resource *r, *r2; 131 struct resource *r, *r2;
132 struct clk *iommu_clk; 132 struct clk *iommu_clk;
133 struct clk *iommu_pclk;
133 struct msm_iommu_drvdata *drvdata; 134 struct msm_iommu_drvdata *drvdata;
134 struct msm_iommu_dev *iommu_dev = pdev->dev.platform_data; 135 struct msm_iommu_dev *iommu_dev = pdev->dev.platform_data;
135 void __iomem *regs_base; 136 void __iomem *regs_base;
136 resource_size_t len; 137 resource_size_t len;
137 int ret = 0, ncb, nm2v, irq; 138 int ret, irq, par;
138 139
139 if (pdev->id != -1) { 140 if (pdev->id == -1) {
140 drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL); 141 msm_iommu_root_dev = pdev;
142 return 0;
143 }
141 144
142 if (!drvdata) { 145 drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
143 ret = -ENOMEM;
144 goto fail;
145 }
146 146
147 if (!iommu_dev) { 147 if (!drvdata) {
148 ret = -ENODEV; 148 ret = -ENOMEM;
149 goto fail; 149 goto fail;
150 } 150 }
151 151
152 if (iommu_dev->clk_rate != 0) { 152 if (!iommu_dev) {
153 iommu_clk = clk_get(&pdev->dev, "iommu_clk"); 153 ret = -ENODEV;
154 154 goto fail;
155 if (IS_ERR(iommu_clk)) { 155 }
156 ret = -ENODEV; 156
157 goto fail; 157 iommu_pclk = clk_get(NULL, "smmu_pclk");
158 } 158 if (IS_ERR(iommu_pclk)) {
159 159 ret = -ENODEV;
160 if (iommu_dev->clk_rate > 0) { 160 goto fail;
161 ret = clk_set_rate(iommu_clk, 161 }
162 iommu_dev->clk_rate); 162
163 if (ret) { 163 ret = clk_enable(iommu_pclk);
164 clk_put(iommu_clk); 164 if (ret)
165 goto fail; 165 goto fail_enable;
166 } 166
167 } 167 iommu_clk = clk_get(&pdev->dev, "iommu_clk");
168 168
169 ret = clk_enable(iommu_clk); 169 if (!IS_ERR(iommu_clk)) {
170 if (ret) { 170 if (clk_get_rate(iommu_clk) == 0)
171 clk_put(iommu_clk); 171 clk_set_min_rate(iommu_clk, 1);
172 goto fail; 172
173 } 173 ret = clk_enable(iommu_clk);
174 if (ret) {
174 clk_put(iommu_clk); 175 clk_put(iommu_clk);
176 goto fail_pclk;
175 } 177 }
178 } else
179 iommu_clk = NULL;
176 180
177 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, 181 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "physbase");
178 "physbase");
179 if (!r) {
180 ret = -ENODEV;
181 goto fail;
182 }
183 182
184 len = r->end - r->start + 1; 183 if (!r) {
184 ret = -ENODEV;
185 goto fail_clk;
186 }
185 187
186 r2 = request_mem_region(r->start, len, r->name); 188 len = resource_size(r);
187 if (!r2) {
188 pr_err("Could not request memory region: "
189 "start=%p, len=%d\n", (void *) r->start, len);
190 ret = -EBUSY;
191 goto fail;
192 }
193 189
194 regs_base = ioremap(r2->start, len); 190 r2 = request_mem_region(r->start, len, r->name);
191 if (!r2) {
192 pr_err("Could not request memory region: start=%p, len=%d\n",
193 (void *) r->start, len);
194 ret = -EBUSY;
195 goto fail_clk;
196 }
195 197
196 if (!regs_base) { 198 regs_base = ioremap(r2->start, len);
197 pr_err("Could not ioremap: start=%p, len=%d\n",
198 (void *) r2->start, len);
199 ret = -EBUSY;
200 goto fail_mem;
201 }
202 199
203 irq = platform_get_irq_byname(pdev, "secure_irq"); 200 if (!regs_base) {
204 if (irq < 0) { 201 pr_err("Could not ioremap: start=%p, len=%d\n",
205 ret = -ENODEV; 202 (void *) r2->start, len);
206 goto fail_io; 203 ret = -EBUSY;
207 } 204 goto fail_mem;
205 }
208 206
209 mb(); 207 irq = platform_get_irq_byname(pdev, "secure_irq");
208 if (irq < 0) {
209 ret = -ENODEV;
210 goto fail_io;
211 }
210 212
211 if (GET_IDR(regs_base) == 0) { 213 msm_iommu_reset(regs_base, iommu_dev->ncb);
212 pr_err("Invalid IDR value detected\n");
213 ret = -ENODEV;
214 goto fail_io;
215 }
216 214
217 ret = request_irq(irq, msm_iommu_fault_handler, 0, 215 SET_M(regs_base, 0, 1);
218 "msm_iommu_secure_irpt_handler", drvdata); 216 SET_PAR(regs_base, 0, 0);
219 if (ret) { 217 SET_V2PCFG(regs_base, 0, 1);
220 pr_err("Request IRQ %d failed with ret=%d\n", irq, ret); 218 SET_V2PPR(regs_base, 0, 0);
221 goto fail_io; 219 par = GET_PAR(regs_base, 0);
222 } 220 SET_V2PCFG(regs_base, 0, 0);
221 SET_M(regs_base, 0, 0);
223 222
224 msm_iommu_reset(regs_base); 223 if (!par) {
225 drvdata->base = regs_base; 224 pr_err("%s: Invalid PAR value detected\n", iommu_dev->name);
226 drvdata->irq = irq; 225 ret = -ENODEV;
226 goto fail_io;
227 }
227 228
228 nm2v = GET_NM2VCBMT((unsigned long) regs_base); 229 ret = request_irq(irq, msm_iommu_fault_handler, 0,
229 ncb = GET_NCB((unsigned long) regs_base); 230 "msm_iommu_secure_irpt_handler", drvdata);
231 if (ret) {
232 pr_err("Request IRQ %d failed with ret=%d\n", irq, ret);
233 goto fail_io;
234 }
230 235
231 pr_info("device %s mapped at %p, irq %d with %d ctx banks\n",
232 iommu_dev->name, regs_base, irq, ncb+1);
233 236
234 platform_set_drvdata(pdev, drvdata); 237 drvdata->pclk = iommu_pclk;
235 } else 238 drvdata->clk = iommu_clk;
236 msm_iommu_root_dev = pdev; 239 drvdata->base = regs_base;
240 drvdata->irq = irq;
241 drvdata->ncb = iommu_dev->ncb;
237 242
238 return 0; 243 pr_info("device %s mapped at %p, irq %d with %d ctx banks\n",
244 iommu_dev->name, regs_base, irq, iommu_dev->ncb);
245
246 platform_set_drvdata(pdev, drvdata);
247
248 if (iommu_clk)
249 clk_disable(iommu_clk);
250
251 clk_disable(iommu_pclk);
239 252
253 return 0;
240fail_io: 254fail_io:
241 iounmap(regs_base); 255 iounmap(regs_base);
242fail_mem: 256fail_mem:
243 release_mem_region(r->start, len); 257 release_mem_region(r->start, len);
258fail_clk:
259 if (iommu_clk) {
260 clk_disable(iommu_clk);
261 clk_put(iommu_clk);
262 }
263fail_pclk:
264 clk_disable(iommu_pclk);
265fail_enable:
266 clk_put(iommu_pclk);
244fail: 267fail:
245 kfree(drvdata); 268 kfree(drvdata);
246 return ret; 269 return ret;
@@ -252,7 +275,10 @@ static int msm_iommu_remove(struct platform_device *pdev)
252 275
253 drv = platform_get_drvdata(pdev); 276 drv = platform_get_drvdata(pdev);
254 if (drv) { 277 if (drv) {
255 memset(drv, 0, sizeof(struct msm_iommu_drvdata)); 278 if (drv->clk)
279 clk_put(drv->clk);
280 clk_put(drv->pclk);
281 memset(drv, 0, sizeof(*drv));
256 kfree(drv); 282 kfree(drv);
257 platform_set_drvdata(pdev, NULL); 283 platform_set_drvdata(pdev, NULL);
258 } 284 }
@@ -264,7 +290,7 @@ static int msm_iommu_ctx_probe(struct platform_device *pdev)
264 struct msm_iommu_ctx_dev *c = pdev->dev.platform_data; 290 struct msm_iommu_ctx_dev *c = pdev->dev.platform_data;
265 struct msm_iommu_drvdata *drvdata; 291 struct msm_iommu_drvdata *drvdata;
266 struct msm_iommu_ctx_drvdata *ctx_drvdata = NULL; 292 struct msm_iommu_ctx_drvdata *ctx_drvdata = NULL;
267 int i, ret = 0; 293 int i, ret;
268 if (!c || !pdev->dev.parent) { 294 if (!c || !pdev->dev.parent) {
269 ret = -EINVAL; 295 ret = -EINVAL;
270 goto fail; 296 goto fail;
@@ -288,6 +314,18 @@ static int msm_iommu_ctx_probe(struct platform_device *pdev)
288 INIT_LIST_HEAD(&ctx_drvdata->attached_elm); 314 INIT_LIST_HEAD(&ctx_drvdata->attached_elm);
289 platform_set_drvdata(pdev, ctx_drvdata); 315 platform_set_drvdata(pdev, ctx_drvdata);
290 316
317 ret = clk_enable(drvdata->pclk);
318 if (ret)
319 goto fail;
320
321 if (drvdata->clk) {
322 ret = clk_enable(drvdata->clk);
323 if (ret) {
324 clk_disable(drvdata->pclk);
325 goto fail;
326 }
327 }
328
291 /* Program the M2V tables for this context */ 329 /* Program the M2V tables for this context */
292 for (i = 0; i < MAX_NUM_MIDS; i++) { 330 for (i = 0; i < MAX_NUM_MIDS; i++) {
293 int mid = c->mids[i]; 331 int mid = c->mids[i];
@@ -297,21 +335,27 @@ static int msm_iommu_ctx_probe(struct platform_device *pdev)
297 SET_M2VCBR_N(drvdata->base, mid, 0); 335 SET_M2VCBR_N(drvdata->base, mid, 0);
298 SET_CBACR_N(drvdata->base, c->num, 0); 336 SET_CBACR_N(drvdata->base, c->num, 0);
299 337
300 /* Set VMID = MID */ 338 /* Set VMID = 0 */
301 SET_VMID(drvdata->base, mid, mid); 339 SET_VMID(drvdata->base, mid, 0);
302 340
303 /* Set the context number for that MID to this context */ 341 /* Set the context number for that MID to this context */
304 SET_CBNDX(drvdata->base, mid, c->num); 342 SET_CBNDX(drvdata->base, mid, c->num);
305 343
306 /* Set MID associated with this context bank */ 344 /* Set MID associated with this context bank to 0*/
307 SET_CBVMID(drvdata->base, c->num, mid); 345 SET_CBVMID(drvdata->base, c->num, 0);
346
347 /* Set the ASID for TLB tagging for this context */
348 SET_CONTEXTIDR_ASID(drvdata->base, c->num, c->num);
308 349
309 /* Set security bit override to be Non-secure */ 350 /* Set security bit override to be Non-secure */
310 SET_NSCFG(drvdata->base, mid, 3); 351 SET_NSCFG(drvdata->base, mid, 3);
311 } 352 }
312 353
313 pr_info("context device %s with bank index %d\n", c->name, c->num); 354 if (drvdata->clk)
355 clk_disable(drvdata->clk);
356 clk_disable(drvdata->pclk);
314 357
358 dev_info(&pdev->dev, "context %s using bank %d\n", c->name, c->num);
315 return 0; 359 return 0;
316fail: 360fail:
317 kfree(ctx_drvdata); 361 kfree(ctx_drvdata);
diff --git a/arch/arm/mach-msm/scm-boot.h b/arch/arm/mach-msm/scm-boot.h
index 68f9b6153d74..7be32ff5d687 100644
--- a/arch/arm/mach-msm/scm-boot.h
+++ b/arch/arm/mach-msm/scm-boot.h
@@ -1,29 +1,13 @@
1/* Copyright (c) 2010, Code Aurora Forum. All rights reserved. 1/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
2 * 2 *
3 * Redistribution and use in source and binary forms, with or without 3 * This program is free software; you can redistribute it and/or modify
4 * modification, are permitted provided that the following conditions are 4 * it under the terms of the GNU General Public License version 2 and
5 * met: 5 * only version 2 as published by the Free Software Foundation.
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above
9 * copyright notice, this list of conditions and the following
10 * disclaimer in the documentation and/or other materials provided
11 * with the distribution.
12 * * Neither the name of Code Aurora Forum, Inc. nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 * 6 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 7 * This program is distributed in the hope that it will be useful,
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 10 * GNU General Public License for more details.
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 11 */
28#ifndef __MACH_SCM_BOOT_H 12#ifndef __MACH_SCM_BOOT_H
29#define __MACH_SCM_BOOT_H 13#define __MACH_SCM_BOOT_H
diff --git a/arch/arm/mach-msm/scm.c b/arch/arm/mach-msm/scm.c
index f4b9bc90d6a7..cfa808dd4897 100644
--- a/arch/arm/mach-msm/scm.c
+++ b/arch/arm/mach-msm/scm.c
@@ -174,15 +174,18 @@ static u32 smc(u32 cmd_addr)
174 register u32 r0 asm("r0") = 1; 174 register u32 r0 asm("r0") = 1;
175 register u32 r1 asm("r1") = (u32)&context_id; 175 register u32 r1 asm("r1") = (u32)&context_id;
176 register u32 r2 asm("r2") = cmd_addr; 176 register u32 r2 asm("r2") = cmd_addr;
177 asm( 177 do {
178 __asmeq("%0", "r0") 178 asm volatile(
179 __asmeq("%1", "r0") 179 __asmeq("%0", "r0")
180 __asmeq("%2", "r1") 180 __asmeq("%1", "r0")
181 __asmeq("%3", "r2") 181 __asmeq("%2", "r1")
182 "smc #0 @ switch to secure world\n" 182 __asmeq("%3", "r2")
183 : "=r" (r0) 183 "smc #0 @ switch to secure world\n"
184 : "r" (r0), "r" (r1), "r" (r2) 184 : "=r" (r0)
185 : "r3"); 185 : "r" (r0), "r" (r1), "r" (r2)
186 : "r3");
187 } while (r0 == SCM_INTERRUPTED);
188
186 return r0; 189 return r0;
187} 190}
188 191
@@ -197,13 +200,9 @@ static int __scm_call(const struct scm_command *cmd)
197 * side in the buffer. 200 * side in the buffer.
198 */ 201 */
199 flush_cache_all(); 202 flush_cache_all();
200 do { 203 ret = smc(cmd_addr);
201 ret = smc(cmd_addr); 204 if (ret < 0)
202 if (ret < 0) { 205 ret = scm_remap_error(ret);
203 ret = scm_remap_error(ret);
204 break;
205 }
206 } while (ret == SCM_INTERRUPTED);
207 206
208 return ret; 207 return ret;
209} 208}
@@ -264,21 +263,28 @@ u32 scm_get_version(void)
264{ 263{
265 int context_id; 264 int context_id;
266 static u32 version = -1; 265 static u32 version = -1;
267 register u32 r0 asm("r0") = 0x1 << 8; 266 register u32 r0 asm("r0");
268 register u32 r1 asm("r1") = (u32)&context_id; 267 register u32 r1 asm("r1");
269 268
270 if (version != -1) 269 if (version != -1)
271 return version; 270 return version;
272 271
273 mutex_lock(&scm_lock); 272 mutex_lock(&scm_lock);
274 asm( 273
275 __asmeq("%0", "r1") 274 r0 = 0x1 << 8;
276 __asmeq("%1", "r0") 275 r1 = (u32)&context_id;
277 __asmeq("%2", "r1") 276 do {
278 "smc #0 @ switch to secure world\n" 277 asm volatile(
279 : "=r" (r1) 278 __asmeq("%0", "r0")
280 : "r" (r0), "r" (r1) 279 __asmeq("%1", "r1")
281 : "r2", "r3"); 280 __asmeq("%2", "r0")
281 __asmeq("%3", "r1")
282 "smc #0 @ switch to secure world\n"
283 : "=r" (r0), "=r" (r1)
284 : "r" (r0), "r" (r1)
285 : "r2", "r3");
286 } while (r0 == SCM_INTERRUPTED);
287
282 version = r1; 288 version = r1;
283 mutex_unlock(&scm_lock); 289 mutex_unlock(&scm_lock);
284 290
diff --git a/arch/arm/mach-msm/scm.h b/arch/arm/mach-msm/scm.h
index 261786be11c5..00b31ea58f29 100644
--- a/arch/arm/mach-msm/scm.h
+++ b/arch/arm/mach-msm/scm.h
@@ -1,29 +1,13 @@
1/* Copyright (c) 2010, Code Aurora Forum. All rights reserved. 1/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
2 * 2 *
3 * Redistribution and use in source and binary forms, with or without 3 * This program is free software; you can redistribute it and/or modify
4 * modification, are permitted provided that the following conditions are 4 * it under the terms of the GNU General Public License version 2 and
5 * met: 5 * only version 2 as published by the Free Software Foundation.
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above
9 * copyright notice, this list of conditions and the following
10 * disclaimer in the documentation and/or other materials provided
11 * with the distribution.
12 * * Neither the name of Code Aurora Forum, Inc. nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 * 6 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 7 * This program is distributed in the hope that it will be useful,
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 10 * GNU General Public License for more details.
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 11 */
28#ifndef __MACH_SCM_H 12#ifndef __MACH_SCM_H
29#define __MACH_SCM_H 13#define __MACH_SCM_H
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c
index c105d28b53e3..56f920c55b6a 100644
--- a/arch/arm/mach-msm/timer.c
+++ b/arch/arm/mach-msm/timer.c
@@ -24,10 +24,7 @@
24 24
25#include <asm/mach/time.h> 25#include <asm/mach/time.h>
26#include <mach/msm_iomap.h> 26#include <mach/msm_iomap.h>
27 27#include <mach/cpu.h>
28#ifndef MSM_DGT_BASE
29#define MSM_DGT_BASE (MSM_GPT_BASE + 0x10)
30#endif
31 28
32#define TIMER_MATCH_VAL 0x0000 29#define TIMER_MATCH_VAL 0x0000
33#define TIMER_COUNT_VAL 0x0004 30#define TIMER_COUNT_VAL 0x0004
@@ -52,18 +49,14 @@ enum timer_location {
52 GLOBAL_TIMER = 1, 49 GLOBAL_TIMER = 1,
53}; 50};
54 51
55#ifdef MSM_TMR0_BASE
56#define MSM_TMR_GLOBAL (MSM_TMR0_BASE - MSM_TMR_BASE)
57#else
58#define MSM_TMR_GLOBAL 0
59#endif
60
61#define MSM_GLOBAL_TIMER MSM_CLOCK_DGT 52#define MSM_GLOBAL_TIMER MSM_CLOCK_DGT
62 53
54/* TODO: Remove these ifdefs */
63#if defined(CONFIG_ARCH_QSD8X50) 55#if defined(CONFIG_ARCH_QSD8X50)
64#define DGT_HZ (19200000 / 4) /* 19.2 MHz / 4 by default */ 56#define DGT_HZ (19200000 / 4) /* 19.2 MHz / 4 by default */
65#define MSM_DGT_SHIFT (0) 57#define MSM_DGT_SHIFT (0)
66#elif defined(CONFIG_ARCH_MSM7X30) || defined(CONFIG_ARCH_MSM8X60) 58#elif defined(CONFIG_ARCH_MSM7X30) || defined(CONFIG_ARCH_MSM8X60) || \
59 defined(CONFIG_ARCH_MSM8960)
67#define DGT_HZ (24576000 / 4) /* 24.576 MHz (LPXO) / 4 by default */ 60#define DGT_HZ (24576000 / 4) /* 24.576 MHz (LPXO) / 4 by default */
68#define MSM_DGT_SHIFT (0) 61#define MSM_DGT_SHIFT (0)
69#else 62#else
@@ -177,11 +170,7 @@ static struct msm_clock msm_clocks[] = {
177 .dev_id = &msm_clocks[0].clockevent, 170 .dev_id = &msm_clocks[0].clockevent,
178 .irq = INT_GP_TIMER_EXP 171 .irq = INT_GP_TIMER_EXP
179 }, 172 },
180 .regbase = MSM_GPT_BASE,
181 .freq = GPT_HZ, 173 .freq = GPT_HZ,
182 .local_counter = MSM_GPT_BASE + TIMER_COUNT_VAL,
183 .global_counter = MSM_GPT_BASE + TIMER_COUNT_VAL +
184 MSM_TMR_GLOBAL,
185 }, 174 },
186 [MSM_CLOCK_DGT] = { 175 [MSM_CLOCK_DGT] = {
187 .clockevent = { 176 .clockevent = {
@@ -206,12 +195,8 @@ static struct msm_clock msm_clocks[] = {
206 .dev_id = &msm_clocks[1].clockevent, 195 .dev_id = &msm_clocks[1].clockevent,
207 .irq = INT_DEBUG_TIMER_EXP 196 .irq = INT_DEBUG_TIMER_EXP
208 }, 197 },
209 .regbase = MSM_DGT_BASE,
210 .freq = DGT_HZ >> MSM_DGT_SHIFT, 198 .freq = DGT_HZ >> MSM_DGT_SHIFT,
211 .shift = MSM_DGT_SHIFT, 199 .shift = MSM_DGT_SHIFT,
212 .local_counter = MSM_DGT_BASE + TIMER_COUNT_VAL,
213 .global_counter = MSM_DGT_BASE + TIMER_COUNT_VAL +
214 MSM_TMR_GLOBAL,
215 } 200 }
216}; 201};
217 202
@@ -219,6 +204,25 @@ static void __init msm_timer_init(void)
219{ 204{
220 int i; 205 int i;
221 int res; 206 int res;
207 int global_offset = 0;
208
209 if (cpu_is_msm7x01()) {
210 msm_clocks[MSM_CLOCK_GPT].regbase = MSM_CSR_BASE;
211 msm_clocks[MSM_CLOCK_DGT].regbase = MSM_CSR_BASE + 0x10;
212 } else if (cpu_is_msm7x30()) {
213 msm_clocks[MSM_CLOCK_GPT].regbase = MSM_CSR_BASE + 0x04;
214 msm_clocks[MSM_CLOCK_DGT].regbase = MSM_CSR_BASE + 0x24;
215 } else if (cpu_is_qsd8x50()) {
216 msm_clocks[MSM_CLOCK_GPT].regbase = MSM_CSR_BASE;
217 msm_clocks[MSM_CLOCK_DGT].regbase = MSM_CSR_BASE + 0x10;
218 } else if (cpu_is_msm8x60() || cpu_is_msm8960()) {
219 msm_clocks[MSM_CLOCK_GPT].regbase = MSM_TMR_BASE + 0x04;
220 msm_clocks[MSM_CLOCK_DGT].regbase = MSM_TMR_BASE + 0x24;
221
222 /* Use CPU0's timer as the global timer. */
223 global_offset = MSM_TMR0_BASE - MSM_TMR_BASE;
224 } else
225 BUG();
222 226
223#ifdef CONFIG_ARCH_MSM_SCORPIONMP 227#ifdef CONFIG_ARCH_MSM_SCORPIONMP
224 writel(DGT_CLK_CTL_DIV_4, MSM_TMR_BASE + DGT_CLK_CTL); 228 writel(DGT_CLK_CTL_DIV_4, MSM_TMR_BASE + DGT_CLK_CTL);
@@ -228,6 +232,10 @@ static void __init msm_timer_init(void)
228 struct msm_clock *clock = &msm_clocks[i]; 232 struct msm_clock *clock = &msm_clocks[i];
229 struct clock_event_device *ce = &clock->clockevent; 233 struct clock_event_device *ce = &clock->clockevent;
230 struct clocksource *cs = &clock->clocksource; 234 struct clocksource *cs = &clock->clocksource;
235
236 clock->local_counter = clock->regbase + TIMER_COUNT_VAL;
237 clock->global_counter = clock->local_counter + global_offset;
238
231 writel(0, clock->regbase + TIMER_ENABLE); 239 writel(0, clock->regbase + TIMER_ENABLE);
232 writel(0, clock->regbase + TIMER_CLEAR); 240 writel(0, clock->regbase + TIMER_CLEAR);
233 writel(~0, clock->regbase + TIMER_MATCH_VAL); 241 writel(~0, clock->regbase + TIMER_MATCH_VAL);
@@ -255,7 +263,7 @@ static void __init msm_timer_init(void)
255} 263}
256 264
257#ifdef CONFIG_SMP 265#ifdef CONFIG_SMP
258void __cpuinit local_timer_setup(struct clock_event_device *evt) 266int __cpuinit local_timer_setup(struct clock_event_device *evt)
259{ 267{
260 struct msm_clock *clock = &msm_clocks[MSM_GLOBAL_TIMER]; 268 struct msm_clock *clock = &msm_clocks[MSM_GLOBAL_TIMER];
261 269
@@ -287,6 +295,7 @@ void __cpuinit local_timer_setup(struct clock_event_device *evt)
287 gic_enable_ppi(clock->irq.irq); 295 gic_enable_ppi(clock->irq.irq);
288 296
289 clockevents_register_device(evt); 297 clockevents_register_device(evt);
298 return 0;
290} 299}
291 300
292inline int local_timer_ack(void) 301inline int local_timer_ack(void)
diff --git a/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c b/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c
index 29e390e89ff4..20f3f125ed2b 100644
--- a/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c
+++ b/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c
@@ -148,6 +148,7 @@ MACHINE_START(TERASTATION_WXL, "Buffalo Nas WXL")
148 .boot_params = 0x00000100, 148 .boot_params = 0x00000100,
149 .init_machine = wxl_init, 149 .init_machine = wxl_init,
150 .map_io = mv78xx0_map_io, 150 .map_io = mv78xx0_map_io,
151 .init_early = mv78xx0_init_early,
151 .init_irq = mv78xx0_init_irq, 152 .init_irq = mv78xx0_init_irq,
152 .timer = &mv78xx0_timer, 153 .timer = &mv78xx0_timer,
153MACHINE_END 154MACHINE_END
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c
index 08465eb6a2c2..44fb4e55be0d 100644
--- a/arch/arm/mach-mv78xx0/common.c
+++ b/arch/arm/mach-mv78xx0/common.c
@@ -818,9 +818,15 @@ void __init mv78xx0_uart3_init(void)
818/***************************************************************************** 818/*****************************************************************************
819 * Time handling 819 * Time handling
820 ****************************************************************************/ 820 ****************************************************************************/
821void __init mv78xx0_init_early(void)
822{
823 orion_time_set_base(TIMER_VIRT_BASE);
824}
825
821static void mv78xx0_timer_init(void) 826static void mv78xx0_timer_init(void)
822{ 827{
823 orion_time_init(IRQ_MV78XX0_TIMER_1, get_tclk()); 828 orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR,
829 IRQ_MV78XX0_TIMER_1, get_tclk());
824} 830}
825 831
826struct sys_timer mv78xx0_timer = { 832struct sys_timer mv78xx0_timer = {
diff --git a/arch/arm/mach-mv78xx0/common.h b/arch/arm/mach-mv78xx0/common.h
index befc22475469..632e63d65e7a 100644
--- a/arch/arm/mach-mv78xx0/common.h
+++ b/arch/arm/mach-mv78xx0/common.h
@@ -20,6 +20,7 @@ struct mv_sata_platform_data;
20int mv78xx0_core_index(void); 20int mv78xx0_core_index(void);
21void mv78xx0_map_io(void); 21void mv78xx0_map_io(void);
22void mv78xx0_init(void); 22void mv78xx0_init(void);
23void mv78xx0_init_early(void);
23void mv78xx0_init_irq(void); 24void mv78xx0_init_irq(void);
24 25
25extern struct mbus_dram_target_info mv78xx0_mbus_dram_info; 26extern struct mbus_dram_target_info mv78xx0_mbus_dram_info;
diff --git a/arch/arm/mach-mv78xx0/db78x00-bp-setup.c b/arch/arm/mach-mv78xx0/db78x00-bp-setup.c
index 207c95e403b9..df5aebe5b0fa 100644
--- a/arch/arm/mach-mv78xx0/db78x00-bp-setup.c
+++ b/arch/arm/mach-mv78xx0/db78x00-bp-setup.c
@@ -96,6 +96,7 @@ MACHINE_START(DB78X00_BP, "Marvell DB-78x00-BP Development Board")
96 .boot_params = 0x00000100, 96 .boot_params = 0x00000100,
97 .init_machine = db78x00_init, 97 .init_machine = db78x00_init,
98 .map_io = mv78xx0_map_io, 98 .map_io = mv78xx0_map_io,
99 .init_early = mv78xx0_init_early,
99 .init_irq = mv78xx0_init_irq, 100 .init_irq = mv78xx0_init_irq,
100 .timer = &mv78xx0_timer, 101 .timer = &mv78xx0_timer,
101MACHINE_END 102MACHINE_END
diff --git a/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h b/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h
index 2d14c4fe294d..c64dbb96dbad 100644
--- a/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h
+++ b/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h
@@ -20,10 +20,6 @@
20#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE | 0x010c) 20#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE | 0x010c)
21#define SOFT_RESET 0x00000001 21#define SOFT_RESET 0x00000001
22 22
23#define BRIDGE_CAUSE (BRIDGE_VIRT_BASE | 0x0110)
24#define BRIDGE_MASK (BRIDGE_VIRT_BASE | 0x0114)
25#define BRIDGE_INT_TIMER0 0x0002
26#define BRIDGE_INT_TIMER1 0x0004
27#define BRIDGE_INT_TIMER1_CLR (~0x0004) 23#define BRIDGE_INT_TIMER1_CLR (~0x0004)
28 24
29#define IRQ_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0200) 25#define IRQ_VIRT_BASE (BRIDGE_VIRT_BASE | 0x0200)
diff --git a/arch/arm/mach-mv78xx0/include/mach/gpio.h b/arch/arm/mach-mv78xx0/include/mach/gpio.h
index d9d1535ea100..77e1b843e768 100644
--- a/arch/arm/mach-mv78xx0/include/mach/gpio.h
+++ b/arch/arm/mach-mv78xx0/include/mach/gpio.h
@@ -6,35 +6,4 @@
6 * warranty of any kind, whether express or implied. 6 * warranty of any kind, whether express or implied.
7 */ 7 */
8 8
9#ifndef __ASM_ARCH_GPIO_H
10#define __ASM_ARCH_GPIO_H
11
12#include <mach/irqs.h>
13#include <plat/gpio.h> 9#include <plat/gpio.h>
14#include <asm-generic/gpio.h> /* cansleep wrappers */
15
16extern int mv78xx0_core_index(void);
17
18#define GPIO_MAX 32
19#define GPIO_OUT(pin) (DEV_BUS_VIRT_BASE + 0x0100)
20#define GPIO_IO_CONF(pin) (DEV_BUS_VIRT_BASE + 0x0104)
21#define GPIO_BLINK_EN(pin) (DEV_BUS_VIRT_BASE + 0x0108)
22#define GPIO_IN_POL(pin) (DEV_BUS_VIRT_BASE + 0x010c)
23#define GPIO_DATA_IN(pin) (DEV_BUS_VIRT_BASE + 0x0110)
24#define GPIO_EDGE_CAUSE(pin) (DEV_BUS_VIRT_BASE + 0x0114)
25#define GPIO_MASK_OFF (mv78xx0_core_index() ? 0x18 : 0)
26#define GPIO_EDGE_MASK(pin) (DEV_BUS_VIRT_BASE + 0x0118 + GPIO_MASK_OFF)
27#define GPIO_LEVEL_MASK(pin) (DEV_BUS_VIRT_BASE + 0x011c + GPIO_MASK_OFF)
28
29static inline int gpio_to_irq(int pin)
30{
31 return pin + IRQ_MV78XX0_GPIO_START;
32}
33
34static inline int irq_to_gpio(int irq)
35{
36 return irq - IRQ_MV78XX0_GPIO_START;
37}
38
39
40#endif
diff --git a/arch/arm/mach-mv78xx0/include/mach/memory.h b/arch/arm/mach-mv78xx0/include/mach/memory.h
index e663042d307f..a648c51f2e42 100644
--- a/arch/arm/mach-mv78xx0/include/mach/memory.h
+++ b/arch/arm/mach-mv78xx0/include/mach/memory.h
@@ -5,6 +5,6 @@
5#ifndef __ASM_ARCH_MEMORY_H 5#ifndef __ASM_ARCH_MEMORY_H
6#define __ASM_ARCH_MEMORY_H 6#define __ASM_ARCH_MEMORY_H
7 7
8#define PHYS_OFFSET UL(0x00000000) 8#define PLAT_PHYS_OFFSET UL(0x00000000)
9 9
10#endif 10#endif
diff --git a/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h b/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h
index 3eff39921d4d..3674497162e3 100644
--- a/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h
+++ b/arch/arm/mach-mv78xx0/include/mach/mv78xx0.h
@@ -71,6 +71,7 @@
71#define DEV_BUS_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x10000) 71#define DEV_BUS_VIRT_BASE (MV78XX0_REGS_VIRT_BASE | 0x10000)
72#define SAMPLE_AT_RESET_LOW (DEV_BUS_VIRT_BASE | 0x0030) 72#define SAMPLE_AT_RESET_LOW (DEV_BUS_VIRT_BASE | 0x0030)
73#define SAMPLE_AT_RESET_HIGH (DEV_BUS_VIRT_BASE | 0x0034) 73#define SAMPLE_AT_RESET_HIGH (DEV_BUS_VIRT_BASE | 0x0034)
74#define GPIO_VIRT_BASE (DEV_BUS_VIRT_BASE | 0x0100)
74#define I2C_0_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x1000) 75#define I2C_0_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x1000)
75#define I2C_1_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x1100) 76#define I2C_1_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x1100)
76#define UART0_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2000) 77#define UART0_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2000)
diff --git a/arch/arm/mach-mv78xx0/irq.c b/arch/arm/mach-mv78xx0/irq.c
index 22b4ff893b3c..08da497c39c2 100644
--- a/arch/arm/mach-mv78xx0/irq.c
+++ b/arch/arm/mach-mv78xx0/irq.c
@@ -26,28 +26,18 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
26 26
27void __init mv78xx0_init_irq(void) 27void __init mv78xx0_init_irq(void)
28{ 28{
29 int i;
30
31 /* Initialize gpiolib. */
32 orion_gpio_init();
33
34 orion_irq_init(0, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF)); 29 orion_irq_init(0, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_LOW_OFF));
35 orion_irq_init(32, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF)); 30 orion_irq_init(32, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_HIGH_OFF));
36 orion_irq_init(64, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_ERR_OFF)); 31 orion_irq_init(64, (void __iomem *)(IRQ_VIRT_BASE + IRQ_MASK_ERR_OFF));
37 32
38 /* 33 /*
39 * Mask and clear GPIO IRQ interrupts. 34 * Initialize gpiolib for GPIOs 0-31. (The GPIO interrupt mask
35 * registers for core #1 are at an offset of 0x18 from those of
36 * core #0.)
40 */ 37 */
41 writel(0, GPIO_LEVEL_MASK(0)); 38 orion_gpio_init(0, 32, GPIO_VIRT_BASE,
42 writel(0, GPIO_EDGE_MASK(0)); 39 mv78xx0_core_index() ? 0x18 : 0,
43 writel(0, GPIO_EDGE_CAUSE(0)); 40 IRQ_MV78XX0_GPIO_START);
44
45 for (i = IRQ_MV78XX0_GPIO_START; i < NR_IRQS; i++) {
46 set_irq_chip(i, &orion_gpio_irq_chip);
47 set_irq_handler(i, handle_level_irq);
48 irq_desc[i].status |= IRQ_LEVEL;
49 set_irq_flags(i, IRQF_VALID);
50 }
51 set_irq_chained_handler(IRQ_MV78XX0_GPIO_0_7, gpio_irq_handler); 41 set_irq_chained_handler(IRQ_MV78XX0_GPIO_0_7, gpio_irq_handler);
52 set_irq_chained_handler(IRQ_MV78XX0_GPIO_8_15, gpio_irq_handler); 42 set_irq_chained_handler(IRQ_MV78XX0_GPIO_8_15, gpio_irq_handler);
53 set_irq_chained_handler(IRQ_MV78XX0_GPIO_16_23, gpio_irq_handler); 43 set_irq_chained_handler(IRQ_MV78XX0_GPIO_16_23, gpio_irq_handler);
diff --git a/arch/arm/mach-mv78xx0/mpp.c b/arch/arm/mach-mv78xx0/mpp.c
index 84db2dfc475c..65b72c454cb0 100644
--- a/arch/arm/mach-mv78xx0/mpp.c
+++ b/arch/arm/mach-mv78xx0/mpp.c
@@ -44,9 +44,6 @@ void __init mv78xx0_mpp_conf(unsigned int *mpp_list)
44 if (!variant_mask) 44 if (!variant_mask)
45 return; 45 return;
46 46
47 /* Initialize gpiolib. */
48 orion_gpio_init();
49
50 printk(KERN_DEBUG "initial MPP regs:"); 47 printk(KERN_DEBUG "initial MPP regs:");
51 for (i = 0; i < MPP_NR_REGS; i++) { 48 for (i = 0; i < MPP_NR_REGS; i++) {
52 mpp_ctrl[i] = readl(MPP_CTRL(i)); 49 mpp_ctrl[i] = readl(MPP_CTRL(i));
diff --git a/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c b/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
index 3511ad4d973b..d927f14c6810 100644
--- a/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
+++ b/arch/arm/mach-mv78xx0/rd78x00-masa-setup.c
@@ -81,6 +81,7 @@ MACHINE_START(RD78X00_MASA, "Marvell RD-78x00-MASA Development Board")
81 .boot_params = 0x00000100, 81 .boot_params = 0x00000100,
82 .init_machine = rd78x00_masa_init, 82 .init_machine = rd78x00_masa_init,
83 .map_io = mv78xx0_map_io, 83 .map_io = mv78xx0_map_io,
84 .init_early = mv78xx0_init_early,
84 .init_irq = mv78xx0_init_irq, 85 .init_irq = mv78xx0_init_irq,
85 .timer = &mv78xx0_timer, 86 .timer = &mv78xx0_timer,
86MACHINE_END 87MACHINE_END
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index 0717f887cba0..340809a7d233 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -94,6 +94,7 @@ config MACH_MX31_3DS
94 select MXC_DEBUG_BOARD 94 select MXC_DEBUG_BOARD
95 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 95 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
96 select IMX_HAVE_PLATFORM_IMX2_WDT 96 select IMX_HAVE_PLATFORM_IMX2_WDT
97 select IMX_HAVE_PLATFORM_IMX_I2C
97 select IMX_HAVE_PLATFORM_IMX_KEYPAD 98 select IMX_HAVE_PLATFORM_IMX_KEYPAD
98 select IMX_HAVE_PLATFORM_IMX_UART 99 select IMX_HAVE_PLATFORM_IMX_UART
99 select IMX_HAVE_PLATFORM_MXC_EHCI 100 select IMX_HAVE_PLATFORM_MXC_EHCI
@@ -183,6 +184,7 @@ config MACH_MX35_3DS
183 select MXC_DEBUG_BOARD 184 select MXC_DEBUG_BOARD
184 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 185 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
185 select IMX_HAVE_PLATFORM_IMX2_WDT 186 select IMX_HAVE_PLATFORM_IMX2_WDT
187 select IMX_HAVE_PLATFORM_IMX_I2C
186 select IMX_HAVE_PLATFORM_IMX_UART 188 select IMX_HAVE_PLATFORM_IMX_UART
187 select IMX_HAVE_PLATFORM_MXC_EHCI 189 select IMX_HAVE_PLATFORM_MXC_EHCI
188 select IMX_HAVE_PLATFORM_MXC_NAND 190 select IMX_HAVE_PLATFORM_MXC_NAND
@@ -199,6 +201,15 @@ config MACH_KZM_ARM11_01
199 Include support for KZM-ARM11-01. This includes specific 201 Include support for KZM-ARM11-01. This includes specific
200 configurations for the board and its peripherals. 202 configurations for the board and its peripherals.
201 203
204config MACH_BUG
205 bool "Support Buglabs BUGBase platform"
206 select SOC_IMX31
207 select IMX_HAVE_PLATFORM_IMX_UART
208 default y
209 help
210 Include support for BUGBase 1.3 platform. This includes specific
211 configurations for the board and its peripherals.
212
202config MACH_EUKREA_CPUIMX35 213config MACH_EUKREA_CPUIMX35
203 bool "Support Eukrea CPUIMX35 Platform" 214 bool "Support Eukrea CPUIMX35 Platform"
204 select SOC_IMX35 215 select SOC_IMX35
@@ -229,4 +240,18 @@ config MACH_EUKREA_MBIMXSD35_BASEBOARD
229 240
230endchoice 241endchoice
231 242
243config MACH_VPR200
244 bool "Support VPR200 platform"
245 select SOC_IMX35
246 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
247 select IMX_HAVE_PLATFORM_IMX2_WDT
248 select IMX_HAVE_PLATFORM_IMX_UART
249 select IMX_HAVE_PLATFORM_IMX_I2C
250 select IMX_HAVE_PLATFORM_MXC_EHCI
251 select IMX_HAVE_PLATFORM_MXC_NAND
252 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
253 help
254 Include support for VPR200 platform. This includes specific
255 configurations for the board and its peripherals.
256
232endif 257endif
diff --git a/arch/arm/mach-mx3/Makefile b/arch/arm/mach-mx3/Makefile
index 8db13294ad27..a54faf2cf5fa 100644
--- a/arch/arm/mach-mx3/Makefile
+++ b/arch/arm/mach-mx3/Makefile
@@ -5,8 +5,8 @@
5# Object file lists. 5# Object file lists.
6 6
7obj-y := mm.o devices.o cpu.o 7obj-y := mm.o devices.o cpu.o
8obj-$(CONFIG_SOC_IMX31) += clock-imx31.o iomux-imx31.o 8obj-$(CONFIG_SOC_IMX31) += clock-imx31.o iomux-imx31.o ehci-imx31.o
9obj-$(CONFIG_SOC_IMX35) += clock-imx35.o 9obj-$(CONFIG_SOC_IMX35) += clock-imx35.o ehci-imx35.o
10obj-$(CONFIG_MACH_MX31ADS) += mach-mx31ads.o 10obj-$(CONFIG_MACH_MX31ADS) += mach-mx31ads.o
11obj-$(CONFIG_MACH_MX31LILLY) += mach-mx31lilly.o mx31lilly-db.o 11obj-$(CONFIG_MACH_MX31LILLY) += mach-mx31lilly.o mx31lilly-db.o
12obj-$(CONFIG_MACH_MX31LITE) += mach-mx31lite.o mx31lite-db.o 12obj-$(CONFIG_MACH_MX31LITE) += mach-mx31lite.o mx31lite-db.o
@@ -20,5 +20,7 @@ obj-$(CONFIG_MACH_PCM043) += mach-pcm043.o
20obj-$(CONFIG_MACH_ARMADILLO5X0) += mach-armadillo5x0.o 20obj-$(CONFIG_MACH_ARMADILLO5X0) += mach-armadillo5x0.o
21obj-$(CONFIG_MACH_MX35_3DS) += mach-mx35_3ds.o 21obj-$(CONFIG_MACH_MX35_3DS) += mach-mx35_3ds.o
22obj-$(CONFIG_MACH_KZM_ARM11_01) += mach-kzm_arm11_01.o 22obj-$(CONFIG_MACH_KZM_ARM11_01) += mach-kzm_arm11_01.o
23obj-$(CONFIG_MACH_BUG) += mach-bug.o
23obj-$(CONFIG_MACH_EUKREA_CPUIMX35) += mach-cpuimx35.o 24obj-$(CONFIG_MACH_EUKREA_CPUIMX35) += mach-cpuimx35.o
24obj-$(CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD) += eukrea_mbimxsd-baseboard.o 25obj-$(CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD) += eukrea_mbimxsd-baseboard.o
26obj-$(CONFIG_MACH_VPR200) += mach-vpr200.o
diff --git a/arch/arm/mach-mx3/devices-imx35.h b/arch/arm/mach-mx3/devices-imx35.h
index 677b18aa7ae6..d545d86cc202 100644
--- a/arch/arm/mach-mx3/devices-imx35.h
+++ b/arch/arm/mach-mx3/devices-imx35.h
@@ -35,7 +35,7 @@ extern const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst;
35#define imx35_add_imx_i2c2(pdata) imx35_add_imx_i2c(2, pdata) 35#define imx35_add_imx_i2c2(pdata) imx35_add_imx_i2c(2, pdata)
36 36
37extern const struct imx_imx_keypad_data imx35_imx_keypad_data __initconst; 37extern const struct imx_imx_keypad_data imx35_imx_keypad_data __initconst;
38#define imx31_add_imx_keypad(pdata) \ 38#define imx35_add_imx_keypad(pdata) \
39 imx_add_imx_keypad(&imx35_imx_keypad_data, pdata) 39 imx_add_imx_keypad(&imx35_imx_keypad_data, pdata)
40 40
41extern const struct imx_imx_ssi_data imx35_imx_ssi_data[] __initconst; 41extern const struct imx_imx_ssi_data imx35_imx_ssi_data[] __initconst;
diff --git a/arch/arm/mach-mx3/ehci-imx31.c b/arch/arm/mach-mx3/ehci-imx31.c
new file mode 100644
index 000000000000..314a983ac614
--- /dev/null
+++ b/arch/arm/mach-mx3/ehci-imx31.c
@@ -0,0 +1,83 @@
1/*
2 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
3 * Copyright (C) 2010 Freescale Semiconductor, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16#include <linux/platform_device.h>
17#include <linux/io.h>
18
19#include <mach/hardware.h>
20#include <mach/mxc_ehci.h>
21
22#define USBCTRL_OTGBASE_OFFSET 0x600
23
24#define MX31_OTG_SIC_SHIFT 29
25#define MX31_OTG_SIC_MASK (0x3 << MX31_OTG_SIC_SHIFT)
26#define MX31_OTG_PM_BIT (1 << 24)
27
28#define MX31_H2_SIC_SHIFT 21
29#define MX31_H2_SIC_MASK (0x3 << MX31_H2_SIC_SHIFT)
30#define MX31_H2_PM_BIT (1 << 16)
31#define MX31_H2_DT_BIT (1 << 5)
32
33#define MX31_H1_SIC_SHIFT 13
34#define MX31_H1_SIC_MASK (0x3 << MX31_H1_SIC_SHIFT)
35#define MX31_H1_PM_BIT (1 << 8)
36#define MX31_H1_DT_BIT (1 << 4)
37
38int mx31_initialize_usb_hw(int port, unsigned int flags)
39{
40 unsigned int v;
41
42 v = readl(MX31_IO_ADDRESS(MX31_USB_BASE_ADDR + USBCTRL_OTGBASE_OFFSET));
43
44 switch (port) {
45 case 0: /* OTG port */
46 v &= ~(MX31_OTG_SIC_MASK | MX31_OTG_PM_BIT);
47 v |= (flags & MXC_EHCI_INTERFACE_MASK) << MX31_OTG_SIC_SHIFT;
48
49 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
50 v |= MX31_OTG_PM_BIT;
51
52 break;
53 case 1: /* H1 port */
54 v &= ~(MX31_H1_SIC_MASK | MX31_H1_PM_BIT | MX31_H1_DT_BIT);
55 v |= (flags & MXC_EHCI_INTERFACE_MASK) << MX31_H1_SIC_SHIFT;
56
57 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
58 v |= MX31_H1_PM_BIT;
59
60 if (!(flags & MXC_EHCI_TTL_ENABLED))
61 v |= MX31_H1_DT_BIT;
62
63 break;
64 case 2: /* H2 port */
65 v &= ~(MX31_H2_SIC_MASK | MX31_H2_PM_BIT | MX31_H2_DT_BIT);
66 v |= (flags & MXC_EHCI_INTERFACE_MASK) << MX31_H2_SIC_SHIFT;
67
68 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
69 v |= MX31_H2_PM_BIT;
70
71 if (!(flags & MXC_EHCI_TTL_ENABLED))
72 v |= MX31_H2_DT_BIT;
73
74 break;
75 default:
76 return -EINVAL;
77 }
78
79 writel(v, MX31_IO_ADDRESS(MX31_USB_BASE_ADDR + USBCTRL_OTGBASE_OFFSET));
80
81 return 0;
82}
83
diff --git a/arch/arm/mach-mx3/ehci-imx35.c b/arch/arm/mach-mx3/ehci-imx35.c
new file mode 100644
index 000000000000..33983a478c6b
--- /dev/null
+++ b/arch/arm/mach-mx3/ehci-imx35.c
@@ -0,0 +1,80 @@
1/*
2 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
3 * Copyright (C) 2010 Freescale Semiconductor, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16#include <linux/platform_device.h>
17#include <linux/io.h>
18
19#include <mach/hardware.h>
20#include <mach/mxc_ehci.h>
21
22#define USBCTRL_OTGBASE_OFFSET 0x600
23
24#define MX35_OTG_SIC_SHIFT 29
25#define MX35_OTG_SIC_MASK (0x3 << MX35_OTG_SIC_SHIFT)
26#define MX35_OTG_PM_BIT (1 << 24)
27
28#define MX35_H1_SIC_SHIFT 21
29#define MX35_H1_SIC_MASK (0x3 << MX35_H1_SIC_SHIFT)
30#define MX35_H1_PM_BIT (1 << 8)
31#define MX35_H1_IPPUE_UP_BIT (1 << 7)
32#define MX35_H1_IPPUE_DOWN_BIT (1 << 6)
33#define MX35_H1_TLL_BIT (1 << 5)
34#define MX35_H1_USBTE_BIT (1 << 4)
35
36int mx35_initialize_usb_hw(int port, unsigned int flags)
37{
38 unsigned int v;
39
40 v = readl(MX35_IO_ADDRESS(MX35_USB_BASE_ADDR + USBCTRL_OTGBASE_OFFSET));
41
42 switch (port) {
43 case 0: /* OTG port */
44 v &= ~(MX35_OTG_SIC_MASK | MX35_OTG_PM_BIT);
45 v |= (flags & MXC_EHCI_INTERFACE_MASK) << MX35_OTG_SIC_SHIFT;
46
47 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
48 v |= MX35_OTG_PM_BIT;
49
50 break;
51 case 1: /* H1 port */
52 v &= ~(MX35_H1_SIC_MASK | MX35_H1_PM_BIT | MX35_H1_TLL_BIT |
53 MX35_H1_USBTE_BIT | MX35_H1_IPPUE_DOWN_BIT | MX35_H1_IPPUE_UP_BIT);
54 v |= (flags & MXC_EHCI_INTERFACE_MASK) << MX35_H1_SIC_SHIFT;
55
56 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
57 v |= MX35_H1_PM_BIT;
58
59 if (!(flags & MXC_EHCI_TTL_ENABLED))
60 v |= MX35_H1_TLL_BIT;
61
62 if (flags & MXC_EHCI_INTERNAL_PHY)
63 v |= MX35_H1_USBTE_BIT;
64
65 if (flags & MXC_EHCI_IPPUE_DOWN)
66 v |= MX35_H1_IPPUE_DOWN_BIT;
67
68 if (flags & MXC_EHCI_IPPUE_UP)
69 v |= MX35_H1_IPPUE_UP_BIT;
70
71 break;
72 default:
73 return -EINVAL;
74 }
75
76 writel(v, MX35_IO_ADDRESS(MX35_USB_BASE_ADDR + USBCTRL_OTGBASE_OFFSET));
77
78 return 0;
79}
80
diff --git a/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c
index 14a5ffc939ad..80761474c0f8 100644
--- a/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c
+++ b/arch/arm/mach-mx3/eukrea_mbimxsd-baseboard.c
@@ -165,8 +165,8 @@ static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
165 MX35_PAD_SD1_DATA3__ESDHC1_DAT3, 165 MX35_PAD_SD1_DATA3__ESDHC1_DAT3,
166}; 166};
167 167
168#define GPIO_LED1 (2 * 32 + 29) 168#define GPIO_LED1 IMX_GPIO_NR(3, 29)
169#define GPIO_SWITCH1 (2 * 32 + 25) 169#define GPIO_SWITCH1 IMX_GPIO_NR(3, 25)
170#define GPIO_LCDPWR (4) 170#define GPIO_LCDPWR (4)
171 171
172static void eukrea_mbimxsd_lcd_power_set(struct plat_lcd_data *pd, 172static void eukrea_mbimxsd_lcd_power_set(struct plat_lcd_data *pd,
diff --git a/arch/arm/mach-mx3/iomux-imx31.c b/arch/arm/mach-mx3/iomux-imx31.c
index a1d7fa5123dc..cf8f8099ebd7 100644
--- a/arch/arm/mach-mx3/iomux-imx31.c
+++ b/arch/arm/mach-mx3/iomux-imx31.c
@@ -97,7 +97,7 @@ EXPORT_SYMBOL(mxc_iomux_set_pad);
97 * - reserves the pin so that it is not claimed by another driver 97 * - reserves the pin so that it is not claimed by another driver
98 * - setups the iomux according to the configuration 98 * - setups the iomux according to the configuration
99 */ 99 */
100int mxc_iomux_alloc_pin(const unsigned int pin, const char *label) 100int mxc_iomux_alloc_pin(unsigned int pin, const char *label)
101{ 101{
102 unsigned pad = pin & IOMUX_PADNUM_MASK; 102 unsigned pad = pin & IOMUX_PADNUM_MASK;
103 103
@@ -118,10 +118,10 @@ int mxc_iomux_alloc_pin(const unsigned int pin, const char *label)
118} 118}
119EXPORT_SYMBOL(mxc_iomux_alloc_pin); 119EXPORT_SYMBOL(mxc_iomux_alloc_pin);
120 120
121int mxc_iomux_setup_multiple_pins(unsigned int *pin_list, unsigned count, 121int mxc_iomux_setup_multiple_pins(const unsigned int *pin_list, unsigned count,
122 const char *label) 122 const char *label)
123{ 123{
124 unsigned int *p = pin_list; 124 const unsigned int *p = pin_list;
125 int i; 125 int i;
126 int ret = -EINVAL; 126 int ret = -EINVAL;
127 127
@@ -139,7 +139,7 @@ setup_error:
139} 139}
140EXPORT_SYMBOL(mxc_iomux_setup_multiple_pins); 140EXPORT_SYMBOL(mxc_iomux_setup_multiple_pins);
141 141
142void mxc_iomux_release_pin(const unsigned int pin) 142void mxc_iomux_release_pin(unsigned int pin)
143{ 143{
144 unsigned pad = pin & IOMUX_PADNUM_MASK; 144 unsigned pad = pin & IOMUX_PADNUM_MASK;
145 145
@@ -148,9 +148,9 @@ void mxc_iomux_release_pin(const unsigned int pin)
148} 148}
149EXPORT_SYMBOL(mxc_iomux_release_pin); 149EXPORT_SYMBOL(mxc_iomux_release_pin);
150 150
151void mxc_iomux_release_multiple_pins(unsigned int *pin_list, int count) 151void mxc_iomux_release_multiple_pins(const unsigned int *pin_list, int count)
152{ 152{
153 unsigned int *p = pin_list; 153 const unsigned int *p = pin_list;
154 int i; 154 int i;
155 155
156 for (i = 0; i < count; i++) { 156 for (i = 0; i < count; i++) {
diff --git a/arch/arm/mach-mx3/mach-armadillo5x0.c b/arch/arm/mach-mx3/mach-armadillo5x0.c
index 28b6f414b5d5..226829bf7c25 100644
--- a/arch/arm/mach-mx3/mach-armadillo5x0.c
+++ b/arch/arm/mach-mx3/mach-armadillo5x0.c
@@ -133,7 +133,6 @@ static int armadillo5x0_pins[] = {
133}; 133};
134 134
135/* USB */ 135/* USB */
136#if defined(CONFIG_USB_ULPI)
137 136
138#define OTG_RESET IOMUX_TO_GPIO(MX31_PIN_STXD4) 137#define OTG_RESET IOMUX_TO_GPIO(MX31_PIN_STXD4)
139#define USBH2_RESET IOMUX_TO_GPIO(MX31_PIN_SCK6) 138#define USBH2_RESET IOMUX_TO_GPIO(MX31_PIN_SCK6)
@@ -176,8 +175,10 @@ static int usbotg_init(struct platform_device *pdev)
176 gpio_set_value(OTG_RESET, 0/*LOW*/); 175 gpio_set_value(OTG_RESET, 0/*LOW*/);
177 mdelay(5); 176 mdelay(5);
178 gpio_set_value(OTG_RESET, 1/*HIGH*/); 177 gpio_set_value(OTG_RESET, 1/*HIGH*/);
178 mdelay(10);
179 179
180 return 0; 180 return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED |
181 MXC_EHCI_INTERFACE_DIFF_UNI);
181 182
182otg_free_reset: 183otg_free_reset:
183 gpio_free(OTG_RESET); 184 gpio_free(OTG_RESET);
@@ -233,8 +234,10 @@ static int usbh2_init(struct platform_device *pdev)
233 gpio_set_value(USBH2_RESET, 0/*LOW*/); 234 gpio_set_value(USBH2_RESET, 0/*LOW*/);
234 mdelay(5); 235 mdelay(5);
235 gpio_set_value(USBH2_RESET, 1/*HIGH*/); 236 gpio_set_value(USBH2_RESET, 1/*HIGH*/);
237 mdelay(10);
236 238
237 return 0; 239 return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED |
240 MXC_EHCI_INTERFACE_DIFF_UNI);
238 241
239h2_free_reset: 242h2_free_reset:
240 gpio_free(USBH2_RESET); 243 gpio_free(USBH2_RESET);
@@ -246,15 +249,12 @@ h2_free_cs:
246static struct mxc_usbh_platform_data usbotg_pdata __initdata = { 249static struct mxc_usbh_platform_data usbotg_pdata __initdata = {
247 .init = usbotg_init, 250 .init = usbotg_init,
248 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, 251 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT,
249 .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI,
250}; 252};
251 253
252static struct mxc_usbh_platform_data usbh2_pdata __initdata = { 254static struct mxc_usbh_platform_data usbh2_pdata __initdata = {
253 .init = usbh2_init, 255 .init = usbh2_init,
254 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, 256 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT,
255 .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI,
256}; 257};
257#endif /* CONFIG_USB_ULPI */
258 258
259/* RTC over I2C*/ 259/* RTC over I2C*/
260#define ARMADILLO5X0_RTC_GPIO IOMUX_TO_GPIO(MX31_PIN_SRXD4) 260#define ARMADILLO5X0_RTC_GPIO IOMUX_TO_GPIO(MX31_PIN_SRXD4)
@@ -547,15 +547,15 @@ static void __init armadillo5x0_init(void)
547 i2c_register_board_info(1, &armadillo5x0_i2c_rtc, 1); 547 i2c_register_board_info(1, &armadillo5x0_i2c_rtc, 1);
548 548
549 /* USB */ 549 /* USB */
550#if defined(CONFIG_USB_ULPI) 550
551 usbotg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 551 usbotg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
552 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); 552 ULPI_OTG_DRVVBUS_EXT);
553 usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 553 if (usbotg_pdata.otg)
554 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); 554 imx31_add_mxc_ehci_otg(&usbotg_pdata);
555 555 usbh2_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
556 imx31_add_mxc_ehci_otg(&usbotg_pdata); 556 ULPI_OTG_DRVVBUS_EXT);
557 imx31_add_mxc_ehci_hs(2, &usbh2_pdata); 557 if (usbh2_pdata.otg)
558#endif 558 imx31_add_mxc_ehci_hs(2, &usbh2_pdata);
559} 559}
560 560
561static void __init armadillo5x0_timer_init(void) 561static void __init armadillo5x0_timer_init(void)
@@ -569,9 +569,10 @@ static struct sys_timer armadillo5x0_timer = {
569 569
570MACHINE_START(ARMADILLO5X0, "Armadillo-500") 570MACHINE_START(ARMADILLO5X0, "Armadillo-500")
571 /* Maintainer: Alberto Panizzo */ 571 /* Maintainer: Alberto Panizzo */
572 .boot_params = MX3x_PHYS_OFFSET + 0x100, 572 .boot_params = MX3x_PHYS_OFFSET + 0x100,
573 .map_io = mx31_map_io, 573 .map_io = mx31_map_io,
574 .init_irq = mx31_init_irq, 574 .init_early = imx31_init_early,
575 .timer = &armadillo5x0_timer, 575 .init_irq = mx31_init_irq,
576 .init_machine = armadillo5x0_init, 576 .timer = &armadillo5x0_timer,
577 .init_machine = armadillo5x0_init,
577MACHINE_END 578MACHINE_END
diff --git a/arch/arm/mach-mx3/mach-bug.c b/arch/arm/mach-mx3/mach-bug.c
new file mode 100644
index 000000000000..d137d7078ee9
--- /dev/null
+++ b/arch/arm/mach-mx3/mach-bug.c
@@ -0,0 +1,66 @@
1/*
2 * Copyright (C) 2000 Deep Blue Solutions Ltd
3 * Copyright (C) 2002 Shane Nay (shane@minirl.com)
4 * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
5 * Copyright 2011 Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
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
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/platform_device.h>
21
22#include <mach/iomux-mx3.h>
23#include <mach/imx-uart.h>
24#include <mach/hardware.h>
25#include <mach/common.h>
26
27#include <asm/mach/time.h>
28#include <asm/mach/arch.h>
29#include <asm/mach-types.h>
30
31#include "devices-imx31.h"
32
33static const struct imxuart_platform_data uart_pdata __initconst = {
34 .flags = IMXUART_HAVE_RTSCTS,
35};
36
37static const unsigned int bug_pins[] __initconst = {
38 MX31_PIN_PC_RST__CTS5,
39 MX31_PIN_PC_VS2__RTS5,
40 MX31_PIN_PC_BVD2__TXD5,
41 MX31_PIN_PC_BVD1__RXD5,
42};
43
44static void __init bug_board_init(void)
45{
46 mxc_iomux_setup_multiple_pins(bug_pins,
47 ARRAY_SIZE(bug_pins), "uart-4");
48 imx31_add_imx_uart4(&uart_pdata);
49}
50
51static void __init bug_timer_init(void)
52{
53 mx31_clocks_init(26000000);
54}
55
56static struct sys_timer bug_timer = {
57 .init = bug_timer_init,
58};
59
60MACHINE_START(BUG, "BugLabs BUGBase")
61 .map_io = mx31_map_io,
62 .init_early = imx31_init_early,
63 .init_irq = mx31_init_irq,
64 .timer = &bug_timer,
65 .init_machine = bug_board_init,
66MACHINE_END
diff --git a/arch/arm/mach-mx3/mach-cpuimx35.c b/arch/arm/mach-mx3/mach-cpuimx35.c
index 26ae90f02582..ec63d998f647 100644
--- a/arch/arm/mach-mx3/mach-cpuimx35.c
+++ b/arch/arm/mach-mx3/mach-cpuimx35.c
@@ -60,7 +60,7 @@ static struct tsc2007_platform_data tsc2007_info = {
60 .x_plate_ohms = 180, 60 .x_plate_ohms = 180,
61}; 61};
62 62
63#define TSC2007_IRQGPIO (2 * 32 + 2) 63#define TSC2007_IRQGPIO IMX_GPIO_NR(3, 2)
64static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = { 64static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = {
65 { 65 {
66 I2C_BOARD_INFO("pcf8563", 0x51), 66 I2C_BOARD_INFO("pcf8563", 0x51),
@@ -111,15 +111,25 @@ static const struct mxc_nand_platform_data
111 .flash_bbt = 1, 111 .flash_bbt = 1,
112}; 112};
113 113
114static int eukrea_cpuimx35_otg_init(struct platform_device *pdev)
115{
116 return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI);
117}
118
114static const struct mxc_usbh_platform_data otg_pdata __initconst = { 119static const struct mxc_usbh_platform_data otg_pdata __initconst = {
120 .init = eukrea_cpuimx35_otg_init,
115 .portsc = MXC_EHCI_MODE_UTMI, 121 .portsc = MXC_EHCI_MODE_UTMI,
116 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
117}; 122};
118 123
124static int eukrea_cpuimx35_usbh1_init(struct platform_device *pdev)
125{
126 return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_SINGLE_UNI |
127 MXC_EHCI_INTERNAL_PHY | MXC_EHCI_IPPUE_DOWN);
128}
129
119static const struct mxc_usbh_platform_data usbh1_pdata __initconst = { 130static const struct mxc_usbh_platform_data usbh1_pdata __initconst = {
131 .init = eukrea_cpuimx35_usbh1_init,
120 .portsc = MXC_EHCI_MODE_SERIAL, 132 .portsc = MXC_EHCI_MODE_SERIAL,
121 .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY |
122 MXC_EHCI_IPPUE_DOWN,
123}; 133};
124 134
125static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { 135static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
@@ -146,7 +156,7 @@ __setup("otg_mode=", eukrea_cpuimx35_otg_mode);
146/* 156/*
147 * Board specific initialization. 157 * Board specific initialization.
148 */ 158 */
149static void __init mxc_board_init(void) 159static void __init eukrea_cpuimx35_init(void)
150{ 160{
151 mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx35_pads, 161 mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx35_pads,
152 ARRAY_SIZE(eukrea_cpuimx35_pads)); 162 ARRAY_SIZE(eukrea_cpuimx35_pads));
@@ -184,9 +194,10 @@ struct sys_timer eukrea_cpuimx35_timer = {
184 194
185MACHINE_START(EUKREA_CPUIMX35, "Eukrea CPUIMX35") 195MACHINE_START(EUKREA_CPUIMX35, "Eukrea CPUIMX35")
186 /* Maintainer: Eukrea Electromatique */ 196 /* Maintainer: Eukrea Electromatique */
187 .boot_params = MX3x_PHYS_OFFSET + 0x100, 197 .boot_params = MX3x_PHYS_OFFSET + 0x100,
188 .map_io = mx35_map_io, 198 .map_io = mx35_map_io,
189 .init_irq = mx35_init_irq, 199 .init_early = imx35_init_early,
190 .init_machine = mxc_board_init, 200 .init_irq = mx35_init_irq,
191 .timer = &eukrea_cpuimx35_timer, 201 .timer = &eukrea_cpuimx35_timer,
202 .init_machine = eukrea_cpuimx35_init,
192MACHINE_END 203MACHINE_END
diff --git a/arch/arm/mach-mx3/mach-kzm_arm11_01.c b/arch/arm/mach-mx3/mach-kzm_arm11_01.c
index a5f3eb24e4d5..d35621d62b4d 100644
--- a/arch/arm/mach-mx3/mach-kzm_arm11_01.c
+++ b/arch/arm/mach-mx3/mach-kzm_arm11_01.c
@@ -27,6 +27,7 @@
27 27
28#include <asm/irq.h> 28#include <asm/irq.h>
29#include <asm/mach-types.h> 29#include <asm/mach-types.h>
30#include <asm/memory.h>
30#include <asm/setup.h> 31#include <asm/setup.h>
31#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
32#include <asm/mach/irq.h> 33#include <asm/mach/irq.h>
@@ -36,7 +37,6 @@
36#include <mach/clock.h> 37#include <mach/clock.h>
37#include <mach/common.h> 38#include <mach/common.h>
38#include <mach/iomux-mx3.h> 39#include <mach/iomux-mx3.h>
39#include <mach/memory.h>
40 40
41#include "devices-imx31.h" 41#include "devices-imx31.h"
42#include "devices.h" 42#include "devices.h"
@@ -266,17 +266,14 @@ static void __init kzm_timer_init(void)
266} 266}
267 267
268static struct sys_timer kzm_timer = { 268static struct sys_timer kzm_timer = {
269 .init = kzm_timer_init, 269 .init = kzm_timer_init,
270}; 270};
271 271
272/*
273 * The following uses standard kernel macros define in arch.h in order to
274 * initialize __mach_desc_KZM_ARM11_01 data structure.
275 */
276MACHINE_START(KZM_ARM11_01, "Kyoto Microcomputer Co., Ltd. KZM-ARM11-01") 272MACHINE_START(KZM_ARM11_01, "Kyoto Microcomputer Co., Ltd. KZM-ARM11-01")
277 .boot_params = MX3x_PHYS_OFFSET + 0x100, 273 .boot_params = MX3x_PHYS_OFFSET + 0x100,
278 .map_io = kzm_map_io, 274 .map_io = kzm_map_io,
279 .init_irq = mx31_init_irq, 275 .init_early = imx31_init_early,
280 .init_machine = kzm_board_init, 276 .init_irq = mx31_init_irq,
281 .timer = &kzm_timer, 277 .timer = &kzm_timer,
278 .init_machine = kzm_board_init,
282MACHINE_END 279MACHINE_END
diff --git a/arch/arm/mach-mx3/mach-mx31_3ds.c b/arch/arm/mach-mx3/mach-mx31_3ds.c
index 0d65db885be7..034be624d35c 100644
--- a/arch/arm/mach-mx3/mach-mx31_3ds.c
+++ b/arch/arm/mach-mx3/mach-mx31_3ds.c
@@ -21,9 +21,13 @@
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/mfd/mc13783.h> 22#include <linux/mfd/mc13783.h>
23#include <linux/spi/spi.h> 23#include <linux/spi/spi.h>
24#include <linux/spi/l4f00242t03.h>
24#include <linux/regulator/machine.h> 25#include <linux/regulator/machine.h>
25#include <linux/usb/otg.h> 26#include <linux/usb/otg.h>
26#include <linux/usb/ulpi.h> 27#include <linux/usb/ulpi.h>
28#include <linux/memblock.h>
29
30#include <media/soc_camera.h>
27 31
28#include <mach/hardware.h> 32#include <mach/hardware.h>
29#include <asm/mach-types.h> 33#include <asm/mach-types.h>
@@ -35,6 +39,10 @@
35#include <mach/iomux-mx3.h> 39#include <mach/iomux-mx3.h>
36#include <mach/3ds_debugboard.h> 40#include <mach/3ds_debugboard.h>
37#include <mach/ulpi.h> 41#include <mach/ulpi.h>
42#include <mach/mmc.h>
43#include <mach/ipu.h>
44#include <mach/mx3fb.h>
45#include <mach/mx3_camera.h>
38 46
39#include "devices-imx31.h" 47#include "devices-imx31.h"
40#include "devices.h" 48#include "devices.h"
@@ -42,10 +50,6 @@
42/* CPLD IRQ line for external uart, external ethernet etc */ 50/* CPLD IRQ line for external uart, external ethernet etc */
43#define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX31_PIN_GPIO1_1) 51#define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX31_PIN_GPIO1_1)
44 52
45/*
46 * This file contains the board-specific initialization routines.
47 */
48
49static int mx31_3ds_pins[] = { 53static int mx31_3ds_pins[] = {
50 /* UART1 */ 54 /* UART1 */
51 MX31_PIN_CTS1__CTS1, 55 MX31_PIN_CTS1__CTS1,
@@ -53,6 +57,12 @@ static int mx31_3ds_pins[] = {
53 MX31_PIN_TXD1__TXD1, 57 MX31_PIN_TXD1__TXD1,
54 MX31_PIN_RXD1__RXD1, 58 MX31_PIN_RXD1__RXD1,
55 IOMUX_MODE(MX31_PIN_GPIO1_1, IOMUX_CONFIG_GPIO), 59 IOMUX_MODE(MX31_PIN_GPIO1_1, IOMUX_CONFIG_GPIO),
60 /*SPI0*/
61 MX31_PIN_CSPI1_SCLK__SCLK,
62 MX31_PIN_CSPI1_MOSI__MOSI,
63 MX31_PIN_CSPI1_MISO__MISO,
64 MX31_PIN_CSPI1_SPI_RDY__SPI_RDY,
65 MX31_PIN_CSPI1_SS2__SS2, /* CS for LCD */
56 /* SPI 1 */ 66 /* SPI 1 */
57 MX31_PIN_CSPI2_SCLK__SCLK, 67 MX31_PIN_CSPI2_SCLK__SCLK,
58 MX31_PIN_CSPI2_MOSI__MOSI, 68 MX31_PIN_CSPI2_MOSI__MOSI,
@@ -100,6 +110,252 @@ static int mx31_3ds_pins[] = {
100 IOMUX_MODE(MX31_PIN_PC_RW_B, IOMUX_CONFIG_ALT1), 110 IOMUX_MODE(MX31_PIN_PC_RW_B, IOMUX_CONFIG_ALT1),
101 /* USB Host2 reset */ 111 /* USB Host2 reset */
102 IOMUX_MODE(MX31_PIN_USB_BYP, IOMUX_CONFIG_GPIO), 112 IOMUX_MODE(MX31_PIN_USB_BYP, IOMUX_CONFIG_GPIO),
113 /* I2C1 */
114 MX31_PIN_I2C_CLK__I2C1_SCL,
115 MX31_PIN_I2C_DAT__I2C1_SDA,
116 /* SDHC1 */
117 MX31_PIN_SD1_DATA3__SD1_DATA3,
118 MX31_PIN_SD1_DATA2__SD1_DATA2,
119 MX31_PIN_SD1_DATA1__SD1_DATA1,
120 MX31_PIN_SD1_DATA0__SD1_DATA0,
121 MX31_PIN_SD1_CLK__SD1_CLK,
122 MX31_PIN_SD1_CMD__SD1_CMD,
123 MX31_PIN_GPIO3_1__GPIO3_1, /* Card detect */
124 MX31_PIN_GPIO3_0__GPIO3_0, /* OE */
125 /* Framebuffer */
126 MX31_PIN_LD0__LD0,
127 MX31_PIN_LD1__LD1,
128 MX31_PIN_LD2__LD2,
129 MX31_PIN_LD3__LD3,
130 MX31_PIN_LD4__LD4,
131 MX31_PIN_LD5__LD5,
132 MX31_PIN_LD6__LD6,
133 MX31_PIN_LD7__LD7,
134 MX31_PIN_LD8__LD8,
135 MX31_PIN_LD9__LD9,
136 MX31_PIN_LD10__LD10,
137 MX31_PIN_LD11__LD11,
138 MX31_PIN_LD12__LD12,
139 MX31_PIN_LD13__LD13,
140 MX31_PIN_LD14__LD14,
141 MX31_PIN_LD15__LD15,
142 MX31_PIN_LD16__LD16,
143 MX31_PIN_LD17__LD17,
144 MX31_PIN_VSYNC3__VSYNC3,
145 MX31_PIN_HSYNC__HSYNC,
146 MX31_PIN_FPSHIFT__FPSHIFT,
147 MX31_PIN_CONTRAST__CONTRAST,
148 /* CSI */
149 MX31_PIN_CSI_D6__CSI_D6,
150 MX31_PIN_CSI_D7__CSI_D7,
151 MX31_PIN_CSI_D8__CSI_D8,
152 MX31_PIN_CSI_D9__CSI_D9,
153 MX31_PIN_CSI_D10__CSI_D10,
154 MX31_PIN_CSI_D11__CSI_D11,
155 MX31_PIN_CSI_D12__CSI_D12,
156 MX31_PIN_CSI_D13__CSI_D13,
157 MX31_PIN_CSI_D14__CSI_D14,
158 MX31_PIN_CSI_D15__CSI_D15,
159 MX31_PIN_CSI_HSYNC__CSI_HSYNC,
160 MX31_PIN_CSI_MCLK__CSI_MCLK,
161 MX31_PIN_CSI_PIXCLK__CSI_PIXCLK,
162 MX31_PIN_CSI_VSYNC__CSI_VSYNC,
163 MX31_PIN_CSI_D5__GPIO3_5, /* CMOS PWDN */
164 IOMUX_MODE(MX31_PIN_RI_DTE1, IOMUX_CONFIG_GPIO), /* CMOS reset */
165};
166
167/*
168 * Camera support
169 */
170static phys_addr_t mx3_camera_base __initdata;
171#define MX31_3DS_CAMERA_BUF_SIZE SZ_8M
172
173#define MX31_3DS_GPIO_CAMERA_PW IOMUX_TO_GPIO(MX31_PIN_CSI_D5)
174#define MX31_3DS_GPIO_CAMERA_RST IOMUX_TO_GPIO(MX31_PIN_RI_DTE1)
175
176static struct gpio mx31_3ds_camera_gpios[] = {
177 { MX31_3DS_GPIO_CAMERA_PW, GPIOF_OUT_INIT_HIGH, "camera-power" },
178 { MX31_3DS_GPIO_CAMERA_RST, GPIOF_OUT_INIT_HIGH, "camera-reset" },
179};
180
181static int __init mx31_3ds_camera_alloc_dma(void)
182{
183 int dma;
184
185 if (!mx3_camera_base)
186 return -ENOMEM;
187
188 dma = dma_declare_coherent_memory(&mx3_camera.dev,
189 mx3_camera_base, mx3_camera_base,
190 MX31_3DS_CAMERA_BUF_SIZE,
191 DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
192
193 if (!(dma & DMA_MEMORY_MAP))
194 return -ENOMEM;
195
196 return 0;
197}
198
199static int mx31_3ds_camera_power(struct device *dev, int on)
200{
201 /* enable or disable the camera */
202 pr_debug("%s: %s the camera\n", __func__, on ? "ENABLE" : "DISABLE");
203 gpio_set_value(MX31_3DS_GPIO_CAMERA_PW, on ? 0 : 1);
204
205 if (!on)
206 goto out;
207
208 /* If enabled, give a reset impulse */
209 gpio_set_value(MX31_3DS_GPIO_CAMERA_RST, 0);
210 msleep(20);
211 gpio_set_value(MX31_3DS_GPIO_CAMERA_RST, 1);
212 msleep(100);
213
214out:
215 return 0;
216}
217
218static struct i2c_board_info mx31_3ds_i2c_camera = {
219 I2C_BOARD_INFO("ov2640", 0x30),
220};
221
222static struct regulator_bulk_data mx31_3ds_camera_regs[] = {
223 { .supply = "cmos_vcore" },
224 { .supply = "cmos_2v8" },
225};
226
227static struct soc_camera_link iclink_ov2640 = {
228 .bus_id = 0,
229 .board_info = &mx31_3ds_i2c_camera,
230 .i2c_adapter_id = 0,
231 .power = mx31_3ds_camera_power,
232 .regulators = mx31_3ds_camera_regs,
233 .num_regulators = ARRAY_SIZE(mx31_3ds_camera_regs),
234};
235
236static struct platform_device mx31_3ds_ov2640 = {
237 .name = "soc-camera-pdrv",
238 .id = 0,
239 .dev = {
240 .platform_data = &iclink_ov2640,
241 },
242};
243
244struct mx3_camera_pdata mx31_3ds_camera_pdata = {
245 .dma_dev = &mx3_ipu.dev,
246 .flags = MX3_CAMERA_DATAWIDTH_10,
247 .mclk_10khz = 2600,
248};
249
250/*
251 * FB support
252 */
253static const struct fb_videomode fb_modedb[] = {
254 { /* 480x640 @ 60 Hz */
255 .name = "Epson-VGA",
256 .refresh = 60,
257 .xres = 480,
258 .yres = 640,
259 .pixclock = 41701,
260 .left_margin = 20,
261 .right_margin = 41,
262 .upper_margin = 10,
263 .lower_margin = 5,
264 .hsync_len = 20,
265 .vsync_len = 10,
266 .sync = FB_SYNC_OE_ACT_HIGH | FB_SYNC_CLK_INVERT,
267 .vmode = FB_VMODE_NONINTERLACED,
268 .flag = 0,
269 },
270};
271
272static struct ipu_platform_data mx3_ipu_data = {
273 .irq_base = MXC_IPU_IRQ_START,
274};
275
276static struct mx3fb_platform_data mx3fb_pdata = {
277 .dma_dev = &mx3_ipu.dev,
278 .name = "Epson-VGA",
279 .mode = fb_modedb,
280 .num_modes = ARRAY_SIZE(fb_modedb),
281};
282
283/* LCD */
284static struct l4f00242t03_pdata mx31_3ds_l4f00242t03_pdata = {
285 .reset_gpio = IOMUX_TO_GPIO(MX31_PIN_LCS1),
286 .data_enable_gpio = IOMUX_TO_GPIO(MX31_PIN_SER_RS),
287 .core_supply = "lcd_2v8",
288 .io_supply = "vdd_lcdio",
289};
290
291/*
292 * Support for SD card slot in personality board
293 */
294#define MX31_3DS_GPIO_SDHC1_CD IOMUX_TO_GPIO(MX31_PIN_GPIO3_1)
295#define MX31_3DS_GPIO_SDHC1_BE IOMUX_TO_GPIO(MX31_PIN_GPIO3_0)
296
297static struct gpio mx31_3ds_sdhc1_gpios[] = {
298 { MX31_3DS_GPIO_SDHC1_CD, GPIOF_IN, "sdhc1-card-detect" },
299 { MX31_3DS_GPIO_SDHC1_BE, GPIOF_OUT_INIT_LOW, "sdhc1-bus-en" },
300};
301
302static int mx31_3ds_sdhc1_init(struct device *dev,
303 irq_handler_t detect_irq,
304 void *data)
305{
306 int ret;
307
308 ret = gpio_request_array(mx31_3ds_sdhc1_gpios,
309 ARRAY_SIZE(mx31_3ds_sdhc1_gpios));
310 if (ret) {
311 pr_warning("Unable to request the SD/MMC GPIOs.\n");
312 return ret;
313 }
314
315 ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO3_1),
316 detect_irq, IRQF_DISABLED |
317 IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
318 "sdhc1-detect", data);
319 if (ret) {
320 pr_warning("Unable to request the SD/MMC card-detect IRQ.\n");
321 goto gpio_free;
322 }
323
324 return 0;
325
326gpio_free:
327 gpio_free_array(mx31_3ds_sdhc1_gpios,
328 ARRAY_SIZE(mx31_3ds_sdhc1_gpios));
329 return ret;
330}
331
332static void mx31_3ds_sdhc1_exit(struct device *dev, void *data)
333{
334 free_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), data);
335 gpio_free_array(mx31_3ds_sdhc1_gpios,
336 ARRAY_SIZE(mx31_3ds_sdhc1_gpios));
337}
338
339static void mx31_3ds_sdhc1_setpower(struct device *dev, unsigned int vdd)
340{
341 /*
342 * While the voltage stuff is done by the driver, activate the
343 * Buffer Enable Pin only if there is a card in slot to fix the card
344 * voltage issue caused by bi-directional chip TXB0108 on 3Stack.
345 * Done here because at this stage we have for sure a debounced value
346 * of the presence of the card, showed by the value of vdd.
347 * 7 == ilog2(MMC_VDD_165_195)
348 */
349 if (vdd > 7)
350 gpio_set_value(MX31_3DS_GPIO_SDHC1_BE, 1);
351 else
352 gpio_set_value(MX31_3DS_GPIO_SDHC1_BE, 0);
353}
354
355static struct imxmmc_platform_data sdhc1_pdata = {
356 .init = mx31_3ds_sdhc1_init,
357 .exit = mx31_3ds_sdhc1_exit,
358 .setpower = mx31_3ds_sdhc1_setpower,
103}; 359};
104 360
105/* 361/*
@@ -138,7 +394,71 @@ static struct regulator_init_data gpo_init = {
138 } 394 }
139}; 395};
140 396
141static struct mc13783_regulator_init_data mx31_3ds_regulators[] = { 397static struct regulator_consumer_supply vmmc2_consumers[] = {
398 REGULATOR_SUPPLY("vmmc", "mxc-mmc.0"),
399};
400
401static struct regulator_init_data vmmc2_init = {
402 .constraints = {
403 .min_uV = 3000000,
404 .max_uV = 3000000,
405 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
406 REGULATOR_CHANGE_STATUS,
407 },
408 .num_consumer_supplies = ARRAY_SIZE(vmmc2_consumers),
409 .consumer_supplies = vmmc2_consumers,
410};
411
412static struct regulator_consumer_supply vmmc1_consumers[] = {
413 REGULATOR_SUPPLY("lcd_2v8", NULL),
414 REGULATOR_SUPPLY("cmos_2v8", "soc-camera-pdrv.0"),
415};
416
417static struct regulator_init_data vmmc1_init = {
418 .constraints = {
419 .min_uV = 2800000,
420 .max_uV = 2800000,
421 .apply_uV = 1,
422 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
423 REGULATOR_CHANGE_STATUS,
424 },
425 .num_consumer_supplies = ARRAY_SIZE(vmmc1_consumers),
426 .consumer_supplies = vmmc1_consumers,
427};
428
429static struct regulator_consumer_supply vgen_consumers[] = {
430 REGULATOR_SUPPLY("vdd_lcdio", NULL),
431};
432
433static struct regulator_init_data vgen_init = {
434 .constraints = {
435 .min_uV = 1800000,
436 .max_uV = 1800000,
437 .apply_uV = 1,
438 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
439 REGULATOR_CHANGE_STATUS,
440 },
441 .num_consumer_supplies = ARRAY_SIZE(vgen_consumers),
442 .consumer_supplies = vgen_consumers,
443};
444
445static struct regulator_consumer_supply vvib_consumers[] = {
446 REGULATOR_SUPPLY("cmos_vcore", "soc-camera-pdrv.0"),
447};
448
449static struct regulator_init_data vvib_init = {
450 .constraints = {
451 .min_uV = 1300000,
452 .max_uV = 1300000,
453 .apply_uV = 1,
454 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
455 REGULATOR_CHANGE_STATUS,
456 },
457 .num_consumer_supplies = ARRAY_SIZE(vvib_consumers),
458 .consumer_supplies = vvib_consumers,
459};
460
461static struct mc13xxx_regulator_init_data mx31_3ds_regulators[] = {
142 { 462 {
143 .id = MC13783_REG_PWGT1SPI, /* Power Gate for ARM core. */ 463 .id = MC13783_REG_PWGT1SPI, /* Power Gate for ARM core. */
144 .init_data = &pwgtx_init, 464 .init_data = &pwgtx_init,
@@ -152,17 +472,40 @@ static struct mc13783_regulator_init_data mx31_3ds_regulators[] = {
152 }, { 472 }, {
153 .id = MC13783_REG_GPO3, /* Turn on 3.3V */ 473 .id = MC13783_REG_GPO3, /* Turn on 3.3V */
154 .init_data = &gpo_init, 474 .init_data = &gpo_init,
475 }, {
476 .id = MC13783_REG_VMMC2, /* Power MMC/SD, WiFi/Bluetooth. */
477 .init_data = &vmmc2_init,
478 }, {
479 .id = MC13783_REG_VMMC1, /* Power LCD, CMOS, FM, GPS, Accel. */
480 .init_data = &vmmc1_init,
481 }, {
482 .id = MC13783_REG_VGEN, /* Power LCD */
483 .init_data = &vgen_init,
484 }, {
485 .id = MC13783_REG_VVIB, /* Power CMOS */
486 .init_data = &vvib_init,
155 }, 487 },
156}; 488};
157 489
158/* MC13783 */ 490/* MC13783 */
159static struct mc13783_platform_data mc13783_pdata __initdata = { 491static struct mc13xxx_platform_data mc13783_pdata = {
160 .regulators = mx31_3ds_regulators, 492 .regulators = {
161 .num_regulators = ARRAY_SIZE(mx31_3ds_regulators), 493 .regulators = mx31_3ds_regulators,
494 .num_regulators = ARRAY_SIZE(mx31_3ds_regulators),
495 },
162 .flags = MC13783_USE_REGULATOR | MC13783_USE_TOUCHSCREEN, 496 .flags = MC13783_USE_REGULATOR | MC13783_USE_TOUCHSCREEN,
163}; 497};
164 498
165/* SPI */ 499/* SPI */
500static int spi0_internal_chipselect[] = {
501 MXC_SPI_CS(2),
502};
503
504static const struct spi_imx_master spi0_pdata __initconst = {
505 .chipselect = spi0_internal_chipselect,
506 .num_chipselect = ARRAY_SIZE(spi0_internal_chipselect),
507};
508
166static int spi1_internal_chipselect[] = { 509static int spi1_internal_chipselect[] = {
167 MXC_SPI_CS(0), 510 MXC_SPI_CS(0),
168 MXC_SPI_CS(2), 511 MXC_SPI_CS(2),
@@ -182,6 +525,12 @@ static struct spi_board_info mx31_3ds_spi_devs[] __initdata = {
182 .platform_data = &mc13783_pdata, 525 .platform_data = &mc13783_pdata,
183 .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3), 526 .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3),
184 .mode = SPI_CS_HIGH, 527 .mode = SPI_CS_HIGH,
528 }, {
529 .modalias = "l4f00242t03",
530 .max_speed_hz = 5000000,
531 .bus_num = 0,
532 .chip_select = 0, /* SS2 */
533 .platform_data = &mx31_3ds_l4f00242t03_pdata,
185 }, 534 },
186}; 535};
187 536
@@ -245,6 +594,11 @@ usbotg_free_reset:
245 return err; 594 return err;
246} 595}
247 596
597static int mx31_3ds_otg_init(struct platform_device *pdev)
598{
599 return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED);
600}
601
248static int mx31_3ds_host2_init(struct platform_device *pdev) 602static int mx31_3ds_host2_init(struct platform_device *pdev)
249{ 603{
250 int err; 604 int err;
@@ -276,25 +630,25 @@ static int mx31_3ds_host2_init(struct platform_device *pdev)
276 630
277 mdelay(1); 631 mdelay(1);
278 gpio_set_value(USBH2_RST_B, 1); 632 gpio_set_value(USBH2_RST_B, 1);
279 return 0; 633
634 mdelay(10);
635
636 return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED);
280 637
281usbotg_free_reset: 638usbotg_free_reset:
282 gpio_free(USBH2_RST_B); 639 gpio_free(USBH2_RST_B);
283 return err; 640 return err;
284} 641}
285 642
286#if defined(CONFIG_USB_ULPI)
287static struct mxc_usbh_platform_data otg_pdata __initdata = { 643static struct mxc_usbh_platform_data otg_pdata __initdata = {
644 .init = mx31_3ds_otg_init,
288 .portsc = MXC_EHCI_MODE_ULPI, 645 .portsc = MXC_EHCI_MODE_ULPI,
289 .flags = MXC_EHCI_POWER_PINS_ENABLED,
290}; 646};
291 647
292static struct mxc_usbh_platform_data usbh2_pdata __initdata = { 648static struct mxc_usbh_platform_data usbh2_pdata __initdata = {
293 .init = mx31_3ds_host2_init, 649 .init = mx31_3ds_host2_init,
294 .portsc = MXC_EHCI_MODE_ULPI, 650 .portsc = MXC_EHCI_MODE_ULPI,
295 .flags = MXC_EHCI_POWER_PINS_ENABLED,
296}; 651};
297#endif
298 652
299static const struct fsl_usb2_platform_data usbotg_pdata __initconst = { 653static const struct fsl_usb2_platform_data usbotg_pdata __initconst = {
300 .operating_mode = FSL_USB2_DR_DEVICE, 654 .operating_mode = FSL_USB2_DR_DEVICE,
@@ -320,19 +674,18 @@ static const struct imxuart_platform_data uart_pdata __initconst = {
320 .flags = IMXUART_HAVE_RTSCTS, 674 .flags = IMXUART_HAVE_RTSCTS,
321}; 675};
322 676
323/* 677static const struct imxi2c_platform_data mx31_3ds_i2c0_data __initconst = {
324 * Set up static virtual mappings. 678 .bitrate = 100000,
325 */ 679};
326static void __init mx31_3ds_map_io(void)
327{
328 mx31_map_io();
329}
330 680
331/*! 681static struct platform_device *devices[] __initdata = {
332 * Board specific initialization. 682 &mx31_3ds_ov2640,
333 */ 683};
334static void __init mxc_board_init(void) 684
685static void __init mx31_3ds_init(void)
335{ 686{
687 int ret;
688
336 mxc_iomux_setup_multiple_pins(mx31_3ds_pins, ARRAY_SIZE(mx31_3ds_pins), 689 mxc_iomux_setup_multiple_pins(mx31_3ds_pins, ARRAY_SIZE(mx31_3ds_pins),
337 "mx31_3ds"); 690 "mx31_3ds");
338 691
@@ -343,20 +696,22 @@ static void __init mxc_board_init(void)
343 spi_register_board_info(mx31_3ds_spi_devs, 696 spi_register_board_info(mx31_3ds_spi_devs,
344 ARRAY_SIZE(mx31_3ds_spi_devs)); 697 ARRAY_SIZE(mx31_3ds_spi_devs));
345 698
699 platform_add_devices(devices, ARRAY_SIZE(devices));
700
346 imx31_add_imx_keypad(&mx31_3ds_keymap_data); 701 imx31_add_imx_keypad(&mx31_3ds_keymap_data);
347 702
348 mx31_3ds_usbotg_init(); 703 mx31_3ds_usbotg_init();
349#if defined(CONFIG_USB_ULPI)
350 if (otg_mode_host) { 704 if (otg_mode_host) {
351 otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 705 otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
352 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); 706 ULPI_OTG_DRVVBUS_EXT);
353 707 if (otg_pdata.otg)
354 imx31_add_mxc_ehci_otg(&otg_pdata); 708 imx31_add_mxc_ehci_otg(&otg_pdata);
355 } 709 }
356 usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 710 usbh2_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
357 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); 711 ULPI_OTG_DRVVBUS_EXT);
358 imx31_add_mxc_ehci_hs(2, &usbh2_pdata); 712 if (usbh2_pdata.otg)
359#endif 713 imx31_add_mxc_ehci_hs(2, &usbh2_pdata);
714
360 if (!otg_mode_host) 715 if (!otg_mode_host)
361 imx31_add_fsl_usb2_udc(&usbotg_pdata); 716 imx31_add_fsl_usb2_udc(&usbotg_pdata);
362 717
@@ -364,6 +719,26 @@ static void __init mxc_board_init(void)
364 printk(KERN_WARNING "Init of the debug board failed, all " 719 printk(KERN_WARNING "Init of the debug board failed, all "
365 "devices on the debug board are unusable.\n"); 720 "devices on the debug board are unusable.\n");
366 imx31_add_imx2_wdt(NULL); 721 imx31_add_imx2_wdt(NULL);
722 imx31_add_imx_i2c0(&mx31_3ds_i2c0_data);
723 imx31_add_mxc_mmc(0, &sdhc1_pdata);
724
725 imx31_add_spi_imx0(&spi0_pdata);
726 mxc_register_device(&mx3_ipu, &mx3_ipu_data);
727 mxc_register_device(&mx3_fb, &mx3fb_pdata);
728
729 /* CSI */
730 /* Camera power: default - off */
731 ret = gpio_request_array(mx31_3ds_camera_gpios,
732 ARRAY_SIZE(mx31_3ds_camera_gpios));
733 if (ret) {
734 pr_err("Failed to request camera gpios");
735 iclink_ov2640.power = NULL;
736 }
737
738 if (!mx31_3ds_camera_alloc_dma())
739 mxc_register_device(&mx3_camera, &mx31_3ds_camera_pdata);
740 else
741 pr_err("Failed to allocate dma memory for camera");
367} 742}
368 743
369static void __init mx31_3ds_timer_init(void) 744static void __init mx31_3ds_timer_init(void)
@@ -375,15 +750,22 @@ static struct sys_timer mx31_3ds_timer = {
375 .init = mx31_3ds_timer_init, 750 .init = mx31_3ds_timer_init,
376}; 751};
377 752
378/* 753static void __init mx31_3ds_reserve(void)
379 * The following uses standard kernel macros defined in arch.h in order to 754{
380 * initialize __mach_desc_MX31_3DS data structure. 755 /* reserve MX31_3DS_CAMERA_BUF_SIZE bytes for mx3-camera */
381 */ 756 mx3_camera_base = memblock_alloc(MX31_3DS_CAMERA_BUF_SIZE,
757 MX31_3DS_CAMERA_BUF_SIZE);
758 memblock_free(mx3_camera_base, MX31_3DS_CAMERA_BUF_SIZE);
759 memblock_remove(mx3_camera_base, MX31_3DS_CAMERA_BUF_SIZE);
760}
761
382MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)") 762MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)")
383 /* Maintainer: Freescale Semiconductor, Inc. */ 763 /* Maintainer: Freescale Semiconductor, Inc. */
384 .boot_params = MX3x_PHYS_OFFSET + 0x100, 764 .boot_params = MX3x_PHYS_OFFSET + 0x100,
385 .map_io = mx31_3ds_map_io, 765 .map_io = mx31_map_io,
386 .init_irq = mx31_init_irq, 766 .init_early = imx31_init_early,
387 .init_machine = mxc_board_init, 767 .init_irq = mx31_init_irq,
388 .timer = &mx31_3ds_timer, 768 .timer = &mx31_3ds_timer,
769 .init_machine = mx31_3ds_init,
770 .reserve = mx31_3ds_reserve,
389MACHINE_END 771MACHINE_END
diff --git a/arch/arm/mach-mx3/mach-mx31ads.c b/arch/arm/mach-mx3/mach-mx31ads.c
index 88b97d62b57e..4e4b780c481d 100644
--- a/arch/arm/mach-mx3/mach-mx31ads.c
+++ b/arch/arm/mach-mx3/mach-mx31ads.c
@@ -69,12 +69,8 @@
69#define EXPIO_INT_XUART_INTB (MXC_EXP_IO_BASE + 11) 69#define EXPIO_INT_XUART_INTB (MXC_EXP_IO_BASE + 11)
70 70
71#define MXC_MAX_EXP_IO_LINES 16 71#define MXC_MAX_EXP_IO_LINES 16
72/*
73 * This file contains the board-specific initialization routines.
74 */
75 72
76#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) 73/*
77/*!
78 * The serial port definition structure. 74 * The serial port definition structure.
79 */ 75 */
80static struct plat_serial8250_port serial_platform_data[] = { 76static struct plat_serial8250_port serial_platform_data[] = {
@@ -110,14 +106,7 @@ static int __init mxc_init_extuart(void)
110{ 106{
111 return platform_device_register(&serial_device); 107 return platform_device_register(&serial_device);
112} 108}
113#else
114static inline int mxc_init_extuart(void)
115{
116 return 0;
117}
118#endif
119 109
120#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE)
121static const struct imxuart_platform_data uart_pdata __initconst = { 110static const struct imxuart_platform_data uart_pdata __initconst = {
122 .flags = IMXUART_HAVE_RTSCTS, 111 .flags = IMXUART_HAVE_RTSCTS,
123}; 112};
@@ -134,11 +123,6 @@ static inline void mxc_init_imx_uart(void)
134 mxc_iomux_setup_multiple_pins(uart_pins, ARRAY_SIZE(uart_pins), "uart-0"); 123 mxc_iomux_setup_multiple_pins(uart_pins, ARRAY_SIZE(uart_pins), "uart-0");
135 imx31_add_imx_uart0(&uart_pdata); 124 imx31_add_imx_uart0(&uart_pdata);
136} 125}
137#else /* !SERIAL_IMX */
138static inline void mxc_init_imx_uart(void)
139{
140}
141#endif /* !SERIAL_IMX */
142 126
143static void mx31ads_expio_irq_handler(u32 irq, struct irq_desc *desc) 127static void mx31ads_expio_irq_handler(u32 irq, struct irq_desc *desc)
144{ 128{
@@ -160,7 +144,7 @@ static void mx31ads_expio_irq_handler(u32 irq, struct irq_desc *desc)
160 144
161/* 145/*
162 * Disable an expio pin's interrupt by setting the bit in the imr. 146 * Disable an expio pin's interrupt by setting the bit in the imr.
163 * @param irq an expio virtual irq number 147 * @param d an expio virtual irq description
164 */ 148 */
165static void expio_mask_irq(struct irq_data *d) 149static void expio_mask_irq(struct irq_data *d)
166{ 150{
@@ -172,7 +156,7 @@ static void expio_mask_irq(struct irq_data *d)
172 156
173/* 157/*
174 * Acknowledge an expanded io pin's interrupt by clearing the bit in the isr. 158 * Acknowledge an expanded io pin's interrupt by clearing the bit in the isr.
175 * @param irq an expanded io virtual irq number 159 * @param d an expio virtual irq description
176 */ 160 */
177static void expio_ack_irq(struct irq_data *d) 161static void expio_ack_irq(struct irq_data *d)
178{ 162{
@@ -183,7 +167,7 @@ static void expio_ack_irq(struct irq_data *d)
183 167
184/* 168/*
185 * Enable a expio pin's interrupt by clearing the bit in the imr. 169 * Enable a expio pin's interrupt by clearing the bit in the imr.
186 * @param irq a expio virtual irq number 170 * @param d an expio virtual irq description
187 */ 171 */
188static void expio_unmask_irq(struct irq_data *d) 172static void expio_unmask_irq(struct irq_data *d)
189{ 173{
@@ -476,7 +460,6 @@ static struct wm8350_platform_data __initdata mx31_wm8350_pdata = {
476}; 460};
477#endif 461#endif
478 462
479#if defined(CONFIG_I2C_IMX) || defined(CONFIG_I2C_IMX_MODULE)
480static struct i2c_board_info __initdata mx31ads_i2c1_devices[] = { 463static struct i2c_board_info __initdata mx31ads_i2c1_devices[] = {
481#ifdef CONFIG_MACH_MX31ADS_WM1133_EV1 464#ifdef CONFIG_MACH_MX31ADS_WM1133_EV1
482 { 465 {
@@ -497,11 +480,6 @@ static void mxc_init_i2c(void)
497 480
498 imx31_add_imx_i2c1(NULL); 481 imx31_add_imx_i2c1(NULL);
499} 482}
500#else
501static void mxc_init_i2c(void)
502{
503}
504#endif
505 483
506static unsigned int ssi_pins[] = { 484static unsigned int ssi_pins[] = {
507 MX31_PIN_SFS5__SFS5, 485 MX31_PIN_SFS5__SFS5,
@@ -516,9 +494,7 @@ static void mxc_init_audio(void)
516 mxc_iomux_setup_multiple_pins(ssi_pins, ARRAY_SIZE(ssi_pins), "ssi"); 494 mxc_iomux_setup_multiple_pins(ssi_pins, ARRAY_SIZE(ssi_pins), "ssi");
517} 495}
518 496
519/*! 497/* static mappings */
520 * This structure defines static mappings for the i.MX31ADS board.
521 */
522static struct map_desc mx31ads_io_desc[] __initdata = { 498static struct map_desc mx31ads_io_desc[] __initdata = {
523 { 499 {
524 .virtual = MX31_CS4_BASE_ADDR_VIRT, 500 .virtual = MX31_CS4_BASE_ADDR_VIRT,
@@ -528,9 +504,6 @@ static struct map_desc mx31ads_io_desc[] __initdata = {
528 }, 504 },
529}; 505};
530 506
531/*!
532 * Set up static virtual mappings.
533 */
534static void __init mx31ads_map_io(void) 507static void __init mx31ads_map_io(void)
535{ 508{
536 mx31_map_io(); 509 mx31_map_io();
@@ -543,10 +516,7 @@ static void __init mx31ads_init_irq(void)
543 mx31ads_init_expio(); 516 mx31ads_init_expio();
544} 517}
545 518
546/*! 519static void __init mx31ads_init(void)
547 * Board specific initialization.
548 */
549static void __init mxc_board_init(void)
550{ 520{
551 mxc_init_extuart(); 521 mxc_init_extuart();
552 mxc_init_imx_uart(); 522 mxc_init_imx_uart();
@@ -563,15 +533,12 @@ static struct sys_timer mx31ads_timer = {
563 .init = mx31ads_timer_init, 533 .init = mx31ads_timer_init,
564}; 534};
565 535
566/*
567 * The following uses standard kernel macros defined in arch.h in order to
568 * initialize __mach_desc_MX31ADS data structure.
569 */
570MACHINE_START(MX31ADS, "Freescale MX31ADS") 536MACHINE_START(MX31ADS, "Freescale MX31ADS")
571 /* Maintainer: Freescale Semiconductor, Inc. */ 537 /* Maintainer: Freescale Semiconductor, Inc. */
572 .boot_params = MX3x_PHYS_OFFSET + 0x100, 538 .boot_params = MX3x_PHYS_OFFSET + 0x100,
573 .map_io = mx31ads_map_io, 539 .map_io = mx31ads_map_io,
574 .init_irq = mx31ads_init_irq, 540 .init_early = imx31_init_early,
575 .init_machine = mxc_board_init, 541 .init_irq = mx31ads_init_irq,
576 .timer = &mx31ads_timer, 542 .timer = &mx31ads_timer,
543 .init_machine = mx31ads_init,
577MACHINE_END 544MACHINE_END
diff --git a/arch/arm/mach-mx3/mach-mx31lilly.c b/arch/arm/mach-mx3/mach-mx31lilly.c
index 2c595483f356..ed95745163b8 100644
--- a/arch/arm/mach-mx3/mach-mx31lilly.c
+++ b/arch/arm/mach-mx3/mach-mx31lilly.c
@@ -24,6 +24,7 @@
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/clk.h> 25#include <linux/clk.h>
26#include <linux/gpio.h> 26#include <linux/gpio.h>
27#include <linux/delay.h>
27#include <linux/platform_device.h> 28#include <linux/platform_device.h>
28#include <linux/interrupt.h> 29#include <linux/interrupt.h>
29#include <linux/smsc911x.h> 30#include <linux/smsc911x.h>
@@ -110,55 +111,9 @@ static struct platform_device physmap_flash_device = {
110 111
111/* USB */ 112/* USB */
112 113
113#if defined(CONFIG_USB_ULPI)
114
115#define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \ 114#define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
116 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) 115 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
117 116
118static int usbotg_init(struct platform_device *pdev)
119{
120 unsigned int pins[] = {
121 MX31_PIN_USBOTG_DATA0__USBOTG_DATA0,
122 MX31_PIN_USBOTG_DATA1__USBOTG_DATA1,
123 MX31_PIN_USBOTG_DATA2__USBOTG_DATA2,
124 MX31_PIN_USBOTG_DATA3__USBOTG_DATA3,
125 MX31_PIN_USBOTG_DATA4__USBOTG_DATA4,
126 MX31_PIN_USBOTG_DATA5__USBOTG_DATA5,
127 MX31_PIN_USBOTG_DATA6__USBOTG_DATA6,
128 MX31_PIN_USBOTG_DATA7__USBOTG_DATA7,
129 MX31_PIN_USBOTG_CLK__USBOTG_CLK,
130 MX31_PIN_USBOTG_DIR__USBOTG_DIR,
131 MX31_PIN_USBOTG_NXT__USBOTG_NXT,
132 MX31_PIN_USBOTG_STP__USBOTG_STP,
133 };
134
135 mxc_iomux_setup_multiple_pins(pins, ARRAY_SIZE(pins), "USB OTG");
136
137 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, USB_PAD_CFG);
138 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, USB_PAD_CFG);
139 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, USB_PAD_CFG);
140 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, USB_PAD_CFG);
141 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, USB_PAD_CFG);
142 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, USB_PAD_CFG);
143 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, USB_PAD_CFG);
144 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, USB_PAD_CFG);
145 mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, USB_PAD_CFG);
146 mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, USB_PAD_CFG);
147 mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, USB_PAD_CFG);
148 mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, USB_PAD_CFG);
149
150 mxc_iomux_set_gpr(MUX_PGP_USB_4WIRE, true);
151 mxc_iomux_set_gpr(MUX_PGP_USB_COMMON, true);
152
153 /* chip select */
154 mxc_iomux_alloc_pin(IOMUX_MODE(MX31_PIN_DTR_DCE2, IOMUX_CONFIG_GPIO),
155 "USBOTG_CS");
156 gpio_request(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE2), "USBH1 CS");
157 gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE2), 0);
158
159 return 0;
160}
161
162static int usbh1_init(struct platform_device *pdev) 117static int usbh1_init(struct platform_device *pdev)
163{ 118{
164 int pins[] = { 119 int pins[] = {
@@ -183,7 +138,10 @@ static int usbh1_init(struct platform_device *pdev)
183 138
184 mxc_iomux_set_gpr(MUX_PGP_USB_SUSPEND, true); 139 mxc_iomux_set_gpr(MUX_PGP_USB_SUSPEND, true);
185 140
186 return 0; 141 mdelay(10);
142
143 return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED |
144 MXC_EHCI_INTERFACE_SINGLE_UNI);
187} 145}
188 146
189static int usbh2_init(struct platform_device *pdev) 147static int usbh2_init(struct platform_device *pdev)
@@ -220,41 +178,30 @@ static int usbh2_init(struct platform_device *pdev)
220 gpio_request(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), "USBH2 CS"); 178 gpio_request(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), "USBH2 CS");
221 gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), 0); 179 gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), 0);
222 180
223 return 0; 181 mdelay(10);
224}
225 182
226static struct mxc_usbh_platform_data usbotg_pdata = { 183 return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED);
227 .init = usbotg_init, 184}
228 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT,
229 .flags = MXC_EHCI_POWER_PINS_ENABLED,
230};
231 185
232static const struct mxc_usbh_platform_data usbh1_pdata __initconst = { 186static const struct mxc_usbh_platform_data usbh1_pdata __initconst = {
233 .init = usbh1_init, 187 .init = usbh1_init,
234 .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, 188 .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL,
235 .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI,
236}; 189};
237 190
238static struct mxc_usbh_platform_data usbh2_pdata __initdata = { 191static struct mxc_usbh_platform_data usbh2_pdata __initdata = {
239 .init = usbh2_init, 192 .init = usbh2_init,
240 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, 193 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT,
241 .flags = MXC_EHCI_POWER_PINS_ENABLED,
242}; 194};
243 195
244static void lilly1131_usb_init(void) 196static void lilly1131_usb_init(void)
245{ 197{
246 usbotg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
247 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT);
248 usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
249 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT);
250
251 imx31_add_mxc_ehci_hs(1, &usbh1_pdata); 198 imx31_add_mxc_ehci_hs(1, &usbh1_pdata);
252 imx31_add_mxc_ehci_hs(2, &usbh2_pdata);
253}
254 199
255#else 200 usbh2_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
256static inline void lilly1131_usb_init(void) {} 201 ULPI_OTG_DRVVBUS_EXT);
257#endif /* CONFIG_USB_ULPI */ 202 if (usbh2_pdata.otg)
203 imx31_add_mxc_ehci_hs(2, &usbh2_pdata);
204}
258 205
259/* SPI */ 206/* SPI */
260 207
@@ -274,8 +221,8 @@ static const struct spi_imx_master spi1_pdata __initconst = {
274 .num_chipselect = ARRAY_SIZE(spi_internal_chipselect), 221 .num_chipselect = ARRAY_SIZE(spi_internal_chipselect),
275}; 222};
276 223
277static struct mc13783_platform_data mc13783_pdata __initdata = { 224static struct mc13xxx_platform_data mc13783_pdata __initdata = {
278 .flags = MC13783_USE_RTC | MC13783_USE_TOUCHSCREEN, 225 .flags = MC13XXX_USE_RTC | MC13XXX_USE_TOUCHSCREEN,
279}; 226};
280 227
281static struct spi_board_info mc13783_dev __initdata = { 228static struct spi_board_info mc13783_dev __initdata = {
@@ -347,10 +294,10 @@ static struct sys_timer mx31lilly_timer = {
347}; 294};
348 295
349MACHINE_START(LILLY1131, "INCO startec LILLY-1131") 296MACHINE_START(LILLY1131, "INCO startec LILLY-1131")
350 .boot_params = MX3x_PHYS_OFFSET + 0x100, 297 .boot_params = MX3x_PHYS_OFFSET + 0x100,
351 .map_io = mx31_map_io, 298 .map_io = mx31_map_io,
352 .init_irq = mx31_init_irq, 299 .init_early = imx31_init_early,
353 .init_machine = mx31lilly_board_init, 300 .init_irq = mx31_init_irq,
354 .timer = &mx31lilly_timer, 301 .timer = &mx31lilly_timer,
302 .init_machine = mx31lilly_board_init,
355MACHINE_END 303MACHINE_END
356
diff --git a/arch/arm/mach-mx3/mach-mx31lite.c b/arch/arm/mach-mx3/mach-mx31lite.c
index 9e64c66396e0..24a21a384bf1 100644
--- a/arch/arm/mach-mx3/mach-mx31lite.c
+++ b/arch/arm/mach-mx3/mach-mx31lite.c
@@ -27,6 +27,7 @@
27#include <linux/usb/otg.h> 27#include <linux/usb/otg.h>
28#include <linux/usb/ulpi.h> 28#include <linux/usb/ulpi.h>
29#include <linux/mtd/physmap.h> 29#include <linux/mtd/physmap.h>
30#include <linux/delay.h>
30 31
31#include <asm/mach-types.h> 32#include <asm/mach-types.h>
32#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
@@ -111,9 +112,9 @@ static const struct spi_imx_master spi1_pdata __initconst = {
111 .num_chipselect = ARRAY_SIZE(spi_internal_chipselect), 112 .num_chipselect = ARRAY_SIZE(spi_internal_chipselect),
112}; 113};
113 114
114static struct mc13783_platform_data mc13783_pdata __initdata = { 115static struct mc13xxx_platform_data mc13783_pdata __initdata = {
115 .flags = MC13783_USE_RTC | 116 .flags = MC13XXX_USE_RTC |
116 MC13783_USE_REGULATOR, 117 MC13XXX_USE_REGULATOR,
117}; 118};
118 119
119static struct spi_board_info mc13783_spi_dev __initdata = { 120static struct spi_board_info mc13783_spi_dev __initdata = {
@@ -129,7 +130,6 @@ static struct spi_board_info mc13783_spi_dev __initdata = {
129 * USB 130 * USB
130 */ 131 */
131 132
132#if defined(CONFIG_USB_ULPI)
133#define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \ 133#define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
134 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) 134 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
135 135
@@ -167,15 +167,15 @@ static int usbh2_init(struct platform_device *pdev)
167 gpio_request(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), "USBH2 CS"); 167 gpio_request(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), "USBH2 CS");
168 gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), 0); 168 gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), 0);
169 169
170 return 0; 170 mdelay(10);
171
172 return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED);
171} 173}
172 174
173static struct mxc_usbh_platform_data usbh2_pdata __initdata = { 175static struct mxc_usbh_platform_data usbh2_pdata __initdata = {
174 .init = usbh2_init, 176 .init = usbh2_init,
175 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, 177 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT,
176 .flags = MXC_EHCI_POWER_PINS_ENABLED,
177}; 178};
178#endif
179 179
180/* 180/*
181 * NOR flash 181 * NOR flash
@@ -227,7 +227,7 @@ void __init mx31lite_map_io(void)
227static int mx31lite_baseboard; 227static int mx31lite_baseboard;
228core_param(mx31lite_baseboard, mx31lite_baseboard, int, 0444); 228core_param(mx31lite_baseboard, mx31lite_baseboard, int, 0444);
229 229
230static void __init mxc_board_init(void) 230static void __init mx31lite_init(void)
231{ 231{
232 int ret; 232 int ret;
233 233
@@ -252,13 +252,11 @@ static void __init mxc_board_init(void)
252 imx31_add_spi_imx1(&spi1_pdata); 252 imx31_add_spi_imx1(&spi1_pdata);
253 spi_register_board_info(&mc13783_spi_dev, 1); 253 spi_register_board_info(&mc13783_spi_dev, 1);
254 254
255#if defined(CONFIG_USB_ULPI)
256 /* USB */ 255 /* USB */
257 usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 256 usbh2_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
258 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); 257 ULPI_OTG_DRVVBUS_EXT);
259 258 if (usbh2_pdata.otg)
260 imx31_add_mxc_ehci_hs(2, &usbh2_pdata); 259 imx31_add_mxc_ehci_hs(2, &usbh2_pdata);
261#endif
262 260
263 /* SMSC9117 IRQ pin */ 261 /* SMSC9117 IRQ pin */
264 ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_SFS6), "sms9117-irq"); 262 ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_SFS6), "sms9117-irq");
@@ -281,9 +279,10 @@ struct sys_timer mx31lite_timer = {
281 279
282MACHINE_START(MX31LITE, "LogicPD i.MX31 SOM") 280MACHINE_START(MX31LITE, "LogicPD i.MX31 SOM")
283 /* Maintainer: Freescale Semiconductor, Inc. */ 281 /* Maintainer: Freescale Semiconductor, Inc. */
284 .boot_params = MX3x_PHYS_OFFSET + 0x100, 282 .boot_params = MX3x_PHYS_OFFSET + 0x100,
285 .map_io = mx31lite_map_io, 283 .map_io = mx31lite_map_io,
286 .init_irq = mx31_init_irq, 284 .init_early = imx31_init_early,
287 .init_machine = mxc_board_init, 285 .init_irq = mx31_init_irq,
288 .timer = &mx31lite_timer, 286 .timer = &mx31lite_timer,
287 .init_machine = mx31lite_init,
289MACHINE_END 288MACHINE_END
diff --git a/arch/arm/mach-mx3/mach-mx31moboard.c b/arch/arm/mach-mx3/mach-mx31moboard.c
index 1aa8d65fccbb..3a021b01161d 100644
--- a/arch/arm/mach-mx3/mach-mx31moboard.c
+++ b/arch/arm/mach-mx3/mach-mx31moboard.c
@@ -214,7 +214,7 @@ static struct regulator_init_data cam_vreg_data = {
214 .consumer_supplies = cam_consumers, 214 .consumer_supplies = cam_consumers,
215}; 215};
216 216
217static struct mc13783_regulator_init_data moboard_regulators[] = { 217static struct mc13xxx_regulator_init_data moboard_regulators[] = {
218 { 218 {
219 .id = MC13783_REG_VMMC1, 219 .id = MC13783_REG_VMMC1,
220 .init_data = &sdhc_vreg_data, 220 .init_data = &sdhc_vreg_data,
@@ -267,12 +267,14 @@ static struct mc13783_leds_platform_data moboard_leds = {
267 .tc2_period = MC13783_LED_PERIOD_10MS, 267 .tc2_period = MC13783_LED_PERIOD_10MS,
268}; 268};
269 269
270static struct mc13783_platform_data moboard_pmic = { 270static struct mc13xxx_platform_data moboard_pmic = {
271 .regulators = moboard_regulators, 271 .regulators = {
272 .num_regulators = ARRAY_SIZE(moboard_regulators), 272 .regulators = moboard_regulators,
273 .num_regulators = ARRAY_SIZE(moboard_regulators),
274 },
273 .leds = &moboard_leds, 275 .leds = &moboard_leds,
274 .flags = MC13783_USE_REGULATOR | MC13783_USE_RTC | 276 .flags = MC13XXX_USE_REGULATOR | MC13XXX_USE_RTC |
275 MC13783_USE_ADC | MC13783_USE_LED, 277 MC13XXX_USE_ADC | MC13XXX_USE_LED,
276}; 278};
277 279
278static struct spi_board_info moboard_spi_board_info[] __initdata = { 280static struct spi_board_info moboard_spi_board_info[] __initdata = {
@@ -400,19 +402,24 @@ static void usb_xcvr_reset(void)
400 mdelay(1); 402 mdelay(1);
401} 403}
402 404
403#if defined(CONFIG_USB_ULPI) 405static int moboard_usbh2_init_hw(struct platform_device *pdev)
406{
407 return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED);
408}
404 409
405static struct mxc_usbh_platform_data usbh2_pdata __initdata = { 410static struct mxc_usbh_platform_data usbh2_pdata __initdata = {
411 .init = moboard_usbh2_init_hw,
406 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, 412 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT,
407 .flags = MXC_EHCI_POWER_PINS_ENABLED,
408}; 413};
409 414
410static int __init moboard_usbh2_init(void) 415static int __init moboard_usbh2_init(void)
411{ 416{
412 struct platform_device *pdev; 417 struct platform_device *pdev;
413 418
414 usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 419 usbh2_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
415 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); 420 ULPI_OTG_DRVVBUS_EXT);
421 if (!usbh2_pdata.otg)
422 return -ENODEV;
416 423
417 pdev = imx31_add_mxc_ehci_hs(2, &usbh2_pdata); 424 pdev = imx31_add_mxc_ehci_hs(2, &usbh2_pdata);
418 if (IS_ERR(pdev)) 425 if (IS_ERR(pdev))
@@ -420,10 +427,6 @@ static int __init moboard_usbh2_init(void)
420 427
421 return 0; 428 return 0;
422} 429}
423#else
424static inline int moboard_usbh2_init(void) { return 0; }
425#endif
426
427 430
428static struct gpio_led mx31moboard_leds[] = { 431static struct gpio_led mx31moboard_leds[] = {
429 { 432 {
@@ -503,7 +506,7 @@ core_param(mx31moboard_baseboard, mx31moboard_baseboard, int, 0444);
503/* 506/*
504 * Board specific initialization. 507 * Board specific initialization.
505 */ 508 */
506static void __init mxc_board_init(void) 509static void __init mx31moboard_init(void)
507{ 510{
508 mxc_iomux_setup_multiple_pins(moboard_pins, ARRAY_SIZE(moboard_pins), 511 mxc_iomux_setup_multiple_pins(moboard_pins, ARRAY_SIZE(moboard_pins),
509 "moboard"); 512 "moboard");
@@ -564,10 +567,10 @@ struct sys_timer mx31moboard_timer = {
564 567
565MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard") 568MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard")
566 /* Maintainer: Valentin Longchamp, EPFL Mobots group */ 569 /* Maintainer: Valentin Longchamp, EPFL Mobots group */
567 .boot_params = MX3x_PHYS_OFFSET + 0x100, 570 .boot_params = MX3x_PHYS_OFFSET + 0x100,
568 .map_io = mx31_map_io, 571 .map_io = mx31_map_io,
569 .init_irq = mx31_init_irq, 572 .init_early = imx31_init_early,
570 .init_machine = mxc_board_init, 573 .init_irq = mx31_init_irq,
571 .timer = &mx31moboard_timer, 574 .timer = &mx31moboard_timer,
575 .init_machine = mx31moboard_init,
572MACHINE_END 576MACHINE_END
573
diff --git a/arch/arm/mach-mx3/mach-mx35_3ds.c b/arch/arm/mach-mx3/mach-mx35_3ds.c
index b1963f257c20..ff5fe231b8d6 100644
--- a/arch/arm/mach-mx3/mach-mx35_3ds.c
+++ b/arch/arm/mach-mx3/mach-mx35_3ds.c
@@ -118,24 +118,42 @@ static iomux_v3_cfg_t mx35pdk_pads[] = {
118 MX35_PAD_SD1_DATA1__ESDHC1_DAT1, 118 MX35_PAD_SD1_DATA1__ESDHC1_DAT1,
119 MX35_PAD_SD1_DATA2__ESDHC1_DAT2, 119 MX35_PAD_SD1_DATA2__ESDHC1_DAT2,
120 MX35_PAD_SD1_DATA3__ESDHC1_DAT3, 120 MX35_PAD_SD1_DATA3__ESDHC1_DAT3,
121 /* I2C1 */
122 MX35_PAD_I2C1_CLK__I2C1_SCL,
123 MX35_PAD_I2C1_DAT__I2C1_SDA,
121}; 124};
122 125
126static int mx35_3ds_otg_init(struct platform_device *pdev)
127{
128 return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERNAL_PHY);
129}
130
123/* OTG config */ 131/* OTG config */
124static const struct fsl_usb2_platform_data usb_otg_pdata __initconst = { 132static const struct fsl_usb2_platform_data usb_otg_pdata __initconst = {
125 .operating_mode = FSL_USB2_DR_DEVICE, 133 .operating_mode = FSL_USB2_DR_DEVICE,
126 .phy_mode = FSL_USB2_PHY_UTMI_WIDE, 134 .phy_mode = FSL_USB2_PHY_UTMI_WIDE,
135 .workaround = FLS_USB2_WORKAROUND_ENGCM09152,
136/*
137 * ENGCM09152 also requires a hardware change.
138 * Please check the MX35 Chip Errata document for details.
139 */
127}; 140};
128 141
129static struct mxc_usbh_platform_data otg_pdata __initdata = { 142static struct mxc_usbh_platform_data otg_pdata __initdata = {
143 .init = mx35_3ds_otg_init,
130 .portsc = MXC_EHCI_MODE_UTMI, 144 .portsc = MXC_EHCI_MODE_UTMI,
131 .flags = MXC_EHCI_INTERNAL_PHY,
132}; 145};
133 146
147static int mx35_3ds_usbh_init(struct platform_device *pdev)
148{
149 return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_SINGLE_UNI |
150 MXC_EHCI_INTERNAL_PHY);
151}
152
134/* USB HOST config */ 153/* USB HOST config */
135static const struct mxc_usbh_platform_data usb_host_pdata __initconst = { 154static const struct mxc_usbh_platform_data usb_host_pdata __initconst = {
155 .init = mx35_3ds_usbh_init,
136 .portsc = MXC_EHCI_MODE_SERIAL, 156 .portsc = MXC_EHCI_MODE_SERIAL,
137 .flags = MXC_EHCI_INTERFACE_SINGLE_UNI |
138 MXC_EHCI_INTERNAL_PHY,
139}; 157};
140 158
141static int otg_mode_host; 159static int otg_mode_host;
@@ -153,10 +171,14 @@ static int __init mx35_3ds_otg_mode(char *options)
153} 171}
154__setup("otg_mode=", mx35_3ds_otg_mode); 172__setup("otg_mode=", mx35_3ds_otg_mode);
155 173
174static const struct imxi2c_platform_data mx35_3ds_i2c0_data __initconst = {
175 .bitrate = 100000,
176};
177
156/* 178/*
157 * Board specific initialization. 179 * Board specific initialization.
158 */ 180 */
159static void __init mxc_board_init(void) 181static void __init mx35_3ds_init(void)
160{ 182{
161 mxc_iomux_v3_setup_multiple_pads(mx35pdk_pads, ARRAY_SIZE(mx35pdk_pads)); 183 mxc_iomux_v3_setup_multiple_pads(mx35pdk_pads, ARRAY_SIZE(mx35pdk_pads));
162 184
@@ -180,6 +202,7 @@ static void __init mxc_board_init(void)
180 if (mxc_expio_init(MX35_CS5_BASE_ADDR, EXPIO_PARENT_INT)) 202 if (mxc_expio_init(MX35_CS5_BASE_ADDR, EXPIO_PARENT_INT))
181 pr_warn("Init of the debugboard failed, all " 203 pr_warn("Init of the debugboard failed, all "
182 "devices on the debugboard are unusable.\n"); 204 "devices on the debugboard are unusable.\n");
205 imx35_add_imx_i2c0(&mx35_3ds_i2c0_data);
183} 206}
184 207
185static void __init mx35pdk_timer_init(void) 208static void __init mx35pdk_timer_init(void)
@@ -193,9 +216,10 @@ struct sys_timer mx35pdk_timer = {
193 216
194MACHINE_START(MX35_3DS, "Freescale MX35PDK") 217MACHINE_START(MX35_3DS, "Freescale MX35PDK")
195 /* Maintainer: Freescale Semiconductor, Inc */ 218 /* Maintainer: Freescale Semiconductor, Inc */
196 .boot_params = MX3x_PHYS_OFFSET + 0x100, 219 .boot_params = MX3x_PHYS_OFFSET + 0x100,
197 .map_io = mx35_map_io, 220 .map_io = mx35_map_io,
198 .init_irq = mx35_init_irq, 221 .init_early = imx35_init_early,
199 .init_machine = mxc_board_init, 222 .init_irq = mx35_init_irq,
200 .timer = &mx35pdk_timer, 223 .timer = &mx35pdk_timer,
224 .init_machine = mx35_3ds_init,
201MACHINE_END 225MACHINE_END
diff --git a/arch/arm/mach-mx3/mach-pcm037.c b/arch/arm/mach-mx3/mach-pcm037.c
index b752f6bc20a2..f07d3bded674 100644
--- a/arch/arm/mach-mx3/mach-pcm037.c
+++ b/arch/arm/mach-mx3/mach-pcm037.c
@@ -533,17 +533,25 @@ static struct platform_device pcm970_sja1000 = {
533 .num_resources = ARRAY_SIZE(pcm970_sja1000_resources), 533 .num_resources = ARRAY_SIZE(pcm970_sja1000_resources),
534}; 534};
535 535
536#if defined(CONFIG_USB_ULPI) 536static int pcm037_otg_init(struct platform_device *pdev)
537{
538 return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI);
539}
540
537static struct mxc_usbh_platform_data otg_pdata __initdata = { 541static struct mxc_usbh_platform_data otg_pdata __initdata = {
542 .init = pcm037_otg_init,
538 .portsc = MXC_EHCI_MODE_ULPI, 543 .portsc = MXC_EHCI_MODE_ULPI,
539 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
540}; 544};
541 545
546static int pcm037_usbh2_init(struct platform_device *pdev)
547{
548 return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI);
549}
550
542static struct mxc_usbh_platform_data usbh2_pdata __initdata = { 551static struct mxc_usbh_platform_data usbh2_pdata __initdata = {
552 .init = pcm037_usbh2_init,
543 .portsc = MXC_EHCI_MODE_ULPI, 553 .portsc = MXC_EHCI_MODE_ULPI,
544 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
545}; 554};
546#endif
547 555
548static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { 556static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
549 .operating_mode = FSL_USB2_DR_DEVICE, 557 .operating_mode = FSL_USB2_DR_DEVICE,
@@ -568,7 +576,7 @@ __setup("otg_mode=", pcm037_otg_mode);
568/* 576/*
569 * Board specific initialization. 577 * Board specific initialization.
570 */ 578 */
571static void __init mxc_board_init(void) 579static void __init pcm037_init(void)
572{ 580{
573 int ret; 581 int ret;
574 582
@@ -646,19 +654,18 @@ static void __init mxc_board_init(void)
646 654
647 platform_device_register(&pcm970_sja1000); 655 platform_device_register(&pcm970_sja1000);
648 656
649#if defined(CONFIG_USB_ULPI)
650 if (otg_mode_host) { 657 if (otg_mode_host) {
651 otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 658 otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
652 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); 659 ULPI_OTG_DRVVBUS_EXT);
653 660 if (otg_pdata.otg)
654 imx31_add_mxc_ehci_otg(&otg_pdata); 661 imx31_add_mxc_ehci_otg(&otg_pdata);
655 } 662 }
656 663
657 usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 664 usbh2_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
658 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); 665 ULPI_OTG_DRVVBUS_EXT);
666 if (usbh2_pdata.otg)
667 imx31_add_mxc_ehci_hs(2, &usbh2_pdata);
659 668
660 imx31_add_mxc_ehci_hs(2, &usbh2_pdata);
661#endif
662 if (!otg_mode_host) 669 if (!otg_mode_host)
663 imx31_add_fsl_usb2_udc(&otg_device_pdata); 670 imx31_add_fsl_usb2_udc(&otg_device_pdata);
664 671
@@ -675,9 +682,10 @@ struct sys_timer pcm037_timer = {
675 682
676MACHINE_START(PCM037, "Phytec Phycore pcm037") 683MACHINE_START(PCM037, "Phytec Phycore pcm037")
677 /* Maintainer: Pengutronix */ 684 /* Maintainer: Pengutronix */
678 .boot_params = MX3x_PHYS_OFFSET + 0x100, 685 .boot_params = MX3x_PHYS_OFFSET + 0x100,
679 .map_io = mx31_map_io, 686 .map_io = mx31_map_io,
680 .init_irq = mx31_init_irq, 687 .init_early = imx31_init_early,
681 .init_machine = mxc_board_init, 688 .init_irq = mx31_init_irq,
682 .timer = &pcm037_timer, 689 .timer = &pcm037_timer,
690 .init_machine = pcm037_init,
683MACHINE_END 691MACHINE_END
diff --git a/arch/arm/mach-mx3/mach-pcm037_eet.c b/arch/arm/mach-mx3/mach-pcm037_eet.c
index fda56545d2fd..df6fb07d037e 100644
--- a/arch/arm/mach-mx3/mach-pcm037_eet.c
+++ b/arch/arm/mach-mx3/mach-pcm037_eet.c
@@ -180,9 +180,7 @@ static int __init eet_init_devices(void)
180 180
181 /* SPI */ 181 /* SPI */
182 spi_register_board_info(pcm037_spi_dev, ARRAY_SIZE(pcm037_spi_dev)); 182 spi_register_board_info(pcm037_spi_dev, ARRAY_SIZE(pcm037_spi_dev));
183#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
184 imx31_add_spi_imx0(&pcm037_spi1_pdata); 183 imx31_add_spi_imx0(&pcm037_spi1_pdata);
185#endif
186 184
187 platform_device_register(&pcm037_gpio_keys_device); 185 platform_device_register(&pcm037_gpio_keys_device);
188 186
diff --git a/arch/arm/mach-mx3/mach-pcm043.c b/arch/arm/mach-mx3/mach-pcm043.c
index bcf83fc7e701..b3ecfb22d241 100644
--- a/arch/arm/mach-mx3/mach-pcm043.c
+++ b/arch/arm/mach-mx3/mach-pcm043.c
@@ -115,7 +115,6 @@ static const struct imxuart_platform_data uart_pdata __initconst = {
115 .flags = IMXUART_HAVE_RTSCTS, 115 .flags = IMXUART_HAVE_RTSCTS,
116}; 116};
117 117
118#if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE
119static const struct imxi2c_platform_data pcm043_i2c0_data __initconst = { 118static const struct imxi2c_platform_data pcm043_i2c0_data __initconst = {
120 .bitrate = 50000, 119 .bitrate = 50000,
121}; 120};
@@ -134,7 +133,6 @@ static struct i2c_board_info pcm043_i2c_devices[] = {
134 I2C_BOARD_INFO("pcf8563", 0x51), 133 I2C_BOARD_INFO("pcf8563", 0x51),
135 } 134 }
136}; 135};
137#endif
138 136
139static struct platform_device *devices[] __initdata = { 137static struct platform_device *devices[] __initdata = {
140 &pcm043_flash, 138 &pcm043_flash,
@@ -221,9 +219,9 @@ static iomux_v3_cfg_t pcm043_pads[] = {
221 MX35_PAD_SD1_DATA3__ESDHC1_DAT3, 219 MX35_PAD_SD1_DATA3__ESDHC1_DAT3,
222}; 220};
223 221
224#define AC97_GPIO_TXFS (1 * 32 + 31) 222#define AC97_GPIO_TXFS IMX_GPIO_NR(2, 31)
225#define AC97_GPIO_TXD (1 * 32 + 28) 223#define AC97_GPIO_TXD IMX_GPIO_NR(2, 28)
226#define AC97_GPIO_RESET (1 * 32 + 0) 224#define AC97_GPIO_RESET IMX_GPIO_NR(2, 0)
227 225
228static void pcm043_ac97_warm_reset(struct snd_ac97 *ac97) 226static void pcm043_ac97_warm_reset(struct snd_ac97 *ac97)
229{ 227{
@@ -307,18 +305,26 @@ pcm037_nand_board_info __initconst = {
307 .hw_ecc = 1, 305 .hw_ecc = 1,
308}; 306};
309 307
310#if defined(CONFIG_USB_ULPI) 308static int pcm043_otg_init(struct platform_device *pdev)
309{
310 return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI);
311}
312
311static struct mxc_usbh_platform_data otg_pdata __initdata = { 313static struct mxc_usbh_platform_data otg_pdata __initdata = {
314 .init = pcm043_otg_init,
312 .portsc = MXC_EHCI_MODE_UTMI, 315 .portsc = MXC_EHCI_MODE_UTMI,
313 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
314}; 316};
315 317
318static int pcm043_usbh1_init(struct platform_device *pdev)
319{
320 return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_SINGLE_UNI |
321 MXC_EHCI_INTERNAL_PHY | MXC_EHCI_IPPUE_DOWN);
322}
323
316static const struct mxc_usbh_platform_data usbh1_pdata __initconst = { 324static const struct mxc_usbh_platform_data usbh1_pdata __initconst = {
325 .init = pcm043_usbh1_init,
317 .portsc = MXC_EHCI_MODE_SERIAL, 326 .portsc = MXC_EHCI_MODE_SERIAL,
318 .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY |
319 MXC_EHCI_IPPUE_DOWN,
320}; 327};
321#endif
322 328
323static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { 329static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
324 .operating_mode = FSL_USB2_DR_DEVICE, 330 .operating_mode = FSL_USB2_DR_DEVICE,
@@ -343,7 +349,7 @@ __setup("otg_mode=", pcm043_otg_mode);
343/* 349/*
344 * Board specific initialization. 350 * Board specific initialization.
345 */ 351 */
346static void __init mxc_board_init(void) 352static void __init pcm043_init(void)
347{ 353{
348 mxc_iomux_v3_setup_multiple_pads(pcm043_pads, ARRAY_SIZE(pcm043_pads)); 354 mxc_iomux_v3_setup_multiple_pads(pcm043_pads, ARRAY_SIZE(pcm043_pads));
349 355
@@ -369,26 +375,22 @@ static void __init mxc_board_init(void)
369 375
370 imx35_add_imx_uart1(&uart_pdata); 376 imx35_add_imx_uart1(&uart_pdata);
371 377
372#if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE
373 i2c_register_board_info(0, pcm043_i2c_devices, 378 i2c_register_board_info(0, pcm043_i2c_devices,
374 ARRAY_SIZE(pcm043_i2c_devices)); 379 ARRAY_SIZE(pcm043_i2c_devices));
375 380
376 imx35_add_imx_i2c0(&pcm043_i2c0_data); 381 imx35_add_imx_i2c0(&pcm043_i2c0_data);
377#endif
378 382
379 mxc_register_device(&mx3_ipu, &mx3_ipu_data); 383 mxc_register_device(&mx3_ipu, &mx3_ipu_data);
380 mxc_register_device(&mx3_fb, &mx3fb_pdata); 384 mxc_register_device(&mx3_fb, &mx3fb_pdata);
381 385
382#if defined(CONFIG_USB_ULPI)
383 if (otg_mode_host) { 386 if (otg_mode_host) {
384 otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 387 otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
385 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); 388 ULPI_OTG_DRVVBUS_EXT);
386 389 if (otg_pdata.otg)
387 imx35_add_mxc_ehci_otg(&otg_pdata); 390 imx35_add_mxc_ehci_otg(&otg_pdata);
388 } 391 }
389
390 imx35_add_mxc_ehci_hs(&usbh1_pdata); 392 imx35_add_mxc_ehci_hs(&usbh1_pdata);
391#endif 393
392 if (!otg_mode_host) 394 if (!otg_mode_host)
393 imx35_add_fsl_usb2_udc(&otg_device_pdata); 395 imx35_add_fsl_usb2_udc(&otg_device_pdata);
394 396
@@ -407,10 +409,10 @@ struct sys_timer pcm043_timer = {
407 409
408MACHINE_START(PCM043, "Phytec Phycore pcm043") 410MACHINE_START(PCM043, "Phytec Phycore pcm043")
409 /* Maintainer: Pengutronix */ 411 /* Maintainer: Pengutronix */
410 .boot_params = MX3x_PHYS_OFFSET + 0x100, 412 .boot_params = MX3x_PHYS_OFFSET + 0x100,
411 .map_io = mx35_map_io, 413 .map_io = mx35_map_io,
412 .init_irq = mx35_init_irq, 414 .init_early = imx35_init_early,
413 .init_machine = mxc_board_init, 415 .init_irq = mx35_init_irq,
414 .timer = &pcm043_timer, 416 .timer = &pcm043_timer,
417 .init_machine = pcm043_init,
415MACHINE_END 418MACHINE_END
416
diff --git a/arch/arm/mach-mx3/mach-qong.c b/arch/arm/mach-mx3/mach-qong.c
index fd1050c40964..17f758b77623 100644
--- a/arch/arm/mach-mx3/mach-qong.c
+++ b/arch/arm/mach-mx3/mach-qong.c
@@ -54,10 +54,6 @@
54 54
55#define QONG_FPGA_IRQ IOMUX_TO_IRQ(MX31_PIN_DTR_DCE1) 55#define QONG_FPGA_IRQ IOMUX_TO_IRQ(MX31_PIN_DTR_DCE1)
56 56
57/*
58 * This file contains the board-specific initialization routines.
59 */
60
61static const struct imxuart_platform_data uart_pdata __initconst = { 57static const struct imxuart_platform_data uart_pdata __initconst = {
62 .flags = IMXUART_HAVE_RTSCTS, 58 .flags = IMXUART_HAVE_RTSCTS,
63}; 59};
@@ -247,7 +243,7 @@ static void __init qong_init_fpga(void)
247/* 243/*
248 * Board specific initialization. 244 * Board specific initialization.
249 */ 245 */
250static void __init mxc_board_init(void) 246static void __init qong_init(void)
251{ 247{
252 mxc_init_imx_uart(); 248 mxc_init_imx_uart();
253 qong_init_nor_mtd(); 249 qong_init_nor_mtd();
@@ -263,16 +259,12 @@ static struct sys_timer qong_timer = {
263 .init = qong_timer_init, 259 .init = qong_timer_init,
264}; 260};
265 261
266/*
267 * The following uses standard kernel macros defined in arch.h in order to
268 * initialize __mach_desc_QONG data structure.
269 */
270
271MACHINE_START(QONG, "Dave/DENX QongEVB-LITE") 262MACHINE_START(QONG, "Dave/DENX QongEVB-LITE")
272 /* Maintainer: DENX Software Engineering GmbH */ 263 /* Maintainer: DENX Software Engineering GmbH */
273 .boot_params = MX3x_PHYS_OFFSET + 0x100, 264 .boot_params = MX3x_PHYS_OFFSET + 0x100,
274 .map_io = mx31_map_io, 265 .map_io = mx31_map_io,
275 .init_irq = mx31_init_irq, 266 .init_early = imx31_init_early,
276 .init_machine = mxc_board_init, 267 .init_irq = mx31_init_irq,
277 .timer = &qong_timer, 268 .timer = &qong_timer,
269 .init_machine = qong_init,
278MACHINE_END 270MACHINE_END
diff --git a/arch/arm/mach-mx3/mach-vpr200.c b/arch/arm/mach-mx3/mach-vpr200.c
new file mode 100644
index 000000000000..2cf390fbd980
--- /dev/null
+++ b/arch/arm/mach-mx3/mach-vpr200.c
@@ -0,0 +1,328 @@
1/*
2 * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright (C) 2009 Marc Kleine-Budde, Pengutronix
4 * Copyright 2010 Creative Product Design
5 *
6 * Derived from mx35 3stack.
7 * Original author: Fabio Estevam <fabio.estevam@freescale.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 */
19
20#include <linux/types.h>
21#include <linux/init.h>
22#include <linux/platform_device.h>
23#include <linux/mtd/physmap.h>
24#include <linux/memory.h>
25#include <linux/gpio.h>
26
27#include <asm/mach-types.h>
28#include <asm/mach/arch.h>
29#include <asm/mach/time.h>
30
31#include <mach/hardware.h>
32#include <mach/common.h>
33#include <mach/iomux-mx35.h>
34#include <mach/irqs.h>
35#include <mach/ipu.h>
36#include <mach/mx3fb.h>
37
38#include <linux/i2c.h>
39#include <linux/i2c/at24.h>
40#include <linux/mfd/mc13xxx.h>
41#include <linux/gpio_keys.h>
42
43#include "devices-imx35.h"
44#include "devices.h"
45
46#define GPIO_LCDPWR IMX_GPIO_NR(1, 2)
47#define GPIO_PMIC_INT IMX_GPIO_NR(2, 0)
48
49#define GPIO_BUTTON1 IMX_GPIO_NR(1, 4)
50#define GPIO_BUTTON2 IMX_GPIO_NR(1, 5)
51#define GPIO_BUTTON3 IMX_GPIO_NR(1, 7)
52#define GPIO_BUTTON4 IMX_GPIO_NR(1, 8)
53#define GPIO_BUTTON5 IMX_GPIO_NR(1, 9)
54#define GPIO_BUTTON6 IMX_GPIO_NR(1, 10)
55#define GPIO_BUTTON7 IMX_GPIO_NR(1, 11)
56#define GPIO_BUTTON8 IMX_GPIO_NR(1, 12)
57
58static const struct fb_videomode fb_modedb[] = {
59 {
60 /* 800x480 @ 60 Hz */
61 .name = "PT0708048",
62 .refresh = 60,
63 .xres = 800,
64 .yres = 480,
65 .pixclock = KHZ2PICOS(33260),
66 .left_margin = 50,
67 .right_margin = 156,
68 .upper_margin = 10,
69 .lower_margin = 10,
70 .hsync_len = 1, /* note: DE only display */
71 .vsync_len = 1, /* note: DE only display */
72 .sync = FB_SYNC_CLK_IDLE_EN | FB_SYNC_OE_ACT_HIGH,
73 .vmode = FB_VMODE_NONINTERLACED,
74 .flag = 0,
75 }, {
76 /* 800x480 @ 60 Hz */
77 .name = "CTP-CLAA070LC0ACW",
78 .refresh = 60,
79 .xres = 800,
80 .yres = 480,
81 .pixclock = KHZ2PICOS(27000),
82 .left_margin = 50,
83 .right_margin = 50, /* whole line should have 900 clocks */
84 .upper_margin = 10,
85 .lower_margin = 10, /* whole frame should have 500 lines */
86 .hsync_len = 1, /* note: DE only display */
87 .vsync_len = 1, /* note: DE only display */
88 .sync = FB_SYNC_CLK_IDLE_EN | FB_SYNC_OE_ACT_HIGH,
89 .vmode = FB_VMODE_NONINTERLACED,
90 .flag = 0,
91 }
92};
93
94static struct ipu_platform_data mx3_ipu_data = {
95 .irq_base = MXC_IPU_IRQ_START,
96};
97
98static struct mx3fb_platform_data mx3fb_pdata = {
99 .dma_dev = &mx3_ipu.dev,
100 .name = "PT0708048",
101 .mode = fb_modedb,
102 .num_modes = ARRAY_SIZE(fb_modedb),
103};
104
105static struct physmap_flash_data vpr200_flash_data = {
106 .width = 2,
107};
108
109static struct resource vpr200_flash_resource = {
110 .start = MX35_CS0_BASE_ADDR,
111 .end = MX35_CS0_BASE_ADDR + SZ_64M - 1,
112 .flags = IORESOURCE_MEM,
113};
114
115static struct platform_device vpr200_flash = {
116 .name = "physmap-flash",
117 .id = 0,
118 .dev = {
119 .platform_data = &vpr200_flash_data,
120 },
121 .resource = &vpr200_flash_resource,
122 .num_resources = 1,
123};
124
125static const struct mxc_nand_platform_data
126 vpr200_nand_board_info __initconst = {
127 .width = 1,
128 .hw_ecc = 1,
129 .flash_bbt = 1,
130};
131
132#define VPR_KEY_DEBOUNCE 500
133static struct gpio_keys_button vpr200_gpio_keys_table[] = {
134 {KEY_F2, GPIO_BUTTON1, 1, "vpr-keys: F2", 0, VPR_KEY_DEBOUNCE},
135 {KEY_F3, GPIO_BUTTON2, 1, "vpr-keys: F3", 0, VPR_KEY_DEBOUNCE},
136 {KEY_F4, GPIO_BUTTON3, 1, "vpr-keys: F4", 0, VPR_KEY_DEBOUNCE},
137 {KEY_F5, GPIO_BUTTON4, 1, "vpr-keys: F5", 0, VPR_KEY_DEBOUNCE},
138 {KEY_F6, GPIO_BUTTON5, 1, "vpr-keys: F6", 0, VPR_KEY_DEBOUNCE},
139 {KEY_F7, GPIO_BUTTON6, 1, "vpr-keys: F7", 0, VPR_KEY_DEBOUNCE},
140 {KEY_F8, GPIO_BUTTON7, 1, "vpr-keys: F8", 1, VPR_KEY_DEBOUNCE},
141 {KEY_F9, GPIO_BUTTON8, 1, "vpr-keys: F9", 1, VPR_KEY_DEBOUNCE},
142};
143
144static struct gpio_keys_platform_data vpr200_gpio_keys_data = {
145 .buttons = vpr200_gpio_keys_table,
146 .nbuttons = ARRAY_SIZE(vpr200_gpio_keys_table),
147};
148
149static struct platform_device vpr200_device_gpiokeys = {
150 .name = "gpio-keys",
151 .dev = {
152 .platform_data = &vpr200_gpio_keys_data,
153 }
154};
155
156static struct mc13xxx_platform_data vpr200_pmic = {
157 .flags = MC13XXX_USE_ADC | MC13XXX_USE_TOUCHSCREEN,
158};
159
160static const struct imxi2c_platform_data vpr200_i2c0_data __initconst = {
161 .bitrate = 50000,
162};
163
164static struct at24_platform_data vpr200_eeprom = {
165 .byte_len = 2048 / 8,
166 .page_size = 1,
167};
168
169static struct i2c_board_info vpr200_i2c_devices[] = {
170 {
171 I2C_BOARD_INFO("at24", 0x50), /* E0=0, E1=0, E2=0 */
172 .platform_data = &vpr200_eeprom,
173 }, {
174 I2C_BOARD_INFO("mc13892", 0x08),
175 .platform_data = &vpr200_pmic,
176 .irq = gpio_to_irq(GPIO_PMIC_INT),
177 }
178};
179
180static iomux_v3_cfg_t vpr200_pads[] = {
181 /* UART1 */
182 MX35_PAD_TXD1__UART1_TXD_MUX,
183 MX35_PAD_RXD1__UART1_RXD_MUX,
184 /* UART3 */
185 MX35_PAD_ATA_DATA10__UART3_RXD_MUX,
186 MX35_PAD_ATA_DATA11__UART3_TXD_MUX,
187 /* FEC */
188 MX35_PAD_FEC_TX_CLK__FEC_TX_CLK,
189 MX35_PAD_FEC_RX_CLK__FEC_RX_CLK,
190 MX35_PAD_FEC_RX_DV__FEC_RX_DV,
191 MX35_PAD_FEC_COL__FEC_COL,
192 MX35_PAD_FEC_RDATA0__FEC_RDATA_0,
193 MX35_PAD_FEC_TDATA0__FEC_TDATA_0,
194 MX35_PAD_FEC_TX_EN__FEC_TX_EN,
195 MX35_PAD_FEC_MDC__FEC_MDC,
196 MX35_PAD_FEC_MDIO__FEC_MDIO,
197 MX35_PAD_FEC_TX_ERR__FEC_TX_ERR,
198 MX35_PAD_FEC_RX_ERR__FEC_RX_ERR,
199 MX35_PAD_FEC_CRS__FEC_CRS,
200 MX35_PAD_FEC_RDATA1__FEC_RDATA_1,
201 MX35_PAD_FEC_TDATA1__FEC_TDATA_1,
202 MX35_PAD_FEC_RDATA2__FEC_RDATA_2,
203 MX35_PAD_FEC_TDATA2__FEC_TDATA_2,
204 MX35_PAD_FEC_RDATA3__FEC_RDATA_3,
205 MX35_PAD_FEC_TDATA3__FEC_TDATA_3,
206 /* Display */
207 MX35_PAD_LD0__IPU_DISPB_DAT_0,
208 MX35_PAD_LD1__IPU_DISPB_DAT_1,
209 MX35_PAD_LD2__IPU_DISPB_DAT_2,
210 MX35_PAD_LD3__IPU_DISPB_DAT_3,
211 MX35_PAD_LD4__IPU_DISPB_DAT_4,
212 MX35_PAD_LD5__IPU_DISPB_DAT_5,
213 MX35_PAD_LD6__IPU_DISPB_DAT_6,
214 MX35_PAD_LD7__IPU_DISPB_DAT_7,
215 MX35_PAD_LD8__IPU_DISPB_DAT_8,
216 MX35_PAD_LD9__IPU_DISPB_DAT_9,
217 MX35_PAD_LD10__IPU_DISPB_DAT_10,
218 MX35_PAD_LD11__IPU_DISPB_DAT_11,
219 MX35_PAD_LD12__IPU_DISPB_DAT_12,
220 MX35_PAD_LD13__IPU_DISPB_DAT_13,
221 MX35_PAD_LD14__IPU_DISPB_DAT_14,
222 MX35_PAD_LD15__IPU_DISPB_DAT_15,
223 MX35_PAD_LD16__IPU_DISPB_DAT_16,
224 MX35_PAD_LD17__IPU_DISPB_DAT_17,
225 MX35_PAD_D3_FPSHIFT__IPU_DISPB_D3_CLK,
226 MX35_PAD_D3_DRDY__IPU_DISPB_D3_DRDY,
227 MX35_PAD_CONTRAST__IPU_DISPB_CONTR,
228 /* LCD Enable */
229 MX35_PAD_D3_VSYNC__GPIO1_2,
230 /* USBOTG */
231 MX35_PAD_USBOTG_PWR__USB_TOP_USBOTG_PWR,
232 MX35_PAD_USBOTG_OC__USB_TOP_USBOTG_OC,
233 /* SDCARD */
234 MX35_PAD_SD1_CMD__ESDHC1_CMD,
235 MX35_PAD_SD1_CLK__ESDHC1_CLK,
236 MX35_PAD_SD1_DATA0__ESDHC1_DAT0,
237 MX35_PAD_SD1_DATA1__ESDHC1_DAT1,
238 MX35_PAD_SD1_DATA2__ESDHC1_DAT2,
239 MX35_PAD_SD1_DATA3__ESDHC1_DAT3,
240 /* PMIC */
241 MX35_PAD_GPIO2_0__GPIO2_0,
242 /* GPIO keys */
243 MX35_PAD_SCKR__GPIO1_4,
244 MX35_PAD_COMPARE__GPIO1_5,
245 MX35_PAD_SCKT__GPIO1_7,
246 MX35_PAD_FST__GPIO1_8,
247 MX35_PAD_HCKT__GPIO1_9,
248 MX35_PAD_TX5_RX0__GPIO1_10,
249 MX35_PAD_TX4_RX1__GPIO1_11,
250 MX35_PAD_TX3_RX2__GPIO1_12,
251};
252
253/* USB Device config */
254static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
255 .operating_mode = FSL_USB2_DR_DEVICE,
256 .phy_mode = FSL_USB2_PHY_UTMI,
257 .workaround = FLS_USB2_WORKAROUND_ENGCM09152,
258};
259
260/* USB HOST config */
261static const struct mxc_usbh_platform_data usb_host_pdata __initconst = {
262 .portsc = MXC_EHCI_MODE_SERIAL,
263 .flags = MXC_EHCI_INTERFACE_SINGLE_UNI |
264 MXC_EHCI_INTERNAL_PHY,
265};
266
267static struct platform_device *devices[] __initdata = {
268 &vpr200_flash,
269 &vpr200_device_gpiokeys,
270};
271
272/*
273 * Board specific initialization.
274 */
275static void __init vpr200_board_init(void)
276{
277 mxc_iomux_v3_setup_multiple_pads(vpr200_pads, ARRAY_SIZE(vpr200_pads));
278
279 imx35_add_fec(NULL);
280 imx35_add_imx2_wdt(NULL);
281
282 platform_add_devices(devices, ARRAY_SIZE(devices));
283
284 if (0 != gpio_request(GPIO_LCDPWR, "LCDPWR"))
285 printk(KERN_WARNING "vpr200: Couldn't get LCDPWR gpio\n");
286 else
287 gpio_direction_output(GPIO_LCDPWR, 0);
288
289 if (0 != gpio_request(GPIO_PMIC_INT, "PMIC_INT"))
290 printk(KERN_WARNING "vpr200: Couldn't get PMIC_INT gpio\n");
291 else
292 gpio_direction_input(GPIO_PMIC_INT);
293
294 imx35_add_imx_uart0(NULL);
295 imx35_add_imx_uart2(NULL);
296
297 mxc_register_device(&mx3_ipu, &mx3_ipu_data);
298 mxc_register_device(&mx3_fb, &mx3fb_pdata);
299
300 imx35_add_fsl_usb2_udc(&otg_device_pdata);
301 imx35_add_mxc_ehci_hs(&usb_host_pdata);
302
303 imx35_add_mxc_nand(&vpr200_nand_board_info);
304 imx35_add_sdhci_esdhc_imx(0, NULL);
305
306 i2c_register_board_info(0, vpr200_i2c_devices,
307 ARRAY_SIZE(vpr200_i2c_devices));
308
309 imx35_add_imx_i2c0(&vpr200_i2c0_data);
310}
311
312static void __init vpr200_timer_init(void)
313{
314 mx35_clocks_init();
315}
316
317struct sys_timer vpr200_timer = {
318 .init = vpr200_timer_init,
319};
320
321MACHINE_START(VPR200, "VPR200")
322 /* Maintainer: Creative Product Design */
323 .map_io = mx35_map_io,
324 .init_early = imx35_init_early,
325 .init_irq = mx35_init_irq,
326 .timer = &vpr200_timer,
327 .init_machine = vpr200_board_init,
328MACHINE_END
diff --git a/arch/arm/mach-mx3/mm.c b/arch/arm/mach-mx3/mm.c
index 47118f760244..54d7174b4202 100644
--- a/arch/arm/mach-mx3/mm.c
+++ b/arch/arm/mach-mx3/mm.c
@@ -27,14 +27,8 @@
27#include <mach/common.h> 27#include <mach/common.h>
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <mach/iomux-v3.h> 29#include <mach/iomux-v3.h>
30 30#include <mach/gpio.h>
31/*! 31#include <mach/irqs.h>
32 * @file mm.c
33 *
34 * @brief This file creates static virtual to physical mappings, common to all MX3 boards.
35 *
36 * @ingroup Memory
37 */
38 32
39#ifdef CONFIG_SOC_IMX31 33#ifdef CONFIG_SOC_IMX31
40static struct map_desc mx31_io_desc[] __initdata = { 34static struct map_desc mx31_io_desc[] __initdata = {
@@ -52,17 +46,25 @@ static struct map_desc mx31_io_desc[] __initdata = {
52 */ 46 */
53void __init mx31_map_io(void) 47void __init mx31_map_io(void)
54{ 48{
49 iotable_init(mx31_io_desc, ARRAY_SIZE(mx31_io_desc));
50}
51
52void __init imx31_init_early(void)
53{
55 mxc_set_cpu_type(MXC_CPU_MX31); 54 mxc_set_cpu_type(MXC_CPU_MX31);
56 mxc_arch_reset_init(MX31_IO_ADDRESS(MX31_WDOG_BASE_ADDR)); 55 mxc_arch_reset_init(MX31_IO_ADDRESS(MX31_WDOG_BASE_ADDR));
57
58 iotable_init(mx31_io_desc, ARRAY_SIZE(mx31_io_desc));
59} 56}
60 57
61int imx31_register_gpios(void); 58static struct mxc_gpio_port imx31_gpio_ports[] = {
59 DEFINE_IMX_GPIO_PORT_IRQ(MX31, 0, 1, MX31_INT_GPIO1),
60 DEFINE_IMX_GPIO_PORT_IRQ(MX31, 1, 2, MX31_INT_GPIO2),
61 DEFINE_IMX_GPIO_PORT_IRQ(MX31, 2, 3, MX31_INT_GPIO3),
62};
63
62void __init mx31_init_irq(void) 64void __init mx31_init_irq(void)
63{ 65{
64 mxc_init_irq(MX31_IO_ADDRESS(MX31_AVIC_BASE_ADDR)); 66 mxc_init_irq(MX31_IO_ADDRESS(MX31_AVIC_BASE_ADDR));
65 imx31_register_gpios(); 67 mxc_gpio_init(imx31_gpio_ports, ARRAY_SIZE(imx31_gpio_ports));
66} 68}
67#endif /* ifdef CONFIG_SOC_IMX31 */ 69#endif /* ifdef CONFIG_SOC_IMX31 */
68 70
@@ -77,18 +79,26 @@ static struct map_desc mx35_io_desc[] __initdata = {
77 79
78void __init mx35_map_io(void) 80void __init mx35_map_io(void)
79{ 81{
82 iotable_init(mx35_io_desc, ARRAY_SIZE(mx35_io_desc));
83}
84
85void __init imx35_init_early(void)
86{
80 mxc_set_cpu_type(MXC_CPU_MX35); 87 mxc_set_cpu_type(MXC_CPU_MX35);
81 mxc_iomux_v3_init(MX35_IO_ADDRESS(MX35_IOMUXC_BASE_ADDR)); 88 mxc_iomux_v3_init(MX35_IO_ADDRESS(MX35_IOMUXC_BASE_ADDR));
82 mxc_arch_reset_init(MX35_IO_ADDRESS(MX35_WDOG_BASE_ADDR)); 89 mxc_arch_reset_init(MX35_IO_ADDRESS(MX35_WDOG_BASE_ADDR));
83
84 iotable_init(mx35_io_desc, ARRAY_SIZE(mx35_io_desc));
85} 90}
86 91
87int imx35_register_gpios(void); 92static struct mxc_gpio_port imx35_gpio_ports[] = {
93 DEFINE_IMX_GPIO_PORT_IRQ(MX35, 0, 1, MX35_INT_GPIO1),
94 DEFINE_IMX_GPIO_PORT_IRQ(MX35, 1, 2, MX35_INT_GPIO2),
95 DEFINE_IMX_GPIO_PORT_IRQ(MX35, 2, 3, MX35_INT_GPIO3),
96};
97
88void __init mx35_init_irq(void) 98void __init mx35_init_irq(void)
89{ 99{
90 mxc_init_irq(MX35_IO_ADDRESS(MX35_AVIC_BASE_ADDR)); 100 mxc_init_irq(MX35_IO_ADDRESS(MX35_AVIC_BASE_ADDR));
91 imx35_register_gpios(); 101 mxc_gpio_init(imx35_gpio_ports, ARRAY_SIZE(imx35_gpio_ports));
92} 102}
93#endif /* ifdef CONFIG_SOC_IMX35 */ 103#endif /* ifdef CONFIG_SOC_IMX35 */
94 104
@@ -129,4 +139,3 @@ static int mxc_init_l2x0(void)
129 139
130arch_initcall(mxc_init_l2x0); 140arch_initcall(mxc_init_l2x0);
131#endif 141#endif
132
diff --git a/arch/arm/mach-mx3/mx31moboard-devboard.c b/arch/arm/mach-mx3/mx31moboard-devboard.c
index 94a0b9e4b7f3..6410b9c48a02 100644
--- a/arch/arm/mach-mx3/mx31moboard-devboard.c
+++ b/arch/arm/mach-mx3/mx31moboard-devboard.c
@@ -15,6 +15,7 @@
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/delay.h>
18#include <linux/platform_device.h> 19#include <linux/platform_device.h>
19#include <linux/slab.h> 20#include <linux/slab.h>
20#include <linux/types.h> 21#include <linux/types.h>
@@ -149,7 +150,10 @@ static int devboard_usbh1_hw_init(struct platform_device *pdev)
149 mxc_iomux_set_pad(MX31_PIN_CSPI1_SPI_RDY, USB_PAD_CFG); 150 mxc_iomux_set_pad(MX31_PIN_CSPI1_SPI_RDY, USB_PAD_CFG);
150 mxc_iomux_set_pad(MX31_PIN_SFS6, USB_PAD_CFG); 151 mxc_iomux_set_pad(MX31_PIN_SFS6, USB_PAD_CFG);
151 152
152 return 0; 153 mdelay(10);
154
155 return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED |
156 MXC_EHCI_INTERFACE_SINGLE_UNI);
153} 157}
154 158
155#define USBH1_VBUSEN_B IOMUX_TO_GPIO(MX31_PIN_NFRE_B) 159#define USBH1_VBUSEN_B IOMUX_TO_GPIO(MX31_PIN_NFRE_B)
@@ -187,7 +191,6 @@ static int devboard_isp1105_set_vbus(struct otg_transceiver *otg, bool on)
187static struct mxc_usbh_platform_data usbh1_pdata __initdata = { 191static struct mxc_usbh_platform_data usbh1_pdata __initdata = {
188 .init = devboard_usbh1_hw_init, 192 .init = devboard_usbh1_hw_init,
189 .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, 193 .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL,
190 .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI,
191}; 194};
192 195
193static int __init devboard_usbh1_init(void) 196static int __init devboard_usbh1_init(void)
diff --git a/arch/arm/mach-mx3/mx31moboard-marxbot.c b/arch/arm/mach-mx3/mx31moboard-marxbot.c
index f449a97ae1a2..57f7b00cb709 100644
--- a/arch/arm/mach-mx3/mx31moboard-marxbot.c
+++ b/arch/arm/mach-mx3/mx31moboard-marxbot.c
@@ -265,7 +265,10 @@ static int marxbot_usbh1_hw_init(struct platform_device *pdev)
265 mxc_iomux_set_pad(MX31_PIN_CSPI1_SPI_RDY, USB_PAD_CFG); 265 mxc_iomux_set_pad(MX31_PIN_CSPI1_SPI_RDY, USB_PAD_CFG);
266 mxc_iomux_set_pad(MX31_PIN_SFS6, USB_PAD_CFG); 266 mxc_iomux_set_pad(MX31_PIN_SFS6, USB_PAD_CFG);
267 267
268 return 0; 268 mdelay(10);
269
270 return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED |
271 MXC_EHCI_INTERFACE_SINGLE_UNI);
269} 272}
270 273
271#define USBH1_VBUSEN_B IOMUX_TO_GPIO(MX31_PIN_NFRE_B) 274#define USBH1_VBUSEN_B IOMUX_TO_GPIO(MX31_PIN_NFRE_B)
@@ -303,7 +306,6 @@ static int marxbot_isp1105_set_vbus(struct otg_transceiver *otg, bool on)
303static struct mxc_usbh_platform_data usbh1_pdata __initdata = { 306static struct mxc_usbh_platform_data usbh1_pdata __initdata = {
304 .init = marxbot_usbh1_hw_init, 307 .init = marxbot_usbh1_hw_init,
305 .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, 308 .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL,
306 .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI,
307}; 309};
308 310
309static int __init marxbot_usbh1_init(void) 311static int __init marxbot_usbh1_init(void)
diff --git a/arch/arm/mach-mx3/mx31moboard-smartbot.c b/arch/arm/mach-mx3/mx31moboard-smartbot.c
index bbec3c82264a..35f806e737c1 100644
--- a/arch/arm/mach-mx3/mx31moboard-smartbot.c
+++ b/arch/arm/mach-mx3/mx31moboard-smartbot.c
@@ -123,17 +123,24 @@ static const struct fsl_usb2_platform_data usb_pdata __initconst = {
123 123
124#if defined(CONFIG_USB_ULPI) 124#if defined(CONFIG_USB_ULPI)
125 125
126static int smartbot_otg_init(struct platform_device *pdev)
127{
128 return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED);
129}
130
126static struct mxc_usbh_platform_data otg_host_pdata __initdata = { 131static struct mxc_usbh_platform_data otg_host_pdata __initdata = {
132 .init = smartbot_otg_init,
127 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, 133 .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT,
128 .flags = MXC_EHCI_POWER_PINS_ENABLED,
129}; 134};
130 135
131static int __init smartbot_otg_host_init(void) 136static int __init smartbot_otg_host_init(void)
132{ 137{
133 struct platform_device *pdev; 138 struct platform_device *pdev;
134 139
135 otg_host_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, 140 otg_host_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
136 ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); 141 ULPI_OTG_DRVVBUS_EXT);
142 if (!otg_host_pdata.otg)
143 return -ENODEV;
137 144
138 pdev = imx31_add_mxc_ehci_otg(&otg_host_pdata); 145 pdev = imx31_add_mxc_ehci_otg(&otg_host_pdata);
139 if (IS_ERR(pdev)) 146 if (IS_ERR(pdev))
diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig
index de4fa992fc3e..83ee08847d4d 100644
--- a/arch/arm/mach-mx5/Kconfig
+++ b/arch/arm/mach-mx5/Kconfig
@@ -1,5 +1,6 @@
1if ARCH_MX5 1if ARCH_MX5
2# ARCH_MX51 and ARCH_MX50 are left for compatibility 2# ARCH_MX50/51/53 are left to mark places where prevent multi-soc in single
3# image. So for most time, SOC_IMX50/51/53 should be used.
3 4
4config ARCH_MX50 5config ARCH_MX50
5 bool 6 bool
@@ -50,6 +51,7 @@ config MACH_MX51_BABBAGE
50config MACH_MX51_3DS 51config MACH_MX51_3DS
51 bool "Support MX51PDK (3DS)" 52 bool "Support MX51PDK (3DS)"
52 select SOC_IMX51 53 select SOC_IMX51
54 select IMX_HAVE_PLATFORM_IMX2_WDT
53 select IMX_HAVE_PLATFORM_IMX_KEYPAD 55 select IMX_HAVE_PLATFORM_IMX_KEYPAD
54 select IMX_HAVE_PLATFORM_IMX_UART 56 select IMX_HAVE_PLATFORM_IMX_UART
55 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 57 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
@@ -112,19 +114,32 @@ config MACH_EUKREA_MBIMXSD51_BASEBOARD
112 114
113endchoice 115endchoice
114 116
115config MACH_MX51_EFIKAMX 117config MX51_EFIKA_COMMON
116 bool "Support MX51 Genesi Efika MX nettop" 118 bool
117 select SOC_IMX51 119 select SOC_IMX51
118 select IMX_HAVE_PLATFORM_IMX_UART 120 select IMX_HAVE_PLATFORM_IMX_UART
119 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 121 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
120 select IMX_HAVE_PLATFORM_SPI_IMX 122 select IMX_HAVE_PLATFORM_SPI_IMX
123 select MXC_ULPI if USB_ULPI
124
125config MACH_MX51_EFIKAMX
126 bool "Support MX51 Genesi Efika MX nettop"
127 select MX51_EFIKA_COMMON
121 help 128 help
122 Include support for Genesi Efika MX nettop. This includes specific 129 Include support for Genesi Efika MX nettop. This includes specific
123 configurations for the board and its peripherals. 130 configurations for the board and its peripherals.
124 131
132config MACH_MX51_EFIKASB
133 bool "Support MX51 Genesi Efika Smartbook"
134 select MX51_EFIKA_COMMON
135 help
136 Include support for Genesi Efika Smartbook. This includes specific
137 configurations for the board and its peripherals.
138
125config MACH_MX53_EVK 139config MACH_MX53_EVK
126 bool "Support MX53 EVK platforms" 140 bool "Support MX53 EVK platforms"
127 select SOC_IMX53 141 select SOC_IMX53
142 select IMX_HAVE_PLATFORM_IMX2_WDT
128 select IMX_HAVE_PLATFORM_IMX_UART 143 select IMX_HAVE_PLATFORM_IMX_UART
129 select IMX_HAVE_PLATFORM_IMX_I2C 144 select IMX_HAVE_PLATFORM_IMX_I2C
130 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 145 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
@@ -136,6 +151,8 @@ config MACH_MX53_EVK
136config MACH_MX53_SMD 151config MACH_MX53_SMD
137 bool "Support MX53 SMD platforms" 152 bool "Support MX53 SMD platforms"
138 select SOC_IMX53 153 select SOC_IMX53
154 select IMX_HAVE_PLATFORM_IMX2_WDT
155 select IMX_HAVE_PLATFORM_IMX_I2C
139 select IMX_HAVE_PLATFORM_IMX_UART 156 select IMX_HAVE_PLATFORM_IMX_UART
140 help 157 help
141 Include support for MX53 SMD platform. This includes specific 158 Include support for MX53 SMD platform. This includes specific
@@ -144,7 +161,10 @@ config MACH_MX53_SMD
144config MACH_MX53_LOCO 161config MACH_MX53_LOCO
145 bool "Support MX53 LOCO platforms" 162 bool "Support MX53 LOCO platforms"
146 select SOC_IMX53 163 select SOC_IMX53
164 select IMX_HAVE_PLATFORM_IMX2_WDT
165 select IMX_HAVE_PLATFORM_IMX_I2C
147 select IMX_HAVE_PLATFORM_IMX_UART 166 select IMX_HAVE_PLATFORM_IMX_UART
167 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
148 help 168 help
149 Include support for MX53 LOCO platform. This includes specific 169 Include support for MX53 LOCO platform. This includes specific
150 configurations for the board and its peripherals. 170 configurations for the board and its peripherals.
@@ -157,6 +177,7 @@ config MACH_MX50_RDP
157 select IMX_HAVE_PLATFORM_IMX_UART 177 select IMX_HAVE_PLATFORM_IMX_UART
158 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 178 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
159 select IMX_HAVE_PLATFORM_SPI_IMX 179 select IMX_HAVE_PLATFORM_SPI_IMX
180 select IMX_HAVE_PLATFORM_FEC
160 help 181 help
161 Include support for MX50 reference design platform (RDP) board. This 182 Include support for MX50 reference design platform (RDP) board. This
162 includes specific configurations for the board and its peripherals. 183 includes specific configurations for the board and its peripherals.
diff --git a/arch/arm/mach-mx5/Makefile b/arch/arm/mach-mx5/Makefile
index 0d43be98e51c..4f63048be3ca 100644
--- a/arch/arm/mach-mx5/Makefile
+++ b/arch/arm/mach-mx5/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5# Object file lists. 5# Object file lists.
6obj-y := cpu.o mm.o clock-mx51-mx53.o devices.o 6obj-y := cpu.o mm.o clock-mx51-mx53.o devices.o ehci.o
7obj-$(CONFIG_SOC_IMX50) += mm-mx50.o 7obj-$(CONFIG_SOC_IMX50) += mm-mx50.o
8 8
9obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o 9obj-$(CONFIG_CPU_FREQ_IMX) += cpu_op-mx51.o
@@ -16,5 +16,7 @@ obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o
16obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o 16obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o
17obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += board-cpuimx51sd.o 17obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += board-cpuimx51sd.o
18obj-$(CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD) += eukrea_mbimxsd-baseboard.o 18obj-$(CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD) += eukrea_mbimxsd-baseboard.o
19obj-$(CONFIG_MX51_EFIKA_COMMON) += mx51_efika.o
19obj-$(CONFIG_MACH_MX51_EFIKAMX) += board-mx51_efikamx.o 20obj-$(CONFIG_MACH_MX51_EFIKAMX) += board-mx51_efikamx.o
21obj-$(CONFIG_MACH_MX51_EFIKASB) += board-mx51_efikasb.o
20obj-$(CONFIG_MACH_MX50_RDP) += board-mx50_rdp.o 22obj-$(CONFIG_MACH_MX50_RDP) += board-mx50_rdp.o
diff --git a/arch/arm/mach-mx5/board-cpuimx51.c b/arch/arm/mach-mx5/board-cpuimx51.c
index f8652ef25f85..d0296a94c475 100644
--- a/arch/arm/mach-mx5/board-cpuimx51.c
+++ b/arch/arm/mach-mx5/board-cpuimx51.c
@@ -60,7 +60,6 @@
60#define MX51_USB_PLL_DIV_19_2_MHZ 0x01 60#define MX51_USB_PLL_DIV_19_2_MHZ 0x01
61#define MX51_USB_PLL_DIV_24_MHZ 0x02 61#define MX51_USB_PLL_DIV_24_MHZ 0x02
62 62
63#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
64static struct plat_serial8250_port serial_platform_data[] = { 63static struct plat_serial8250_port serial_platform_data[] = {
65 { 64 {
66 .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x400000), 65 .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x400000),
@@ -105,12 +104,9 @@ static struct platform_device serial_device = {
105 .platform_data = serial_platform_data, 104 .platform_data = serial_platform_data,
106 }, 105 },
107}; 106};
108#endif
109 107
110static struct platform_device *devices[] __initdata = { 108static struct platform_device *devices[] __initdata = {
111#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
112 &serial_device, 109 &serial_device,
113#endif
114}; 110};
115 111
116static iomux_v3_cfg_t eukrea_cpuimx51_pads[] = { 112static iomux_v3_cfg_t eukrea_cpuimx51_pads[] = {
@@ -188,7 +184,10 @@ static int initialize_otg_port(struct platform_device *pdev)
188 v |= MX51_USB_PLL_DIV_19_2_MHZ; 184 v |= MX51_USB_PLL_DIV_19_2_MHZ;
189 __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET); 185 __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET);
190 iounmap(usb_base); 186 iounmap(usb_base);
191 return 0; 187
188 mdelay(10);
189
190 return mx51_initialize_usb_hw(0, MXC_EHCI_INTERNAL_PHY);
192} 191}
193 192
194static int initialize_usbh1_port(struct platform_device *pdev) 193static int initialize_usbh1_port(struct platform_device *pdev)
@@ -206,13 +205,16 @@ static int initialize_usbh1_port(struct platform_device *pdev)
206 v = __raw_readl(usbother_base + MX51_USB_CTRL_1_OFFSET); 205 v = __raw_readl(usbother_base + MX51_USB_CTRL_1_OFFSET);
207 __raw_writel(v | MX51_USB_CTRL_UH1_EXT_CLK_EN, usbother_base + MX51_USB_CTRL_1_OFFSET); 206 __raw_writel(v | MX51_USB_CTRL_UH1_EXT_CLK_EN, usbother_base + MX51_USB_CTRL_1_OFFSET);
208 iounmap(usb_base); 207 iounmap(usb_base);
209 return 0; 208
209 mdelay(10);
210
211 return mx51_initialize_usb_hw(1, MXC_EHCI_POWER_PINS_ENABLED |
212 MXC_EHCI_ITC_NO_THRESHOLD);
210} 213}
211 214
212static struct mxc_usbh_platform_data dr_utmi_config = { 215static struct mxc_usbh_platform_data dr_utmi_config = {
213 .init = initialize_otg_port, 216 .init = initialize_otg_port,
214 .portsc = MXC_EHCI_UTMI_16BIT, 217 .portsc = MXC_EHCI_UTMI_16BIT,
215 .flags = MXC_EHCI_INTERNAL_PHY,
216}; 218};
217 219
218static struct fsl_usb2_platform_data usb_pdata = { 220static struct fsl_usb2_platform_data usb_pdata = {
@@ -223,7 +225,6 @@ static struct fsl_usb2_platform_data usb_pdata = {
223static struct mxc_usbh_platform_data usbh1_config = { 225static struct mxc_usbh_platform_data usbh1_config = {
224 .init = initialize_usbh1_port, 226 .init = initialize_usbh1_port,
225 .portsc = MXC_EHCI_MODE_ULPI, 227 .portsc = MXC_EHCI_MODE_ULPI,
226 .flags = (MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_ITC_NO_THRESHOLD),
227}; 228};
228 229
229static int otg_mode_host; 230static int otg_mode_host;
@@ -298,7 +299,8 @@ MACHINE_START(EUKREA_CPUIMX51, "Eukrea CPUIMX51 Module")
298 /* Maintainer: Eric Bénard <eric@eukrea.com> */ 299 /* Maintainer: Eric Bénard <eric@eukrea.com> */
299 .boot_params = MX51_PHYS_OFFSET + 0x100, 300 .boot_params = MX51_PHYS_OFFSET + 0x100,
300 .map_io = mx51_map_io, 301 .map_io = mx51_map_io,
302 .init_early = imx51_init_early,
301 .init_irq = mx51_init_irq, 303 .init_irq = mx51_init_irq,
302 .init_machine = eukrea_cpuimx51_init,
303 .timer = &mxc_timer, 304 .timer = &mxc_timer,
305 .init_machine = eukrea_cpuimx51_init,
304MACHINE_END 306MACHINE_END
diff --git a/arch/arm/mach-mx5/board-cpuimx51sd.c b/arch/arm/mach-mx5/board-cpuimx51sd.c
index ad931895d8b6..29b180823bf5 100644
--- a/arch/arm/mach-mx5/board-cpuimx51sd.c
+++ b/arch/arm/mach-mx5/board-cpuimx51sd.c
@@ -42,6 +42,7 @@
42 42
43#include "devices-imx51.h" 43#include "devices-imx51.h"
44#include "devices.h" 44#include "devices.h"
45#include "cpu_op-mx51.h"
45 46
46#define USBH1_RST IMX_GPIO_NR(2, 28) 47#define USBH1_RST IMX_GPIO_NR(2, 28)
47#define ETH_RST IMX_GPIO_NR(2, 31) 48#define ETH_RST IMX_GPIO_NR(2, 31)
@@ -109,7 +110,7 @@ static iomux_v3_cfg_t eukrea_cpuimx51sd_pads[] = {
109 110
110 /* Touchscreen */ 111 /* Touchscreen */
111 /* IRQ */ 112 /* IRQ */
112 _MX51_PAD_CSI1_D8__GPIO3_12 | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP | 113 _MX51_PAD_GPIO_NAND__GPIO_NAND | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP |
113 PAD_CTL_PKE | PAD_CTL_SRE_FAST | 114 PAD_CTL_PKE | PAD_CTL_SRE_FAST |
114 PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS), 115 PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS),
115}; 116};
@@ -118,15 +119,9 @@ static const struct imxuart_platform_data uart_pdata __initconst = {
118 .flags = IMXUART_HAVE_RTSCTS, 119 .flags = IMXUART_HAVE_RTSCTS,
119}; 120};
120 121
121static int ts_get_pendown_state(void)
122{
123 return gpio_get_value(TSC2007_IRQGPIO) ? 0 : 1;
124}
125
126static struct tsc2007_platform_data tsc2007_info = { 122static struct tsc2007_platform_data tsc2007_info = {
127 .model = 2007, 123 .model = 2007,
128 .x_plate_ohms = 180, 124 .x_plate_ohms = 180,
129 .get_pendown_state = ts_get_pendown_state,
130}; 125};
131 126
132static struct i2c_board_info eukrea_cpuimx51sd_i2c_devices[] = { 127static struct i2c_board_info eukrea_cpuimx51sd_i2c_devices[] = {
@@ -167,7 +162,10 @@ static int initialize_otg_port(struct platform_device *pdev)
167 v |= MX51_USB_PLL_DIV_19_2_MHZ; 162 v |= MX51_USB_PLL_DIV_19_2_MHZ;
168 __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET); 163 __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET);
169 iounmap(usb_base); 164 iounmap(usb_base);
170 return 0; 165
166 mdelay(10);
167
168 return mx51_initialize_usb_hw(0, MXC_EHCI_INTERNAL_PHY);
171} 169}
172 170
173static int initialize_usbh1_port(struct platform_device *pdev) 171static int initialize_usbh1_port(struct platform_device *pdev)
@@ -186,13 +184,16 @@ static int initialize_usbh1_port(struct platform_device *pdev)
186 __raw_writel(v | MX51_USB_CTRL_UH1_EXT_CLK_EN, 184 __raw_writel(v | MX51_USB_CTRL_UH1_EXT_CLK_EN,
187 usbother_base + MX51_USB_CTRL_1_OFFSET); 185 usbother_base + MX51_USB_CTRL_1_OFFSET);
188 iounmap(usb_base); 186 iounmap(usb_base);
189 return 0; 187
188 mdelay(10);
189
190 return mx51_initialize_usb_hw(1, MXC_EHCI_POWER_PINS_ENABLED |
191 MXC_EHCI_ITC_NO_THRESHOLD);
190} 192}
191 193
192static struct mxc_usbh_platform_data dr_utmi_config = { 194static struct mxc_usbh_platform_data dr_utmi_config = {
193 .init = initialize_otg_port, 195 .init = initialize_otg_port,
194 .portsc = MXC_EHCI_UTMI_16BIT, 196 .portsc = MXC_EHCI_UTMI_16BIT,
195 .flags = MXC_EHCI_INTERNAL_PHY,
196}; 197};
197 198
198static struct fsl_usb2_platform_data usb_pdata = { 199static struct fsl_usb2_platform_data usb_pdata = {
@@ -203,7 +204,6 @@ static struct fsl_usb2_platform_data usb_pdata = {
203static struct mxc_usbh_platform_data usbh1_config = { 204static struct mxc_usbh_platform_data usbh1_config = {
204 .init = initialize_usbh1_port, 205 .init = initialize_usbh1_port,
205 .portsc = MXC_EHCI_MODE_ULPI, 206 .portsc = MXC_EHCI_MODE_ULPI,
206 .flags = (MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_ITC_NO_THRESHOLD),
207}; 207};
208 208
209static int otg_mode_host; 209static int otg_mode_host;
@@ -242,7 +242,7 @@ static struct mcp251x_platform_data mcp251x_info = {
242static struct spi_board_info cpuimx51sd_spi_device[] = { 242static struct spi_board_info cpuimx51sd_spi_device[] = {
243 { 243 {
244 .modalias = "mcp2515", 244 .modalias = "mcp2515",
245 .max_speed_hz = 6500000, 245 .max_speed_hz = 10000000,
246 .bus_num = 0, 246 .bus_num = 0,
247 .mode = SPI_MODE_0, 247 .mode = SPI_MODE_0,
248 .chip_select = 0, 248 .chip_select = 0,
@@ -269,6 +269,10 @@ static void __init eukrea_cpuimx51sd_init(void)
269 mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx51sd_pads, 269 mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx51sd_pads,
270 ARRAY_SIZE(eukrea_cpuimx51sd_pads)); 270 ARRAY_SIZE(eukrea_cpuimx51sd_pads));
271 271
272#if defined(CONFIG_CPU_FREQ_IMX)
273 get_cpu_op = mx51_get_cpu_op;
274#endif
275
272 imx51_add_imx_uart(0, &uart_pdata); 276 imx51_add_imx_uart(0, &uart_pdata);
273 imx51_add_mxc_nand(&eukrea_cpuimx51sd_nand_board_info); 277 imx51_add_mxc_nand(&eukrea_cpuimx51sd_nand_board_info);
274 278
@@ -329,7 +333,8 @@ MACHINE_START(EUKREA_CPUIMX51SD, "Eukrea CPUIMX51SD")
329 /* Maintainer: Eric Bénard <eric@eukrea.com> */ 333 /* Maintainer: Eric Bénard <eric@eukrea.com> */
330 .boot_params = MX51_PHYS_OFFSET + 0x100, 334 .boot_params = MX51_PHYS_OFFSET + 0x100,
331 .map_io = mx51_map_io, 335 .map_io = mx51_map_io,
336 .init_early = imx51_init_early,
332 .init_irq = mx51_init_irq, 337 .init_irq = mx51_init_irq,
333 .init_machine = eukrea_cpuimx51sd_init,
334 .timer = &mxc_timer, 338 .timer = &mxc_timer,
339 .init_machine = eukrea_cpuimx51sd_init,
335MACHINE_END 340MACHINE_END
diff --git a/arch/arm/mach-mx5/board-mx50_rdp.c b/arch/arm/mach-mx5/board-mx50_rdp.c
index fd32e4c450e8..dedf7f2d6d0f 100644
--- a/arch/arm/mach-mx5/board-mx50_rdp.c
+++ b/arch/arm/mach-mx5/board-mx50_rdp.c
@@ -35,7 +35,10 @@
35#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
36#include <asm/mach/time.h> 36#include <asm/mach/time.h>
37 37
38#include "devices-mx50.h" 38#include "devices-imx50.h"
39
40#define FEC_EN IMX_GPIO_NR(6, 23)
41#define FEC_RESET_B IMX_GPIO_NR(4, 12)
39 42
40static iomux_v3_cfg_t mx50_rdp_pads[] __initdata = { 43static iomux_v3_cfg_t mx50_rdp_pads[] __initdata = {
41 /* SD1 */ 44 /* SD1 */
@@ -102,7 +105,7 @@ static iomux_v3_cfg_t mx50_rdp_pads[] __initdata = {
102 MX50_PAD_I2C3_SCL__USBOTG_OC, 105 MX50_PAD_I2C3_SCL__USBOTG_OC,
103 106
104 MX50_PAD_SSI_RXC__FEC_MDIO, 107 MX50_PAD_SSI_RXC__FEC_MDIO,
105 MX50_PAD_SSI_RXC__FEC_MDIO, 108 MX50_PAD_SSI_RXFS__FEC_MDC,
106 MX50_PAD_DISP_D0__FEC_TXCLK, 109 MX50_PAD_DISP_D0__FEC_TXCLK,
107 MX50_PAD_DISP_D1__FEC_RX_ER, 110 MX50_PAD_DISP_D1__FEC_RX_ER,
108 MX50_PAD_DISP_D2__FEC_RX_DV, 111 MX50_PAD_DISP_D2__FEC_RX_DV,
@@ -111,7 +114,6 @@ static iomux_v3_cfg_t mx50_rdp_pads[] __initdata = {
111 MX50_PAD_DISP_D5__FEC_TX_EN, 114 MX50_PAD_DISP_D5__FEC_TX_EN,
112 MX50_PAD_DISP_D6__FEC_TXD1, 115 MX50_PAD_DISP_D6__FEC_TXD1,
113 MX50_PAD_DISP_D7__FEC_TXD0, 116 MX50_PAD_DISP_D7__FEC_TXD0,
114 MX50_PAD_SSI_RXFS__FEC_MDC,
115 MX50_PAD_I2C3_SDA__GPIO_6_23, 117 MX50_PAD_I2C3_SDA__GPIO_6_23,
116 MX50_PAD_ECSPI1_SCLK__GPIO_4_12, 118 MX50_PAD_ECSPI1_SCLK__GPIO_4_12,
117 119
@@ -168,6 +170,24 @@ static const struct imxuart_platform_data uart_pdata __initconst = {
168 .flags = IMXUART_HAVE_RTSCTS, 170 .flags = IMXUART_HAVE_RTSCTS,
169}; 171};
170 172
173static const struct fec_platform_data fec_data __initconst = {
174 .phy = PHY_INTERFACE_MODE_RMII,
175};
176
177static inline void mx50_rdp_fec_reset(void)
178{
179 gpio_request(FEC_EN, "fec-en");
180 gpio_direction_output(FEC_EN, 0);
181 gpio_request(FEC_RESET_B, "fec-reset_b");
182 gpio_direction_output(FEC_RESET_B, 0);
183 msleep(1);
184 gpio_set_value(FEC_RESET_B, 1);
185}
186
187static const struct imxi2c_platform_data i2c_data __initconst = {
188 .bitrate = 100000,
189};
190
171/* 191/*
172 * Board specific initialization. 192 * Board specific initialization.
173 */ 193 */
@@ -178,6 +198,11 @@ static void __init mx50_rdp_board_init(void)
178 198
179 imx50_add_imx_uart(0, &uart_pdata); 199 imx50_add_imx_uart(0, &uart_pdata);
180 imx50_add_imx_uart(1, &uart_pdata); 200 imx50_add_imx_uart(1, &uart_pdata);
201 mx50_rdp_fec_reset();
202 imx50_add_fec(&fec_data);
203 imx50_add_imx_i2c(0, &i2c_data);
204 imx50_add_imx_i2c(1, &i2c_data);
205 imx50_add_imx_i2c(2, &i2c_data);
181} 206}
182 207
183static void __init mx50_rdp_timer_init(void) 208static void __init mx50_rdp_timer_init(void)
@@ -191,7 +216,8 @@ static struct sys_timer mx50_rdp_timer = {
191 216
192MACHINE_START(MX50_RDP, "Freescale MX50 Reference Design Platform") 217MACHINE_START(MX50_RDP, "Freescale MX50 Reference Design Platform")
193 .map_io = mx50_map_io, 218 .map_io = mx50_map_io,
219 .init_early = imx50_init_early,
194 .init_irq = mx50_init_irq, 220 .init_irq = mx50_init_irq,
195 .init_machine = mx50_rdp_board_init,
196 .timer = &mx50_rdp_timer, 221 .timer = &mx50_rdp_timer,
222 .init_machine = mx50_rdp_board_init,
197MACHINE_END 223MACHINE_END
diff --git a/arch/arm/mach-mx5/board-mx51_3ds.c b/arch/arm/mach-mx5/board-mx51_3ds.c
index 49d644842379..63dfbeafbc1e 100644
--- a/arch/arm/mach-mx5/board-mx51_3ds.c
+++ b/arch/arm/mach-mx5/board-mx51_3ds.c
@@ -71,24 +71,10 @@ static iomux_v3_cfg_t mx51_3ds_pads[] = {
71}; 71};
72 72
73/* Serial ports */ 73/* Serial ports */
74#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE)
75static const struct imxuart_platform_data uart_pdata __initconst = { 74static const struct imxuart_platform_data uart_pdata __initconst = {
76 .flags = IMXUART_HAVE_RTSCTS, 75 .flags = IMXUART_HAVE_RTSCTS,
77}; 76};
78 77
79static inline void mxc_init_imx_uart(void)
80{
81 imx51_add_imx_uart(0, &uart_pdata);
82 imx51_add_imx_uart(1, &uart_pdata);
83 imx51_add_imx_uart(2, &uart_pdata);
84}
85#else /* !SERIAL_IMX */
86static inline void mxc_init_imx_uart(void)
87{
88}
89#endif /* SERIAL_IMX */
90
91#if defined(CONFIG_KEYBOARD_IMX) || defined(CONFIG_KEYBOARD_IMX_MODULE)
92static int mx51_3ds_board_keymap[] = { 78static int mx51_3ds_board_keymap[] = {
93 KEY(0, 0, KEY_1), 79 KEY(0, 0, KEY_1),
94 KEY(0, 1, KEY_2), 80 KEY(0, 1, KEY_2),
@@ -124,16 +110,6 @@ static const struct matrix_keymap_data mx51_3ds_map_data __initconst = {
124 .keymap_size = ARRAY_SIZE(mx51_3ds_board_keymap), 110 .keymap_size = ARRAY_SIZE(mx51_3ds_board_keymap),
125}; 111};
126 112
127static void mxc_init_keypad(void)
128{
129 imx51_add_imx_keypad(&mx51_3ds_map_data);
130}
131#else
132static inline void mxc_init_keypad(void)
133{
134}
135#endif
136
137static int mx51_3ds_spi2_cs[] = { 113static int mx51_3ds_spi2_cs[] = {
138 MXC_SPI_CS(0), 114 MXC_SPI_CS(0),
139 MX51_3DS_ECSPI2_CS, 115 MX51_3DS_ECSPI2_CS,
@@ -157,11 +133,14 @@ static struct spi_board_info mx51_3ds_spi_nor_device[] = {
157/* 133/*
158 * Board specific initialization. 134 * Board specific initialization.
159 */ 135 */
160static void __init mxc_board_init(void) 136static void __init mx51_3ds_init(void)
161{ 137{
162 mxc_iomux_v3_setup_multiple_pads(mx51_3ds_pads, 138 mxc_iomux_v3_setup_multiple_pads(mx51_3ds_pads,
163 ARRAY_SIZE(mx51_3ds_pads)); 139 ARRAY_SIZE(mx51_3ds_pads));
164 mxc_init_imx_uart(); 140
141 imx51_add_imx_uart(0, &uart_pdata);
142 imx51_add_imx_uart(1, &uart_pdata);
143 imx51_add_imx_uart(2, &uart_pdata);
165 144
166 imx51_add_ecspi(1, &mx51_3ds_ecspi2_pdata); 145 imx51_add_ecspi(1, &mx51_3ds_ecspi2_pdata);
167 spi_register_board_info(mx51_3ds_spi_nor_device, 146 spi_register_board_info(mx51_3ds_spi_nor_device,
@@ -172,7 +151,8 @@ static void __init mxc_board_init(void)
172 "devices on the board are unusable.\n"); 151 "devices on the board are unusable.\n");
173 152
174 imx51_add_sdhci_esdhc_imx(0, NULL); 153 imx51_add_sdhci_esdhc_imx(0, NULL);
175 mxc_init_keypad(); 154 imx51_add_imx_keypad(&mx51_3ds_map_data);
155 imx51_add_imx2_wdt(0, NULL);
176} 156}
177 157
178static void __init mx51_3ds_timer_init(void) 158static void __init mx51_3ds_timer_init(void)
@@ -180,15 +160,16 @@ static void __init mx51_3ds_timer_init(void)
180 mx51_clocks_init(32768, 24000000, 22579200, 0); 160 mx51_clocks_init(32768, 24000000, 22579200, 0);
181} 161}
182 162
183static struct sys_timer mxc_timer = { 163static struct sys_timer mx51_3ds_timer = {
184 .init = mx51_3ds_timer_init, 164 .init = mx51_3ds_timer_init,
185}; 165};
186 166
187MACHINE_START(MX51_3DS, "Freescale MX51 3-Stack Board") 167MACHINE_START(MX51_3DS, "Freescale MX51 3-Stack Board")
188 /* Maintainer: Freescale Semiconductor, Inc. */ 168 /* Maintainer: Freescale Semiconductor, Inc. */
189 .boot_params = MX51_PHYS_OFFSET + 0x100, 169 .boot_params = MX51_PHYS_OFFSET + 0x100,
190 .map_io = mx51_map_io, 170 .map_io = mx51_map_io,
171 .init_early = imx51_init_early,
191 .init_irq = mx51_init_irq, 172 .init_irq = mx51_init_irq,
192 .init_machine = mxc_board_init, 173 .timer = &mx51_3ds_timer,
193 .timer = &mxc_timer, 174 .init_machine = mx51_3ds_init,
194MACHINE_END 175MACHINE_END
diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c
index 1d231e84107c..b2ecd194e76d 100644
--- a/arch/arm/mach-mx5/board-mx51_babbage.c
+++ b/arch/arm/mach-mx5/board-mx51_babbage.c
@@ -161,23 +161,10 @@ static iomux_v3_cfg_t mx51babbage_pads[] = {
161}; 161};
162 162
163/* Serial ports */ 163/* Serial ports */
164#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE)
165static const struct imxuart_platform_data uart_pdata __initconst = { 164static const struct imxuart_platform_data uart_pdata __initconst = {
166 .flags = IMXUART_HAVE_RTSCTS, 165 .flags = IMXUART_HAVE_RTSCTS,
167}; 166};
168 167
169static inline void mxc_init_imx_uart(void)
170{
171 imx51_add_imx_uart(0, &uart_pdata);
172 imx51_add_imx_uart(1, &uart_pdata);
173 imx51_add_imx_uart(2, &uart_pdata);
174}
175#else /* !SERIAL_IMX */
176static inline void mxc_init_imx_uart(void)
177{
178}
179#endif /* SERIAL_IMX */
180
181static const struct imxi2c_platform_data babbage_i2c_data __initconst = { 168static const struct imxi2c_platform_data babbage_i2c_data __initconst = {
182 .bitrate = 100000, 169 .bitrate = 100000,
183}; 170};
@@ -272,7 +259,10 @@ static int initialize_otg_port(struct platform_device *pdev)
272 v |= MX51_USB_PLL_DIV_19_2_MHZ; 259 v |= MX51_USB_PLL_DIV_19_2_MHZ;
273 __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET); 260 __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET);
274 iounmap(usb_base); 261 iounmap(usb_base);
275 return 0; 262
263 mdelay(10);
264
265 return mx51_initialize_usb_hw(0, MXC_EHCI_INTERNAL_PHY);
276} 266}
277 267
278static int initialize_usbh1_port(struct platform_device *pdev) 268static int initialize_usbh1_port(struct platform_device *pdev)
@@ -290,13 +280,16 @@ static int initialize_usbh1_port(struct platform_device *pdev)
290 v = __raw_readl(usbother_base + MX51_USB_CTRL_1_OFFSET); 280 v = __raw_readl(usbother_base + MX51_USB_CTRL_1_OFFSET);
291 __raw_writel(v | MX51_USB_CTRL_UH1_EXT_CLK_EN, usbother_base + MX51_USB_CTRL_1_OFFSET); 281 __raw_writel(v | MX51_USB_CTRL_UH1_EXT_CLK_EN, usbother_base + MX51_USB_CTRL_1_OFFSET);
292 iounmap(usb_base); 282 iounmap(usb_base);
293 return 0; 283
284 mdelay(10);
285
286 return mx51_initialize_usb_hw(1, MXC_EHCI_POWER_PINS_ENABLED |
287 MXC_EHCI_ITC_NO_THRESHOLD);
294} 288}
295 289
296static struct mxc_usbh_platform_data dr_utmi_config = { 290static struct mxc_usbh_platform_data dr_utmi_config = {
297 .init = initialize_otg_port, 291 .init = initialize_otg_port,
298 .portsc = MXC_EHCI_UTMI_16BIT, 292 .portsc = MXC_EHCI_UTMI_16BIT,
299 .flags = MXC_EHCI_INTERNAL_PHY,
300}; 293};
301 294
302static struct fsl_usb2_platform_data usb_pdata = { 295static struct fsl_usb2_platform_data usb_pdata = {
@@ -307,7 +300,6 @@ static struct fsl_usb2_platform_data usb_pdata = {
307static struct mxc_usbh_platform_data usbh1_config = { 300static struct mxc_usbh_platform_data usbh1_config = {
308 .init = initialize_usbh1_port, 301 .init = initialize_usbh1_port,
309 .portsc = MXC_EHCI_MODE_ULPI, 302 .portsc = MXC_EHCI_MODE_ULPI,
310 .flags = (MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_ITC_NO_THRESHOLD),
311}; 303};
312 304
313static int otg_mode_host; 305static int otg_mode_host;
@@ -349,7 +341,7 @@ static const struct spi_imx_master mx51_babbage_spi_pdata __initconst = {
349/* 341/*
350 * Board specific initialization. 342 * Board specific initialization.
351 */ 343 */
352static void __init mxc_board_init(void) 344static void __init mx51_babbage_init(void)
353{ 345{
354 iomux_v3_cfg_t usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP; 346 iomux_v3_cfg_t usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP;
355 iomux_v3_cfg_t power_key = _MX51_PAD_EIM_A27__GPIO2_21 | 347 iomux_v3_cfg_t power_key = _MX51_PAD_EIM_A27__GPIO2_21 |
@@ -360,7 +352,11 @@ static void __init mxc_board_init(void)
360#endif 352#endif
361 mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads, 353 mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads,
362 ARRAY_SIZE(mx51babbage_pads)); 354 ARRAY_SIZE(mx51babbage_pads));
363 mxc_init_imx_uart(); 355
356 imx51_add_imx_uart(0, &uart_pdata);
357 imx51_add_imx_uart(1, &uart_pdata);
358 imx51_add_imx_uart(2, &uart_pdata);
359
364 babbage_fec_reset(); 360 babbage_fec_reset();
365 imx51_add_fec(NULL); 361 imx51_add_fec(NULL);
366 362
@@ -399,15 +395,16 @@ static void __init mx51_babbage_timer_init(void)
399 mx51_clocks_init(32768, 24000000, 22579200, 0); 395 mx51_clocks_init(32768, 24000000, 22579200, 0);
400} 396}
401 397
402static struct sys_timer mxc_timer = { 398static struct sys_timer mx51_babbage_timer = {
403 .init = mx51_babbage_timer_init, 399 .init = mx51_babbage_timer_init,
404}; 400};
405 401
406MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board") 402MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board")
407 /* Maintainer: Amit Kucheria <amit.kucheria@canonical.com> */ 403 /* Maintainer: Amit Kucheria <amit.kucheria@canonical.com> */
408 .boot_params = MX51_PHYS_OFFSET + 0x100, 404 .boot_params = MX51_PHYS_OFFSET + 0x100,
409 .map_io = mx51_map_io, 405 .map_io = mx51_map_io,
406 .init_early = imx51_init_early,
410 .init_irq = mx51_init_irq, 407 .init_irq = mx51_init_irq,
411 .init_machine = mxc_board_init, 408 .timer = &mx51_babbage_timer,
412 .timer = &mxc_timer, 409 .init_machine = mx51_babbage_init,
413MACHINE_END 410MACHINE_END
diff --git a/arch/arm/mach-mx5/board-mx51_efikamx.c b/arch/arm/mach-mx5/board-mx51_efikamx.c
index b7946f8e8d40..acab1911cb3c 100644
--- a/arch/arm/mach-mx5/board-mx51_efikamx.c
+++ b/arch/arm/mach-mx5/board-mx51_efikamx.c
@@ -25,6 +25,9 @@
25#include <linux/fsl_devices.h> 25#include <linux/fsl_devices.h>
26#include <linux/spi/flash.h> 26#include <linux/spi/flash.h>
27#include <linux/spi/spi.h> 27#include <linux/spi/spi.h>
28#include <linux/mfd/mc13892.h>
29#include <linux/regulator/machine.h>
30#include <linux/regulator/consumer.h>
28 31
29#include <mach/common.h> 32#include <mach/common.h>
30#include <mach/hardware.h> 33#include <mach/hardware.h>
@@ -40,8 +43,7 @@
40 43
41#include "devices-imx51.h" 44#include "devices-imx51.h"
42#include "devices.h" 45#include "devices.h"
43 46#include "efika.h"
44#define MX51_USB_PLL_DIV_24_MHZ 0x01
45 47
46#define EFIKAMX_PCBID0 IMX_GPIO_NR(3, 16) 48#define EFIKAMX_PCBID0 IMX_GPIO_NR(3, 16)
47#define EFIKAMX_PCBID1 IMX_GPIO_NR(3, 17) 49#define EFIKAMX_PCBID1 IMX_GPIO_NR(3, 17)
@@ -53,13 +55,14 @@
53 55
54#define EFIKAMX_POWER_KEY IMX_GPIO_NR(2, 31) 56#define EFIKAMX_POWER_KEY IMX_GPIO_NR(2, 31)
55 57
56#define EFIKAMX_SPI_CS0 IMX_GPIO_NR(4, 24)
57#define EFIKAMX_SPI_CS1 IMX_GPIO_NR(4, 25)
58
59/* board 1.1 doesn't have same reset gpio */ 58/* board 1.1 doesn't have same reset gpio */
60#define EFIKAMX_RESET1_1 IMX_GPIO_NR(3, 2) 59#define EFIKAMX_RESET1_1 IMX_GPIO_NR(3, 2)
61#define EFIKAMX_RESET IMX_GPIO_NR(1, 4) 60#define EFIKAMX_RESET IMX_GPIO_NR(1, 4)
62 61
62#define EFIKAMX_POWEROFF IMX_GPIO_NR(4, 13)
63
64#define EFIKAMX_PMIC IMX_GPIO_NR(1, 6)
65
63/* the pci ids pin have pull up. they're driven low according to board id */ 66/* the pci ids pin have pull up. they're driven low according to board id */
64#define MX51_PAD_PCBID0 IOMUX_PAD(0x518, 0x130, 3, 0x0, 0, PAD_CTL_PUS_100K_UP) 67#define MX51_PAD_PCBID0 IOMUX_PAD(0x518, 0x130, 3, 0x0, 0, PAD_CTL_PUS_100K_UP)
65#define MX51_PAD_PCBID1 IOMUX_PAD(0x51C, 0x134, 3, 0x0, 0, PAD_CTL_PUS_100K_UP) 68#define MX51_PAD_PCBID1 IOMUX_PAD(0x51C, 0x134, 3, 0x0, 0, PAD_CTL_PUS_100K_UP)
@@ -67,38 +70,11 @@
67#define MX51_PAD_PWRKEY IOMUX_PAD(0x48c, 0x0f8, 1, 0x0, 0, PAD_CTL_PUS_100K_UP | PAD_CTL_PKE) 70#define MX51_PAD_PWRKEY IOMUX_PAD(0x48c, 0x0f8, 1, 0x0, 0, PAD_CTL_PUS_100K_UP | PAD_CTL_PKE)
68 71
69static iomux_v3_cfg_t mx51efikamx_pads[] = { 72static iomux_v3_cfg_t mx51efikamx_pads[] = {
70 /* UART1 */
71 MX51_PAD_UART1_RXD__UART1_RXD,
72 MX51_PAD_UART1_TXD__UART1_TXD,
73 MX51_PAD_UART1_RTS__UART1_RTS,
74 MX51_PAD_UART1_CTS__UART1_CTS,
75 /* board id */ 73 /* board id */
76 MX51_PAD_PCBID0, 74 MX51_PAD_PCBID0,
77 MX51_PAD_PCBID1, 75 MX51_PAD_PCBID1,
78 MX51_PAD_PCBID2, 76 MX51_PAD_PCBID2,
79 77
80 /* SD 1 */
81 MX51_PAD_SD1_CMD__SD1_CMD,
82 MX51_PAD_SD1_CLK__SD1_CLK,
83 MX51_PAD_SD1_DATA0__SD1_DATA0,
84 MX51_PAD_SD1_DATA1__SD1_DATA1,
85 MX51_PAD_SD1_DATA2__SD1_DATA2,
86 MX51_PAD_SD1_DATA3__SD1_DATA3,
87
88 /* SD 2 */
89 MX51_PAD_SD2_CMD__SD2_CMD,
90 MX51_PAD_SD2_CLK__SD2_CLK,
91 MX51_PAD_SD2_DATA0__SD2_DATA0,
92 MX51_PAD_SD2_DATA1__SD2_DATA1,
93 MX51_PAD_SD2_DATA2__SD2_DATA2,
94 MX51_PAD_SD2_DATA3__SD2_DATA3,
95
96 /* SD/MMC WP/CD */
97 MX51_PAD_GPIO1_0__SD1_CD,
98 MX51_PAD_GPIO1_1__SD1_WP,
99 MX51_PAD_GPIO1_7__SD2_WP,
100 MX51_PAD_GPIO1_8__SD2_CD,
101
102 /* leds */ 78 /* leds */
103 MX51_PAD_CSI1_D9__GPIO3_13, 79 MX51_PAD_CSI1_D9__GPIO3_13,
104 MX51_PAD_CSI1_VSYNC__GPIO3_14, 80 MX51_PAD_CSI1_VSYNC__GPIO3_14,
@@ -107,64 +83,12 @@ static iomux_v3_cfg_t mx51efikamx_pads[] = {
107 /* power key */ 83 /* power key */
108 MX51_PAD_PWRKEY, 84 MX51_PAD_PWRKEY,
109 85
110 /* spi */
111 MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI,
112 MX51_PAD_CSPI1_MISO__ECSPI1_MISO,
113 MX51_PAD_CSPI1_SS0__GPIO4_24,
114 MX51_PAD_CSPI1_SS1__GPIO4_25,
115 MX51_PAD_CSPI1_RDY__ECSPI1_RDY,
116 MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK,
117
118 /* reset */ 86 /* reset */
119 MX51_PAD_DI1_PIN13__GPIO3_2, 87 MX51_PAD_DI1_PIN13__GPIO3_2,
120 MX51_PAD_GPIO1_4__GPIO1_4, 88 MX51_PAD_GPIO1_4__GPIO1_4,
121};
122 89
123/* Serial ports */ 90 /* power off */
124#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) 91 MX51_PAD_CSI2_VSYNC__GPIO4_13,
125static const struct imxuart_platform_data uart_pdata = {
126 .flags = IMXUART_HAVE_RTSCTS,
127};
128
129static inline void mxc_init_imx_uart(void)
130{
131 imx51_add_imx_uart(0, &uart_pdata);
132 imx51_add_imx_uart(1, &uart_pdata);
133 imx51_add_imx_uart(2, &uart_pdata);
134}
135#else /* !SERIAL_IMX */
136static inline void mxc_init_imx_uart(void)
137{
138}
139#endif /* SERIAL_IMX */
140
141/* This function is board specific as the bit mask for the plldiv will also
142 * be different for other Freescale SoCs, thus a common bitmask is not
143 * possible and cannot get place in /plat-mxc/ehci.c.
144 */
145static int initialize_otg_port(struct platform_device *pdev)
146{
147 u32 v;
148 void __iomem *usb_base;
149 void __iomem *usbother_base;
150 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
151 if (!usb_base)
152 return -ENOMEM;
153 usbother_base = (void __iomem *)(usb_base + MX5_USBOTHER_REGS_OFFSET);
154
155 /* Set the PHY clock to 19.2MHz */
156 v = __raw_readl(usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET);
157 v &= ~MX5_USB_UTMI_PHYCTRL1_PLLDIV_MASK;
158 v |= MX51_USB_PLL_DIV_24_MHZ;
159 __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET);
160 iounmap(usb_base);
161 return 0;
162}
163
164static struct mxc_usbh_platform_data dr_utmi_config = {
165 .init = initialize_otg_port,
166 .portsc = MXC_EHCI_UTMI_16BIT,
167 .flags = MXC_EHCI_INTERNAL_PHY,
168}; 92};
169 93
170/* PCBID2 PCBID1 PCBID0 STATE 94/* PCBID2 PCBID1 PCBID0 STATE
@@ -265,47 +189,6 @@ static const struct gpio_keys_platform_data mx51_efikamx_powerkey_data __initcon
265 .nbuttons = ARRAY_SIZE(mx51_efikamx_powerkey), 189 .nbuttons = ARRAY_SIZE(mx51_efikamx_powerkey),
266}; 190};
267 191
268static struct mtd_partition mx51_efikamx_spi_nor_partitions[] = {
269 {
270 .name = "u-boot",
271 .offset = 0,
272 .size = SZ_256K,
273 },
274 {
275 .name = "config",
276 .offset = MTDPART_OFS_APPEND,
277 .size = SZ_64K,
278 },
279};
280
281static struct flash_platform_data mx51_efikamx_spi_flash_data = {
282 .name = "spi_flash",
283 .parts = mx51_efikamx_spi_nor_partitions,
284 .nr_parts = ARRAY_SIZE(mx51_efikamx_spi_nor_partitions),
285 .type = "sst25vf032b",
286};
287
288static struct spi_board_info mx51_efikamx_spi_board_info[] __initdata = {
289 {
290 .modalias = "m25p80",
291 .max_speed_hz = 25000000,
292 .bus_num = 0,
293 .chip_select = 1,
294 .platform_data = &mx51_efikamx_spi_flash_data,
295 .irq = -1,
296 },
297};
298
299static int mx51_efikamx_spi_cs[] = {
300 EFIKAMX_SPI_CS0,
301 EFIKAMX_SPI_CS1,
302};
303
304static const struct spi_imx_master mx51_efikamx_spi_pdata __initconst = {
305 .chipselect = mx51_efikamx_spi_cs,
306 .num_chipselect = ARRAY_SIZE(mx51_efikamx_spi_cs),
307};
308
309void mx51_efikamx_reset(void) 192void mx51_efikamx_reset(void)
310{ 193{
311 if (system_rev == 0x11) 194 if (system_rev == 0x11)
@@ -314,14 +197,53 @@ void mx51_efikamx_reset(void)
314 gpio_direction_output(EFIKAMX_RESET, 0); 197 gpio_direction_output(EFIKAMX_RESET, 0);
315} 198}
316 199
317static void __init mxc_board_init(void) 200static struct regulator *pwgt1, *pwgt2, *coincell;
201
202static void mx51_efikamx_power_off(void)
203{
204 if (!IS_ERR(coincell))
205 regulator_disable(coincell);
206
207 if (!IS_ERR(pwgt1) && !IS_ERR(pwgt2)) {
208 regulator_disable(pwgt2);
209 regulator_disable(pwgt1);
210 }
211 gpio_direction_output(EFIKAMX_POWEROFF, 1);
212}
213
214static int __init mx51_efikamx_power_init(void)
215{
216 if (machine_is_mx51_efikamx()) {
217 pwgt1 = regulator_get(NULL, "pwgt1");
218 pwgt2 = regulator_get(NULL, "pwgt2");
219 if (!IS_ERR(pwgt1) && !IS_ERR(pwgt2)) {
220 regulator_enable(pwgt1);
221 regulator_enable(pwgt2);
222 }
223 gpio_request(EFIKAMX_POWEROFF, "poweroff");
224 pm_power_off = mx51_efikamx_power_off;
225
226 /* enable coincell charger. maybe need a small power driver ? */
227 coincell = regulator_get(NULL, "coincell");
228 if (!IS_ERR(coincell)) {
229 regulator_set_voltage(coincell, 3000000, 3000000);
230 regulator_enable(coincell);
231 }
232
233 regulator_has_full_constraints();
234 }
235
236 return 0;
237}
238late_initcall(mx51_efikamx_power_init);
239
240static void __init mx51_efikamx_init(void)
318{ 241{
319 mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads, 242 mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads,
320 ARRAY_SIZE(mx51efikamx_pads)); 243 ARRAY_SIZE(mx51efikamx_pads));
244 efika_board_common_init();
245
321 mx51_efikamx_board_id(); 246 mx51_efikamx_board_id();
322 mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config);
323 mxc_init_imx_uart();
324 imx51_add_sdhci_esdhc_imx(0, NULL);
325 247
326 /* on < 1.2 boards both SD controllers are used */ 248 /* on < 1.2 boards both SD controllers are used */
327 if (system_rev < 0x12) { 249 if (system_rev < 0x12) {
@@ -332,10 +254,6 @@ static void __init mxc_board_init(void)
332 platform_device_register(&mx51_efikamx_leds_device); 254 platform_device_register(&mx51_efikamx_leds_device);
333 imx51_add_gpio_keys(&mx51_efikamx_powerkey_data); 255 imx51_add_gpio_keys(&mx51_efikamx_powerkey_data);
334 256
335 spi_register_board_info(mx51_efikamx_spi_board_info,
336 ARRAY_SIZE(mx51_efikamx_spi_board_info));
337 imx51_add_ecspi(0, &mx51_efikamx_spi_pdata);
338
339 if (system_rev == 0x11) { 257 if (system_rev == 0x11) {
340 gpio_request(EFIKAMX_RESET1_1, "reset"); 258 gpio_request(EFIKAMX_RESET1_1, "reset");
341 gpio_direction_output(EFIKAMX_RESET1_1, 1); 259 gpio_direction_output(EFIKAMX_RESET1_1, 1);
@@ -343,6 +261,20 @@ static void __init mxc_board_init(void)
343 gpio_request(EFIKAMX_RESET, "reset"); 261 gpio_request(EFIKAMX_RESET, "reset");
344 gpio_direction_output(EFIKAMX_RESET, 1); 262 gpio_direction_output(EFIKAMX_RESET, 1);
345 } 263 }
264
265 /*
266 * enable wifi by default only on mx
267 * sb and mx have same wlan pin but the value to enable it are
268 * different :/
269 */
270 gpio_request(EFIKA_WLAN_EN, "wlan_en");
271 gpio_direction_output(EFIKA_WLAN_EN, 0);
272 msleep(10);
273
274 gpio_request(EFIKA_WLAN_RESET, "wlan_rst");
275 gpio_direction_output(EFIKA_WLAN_RESET, 0);
276 msleep(10);
277 gpio_set_value(EFIKA_WLAN_RESET, 1);
346} 278}
347 279
348static void __init mx51_efikamx_timer_init(void) 280static void __init mx51_efikamx_timer_init(void)
@@ -350,15 +282,16 @@ static void __init mx51_efikamx_timer_init(void)
350 mx51_clocks_init(32768, 24000000, 22579200, 24576000); 282 mx51_clocks_init(32768, 24000000, 22579200, 24576000);
351} 283}
352 284
353static struct sys_timer mxc_timer = { 285static struct sys_timer mx51_efikamx_timer = {
354 .init = mx51_efikamx_timer_init, 286 .init = mx51_efikamx_timer_init,
355}; 287};
356 288
357MACHINE_START(MX51_EFIKAMX, "Genesi EfikaMX nettop") 289MACHINE_START(MX51_EFIKAMX, "Genesi EfikaMX nettop")
358 /* Maintainer: Amit Kucheria <amit.kucheria@linaro.org> */ 290 /* Maintainer: Amit Kucheria <amit.kucheria@linaro.org> */
359 .boot_params = MX51_PHYS_OFFSET + 0x100, 291 .boot_params = MX51_PHYS_OFFSET + 0x100,
360 .map_io = mx51_map_io, 292 .map_io = mx51_map_io,
293 .init_early = imx51_init_early,
361 .init_irq = mx51_init_irq, 294 .init_irq = mx51_init_irq,
362 .init_machine = mxc_board_init, 295 .timer = &mx51_efikamx_timer,
363 .timer = &mxc_timer, 296 .init_machine = mx51_efikamx_init,
364MACHINE_END 297MACHINE_END
diff --git a/arch/arm/mach-mx5/board-mx51_efikasb.c b/arch/arm/mach-mx5/board-mx51_efikasb.c
new file mode 100644
index 000000000000..db04ce8462dc
--- /dev/null
+++ b/arch/arm/mach-mx5/board-mx51_efikasb.c
@@ -0,0 +1,283 @@
1/*
2 * Copyright (C) Arnaud Patard <arnaud.patard@rtp-net.org>
3 *
4 * based on code from the following
5 * Copyright 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved.
6 * Copyright 2009-2010 Pegatron Corporation. All Rights Reserved.
7 * Copyright 2009-2010 Genesi USA, Inc. All Rights Reserved.
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#include <linux/init.h>
18#include <linux/platform_device.h>
19#include <linux/i2c.h>
20#include <linux/gpio.h>
21#include <linux/leds.h>
22#include <linux/input.h>
23#include <linux/delay.h>
24#include <linux/io.h>
25#include <linux/fsl_devices.h>
26#include <linux/spi/flash.h>
27#include <linux/spi/spi.h>
28#include <linux/mfd/mc13892.h>
29#include <linux/regulator/machine.h>
30#include <linux/regulator/consumer.h>
31#include <linux/usb/otg.h>
32#include <linux/usb/ulpi.h>
33#include <mach/ulpi.h>
34
35#include <mach/common.h>
36#include <mach/hardware.h>
37#include <mach/iomux-mx51.h>
38#include <mach/i2c.h>
39#include <mach/mxc_ehci.h>
40
41#include <asm/irq.h>
42#include <asm/setup.h>
43#include <asm/mach-types.h>
44#include <asm/mach/arch.h>
45#include <asm/mach/time.h>
46
47#include "devices-imx51.h"
48#include "devices.h"
49#include "efika.h"
50
51#define EFIKASB_USBH2_STP IMX_GPIO_NR(2, 20)
52#define EFIKASB_GREEN_LED IMX_GPIO_NR(1, 3)
53#define EFIKASB_WHITE_LED IMX_GPIO_NR(2, 25)
54#define EFIKASB_PCBID0 IMX_GPIO_NR(2, 28)
55#define EFIKASB_PCBID1 IMX_GPIO_NR(2, 29)
56#define EFIKASB_PWRKEY IMX_GPIO_NR(2, 31)
57#define EFIKASB_LID IMX_GPIO_NR(3, 14)
58#define EFIKASB_POWEROFF IMX_GPIO_NR(4, 13)
59#define EFIKASB_RFKILL IMX_GPIO_NR(3, 1)
60
61#define MX51_PAD_PWRKEY IOMUX_PAD(0x48c, 0x0f8, 1, 0x0, 0, PAD_CTL_PUS_100K_UP | PAD_CTL_PKE)
62
63static iomux_v3_cfg_t mx51efikasb_pads[] = {
64 /* USB HOST2 */
65 MX51_PAD_EIM_D16__USBH2_DATA0,
66 MX51_PAD_EIM_D17__USBH2_DATA1,
67 MX51_PAD_EIM_D18__USBH2_DATA2,
68 MX51_PAD_EIM_D19__USBH2_DATA3,
69 MX51_PAD_EIM_D20__USBH2_DATA4,
70 MX51_PAD_EIM_D21__USBH2_DATA5,
71 MX51_PAD_EIM_D22__USBH2_DATA6,
72 MX51_PAD_EIM_D23__USBH2_DATA7,
73 MX51_PAD_EIM_A24__USBH2_CLK,
74 MX51_PAD_EIM_A25__USBH2_DIR,
75 MX51_PAD_EIM_A26__USBH2_STP,
76 MX51_PAD_EIM_A27__USBH2_NXT,
77
78 /* leds */
79 MX51_PAD_EIM_CS0__GPIO2_25,
80 MX51_PAD_GPIO1_3__GPIO1_3,
81
82 /* pcb id */
83 MX51_PAD_EIM_CS3__GPIO2_28,
84 MX51_PAD_EIM_CS4__GPIO2_29,
85
86 /* lid */
87 MX51_PAD_CSI1_VSYNC__GPIO3_14,
88
89 /* power key*/
90 MX51_PAD_PWRKEY,
91
92 /* wifi/bt button */
93 MX51_PAD_DI1_PIN12__GPIO3_1,
94
95 /* power off */
96 MX51_PAD_CSI2_VSYNC__GPIO4_13,
97
98 /* wdog reset */
99 MX51_PAD_GPIO1_4__WDOG1_WDOG_B,
100
101 /* BT */
102 MX51_PAD_EIM_A17__GPIO2_11,
103};
104
105static int initialize_usbh2_port(struct platform_device *pdev)
106{
107 iomux_v3_cfg_t usbh2stp = MX51_PAD_EIM_A26__USBH2_STP;
108 iomux_v3_cfg_t usbh2gpio = MX51_PAD_EIM_A26__GPIO2_20;
109
110 mxc_iomux_v3_setup_pad(usbh2gpio);
111 gpio_request(EFIKASB_USBH2_STP, "usbh2_stp");
112 gpio_direction_output(EFIKASB_USBH2_STP, 0);
113 msleep(1);
114 gpio_set_value(EFIKASB_USBH2_STP, 1);
115 msleep(1);
116
117 gpio_free(EFIKASB_USBH2_STP);
118 mxc_iomux_v3_setup_pad(usbh2stp);
119
120 mdelay(10);
121
122 return mx51_initialize_usb_hw(pdev->id, MXC_EHCI_ITC_NO_THRESHOLD);
123}
124
125static struct mxc_usbh_platform_data usbh2_config = {
126 .init = initialize_usbh2_port,
127 .portsc = MXC_EHCI_MODE_ULPI,
128};
129
130static void __init mx51_efikasb_usb(void)
131{
132 usbh2_config.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
133 ULPI_OTG_DRVVBUS_EXT | ULPI_OTG_EXTVBUSIND);
134 if (usbh2_config.otg)
135 mxc_register_device(&mxc_usbh2_device, &usbh2_config);
136}
137
138static struct gpio_led mx51_efikasb_leds[] = {
139 {
140 .name = "efikasb:green",
141 .default_trigger = "default-on",
142 .gpio = EFIKASB_GREEN_LED,
143 .active_low = 1,
144 },
145 {
146 .name = "efikasb:white",
147 .default_trigger = "caps",
148 .gpio = EFIKASB_WHITE_LED,
149 },
150};
151
152static struct gpio_led_platform_data mx51_efikasb_leds_data = {
153 .leds = mx51_efikasb_leds,
154 .num_leds = ARRAY_SIZE(mx51_efikasb_leds),
155};
156
157static struct platform_device mx51_efikasb_leds_device = {
158 .name = "leds-gpio",
159 .id = -1,
160 .dev = {
161 .platform_data = &mx51_efikasb_leds_data,
162 },
163};
164
165static struct gpio_keys_button mx51_efikasb_keys[] = {
166 {
167 .code = KEY_POWER,
168 .gpio = EFIKASB_PWRKEY,
169 .type = EV_PWR,
170 .desc = "Power Button",
171 .wakeup = 1,
172 .debounce_interval = 10, /* ms */
173 },
174 {
175 .code = SW_LID,
176 .gpio = EFIKASB_LID,
177 .type = EV_SW,
178 .desc = "Lid Switch",
179 },
180 {
181 /* SW_RFKILLALL vs KEY_RFKILL ? */
182 .code = SW_RFKILL_ALL,
183 .gpio = EFIKASB_RFKILL,
184 .type = EV_SW,
185 .desc = "rfkill",
186 },
187};
188
189static const struct gpio_keys_platform_data mx51_efikasb_keys_data __initconst = {
190 .buttons = mx51_efikasb_keys,
191 .nbuttons = ARRAY_SIZE(mx51_efikasb_keys),
192};
193
194static struct regulator *pwgt1, *pwgt2;
195
196static void mx51_efikasb_power_off(void)
197{
198 gpio_set_value(EFIKA_USB_PHY_RESET, 0);
199
200 if (!IS_ERR(pwgt1) && !IS_ERR(pwgt2)) {
201 regulator_disable(pwgt2);
202 regulator_disable(pwgt1);
203 }
204 gpio_direction_output(EFIKASB_POWEROFF, 1);
205}
206
207static int __init mx51_efikasb_power_init(void)
208{
209 if (machine_is_mx51_efikasb()) {
210 pwgt1 = regulator_get(NULL, "pwgt1");
211 pwgt2 = regulator_get(NULL, "pwgt2");
212 if (!IS_ERR(pwgt1) && !IS_ERR(pwgt2)) {
213 regulator_enable(pwgt1);
214 regulator_enable(pwgt2);
215 }
216 gpio_request(EFIKASB_POWEROFF, "poweroff");
217 pm_power_off = mx51_efikasb_power_off;
218
219 regulator_has_full_constraints();
220 }
221
222 return 0;
223}
224late_initcall(mx51_efikasb_power_init);
225
226/* 01 R1.3 board
227 10 R2.0 board */
228static void __init mx51_efikasb_board_id(void)
229{
230 int id;
231
232 gpio_request(EFIKASB_PCBID0, "pcb id0");
233 gpio_direction_input(EFIKASB_PCBID0);
234 gpio_request(EFIKASB_PCBID1, "pcb id1");
235 gpio_direction_input(EFIKASB_PCBID1);
236
237 id = gpio_get_value(EFIKASB_PCBID0);
238 id |= gpio_get_value(EFIKASB_PCBID1) << 1;
239
240 switch (id) {
241 default:
242 break;
243 case 1:
244 system_rev = 0x13;
245 break;
246 case 2:
247 system_rev = 0x20;
248 break;
249 }
250}
251
252static void __init efikasb_board_init(void)
253{
254 mxc_iomux_v3_setup_multiple_pads(mx51efikasb_pads,
255 ARRAY_SIZE(mx51efikasb_pads));
256 efika_board_common_init();
257
258 mx51_efikasb_board_id();
259 mx51_efikasb_usb();
260 imx51_add_sdhci_esdhc_imx(1, NULL);
261
262 platform_device_register(&mx51_efikasb_leds_device);
263 imx51_add_gpio_keys(&mx51_efikasb_keys_data);
264
265}
266
267static void __init mx51_efikasb_timer_init(void)
268{
269 mx51_clocks_init(32768, 24000000, 22579200, 24576000);
270}
271
272static struct sys_timer mx51_efikasb_timer = {
273 .init = mx51_efikasb_timer_init,
274};
275
276MACHINE_START(MX51_EFIKASB, "Genesi Efika Smartbook")
277 .boot_params = MX51_PHYS_OFFSET + 0x100,
278 .map_io = mx51_map_io,
279 .init_early = imx51_init_early,
280 .init_irq = mx51_init_irq,
281 .init_machine = efikasb_board_init,
282 .timer = &mx51_efikasb_timer,
283MACHINE_END
diff --git a/arch/arm/mach-mx5/board-mx53_evk.c b/arch/arm/mach-mx5/board-mx53_evk.c
index caee04c08238..7b5735c5ea59 100644
--- a/arch/arm/mach-mx5/board-mx53_evk.c
+++ b/arch/arm/mach-mx5/board-mx53_evk.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved. 2 * Copyright (C) 2010-2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright (C) 2010 Yong Shen. <Yong.Shen@linaro.org> 3 * Copyright (C) 2010 Yong Shen. <Yong.Shen@linaro.org>
4 */ 4 */
5 5
@@ -42,28 +42,24 @@
42#include "devices-imx53.h" 42#include "devices-imx53.h"
43 43
44static iomux_v3_cfg_t mx53_evk_pads[] = { 44static iomux_v3_cfg_t mx53_evk_pads[] = {
45 MX53_PAD_CSI0_D10__UART1_TXD, 45 MX53_PAD_CSI0_DAT10__UART1_TXD_MUX,
46 MX53_PAD_CSI0_D11__UART1_RXD, 46 MX53_PAD_CSI0_DAT11__UART1_RXD_MUX,
47 MX53_PAD_ATA_DIOW__UART1_TXD,
48 MX53_PAD_ATA_DMACK__UART1_RXD,
49 47
50 MX53_PAD_ATA_BUFFER_EN__UART2_RXD, 48 MX53_PAD_PATA_BUFFER_EN__UART2_RXD_MUX,
51 MX53_PAD_ATA_DMARQ__UART2_TXD, 49 MX53_PAD_PATA_DMARQ__UART2_TXD_MUX,
52 MX53_PAD_ATA_DIOR__UART2_RTS, 50 MX53_PAD_PATA_DIOR__UART2_RTS,
53 MX53_PAD_ATA_INTRQ__UART2_CTS, 51 MX53_PAD_PATA_INTRQ__UART2_CTS,
54 52
55 MX53_PAD_ATA_CS_0__UART3_TXD, 53 MX53_PAD_PATA_CS_0__UART3_TXD_MUX,
56 MX53_PAD_ATA_CS_1__UART3_RXD, 54 MX53_PAD_PATA_CS_1__UART3_RXD_MUX,
57 MX53_PAD_ATA_DA_1__UART3_CTS,
58 MX53_PAD_ATA_DA_2__UART3_RTS,
59 55
60 MX53_PAD_EIM_D16__CSPI1_SCLK, 56 MX53_PAD_EIM_D16__ECSPI1_SCLK,
61 MX53_PAD_EIM_D17__CSPI1_MISO, 57 MX53_PAD_EIM_D17__ECSPI1_MISO,
62 MX53_PAD_EIM_D18__CSPI1_MOSI, 58 MX53_PAD_EIM_D18__ECSPI1_MOSI,
63 59
64 /* ecspi chip select lines */ 60 /* ecspi chip select lines */
65 MX53_PAD_EIM_EB2__GPIO_2_30, 61 MX53_PAD_EIM_EB2__GPIO2_30,
66 MX53_PAD_EIM_D19__GPIO_3_19, 62 MX53_PAD_EIM_D19__GPIO3_19,
67}; 63};
68 64
69static const struct imxuart_platform_data mx53_evk_uart_pdata __initconst = { 65static const struct imxuart_platform_data mx53_evk_uart_pdata __initconst = {
@@ -72,9 +68,9 @@ static const struct imxuart_platform_data mx53_evk_uart_pdata __initconst = {
72 68
73static inline void mx53_evk_init_uart(void) 69static inline void mx53_evk_init_uart(void)
74{ 70{
75 imx53_add_imx_uart(0, &mx53_evk_uart_pdata); 71 imx53_add_imx_uart(0, NULL);
76 imx53_add_imx_uart(1, &mx53_evk_uart_pdata); 72 imx53_add_imx_uart(1, &mx53_evk_uart_pdata);
77 imx53_add_imx_uart(2, &mx53_evk_uart_pdata); 73 imx53_add_imx_uart(2, NULL);
78} 74}
79 75
80static const struct imxi2c_platform_data mx53_evk_i2c_data __initconst = { 76static const struct imxi2c_platform_data mx53_evk_i2c_data __initconst = {
@@ -139,6 +135,7 @@ static void __init mx53_evk_board_init(void)
139 spi_register_board_info(mx53_evk_spi_board_info, 135 spi_register_board_info(mx53_evk_spi_board_info,
140 ARRAY_SIZE(mx53_evk_spi_board_info)); 136 ARRAY_SIZE(mx53_evk_spi_board_info));
141 imx53_add_ecspi(0, &mx53_evk_spi_data); 137 imx53_add_ecspi(0, &mx53_evk_spi_data);
138 imx53_add_imx2_wdt(0, NULL);
142} 139}
143 140
144static void __init mx53_evk_timer_init(void) 141static void __init mx53_evk_timer_init(void)
@@ -152,7 +149,8 @@ static struct sys_timer mx53_evk_timer = {
152 149
153MACHINE_START(MX53_EVK, "Freescale MX53 EVK Board") 150MACHINE_START(MX53_EVK, "Freescale MX53 EVK Board")
154 .map_io = mx53_map_io, 151 .map_io = mx53_map_io,
152 .init_early = imx53_init_early,
155 .init_irq = mx53_init_irq, 153 .init_irq = mx53_init_irq,
156 .init_machine = mx53_evk_board_init,
157 .timer = &mx53_evk_timer, 154 .timer = &mx53_evk_timer,
155 .init_machine = mx53_evk_board_init,
158MACHINE_END 156MACHINE_END
diff --git a/arch/arm/mach-mx5/board-mx53_loco.c b/arch/arm/mach-mx5/board-mx53_loco.c
index d1348e04ace3..0a18f8d23eb0 100644
--- a/arch/arm/mach-mx5/board-mx53_loco.c
+++ b/arch/arm/mach-mx5/board-mx53_loco.c
@@ -39,33 +39,147 @@
39#define LOCO_FEC_PHY_RST IMX_GPIO_NR(7, 6) 39#define LOCO_FEC_PHY_RST IMX_GPIO_NR(7, 6)
40 40
41static iomux_v3_cfg_t mx53_loco_pads[] = { 41static iomux_v3_cfg_t mx53_loco_pads[] = {
42 MX53_PAD_CSI0_D10__UART1_TXD, 42 /* FEC */
43 MX53_PAD_CSI0_D11__UART1_RXD, 43 MX53_PAD_FEC_MDC__FEC_MDC,
44 MX53_PAD_ATA_DIOW__UART1_TXD, 44 MX53_PAD_FEC_MDIO__FEC_MDIO,
45 MX53_PAD_ATA_DMACK__UART1_RXD, 45 MX53_PAD_FEC_REF_CLK__FEC_TX_CLK,
46 46 MX53_PAD_FEC_RX_ER__FEC_RX_ER,
47 MX53_PAD_ATA_BUFFER_EN__UART2_RXD, 47 MX53_PAD_FEC_CRS_DV__FEC_RX_DV,
48 MX53_PAD_ATA_DMARQ__UART2_TXD, 48 MX53_PAD_FEC_RXD1__FEC_RDATA_1,
49 MX53_PAD_ATA_DIOR__UART2_RTS, 49 MX53_PAD_FEC_RXD0__FEC_RDATA_0,
50 MX53_PAD_ATA_INTRQ__UART2_CTS, 50 MX53_PAD_FEC_TX_EN__FEC_TX_EN,
51 51 MX53_PAD_FEC_TXD1__FEC_TDATA_1,
52 MX53_PAD_ATA_CS_0__UART3_TXD, 52 MX53_PAD_FEC_TXD0__FEC_TDATA_0,
53 MX53_PAD_ATA_CS_1__UART3_RXD, 53 /* FEC_nRST */
54 MX53_PAD_ATA_DA_1__UART3_CTS, 54 MX53_PAD_PATA_DA_0__GPIO7_6,
55 MX53_PAD_ATA_DA_2__UART3_RTS, 55 /* FEC_nINT */
56 MX53_PAD_PATA_DATA4__GPIO2_4,
57 /* AUDMUX5 */
58 MX53_PAD_KEY_COL0__AUDMUX_AUD5_TXC,
59 MX53_PAD_KEY_ROW0__AUDMUX_AUD5_TXD,
60 MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS,
61 MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD,
62 /* I2C2 */
63 MX53_PAD_KEY_COL3__I2C2_SCL,
64 MX53_PAD_KEY_ROW3__I2C2_SDA,
65 /* SD1 */
66 MX53_PAD_SD1_CMD__ESDHC1_CMD,
67 MX53_PAD_SD1_CLK__ESDHC1_CLK,
68 MX53_PAD_SD1_DATA0__ESDHC1_DAT0,
69 MX53_PAD_SD1_DATA1__ESDHC1_DAT1,
70 MX53_PAD_SD1_DATA2__ESDHC1_DAT2,
71 MX53_PAD_SD1_DATA3__ESDHC1_DAT3,
72 /* SD3 */
73 MX53_PAD_PATA_DATA8__ESDHC3_DAT0,
74 MX53_PAD_PATA_DATA9__ESDHC3_DAT1,
75 MX53_PAD_PATA_DATA10__ESDHC3_DAT2,
76 MX53_PAD_PATA_DATA11__ESDHC3_DAT3,
77 MX53_PAD_PATA_DATA0__ESDHC3_DAT4,
78 MX53_PAD_PATA_DATA1__ESDHC3_DAT5,
79 MX53_PAD_PATA_DATA2__ESDHC3_DAT6,
80 MX53_PAD_PATA_DATA3__ESDHC3_DAT7,
81 MX53_PAD_PATA_IORDY__ESDHC3_CLK,
82 MX53_PAD_PATA_RESET_B__ESDHC3_CMD,
83 /* SD3_CD */
84 MX53_PAD_EIM_DA11__GPIO3_11,
85 /* SD3_WP */
86 MX53_PAD_EIM_DA12__GPIO3_12,
87 /* VGA */
88 MX53_PAD_EIM_OE__IPU_DI1_PIN7,
89 MX53_PAD_EIM_RW__IPU_DI1_PIN8,
90 /* DISPLB */
91 MX53_PAD_EIM_D20__IPU_SER_DISP0_CS,
92 MX53_PAD_EIM_D21__IPU_DISPB0_SER_CLK,
93 MX53_PAD_EIM_D22__IPU_DISPB0_SER_DIN,
94 MX53_PAD_EIM_D23__IPU_DI0_D0_CS,
95 /* DISP0_POWER_EN */
96 MX53_PAD_EIM_D24__GPIO3_24,
97 /* DISP0 DET INT */
98 MX53_PAD_EIM_D31__GPIO3_31,
99 /* LVDS */
100 MX53_PAD_LVDS0_TX3_P__LDB_LVDS0_TX3,
101 MX53_PAD_LVDS0_CLK_P__LDB_LVDS0_CLK,
102 MX53_PAD_LVDS0_TX2_P__LDB_LVDS0_TX2,
103 MX53_PAD_LVDS0_TX1_P__LDB_LVDS0_TX1,
104 MX53_PAD_LVDS0_TX0_P__LDB_LVDS0_TX0,
105 MX53_PAD_LVDS1_TX3_P__LDB_LVDS1_TX3,
106 MX53_PAD_LVDS1_TX2_P__LDB_LVDS1_TX2,
107 MX53_PAD_LVDS1_CLK_P__LDB_LVDS1_CLK,
108 MX53_PAD_LVDS1_TX1_P__LDB_LVDS1_TX1,
109 MX53_PAD_LVDS1_TX0_P__LDB_LVDS1_TX0,
110 /* I2C1 */
111 MX53_PAD_CSI0_DAT8__I2C1_SDA,
112 MX53_PAD_CSI0_DAT9__I2C1_SCL,
113 /* UART1 */
114 MX53_PAD_CSI0_DAT10__UART1_TXD_MUX,
115 MX53_PAD_CSI0_DAT11__UART1_RXD_MUX,
116 /* CSI0 */
117 MX53_PAD_CSI0_DAT12__IPU_CSI0_D_12,
118 MX53_PAD_CSI0_DAT13__IPU_CSI0_D_13,
119 MX53_PAD_CSI0_DAT14__IPU_CSI0_D_14,
120 MX53_PAD_CSI0_DAT15__IPU_CSI0_D_15,
121 MX53_PAD_CSI0_DAT16__IPU_CSI0_D_16,
122 MX53_PAD_CSI0_DAT17__IPU_CSI0_D_17,
123 MX53_PAD_CSI0_DAT18__IPU_CSI0_D_18,
124 MX53_PAD_CSI0_DAT19__IPU_CSI0_D_19,
125 MX53_PAD_CSI0_VSYNC__IPU_CSI0_VSYNC,
126 MX53_PAD_CSI0_MCLK__IPU_CSI0_HSYNC,
127 MX53_PAD_CSI0_PIXCLK__IPU_CSI0_PIXCLK,
128 /* DISPLAY */
129 MX53_PAD_DI0_DISP_CLK__IPU_DI0_DISP_CLK,
130 MX53_PAD_DI0_PIN15__IPU_DI0_PIN15,
131 MX53_PAD_DI0_PIN2__IPU_DI0_PIN2,
132 MX53_PAD_DI0_PIN3__IPU_DI0_PIN3,
133 MX53_PAD_DISP0_DAT0__IPU_DISP0_DAT_0,
134 MX53_PAD_DISP0_DAT1__IPU_DISP0_DAT_1,
135 MX53_PAD_DISP0_DAT2__IPU_DISP0_DAT_2,
136 MX53_PAD_DISP0_DAT3__IPU_DISP0_DAT_3,
137 MX53_PAD_DISP0_DAT4__IPU_DISP0_DAT_4,
138 MX53_PAD_DISP0_DAT5__IPU_DISP0_DAT_5,
139 MX53_PAD_DISP0_DAT6__IPU_DISP0_DAT_6,
140 MX53_PAD_DISP0_DAT7__IPU_DISP0_DAT_7,
141 MX53_PAD_DISP0_DAT8__IPU_DISP0_DAT_8,
142 MX53_PAD_DISP0_DAT9__IPU_DISP0_DAT_9,
143 MX53_PAD_DISP0_DAT10__IPU_DISP0_DAT_10,
144 MX53_PAD_DISP0_DAT11__IPU_DISP0_DAT_11,
145 MX53_PAD_DISP0_DAT12__IPU_DISP0_DAT_12,
146 MX53_PAD_DISP0_DAT13__IPU_DISP0_DAT_13,
147 MX53_PAD_DISP0_DAT14__IPU_DISP0_DAT_14,
148 MX53_PAD_DISP0_DAT15__IPU_DISP0_DAT_15,
149 MX53_PAD_DISP0_DAT16__IPU_DISP0_DAT_16,
150 MX53_PAD_DISP0_DAT17__IPU_DISP0_DAT_17,
151 MX53_PAD_DISP0_DAT18__IPU_DISP0_DAT_18,
152 MX53_PAD_DISP0_DAT19__IPU_DISP0_DAT_19,
153 MX53_PAD_DISP0_DAT20__IPU_DISP0_DAT_20,
154 MX53_PAD_DISP0_DAT21__IPU_DISP0_DAT_21,
155 MX53_PAD_DISP0_DAT22__IPU_DISP0_DAT_22,
156 MX53_PAD_DISP0_DAT23__IPU_DISP0_DAT_23,
157 /* Audio CLK*/
158 MX53_PAD_GPIO_0__CCM_SSI_EXT1_CLK,
159 /* PWM */
160 MX53_PAD_GPIO_1__PWM2_PWMO,
161 /* SPDIF */
162 MX53_PAD_GPIO_7__SPDIF_PLOCK,
163 MX53_PAD_GPIO_17__SPDIF_OUT1,
164 /* GPIO */
165 MX53_PAD_PATA_DA_1__GPIO7_7,
166 MX53_PAD_PATA_DA_2__GPIO7_8,
167 MX53_PAD_PATA_DATA5__GPIO2_5,
168 MX53_PAD_PATA_DATA6__GPIO2_6,
169 MX53_PAD_PATA_DATA14__GPIO2_14,
170 MX53_PAD_PATA_DATA15__GPIO2_15,
171 MX53_PAD_PATA_INTRQ__GPIO7_2,
172 MX53_PAD_EIM_WAIT__GPIO5_0,
173 MX53_PAD_NANDF_WP_B__GPIO6_9,
174 MX53_PAD_NANDF_RB0__GPIO6_10,
175 MX53_PAD_NANDF_CS1__GPIO6_14,
176 MX53_PAD_NANDF_CS2__GPIO6_15,
177 MX53_PAD_NANDF_CS3__GPIO6_16,
178 MX53_PAD_GPIO_5__GPIO1_5,
179 MX53_PAD_GPIO_16__GPIO7_11,
180 MX53_PAD_GPIO_8__GPIO1_8,
56}; 181};
57 182
58static const struct imxuart_platform_data mx53_loco_uart_data __initconst = {
59 .flags = IMXUART_HAVE_RTSCTS,
60};
61
62static inline void mx53_loco_init_uart(void)
63{
64 imx53_add_imx_uart(0, &mx53_loco_uart_data);
65 imx53_add_imx_uart(1, &mx53_loco_uart_data);
66 imx53_add_imx_uart(2, &mx53_loco_uart_data);
67}
68
69static inline void mx53_loco_fec_reset(void) 183static inline void mx53_loco_fec_reset(void)
70{ 184{
71 int ret; 185 int ret;
@@ -85,13 +199,22 @@ static struct fec_platform_data mx53_loco_fec_data = {
85 .phy = PHY_INTERFACE_MODE_RMII, 199 .phy = PHY_INTERFACE_MODE_RMII,
86}; 200};
87 201
202static const struct imxi2c_platform_data mx53_loco_i2c_data __initconst = {
203 .bitrate = 100000,
204};
205
88static void __init mx53_loco_board_init(void) 206static void __init mx53_loco_board_init(void)
89{ 207{
90 mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads, 208 mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads,
91 ARRAY_SIZE(mx53_loco_pads)); 209 ARRAY_SIZE(mx53_loco_pads));
92 mx53_loco_init_uart(); 210 imx53_add_imx_uart(0, NULL);
93 mx53_loco_fec_reset(); 211 mx53_loco_fec_reset();
94 imx53_add_fec(&mx53_loco_fec_data); 212 imx53_add_fec(&mx53_loco_fec_data);
213 imx53_add_imx2_wdt(0, NULL);
214 imx53_add_imx_i2c(0, &mx53_loco_i2c_data);
215 imx53_add_imx_i2c(1, &mx53_loco_i2c_data);
216 imx53_add_sdhci_esdhc_imx(0, NULL);
217 imx53_add_sdhci_esdhc_imx(2, NULL);
95} 218}
96 219
97static void __init mx53_loco_timer_init(void) 220static void __init mx53_loco_timer_init(void)
@@ -105,7 +228,8 @@ static struct sys_timer mx53_loco_timer = {
105 228
106MACHINE_START(MX53_LOCO, "Freescale MX53 LOCO Board") 229MACHINE_START(MX53_LOCO, "Freescale MX53 LOCO Board")
107 .map_io = mx53_map_io, 230 .map_io = mx53_map_io,
231 .init_early = imx53_init_early,
108 .init_irq = mx53_init_irq, 232 .init_irq = mx53_init_irq,
109 .init_machine = mx53_loco_board_init,
110 .timer = &mx53_loco_timer, 233 .timer = &mx53_loco_timer,
234 .init_machine = mx53_loco_board_init,
111MACHINE_END 235MACHINE_END
diff --git a/arch/arm/mach-mx5/board-mx53_smd.c b/arch/arm/mach-mx5/board-mx53_smd.c
index 7970f7a48588..31e173267edf 100644
--- a/arch/arm/mach-mx5/board-mx53_smd.c
+++ b/arch/arm/mach-mx5/board-mx53_smd.c
@@ -39,20 +39,19 @@
39#define SMD_FEC_PHY_RST IMX_GPIO_NR(7, 6) 39#define SMD_FEC_PHY_RST IMX_GPIO_NR(7, 6)
40 40
41static iomux_v3_cfg_t mx53_smd_pads[] = { 41static iomux_v3_cfg_t mx53_smd_pads[] = {
42 MX53_PAD_CSI0_D10__UART1_TXD, 42 MX53_PAD_CSI0_DAT10__UART1_TXD_MUX,
43 MX53_PAD_CSI0_D11__UART1_RXD, 43 MX53_PAD_CSI0_DAT11__UART1_RXD_MUX,
44 MX53_PAD_ATA_DIOW__UART1_TXD, 44
45 MX53_PAD_ATA_DMACK__UART1_RXD, 45 MX53_PAD_PATA_BUFFER_EN__UART2_RXD_MUX,
46 46 MX53_PAD_PATA_DMARQ__UART2_TXD_MUX,
47 MX53_PAD_ATA_BUFFER_EN__UART2_RXD, 47
48 MX53_PAD_ATA_DMARQ__UART2_TXD, 48 MX53_PAD_PATA_CS_0__UART3_TXD_MUX,
49 MX53_PAD_ATA_DIOR__UART2_RTS, 49 MX53_PAD_PATA_CS_1__UART3_RXD_MUX,
50 MX53_PAD_ATA_INTRQ__UART2_CTS, 50 MX53_PAD_PATA_DA_1__UART3_CTS,
51 51 MX53_PAD_PATA_DA_2__UART3_RTS,
52 MX53_PAD_ATA_CS_0__UART3_TXD, 52 /* I2C1 */
53 MX53_PAD_ATA_CS_1__UART3_RXD, 53 MX53_PAD_CSI0_DAT8__I2C1_SDA,
54 MX53_PAD_ATA_DA_1__UART3_CTS, 54 MX53_PAD_CSI0_DAT9__I2C1_SCL,
55 MX53_PAD_ATA_DA_2__UART3_RTS,
56}; 55};
57 56
58static const struct imxuart_platform_data mx53_smd_uart_data __initconst = { 57static const struct imxuart_platform_data mx53_smd_uart_data __initconst = {
@@ -61,8 +60,8 @@ static const struct imxuart_platform_data mx53_smd_uart_data __initconst = {
61 60
62static inline void mx53_smd_init_uart(void) 61static inline void mx53_smd_init_uart(void)
63{ 62{
64 imx53_add_imx_uart(0, &mx53_smd_uart_data); 63 imx53_add_imx_uart(0, NULL);
65 imx53_add_imx_uart(1, &mx53_smd_uart_data); 64 imx53_add_imx_uart(1, NULL);
66 imx53_add_imx_uart(2, &mx53_smd_uart_data); 65 imx53_add_imx_uart(2, &mx53_smd_uart_data);
67} 66}
68 67
@@ -85,6 +84,10 @@ static struct fec_platform_data mx53_smd_fec_data = {
85 .phy = PHY_INTERFACE_MODE_RMII, 84 .phy = PHY_INTERFACE_MODE_RMII,
86}; 85};
87 86
87static const struct imxi2c_platform_data mx53_smd_i2c_data __initconst = {
88 .bitrate = 100000,
89};
90
88static void __init mx53_smd_board_init(void) 91static void __init mx53_smd_board_init(void)
89{ 92{
90 mxc_iomux_v3_setup_multiple_pads(mx53_smd_pads, 93 mxc_iomux_v3_setup_multiple_pads(mx53_smd_pads,
@@ -92,6 +95,8 @@ static void __init mx53_smd_board_init(void)
92 mx53_smd_init_uart(); 95 mx53_smd_init_uart();
93 mx53_smd_fec_reset(); 96 mx53_smd_fec_reset();
94 imx53_add_fec(&mx53_smd_fec_data); 97 imx53_add_fec(&mx53_smd_fec_data);
98 imx53_add_imx2_wdt(0, NULL);
99 imx53_add_imx_i2c(0, &mx53_smd_i2c_data);
95} 100}
96 101
97static void __init mx53_smd_timer_init(void) 102static void __init mx53_smd_timer_init(void)
@@ -105,7 +110,8 @@ static struct sys_timer mx53_smd_timer = {
105 110
106MACHINE_START(MX53_SMD, "Freescale MX53 SMD Board") 111MACHINE_START(MX53_SMD, "Freescale MX53 SMD Board")
107 .map_io = mx53_map_io, 112 .map_io = mx53_map_io,
113 .init_early = imx53_init_early,
108 .init_irq = mx53_init_irq, 114 .init_irq = mx53_init_irq,
109 .init_machine = mx53_smd_board_init,
110 .timer = &mx53_smd_timer, 115 .timer = &mx53_smd_timer,
116 .init_machine = mx53_smd_board_init,
111MACHINE_END 117MACHINE_END
diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c
index 0a19e7567c0b..652ace413825 100644
--- a/arch/arm/mach-mx5/clock-mx51-mx53.c
+++ b/arch/arm/mach-mx5/clock-mx51-mx53.c
@@ -42,6 +42,9 @@ static struct clk usboh3_clk;
42static struct clk emi_fast_clk; 42static struct clk emi_fast_clk;
43static struct clk ipu_clk; 43static struct clk ipu_clk;
44static struct clk mipi_hsc1_clk; 44static struct clk mipi_hsc1_clk;
45static struct clk esdhc1_clk;
46static struct clk esdhc2_clk;
47static struct clk esdhc3_mx53_clk;
45 48
46#define MAX_DPLL_WAIT_TRIES 1000 /* 1000 * udelay(1) = 1ms */ 49#define MAX_DPLL_WAIT_TRIES 1000 /* 1000 * udelay(1) = 1ms */
47 50
@@ -867,10 +870,6 @@ static struct clk gpt_32k_clk = {
867 .parent = &ckil_clk, 870 .parent = &ckil_clk,
868}; 871};
869 872
870static struct clk kpp_clk = {
871 .id = 0,
872};
873
874static struct clk dummy_clk = { 873static struct clk dummy_clk = {
875 .id = 0, 874 .id = 0,
876}; 875};
@@ -1147,10 +1146,80 @@ CLK_GET_RATE(esdhc1, 1, ESDHC1_MSHC1)
1147CLK_SET_PARENT(esdhc1, 1, ESDHC1_MSHC1) 1146CLK_SET_PARENT(esdhc1, 1, ESDHC1_MSHC1)
1148CLK_SET_RATE(esdhc1, 1, ESDHC1_MSHC1) 1147CLK_SET_RATE(esdhc1, 1, ESDHC1_MSHC1)
1149 1148
1149/* mx51 specific */
1150CLK_GET_RATE(esdhc2, 1, ESDHC2_MSHC2) 1150CLK_GET_RATE(esdhc2, 1, ESDHC2_MSHC2)
1151CLK_SET_PARENT(esdhc2, 1, ESDHC2_MSHC2) 1151CLK_SET_PARENT(esdhc2, 1, ESDHC2_MSHC2)
1152CLK_SET_RATE(esdhc2, 1, ESDHC2_MSHC2) 1152CLK_SET_RATE(esdhc2, 1, ESDHC2_MSHC2)
1153 1153
1154static int clk_esdhc3_set_parent(struct clk *clk, struct clk *parent)
1155{
1156 u32 reg;
1157
1158 reg = __raw_readl(MXC_CCM_CSCMR1);
1159 if (parent == &esdhc1_clk)
1160 reg &= ~MXC_CCM_CSCMR1_ESDHC3_CLK_SEL;
1161 else if (parent == &esdhc2_clk)
1162 reg |= MXC_CCM_CSCMR1_ESDHC3_CLK_SEL;
1163 else
1164 return -EINVAL;
1165 __raw_writel(reg, MXC_CCM_CSCMR1);
1166
1167 return 0;
1168}
1169
1170static int clk_esdhc4_set_parent(struct clk *clk, struct clk *parent)
1171{
1172 u32 reg;
1173
1174 reg = __raw_readl(MXC_CCM_CSCMR1);
1175 if (parent == &esdhc1_clk)
1176 reg &= ~MXC_CCM_CSCMR1_ESDHC4_CLK_SEL;
1177 else if (parent == &esdhc2_clk)
1178 reg |= MXC_CCM_CSCMR1_ESDHC4_CLK_SEL;
1179 else
1180 return -EINVAL;
1181 __raw_writel(reg, MXC_CCM_CSCMR1);
1182
1183 return 0;
1184}
1185
1186/* mx53 specific */
1187static int clk_esdhc2_mx53_set_parent(struct clk *clk, struct clk *parent)
1188{
1189 u32 reg;
1190
1191 reg = __raw_readl(MXC_CCM_CSCMR1);
1192 if (parent == &esdhc1_clk)
1193 reg &= ~MXC_CCM_CSCMR1_ESDHC2_MSHC2_MX53_CLK_SEL;
1194 else if (parent == &esdhc3_mx53_clk)
1195 reg |= MXC_CCM_CSCMR1_ESDHC2_MSHC2_MX53_CLK_SEL;
1196 else
1197 return -EINVAL;
1198 __raw_writel(reg, MXC_CCM_CSCMR1);
1199
1200 return 0;
1201}
1202
1203CLK_GET_RATE(esdhc3_mx53, 1, ESDHC3_MX53)
1204CLK_SET_PARENT(esdhc3_mx53, 1, ESDHC3_MX53)
1205CLK_SET_RATE(esdhc3_mx53, 1, ESDHC3_MX53)
1206
1207static int clk_esdhc4_mx53_set_parent(struct clk *clk, struct clk *parent)
1208{
1209 u32 reg;
1210
1211 reg = __raw_readl(MXC_CCM_CSCMR1);
1212 if (parent == &esdhc1_clk)
1213 reg &= ~MXC_CCM_CSCMR1_ESDHC4_CLK_SEL;
1214 else if (parent == &esdhc3_mx53_clk)
1215 reg |= MXC_CCM_CSCMR1_ESDHC4_CLK_SEL;
1216 else
1217 return -EINVAL;
1218 __raw_writel(reg, MXC_CCM_CSCMR1);
1219
1220 return 0;
1221}
1222
1154#define DEFINE_CLOCK_FULL(name, i, er, es, gr, sr, e, d, p, s) \ 1223#define DEFINE_CLOCK_FULL(name, i, er, es, gr, sr, e, d, p, s) \
1155 static struct clk name = { \ 1224 static struct clk name = { \
1156 .id = i, \ 1225 .id = i, \
@@ -1255,9 +1324,62 @@ DEFINE_CLOCK_MAX(esdhc1_clk, 0, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG1_OFFSET,
1255 clk_esdhc1, &pll2_sw_clk, &esdhc1_ipg_clk); 1324 clk_esdhc1, &pll2_sw_clk, &esdhc1_ipg_clk);
1256DEFINE_CLOCK_FULL(esdhc2_ipg_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG2_OFFSET, 1325DEFINE_CLOCK_FULL(esdhc2_ipg_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG2_OFFSET,
1257 NULL, NULL, _clk_max_enable, _clk_max_disable, &ipg_clk, NULL); 1326 NULL, NULL, _clk_max_enable, _clk_max_disable, &ipg_clk, NULL);
1327DEFINE_CLOCK_FULL(esdhc3_ipg_clk, 2, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG4_OFFSET,
1328 NULL, NULL, _clk_max_enable, _clk_max_disable, &ipg_clk, NULL);
1329DEFINE_CLOCK_FULL(esdhc4_ipg_clk, 3, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG6_OFFSET,
1330 NULL, NULL, _clk_max_enable, _clk_max_disable, &ipg_clk, NULL);
1331
1332/* mx51 specific */
1258DEFINE_CLOCK_MAX(esdhc2_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG3_OFFSET, 1333DEFINE_CLOCK_MAX(esdhc2_clk, 1, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG3_OFFSET,
1259 clk_esdhc2, &pll2_sw_clk, &esdhc2_ipg_clk); 1334 clk_esdhc2, &pll2_sw_clk, &esdhc2_ipg_clk);
1260 1335
1336static struct clk esdhc3_clk = {
1337 .id = 2,
1338 .parent = &esdhc1_clk,
1339 .set_parent = clk_esdhc3_set_parent,
1340 .enable_reg = MXC_CCM_CCGR3,
1341 .enable_shift = MXC_CCM_CCGRx_CG5_OFFSET,
1342 .enable = _clk_max_enable,
1343 .disable = _clk_max_disable,
1344 .secondary = &esdhc3_ipg_clk,
1345};
1346static struct clk esdhc4_clk = {
1347 .id = 3,
1348 .parent = &esdhc1_clk,
1349 .set_parent = clk_esdhc4_set_parent,
1350 .enable_reg = MXC_CCM_CCGR3,
1351 .enable_shift = MXC_CCM_CCGRx_CG7_OFFSET,
1352 .enable = _clk_max_enable,
1353 .disable = _clk_max_disable,
1354 .secondary = &esdhc4_ipg_clk,
1355};
1356
1357/* mx53 specific */
1358static struct clk esdhc2_mx53_clk = {
1359 .id = 2,
1360 .parent = &esdhc1_clk,
1361 .set_parent = clk_esdhc2_mx53_set_parent,
1362 .enable_reg = MXC_CCM_CCGR3,
1363 .enable_shift = MXC_CCM_CCGRx_CG3_OFFSET,
1364 .enable = _clk_max_enable,
1365 .disable = _clk_max_disable,
1366 .secondary = &esdhc3_ipg_clk,
1367};
1368
1369DEFINE_CLOCK_MAX(esdhc3_mx53_clk, 2, MXC_CCM_CCGR3, MXC_CCM_CCGRx_CG5_OFFSET,
1370 clk_esdhc3_mx53, &pll2_sw_clk, &esdhc2_ipg_clk);
1371
1372static struct clk esdhc4_mx53_clk = {
1373 .id = 3,
1374 .parent = &esdhc1_clk,
1375 .set_parent = clk_esdhc4_mx53_set_parent,
1376 .enable_reg = MXC_CCM_CCGR3,
1377 .enable_shift = MXC_CCM_CCGRx_CG7_OFFSET,
1378 .enable = _clk_max_enable,
1379 .disable = _clk_max_disable,
1380 .secondary = &esdhc4_ipg_clk,
1381};
1382
1261DEFINE_CLOCK(mipi_esc_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG5_OFFSET, NULL, NULL, NULL, &pll2_sw_clk); 1383DEFINE_CLOCK(mipi_esc_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG5_OFFSET, NULL, NULL, NULL, &pll2_sw_clk);
1262DEFINE_CLOCK(mipi_hsc2_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG4_OFFSET, NULL, NULL, &mipi_esc_clk, &pll2_sw_clk); 1384DEFINE_CLOCK(mipi_hsc2_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG4_OFFSET, NULL, NULL, &mipi_esc_clk, &pll2_sw_clk);
1263DEFINE_CLOCK(mipi_hsc1_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG3_OFFSET, NULL, NULL, &mipi_hsc2_clk, &pll2_sw_clk); 1385DEFINE_CLOCK(mipi_hsc1_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG3_OFFSET, NULL, NULL, &mipi_hsc2_clk, &pll2_sw_clk);
@@ -1302,7 +1424,7 @@ static struct clk_lookup mx51_lookups[] = {
1302 _REGISTER_CLOCK("mxc-ehci.2", "usb_ahb", usb_ahb_clk) 1424 _REGISTER_CLOCK("mxc-ehci.2", "usb_ahb", usb_ahb_clk)
1303 _REGISTER_CLOCK("fsl-usb2-udc", "usb", usboh3_clk) 1425 _REGISTER_CLOCK("fsl-usb2-udc", "usb", usboh3_clk)
1304 _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", ahb_clk) 1426 _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", ahb_clk)
1305 _REGISTER_CLOCK("imx-keypad", NULL, kpp_clk) 1427 _REGISTER_CLOCK("imx-keypad", NULL, dummy_clk)
1306 _REGISTER_CLOCK("mxc_nand", NULL, nfc_clk) 1428 _REGISTER_CLOCK("mxc_nand", NULL, nfc_clk)
1307 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) 1429 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
1308 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk) 1430 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
@@ -1316,6 +1438,8 @@ static struct clk_lookup mx51_lookups[] = {
1316 _REGISTER_CLOCK("imx51-cspi.0", NULL, cspi_clk) 1438 _REGISTER_CLOCK("imx51-cspi.0", NULL, cspi_clk)
1317 _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk) 1439 _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk)
1318 _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_clk) 1440 _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_clk)
1441 _REGISTER_CLOCK("sdhci-esdhc-imx.2", NULL, esdhc3_clk)
1442 _REGISTER_CLOCK("sdhci-esdhc-imx.3", NULL, esdhc4_clk)
1319 _REGISTER_CLOCK(NULL, "cpu_clk", cpu_clk) 1443 _REGISTER_CLOCK(NULL, "cpu_clk", cpu_clk)
1320 _REGISTER_CLOCK(NULL, "iim_clk", iim_clk) 1444 _REGISTER_CLOCK(NULL, "iim_clk", iim_clk)
1321 _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk) 1445 _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk)
@@ -1336,10 +1460,14 @@ static struct clk_lookup mx53_lookups[] = {
1336 _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk) 1460 _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk)
1337 _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) 1461 _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk)
1338 _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk) 1462 _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk)
1339 _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_clk) 1463 _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_mx53_clk)
1464 _REGISTER_CLOCK("sdhci-esdhc-imx.2", NULL, esdhc3_mx53_clk)
1465 _REGISTER_CLOCK("sdhci-esdhc-imx.3", NULL, esdhc4_mx53_clk)
1340 _REGISTER_CLOCK("imx53-ecspi.0", NULL, ecspi1_clk) 1466 _REGISTER_CLOCK("imx53-ecspi.0", NULL, ecspi1_clk)
1341 _REGISTER_CLOCK("imx53-ecspi.1", NULL, ecspi2_clk) 1467 _REGISTER_CLOCK("imx53-ecspi.1", NULL, ecspi2_clk)
1342 _REGISTER_CLOCK("imx53-cspi.0", NULL, cspi_clk) 1468 _REGISTER_CLOCK("imx53-cspi.0", NULL, cspi_clk)
1469 _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk)
1470 _REGISTER_CLOCK("imx2-wdt.1", NULL, dummy_clk)
1343}; 1471};
1344 1472
1345static void clk_tree_init(void) 1473static void clk_tree_init(void)
@@ -1427,6 +1555,14 @@ int __init mx53_clocks_init(unsigned long ckil, unsigned long osc,
1427 mx53_revision(); 1555 mx53_revision();
1428 clk_disable(&iim_clk); 1556 clk_disable(&iim_clk);
1429 1557
1558 /* Set SDHC parents to be PLL2 */
1559 clk_set_parent(&esdhc1_clk, &pll2_sw_clk);
1560 clk_set_parent(&esdhc3_mx53_clk, &pll2_sw_clk);
1561
1562 /* set SDHC root clock as 200MHZ*/
1563 clk_set_rate(&esdhc1_clk, 200000000);
1564 clk_set_rate(&esdhc3_mx53_clk, 200000000);
1565
1430 /* System timer */ 1566 /* System timer */
1431 mxc_timer_init(&gpt_clk, MX53_IO_ADDRESS(MX53_GPT1_BASE_ADDR), 1567 mxc_timer_init(&gpt_clk, MX53_IO_ADDRESS(MX53_GPT1_BASE_ADDR),
1432 MX53_INT_GPT); 1568 MX53_INT_GPT);
diff --git a/arch/arm/mach-mx5/cpu.c b/arch/arm/mach-mx5/cpu.c
index d40671da4372..df46b5e60857 100644
--- a/arch/arm/mach-mx5/cpu.c
+++ b/arch/arm/mach-mx5/cpu.c
@@ -78,11 +78,16 @@ static int get_mx53_srev(void)
78 void __iomem *iim_base = MX51_IO_ADDRESS(MX53_IIM_BASE_ADDR); 78 void __iomem *iim_base = MX51_IO_ADDRESS(MX53_IIM_BASE_ADDR);
79 u32 rev = readl(iim_base + IIM_SREV) & 0xff; 79 u32 rev = readl(iim_base + IIM_SREV) & 0xff;
80 80
81 if (rev == 0x0) 81 switch (rev) {
82 case 0x0:
82 return IMX_CHIP_REVISION_1_0; 83 return IMX_CHIP_REVISION_1_0;
83 else if (rev == 0x10) 84 case 0x2:
84 return IMX_CHIP_REVISION_2_0; 85 return IMX_CHIP_REVISION_2_0;
85 return 0; 86 case 0x3:
87 return IMX_CHIP_REVISION_2_1;
88 default:
89 return IMX_CHIP_REVISION_UNKNOWN;
90 }
86} 91}
87 92
88/* 93/*
diff --git a/arch/arm/mach-mx5/crm_regs.h b/arch/arm/mach-mx5/crm_regs.h
index b462c22f53d8..87c0c58f27a7 100644
--- a/arch/arm/mach-mx5/crm_regs.h
+++ b/arch/arm/mach-mx5/crm_regs.h
@@ -217,9 +217,12 @@
217#define MXC_CCM_CSCMR1_ESDHC1_MSHC1_CLK_SEL_OFFSET (20) 217#define MXC_CCM_CSCMR1_ESDHC1_MSHC1_CLK_SEL_OFFSET (20)
218#define MXC_CCM_CSCMR1_ESDHC1_MSHC1_CLK_SEL_MASK (0x3 << 20) 218#define MXC_CCM_CSCMR1_ESDHC1_MSHC1_CLK_SEL_MASK (0x3 << 20)
219#define MXC_CCM_CSCMR1_ESDHC3_CLK_SEL (0x1 << 19) 219#define MXC_CCM_CSCMR1_ESDHC3_CLK_SEL (0x1 << 19)
220#define MXC_CCM_CSCMR1_ESDHC2_MSHC2_MX53_CLK_SEL (0x1 << 19)
220#define MXC_CCM_CSCMR1_ESDHC4_CLK_SEL (0x1 << 18) 221#define MXC_CCM_CSCMR1_ESDHC4_CLK_SEL (0x1 << 18)
221#define MXC_CCM_CSCMR1_ESDHC2_MSHC2_CLK_SEL_OFFSET (16) 222#define MXC_CCM_CSCMR1_ESDHC2_MSHC2_CLK_SEL_OFFSET (16)
222#define MXC_CCM_CSCMR1_ESDHC2_MSHC2_CLK_SEL_MASK (0x3 << 16) 223#define MXC_CCM_CSCMR1_ESDHC2_MSHC2_CLK_SEL_MASK (0x3 << 16)
224#define MXC_CCM_CSCMR1_ESDHC3_MX53_CLK_SEL_OFFSET (16)
225#define MXC_CCM_CSCMR1_ESDHC3_MX53_CLK_SEL_MASK (0x3 << 16)
223#define MXC_CCM_CSCMR1_SSI1_CLK_SEL_OFFSET (14) 226#define MXC_CCM_CSCMR1_SSI1_CLK_SEL_OFFSET (14)
224#define MXC_CCM_CSCMR1_SSI1_CLK_SEL_MASK (0x3 << 14) 227#define MXC_CCM_CSCMR1_SSI1_CLK_SEL_MASK (0x3 << 14)
225#define MXC_CCM_CSCMR1_SSI2_CLK_SEL_OFFSET (12) 228#define MXC_CCM_CSCMR1_SSI2_CLK_SEL_OFFSET (12)
@@ -271,6 +274,10 @@
271#define MXC_CCM_CSCDR1_ESDHC2_MSHC2_CLK_PRED_MASK (0x7 << 22) 274#define MXC_CCM_CSCDR1_ESDHC2_MSHC2_CLK_PRED_MASK (0x7 << 22)
272#define MXC_CCM_CSCDR1_ESDHC2_MSHC2_CLK_PODF_OFFSET (19) 275#define MXC_CCM_CSCDR1_ESDHC2_MSHC2_CLK_PODF_OFFSET (19)
273#define MXC_CCM_CSCDR1_ESDHC2_MSHC2_CLK_PODF_MASK (0x7 << 19) 276#define MXC_CCM_CSCDR1_ESDHC2_MSHC2_CLK_PODF_MASK (0x7 << 19)
277#define MXC_CCM_CSCDR1_ESDHC3_MX53_CLK_PRED_OFFSET (22)
278#define MXC_CCM_CSCDR1_ESDHC3_MX53_CLK_PRED_MASK (0x7 << 22)
279#define MXC_CCM_CSCDR1_ESDHC3_MX53_CLK_PODF_OFFSET (19)
280#define MXC_CCM_CSCDR1_ESDHC3_MX53_CLK_PODF_MASK (0x7 << 19)
274#define MXC_CCM_CSCDR1_ESDHC1_MSHC1_CLK_PRED_OFFSET (16) 281#define MXC_CCM_CSCDR1_ESDHC1_MSHC1_CLK_PRED_OFFSET (16)
275#define MXC_CCM_CSCDR1_ESDHC1_MSHC1_CLK_PRED_MASK (0x7 << 16) 282#define MXC_CCM_CSCDR1_ESDHC1_MSHC1_CLK_PRED_MASK (0x7 << 16)
276#define MXC_CCM_CSCDR1_PGC_CLK_PODF_OFFSET (14) 283#define MXC_CCM_CSCDR1_PGC_CLK_PODF_OFFSET (14)
diff --git a/arch/arm/mach-mx5/devices-mx50.h b/arch/arm/mach-mx5/devices-imx50.h
index 98ab07468a0e..c9e42823c7e3 100644
--- a/arch/arm/mach-mx5/devices-mx50.h
+++ b/arch/arm/mach-mx5/devices-imx50.h
@@ -24,3 +24,11 @@
24extern const struct imx_imx_uart_1irq_data imx50_imx_uart_data[] __initconst; 24extern const struct imx_imx_uart_1irq_data imx50_imx_uart_data[] __initconst;
25#define imx50_add_imx_uart(id, pdata) \ 25#define imx50_add_imx_uart(id, pdata) \
26 imx_add_imx_uart_1irq(&imx50_imx_uart_data[id], pdata) 26 imx_add_imx_uart_1irq(&imx50_imx_uart_data[id], pdata)
27
28extern const struct imx_fec_data imx50_fec_data __initconst;
29#define imx50_add_fec(pdata) \
30 imx_add_fec(&imx50_fec_data, pdata)
31
32extern const struct imx_imx_i2c_data imx50_imx_i2c_data[] __initconst;
33#define imx50_add_imx_i2c(id, pdata) \
34 imx_add_imx_i2c(&imx50_imx_i2c_data[id], pdata)
diff --git a/arch/arm/mach-mx5/devices-imx53.h b/arch/arm/mach-mx5/devices-imx53.h
index 8639735a117b..9251008dad1f 100644
--- a/arch/arm/mach-mx5/devices-imx53.h
+++ b/arch/arm/mach-mx5/devices-imx53.h
@@ -29,3 +29,7 @@ imx53_sdhci_esdhc_imx_data[] __initconst;
29extern const struct imx_spi_imx_data imx53_ecspi_data[] __initconst; 29extern const struct imx_spi_imx_data imx53_ecspi_data[] __initconst;
30#define imx53_add_ecspi(id, pdata) \ 30#define imx53_add_ecspi(id, pdata) \
31 imx_add_spi_imx(&imx53_ecspi_data[id], pdata) 31 imx_add_spi_imx(&imx53_ecspi_data[id], pdata)
32
33extern const struct imx_imx2_wdt_data imx53_imx2_wdt_data[] __initconst;
34#define imx53_add_imx2_wdt(id, pdata) \
35 imx_add_imx2_wdt(&imx53_imx2_wdt_data[id])
diff --git a/arch/arm/mach-mx5/efika.h b/arch/arm/mach-mx5/efika.h
new file mode 100644
index 000000000000..014aa985faae
--- /dev/null
+++ b/arch/arm/mach-mx5/efika.h
@@ -0,0 +1,10 @@
1#ifndef _EFIKA_H
2#define _EFIKA_H
3
4#define EFIKA_WLAN_EN IMX_GPIO_NR(2, 16)
5#define EFIKA_WLAN_RESET IMX_GPIO_NR(2, 10)
6#define EFIKA_USB_PHY_RESET IMX_GPIO_NR(2, 9)
7
8void __init efika_board_common_init(void);
9
10#endif
diff --git a/arch/arm/mach-mx5/ehci.c b/arch/arm/mach-mx5/ehci.c
new file mode 100644
index 000000000000..7ce12c804a32
--- /dev/null
+++ b/arch/arm/mach-mx5/ehci.c
@@ -0,0 +1,156 @@
1/*
2 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
3 * Copyright (C) 2010 Freescale Semiconductor, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16#include <linux/platform_device.h>
17#include <linux/io.h>
18
19#include <mach/hardware.h>
20#include <mach/mxc_ehci.h>
21
22#define MXC_OTG_OFFSET 0
23#define MXC_H1_OFFSET 0x200
24#define MXC_H2_OFFSET 0x400
25
26/* USB_CTRL */
27#define MXC_OTG_UCTRL_OWIE_BIT (1 << 27) /* OTG wakeup intr enable */
28#define MXC_OTG_UCTRL_OPM_BIT (1 << 24) /* OTG power mask */
29#define MXC_H1_UCTRL_H1UIE_BIT (1 << 12) /* Host1 ULPI interrupt enable */
30#define MXC_H1_UCTRL_H1WIE_BIT (1 << 11) /* HOST1 wakeup intr enable */
31#define MXC_H1_UCTRL_H1PM_BIT (1 << 8) /* HOST1 power mask */
32
33/* USB_PHY_CTRL_FUNC */
34#define MXC_OTG_PHYCTRL_OC_DIS_BIT (1 << 8) /* OTG Disable Overcurrent Event */
35#define MXC_H1_OC_DIS_BIT (1 << 5) /* UH1 Disable Overcurrent Event */
36
37/* USBH2CTRL */
38#define MXC_H2_UCTRL_H2UIE_BIT (1 << 8)
39#define MXC_H2_UCTRL_H2WIE_BIT (1 << 7)
40#define MXC_H2_UCTRL_H2PM_BIT (1 << 4)
41
42#define MXC_USBCMD_OFFSET 0x140
43
44/* USBCMD */
45#define MXC_UCMD_ITC_NO_THRESHOLD_MASK (~(0xff << 16)) /* Interrupt Threshold Control */
46
47int mx51_initialize_usb_hw(int port, unsigned int flags)
48{
49 unsigned int v;
50 void __iomem *usb_base;
51 void __iomem *usbotg_base;
52 void __iomem *usbother_base;
53 int ret = 0;
54
55 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
56 if (!usb_base) {
57 printk(KERN_ERR "%s(): ioremap failed\n", __func__);
58 return -ENOMEM;
59 }
60
61 switch (port) {
62 case 0: /* OTG port */
63 usbotg_base = usb_base + MXC_OTG_OFFSET;
64 break;
65 case 1: /* Host 1 port */
66 usbotg_base = usb_base + MXC_H1_OFFSET;
67 break;
68 case 2: /* Host 2 port */
69 usbotg_base = usb_base + MXC_H2_OFFSET;
70 break;
71 default:
72 printk(KERN_ERR"%s no such port %d\n", __func__, port);
73 ret = -ENOENT;
74 goto error;
75 }
76 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
77
78 switch (port) {
79 case 0: /*OTG port */
80 if (flags & MXC_EHCI_INTERNAL_PHY) {
81 v = __raw_readl(usbother_base + MXC_USB_PHY_CTR_FUNC_OFFSET);
82
83 if (flags & MXC_EHCI_POWER_PINS_ENABLED) {
84 /* OC/USBPWR is not used */
85 v |= MXC_OTG_PHYCTRL_OC_DIS_BIT;
86 } else {
87 /* OC/USBPWR is used */
88 v &= ~MXC_OTG_PHYCTRL_OC_DIS_BIT;
89 }
90 __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC_OFFSET);
91
92 v = __raw_readl(usbother_base + MXC_USBCTRL_OFFSET);
93 if (flags & MXC_EHCI_WAKEUP_ENABLED)
94 v |= MXC_OTG_UCTRL_OWIE_BIT;/* OTG wakeup enable */
95 else
96 v &= ~MXC_OTG_UCTRL_OWIE_BIT;/* OTG wakeup disable */
97 if (flags & MXC_EHCI_POWER_PINS_ENABLED)
98 v |= MXC_OTG_UCTRL_OPM_BIT;
99 else
100 v &= ~MXC_OTG_UCTRL_OPM_BIT;
101 __raw_writel(v, usbother_base + MXC_USBCTRL_OFFSET);
102 }
103 break;
104 case 1: /* Host 1 */
105 /*Host ULPI */
106 v = __raw_readl(usbother_base + MXC_USBCTRL_OFFSET);
107 if (flags & MXC_EHCI_WAKEUP_ENABLED) {
108 /* HOST1 wakeup/ULPI intr enable */
109 v |= (MXC_H1_UCTRL_H1WIE_BIT | MXC_H1_UCTRL_H1UIE_BIT);
110 } else {
111 /* HOST1 wakeup/ULPI intr disable */
112 v &= ~(MXC_H1_UCTRL_H1WIE_BIT | MXC_H1_UCTRL_H1UIE_BIT);
113 }
114
115 if (flags & MXC_EHCI_POWER_PINS_ENABLED)
116 v &= ~MXC_H1_UCTRL_H1PM_BIT; /* HOST1 power mask used*/
117 else
118 v |= MXC_H1_UCTRL_H1PM_BIT; /* HOST1 power mask used*/
119 __raw_writel(v, usbother_base + MXC_USBCTRL_OFFSET);
120
121 v = __raw_readl(usbother_base + MXC_USB_PHY_CTR_FUNC_OFFSET);
122 if (flags & MXC_EHCI_POWER_PINS_ENABLED)
123 v &= ~MXC_H1_OC_DIS_BIT; /* OC is used */
124 else
125 v |= MXC_H1_OC_DIS_BIT; /* OC is not used */
126 __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC_OFFSET);
127
128 v = __raw_readl(usbotg_base + MXC_USBCMD_OFFSET);
129 if (flags & MXC_EHCI_ITC_NO_THRESHOLD)
130 /* Interrupt Threshold Control:Immediate (no threshold) */
131 v &= MXC_UCMD_ITC_NO_THRESHOLD_MASK;
132 __raw_writel(v, usbotg_base + MXC_USBCMD_OFFSET);
133 break;
134 case 2: /* Host 2 ULPI */
135 v = __raw_readl(usbother_base + MXC_USBH2CTRL_OFFSET);
136 if (flags & MXC_EHCI_WAKEUP_ENABLED) {
137 /* HOST1 wakeup/ULPI intr enable */
138 v |= (MXC_H2_UCTRL_H2WIE_BIT | MXC_H2_UCTRL_H2UIE_BIT);
139 } else {
140 /* HOST1 wakeup/ULPI intr disable */
141 v &= ~(MXC_H2_UCTRL_H2WIE_BIT | MXC_H2_UCTRL_H2UIE_BIT);
142 }
143
144 if (flags & MXC_EHCI_POWER_PINS_ENABLED)
145 v &= ~MXC_H2_UCTRL_H2PM_BIT; /* HOST2 power mask used*/
146 else
147 v |= MXC_H2_UCTRL_H2PM_BIT; /* HOST2 power mask used*/
148 __raw_writel(v, usbother_base + MXC_USBH2CTRL_OFFSET);
149 break;
150 }
151
152error:
153 iounmap(usb_base);
154 return ret;
155}
156
diff --git a/arch/arm/mach-mx5/mm-mx50.c b/arch/arm/mach-mx5/mm-mx50.c
index 8c6540e58390..b9c363b514a9 100644
--- a/arch/arm/mach-mx5/mm-mx50.c
+++ b/arch/arm/mach-mx5/mm-mx50.c
@@ -26,6 +26,8 @@
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <mach/common.h> 27#include <mach/common.h>
28#include <mach/iomux-v3.h> 28#include <mach/iomux-v3.h>
29#include <mach/gpio.h>
30#include <mach/irqs.h>
29 31
30/* 32/*
31 * Define the MX50 memory map. 33 * Define the MX50 memory map.
@@ -44,16 +46,27 @@ static struct map_desc mx50_io_desc[] __initdata = {
44 */ 46 */
45void __init mx50_map_io(void) 47void __init mx50_map_io(void)
46{ 48{
49 iotable_init(mx50_io_desc, ARRAY_SIZE(mx50_io_desc));
50}
51
52void __init imx50_init_early(void)
53{
47 mxc_set_cpu_type(MXC_CPU_MX50); 54 mxc_set_cpu_type(MXC_CPU_MX50);
48 mxc_iomux_v3_init(MX50_IO_ADDRESS(MX50_IOMUXC_BASE_ADDR)); 55 mxc_iomux_v3_init(MX50_IO_ADDRESS(MX50_IOMUXC_BASE_ADDR));
49 mxc_arch_reset_init(MX50_IO_ADDRESS(MX50_WDOG_BASE_ADDR)); 56 mxc_arch_reset_init(MX50_IO_ADDRESS(MX50_WDOG_BASE_ADDR));
50 iotable_init(mx50_io_desc, ARRAY_SIZE(mx50_io_desc));
51} 57}
52 58
53int imx50_register_gpios(void); 59static struct mxc_gpio_port imx50_gpio_ports[] = {
60 DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 0, 1, MX50_INT_GPIO1_LOW, MX50_INT_GPIO1_HIGH),
61 DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 1, 2, MX50_INT_GPIO2_LOW, MX50_INT_GPIO2_HIGH),
62 DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 2, 3, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH),
63 DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 3, 4, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH),
64 DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 4, 5, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH),
65 DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 5, 6, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH),
66};
54 67
55void __init mx50_init_irq(void) 68void __init mx50_init_irq(void)
56{ 69{
57 tzic_init_irq(MX50_IO_ADDRESS(MX50_TZIC_BASE_ADDR)); 70 tzic_init_irq(MX50_IO_ADDRESS(MX50_TZIC_BASE_ADDR));
58 imx50_register_gpios(); 71 mxc_gpio_init(imx50_gpio_ports, ARRAY_SIZE(imx50_gpio_ports));
59} 72}
diff --git a/arch/arm/mach-mx5/mm.c b/arch/arm/mach-mx5/mm.c
index 457f9f95204b..ff557301b42b 100644
--- a/arch/arm/mach-mx5/mm.c
+++ b/arch/arm/mach-mx5/mm.c
@@ -47,18 +47,26 @@ static struct map_desc mx53_io_desc[] __initdata = {
47 */ 47 */
48void __init mx51_map_io(void) 48void __init mx51_map_io(void)
49{ 49{
50 iotable_init(mx51_io_desc, ARRAY_SIZE(mx51_io_desc));
51}
52
53void __init imx51_init_early(void)
54{
50 mxc_set_cpu_type(MXC_CPU_MX51); 55 mxc_set_cpu_type(MXC_CPU_MX51);
51 mxc_iomux_v3_init(MX51_IO_ADDRESS(MX51_IOMUXC_BASE_ADDR)); 56 mxc_iomux_v3_init(MX51_IO_ADDRESS(MX51_IOMUXC_BASE_ADDR));
52 mxc_arch_reset_init(MX51_IO_ADDRESS(MX51_WDOG1_BASE_ADDR)); 57 mxc_arch_reset_init(MX51_IO_ADDRESS(MX51_WDOG1_BASE_ADDR));
53 iotable_init(mx51_io_desc, ARRAY_SIZE(mx51_io_desc));
54} 58}
55 59
56void __init mx53_map_io(void) 60void __init mx53_map_io(void)
57{ 61{
62 iotable_init(mx53_io_desc, ARRAY_SIZE(mx53_io_desc));
63}
64
65void __init imx53_init_early(void)
66{
58 mxc_set_cpu_type(MXC_CPU_MX53); 67 mxc_set_cpu_type(MXC_CPU_MX53);
59 mxc_iomux_v3_init(MX53_IO_ADDRESS(MX53_IOMUXC_BASE_ADDR)); 68 mxc_iomux_v3_init(MX53_IO_ADDRESS(MX53_IOMUXC_BASE_ADDR));
60 mxc_arch_reset_init(MX53_IO_ADDRESS(MX53_WDOG_BASE_ADDR)); 69 mxc_arch_reset_init(MX53_IO_ADDRESS(MX53_WDOG1_BASE_ADDR));
61 iotable_init(mx53_io_desc, ARRAY_SIZE(mx53_io_desc));
62} 70}
63 71
64int imx51_register_gpios(void); 72int imx51_register_gpios(void);
diff --git a/arch/arm/mach-mx5/mx51_efika.c b/arch/arm/mach-mx5/mx51_efika.c
new file mode 100644
index 000000000000..51a67fc7f0ef
--- /dev/null
+++ b/arch/arm/mach-mx5/mx51_efika.c
@@ -0,0 +1,636 @@
1/*
2 * based on code from the following
3 * Copyright 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved.
4 * Copyright 2009-2010 Pegatron Corporation. All Rights Reserved.
5 * Copyright 2009-2010 Genesi USA, Inc. All Rights Reserved.
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
15#include <linux/init.h>
16#include <linux/platform_device.h>
17#include <linux/i2c.h>
18#include <linux/gpio.h>
19#include <linux/leds.h>
20#include <linux/input.h>
21#include <linux/delay.h>
22#include <linux/io.h>
23#include <linux/fsl_devices.h>
24#include <linux/spi/flash.h>
25#include <linux/spi/spi.h>
26#include <linux/mfd/mc13892.h>
27#include <linux/regulator/machine.h>
28#include <linux/regulator/consumer.h>
29
30#include <mach/common.h>
31#include <mach/hardware.h>
32#include <mach/iomux-mx51.h>
33#include <mach/i2c.h>
34#include <mach/mxc_ehci.h>
35
36#include <linux/usb/otg.h>
37#include <linux/usb/ulpi.h>
38#include <mach/ulpi.h>
39
40#include <asm/irq.h>
41#include <asm/setup.h>
42#include <asm/mach-types.h>
43#include <asm/mach/arch.h>
44#include <asm/mach/time.h>
45#include <asm/mach-types.h>
46
47#include "devices-imx51.h"
48#include "devices.h"
49#include "efika.h"
50#include "cpu_op-mx51.h"
51
52#define MX51_USB_CTRL_1_OFFSET 0x10
53#define MX51_USB_CTRL_UH1_EXT_CLK_EN (1 << 25)
54#define MX51_USB_PLL_DIV_19_2_MHZ 0x01
55
56#define EFIKAMX_USB_HUB_RESET IMX_GPIO_NR(1, 5)
57#define EFIKAMX_USBH1_STP IMX_GPIO_NR(1, 27)
58
59#define EFIKAMX_SPI_CS0 IMX_GPIO_NR(4, 24)
60#define EFIKAMX_SPI_CS1 IMX_GPIO_NR(4, 25)
61
62#define EFIKAMX_PMIC IMX_GPIO_NR(1, 6)
63
64static iomux_v3_cfg_t mx51efika_pads[] = {
65 /* UART1 */
66 MX51_PAD_UART1_RXD__UART1_RXD,
67 MX51_PAD_UART1_TXD__UART1_TXD,
68 MX51_PAD_UART1_RTS__UART1_RTS,
69 MX51_PAD_UART1_CTS__UART1_CTS,
70
71 /* SD 1 */
72 MX51_PAD_SD1_CMD__SD1_CMD,
73 MX51_PAD_SD1_CLK__SD1_CLK,
74 MX51_PAD_SD1_DATA0__SD1_DATA0,
75 MX51_PAD_SD1_DATA1__SD1_DATA1,
76 MX51_PAD_SD1_DATA2__SD1_DATA2,
77 MX51_PAD_SD1_DATA3__SD1_DATA3,
78
79 /* SD 2 */
80 MX51_PAD_SD2_CMD__SD2_CMD,
81 MX51_PAD_SD2_CLK__SD2_CLK,
82 MX51_PAD_SD2_DATA0__SD2_DATA0,
83 MX51_PAD_SD2_DATA1__SD2_DATA1,
84 MX51_PAD_SD2_DATA2__SD2_DATA2,
85 MX51_PAD_SD2_DATA3__SD2_DATA3,
86
87 /* SD/MMC WP/CD */
88 MX51_PAD_GPIO1_0__SD1_CD,
89 MX51_PAD_GPIO1_1__SD1_WP,
90 MX51_PAD_GPIO1_7__SD2_WP,
91 MX51_PAD_GPIO1_8__SD2_CD,
92
93 /* spi */
94 MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI,
95 MX51_PAD_CSPI1_MISO__ECSPI1_MISO,
96 MX51_PAD_CSPI1_SS0__GPIO4_24,
97 MX51_PAD_CSPI1_SS1__GPIO4_25,
98 MX51_PAD_CSPI1_RDY__ECSPI1_RDY,
99 MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK,
100 MX51_PAD_GPIO1_6__GPIO1_6,
101
102 /* USB HOST1 */
103 MX51_PAD_USBH1_CLK__USBH1_CLK,
104 MX51_PAD_USBH1_DIR__USBH1_DIR,
105 MX51_PAD_USBH1_NXT__USBH1_NXT,
106 MX51_PAD_USBH1_DATA0__USBH1_DATA0,
107 MX51_PAD_USBH1_DATA1__USBH1_DATA1,
108 MX51_PAD_USBH1_DATA2__USBH1_DATA2,
109 MX51_PAD_USBH1_DATA3__USBH1_DATA3,
110 MX51_PAD_USBH1_DATA4__USBH1_DATA4,
111 MX51_PAD_USBH1_DATA5__USBH1_DATA5,
112 MX51_PAD_USBH1_DATA6__USBH1_DATA6,
113 MX51_PAD_USBH1_DATA7__USBH1_DATA7,
114
115 /* USB HUB RESET */
116 MX51_PAD_GPIO1_5__GPIO1_5,
117
118 /* WLAN */
119 MX51_PAD_EIM_A22__GPIO2_16,
120 MX51_PAD_EIM_A16__GPIO2_10,
121
122 /* USB PHY RESET */
123 MX51_PAD_EIM_D27__GPIO2_9,
124};
125
126/* Serial ports */
127static const struct imxuart_platform_data uart_pdata = {
128 .flags = IMXUART_HAVE_RTSCTS,
129};
130
131/* This function is board specific as the bit mask for the plldiv will also
132 * be different for other Freescale SoCs, thus a common bitmask is not
133 * possible and cannot get place in /plat-mxc/ehci.c.
134 */
135static int initialize_otg_port(struct platform_device *pdev)
136{
137 u32 v;
138 void __iomem *usb_base;
139 void __iomem *usbother_base;
140 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
141 if (!usb_base)
142 return -ENOMEM;
143 usbother_base = (void __iomem *)(usb_base + MX5_USBOTHER_REGS_OFFSET);
144
145 /* Set the PHY clock to 19.2MHz */
146 v = __raw_readl(usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET);
147 v &= ~MX5_USB_UTMI_PHYCTRL1_PLLDIV_MASK;
148 v |= MX51_USB_PLL_DIV_19_2_MHZ;
149 __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET);
150 iounmap(usb_base);
151
152 mdelay(10);
153
154 return mx51_initialize_usb_hw(pdev->id, MXC_EHCI_INTERNAL_PHY);
155}
156
157static struct mxc_usbh_platform_data dr_utmi_config = {
158 .init = initialize_otg_port,
159 .portsc = MXC_EHCI_UTMI_16BIT,
160};
161
162static int initialize_usbh1_port(struct platform_device *pdev)
163{
164 iomux_v3_cfg_t usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP;
165 iomux_v3_cfg_t usbh1gpio = MX51_PAD_USBH1_STP__GPIO1_27;
166 u32 v;
167 void __iomem *usb_base;
168 void __iomem *socregs_base;
169
170 mxc_iomux_v3_setup_pad(usbh1gpio);
171 gpio_request(EFIKAMX_USBH1_STP, "usbh1_stp");
172 gpio_direction_output(EFIKAMX_USBH1_STP, 0);
173 msleep(1);
174 gpio_set_value(EFIKAMX_USBH1_STP, 1);
175 msleep(1);
176
177 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
178 socregs_base = (void __iomem *)(usb_base + MX5_USBOTHER_REGS_OFFSET);
179
180 /* The clock for the USBH1 ULPI port will come externally */
181 /* from the PHY. */
182 v = __raw_readl(socregs_base + MX51_USB_CTRL_1_OFFSET);
183 __raw_writel(v | MX51_USB_CTRL_UH1_EXT_CLK_EN,
184 socregs_base + MX51_USB_CTRL_1_OFFSET);
185
186 iounmap(usb_base);
187
188 gpio_free(EFIKAMX_USBH1_STP);
189 mxc_iomux_v3_setup_pad(usbh1stp);
190
191 mdelay(10);
192
193 return mx51_initialize_usb_hw(0, MXC_EHCI_ITC_NO_THRESHOLD);
194}
195
196static struct mxc_usbh_platform_data usbh1_config = {
197 .init = initialize_usbh1_port,
198 .portsc = MXC_EHCI_MODE_ULPI,
199};
200
201static void mx51_efika_hubreset(void)
202{
203 gpio_request(EFIKAMX_USB_HUB_RESET, "usb_hub_rst");
204 gpio_direction_output(EFIKAMX_USB_HUB_RESET, 1);
205 msleep(1);
206 gpio_set_value(EFIKAMX_USB_HUB_RESET, 0);
207 msleep(1);
208 gpio_set_value(EFIKAMX_USB_HUB_RESET, 1);
209}
210
211static void __init mx51_efika_usb(void)
212{
213 mx51_efika_hubreset();
214
215 /* pulling it low, means no USB at all... */
216 gpio_request(EFIKA_USB_PHY_RESET, "usb_phy_reset");
217 gpio_direction_output(EFIKA_USB_PHY_RESET, 0);
218 msleep(1);
219 gpio_set_value(EFIKA_USB_PHY_RESET, 1);
220
221 usbh1_config.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
222 ULPI_OTG_DRVVBUS_EXT | ULPI_OTG_EXTVBUSIND);
223
224 mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config);
225 if (usbh1_config.otg)
226 mxc_register_device(&mxc_usbh1_device, &usbh1_config);
227}
228
229static struct mtd_partition mx51_efika_spi_nor_partitions[] = {
230 {
231 .name = "u-boot",
232 .offset = 0,
233 .size = SZ_256K,
234 },
235 {
236 .name = "config",
237 .offset = MTDPART_OFS_APPEND,
238 .size = SZ_64K,
239 },
240};
241
242static struct flash_platform_data mx51_efika_spi_flash_data = {
243 .name = "spi_flash",
244 .parts = mx51_efika_spi_nor_partitions,
245 .nr_parts = ARRAY_SIZE(mx51_efika_spi_nor_partitions),
246 .type = "sst25vf032b",
247};
248
249static struct regulator_consumer_supply sw1_consumers[] = {
250 {
251 .supply = "cpu_vcc",
252 }
253};
254
255static struct regulator_consumer_supply vdig_consumers[] = {
256 /* sgtl5000 */
257 REGULATOR_SUPPLY("VDDA", "1-000a"),
258 REGULATOR_SUPPLY("VDDD", "1-000a"),
259};
260
261static struct regulator_consumer_supply vvideo_consumers[] = {
262 /* sgtl5000 */
263 REGULATOR_SUPPLY("VDDIO", "1-000a"),
264};
265
266static struct regulator_consumer_supply vsd_consumers[] = {
267 REGULATOR_SUPPLY("vmmc", "sdhci-esdhc-imx.0"),
268 REGULATOR_SUPPLY("vmmc", "sdhci-esdhc-imx.1"),
269};
270
271static struct regulator_consumer_supply pwgt1_consumer[] = {
272 {
273 .supply = "pwgt1",
274 }
275};
276
277static struct regulator_consumer_supply pwgt2_consumer[] = {
278 {
279 .supply = "pwgt2",
280 }
281};
282
283static struct regulator_consumer_supply coincell_consumer[] = {
284 {
285 .supply = "coincell",
286 }
287};
288
289static struct regulator_init_data sw1_init = {
290 .constraints = {
291 .name = "SW1",
292 .min_uV = 600000,
293 .max_uV = 1375000,
294 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
295 .valid_modes_mask = 0,
296 .always_on = 1,
297 .boot_on = 1,
298 .state_mem = {
299 .uV = 850000,
300 .mode = REGULATOR_MODE_NORMAL,
301 .enabled = 1,
302 },
303 },
304 .num_consumer_supplies = ARRAY_SIZE(sw1_consumers),
305 .consumer_supplies = sw1_consumers,
306};
307
308static struct regulator_init_data sw2_init = {
309 .constraints = {
310 .name = "SW2",
311 .min_uV = 900000,
312 .max_uV = 1850000,
313 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
314 .always_on = 1,
315 .boot_on = 1,
316 .state_mem = {
317 .uV = 950000,
318 .mode = REGULATOR_MODE_NORMAL,
319 .enabled = 1,
320 },
321 }
322};
323
324static struct regulator_init_data sw3_init = {
325 .constraints = {
326 .name = "SW3",
327 .min_uV = 1100000,
328 .max_uV = 1850000,
329 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
330 .always_on = 1,
331 .boot_on = 1,
332 }
333};
334
335static struct regulator_init_data sw4_init = {
336 .constraints = {
337 .name = "SW4",
338 .min_uV = 1100000,
339 .max_uV = 1850000,
340 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
341 .always_on = 1,
342 .boot_on = 1,
343 }
344};
345
346static struct regulator_init_data viohi_init = {
347 .constraints = {
348 .name = "VIOHI",
349 .boot_on = 1,
350 .always_on = 1,
351 }
352};
353
354static struct regulator_init_data vusb_init = {
355 .constraints = {
356 .name = "VUSB",
357 .boot_on = 1,
358 .always_on = 1,
359 }
360};
361
362static struct regulator_init_data swbst_init = {
363 .constraints = {
364 .name = "SWBST",
365 }
366};
367
368static struct regulator_init_data vdig_init = {
369 .constraints = {
370 .name = "VDIG",
371 .min_uV = 1050000,
372 .max_uV = 1800000,
373 .valid_ops_mask =
374 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS,
375 .boot_on = 1,
376 .always_on = 1,
377 },
378 .num_consumer_supplies = ARRAY_SIZE(vdig_consumers),
379 .consumer_supplies = vdig_consumers,
380};
381
382static struct regulator_init_data vpll_init = {
383 .constraints = {
384 .name = "VPLL",
385 .min_uV = 1050000,
386 .max_uV = 1800000,
387 .valid_ops_mask =
388 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS,
389 .boot_on = 1,
390 .always_on = 1,
391 }
392};
393
394static struct regulator_init_data vusb2_init = {
395 .constraints = {
396 .name = "VUSB2",
397 .min_uV = 2400000,
398 .max_uV = 2775000,
399 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
400 .boot_on = 1,
401 .always_on = 1,
402 }
403};
404
405static struct regulator_init_data vvideo_init = {
406 .constraints = {
407 .name = "VVIDEO",
408 .min_uV = 2775000,
409 .max_uV = 2775000,
410 .valid_ops_mask =
411 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS,
412 .boot_on = 1,
413 .apply_uV = 1,
414 },
415 .num_consumer_supplies = ARRAY_SIZE(vvideo_consumers),
416 .consumer_supplies = vvideo_consumers,
417};
418
419static struct regulator_init_data vaudio_init = {
420 .constraints = {
421 .name = "VAUDIO",
422 .min_uV = 2300000,
423 .max_uV = 3000000,
424 .valid_ops_mask =
425 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS,
426 .boot_on = 1,
427 }
428};
429
430static struct regulator_init_data vsd_init = {
431 .constraints = {
432 .name = "VSD",
433 .min_uV = 1800000,
434 .max_uV = 3150000,
435 .valid_ops_mask =
436 REGULATOR_CHANGE_VOLTAGE,
437 .boot_on = 1,
438 },
439 .num_consumer_supplies = ARRAY_SIZE(vsd_consumers),
440 .consumer_supplies = vsd_consumers,
441};
442
443static struct regulator_init_data vcam_init = {
444 .constraints = {
445 .name = "VCAM",
446 .min_uV = 2500000,
447 .max_uV = 3000000,
448 .valid_ops_mask =
449 REGULATOR_CHANGE_VOLTAGE |
450 REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS,
451 .valid_modes_mask = REGULATOR_MODE_FAST | REGULATOR_MODE_NORMAL,
452 .boot_on = 1,
453 }
454};
455
456static struct regulator_init_data vgen1_init = {
457 .constraints = {
458 .name = "VGEN1",
459 .min_uV = 1200000,
460 .max_uV = 3150000,
461 .valid_ops_mask =
462 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS,
463 .boot_on = 1,
464 .always_on = 1,
465 }
466};
467
468static struct regulator_init_data vgen2_init = {
469 .constraints = {
470 .name = "VGEN2",
471 .min_uV = 1200000,
472 .max_uV = 3150000,
473 .valid_ops_mask =
474 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS,
475 .boot_on = 1,
476 .always_on = 1,
477 }
478};
479
480static struct regulator_init_data vgen3_init = {
481 .constraints = {
482 .name = "VGEN3",
483 .min_uV = 1800000,
484 .max_uV = 2900000,
485 .valid_ops_mask =
486 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS,
487 .boot_on = 1,
488 .always_on = 1,
489 }
490};
491
492static struct regulator_init_data gpo1_init = {
493 .constraints = {
494 .name = "GPO1",
495 }
496};
497
498static struct regulator_init_data gpo2_init = {
499 .constraints = {
500 .name = "GPO2",
501 }
502};
503
504static struct regulator_init_data gpo3_init = {
505 .constraints = {
506 .name = "GPO3",
507 }
508};
509
510static struct regulator_init_data gpo4_init = {
511 .constraints = {
512 .name = "GPO4",
513 }
514};
515
516static struct regulator_init_data pwgt1_init = {
517 .constraints = {
518 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
519 .boot_on = 1,
520 },
521 .num_consumer_supplies = ARRAY_SIZE(pwgt1_consumer),
522 .consumer_supplies = pwgt1_consumer,
523};
524
525static struct regulator_init_data pwgt2_init = {
526 .constraints = {
527 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
528 .boot_on = 1,
529 },
530 .num_consumer_supplies = ARRAY_SIZE(pwgt2_consumer),
531 .consumer_supplies = pwgt2_consumer,
532};
533
534static struct regulator_init_data vcoincell_init = {
535 .constraints = {
536 .name = "COINCELL",
537 .min_uV = 3000000,
538 .max_uV = 3000000,
539 .valid_ops_mask =
540 REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS,
541 },
542 .num_consumer_supplies = ARRAY_SIZE(coincell_consumer),
543 .consumer_supplies = coincell_consumer,
544};
545
546static struct mc13xxx_regulator_init_data mx51_efika_regulators[] = {
547 { .id = MC13892_SW1, .init_data = &sw1_init },
548 { .id = MC13892_SW2, .init_data = &sw2_init },
549 { .id = MC13892_SW3, .init_data = &sw3_init },
550 { .id = MC13892_SW4, .init_data = &sw4_init },
551 { .id = MC13892_SWBST, .init_data = &swbst_init },
552 { .id = MC13892_VIOHI, .init_data = &viohi_init },
553 { .id = MC13892_VPLL, .init_data = &vpll_init },
554 { .id = MC13892_VDIG, .init_data = &vdig_init },
555 { .id = MC13892_VSD, .init_data = &vsd_init },
556 { .id = MC13892_VUSB2, .init_data = &vusb2_init },
557 { .id = MC13892_VVIDEO, .init_data = &vvideo_init },
558 { .id = MC13892_VAUDIO, .init_data = &vaudio_init },
559 { .id = MC13892_VCAM, .init_data = &vcam_init },
560 { .id = MC13892_VGEN1, .init_data = &vgen1_init },
561 { .id = MC13892_VGEN2, .init_data = &vgen2_init },
562 { .id = MC13892_VGEN3, .init_data = &vgen3_init },
563 { .id = MC13892_VUSB, .init_data = &vusb_init },
564 { .id = MC13892_GPO1, .init_data = &gpo1_init },
565 { .id = MC13892_GPO2, .init_data = &gpo2_init },
566 { .id = MC13892_GPO3, .init_data = &gpo3_init },
567 { .id = MC13892_GPO4, .init_data = &gpo4_init },
568 { .id = MC13892_PWGT1SPI, .init_data = &pwgt1_init },
569 { .id = MC13892_PWGT2SPI, .init_data = &pwgt2_init },
570 { .id = MC13892_VCOINCELL, .init_data = &vcoincell_init },
571};
572
573static struct mc13xxx_platform_data mx51_efika_mc13892_data = {
574 .flags = MC13XXX_USE_RTC | MC13XXX_USE_REGULATOR,
575 .num_regulators = ARRAY_SIZE(mx51_efika_regulators),
576 .regulators = mx51_efika_regulators,
577};
578
579static struct spi_board_info mx51_efika_spi_board_info[] __initdata = {
580 {
581 .modalias = "m25p80",
582 .max_speed_hz = 25000000,
583 .bus_num = 0,
584 .chip_select = 1,
585 .platform_data = &mx51_efika_spi_flash_data,
586 .irq = -1,
587 },
588 {
589 .modalias = "mc13892",
590 .max_speed_hz = 1000000,
591 .bus_num = 0,
592 .chip_select = 0,
593 .platform_data = &mx51_efika_mc13892_data,
594 .irq = gpio_to_irq(EFIKAMX_PMIC),
595 },
596};
597
598static int mx51_efika_spi_cs[] = {
599 EFIKAMX_SPI_CS0,
600 EFIKAMX_SPI_CS1,
601};
602
603static const struct spi_imx_master mx51_efika_spi_pdata __initconst = {
604 .chipselect = mx51_efika_spi_cs,
605 .num_chipselect = ARRAY_SIZE(mx51_efika_spi_cs),
606};
607
608void __init efika_board_common_init(void)
609{
610 mxc_iomux_v3_setup_multiple_pads(mx51efika_pads,
611 ARRAY_SIZE(mx51efika_pads));
612 imx51_add_imx_uart(0, &uart_pdata);
613 mx51_efika_usb();
614 imx51_add_sdhci_esdhc_imx(0, NULL);
615
616 /* FIXME: comes from original code. check this. */
617 if (mx51_revision() < IMX_CHIP_REVISION_2_0)
618 sw2_init.constraints.state_mem.uV = 1100000;
619 else if (mx51_revision() == IMX_CHIP_REVISION_2_0) {
620 sw2_init.constraints.state_mem.uV = 1250000;
621 sw1_init.constraints.state_mem.uV = 1000000;
622 }
623 if (machine_is_mx51_efikasb())
624 vgen1_init.constraints.max_uV = 1200000;
625
626 gpio_request(EFIKAMX_PMIC, "pmic irq");
627 gpio_direction_input(EFIKAMX_PMIC);
628 spi_register_board_info(mx51_efika_spi_board_info,
629 ARRAY_SIZE(mx51_efika_spi_board_info));
630 imx51_add_ecspi(0, &mx51_efika_spi_pdata);
631
632#if defined(CONFIG_CPU_FREQ_IMX)
633 get_cpu_op = mx51_get_cpu_op;
634#endif
635}
636
diff --git a/arch/arm/mach-mxc91231/iomux.c b/arch/arm/mach-mxc91231/iomux.c
index 405d9b19d891..66fc41cbf2ca 100644
--- a/arch/arm/mach-mxc91231/iomux.c
+++ b/arch/arm/mach-mxc91231/iomux.c
@@ -50,7 +50,7 @@ unsigned long mxc_pin_alloc_map[NB_PORTS * 32 / BITS_PER_LONG];
50/* 50/*
51 * set the mode for a IOMUX pin. 51 * set the mode for a IOMUX pin.
52 */ 52 */
53int mxc_iomux_mode(const unsigned int pin_mode) 53int mxc_iomux_mode(unsigned int pin_mode)
54{ 54{
55 u32 side, field, l, mode, ret = 0; 55 u32 side, field, l, mode, ret = 0;
56 void __iomem *reg; 56 void __iomem *reg;
@@ -114,7 +114,7 @@ EXPORT_SYMBOL(mxc_iomux_set_pad);
114 * - reserves the pin so that it is not claimed by another driver 114 * - reserves the pin so that it is not claimed by another driver
115 * - setups the iomux according to the configuration 115 * - setups the iomux according to the configuration
116 */ 116 */
117int mxc_iomux_alloc_pin(const unsigned int pin_mode, const char *label) 117int mxc_iomux_alloc_pin(unsigned int pin_mode, const char *label)
118{ 118{
119 unsigned pad = PIN_GLOBAL_NUM(pin_mode); 119 unsigned pad = PIN_GLOBAL_NUM(pin_mode);
120 if (pad >= (PIN_MAX + 1)) { 120 if (pad >= (PIN_MAX + 1)) {
@@ -134,10 +134,10 @@ int mxc_iomux_alloc_pin(const unsigned int pin_mode, const char *label)
134} 134}
135EXPORT_SYMBOL(mxc_iomux_alloc_pin); 135EXPORT_SYMBOL(mxc_iomux_alloc_pin);
136 136
137int mxc_iomux_setup_multiple_pins(unsigned int *pin_list, unsigned count, 137int mxc_iomux_setup_multiple_pins(const unsigned int *pin_list, unsigned count,
138 const char *label) 138 const char *label)
139{ 139{
140 unsigned int *p = pin_list; 140 const unsigned int *p = pin_list;
141 int i; 141 int i;
142 int ret = -EINVAL; 142 int ret = -EINVAL;
143 143
@@ -155,7 +155,7 @@ setup_error:
155} 155}
156EXPORT_SYMBOL(mxc_iomux_setup_multiple_pins); 156EXPORT_SYMBOL(mxc_iomux_setup_multiple_pins);
157 157
158void mxc_iomux_release_pin(const unsigned int pin_mode) 158void mxc_iomux_release_pin(unsigned int pin_mode)
159{ 159{
160 unsigned pad = PIN_GLOBAL_NUM(pin_mode); 160 unsigned pad = PIN_GLOBAL_NUM(pin_mode);
161 161
@@ -164,9 +164,9 @@ void mxc_iomux_release_pin(const unsigned int pin_mode)
164} 164}
165EXPORT_SYMBOL(mxc_iomux_release_pin); 165EXPORT_SYMBOL(mxc_iomux_release_pin);
166 166
167void mxc_iomux_release_multiple_pins(unsigned int *pin_list, int count) 167void mxc_iomux_release_multiple_pins(const unsigned int *pin_list, int count)
168{ 168{
169 unsigned int *p = pin_list; 169 const unsigned int *p = pin_list;
170 int i; 170 int i;
171 171
172 for (i = 0; i < count; i++) { 172 for (i = 0; i < count; i++) {
diff --git a/arch/arm/mach-mxc91231/magx-zn5.c b/arch/arm/mach-mxc91231/magx-zn5.c
index 395d83be8c98..f31a45e5a0b8 100644
--- a/arch/arm/mach-mxc91231/magx-zn5.c
+++ b/arch/arm/mach-mxc91231/magx-zn5.c
@@ -53,9 +53,10 @@ struct sys_timer zn5_timer = {
53}; 53};
54 54
55MACHINE_START(MAGX_ZN5, "Motorola Zn5") 55MACHINE_START(MAGX_ZN5, "Motorola Zn5")
56 .boot_params = MXC91231_PHYS_OFFSET + 0x100, 56 .boot_params = MXC91231_PHYS_OFFSET + 0x100,
57 .map_io = mxc91231_map_io, 57 .map_io = mxc91231_map_io,
58 .init_irq = mxc91231_init_irq, 58 .init_early = mxc91231_init_early,
59 .timer = &zn5_timer, 59 .init_irq = mxc91231_init_irq,
60 .init_machine = zn5_init, 60 .timer = &zn5_timer,
61 .init_machine = zn5_init,
61MACHINE_END 62MACHINE_END
diff --git a/arch/arm/mach-mxc91231/mm.c b/arch/arm/mach-mxc91231/mm.c
index 7652c301da88..a77f6daf6a26 100644
--- a/arch/arm/mach-mxc91231/mm.c
+++ b/arch/arm/mach-mxc91231/mm.c
@@ -45,11 +45,14 @@ static struct map_desc mxc91231_io_desc[] __initdata = {
45 */ 45 */
46void __init mxc91231_map_io(void) 46void __init mxc91231_map_io(void)
47{ 47{
48 mxc_set_cpu_type(MXC_CPU_MXC91231);
49
50 iotable_init(mxc91231_io_desc, ARRAY_SIZE(mxc91231_io_desc)); 48 iotable_init(mxc91231_io_desc, ARRAY_SIZE(mxc91231_io_desc));
51} 49}
52 50
51void __init mxc91231_init_early(void)
52{
53 mxc_set_cpu_type(MXC_CPU_MXC91231);
54}
55
53int mxc91231_register_gpios(void); 56int mxc91231_register_gpios(void);
54 57
55void __init mxc91231_init_irq(void) 58void __init mxc91231_init_irq(void)
diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
index 8bfc8df54617..4f6f174af6c8 100644
--- a/arch/arm/mach-mxs/Kconfig
+++ b/arch/arm/mach-mxs/Kconfig
@@ -2,13 +2,18 @@ if ARCH_MXS
2 2
3source "arch/arm/mach-mxs/devices/Kconfig" 3source "arch/arm/mach-mxs/devices/Kconfig"
4 4
5config MXS_OCOTP
6 bool
7
5config SOC_IMX23 8config SOC_IMX23
6 bool 9 bool
7 select CPU_ARM926T 10 select CPU_ARM926T
11 select HAVE_PWM
8 12
9config SOC_IMX28 13config SOC_IMX28
10 bool 14 bool
11 select CPU_ARM926T 15 select CPU_ARM926T
16 select HAVE_PWM
12 17
13comment "MXS platforms:" 18comment "MXS platforms:"
14 19
@@ -16,6 +21,8 @@ config MACH_MX23EVK
16 bool "Support MX23EVK Platform" 21 bool "Support MX23EVK Platform"
17 select SOC_IMX23 22 select SOC_IMX23
18 select MXS_HAVE_AMBA_DUART 23 select MXS_HAVE_AMBA_DUART
24 select MXS_HAVE_PLATFORM_AUART
25 select MXS_HAVE_PLATFORM_MXSFB
19 default y 26 default y
20 help 27 help
21 Include support for MX23EVK platform. This includes specific 28 Include support for MX23EVK platform. This includes specific
@@ -25,10 +32,27 @@ config MACH_MX28EVK
25 bool "Support MX28EVK Platform" 32 bool "Support MX28EVK Platform"
26 select SOC_IMX28 33 select SOC_IMX28
27 select MXS_HAVE_AMBA_DUART 34 select MXS_HAVE_AMBA_DUART
35 select MXS_HAVE_PLATFORM_AUART
28 select MXS_HAVE_PLATFORM_FEC 36 select MXS_HAVE_PLATFORM_FEC
37 select MXS_HAVE_PLATFORM_FLEXCAN
38 select MXS_HAVE_PLATFORM_MXSFB
39 select MXS_OCOTP
29 default y 40 default y
30 help 41 help
31 Include support for MX28EVK platform. This includes specific 42 Include support for MX28EVK platform. This includes specific
32 configurations for the board and its peripherals. 43 configurations for the board and its peripherals.
33 44
45config MODULE_TX28
46 bool
47 select SOC_IMX28
48 select MXS_HAVE_AMBA_DUART
49 select MXS_HAVE_PLATFORM_AUART
50 select MXS_HAVE_PLATFORM_FEC
51 select MXS_HAVE_PLATFORM_MXS_I2C
52 select MXS_HAVE_PLATFORM_MXS_PWM
53
54config MACH_TX28
55 bool "Ka-Ro TX28 module"
56 select MODULE_TX28
57
34endif 58endif
diff --git a/arch/arm/mach-mxs/Makefile b/arch/arm/mach-mxs/Makefile
index 39d3f9c2a841..2f1f6141ca71 100644
--- a/arch/arm/mach-mxs/Makefile
+++ b/arch/arm/mach-mxs/Makefile
@@ -1,10 +1,15 @@
1# Common support 1# Common support
2obj-y := clock.o devices.o gpio.o icoll.o iomux.o system.o timer.o 2obj-y := clock.o devices.o gpio.o icoll.o iomux.o system.o timer.o
3 3
4obj-$(CONFIG_MXS_OCOTP) += ocotp.o
5obj-$(CONFIG_PM) += pm.o
6
4obj-$(CONFIG_SOC_IMX23) += clock-mx23.o mm-mx23.o 7obj-$(CONFIG_SOC_IMX23) += clock-mx23.o mm-mx23.o
5obj-$(CONFIG_SOC_IMX28) += clock-mx28.o mm-mx28.o 8obj-$(CONFIG_SOC_IMX28) += clock-mx28.o mm-mx28.o
6 9
7obj-$(CONFIG_MACH_MX23EVK) += mach-mx23evk.o 10obj-$(CONFIG_MACH_MX23EVK) += mach-mx23evk.o
8obj-$(CONFIG_MACH_MX28EVK) += mach-mx28evk.o 11obj-$(CONFIG_MACH_MX28EVK) += mach-mx28evk.o
12obj-$(CONFIG_MODULE_TX28) += module-tx28.o
13obj-$(CONFIG_MACH_TX28) += mach-tx28.o
9 14
10obj-y += devices/ 15obj-y += devices/
diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c
index b1a362ebfded..d133c7f30940 100644
--- a/arch/arm/mach-mxs/clock-mx23.c
+++ b/arch/arm/mach-mxs/clock-mx23.c
@@ -304,7 +304,7 @@ static int name##_set_rate(struct clk *clk, unsigned long rate) \
304 reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr); \ 304 reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr); \
305 reg &= ~BM_CLKCTRL_##dr##_DIV; \ 305 reg &= ~BM_CLKCTRL_##dr##_DIV; \
306 reg |= div << BP_CLKCTRL_##dr##_DIV; \ 306 reg |= div << BP_CLKCTRL_##dr##_DIV; \
307 if (reg | (1 << clk->enable_shift)) { \ 307 if (reg & (1 << clk->enable_shift)) { \
308 pr_err("%s: clock is gated\n", __func__); \ 308 pr_err("%s: clock is gated\n", __func__); \
309 return -EINVAL; \ 309 return -EINVAL; \
310 } \ 310 } \
@@ -347,7 +347,7 @@ static int name##_set_parent(struct clk *clk, struct clk *parent) \
347{ \ 347{ \
348 if (parent != clk->parent) { \ 348 if (parent != clk->parent) { \
349 __raw_writel(BM_CLKCTRL_CLKSEQ_BYPASS_##bit, \ 349 __raw_writel(BM_CLKCTRL_CLKSEQ_BYPASS_##bit, \
350 HW_CLKCTRL_CLKSEQ_TOG); \ 350 CLKCTRL_BASE_ADDR + HW_CLKCTRL_CLKSEQ_TOG); \
351 clk->parent = parent; \ 351 clk->parent = parent; \
352 } \ 352 } \
353 \ 353 \
@@ -442,11 +442,18 @@ static struct clk_lookup lookups[] = {
442 _REGISTER_CLOCK("duart", "apb_pclk", xbus_clk) 442 _REGISTER_CLOCK("duart", "apb_pclk", xbus_clk)
443 /* for amba-pl011 driver */ 443 /* for amba-pl011 driver */
444 _REGISTER_CLOCK("duart", NULL, uart_clk) 444 _REGISTER_CLOCK("duart", NULL, uart_clk)
445 _REGISTER_CLOCK("mxs-auart.0", NULL, uart_clk)
445 _REGISTER_CLOCK("rtc", NULL, rtc_clk) 446 _REGISTER_CLOCK("rtc", NULL, rtc_clk)
446 _REGISTER_CLOCK(NULL, "hclk", hbus_clk) 447 _REGISTER_CLOCK("mxs-dma-apbh", NULL, hbus_clk)
448 _REGISTER_CLOCK("mxs-dma-apbx", NULL, xbus_clk)
447 _REGISTER_CLOCK(NULL, "usb", usb_clk) 449 _REGISTER_CLOCK(NULL, "usb", usb_clk)
448 _REGISTER_CLOCK(NULL, "audio", audio_clk) 450 _REGISTER_CLOCK(NULL, "audio", audio_clk)
449 _REGISTER_CLOCK(NULL, "pwm", pwm_clk) 451 _REGISTER_CLOCK("mxs-pwm.0", NULL, pwm_clk)
452 _REGISTER_CLOCK("mxs-pwm.1", NULL, pwm_clk)
453 _REGISTER_CLOCK("mxs-pwm.2", NULL, pwm_clk)
454 _REGISTER_CLOCK("mxs-pwm.3", NULL, pwm_clk)
455 _REGISTER_CLOCK("mxs-pwm.4", NULL, pwm_clk)
456 _REGISTER_CLOCK("imx23-fb", NULL, lcdif_clk)
450}; 457};
451 458
452static int clk_misc_init(void) 459static int clk_misc_init(void)
diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
index 56312c092a9e..5e489a2b2023 100644
--- a/arch/arm/mach-mxs/clock-mx28.c
+++ b/arch/arm/mach-mxs/clock-mx28.c
@@ -355,12 +355,12 @@ static int name##_set_rate(struct clk *clk, unsigned long rate) \
355 } else { \ 355 } else { \
356 reg &= ~BM_CLKCTRL_##dr##_DIV; \ 356 reg &= ~BM_CLKCTRL_##dr##_DIV; \
357 reg |= div << BP_CLKCTRL_##dr##_DIV; \ 357 reg |= div << BP_CLKCTRL_##dr##_DIV; \
358 if (reg | (1 << clk->enable_shift)) { \ 358 if (reg & (1 << clk->enable_shift)) { \
359 pr_err("%s: clock is gated\n", __func__); \ 359 pr_err("%s: clock is gated\n", __func__); \
360 return -EINVAL; \ 360 return -EINVAL; \
361 } \ 361 } \
362 } \ 362 } \
363 __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_CPU); \ 363 __raw_writel(reg, CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr); \
364 \ 364 \
365 for (i = 10000; i; i--) \ 365 for (i = 10000; i; i--) \
366 if (!(__raw_readl(CLKCTRL_BASE_ADDR + \ 366 if (!(__raw_readl(CLKCTRL_BASE_ADDR + \
@@ -483,7 +483,7 @@ static int name##_set_parent(struct clk *clk, struct clk *parent) \
483{ \ 483{ \
484 if (parent != clk->parent) { \ 484 if (parent != clk->parent) { \
485 __raw_writel(BM_CLKCTRL_CLKSEQ_BYPASS_##bit, \ 485 __raw_writel(BM_CLKCTRL_CLKSEQ_BYPASS_##bit, \
486 HW_CLKCTRL_CLKSEQ_TOG); \ 486 CLKCTRL_BASE_ADDR + HW_CLKCTRL_CLKSEQ_TOG); \
487 clk->parent = parent; \ 487 clk->parent = parent; \
488 } \ 488 } \
489 \ 489 \
@@ -609,18 +609,30 @@ static struct clk_lookup lookups[] = {
609 _REGISTER_CLOCK("duart", NULL, uart_clk) 609 _REGISTER_CLOCK("duart", NULL, uart_clk)
610 _REGISTER_CLOCK("imx28-fec.0", NULL, fec_clk) 610 _REGISTER_CLOCK("imx28-fec.0", NULL, fec_clk)
611 _REGISTER_CLOCK("imx28-fec.1", NULL, fec_clk) 611 _REGISTER_CLOCK("imx28-fec.1", NULL, fec_clk)
612 _REGISTER_CLOCK("fec.0", NULL, fec_clk) 612 _REGISTER_CLOCK("mxs-auart.0", NULL, uart_clk)
613 _REGISTER_CLOCK("mxs-auart.1", NULL, uart_clk)
614 _REGISTER_CLOCK("mxs-auart.2", NULL, uart_clk)
615 _REGISTER_CLOCK("mxs-auart.3", NULL, uart_clk)
616 _REGISTER_CLOCK("mxs-auart.4", NULL, uart_clk)
613 _REGISTER_CLOCK("rtc", NULL, rtc_clk) 617 _REGISTER_CLOCK("rtc", NULL, rtc_clk)
614 _REGISTER_CLOCK("pll2", NULL, pll2_clk) 618 _REGISTER_CLOCK("pll2", NULL, pll2_clk)
615 _REGISTER_CLOCK(NULL, "hclk", hbus_clk) 619 _REGISTER_CLOCK("mxs-dma-apbh", NULL, hbus_clk)
616 _REGISTER_CLOCK(NULL, "xclk", xbus_clk) 620 _REGISTER_CLOCK("mxs-dma-apbx", NULL, xbus_clk)
617 _REGISTER_CLOCK(NULL, "can0", can0_clk) 621 _REGISTER_CLOCK("flexcan.0", NULL, can0_clk)
618 _REGISTER_CLOCK(NULL, "can1", can1_clk) 622 _REGISTER_CLOCK("flexcan.1", NULL, can1_clk)
619 _REGISTER_CLOCK(NULL, "usb0", usb0_clk) 623 _REGISTER_CLOCK(NULL, "usb0", usb0_clk)
620 _REGISTER_CLOCK(NULL, "usb1", usb1_clk) 624 _REGISTER_CLOCK(NULL, "usb1", usb1_clk)
621 _REGISTER_CLOCK(NULL, "pwm", pwm_clk) 625 _REGISTER_CLOCK("mxs-pwm.0", NULL, pwm_clk)
626 _REGISTER_CLOCK("mxs-pwm.1", NULL, pwm_clk)
627 _REGISTER_CLOCK("mxs-pwm.2", NULL, pwm_clk)
628 _REGISTER_CLOCK("mxs-pwm.3", NULL, pwm_clk)
629 _REGISTER_CLOCK("mxs-pwm.4", NULL, pwm_clk)
630 _REGISTER_CLOCK("mxs-pwm.5", NULL, pwm_clk)
631 _REGISTER_CLOCK("mxs-pwm.6", NULL, pwm_clk)
632 _REGISTER_CLOCK("mxs-pwm.7", NULL, pwm_clk)
622 _REGISTER_CLOCK(NULL, "lradc", lradc_clk) 633 _REGISTER_CLOCK(NULL, "lradc", lradc_clk)
623 _REGISTER_CLOCK(NULL, "spdif", spdif_clk) 634 _REGISTER_CLOCK(NULL, "spdif", spdif_clk)
635 _REGISTER_CLOCK("imx28-fb", NULL, lcdif_clk)
624}; 636};
625 637
626static int clk_misc_init(void) 638static int clk_misc_init(void)
@@ -738,6 +750,8 @@ int __init mx28_clocks_init(void)
738 clk_enable(&emi_clk); 750 clk_enable(&emi_clk);
739 clk_enable(&uart_clk); 751 clk_enable(&uart_clk);
740 752
753 clk_set_parent(&lcdif_clk, &ref_pix_clk);
754
741 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 755 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
742 756
743 mxs_timer_init(&clk32k_clk, MX28_INT_TIMER0); 757 mxs_timer_init(&clk32k_clk, MX28_INT_TIMER0);
diff --git a/arch/arm/mach-mxs/clock.c b/arch/arm/mach-mxs/clock.c
index e7d2269cf70e..a7093c88e6a6 100644
--- a/arch/arm/mach-mxs/clock.c
+++ b/arch/arm/mach-mxs/clock.c
@@ -57,7 +57,6 @@ static void __clk_disable(struct clk *clk)
57 if (clk->disable) 57 if (clk->disable)
58 clk->disable(clk); 58 clk->disable(clk);
59 __clk_disable(clk->parent); 59 __clk_disable(clk->parent);
60 __clk_disable(clk->secondary);
61 } 60 }
62} 61}
63 62
@@ -68,7 +67,6 @@ static int __clk_enable(struct clk *clk)
68 67
69 if (clk->usecount++ == 0) { 68 if (clk->usecount++ == 0) {
70 __clk_enable(clk->parent); 69 __clk_enable(clk->parent);
71 __clk_enable(clk->secondary);
72 70
73 if (clk->enable) 71 if (clk->enable)
74 clk->enable(clk); 72 clk->enable(clk);
diff --git a/arch/arm/mach-mxs/devices-mx23.h b/arch/arm/mach-mxs/devices-mx23.h
index 1256788561d0..c7e14f4e3669 100644
--- a/arch/arm/mach-mxs/devices-mx23.h
+++ b/arch/arm/mach-mxs/devices-mx23.h
@@ -10,7 +10,18 @@
10 */ 10 */
11#include <mach/mx23.h> 11#include <mach/mx23.h>
12#include <mach/devices-common.h> 12#include <mach/devices-common.h>
13#include <mach/mxsfb.h>
13 14
14extern const struct amba_device mx23_duart_device __initconst; 15extern const struct amba_device mx23_duart_device __initconst;
15#define mx23_add_duart() \ 16#define mx23_add_duart() \
16 mxs_add_duart(&mx23_duart_device) 17 mxs_add_duart(&mx23_duart_device)
18
19extern const struct mxs_auart_data mx23_auart_data[] __initconst;
20#define mx23_add_auart(id) mxs_add_auart(&mx23_auart_data[id])
21#define mx23_add_auart0() mx23_add_auart(0)
22#define mx23_add_auart1() mx23_add_auart(1)
23
24#define mx23_add_mxs_pwm(id) mxs_add_mxs_pwm(MX23_PWM_BASE_ADDR, id)
25
26struct platform_device *__init mx23_add_mxsfb(
27 const struct mxsfb_platform_data *pdata);
diff --git a/arch/arm/mach-mxs/devices-mx28.h b/arch/arm/mach-mxs/devices-mx28.h
index 33773a6333a2..9d08555c4cf0 100644
--- a/arch/arm/mach-mxs/devices-mx28.h
+++ b/arch/arm/mach-mxs/devices-mx28.h
@@ -10,11 +10,34 @@
10 */ 10 */
11#include <mach/mx28.h> 11#include <mach/mx28.h>
12#include <mach/devices-common.h> 12#include <mach/devices-common.h>
13#include <mach/mxsfb.h>
13 14
14extern const struct amba_device mx28_duart_device __initconst; 15extern const struct amba_device mx28_duart_device __initconst;
15#define mx28_add_duart() \ 16#define mx28_add_duart() \
16 mxs_add_duart(&mx28_duart_device) 17 mxs_add_duart(&mx28_duart_device)
17 18
19extern const struct mxs_auart_data mx28_auart_data[] __initconst;
20#define mx28_add_auart(id) mxs_add_auart(&mx28_auart_data[id])
21#define mx28_add_auart0() mx28_add_auart(0)
22#define mx28_add_auart1() mx28_add_auart(1)
23#define mx28_add_auart2() mx28_add_auart(2)
24#define mx28_add_auart3() mx28_add_auart(3)
25#define mx28_add_auart4() mx28_add_auart(4)
26
18extern const struct mxs_fec_data mx28_fec_data[] __initconst; 27extern const struct mxs_fec_data mx28_fec_data[] __initconst;
19#define mx28_add_fec(id, pdata) \ 28#define mx28_add_fec(id, pdata) \
20 mxs_add_fec(&mx28_fec_data[id], pdata) 29 mxs_add_fec(&mx28_fec_data[id], pdata)
30
31extern const struct mxs_flexcan_data mx28_flexcan_data[] __initconst;
32#define mx28_add_flexcan(id, pdata) \
33 mxs_add_flexcan(&mx28_flexcan_data[id], pdata)
34#define mx28_add_flexcan0(pdata) mx28_add_flexcan(0, pdata)
35#define mx28_add_flexcan1(pdata) mx28_add_flexcan(1, pdata)
36
37extern const struct mxs_i2c_data mx28_mxs_i2c_data[] __initconst;
38#define mx28_add_mxs_i2c(id) mxs_add_mxs_i2c(&mx28_mxs_i2c_data[id])
39
40#define mx28_add_mxs_pwm(id) mxs_add_mxs_pwm(MX28_PWM_BASE_ADDR, id)
41
42struct platform_device *__init mx28_add_mxsfb(
43 const struct mxsfb_platform_data *pdata);
diff --git a/arch/arm/mach-mxs/devices.c b/arch/arm/mach-mxs/devices.c
index c20d54740b0b..cfdb6b284702 100644
--- a/arch/arm/mach-mxs/devices.c
+++ b/arch/arm/mach-mxs/devices.c
@@ -66,6 +66,8 @@ struct platform_device *__init mxs_add_platform_device_dmamask(
66 ret = platform_device_add(pdev); 66 ret = platform_device_add(pdev);
67 if (ret) { 67 if (ret) {
68err: 68err:
69 if (dmamask)
70 kfree(pdev->dev.dma_mask);
69 platform_device_put(pdev); 71 platform_device_put(pdev);
70 return ERR_PTR(ret); 72 return ERR_PTR(ret);
71 } 73 }
diff --git a/arch/arm/mach-mxs/devices/Kconfig b/arch/arm/mach-mxs/devices/Kconfig
index cf7dc1ae575b..1451ad060d82 100644
--- a/arch/arm/mach-mxs/devices/Kconfig
+++ b/arch/arm/mach-mxs/devices/Kconfig
@@ -2,5 +2,21 @@ config MXS_HAVE_AMBA_DUART
2 bool 2 bool
3 select ARM_AMBA 3 select ARM_AMBA
4 4
5config MXS_HAVE_PLATFORM_AUART
6 bool
7
5config MXS_HAVE_PLATFORM_FEC 8config MXS_HAVE_PLATFORM_FEC
6 bool 9 bool
10
11config MXS_HAVE_PLATFORM_FLEXCAN
12 select HAVE_CAN_FLEXCAN if CAN
13 bool
14
15config MXS_HAVE_PLATFORM_MXS_I2C
16 bool
17
18config MXS_HAVE_PLATFORM_MXS_PWM
19 bool
20
21config MXS_HAVE_PLATFORM_MXSFB
22 bool
diff --git a/arch/arm/mach-mxs/devices/Makefile b/arch/arm/mach-mxs/devices/Makefile
index d0a09f6934b8..0d9bea30b0a2 100644
--- a/arch/arm/mach-mxs/devices/Makefile
+++ b/arch/arm/mach-mxs/devices/Makefile
@@ -1,2 +1,8 @@
1obj-$(CONFIG_MXS_HAVE_AMBA_DUART) += amba-duart.o 1obj-$(CONFIG_MXS_HAVE_AMBA_DUART) += amba-duart.o
2obj-$(CONFIG_MXS_HAVE_PLATFORM_AUART) += platform-auart.o
3obj-y += platform-dma.o
2obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o 4obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o
5obj-$(CONFIG_MXS_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o
6obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_I2C) += platform-mxs-i2c.o
7obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_PWM) += platform-mxs-pwm.o
8obj-$(CONFIG_MXS_HAVE_PLATFORM_MXSFB) += platform-mxsfb.o
diff --git a/arch/arm/mach-mxs/devices/platform-auart.c b/arch/arm/mach-mxs/devices/platform-auart.c
new file mode 100644
index 000000000000..796606cce0ce
--- /dev/null
+++ b/arch/arm/mach-mxs/devices/platform-auart.c
@@ -0,0 +1,64 @@
1/*
2 * Copyright (C) 2010 Pengutronix
3 * Sascha Hauer <s.hauer@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9#include <asm/sizes.h>
10#include <mach/mx23.h>
11#include <mach/mx28.h>
12#include <mach/devices-common.h>
13
14#define mxs_auart_data_entry_single(soc, _id, hwid) \
15 { \
16 .id = _id, \
17 .iobase = soc ## _AUART ## hwid ## _BASE_ADDR, \
18 .irq = soc ## _INT_AUART ## hwid, \
19 }
20
21#define mxs_auart_data_entry(soc, _id, hwid) \
22 [_id] = mxs_auart_data_entry_single(soc, _id, hwid)
23
24#ifdef CONFIG_SOC_IMX23
25const struct mxs_auart_data mx23_auart_data[] __initconst = {
26#define mx23_auart_data_entry(_id, hwid) \
27 mxs_auart_data_entry(MX23, _id, hwid)
28 mx23_auart_data_entry(0, 1),
29 mx23_auart_data_entry(1, 2),
30};
31#endif
32
33#ifdef CONFIG_SOC_IMX28
34const struct mxs_auart_data mx28_auart_data[] __initconst = {
35#define mx28_auart_data_entry(_id) \
36 mxs_auart_data_entry(MX28, _id, _id)
37 mx28_auart_data_entry(0),
38 mx28_auart_data_entry(1),
39 mx28_auart_data_entry(2),
40 mx28_auart_data_entry(3),
41 mx28_auart_data_entry(4),
42};
43#endif
44
45struct platform_device *__init mxs_add_auart(
46 const struct mxs_auart_data *data)
47{
48 struct resource res[] = {
49 {
50 .start = data->iobase,
51 .end = data->iobase + SZ_8K - 1,
52 .flags = IORESOURCE_MEM,
53 }, {
54 .start = data->irq,
55 .end = data->irq,
56 .flags = IORESOURCE_IRQ,
57 },
58 };
59
60 return mxs_add_platform_device_dmamask("mxs-auart", data->id,
61 res, ARRAY_SIZE(res), NULL, 0,
62 DMA_BIT_MASK(32));
63}
64
diff --git a/arch/arm/mach-mxs/devices/platform-dma.c b/arch/arm/mach-mxs/devices/platform-dma.c
new file mode 100644
index 000000000000..295c4424d5d9
--- /dev/null
+++ b/arch/arm/mach-mxs/devices/platform-dma.c
@@ -0,0 +1,49 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License version 2 as published by the
6 * Free Software Foundation.
7 */
8#include <linux/compiler.h>
9#include <linux/err.h>
10#include <linux/init.h>
11
12#include <mach/mx23.h>
13#include <mach/mx28.h>
14#include <mach/devices-common.h>
15
16static struct platform_device *__init mxs_add_dma(const char *devid,
17 resource_size_t base)
18{
19 struct resource res[] = {
20 {
21 .start = base,
22 .end = base + SZ_8K - 1,
23 .flags = IORESOURCE_MEM,
24 }
25 };
26
27 return mxs_add_platform_device_dmamask(devid, -1,
28 res, ARRAY_SIZE(res), NULL, 0,
29 DMA_BIT_MASK(32));
30}
31
32static int __init mxs_add_mxs_dma(void)
33{
34 char *apbh = "mxs-dma-apbh";
35 char *apbx = "mxs-dma-apbx";
36
37 if (cpu_is_mx23()) {
38 mxs_add_dma(apbh, MX23_APBH_DMA_BASE_ADDR);
39 mxs_add_dma(apbx, MX23_APBX_DMA_BASE_ADDR);
40 }
41
42 if (cpu_is_mx28()) {
43 mxs_add_dma(apbh, MX28_APBH_DMA_BASE_ADDR);
44 mxs_add_dma(apbx, MX28_APBX_DMA_BASE_ADDR);
45 }
46
47 return 0;
48}
49arch_initcall(mxs_add_mxs_dma);
diff --git a/arch/arm/mach-mxs/devices/platform-fec.c b/arch/arm/mach-mxs/devices/platform-fec.c
index c42dff72b46c..9859cf283335 100644
--- a/arch/arm/mach-mxs/devices/platform-fec.c
+++ b/arch/arm/mach-mxs/devices/platform-fec.c
@@ -45,6 +45,7 @@ struct platform_device *__init mxs_add_fec(
45 }, 45 },
46 }; 46 };
47 47
48 return mxs_add_platform_device("imx28-fec", data->id, 48 return mxs_add_platform_device_dmamask("imx28-fec", data->id,
49 res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); 49 res, ARRAY_SIZE(res), pdata, sizeof(*pdata),
50 DMA_BIT_MASK(32));
50} 51}
diff --git a/arch/arm/mach-mxs/devices/platform-flexcan.c b/arch/arm/mach-mxs/devices/platform-flexcan.c
new file mode 100644
index 000000000000..43a6b4bae6fe
--- /dev/null
+++ b/arch/arm/mach-mxs/devices/platform-flexcan.c
@@ -0,0 +1,51 @@
1/*
2 * Copyright (C) 2010, 2011 Pengutronix,
3 * Marc Kleine-Budde <kernel@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9#include <asm/sizes.h>
10#include <mach/mx28.h>
11#include <mach/devices-common.h>
12
13#define mxs_flexcan_data_entry_single(soc, _id, _hwid, _size) \
14 { \
15 .id = _id, \
16 .iobase = soc ## _CAN ## _hwid ## _BASE_ADDR, \
17 .iosize = _size, \
18 .irq = soc ## _INT_CAN ## _hwid, \
19 }
20
21#define mxs_flexcan_data_entry(soc, _id, _hwid, _size) \
22 [_id] = mxs_flexcan_data_entry_single(soc, _id, _hwid, _size)
23
24#ifdef CONFIG_SOC_IMX28
25const struct mxs_flexcan_data mx28_flexcan_data[] __initconst = {
26#define mx28_flexcan_data_entry(_id, _hwid) \
27 mxs_flexcan_data_entry_single(MX28, _id, _hwid, SZ_8K)
28 mx28_flexcan_data_entry(0, 0),
29 mx28_flexcan_data_entry(1, 1),
30};
31#endif /* ifdef CONFIG_SOC_IMX28 */
32
33struct platform_device *__init mxs_add_flexcan(
34 const struct mxs_flexcan_data *data,
35 const struct flexcan_platform_data *pdata)
36{
37 struct resource res[] = {
38 {
39 .start = data->iobase,
40 .end = data->iobase + data->iosize - 1,
41 .flags = IORESOURCE_MEM,
42 }, {
43 .start = data->irq,
44 .end = data->irq,
45 .flags = IORESOURCE_IRQ,
46 },
47 };
48
49 return mxs_add_platform_device("flexcan", data->id,
50 res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
51}
diff --git a/arch/arm/mach-mxs/devices/platform-mxs-i2c.c b/arch/arm/mach-mxs/devices/platform-mxs-i2c.c
new file mode 100644
index 000000000000..eab3a06836d6
--- /dev/null
+++ b/arch/arm/mach-mxs/devices/platform-mxs-i2c.c
@@ -0,0 +1,51 @@
1/*
2 * Copyright (C) 2011 Pengutronix
3 * Wolfram Sang <w.sang@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9#include <asm/sizes.h>
10#include <mach/mx28.h>
11#include <mach/devices-common.h>
12
13#define mxs_i2c_data_entry_single(soc, _id) \
14 { \
15 .id = _id, \
16 .iobase = soc ## _I2C ## _id ## _BASE_ADDR, \
17 .errirq = soc ## _INT_I2C ## _id ## _ERROR, \
18 .dmairq = soc ## _INT_I2C ## _id ## _DMA, \
19 }
20
21#define mxs_i2c_data_entry(soc, _id) \
22 [_id] = mxs_i2c_data_entry_single(soc, _id)
23
24#ifdef CONFIG_SOC_IMX28
25const struct mxs_i2c_data mx28_mxs_i2c_data[] __initconst = {
26 mxs_i2c_data_entry(MX28, 0),
27 mxs_i2c_data_entry(MX28, 1),
28};
29#endif
30
31struct platform_device *__init mxs_add_mxs_i2c(const struct mxs_i2c_data *data)
32{
33 struct resource res[] = {
34 {
35 .start = data->iobase,
36 .end = data->iobase + SZ_8K - 1,
37 .flags = IORESOURCE_MEM,
38 }, {
39 .start = data->errirq,
40 .end = data->errirq,
41 .flags = IORESOURCE_IRQ,
42 }, {
43 .start = data->dmairq,
44 .end = data->dmairq,
45 .flags = IORESOURCE_IRQ,
46 },
47 };
48
49 return mxs_add_platform_device("mxs-i2c", data->id, res,
50 ARRAY_SIZE(res), NULL, 0);
51}
diff --git a/arch/arm/mach-mxs/devices/platform-mxs-pwm.c b/arch/arm/mach-mxs/devices/platform-mxs-pwm.c
new file mode 100644
index 000000000000..680f5a902936
--- /dev/null
+++ b/arch/arm/mach-mxs/devices/platform-mxs-pwm.c
@@ -0,0 +1,22 @@
1/*
2 * Copyright (C) 2010 Pengutronix
3 * Sascha Hauer <s.hauer@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9#include <asm/sizes.h>
10#include <mach/devices-common.h>
11
12struct platform_device *__init mxs_add_mxs_pwm(resource_size_t iobase, int id)
13{
14 struct resource res = {
15 .flags = IORESOURCE_MEM,
16 };
17
18 res.start = iobase + 0x10 + 0x20 * id;
19 res.end = res.start + 0x1f;
20
21 return mxs_add_platform_device("mxs-pwm", id, &res, 1, NULL, 0);
22}
diff --git a/arch/arm/mach-mxs/devices/platform-mxsfb.c b/arch/arm/mach-mxs/devices/platform-mxsfb.c
new file mode 100644
index 000000000000..bf72c9b8dbdd
--- /dev/null
+++ b/arch/arm/mach-mxs/devices/platform-mxsfb.c
@@ -0,0 +1,46 @@
1/*
2 * Copyright (C) 2011 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
3 *
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License version 2 as published by the
6 * Free Software Foundation.
7 */
8#include <asm/sizes.h>
9#include <mach/mx23.h>
10#include <mach/mx28.h>
11#include <mach/devices-common.h>
12#include <mach/mxsfb.h>
13
14#ifdef CONFIG_SOC_IMX23
15struct platform_device *__init mx23_add_mxsfb(
16 const struct mxsfb_platform_data *pdata)
17{
18 struct resource res[] = {
19 {
20 .start = MX23_LCDIF_BASE_ADDR,
21 .end = MX23_LCDIF_BASE_ADDR + SZ_8K - 1,
22 .flags = IORESOURCE_MEM,
23 },
24 };
25
26 return mxs_add_platform_device_dmamask("imx23-fb", -1,
27 res, ARRAY_SIZE(res), pdata, sizeof(*pdata), DMA_BIT_MASK(32));
28}
29#endif /* ifdef CONFIG_SOC_IMX23 */
30
31#ifdef CONFIG_SOC_IMX28
32struct platform_device *__init mx28_add_mxsfb(
33 const struct mxsfb_platform_data *pdata)
34{
35 struct resource res[] = {
36 {
37 .start = MX28_LCDIF_BASE_ADDR,
38 .end = MX28_LCDIF_BASE_ADDR + SZ_8K - 1,
39 .flags = IORESOURCE_MEM,
40 },
41 };
42
43 return mxs_add_platform_device_dmamask("imx28-fb", -1,
44 res, ARRAY_SIZE(res), pdata, sizeof(*pdata), DMA_BIT_MASK(32));
45}
46#endif /* ifdef CONFIG_SOC_IMX28 */
diff --git a/arch/arm/mach-mxs/gpio.c b/arch/arm/mach-mxs/gpio.c
index d7ad7a61366d..56fa2ed15222 100644
--- a/arch/arm/mach-mxs/gpio.c
+++ b/arch/arm/mach-mxs/gpio.c
@@ -68,29 +68,29 @@ static void set_gpio_irqenable(struct mxs_gpio_port *port, u32 index,
68 } 68 }
69} 69}
70 70
71static void mxs_gpio_ack_irq(u32 irq) 71static void mxs_gpio_ack_irq(struct irq_data *d)
72{ 72{
73 u32 gpio = irq_to_gpio(irq); 73 u32 gpio = irq_to_gpio(d->irq);
74 clear_gpio_irqstatus(&mxs_gpio_ports[gpio / 32], gpio & 0x1f); 74 clear_gpio_irqstatus(&mxs_gpio_ports[gpio / 32], gpio & 0x1f);
75} 75}
76 76
77static void mxs_gpio_mask_irq(u32 irq) 77static void mxs_gpio_mask_irq(struct irq_data *d)
78{ 78{
79 u32 gpio = irq_to_gpio(irq); 79 u32 gpio = irq_to_gpio(d->irq);
80 set_gpio_irqenable(&mxs_gpio_ports[gpio / 32], gpio & 0x1f, 0); 80 set_gpio_irqenable(&mxs_gpio_ports[gpio / 32], gpio & 0x1f, 0);
81} 81}
82 82
83static void mxs_gpio_unmask_irq(u32 irq) 83static void mxs_gpio_unmask_irq(struct irq_data *d)
84{ 84{
85 u32 gpio = irq_to_gpio(irq); 85 u32 gpio = irq_to_gpio(d->irq);
86 set_gpio_irqenable(&mxs_gpio_ports[gpio / 32], gpio & 0x1f, 1); 86 set_gpio_irqenable(&mxs_gpio_ports[gpio / 32], gpio & 0x1f, 1);
87} 87}
88 88
89static int mxs_gpio_get(struct gpio_chip *chip, unsigned offset); 89static int mxs_gpio_get(struct gpio_chip *chip, unsigned offset);
90 90
91static int mxs_gpio_set_irq_type(u32 irq, u32 type) 91static int mxs_gpio_set_irq_type(struct irq_data *d, unsigned int type)
92{ 92{
93 u32 gpio = irq_to_gpio(irq); 93 u32 gpio = irq_to_gpio(d->irq);
94 u32 pin_mask = 1 << (gpio & 31); 94 u32 pin_mask = 1 << (gpio & 31);
95 struct mxs_gpio_port *port = &mxs_gpio_ports[gpio / 32]; 95 struct mxs_gpio_port *port = &mxs_gpio_ports[gpio / 32];
96 void __iomem *pin_addr; 96 void __iomem *pin_addr;
@@ -139,6 +139,8 @@ static void mxs_gpio_irq_handler(u32 irq, struct irq_desc *desc)
139 struct mxs_gpio_port *port = (struct mxs_gpio_port *)get_irq_data(irq); 139 struct mxs_gpio_port *port = (struct mxs_gpio_port *)get_irq_data(irq);
140 u32 gpio_irq_no_base = port->virtual_irq_start; 140 u32 gpio_irq_no_base = port->virtual_irq_start;
141 141
142 desc->irq_data.chip->irq_ack(&desc->irq_data);
143
142 irq_stat = __raw_readl(port->base + PINCTRL_IRQSTAT(port->id)) & 144 irq_stat = __raw_readl(port->base + PINCTRL_IRQSTAT(port->id)) &
143 __raw_readl(port->base + PINCTRL_IRQEN(port->id)); 145 __raw_readl(port->base + PINCTRL_IRQEN(port->id));
144 146
@@ -158,9 +160,9 @@ static void mxs_gpio_irq_handler(u32 irq, struct irq_desc *desc)
158 * @param enable enable as wake-up if equal to non-zero 160 * @param enable enable as wake-up if equal to non-zero
159 * @return This function returns 0 on success. 161 * @return This function returns 0 on success.
160 */ 162 */
161static int mxs_gpio_set_wake_irq(u32 irq, u32 enable) 163static int mxs_gpio_set_wake_irq(struct irq_data *d, unsigned int enable)
162{ 164{
163 u32 gpio = irq_to_gpio(irq); 165 u32 gpio = irq_to_gpio(d->irq);
164 u32 gpio_idx = gpio & 0x1f; 166 u32 gpio_idx = gpio & 0x1f;
165 struct mxs_gpio_port *port = &mxs_gpio_ports[gpio / 32]; 167 struct mxs_gpio_port *port = &mxs_gpio_ports[gpio / 32];
166 168
@@ -180,11 +182,12 @@ static int mxs_gpio_set_wake_irq(u32 irq, u32 enable)
180} 182}
181 183
182static struct irq_chip gpio_irq_chip = { 184static struct irq_chip gpio_irq_chip = {
183 .ack = mxs_gpio_ack_irq, 185 .name = "mxs gpio",
184 .mask = mxs_gpio_mask_irq, 186 .irq_ack = mxs_gpio_ack_irq,
185 .unmask = mxs_gpio_unmask_irq, 187 .irq_mask = mxs_gpio_mask_irq,
186 .set_type = mxs_gpio_set_irq_type, 188 .irq_unmask = mxs_gpio_unmask_irq,
187 .set_wake = mxs_gpio_set_wake_irq, 189 .irq_set_type = mxs_gpio_set_irq_type,
190 .irq_set_wake = mxs_gpio_set_wake_irq,
188}; 191};
189 192
190static void mxs_set_gpio_direction(struct gpio_chip *chip, unsigned offset, 193static void mxs_set_gpio_direction(struct gpio_chip *chip, unsigned offset,
@@ -287,39 +290,42 @@ int __init mxs_gpio_init(struct mxs_gpio_port *port, int cnt)
287 return 0; 290 return 0;
288} 291}
289 292
290#define DEFINE_MXS_GPIO_PORT(soc, _id) \ 293#define MX23_GPIO_BASE MX23_IO_ADDRESS(MX23_PINCTRL_BASE_ADDR)
294#define MX28_GPIO_BASE MX28_IO_ADDRESS(MX28_PINCTRL_BASE_ADDR)
295
296#define DEFINE_MXS_GPIO_PORT(_base, _irq, _id) \
291 { \ 297 { \
292 .chip.label = "gpio-" #_id, \ 298 .chip.label = "gpio-" #_id, \
293 .id = _id, \ 299 .id = _id, \
294 .irq = soc ## _INT_GPIO ## _id, \ 300 .irq = _irq, \
295 .base = soc ## _IO_ADDRESS( \ 301 .base = _base, \
296 soc ## _PINCTRL ## _BASE_ADDR), \
297 .virtual_irq_start = MXS_GPIO_IRQ_START + (_id) * 32, \ 302 .virtual_irq_start = MXS_GPIO_IRQ_START + (_id) * 32, \
298 } 303 }
299 304
300#define DEFINE_REGISTER_FUNCTION(prefix) \
301int __init prefix ## _register_gpios(void) \
302{ \
303 return mxs_gpio_init(prefix ## _gpio_ports, \
304 ARRAY_SIZE(prefix ## _gpio_ports)); \
305}
306
307#ifdef CONFIG_SOC_IMX23 305#ifdef CONFIG_SOC_IMX23
308static struct mxs_gpio_port mx23_gpio_ports[] = { 306static struct mxs_gpio_port mx23_gpio_ports[] = {
309 DEFINE_MXS_GPIO_PORT(MX23, 0), 307 DEFINE_MXS_GPIO_PORT(MX23_GPIO_BASE, MX23_INT_GPIO0, 0),
310 DEFINE_MXS_GPIO_PORT(MX23, 1), 308 DEFINE_MXS_GPIO_PORT(MX23_GPIO_BASE, MX23_INT_GPIO1, 1),
311 DEFINE_MXS_GPIO_PORT(MX23, 2), 309 DEFINE_MXS_GPIO_PORT(MX23_GPIO_BASE, MX23_INT_GPIO2, 2),
312}; 310};
313DEFINE_REGISTER_FUNCTION(mx23) 311
312int __init mx23_register_gpios(void)
313{
314 return mxs_gpio_init(mx23_gpio_ports, ARRAY_SIZE(mx23_gpio_ports));
315}
314#endif 316#endif
315 317
316#ifdef CONFIG_SOC_IMX28 318#ifdef CONFIG_SOC_IMX28
317static struct mxs_gpio_port mx28_gpio_ports[] = { 319static struct mxs_gpio_port mx28_gpio_ports[] = {
318 DEFINE_MXS_GPIO_PORT(MX28, 0), 320 DEFINE_MXS_GPIO_PORT(MX28_GPIO_BASE, MX28_INT_GPIO0, 0),
319 DEFINE_MXS_GPIO_PORT(MX28, 1), 321 DEFINE_MXS_GPIO_PORT(MX28_GPIO_BASE, MX28_INT_GPIO1, 1),
320 DEFINE_MXS_GPIO_PORT(MX28, 2), 322 DEFINE_MXS_GPIO_PORT(MX28_GPIO_BASE, MX28_INT_GPIO2, 2),
321 DEFINE_MXS_GPIO_PORT(MX28, 3), 323 DEFINE_MXS_GPIO_PORT(MX28_GPIO_BASE, MX28_INT_GPIO3, 3),
322 DEFINE_MXS_GPIO_PORT(MX28, 4), 324 DEFINE_MXS_GPIO_PORT(MX28_GPIO_BASE, MX28_INT_GPIO4, 4),
323}; 325};
324DEFINE_REGISTER_FUNCTION(mx28) 326
327int __init mx28_register_gpios(void)
328{
329 return mxs_gpio_init(mx28_gpio_ports, ARRAY_SIZE(mx28_gpio_ports));
330}
325#endif 331#endif
diff --git a/arch/arm/mach-mxs/icoll.c b/arch/arm/mach-mxs/icoll.c
index 5dd43ba70058..0f4c120fc169 100644
--- a/arch/arm/mach-mxs/icoll.c
+++ b/arch/arm/mach-mxs/icoll.c
@@ -34,7 +34,7 @@
34 34
35static void __iomem *icoll_base = MXS_IO_ADDRESS(MXS_ICOLL_BASE_ADDR); 35static void __iomem *icoll_base = MXS_IO_ADDRESS(MXS_ICOLL_BASE_ADDR);
36 36
37static void icoll_ack_irq(unsigned int irq) 37static void icoll_ack_irq(struct irq_data *d)
38{ 38{
39 /* 39 /*
40 * The Interrupt Collector is able to prioritize irqs. 40 * The Interrupt Collector is able to prioritize irqs.
@@ -45,22 +45,22 @@ static void icoll_ack_irq(unsigned int irq)
45 icoll_base + HW_ICOLL_LEVELACK); 45 icoll_base + HW_ICOLL_LEVELACK);
46} 46}
47 47
48static void icoll_mask_irq(unsigned int irq) 48static void icoll_mask_irq(struct irq_data *d)
49{ 49{
50 __raw_writel(BM_ICOLL_INTERRUPTn_ENABLE, 50 __raw_writel(BM_ICOLL_INTERRUPTn_ENABLE,
51 icoll_base + HW_ICOLL_INTERRUPTn_CLR(irq)); 51 icoll_base + HW_ICOLL_INTERRUPTn_CLR(d->irq));
52} 52}
53 53
54static void icoll_unmask_irq(unsigned int irq) 54static void icoll_unmask_irq(struct irq_data *d)
55{ 55{
56 __raw_writel(BM_ICOLL_INTERRUPTn_ENABLE, 56 __raw_writel(BM_ICOLL_INTERRUPTn_ENABLE,
57 icoll_base + HW_ICOLL_INTERRUPTn_SET(irq)); 57 icoll_base + HW_ICOLL_INTERRUPTn_SET(d->irq));
58} 58}
59 59
60static struct irq_chip mxs_icoll_chip = { 60static struct irq_chip mxs_icoll_chip = {
61 .ack = icoll_ack_irq, 61 .irq_ack = icoll_ack_irq,
62 .mask = icoll_mask_irq, 62 .irq_mask = icoll_mask_irq,
63 .unmask = icoll_unmask_irq, 63 .irq_unmask = icoll_unmask_irq,
64}; 64};
65 65
66void __init icoll_init_irq(void) 66void __init icoll_init_irq(void)
diff --git a/arch/arm/mach-mxs/include/mach/clock.h b/arch/arm/mach-mxs/include/mach/clock.h
index 041e276d8a32..592c9ab5d760 100644
--- a/arch/arm/mach-mxs/include/mach/clock.h
+++ b/arch/arm/mach-mxs/include/mach/clock.h
@@ -29,8 +29,6 @@ struct clk {
29 int id; 29 int id;
30 /* Source clock this clk depends on */ 30 /* Source clock this clk depends on */
31 struct clk *parent; 31 struct clk *parent;
32 /* Secondary clock to enable/disable with this clock */
33 struct clk *secondary;
34 /* Reference count of clock enable/disable */ 32 /* Reference count of clock enable/disable */
35 __s8 usecount; 33 __s8 usecount;
36 /* Register bit position for clock's enable/disable control. */ 34 /* Register bit position for clock's enable/disable control. */
diff --git a/arch/arm/mach-mxs/include/mach/common.h b/arch/arm/mach-mxs/include/mach/common.h
index 59133eb3cc96..635bb5d9a20a 100644
--- a/arch/arm/mach-mxs/include/mach/common.h
+++ b/arch/arm/mach-mxs/include/mach/common.h
@@ -13,6 +13,7 @@
13 13
14struct clk; 14struct clk;
15 15
16extern const u32 *mxs_get_ocotp(void);
16extern int mxs_reset_block(void __iomem *); 17extern int mxs_reset_block(void __iomem *);
17extern void mxs_timer_init(struct clk *, int); 18extern void mxs_timer_init(struct clk *, int);
18 19
diff --git a/arch/arm/mach-mxs/include/mach/devices-common.h b/arch/arm/mach-mxs/include/mach/devices-common.h
index 6c3d1a103433..71f24484b044 100644
--- a/arch/arm/mach-mxs/include/mach/devices-common.h
+++ b/arch/arm/mach-mxs/include/mach/devices-common.h
@@ -30,6 +30,16 @@ int __init mxs_add_amba_device(const struct amba_device *dev);
30/* duart */ 30/* duart */
31int __init mxs_add_duart(const struct amba_device *dev); 31int __init mxs_add_duart(const struct amba_device *dev);
32 32
33/* auart */
34struct mxs_auart_data {
35 int id;
36 resource_size_t iobase;
37 resource_size_t iosize;
38 resource_size_t irq;
39};
40struct platform_device *__init mxs_add_auart(
41 const struct mxs_auart_data *data);
42
33/* fec */ 43/* fec */
34#include <linux/fec.h> 44#include <linux/fec.h>
35struct mxs_fec_data { 45struct mxs_fec_data {
@@ -41,3 +51,28 @@ struct mxs_fec_data {
41struct platform_device *__init mxs_add_fec( 51struct platform_device *__init mxs_add_fec(
42 const struct mxs_fec_data *data, 52 const struct mxs_fec_data *data,
43 const struct fec_platform_data *pdata); 53 const struct fec_platform_data *pdata);
54
55/* flexcan */
56#include <linux/can/platform/flexcan.h>
57struct mxs_flexcan_data {
58 int id;
59 resource_size_t iobase;
60 resource_size_t iosize;
61 resource_size_t irq;
62};
63struct platform_device *__init mxs_add_flexcan(
64 const struct mxs_flexcan_data *data,
65 const struct flexcan_platform_data *pdata);
66
67/* i2c */
68struct mxs_i2c_data {
69 int id;
70 resource_size_t iobase;
71 resource_size_t errirq;
72 resource_size_t dmairq;
73};
74struct platform_device * __init mxs_add_mxs_i2c(const struct mxs_i2c_data *data);
75
76/* pwm */
77struct platform_device *__init mxs_add_mxs_pwm(
78 resource_size_t iobase, int id);
diff --git a/arch/arm/mach-mxs/include/mach/dma.h b/arch/arm/mach-mxs/include/mach/dma.h
new file mode 100644
index 000000000000..7f4aeeaba8df
--- /dev/null
+++ b/arch/arm/mach-mxs/include/mach/dma.h
@@ -0,0 +1,26 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __MACH_MXS_DMA_H__
10#define __MACH_MXS_DMA_H__
11
12struct mxs_dma_data {
13 int chan_irq;
14};
15
16static inline int mxs_dma_is_apbh(struct dma_chan *chan)
17{
18 return !strcmp(dev_name(chan->device->dev), "mxs-dma-apbh");
19}
20
21static inline int mxs_dma_is_apbx(struct dma_chan *chan)
22{
23 return !strcmp(dev_name(chan->device->dev), "mxs-dma-apbx");
24}
25
26#endif /* __MACH_MXS_DMA_H__ */
diff --git a/arch/arm/mach-mxs/include/mach/iomux-mx23.h b/arch/arm/mach-mxs/include/mach/iomux-mx23.h
index 94e5dd83cdb8..b0190a4822f2 100644
--- a/arch/arm/mach-mxs/include/mach/iomux-mx23.h
+++ b/arch/arm/mach-mxs/include/mach/iomux-mx23.h
@@ -254,102 +254,102 @@
254#define MX23_PAD_ROTARYB__GPMI_CE3N MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_2) 254#define MX23_PAD_ROTARYB__GPMI_CE3N MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_2)
255 255
256/* MUXSEL_GPIO */ 256/* MUXSEL_GPIO */
257#define MX23_PAD_GPMI_D00__GPO_0_0 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_GPIO) 257#define MX23_PAD_GPMI_D00__GPIO_0_0 MXS_IOMUX_PAD_NAKED(0, 0, PAD_MUXSEL_GPIO)
258#define MX23_PAD_GPMI_D01__GPO_0_1 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_GPIO) 258#define MX23_PAD_GPMI_D01__GPIO_0_1 MXS_IOMUX_PAD_NAKED(0, 1, PAD_MUXSEL_GPIO)
259#define MX23_PAD_GPMI_D02__GPO_0_2 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_GPIO) 259#define MX23_PAD_GPMI_D02__GPIO_0_2 MXS_IOMUX_PAD_NAKED(0, 2, PAD_MUXSEL_GPIO)
260#define MX23_PAD_GPMI_D03__GPO_0_3 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_GPIO) 260#define MX23_PAD_GPMI_D03__GPIO_0_3 MXS_IOMUX_PAD_NAKED(0, 3, PAD_MUXSEL_GPIO)
261#define MX23_PAD_GPMI_D04__GPO_0_4 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_GPIO) 261#define MX23_PAD_GPMI_D04__GPIO_0_4 MXS_IOMUX_PAD_NAKED(0, 4, PAD_MUXSEL_GPIO)
262#define MX23_PAD_GPMI_D05__GPO_0_5 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_GPIO) 262#define MX23_PAD_GPMI_D05__GPIO_0_5 MXS_IOMUX_PAD_NAKED(0, 5, PAD_MUXSEL_GPIO)
263#define MX23_PAD_GPMI_D06__GPO_0_6 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_GPIO) 263#define MX23_PAD_GPMI_D06__GPIO_0_6 MXS_IOMUX_PAD_NAKED(0, 6, PAD_MUXSEL_GPIO)
264#define MX23_PAD_GPMI_D07__GPO_0_7 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_GPIO) 264#define MX23_PAD_GPMI_D07__GPIO_0_7 MXS_IOMUX_PAD_NAKED(0, 7, PAD_MUXSEL_GPIO)
265#define MX23_PAD_GPMI_D08__GPO_0_8 MXS_IOMUX_PAD_NAKED(0, 8, PAD_MUXSEL_GPIO) 265#define MX23_PAD_GPMI_D08__GPIO_0_8 MXS_IOMUX_PAD_NAKED(0, 8, PAD_MUXSEL_GPIO)
266#define MX23_PAD_GPMI_D09__GPO_0_9 MXS_IOMUX_PAD_NAKED(0, 9, PAD_MUXSEL_GPIO) 266#define MX23_PAD_GPMI_D09__GPIO_0_9 MXS_IOMUX_PAD_NAKED(0, 9, PAD_MUXSEL_GPIO)
267#define MX23_PAD_GPMI_D10__GPO_0_10 MXS_IOMUX_PAD_NAKED(0, 10, PAD_MUXSEL_GPIO) 267#define MX23_PAD_GPMI_D10__GPIO_0_10 MXS_IOMUX_PAD_NAKED(0, 10, PAD_MUXSEL_GPIO)
268#define MX23_PAD_GPMI_D11__GPO_0_11 MXS_IOMUX_PAD_NAKED(0, 11, PAD_MUXSEL_GPIO) 268#define MX23_PAD_GPMI_D11__GPIO_0_11 MXS_IOMUX_PAD_NAKED(0, 11, PAD_MUXSEL_GPIO)
269#define MX23_PAD_GPMI_D12__GPO_0_12 MXS_IOMUX_PAD_NAKED(0, 12, PAD_MUXSEL_GPIO) 269#define MX23_PAD_GPMI_D12__GPIO_0_12 MXS_IOMUX_PAD_NAKED(0, 12, PAD_MUXSEL_GPIO)
270#define MX23_PAD_GPMI_D13__GPO_0_13 MXS_IOMUX_PAD_NAKED(0, 13, PAD_MUXSEL_GPIO) 270#define MX23_PAD_GPMI_D13__GPIO_0_13 MXS_IOMUX_PAD_NAKED(0, 13, PAD_MUXSEL_GPIO)
271#define MX23_PAD_GPMI_D14__GPO_0_14 MXS_IOMUX_PAD_NAKED(0, 14, PAD_MUXSEL_GPIO) 271#define MX23_PAD_GPMI_D14__GPIO_0_14 MXS_IOMUX_PAD_NAKED(0, 14, PAD_MUXSEL_GPIO)
272#define MX23_PAD_GPMI_D15__GPO_0_15 MXS_IOMUX_PAD_NAKED(0, 15, PAD_MUXSEL_GPIO) 272#define MX23_PAD_GPMI_D15__GPIO_0_15 MXS_IOMUX_PAD_NAKED(0, 15, PAD_MUXSEL_GPIO)
273#define MX23_PAD_GPMI_CLE__GPO_0_16 MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_GPIO) 273#define MX23_PAD_GPMI_CLE__GPIO_0_16 MXS_IOMUX_PAD_NAKED(0, 16, PAD_MUXSEL_GPIO)
274#define MX23_PAD_GPMI_ALE__GPO_0_17 MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_GPIO) 274#define MX23_PAD_GPMI_ALE__GPIO_0_17 MXS_IOMUX_PAD_NAKED(0, 17, PAD_MUXSEL_GPIO)
275#define MX23_PAD_GPMI_CE2N__GPO_0_18 MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_GPIO) 275#define MX23_PAD_GPMI_CE2N__GPIO_0_18 MXS_IOMUX_PAD_NAKED(0, 18, PAD_MUXSEL_GPIO)
276#define MX23_PAD_GPMI_RDY0__GPO_0_19 MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_GPIO) 276#define MX23_PAD_GPMI_RDY0__GPIO_0_19 MXS_IOMUX_PAD_NAKED(0, 19, PAD_MUXSEL_GPIO)
277#define MX23_PAD_GPMI_RDY1__GPO_0_20 MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_GPIO) 277#define MX23_PAD_GPMI_RDY1__GPIO_0_20 MXS_IOMUX_PAD_NAKED(0, 20, PAD_MUXSEL_GPIO)
278#define MX23_PAD_GPMI_RDY2__GPO_0_21 MXS_IOMUX_PAD_NAKED(0, 21, PAD_MUXSEL_GPIO) 278#define MX23_PAD_GPMI_RDY2__GPIO_0_21 MXS_IOMUX_PAD_NAKED(0, 21, PAD_MUXSEL_GPIO)
279#define MX23_PAD_GPMI_RDY3__GPO_0_22 MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_GPIO) 279#define MX23_PAD_GPMI_RDY3__GPIO_0_22 MXS_IOMUX_PAD_NAKED(0, 22, PAD_MUXSEL_GPIO)
280#define MX23_PAD_GPMI_WPN__GPO_0_23 MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_GPIO) 280#define MX23_PAD_GPMI_WPN__GPIO_0_23 MXS_IOMUX_PAD_NAKED(0, 23, PAD_MUXSEL_GPIO)
281#define MX23_PAD_GPMI_WRN__GPO_0_24 MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_GPIO) 281#define MX23_PAD_GPMI_WRN__GPIO_0_24 MXS_IOMUX_PAD_NAKED(0, 24, PAD_MUXSEL_GPIO)
282#define MX23_PAD_GPMI_RDN__GPO_0_25 MXS_IOMUX_PAD_NAKED(0, 25, PAD_MUXSEL_GPIO) 282#define MX23_PAD_GPMI_RDN__GPIO_0_25 MXS_IOMUX_PAD_NAKED(0, 25, PAD_MUXSEL_GPIO)
283#define MX23_PAD_AUART1_CTS__GPO_0_26 MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_GPIO) 283#define MX23_PAD_AUART1_CTS__GPIO_0_26 MXS_IOMUX_PAD_NAKED(0, 26, PAD_MUXSEL_GPIO)
284#define MX23_PAD_AUART1_RTS__GPO_0_27 MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_GPIO) 284#define MX23_PAD_AUART1_RTS__GPIO_0_27 MXS_IOMUX_PAD_NAKED(0, 27, PAD_MUXSEL_GPIO)
285#define MX23_PAD_AUART1_RX__GPO_0_28 MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_GPIO) 285#define MX23_PAD_AUART1_RX__GPIO_0_28 MXS_IOMUX_PAD_NAKED(0, 28, PAD_MUXSEL_GPIO)
286#define MX23_PAD_AUART1_TX__GPO_0_29 MXS_IOMUX_PAD_NAKED(0, 29, PAD_MUXSEL_GPIO) 286#define MX23_PAD_AUART1_TX__GPIO_0_29 MXS_IOMUX_PAD_NAKED(0, 29, PAD_MUXSEL_GPIO)
287#define MX23_PAD_I2C_SCL__GPO_0_30 MXS_IOMUX_PAD_NAKED(0, 30, PAD_MUXSEL_GPIO) 287#define MX23_PAD_I2C_SCL__GPIO_0_30 MXS_IOMUX_PAD_NAKED(0, 30, PAD_MUXSEL_GPIO)
288#define MX23_PAD_I2C_SDA__GPO_0_31 MXS_IOMUX_PAD_NAKED(0, 31, PAD_MUXSEL_GPIO) 288#define MX23_PAD_I2C_SDA__GPIO_0_31 MXS_IOMUX_PAD_NAKED(0, 31, PAD_MUXSEL_GPIO)
289 289
290#define MX23_PAD_LCD_D00__GPO_1_0 MXS_IOMUX_PAD_NAKED(1, 0, PAD_MUXSEL_GPIO) 290#define MX23_PAD_LCD_D00__GPIO_1_0 MXS_IOMUX_PAD_NAKED(1, 0, PAD_MUXSEL_GPIO)
291#define MX23_PAD_LCD_D01__GPO_1_1 MXS_IOMUX_PAD_NAKED(1, 1, PAD_MUXSEL_GPIO) 291#define MX23_PAD_LCD_D01__GPIO_1_1 MXS_IOMUX_PAD_NAKED(1, 1, PAD_MUXSEL_GPIO)
292#define MX23_PAD_LCD_D02__GPO_1_2 MXS_IOMUX_PAD_NAKED(1, 2, PAD_MUXSEL_GPIO) 292#define MX23_PAD_LCD_D02__GPIO_1_2 MXS_IOMUX_PAD_NAKED(1, 2, PAD_MUXSEL_GPIO)
293#define MX23_PAD_LCD_D03__GPO_1_3 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_GPIO) 293#define MX23_PAD_LCD_D03__GPIO_1_3 MXS_IOMUX_PAD_NAKED(1, 3, PAD_MUXSEL_GPIO)
294#define MX23_PAD_LCD_D04__GPO_1_4 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_GPIO) 294#define MX23_PAD_LCD_D04__GPIO_1_4 MXS_IOMUX_PAD_NAKED(1, 4, PAD_MUXSEL_GPIO)
295#define MX23_PAD_LCD_D05__GPO_1_5 MXS_IOMUX_PAD_NAKED(1, 5, PAD_MUXSEL_GPIO) 295#define MX23_PAD_LCD_D05__GPIO_1_5 MXS_IOMUX_PAD_NAKED(1, 5, PAD_MUXSEL_GPIO)
296#define MX23_PAD_LCD_D06__GPO_1_6 MXS_IOMUX_PAD_NAKED(1, 6, PAD_MUXSEL_GPIO) 296#define MX23_PAD_LCD_D06__GPIO_1_6 MXS_IOMUX_PAD_NAKED(1, 6, PAD_MUXSEL_GPIO)
297#define MX23_PAD_LCD_D07__GPO_1_7 MXS_IOMUX_PAD_NAKED(1, 7, PAD_MUXSEL_GPIO) 297#define MX23_PAD_LCD_D07__GPIO_1_7 MXS_IOMUX_PAD_NAKED(1, 7, PAD_MUXSEL_GPIO)
298#define MX23_PAD_LCD_D08__GPO_1_8 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_GPIO) 298#define MX23_PAD_LCD_D08__GPIO_1_8 MXS_IOMUX_PAD_NAKED(1, 8, PAD_MUXSEL_GPIO)
299#define MX23_PAD_LCD_D09__GPO_1_9 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_GPIO) 299#define MX23_PAD_LCD_D09__GPIO_1_9 MXS_IOMUX_PAD_NAKED(1, 9, PAD_MUXSEL_GPIO)
300#define MX23_PAD_LCD_D10__GPO_1_10 MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_GPIO) 300#define MX23_PAD_LCD_D10__GPIO_1_10 MXS_IOMUX_PAD_NAKED(1, 10, PAD_MUXSEL_GPIO)
301#define MX23_PAD_LCD_D11__GPO_1_11 MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_GPIO) 301#define MX23_PAD_LCD_D11__GPIO_1_11 MXS_IOMUX_PAD_NAKED(1, 11, PAD_MUXSEL_GPIO)
302#define MX23_PAD_LCD_D12__GPO_1_12 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_GPIO) 302#define MX23_PAD_LCD_D12__GPIO_1_12 MXS_IOMUX_PAD_NAKED(1, 12, PAD_MUXSEL_GPIO)
303#define MX23_PAD_LCD_D13__GPO_1_13 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_GPIO) 303#define MX23_PAD_LCD_D13__GPIO_1_13 MXS_IOMUX_PAD_NAKED(1, 13, PAD_MUXSEL_GPIO)
304#define MX23_PAD_LCD_D14__GPO_1_14 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_GPIO) 304#define MX23_PAD_LCD_D14__GPIO_1_14 MXS_IOMUX_PAD_NAKED(1, 14, PAD_MUXSEL_GPIO)
305#define MX23_PAD_LCD_D15__GPO_1_15 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_GPIO) 305#define MX23_PAD_LCD_D15__GPIO_1_15 MXS_IOMUX_PAD_NAKED(1, 15, PAD_MUXSEL_GPIO)
306#define MX23_PAD_LCD_D16__GPO_1_16 MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_GPIO) 306#define MX23_PAD_LCD_D16__GPIO_1_16 MXS_IOMUX_PAD_NAKED(1, 16, PAD_MUXSEL_GPIO)
307#define MX23_PAD_LCD_D17__GPO_1_17 MXS_IOMUX_PAD_NAKED(1, 17, PAD_MUXSEL_GPIO) 307#define MX23_PAD_LCD_D17__GPIO_1_17 MXS_IOMUX_PAD_NAKED(1, 17, PAD_MUXSEL_GPIO)
308#define MX23_PAD_LCD_RESET__GPO_1_18 MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_GPIO) 308#define MX23_PAD_LCD_RESET__GPIO_1_18 MXS_IOMUX_PAD_NAKED(1, 18, PAD_MUXSEL_GPIO)
309#define MX23_PAD_LCD_RS__GPO_1_19 MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_GPIO) 309#define MX23_PAD_LCD_RS__GPIO_1_19 MXS_IOMUX_PAD_NAKED(1, 19, PAD_MUXSEL_GPIO)
310#define MX23_PAD_LCD_WR__GPO_1_20 MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_GPIO) 310#define MX23_PAD_LCD_WR__GPIO_1_20 MXS_IOMUX_PAD_NAKED(1, 20, PAD_MUXSEL_GPIO)
311#define MX23_PAD_LCD_CS__GPO_1_21 MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_GPIO) 311#define MX23_PAD_LCD_CS__GPIO_1_21 MXS_IOMUX_PAD_NAKED(1, 21, PAD_MUXSEL_GPIO)
312#define MX23_PAD_LCD_DOTCK__GPO_1_22 MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_GPIO) 312#define MX23_PAD_LCD_DOTCK__GPIO_1_22 MXS_IOMUX_PAD_NAKED(1, 22, PAD_MUXSEL_GPIO)
313#define MX23_PAD_LCD_ENABLE__GPO_1_23 MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_GPIO) 313#define MX23_PAD_LCD_ENABLE__GPIO_1_23 MXS_IOMUX_PAD_NAKED(1, 23, PAD_MUXSEL_GPIO)
314#define MX23_PAD_LCD_HSYNC__GPO_1_24 MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_GPIO) 314#define MX23_PAD_LCD_HSYNC__GPIO_1_24 MXS_IOMUX_PAD_NAKED(1, 24, PAD_MUXSEL_GPIO)
315#define MX23_PAD_LCD_VSYNC__GPO_1_25 MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_GPIO) 315#define MX23_PAD_LCD_VSYNC__GPIO_1_25 MXS_IOMUX_PAD_NAKED(1, 25, PAD_MUXSEL_GPIO)
316#define MX23_PAD_PWM0__GPO_1_26 MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_GPIO) 316#define MX23_PAD_PWM0__GPIO_1_26 MXS_IOMUX_PAD_NAKED(1, 26, PAD_MUXSEL_GPIO)
317#define MX23_PAD_PWM1__GPO_1_27 MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_GPIO) 317#define MX23_PAD_PWM1__GPIO_1_27 MXS_IOMUX_PAD_NAKED(1, 27, PAD_MUXSEL_GPIO)
318#define MX23_PAD_PWM2__GPO_1_28 MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_GPIO) 318#define MX23_PAD_PWM2__GPIO_1_28 MXS_IOMUX_PAD_NAKED(1, 28, PAD_MUXSEL_GPIO)
319#define MX23_PAD_PWM3__GPO_1_29 MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_GPIO) 319#define MX23_PAD_PWM3__GPIO_1_29 MXS_IOMUX_PAD_NAKED(1, 29, PAD_MUXSEL_GPIO)
320#define MX23_PAD_PWM4__GPO_1_30 MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_GPIO) 320#define MX23_PAD_PWM4__GPIO_1_30 MXS_IOMUX_PAD_NAKED(1, 30, PAD_MUXSEL_GPIO)
321 321
322#define MX23_PAD_SSP1_CMD__GPO_2_0 MXS_IOMUX_PAD_NAKED(2, 0, PAD_MUXSEL_GPIO) 322#define MX23_PAD_SSP1_CMD__GPIO_2_0 MXS_IOMUX_PAD_NAKED(2, 0, PAD_MUXSEL_GPIO)
323#define MX23_PAD_SSP1_DETECT__GPO_2_1 MXS_IOMUX_PAD_NAKED(2, 1, PAD_MUXSEL_GPIO) 323#define MX23_PAD_SSP1_DETECT__GPIO_2_1 MXS_IOMUX_PAD_NAKED(2, 1, PAD_MUXSEL_GPIO)
324#define MX23_PAD_SSP1_DATA0__GPO_2_2 MXS_IOMUX_PAD_NAKED(2, 2, PAD_MUXSEL_GPIO) 324#define MX23_PAD_SSP1_DATA0__GPIO_2_2 MXS_IOMUX_PAD_NAKED(2, 2, PAD_MUXSEL_GPIO)
325#define MX23_PAD_SSP1_DATA1__GPO_2_3 MXS_IOMUX_PAD_NAKED(2, 3, PAD_MUXSEL_GPIO) 325#define MX23_PAD_SSP1_DATA1__GPIO_2_3 MXS_IOMUX_PAD_NAKED(2, 3, PAD_MUXSEL_GPIO)
326#define MX23_PAD_SSP1_DATA2__GPO_2_4 MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_GPIO) 326#define MX23_PAD_SSP1_DATA2__GPIO_2_4 MXS_IOMUX_PAD_NAKED(2, 4, PAD_MUXSEL_GPIO)
327#define MX23_PAD_SSP1_DATA3__GPO_2_5 MXS_IOMUX_PAD_NAKED(2, 5, PAD_MUXSEL_GPIO) 327#define MX23_PAD_SSP1_DATA3__GPIO_2_5 MXS_IOMUX_PAD_NAKED(2, 5, PAD_MUXSEL_GPIO)
328#define MX23_PAD_SSP1_SCK__GPO_2_6 MXS_IOMUX_PAD_NAKED(2, 6, PAD_MUXSEL_GPIO) 328#define MX23_PAD_SSP1_SCK__GPIO_2_6 MXS_IOMUX_PAD_NAKED(2, 6, PAD_MUXSEL_GPIO)
329#define MX23_PAD_ROTARYA__GPO_2_7 MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_GPIO) 329#define MX23_PAD_ROTARYA__GPIO_2_7 MXS_IOMUX_PAD_NAKED(2, 7, PAD_MUXSEL_GPIO)
330#define MX23_PAD_ROTARYB__GPO_2_8 MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_GPIO) 330#define MX23_PAD_ROTARYB__GPIO_2_8 MXS_IOMUX_PAD_NAKED(2, 8, PAD_MUXSEL_GPIO)
331#define MX23_PAD_EMI_A00__GPO_2_9 MXS_IOMUX_PAD_NAKED(2, 9, PAD_MUXSEL_GPIO) 331#define MX23_PAD_EMI_A00__GPIO_2_9 MXS_IOMUX_PAD_NAKED(2, 9, PAD_MUXSEL_GPIO)
332#define MX23_PAD_EMI_A01__GPO_2_10 MXS_IOMUX_PAD_NAKED(2, 10, PAD_MUXSEL_GPIO) 332#define MX23_PAD_EMI_A01__GPIO_2_10 MXS_IOMUX_PAD_NAKED(2, 10, PAD_MUXSEL_GPIO)
333#define MX23_PAD_EMI_A02__GPO_2_11 MXS_IOMUX_PAD_NAKED(2, 11, PAD_MUXSEL_GPIO) 333#define MX23_PAD_EMI_A02__GPIO_2_11 MXS_IOMUX_PAD_NAKED(2, 11, PAD_MUXSEL_GPIO)
334#define MX23_PAD_EMI_A03__GPO_2_12 MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_GPIO) 334#define MX23_PAD_EMI_A03__GPIO_2_12 MXS_IOMUX_PAD_NAKED(2, 12, PAD_MUXSEL_GPIO)
335#define MX23_PAD_EMI_A04__GPO_2_13 MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_GPIO) 335#define MX23_PAD_EMI_A04__GPIO_2_13 MXS_IOMUX_PAD_NAKED(2, 13, PAD_MUXSEL_GPIO)
336#define MX23_PAD_EMI_A05__GPO_2_14 MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_GPIO) 336#define MX23_PAD_EMI_A05__GPIO_2_14 MXS_IOMUX_PAD_NAKED(2, 14, PAD_MUXSEL_GPIO)
337#define MX23_PAD_EMI_A06__GPO_2_15 MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_GPIO) 337#define MX23_PAD_EMI_A06__GPIO_2_15 MXS_IOMUX_PAD_NAKED(2, 15, PAD_MUXSEL_GPIO)
338#define MX23_PAD_EMI_A07__GPO_2_16 MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_GPIO) 338#define MX23_PAD_EMI_A07__GPIO_2_16 MXS_IOMUX_PAD_NAKED(2, 16, PAD_MUXSEL_GPIO)
339#define MX23_PAD_EMI_A08__GPO_2_17 MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_GPIO) 339#define MX23_PAD_EMI_A08__GPIO_2_17 MXS_IOMUX_PAD_NAKED(2, 17, PAD_MUXSEL_GPIO)
340#define MX23_PAD_EMI_A09__GPO_2_18 MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_GPIO) 340#define MX23_PAD_EMI_A09__GPIO_2_18 MXS_IOMUX_PAD_NAKED(2, 18, PAD_MUXSEL_GPIO)
341#define MX23_PAD_EMI_A10__GPO_2_19 MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_GPIO) 341#define MX23_PAD_EMI_A10__GPIO_2_19 MXS_IOMUX_PAD_NAKED(2, 19, PAD_MUXSEL_GPIO)
342#define MX23_PAD_EMI_A11__GPO_2_20 MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_GPIO) 342#define MX23_PAD_EMI_A11__GPIO_2_20 MXS_IOMUX_PAD_NAKED(2, 20, PAD_MUXSEL_GPIO)
343#define MX23_PAD_EMI_A12__GPO_2_21 MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_GPIO) 343#define MX23_PAD_EMI_A12__GPIO_2_21 MXS_IOMUX_PAD_NAKED(2, 21, PAD_MUXSEL_GPIO)
344#define MX23_PAD_EMI_BA0__GPO_2_22 MXS_IOMUX_PAD_NAKED(2, 22, PAD_MUXSEL_GPIO) 344#define MX23_PAD_EMI_BA0__GPIO_2_22 MXS_IOMUX_PAD_NAKED(2, 22, PAD_MUXSEL_GPIO)
345#define MX23_PAD_EMI_BA1__GPO_2_23 MXS_IOMUX_PAD_NAKED(2, 23, PAD_MUXSEL_GPIO) 345#define MX23_PAD_EMI_BA1__GPIO_2_23 MXS_IOMUX_PAD_NAKED(2, 23, PAD_MUXSEL_GPIO)
346#define MX23_PAD_EMI_CASN__GPO_2_24 MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_GPIO) 346#define MX23_PAD_EMI_CASN__GPIO_2_24 MXS_IOMUX_PAD_NAKED(2, 24, PAD_MUXSEL_GPIO)
347#define MX23_PAD_EMI_CE0N__GPO_2_25 MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_GPIO) 347#define MX23_PAD_EMI_CE0N__GPIO_2_25 MXS_IOMUX_PAD_NAKED(2, 25, PAD_MUXSEL_GPIO)
348#define MX23_PAD_EMI_CE1N__GPO_2_26 MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_GPIO) 348#define MX23_PAD_EMI_CE1N__GPIO_2_26 MXS_IOMUX_PAD_NAKED(2, 26, PAD_MUXSEL_GPIO)
349#define MX23_PAD_GPMI_CE1N__GPO_2_27 MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_GPIO) 349#define MX23_PAD_GPMI_CE1N__GPIO_2_27 MXS_IOMUX_PAD_NAKED(2, 27, PAD_MUXSEL_GPIO)
350#define MX23_PAD_GPMI_CE0N__GPO_2_28 MXS_IOMUX_PAD_NAKED(2, 28, PAD_MUXSEL_GPIO) 350#define MX23_PAD_GPMI_CE0N__GPIO_2_28 MXS_IOMUX_PAD_NAKED(2, 28, PAD_MUXSEL_GPIO)
351#define MX23_PAD_EMI_CKE__GPO_2_29 MXS_IOMUX_PAD_NAKED(2, 29, PAD_MUXSEL_GPIO) 351#define MX23_PAD_EMI_CKE__GPIO_2_29 MXS_IOMUX_PAD_NAKED(2, 29, PAD_MUXSEL_GPIO)
352#define MX23_PAD_EMI_RASN__GPO_2_30 MXS_IOMUX_PAD_NAKED(2, 30, PAD_MUXSEL_GPIO) 352#define MX23_PAD_EMI_RASN__GPIO_2_30 MXS_IOMUX_PAD_NAKED(2, 30, PAD_MUXSEL_GPIO)
353#define MX23_PAD_EMI_WEN__GPO_2_31 MXS_IOMUX_PAD_NAKED(2, 31, PAD_MUXSEL_GPIO) 353#define MX23_PAD_EMI_WEN__GPIO_2_31 MXS_IOMUX_PAD_NAKED(2, 31, PAD_MUXSEL_GPIO)
354 354
355#endif /* __MACH_IOMUX_MX23_H__ */ 355#endif /* __MACH_IOMUX_MX23_H__ */
diff --git a/arch/arm/mach-mxs/include/mach/iomux.h b/arch/arm/mach-mxs/include/mach/iomux.h
index fe558e3c5a9a..7abdf58b8bb7 100644
--- a/arch/arm/mach-mxs/include/mach/iomux.h
+++ b/arch/arm/mach-mxs/include/mach/iomux.h
@@ -91,6 +91,9 @@ typedef u32 iomux_cfg_t;
91#define MXS_PAD_PULLUP ((PAD_PULLUP << MXS_PAD_PULL_SHIFT) | \ 91#define MXS_PAD_PULLUP ((PAD_PULLUP << MXS_PAD_PULL_SHIFT) | \
92 MXS_PAD_PULL_VALID_MASK) 92 MXS_PAD_PULL_VALID_MASK)
93 93
94/* generic pad control used in most cases */
95#define MXS_PAD_CTRL (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL)
96
94#define MXS_IOMUX_PAD(_bank, _pin, _muxsel, _ma, _vol, _pull) \ 97#define MXS_IOMUX_PAD(_bank, _pin, _muxsel, _ma, _vol, _pull) \
95 (((iomux_cfg_t)(_bank) << MXS_PAD_BANK_SHIFT) | \ 98 (((iomux_cfg_t)(_bank) << MXS_PAD_BANK_SHIFT) | \
96 ((iomux_cfg_t)(_pin) << MXS_PAD_PIN_SHIFT) | \ 99 ((iomux_cfg_t)(_pin) << MXS_PAD_PIN_SHIFT) | \
diff --git a/arch/arm/mach-mxs/include/mach/mmc.h b/arch/arm/mach-mxs/include/mach/mmc.h
new file mode 100644
index 000000000000..211547a05564
--- /dev/null
+++ b/arch/arm/mach-mxs/include/mach/mmc.h
@@ -0,0 +1,18 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __MACH_MXS_MMC_H__
10#define __MACH_MXS_MMC_H__
11
12struct mxs_mmc_platform_data {
13 int wp_gpio; /* write protect pin */
14 unsigned int flags;
15#define SLOTF_4_BIT_CAPABLE (1 << 0)
16#define SLOTF_8_BIT_CAPABLE (1 << 1)
17};
18#endif /* __MACH_MXS_MMC_H__ */
diff --git a/arch/arm/mach-mxs/include/mach/mx23.h b/arch/arm/mach-mxs/include/mach/mx23.h
index 9edd02ec8e30..c0a18c23084a 100644
--- a/arch/arm/mach-mxs/include/mach/mx23.h
+++ b/arch/arm/mach-mxs/include/mach/mx23.h
@@ -93,7 +93,7 @@
93#define MX23_INT_USB_WAKEUP 12 93#define MX23_INT_USB_WAKEUP 12
94#define MX23_INT_GPMI_DMA 13 94#define MX23_INT_GPMI_DMA 13
95#define MX23_INT_SSP1_DMA 14 95#define MX23_INT_SSP1_DMA 14
96#define MX23_INT_SSP_ERROR 15 96#define MX23_INT_SSP1_ERROR 15
97#define MX23_INT_GPIO0 16 97#define MX23_INT_GPIO0 16
98#define MX23_INT_GPIO1 17 98#define MX23_INT_GPIO1 17
99#define MX23_INT_GPIO2 18 99#define MX23_INT_GPIO2 18
@@ -101,9 +101,9 @@
101#define MX23_INT_SSP2_DMA 20 101#define MX23_INT_SSP2_DMA 20
102#define MX23_INT_ECC8_IRQ 21 102#define MX23_INT_ECC8_IRQ 21
103#define MX23_INT_RTC_ALARM 22 103#define MX23_INT_RTC_ALARM 22
104#define MX23_INT_UARTAPP_TX_DMA 23 104#define MX23_INT_AUART1_TX_DMA 23
105#define MX23_INT_UARTAPP_INTERNAL 24 105#define MX23_INT_AUART1 24
106#define MX23_INT_UARTAPP_RX_DMA 25 106#define MX23_INT_AUART1_RX_DMA 25
107#define MX23_INT_I2C_DMA 26 107#define MX23_INT_I2C_DMA 26
108#define MX23_INT_I2C_ERROR 27 108#define MX23_INT_I2C_ERROR 27
109#define MX23_INT_TIMER0 28 109#define MX23_INT_TIMER0 28
@@ -135,11 +135,35 @@
135#define MX23_INT_DCP 54 135#define MX23_INT_DCP 54
136#define MX23_INT_BCH 56 136#define MX23_INT_BCH 56
137#define MX23_INT_PXP 57 137#define MX23_INT_PXP 57
138#define MX23_INT_UARTAPP2_TX_DMA 58 138#define MX23_INT_AUART2_TX_DMA 58
139#define MX23_INT_UARTAPP2_INTERNAL 59 139#define MX23_INT_AUART2 59
140#define MX23_INT_UARTAPP2_RX_DMA 60 140#define MX23_INT_AUART2_RX_DMA 60
141#define MX23_INT_VDAC_DETECT 61 141#define MX23_INT_VDAC_DETECT 61
142#define MX23_INT_VDD5V_DROOP 64 142#define MX23_INT_VDD5V_DROOP 64
143#define MX23_INT_DCDC4P2_BO 65 143#define MX23_INT_DCDC4P2_BO 65
144 144
145/*
146 * APBH DMA
147 */
148#define MX23_DMA_SSP1 1
149#define MX23_DMA_SSP2 2
150#define MX23_DMA_GPMI0 4
151#define MX23_DMA_GPMI1 5
152#define MX23_DMA_GPMI2 6
153#define MX23_DMA_GPMI3 7
154
155/*
156 * APBX DMA
157 */
158#define MX23_DMA_ADC 0
159#define MX23_DMA_DAC 1
160#define MX23_DMA_SPDIF 2
161#define MX23_DMA_I2C 3
162#define MX23_DMA_SAIF0 4
163#define MX23_DMA_UART0_RX 6
164#define MX23_DMA_UART0_TX 7
165#define MX23_DMA_UART1_RX 8
166#define MX23_DMA_UART1_TX 9
167#define MX23_DMA_SAIF1 10
168
145#endif /* __MACH_MX23_H__ */ 169#endif /* __MACH_MX23_H__ */
diff --git a/arch/arm/mach-mxs/include/mach/mx28.h b/arch/arm/mach-mxs/include/mach/mx28.h
index 0716745267ad..75d86118b76a 100644
--- a/arch/arm/mach-mxs/include/mach/mx28.h
+++ b/arch/arm/mach-mxs/include/mach/mx28.h
@@ -163,10 +163,10 @@
163#define MX28_INT_USB0 93 163#define MX28_INT_USB0 93
164#define MX28_INT_USB1_WAKEUP 94 164#define MX28_INT_USB1_WAKEUP 94
165#define MX28_INT_USB0_WAKEUP 95 165#define MX28_INT_USB0_WAKEUP 95
166#define MX28_INT_SSP0 96 166#define MX28_INT_SSP0_ERROR 96
167#define MX28_INT_SSP1 97 167#define MX28_INT_SSP1_ERROR 97
168#define MX28_INT_SSP2 98 168#define MX28_INT_SSP2_ERROR 98
169#define MX28_INT_SSP3 99 169#define MX28_INT_SSP3_ERROR 99
170#define MX28_INT_ENET_SWI 100 170#define MX28_INT_ENET_SWI 100
171#define MX28_INT_ENET_MAC0 101 171#define MX28_INT_ENET_MAC0 101
172#define MX28_INT_ENET_MAC1 102 172#define MX28_INT_ENET_MAC1 102
@@ -185,4 +185,41 @@
185#define MX28_INT_GPIO1 126 185#define MX28_INT_GPIO1 126
186#define MX28_INT_GPIO0 127 186#define MX28_INT_GPIO0 127
187 187
188/*
189 * APBH DMA
190 */
191#define MX28_DMA_SSP0 0
192#define MX28_DMA_SSP1 1
193#define MX28_DMA_SSP2 2
194#define MX28_DMA_SSP3 3
195#define MX28_DMA_GPMI0 4
196#define MX28_DMA_GPMI1 5
197#define MX28_DMA_GPMI2 6
198#define MX28_DMA_GPMI3 7
199#define MX28_DMA_GPMI4 8
200#define MX28_DMA_GPMI5 9
201#define MX28_DMA_GPMI6 10
202#define MX28_DMA_GPMI7 11
203#define MX28_DMA_HSADC 12
204#define MX28_DMA_LCDIF 13
205
206/*
207 * APBX DMA
208 */
209#define MX28_DMA_AUART4_RX 0
210#define MX28_DMA_AUART4_TX 1
211#define MX28_DMA_SPDIF_TX 2
212#define MX28_DMA_SAIF0 4
213#define MX28_DMA_SAIF1 5
214#define MX28_DMA_I2C0 6
215#define MX28_DMA_I2C1 7
216#define MX28_DMA_AUART0_RX 8
217#define MX28_DMA_AUART0_TX 9
218#define MX28_DMA_AUART1_RX 10
219#define MX28_DMA_AUART1_TX 11
220#define MX28_DMA_AUART2_RX 12
221#define MX28_DMA_AUART2_TX 13
222#define MX28_DMA_AUART3_RX 14
223#define MX28_DMA_AUART3_TX 15
224
188#endif /* __MACH_MX28_H__ */ 225#endif /* __MACH_MX28_H__ */
diff --git a/arch/arm/mach-mxs/include/mach/mxs.h b/arch/arm/mach-mxs/include/mach/mxs.h
index f186c08c2911..35a89dd27242 100644
--- a/arch/arm/mach-mxs/include/mach/mxs.h
+++ b/arch/arm/mach-mxs/include/mach/mxs.h
@@ -28,8 +28,13 @@
28/* 28/*
29 * MXS CPU types 29 * MXS CPU types
30 */ 30 */
31#define cpu_is_mx23() (machine_is_mx23evk()) 31#define cpu_is_mx23() ( \
32#define cpu_is_mx28() (machine_is_mx28evk()) 32 machine_is_mx23evk() || \
33 0)
34#define cpu_is_mx28() ( \
35 machine_is_mx28evk() || \
36 machine_is_tx28() || \
37 0)
33 38
34/* 39/*
35 * IO addresses common to MXS-based 40 * IO addresses common to MXS-based
diff --git a/arch/arm/mach-mxs/include/mach/mxsfb.h b/arch/arm/mach-mxs/include/mach/mxsfb.h
new file mode 100644
index 000000000000..e4d79791515e
--- /dev/null
+++ b/arch/arm/mach-mxs/include/mach/mxsfb.h
@@ -0,0 +1,49 @@
1/*
2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License
4 * as published by the Free Software Foundation; either version 2
5 * of the License, or (at your option) any later version.
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
14 * MA 02110-1301, USA.
15 */
16
17#ifndef __MACH_FB_H
18#define __MACH_FB_H
19
20#include <linux/fb.h>
21
22#define STMLCDIF_8BIT 1 /** pixel data bus to the display is of 8 bit width */
23#define STMLCDIF_16BIT 0 /** pixel data bus to the display is of 16 bit width */
24#define STMLCDIF_18BIT 2 /** pixel data bus to the display is of 18 bit width */
25#define STMLCDIF_24BIT 3 /** pixel data bus to the display is of 24 bit width */
26
27#define FB_SYNC_DATA_ENABLE_HIGH_ACT (1 << 6)
28#define FB_SYNC_DOTCLK_FAILING_ACT (1 << 7) /* failing/negtive edge sampling */
29
30struct mxsfb_platform_data {
31 struct fb_videomode *mode_list;
32 unsigned mode_count;
33
34 unsigned default_bpp;
35
36 unsigned dotclk_delay; /* refer manual HW_LCDIF_VDCTRL4 register */
37 unsigned ld_intf_width; /* refer STMLCDIF_* macros */
38
39 unsigned fb_size; /* Size of the video memory. If zero a
40 * default will be used
41 */
42 unsigned long fb_phys; /* physical address for the video memory. If
43 * zero the framebuffer memory will be dynamically
44 * allocated. If specified,fb_size must also be specified.
45 * fb_phys must be unused by Linux.
46 */
47};
48
49#endif /* __MACH_FB_H */
diff --git a/arch/arm/mach-mxs/include/mach/uncompress.h b/arch/arm/mach-mxs/include/mach/uncompress.h
index a005e76f34f9..f12a1732d8b8 100644
--- a/arch/arm/mach-mxs/include/mach/uncompress.h
+++ b/arch/arm/mach-mxs/include/mach/uncompress.h
@@ -63,6 +63,7 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
63 mxs_duart_base = MX23_DUART_BASE_ADDR; 63 mxs_duart_base = MX23_DUART_BASE_ADDR;
64 break; 64 break;
65 case MACH_TYPE_MX28EVK: 65 case MACH_TYPE_MX28EVK:
66 case MACH_TYPE_TX28:
66 mxs_duart_base = MX28_DUART_BASE_ADDR; 67 mxs_duart_base = MX28_DUART_BASE_ADDR;
67 break; 68 break;
68 default: 69 default:
diff --git a/arch/arm/mach-mxs/mach-mx23evk.c b/arch/arm/mach-mxs/mach-mx23evk.c
index aa0640052f58..a66994f0518f 100644
--- a/arch/arm/mach-mxs/mach-mx23evk.c
+++ b/arch/arm/mach-mxs/mach-mx23evk.c
@@ -26,17 +26,103 @@
26 26
27#include "devices-mx23.h" 27#include "devices-mx23.h"
28 28
29#define MX23EVK_LCD_ENABLE MXS_GPIO_NR(1, 18)
30#define MX23EVK_BL_ENABLE MXS_GPIO_NR(1, 28)
31
29static const iomux_cfg_t mx23evk_pads[] __initconst = { 32static const iomux_cfg_t mx23evk_pads[] __initconst = {
30 /* duart */ 33 /* duart */
31 MX23_PAD_PWM0__DUART_RX | MXS_PAD_4MA, 34 MX23_PAD_PWM0__DUART_RX | MXS_PAD_CTRL,
32 MX23_PAD_PWM1__DUART_TX | MXS_PAD_4MA, 35 MX23_PAD_PWM1__DUART_TX | MXS_PAD_CTRL,
36
37 /* auart */
38 MX23_PAD_AUART1_RX__AUART1_RX | MXS_PAD_CTRL,
39 MX23_PAD_AUART1_TX__AUART1_TX | MXS_PAD_CTRL,
40 MX23_PAD_AUART1_CTS__AUART1_CTS | MXS_PAD_CTRL,
41 MX23_PAD_AUART1_RTS__AUART1_RTS | MXS_PAD_CTRL,
42
43 /* mxsfb (lcdif) */
44 MX23_PAD_LCD_D00__LCD_D00 | MXS_PAD_CTRL,
45 MX23_PAD_LCD_D01__LCD_D01 | MXS_PAD_CTRL,
46 MX23_PAD_LCD_D02__LCD_D02 | MXS_PAD_CTRL,
47 MX23_PAD_LCD_D03__LCD_D03 | MXS_PAD_CTRL,
48 MX23_PAD_LCD_D04__LCD_D04 | MXS_PAD_CTRL,
49 MX23_PAD_LCD_D05__LCD_D05 | MXS_PAD_CTRL,
50 MX23_PAD_LCD_D06__LCD_D06 | MXS_PAD_CTRL,
51 MX23_PAD_LCD_D07__LCD_D07 | MXS_PAD_CTRL,
52 MX23_PAD_LCD_D08__LCD_D08 | MXS_PAD_CTRL,
53 MX23_PAD_LCD_D09__LCD_D09 | MXS_PAD_CTRL,
54 MX23_PAD_LCD_D10__LCD_D10 | MXS_PAD_CTRL,
55 MX23_PAD_LCD_D11__LCD_D11 | MXS_PAD_CTRL,
56 MX23_PAD_LCD_D12__LCD_D12 | MXS_PAD_CTRL,
57 MX23_PAD_LCD_D13__LCD_D13 | MXS_PAD_CTRL,
58 MX23_PAD_LCD_D14__LCD_D14 | MXS_PAD_CTRL,
59 MX23_PAD_LCD_D15__LCD_D15 | MXS_PAD_CTRL,
60 MX23_PAD_LCD_D16__LCD_D16 | MXS_PAD_CTRL,
61 MX23_PAD_LCD_D17__LCD_D17 | MXS_PAD_CTRL,
62 MX23_PAD_GPMI_D08__LCD_D18 | MXS_PAD_CTRL,
63 MX23_PAD_GPMI_D09__LCD_D19 | MXS_PAD_CTRL,
64 MX23_PAD_GPMI_D10__LCD_D20 | MXS_PAD_CTRL,
65 MX23_PAD_GPMI_D11__LCD_D21 | MXS_PAD_CTRL,
66 MX23_PAD_GPMI_D12__LCD_D22 | MXS_PAD_CTRL,
67 MX23_PAD_GPMI_D13__LCD_D23 | MXS_PAD_CTRL,
68 MX23_PAD_LCD_VSYNC__LCD_VSYNC | MXS_PAD_CTRL,
69 MX23_PAD_LCD_HSYNC__LCD_HSYNC | MXS_PAD_CTRL,
70 MX23_PAD_LCD_DOTCK__LCD_DOTCK | MXS_PAD_CTRL,
71 MX23_PAD_LCD_ENABLE__LCD_ENABLE | MXS_PAD_CTRL,
72 /* LCD panel enable */
73 MX23_PAD_LCD_RESET__GPIO_1_18 | MXS_PAD_CTRL,
74 /* backlight control */
75 MX23_PAD_PWM2__GPIO_1_28 | MXS_PAD_CTRL,
76};
77
78/* mxsfb (lcdif) */
79static struct fb_videomode mx23evk_video_modes[] = {
80 {
81 .name = "Samsung-LMS430HF02",
82 .refresh = 60,
83 .xres = 480,
84 .yres = 272,
85 .pixclock = 108096, /* picosecond (9.2 MHz) */
86 .left_margin = 15,
87 .right_margin = 8,
88 .upper_margin = 12,
89 .lower_margin = 4,
90 .hsync_len = 1,
91 .vsync_len = 1,
92 .sync = FB_SYNC_DATA_ENABLE_HIGH_ACT |
93 FB_SYNC_DOTCLK_FAILING_ACT,
94 },
95};
96
97static const struct mxsfb_platform_data mx23evk_mxsfb_pdata __initconst = {
98 .mode_list = mx23evk_video_modes,
99 .mode_count = ARRAY_SIZE(mx23evk_video_modes),
100 .default_bpp = 32,
101 .ld_intf_width = STMLCDIF_24BIT,
33}; 102};
34 103
35static void __init mx23evk_init(void) 104static void __init mx23evk_init(void)
36{ 105{
106 int ret;
107
37 mxs_iomux_setup_multiple_pads(mx23evk_pads, ARRAY_SIZE(mx23evk_pads)); 108 mxs_iomux_setup_multiple_pads(mx23evk_pads, ARRAY_SIZE(mx23evk_pads));
38 109
39 mx23_add_duart(); 110 mx23_add_duart();
111 mx23_add_auart0();
112
113 ret = gpio_request_one(MX23EVK_LCD_ENABLE, GPIOF_DIR_OUT, "lcd-enable");
114 if (ret)
115 pr_warn("failed to request gpio lcd-enable: %d\n", ret);
116 else
117 gpio_set_value(MX23EVK_LCD_ENABLE, 1);
118
119 ret = gpio_request_one(MX23EVK_BL_ENABLE, GPIOF_DIR_OUT, "bl-enable");
120 if (ret)
121 pr_warn("failed to request gpio bl-enable: %d\n", ret);
122 else
123 gpio_set_value(MX23EVK_BL_ENABLE, 1);
124
125 mx23_add_mxsfb(&mx23evk_mxsfb_pdata);
40} 126}
41 127
42static void __init mx23evk_timer_init(void) 128static void __init mx23evk_timer_init(void)
diff --git a/arch/arm/mach-mxs/mach-mx28evk.c b/arch/arm/mach-mxs/mach-mx28evk.c
index 8e2c5975001e..08002d02267a 100644
--- a/arch/arm/mach-mxs/mach-mx28evk.c
+++ b/arch/arm/mach-mxs/mach-mx28evk.c
@@ -28,54 +28,93 @@
28#include "devices-mx28.h" 28#include "devices-mx28.h"
29#include "gpio.h" 29#include "gpio.h"
30 30
31#define MX28EVK_FLEXCAN_SWITCH MXS_GPIO_NR(2, 13)
31#define MX28EVK_FEC_PHY_POWER MXS_GPIO_NR(2, 15) 32#define MX28EVK_FEC_PHY_POWER MXS_GPIO_NR(2, 15)
33#define MX28EVK_BL_ENABLE MXS_GPIO_NR(3, 18)
34#define MX28EVK_LCD_ENABLE MXS_GPIO_NR(3, 30)
32#define MX28EVK_FEC_PHY_RESET MXS_GPIO_NR(4, 13) 35#define MX28EVK_FEC_PHY_RESET MXS_GPIO_NR(4, 13)
33 36
34static const iomux_cfg_t mx28evk_pads[] __initconst = { 37static const iomux_cfg_t mx28evk_pads[] __initconst = {
35 /* duart */ 38 /* duart */
36 MX28_PAD_PWM0__DUART_RX | 39 MX28_PAD_PWM0__DUART_RX | MXS_PAD_CTRL,
37 (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), 40 MX28_PAD_PWM1__DUART_TX | MXS_PAD_CTRL,
38 MX28_PAD_PWM1__DUART_TX |
39 (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
40 41
42 /* auart0 */
43 MX28_PAD_AUART0_RX__AUART0_RX | MXS_PAD_CTRL,
44 MX28_PAD_AUART0_TX__AUART0_TX | MXS_PAD_CTRL,
45 MX28_PAD_AUART0_CTS__AUART0_CTS | MXS_PAD_CTRL,
46 MX28_PAD_AUART0_RTS__AUART0_RTS | MXS_PAD_CTRL,
47 /* auart3 */
48 MX28_PAD_AUART3_RX__AUART3_RX | MXS_PAD_CTRL,
49 MX28_PAD_AUART3_TX__AUART3_TX | MXS_PAD_CTRL,
50 MX28_PAD_AUART3_CTS__AUART3_CTS | MXS_PAD_CTRL,
51 MX28_PAD_AUART3_RTS__AUART3_RTS | MXS_PAD_CTRL,
52
53#define MXS_PAD_FEC (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP)
41 /* fec0 */ 54 /* fec0 */
42 MX28_PAD_ENET0_MDC__ENET0_MDC | 55 MX28_PAD_ENET0_MDC__ENET0_MDC | MXS_PAD_FEC,
43 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 56 MX28_PAD_ENET0_MDIO__ENET0_MDIO | MXS_PAD_FEC,
44 MX28_PAD_ENET0_MDIO__ENET0_MDIO | 57 MX28_PAD_ENET0_RX_EN__ENET0_RX_EN | MXS_PAD_FEC,
45 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 58 MX28_PAD_ENET0_RXD0__ENET0_RXD0 | MXS_PAD_FEC,
46 MX28_PAD_ENET0_RX_EN__ENET0_RX_EN | 59 MX28_PAD_ENET0_RXD1__ENET0_RXD1 | MXS_PAD_FEC,
47 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 60 MX28_PAD_ENET0_TX_EN__ENET0_TX_EN | MXS_PAD_FEC,
48 MX28_PAD_ENET0_RXD0__ENET0_RXD0 | 61 MX28_PAD_ENET0_TXD0__ENET0_TXD0 | MXS_PAD_FEC,
49 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 62 MX28_PAD_ENET0_TXD1__ENET0_TXD1 | MXS_PAD_FEC,
50 MX28_PAD_ENET0_RXD1__ENET0_RXD1 | 63 MX28_PAD_ENET_CLK__CLKCTRL_ENET | MXS_PAD_FEC,
51 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
52 MX28_PAD_ENET0_TX_EN__ENET0_TX_EN |
53 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
54 MX28_PAD_ENET0_TXD0__ENET0_TXD0 |
55 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
56 MX28_PAD_ENET0_TXD1__ENET0_TXD1 |
57 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
58 MX28_PAD_ENET_CLK__CLKCTRL_ENET |
59 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
60 /* fec1 */ 64 /* fec1 */
61 MX28_PAD_ENET0_CRS__ENET1_RX_EN | 65 MX28_PAD_ENET0_CRS__ENET1_RX_EN | MXS_PAD_FEC,
62 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 66 MX28_PAD_ENET0_RXD2__ENET1_RXD0 | MXS_PAD_FEC,
63 MX28_PAD_ENET0_RXD2__ENET1_RXD0 | 67 MX28_PAD_ENET0_RXD3__ENET1_RXD1 | MXS_PAD_FEC,
64 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 68 MX28_PAD_ENET0_COL__ENET1_TX_EN | MXS_PAD_FEC,
65 MX28_PAD_ENET0_RXD3__ENET1_RXD1 | 69 MX28_PAD_ENET0_TXD2__ENET1_TXD0 | MXS_PAD_FEC,
66 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 70 MX28_PAD_ENET0_TXD3__ENET1_TXD1 | MXS_PAD_FEC,
67 MX28_PAD_ENET0_COL__ENET1_TX_EN |
68 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
69 MX28_PAD_ENET0_TXD2__ENET1_TXD0 |
70 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
71 MX28_PAD_ENET0_TXD3__ENET1_TXD1 |
72 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
73 /* phy power line */ 71 /* phy power line */
74 MX28_PAD_SSP1_DATA3__GPIO_2_15 | 72 MX28_PAD_SSP1_DATA3__GPIO_2_15 | MXS_PAD_CTRL,
75 (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
76 /* phy reset line */ 73 /* phy reset line */
77 MX28_PAD_ENET0_RX_CLK__GPIO_4_13 | 74 MX28_PAD_ENET0_RX_CLK__GPIO_4_13 | MXS_PAD_CTRL,
78 (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), 75
76 /* flexcan0 */
77 MX28_PAD_GPMI_RDY2__CAN0_TX,
78 MX28_PAD_GPMI_RDY3__CAN0_RX,
79 /* flexcan1 */
80 MX28_PAD_GPMI_CE2N__CAN1_TX,
81 MX28_PAD_GPMI_CE3N__CAN1_RX,
82 /* transceiver power control */
83 MX28_PAD_SSP1_CMD__GPIO_2_13,
84
85 /* mxsfb (lcdif) */
86 MX28_PAD_LCD_D00__LCD_D0 | MXS_PAD_CTRL,
87 MX28_PAD_LCD_D01__LCD_D1 | MXS_PAD_CTRL,
88 MX28_PAD_LCD_D02__LCD_D2 | MXS_PAD_CTRL,
89 MX28_PAD_LCD_D03__LCD_D3 | MXS_PAD_CTRL,
90 MX28_PAD_LCD_D04__LCD_D4 | MXS_PAD_CTRL,
91 MX28_PAD_LCD_D05__LCD_D5 | MXS_PAD_CTRL,
92 MX28_PAD_LCD_D06__LCD_D6 | MXS_PAD_CTRL,
93 MX28_PAD_LCD_D07__LCD_D7 | MXS_PAD_CTRL,
94 MX28_PAD_LCD_D08__LCD_D8 | MXS_PAD_CTRL,
95 MX28_PAD_LCD_D09__LCD_D9 | MXS_PAD_CTRL,
96 MX28_PAD_LCD_D10__LCD_D10 | MXS_PAD_CTRL,
97 MX28_PAD_LCD_D11__LCD_D11 | MXS_PAD_CTRL,
98 MX28_PAD_LCD_D12__LCD_D12 | MXS_PAD_CTRL,
99 MX28_PAD_LCD_D13__LCD_D13 | MXS_PAD_CTRL,
100 MX28_PAD_LCD_D14__LCD_D14 | MXS_PAD_CTRL,
101 MX28_PAD_LCD_D15__LCD_D15 | MXS_PAD_CTRL,
102 MX28_PAD_LCD_D16__LCD_D16 | MXS_PAD_CTRL,
103 MX28_PAD_LCD_D17__LCD_D17 | MXS_PAD_CTRL,
104 MX28_PAD_LCD_D18__LCD_D18 | MXS_PAD_CTRL,
105 MX28_PAD_LCD_D19__LCD_D19 | MXS_PAD_CTRL,
106 MX28_PAD_LCD_D20__LCD_D20 | MXS_PAD_CTRL,
107 MX28_PAD_LCD_D21__LCD_D21 | MXS_PAD_CTRL,
108 MX28_PAD_LCD_D22__LCD_D22 | MXS_PAD_CTRL,
109 MX28_PAD_LCD_D23__LCD_D23 | MXS_PAD_CTRL,
110 MX28_PAD_LCD_RD_E__LCD_VSYNC | MXS_PAD_CTRL,
111 MX28_PAD_LCD_WR_RWN__LCD_HSYNC | MXS_PAD_CTRL,
112 MX28_PAD_LCD_RS__LCD_DOTCLK | MXS_PAD_CTRL,
113 MX28_PAD_LCD_CS__LCD_ENABLE | MXS_PAD_CTRL,
114 /* LCD panel enable */
115 MX28_PAD_LCD_RESET__GPIO_3_30 | MXS_PAD_CTRL,
116 /* backlight control */
117 MX28_PAD_PWM2__GPIO_3_18 | MXS_PAD_CTRL,
79}; 118};
80 119
81/* fec */ 120/* fec */
@@ -119,7 +158,7 @@ static void __init mx28evk_fec_reset(void)
119 gpio_set_value(MX28EVK_FEC_PHY_RESET, 1); 158 gpio_set_value(MX28EVK_FEC_PHY_RESET, 1);
120} 159}
121 160
122static struct fec_platform_data mx28_fec_pdata[] = { 161static struct fec_platform_data mx28_fec_pdata[] __initdata = {
123 { 162 {
124 /* fec0 */ 163 /* fec0 */
125 .phy = PHY_INTERFACE_MODE_RMII, 164 .phy = PHY_INTERFACE_MODE_RMII,
@@ -129,15 +168,135 @@ static struct fec_platform_data mx28_fec_pdata[] = {
129 }, 168 },
130}; 169};
131 170
171static int __init mx28evk_fec_get_mac(void)
172{
173 int i;
174 u32 val;
175 const u32 *ocotp = mxs_get_ocotp();
176
177 if (!ocotp)
178 goto error;
179
180 /*
181 * OCOTP only stores the last 4 octets for each mac address,
182 * so hard-code Freescale OUI (00:04:9f) here.
183 */
184 for (i = 0; i < 2; i++) {
185 val = ocotp[i * 4];
186 mx28_fec_pdata[i].mac[0] = 0x00;
187 mx28_fec_pdata[i].mac[1] = 0x04;
188 mx28_fec_pdata[i].mac[2] = 0x9f;
189 mx28_fec_pdata[i].mac[3] = (val >> 16) & 0xff;
190 mx28_fec_pdata[i].mac[4] = (val >> 8) & 0xff;
191 mx28_fec_pdata[i].mac[5] = (val >> 0) & 0xff;
192 }
193
194 return 0;
195
196error:
197 pr_err("%s: timeout when reading fec mac from OCOTP\n", __func__);
198 return -ETIMEDOUT;
199}
200
201/*
202 * MX28EVK_FLEXCAN_SWITCH is shared between both flexcan controllers
203 */
204static int flexcan0_en, flexcan1_en;
205
206static void mx28evk_flexcan_switch(void)
207{
208 if (flexcan0_en || flexcan1_en)
209 gpio_set_value(MX28EVK_FLEXCAN_SWITCH, 1);
210 else
211 gpio_set_value(MX28EVK_FLEXCAN_SWITCH, 0);
212}
213
214static void mx28evk_flexcan0_switch(int enable)
215{
216 flexcan0_en = enable;
217 mx28evk_flexcan_switch();
218}
219
220static void mx28evk_flexcan1_switch(int enable)
221{
222 flexcan1_en = enable;
223 mx28evk_flexcan_switch();
224}
225
226static const struct flexcan_platform_data
227 mx28evk_flexcan_pdata[] __initconst = {
228 {
229 .transceiver_switch = mx28evk_flexcan0_switch,
230 }, {
231 .transceiver_switch = mx28evk_flexcan1_switch,
232 }
233};
234
235/* mxsfb (lcdif) */
236static struct fb_videomode mx28evk_video_modes[] = {
237 {
238 .name = "Seiko-43WVF1G",
239 .refresh = 60,
240 .xres = 800,
241 .yres = 480,
242 .pixclock = 29851, /* picosecond (33.5 MHz) */
243 .left_margin = 89,
244 .right_margin = 164,
245 .upper_margin = 23,
246 .lower_margin = 10,
247 .hsync_len = 10,
248 .vsync_len = 10,
249 .sync = FB_SYNC_DATA_ENABLE_HIGH_ACT |
250 FB_SYNC_DOTCLK_FAILING_ACT,
251 },
252};
253
254static const struct mxsfb_platform_data mx28evk_mxsfb_pdata __initconst = {
255 .mode_list = mx28evk_video_modes,
256 .mode_count = ARRAY_SIZE(mx28evk_video_modes),
257 .default_bpp = 32,
258 .ld_intf_width = STMLCDIF_24BIT,
259};
260
132static void __init mx28evk_init(void) 261static void __init mx28evk_init(void)
133{ 262{
263 int ret;
264
134 mxs_iomux_setup_multiple_pads(mx28evk_pads, ARRAY_SIZE(mx28evk_pads)); 265 mxs_iomux_setup_multiple_pads(mx28evk_pads, ARRAY_SIZE(mx28evk_pads));
135 266
136 mx28_add_duart(); 267 mx28_add_duart();
268 mx28_add_auart0();
269 mx28_add_auart3();
270
271 if (mx28evk_fec_get_mac())
272 pr_warn("%s: failed on fec mac setup\n", __func__);
137 273
138 mx28evk_fec_reset(); 274 mx28evk_fec_reset();
139 mx28_add_fec(0, &mx28_fec_pdata[0]); 275 mx28_add_fec(0, &mx28_fec_pdata[0]);
140 mx28_add_fec(1, &mx28_fec_pdata[1]); 276 mx28_add_fec(1, &mx28_fec_pdata[1]);
277
278 ret = gpio_request_one(MX28EVK_FLEXCAN_SWITCH, GPIOF_DIR_OUT,
279 "flexcan-switch");
280 if (ret) {
281 pr_err("failed to request gpio flexcan-switch: %d\n", ret);
282 } else {
283 mx28_add_flexcan(0, &mx28evk_flexcan_pdata[0]);
284 mx28_add_flexcan(1, &mx28evk_flexcan_pdata[1]);
285 }
286
287 ret = gpio_request_one(MX28EVK_LCD_ENABLE, GPIOF_DIR_OUT, "lcd-enable");
288 if (ret)
289 pr_warn("failed to request gpio lcd-enable: %d\n", ret);
290 else
291 gpio_set_value(MX28EVK_LCD_ENABLE, 1);
292
293 ret = gpio_request_one(MX28EVK_BL_ENABLE, GPIOF_DIR_OUT, "bl-enable");
294 if (ret)
295 pr_warn("failed to request gpio bl-enable: %d\n", ret);
296 else
297 gpio_set_value(MX28EVK_BL_ENABLE, 1);
298
299 mx28_add_mxsfb(&mx28evk_mxsfb_pdata);
141} 300}
142 301
143static void __init mx28evk_timer_init(void) 302static void __init mx28evk_timer_init(void)
diff --git a/arch/arm/mach-mxs/mach-tx28.c b/arch/arm/mach-mxs/mach-tx28.c
new file mode 100644
index 000000000000..b65e3719cbc4
--- /dev/null
+++ b/arch/arm/mach-mxs/mach-tx28.c
@@ -0,0 +1,183 @@
1/*
2 * Copyright (C) 2010 <LW@KARO-electronics.de>
3 *
4 * based on: mach-mx28_evk.c
5 * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation
10 */
11#include <linux/kernel.h>
12#include <linux/gpio.h>
13#include <linux/leds.h>
14#include <linux/platform_device.h>
15#include <linux/spi/spi.h>
16#include <linux/spi/spi_gpio.h>
17#include <linux/i2c.h>
18
19#include <asm/mach/arch.h>
20#include <asm/mach/time.h>
21
22#include <mach/common.h>
23#include <mach/iomux-mx28.h>
24
25#include "devices-mx28.h"
26#include "module-tx28.h"
27
28#define TX28_STK5_GPIO_LED MXS_GPIO_NR(4, 10)
29
30static const iomux_cfg_t tx28_stk5v3_pads[] __initconst = {
31 /* LED */
32 MX28_PAD_ENET0_RXD3__GPIO_4_10 |
33 MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_NOPULL,
34
35 /* framebuffer */
36#define LCD_MODE (MXS_PAD_3V3 | MXS_PAD_4MA)
37 MX28_PAD_LCD_D00__LCD_D0 | LCD_MODE,
38 MX28_PAD_LCD_D01__LCD_D1 | LCD_MODE,
39 MX28_PAD_LCD_D02__LCD_D2 | LCD_MODE,
40 MX28_PAD_LCD_D03__LCD_D3 | LCD_MODE,
41 MX28_PAD_LCD_D04__LCD_D4 | LCD_MODE,
42 MX28_PAD_LCD_D05__LCD_D5 | LCD_MODE,
43 MX28_PAD_LCD_D06__LCD_D6 | LCD_MODE,
44 MX28_PAD_LCD_D07__LCD_D7 | LCD_MODE,
45 MX28_PAD_LCD_D08__LCD_D8 | LCD_MODE,
46 MX28_PAD_LCD_D09__LCD_D9 | LCD_MODE,
47 MX28_PAD_LCD_D10__LCD_D10 | LCD_MODE,
48 MX28_PAD_LCD_D11__LCD_D11 | LCD_MODE,
49 MX28_PAD_LCD_D12__LCD_D12 | LCD_MODE,
50 MX28_PAD_LCD_D13__LCD_D13 | LCD_MODE,
51 MX28_PAD_LCD_D14__LCD_D14 | LCD_MODE,
52 MX28_PAD_LCD_D15__LCD_D15 | LCD_MODE,
53 MX28_PAD_LCD_D16__LCD_D16 | LCD_MODE,
54 MX28_PAD_LCD_D17__LCD_D17 | LCD_MODE,
55 MX28_PAD_LCD_D18__LCD_D18 | LCD_MODE,
56 MX28_PAD_LCD_D19__LCD_D19 | LCD_MODE,
57 MX28_PAD_LCD_D20__LCD_D20 | LCD_MODE,
58 MX28_PAD_LCD_D21__LCD_D21 | LCD_MODE,
59 MX28_PAD_LCD_D22__LCD_D22 | LCD_MODE,
60 MX28_PAD_LCD_D23__LCD_D23 | LCD_MODE,
61 MX28_PAD_LCD_RD_E__LCD_VSYNC | LCD_MODE,
62 MX28_PAD_LCD_WR_RWN__LCD_HSYNC | LCD_MODE,
63 MX28_PAD_LCD_RS__LCD_DOTCLK | LCD_MODE,
64 MX28_PAD_LCD_CS__LCD_CS | LCD_MODE,
65 MX28_PAD_LCD_VSYNC__LCD_VSYNC | LCD_MODE,
66 MX28_PAD_LCD_HSYNC__LCD_HSYNC | LCD_MODE,
67 MX28_PAD_LCD_DOTCLK__LCD_DOTCLK | LCD_MODE,
68 MX28_PAD_LCD_ENABLE__GPIO_1_31 | LCD_MODE,
69 MX28_PAD_LCD_RESET__GPIO_3_30 | LCD_MODE,
70 MX28_PAD_PWM0__PWM_0 | LCD_MODE,
71
72 /* UART1 */
73 MX28_PAD_AUART0_CTS__DUART_RX,
74 MX28_PAD_AUART0_RTS__DUART_TX,
75 MX28_PAD_AUART0_TX__DUART_RTS,
76 MX28_PAD_AUART0_RX__DUART_CTS,
77
78 /* UART2 */
79 MX28_PAD_AUART1_RX__AUART1_RX,
80 MX28_PAD_AUART1_TX__AUART1_TX,
81 MX28_PAD_AUART1_RTS__AUART1_RTS,
82 MX28_PAD_AUART1_CTS__AUART1_CTS,
83
84 /* CAN */
85 MX28_PAD_GPMI_RDY2__CAN0_TX,
86 MX28_PAD_GPMI_RDY3__CAN0_RX,
87
88 /* I2C */
89 MX28_PAD_I2C0_SCL__I2C0_SCL,
90 MX28_PAD_I2C0_SDA__I2C0_SDA,
91
92 /* TSC2007 */
93 MX28_PAD_SAIF0_MCLK__GPIO_3_20 | MXS_PAD_3V3 | MXS_PAD_4MA | MXS_PAD_PULLUP,
94
95 /* MMC0 */
96 MX28_PAD_SSP0_DATA0__SSP0_D0 |
97 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
98 MX28_PAD_SSP0_DATA1__SSP0_D1 |
99 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
100 MX28_PAD_SSP0_DATA2__SSP0_D2 |
101 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
102 MX28_PAD_SSP0_DATA3__SSP0_D3 |
103 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
104 MX28_PAD_SSP0_DATA4__SSP0_D4 |
105 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
106 MX28_PAD_SSP0_DATA5__SSP0_D5 |
107 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
108 MX28_PAD_SSP0_DATA6__SSP0_D6 |
109 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
110 MX28_PAD_SSP0_DATA7__SSP0_D7 |
111 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
112 MX28_PAD_SSP0_CMD__SSP0_CMD |
113 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
114 MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT |
115 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
116 MX28_PAD_SSP0_SCK__SSP0_SCK |
117 (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
118};
119
120static struct gpio_led tx28_stk5v3_leds[] = {
121 {
122 .name = "GPIO-LED",
123 .default_trigger = "heartbeat",
124 .gpio = TX28_STK5_GPIO_LED,
125 },
126};
127
128static const struct gpio_led_platform_data tx28_stk5v3_led_data __initconst = {
129 .leds = tx28_stk5v3_leds,
130 .num_leds = ARRAY_SIZE(tx28_stk5v3_leds),
131};
132
133static struct spi_board_info tx28_spi_board_info[] = {
134 {
135 .modalias = "spidev",
136 .max_speed_hz = 20000000,
137 .bus_num = 0,
138 .chip_select = 1,
139 .controller_data = (void *)SPI_GPIO_NO_CHIPSELECT,
140 .mode = SPI_MODE_0,
141 },
142};
143
144static struct i2c_board_info tx28_stk5v3_i2c_boardinfo[] __initdata = {
145 {
146 I2C_BOARD_INFO("ds1339", 0x68),
147 },
148};
149
150static void __init tx28_stk5v3_init(void)
151{
152 mxs_iomux_setup_multiple_pads(tx28_stk5v3_pads,
153 ARRAY_SIZE(tx28_stk5v3_pads));
154
155 mx28_add_duart(); /* UART1 */
156 mx28_add_auart(1); /* UART2 */
157
158 tx28_add_fec0();
159 /* spi via ssp will be added when available */
160 spi_register_board_info(tx28_spi_board_info,
161 ARRAY_SIZE(tx28_spi_board_info));
162 mxs_add_platform_device("leds-gpio", 0, NULL, 0,
163 &tx28_stk5v3_led_data, sizeof(tx28_stk5v3_led_data));
164 mx28_add_mxs_i2c(0);
165 i2c_register_board_info(0, tx28_stk5v3_i2c_boardinfo,
166 ARRAY_SIZE(tx28_stk5v3_i2c_boardinfo));
167}
168
169static void __init tx28_timer_init(void)
170{
171 mx28_clocks_init();
172}
173
174static struct sys_timer tx28_timer = {
175 .init = tx28_timer_init,
176};
177
178MACHINE_START(TX28, "Ka-Ro electronics TX28 module")
179 .map_io = mx28_map_io,
180 .init_irq = mx28_init_irq,
181 .init_machine = tx28_stk5v3_init,
182 .timer = &tx28_timer,
183MACHINE_END
diff --git a/arch/arm/mach-mxs/module-tx28.c b/arch/arm/mach-mxs/module-tx28.c
new file mode 100644
index 000000000000..fa0b154da67b
--- /dev/null
+++ b/arch/arm/mach-mxs/module-tx28.c
@@ -0,0 +1,131 @@
1/*
2 * Copyright (C) 2010 <LW@KARO-electronics.de>
3 *
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License version 2 as published by the
6 * Free Software Foundation.
7 */
8
9#include <linux/delay.h>
10#include <linux/fec.h>
11#include <linux/gpio.h>
12
13#include <mach/iomux-mx28.h>
14#include "../devices-mx28.h"
15
16#include "module-tx28.h"
17
18#define TX28_FEC_PHY_POWER MXS_GPIO_NR(3, 29)
19#define TX28_FEC_PHY_RESET MXS_GPIO_NR(4, 13)
20
21static const iomux_cfg_t tx28_fec_gpio_pads[] __initconst = {
22 /* PHY POWER */
23 MX28_PAD_PWM4__GPIO_3_29 |
24 MXS_PAD_4MA | MXS_PAD_NOPULL | MXS_PAD_3V3,
25 /* PHY RESET */
26 MX28_PAD_ENET0_RX_CLK__GPIO_4_13 |
27 MXS_PAD_4MA | MXS_PAD_NOPULL | MXS_PAD_3V3,
28 /* Mode strap pins 0-2 */
29 MX28_PAD_ENET0_RXD0__GPIO_4_3 |
30 MXS_PAD_8MA | MXS_PAD_PULLUP | MXS_PAD_3V3,
31 MX28_PAD_ENET0_RXD1__GPIO_4_4 |
32 MXS_PAD_8MA | MXS_PAD_PULLUP | MXS_PAD_3V3,
33 MX28_PAD_ENET0_RX_EN__GPIO_4_2 |
34 MXS_PAD_8MA | MXS_PAD_PULLUP | MXS_PAD_3V3,
35 /* nINT */
36 MX28_PAD_ENET0_TX_CLK__GPIO_4_5 |
37 MXS_PAD_4MA | MXS_PAD_NOPULL | MXS_PAD_3V3,
38
39 MX28_PAD_ENET0_MDC__GPIO_4_0,
40 MX28_PAD_ENET0_MDIO__GPIO_4_1,
41 MX28_PAD_ENET0_TX_EN__GPIO_4_6,
42 MX28_PAD_ENET0_TXD0__GPIO_4_7,
43 MX28_PAD_ENET0_TXD1__GPIO_4_8,
44 MX28_PAD_ENET_CLK__GPIO_4_16,
45};
46
47#define FEC_MODE (MXS_PAD_8MA | MXS_PAD_PULLUP | MXS_PAD_3V3)
48static const iomux_cfg_t tx28_fec_pads[] __initconst = {
49 MX28_PAD_ENET0_MDC__ENET0_MDC | FEC_MODE,
50 MX28_PAD_ENET0_MDIO__ENET0_MDIO | FEC_MODE,
51 MX28_PAD_ENET0_RX_EN__ENET0_RX_EN | FEC_MODE,
52 MX28_PAD_ENET0_RXD0__ENET0_RXD0 | FEC_MODE,
53 MX28_PAD_ENET0_RXD1__ENET0_RXD1 | FEC_MODE,
54 MX28_PAD_ENET0_TX_EN__ENET0_TX_EN | FEC_MODE,
55 MX28_PAD_ENET0_TXD0__ENET0_TXD0 | FEC_MODE,
56 MX28_PAD_ENET0_TXD1__ENET0_TXD1 | FEC_MODE,
57 MX28_PAD_ENET_CLK__CLKCTRL_ENET | FEC_MODE,
58};
59
60static const struct fec_platform_data tx28_fec_data __initconst = {
61 .phy = PHY_INTERFACE_MODE_RMII,
62};
63
64int __init tx28_add_fec0(void)
65{
66 int i, ret;
67
68 pr_debug("%s: Switching FEC PHY power off\n", __func__);
69 ret = mxs_iomux_setup_multiple_pads(tx28_fec_gpio_pads,
70 ARRAY_SIZE(tx28_fec_gpio_pads));
71 for (i = 0; i < ARRAY_SIZE(tx28_fec_gpio_pads); i++) {
72 unsigned int gpio = MXS_GPIO_NR(PAD_BANK(tx28_fec_gpio_pads[i]),
73 PAD_PIN(tx28_fec_gpio_pads[i]));
74
75 ret = gpio_request(gpio, "FEC");
76 if (ret) {
77 pr_err("Failed to request GPIO_%d_%d: %d\n",
78 PAD_BANK(tx28_fec_gpio_pads[i]),
79 PAD_PIN(tx28_fec_gpio_pads[i]), ret);
80 goto free_gpios;
81 }
82 ret = gpio_direction_output(gpio, 0);
83 if (ret) {
84 pr_err("Failed to set direction of GPIO_%d_%d to output: %d\n",
85 gpio / 32 + 1, gpio % 32, ret);
86 goto free_gpios;
87 }
88 }
89
90 /* Power up fec phy */
91 pr_debug("%s: Switching FEC PHY power on\n", __func__);
92 ret = gpio_direction_output(TX28_FEC_PHY_POWER, 1);
93 if (ret) {
94 pr_err("Failed to power on PHY: %d\n", ret);
95 goto free_gpios;
96 }
97 mdelay(26); /* 25ms according to data sheet */
98
99 /* nINT */
100 gpio_direction_input(MXS_GPIO_NR(4, 5));
101 /* Mode strap pins */
102 gpio_direction_output(MXS_GPIO_NR(4, 2), 1);
103 gpio_direction_output(MXS_GPIO_NR(4, 3), 1);
104 gpio_direction_output(MXS_GPIO_NR(4, 4), 1);
105
106 udelay(100); /* minimum assertion time for nRST */
107
108 pr_debug("%s: Deasserting FEC PHY RESET\n", __func__);
109 gpio_set_value(TX28_FEC_PHY_RESET, 1);
110
111 ret = mxs_iomux_setup_multiple_pads(tx28_fec_pads,
112 ARRAY_SIZE(tx28_fec_pads));
113 if (ret) {
114 pr_debug("%s: mxs_iomux_setup_multiple_pads() failed with rc: %d\n",
115 __func__, ret);
116 goto free_gpios;
117 }
118 pr_debug("%s: Registering FEC device\n", __func__);
119 mx28_add_fec(0, &tx28_fec_data);
120 return 0;
121
122free_gpios:
123 while (--i >= 0) {
124 unsigned int gpio = MXS_GPIO_NR(PAD_BANK(tx28_fec_gpio_pads[i]),
125 PAD_PIN(tx28_fec_gpio_pads[i]));
126
127 gpio_free(gpio);
128 }
129
130 return ret;
131}
diff --git a/arch/arm/mach-mxs/module-tx28.h b/arch/arm/mach-mxs/module-tx28.h
new file mode 100644
index 000000000000..df9e1b6e81bf
--- /dev/null
+++ b/arch/arm/mach-mxs/module-tx28.h
@@ -0,0 +1,9 @@
1/*
2 * Copyright (C) 2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9int __init tx28_add_fec0(void);
diff --git a/arch/arm/mach-mxs/ocotp.c b/arch/arm/mach-mxs/ocotp.c
new file mode 100644
index 000000000000..65157a35dbba
--- /dev/null
+++ b/arch/arm/mach-mxs/ocotp.c
@@ -0,0 +1,90 @@
1/*
2 * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15#include <linux/delay.h>
16#include <linux/err.h>
17#include <linux/mutex.h>
18
19#include <mach/mxs.h>
20
21#define OCOTP_WORD_OFFSET 0x20
22#define OCOTP_WORD_COUNT 0x20
23
24#define BM_OCOTP_CTRL_BUSY (1 << 8)
25#define BM_OCOTP_CTRL_ERROR (1 << 9)
26#define BM_OCOTP_CTRL_RD_BANK_OPEN (1 << 12)
27
28static DEFINE_MUTEX(ocotp_mutex);
29static u32 ocotp_words[OCOTP_WORD_COUNT];
30
31const u32 *mxs_get_ocotp(void)
32{
33 void __iomem *ocotp_base = MXS_IO_ADDRESS(MXS_OCOTP_BASE_ADDR);
34 int timeout = 0x400;
35 size_t i;
36 static int once = 0;
37
38 if (once)
39 return ocotp_words;
40
41 mutex_lock(&ocotp_mutex);
42
43 /*
44 * clk_enable(hbus_clk) for ocotp can be skipped
45 * as it must be on when system is running.
46 */
47
48 /* try to clear ERROR bit */
49 __mxs_clrl(BM_OCOTP_CTRL_ERROR, ocotp_base);
50
51 /* check both BUSY and ERROR cleared */
52 while ((__raw_readl(ocotp_base) &
53 (BM_OCOTP_CTRL_BUSY | BM_OCOTP_CTRL_ERROR)) && --timeout)
54 cpu_relax();
55
56 if (unlikely(!timeout))
57 goto error_unlock;
58
59 /* open OCOTP banks for read */
60 __mxs_setl(BM_OCOTP_CTRL_RD_BANK_OPEN, ocotp_base);
61
62 /* approximately wait 32 hclk cycles */
63 udelay(1);
64
65 /* poll BUSY bit becoming cleared */
66 timeout = 0x400;
67 while ((__raw_readl(ocotp_base) & BM_OCOTP_CTRL_BUSY) && --timeout)
68 cpu_relax();
69
70 if (unlikely(!timeout))
71 goto error_unlock;
72
73 for (i = 0; i < OCOTP_WORD_COUNT; i++)
74 ocotp_words[i] = __raw_readl(ocotp_base + OCOTP_WORD_OFFSET +
75 i * 0x10);
76
77 /* close banks for power saving */
78 __mxs_clrl(BM_OCOTP_CTRL_RD_BANK_OPEN, ocotp_base);
79
80 once = 1;
81
82 mutex_unlock(&ocotp_mutex);
83
84 return ocotp_words;
85
86error_unlock:
87 mutex_unlock(&ocotp_mutex);
88 pr_err("%s: timeout in reading OCOTP\n", __func__);
89 return NULL;
90}
diff --git a/arch/arm/mach-mxs/pm.c b/arch/arm/mach-mxs/pm.c
new file mode 100644
index 000000000000..fb042da29bda
--- /dev/null
+++ b/arch/arm/mach-mxs/pm.c
@@ -0,0 +1,43 @@
1/*
2 * Copyright (C) 2010 Freescale Semiconductor, Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15#include <linux/kernel.h>
16#include <linux/suspend.h>
17#include <linux/io.h>
18#include <mach/system.h>
19
20static int mxs_suspend_enter(suspend_state_t state)
21{
22 switch (state) {
23 case PM_SUSPEND_MEM:
24 arch_idle();
25 break;
26
27 default:
28 return -EINVAL;
29 }
30 return 0;
31}
32
33static struct platform_suspend_ops mxs_suspend_ops = {
34 .enter = mxs_suspend_enter,
35 .valid = suspend_valid_only_mem,
36};
37
38static int __init mxs_pm_init(void)
39{
40 suspend_set_ops(&mxs_suspend_ops);
41 return 0;
42}
43device_initcall(mxs_pm_init);
diff --git a/arch/arm/mach-mxs/regs-clkctrl-mx23.h b/arch/arm/mach-mxs/regs-clkctrl-mx23.h
index dbc04747b691..0ea5c9d0e2b2 100644
--- a/arch/arm/mach-mxs/regs-clkctrl-mx23.h
+++ b/arch/arm/mach-mxs/regs-clkctrl-mx23.h
@@ -33,10 +33,6 @@
33#define HW_CLKCTRL_PLLCTRL0_CLR (0x00000008) 33#define HW_CLKCTRL_PLLCTRL0_CLR (0x00000008)
34#define HW_CLKCTRL_PLLCTRL0_TOG (0x0000000c) 34#define HW_CLKCTRL_PLLCTRL0_TOG (0x0000000c)
35 35
36#define BP_CLKCTRL_PLLCTRL0_RSRVD6 30
37#define BM_CLKCTRL_PLLCTRL0_RSRVD6 0xC0000000
38#define BF_CLKCTRL_PLLCTRL0_RSRVD6(v) \
39 (((v) << 30) & BM_CLKCTRL_PLLCTRL0_RSRVD6)
40#define BP_CLKCTRL_PLLCTRL0_LFR_SEL 28 36#define BP_CLKCTRL_PLLCTRL0_LFR_SEL 28
41#define BM_CLKCTRL_PLLCTRL0_LFR_SEL 0x30000000 37#define BM_CLKCTRL_PLLCTRL0_LFR_SEL 0x30000000
42#define BF_CLKCTRL_PLLCTRL0_LFR_SEL(v) \ 38#define BF_CLKCTRL_PLLCTRL0_LFR_SEL(v) \
@@ -45,10 +41,6 @@
45#define BV_CLKCTRL_PLLCTRL0_LFR_SEL__TIMES_2 0x1 41#define BV_CLKCTRL_PLLCTRL0_LFR_SEL__TIMES_2 0x1
46#define BV_CLKCTRL_PLLCTRL0_LFR_SEL__TIMES_05 0x2 42#define BV_CLKCTRL_PLLCTRL0_LFR_SEL__TIMES_05 0x2
47#define BV_CLKCTRL_PLLCTRL0_LFR_SEL__UNDEFINED 0x3 43#define BV_CLKCTRL_PLLCTRL0_LFR_SEL__UNDEFINED 0x3
48#define BP_CLKCTRL_PLLCTRL0_RSRVD5 26
49#define BM_CLKCTRL_PLLCTRL0_RSRVD5 0x0C000000
50#define BF_CLKCTRL_PLLCTRL0_RSRVD5(v) \
51 (((v) << 26) & BM_CLKCTRL_PLLCTRL0_RSRVD5)
52#define BP_CLKCTRL_PLLCTRL0_CP_SEL 24 44#define BP_CLKCTRL_PLLCTRL0_CP_SEL 24
53#define BM_CLKCTRL_PLLCTRL0_CP_SEL 0x03000000 45#define BM_CLKCTRL_PLLCTRL0_CP_SEL 0x03000000
54#define BF_CLKCTRL_PLLCTRL0_CP_SEL(v) \ 46#define BF_CLKCTRL_PLLCTRL0_CP_SEL(v) \
@@ -57,10 +49,6 @@
57#define BV_CLKCTRL_PLLCTRL0_CP_SEL__TIMES_2 0x1 49#define BV_CLKCTRL_PLLCTRL0_CP_SEL__TIMES_2 0x1
58#define BV_CLKCTRL_PLLCTRL0_CP_SEL__TIMES_05 0x2 50#define BV_CLKCTRL_PLLCTRL0_CP_SEL__TIMES_05 0x2
59#define BV_CLKCTRL_PLLCTRL0_CP_SEL__UNDEFINED 0x3 51#define BV_CLKCTRL_PLLCTRL0_CP_SEL__UNDEFINED 0x3
60#define BP_CLKCTRL_PLLCTRL0_RSRVD4 22
61#define BM_CLKCTRL_PLLCTRL0_RSRVD4 0x00C00000
62#define BF_CLKCTRL_PLLCTRL0_RSRVD4(v) \
63 (((v) << 22) & BM_CLKCTRL_PLLCTRL0_RSRVD4)
64#define BP_CLKCTRL_PLLCTRL0_DIV_SEL 20 52#define BP_CLKCTRL_PLLCTRL0_DIV_SEL 20
65#define BM_CLKCTRL_PLLCTRL0_DIV_SEL 0x00300000 53#define BM_CLKCTRL_PLLCTRL0_DIV_SEL 0x00300000
66#define BF_CLKCTRL_PLLCTRL0_DIV_SEL(v) \ 54#define BF_CLKCTRL_PLLCTRL0_DIV_SEL(v) \
@@ -69,23 +57,13 @@
69#define BV_CLKCTRL_PLLCTRL0_DIV_SEL__LOWER 0x1 57#define BV_CLKCTRL_PLLCTRL0_DIV_SEL__LOWER 0x1
70#define BV_CLKCTRL_PLLCTRL0_DIV_SEL__LOWEST 0x2 58#define BV_CLKCTRL_PLLCTRL0_DIV_SEL__LOWEST 0x2
71#define BV_CLKCTRL_PLLCTRL0_DIV_SEL__UNDEFINED 0x3 59#define BV_CLKCTRL_PLLCTRL0_DIV_SEL__UNDEFINED 0x3
72#define BM_CLKCTRL_PLLCTRL0_RSRVD3 0x00080000
73#define BM_CLKCTRL_PLLCTRL0_EN_USB_CLKS 0x00040000 60#define BM_CLKCTRL_PLLCTRL0_EN_USB_CLKS 0x00040000
74#define BM_CLKCTRL_PLLCTRL0_RSRVD2 0x00020000
75#define BM_CLKCTRL_PLLCTRL0_POWER 0x00010000 61#define BM_CLKCTRL_PLLCTRL0_POWER 0x00010000
76#define BP_CLKCTRL_PLLCTRL0_RSRVD1 0
77#define BM_CLKCTRL_PLLCTRL0_RSRVD1 0x0000FFFF
78#define BF_CLKCTRL_PLLCTRL0_RSRVD1(v) \
79 (((v) << 0) & BM_CLKCTRL_PLLCTRL0_RSRVD1)
80 62
81#define HW_CLKCTRL_PLLCTRL1 (0x00000010) 63#define HW_CLKCTRL_PLLCTRL1 (0x00000010)
82 64
83#define BM_CLKCTRL_PLLCTRL1_LOCK 0x80000000 65#define BM_CLKCTRL_PLLCTRL1_LOCK 0x80000000
84#define BM_CLKCTRL_PLLCTRL1_FORCE_LOCK 0x40000000 66#define BM_CLKCTRL_PLLCTRL1_FORCE_LOCK 0x40000000
85#define BP_CLKCTRL_PLLCTRL1_RSRVD1 16
86#define BM_CLKCTRL_PLLCTRL1_RSRVD1 0x3FFF0000
87#define BF_CLKCTRL_PLLCTRL1_RSRVD1(v) \
88 (((v) << 16) & BM_CLKCTRL_PLLCTRL1_RSRVD1)
89#define BP_CLKCTRL_PLLCTRL1_LOCK_COUNT 0 67#define BP_CLKCTRL_PLLCTRL1_LOCK_COUNT 0
90#define BM_CLKCTRL_PLLCTRL1_LOCK_COUNT 0x0000FFFF 68#define BM_CLKCTRL_PLLCTRL1_LOCK_COUNT 0x0000FFFF
91#define BF_CLKCTRL_PLLCTRL1_LOCK_COUNT(v) \ 69#define BF_CLKCTRL_PLLCTRL1_LOCK_COUNT(v) \
@@ -96,29 +74,15 @@
96#define HW_CLKCTRL_CPU_CLR (0x00000028) 74#define HW_CLKCTRL_CPU_CLR (0x00000028)
97#define HW_CLKCTRL_CPU_TOG (0x0000002c) 75#define HW_CLKCTRL_CPU_TOG (0x0000002c)
98 76
99#define BP_CLKCTRL_CPU_RSRVD5 30
100#define BM_CLKCTRL_CPU_RSRVD5 0xC0000000
101#define BF_CLKCTRL_CPU_RSRVD5(v) \
102 (((v) << 30) & BM_CLKCTRL_CPU_RSRVD5)
103#define BM_CLKCTRL_CPU_BUSY_REF_XTAL 0x20000000 77#define BM_CLKCTRL_CPU_BUSY_REF_XTAL 0x20000000
104#define BM_CLKCTRL_CPU_BUSY_REF_CPU 0x10000000 78#define BM_CLKCTRL_CPU_BUSY_REF_CPU 0x10000000
105#define BM_CLKCTRL_CPU_RSRVD4 0x08000000
106#define BM_CLKCTRL_CPU_DIV_XTAL_FRAC_EN 0x04000000 79#define BM_CLKCTRL_CPU_DIV_XTAL_FRAC_EN 0x04000000
107#define BP_CLKCTRL_CPU_DIV_XTAL 16 80#define BP_CLKCTRL_CPU_DIV_XTAL 16
108#define BM_CLKCTRL_CPU_DIV_XTAL 0x03FF0000 81#define BM_CLKCTRL_CPU_DIV_XTAL 0x03FF0000
109#define BF_CLKCTRL_CPU_DIV_XTAL(v) \ 82#define BF_CLKCTRL_CPU_DIV_XTAL(v) \
110 (((v) << 16) & BM_CLKCTRL_CPU_DIV_XTAL) 83 (((v) << 16) & BM_CLKCTRL_CPU_DIV_XTAL)
111#define BP_CLKCTRL_CPU_RSRVD3 13
112#define BM_CLKCTRL_CPU_RSRVD3 0x0000E000
113#define BF_CLKCTRL_CPU_RSRVD3(v) \
114 (((v) << 13) & BM_CLKCTRL_CPU_RSRVD3)
115#define BM_CLKCTRL_CPU_INTERRUPT_WAIT 0x00001000 84#define BM_CLKCTRL_CPU_INTERRUPT_WAIT 0x00001000
116#define BM_CLKCTRL_CPU_RSRVD2 0x00000800
117#define BM_CLKCTRL_CPU_DIV_CPU_FRAC_EN 0x00000400 85#define BM_CLKCTRL_CPU_DIV_CPU_FRAC_EN 0x00000400
118#define BP_CLKCTRL_CPU_RSRVD1 6
119#define BM_CLKCTRL_CPU_RSRVD1 0x000003C0
120#define BF_CLKCTRL_CPU_RSRVD1(v) \
121 (((v) << 6) & BM_CLKCTRL_CPU_RSRVD1)
122#define BP_CLKCTRL_CPU_DIV_CPU 0 86#define BP_CLKCTRL_CPU_DIV_CPU 0
123#define BM_CLKCTRL_CPU_DIV_CPU 0x0000003F 87#define BM_CLKCTRL_CPU_DIV_CPU 0x0000003F
124#define BF_CLKCTRL_CPU_DIV_CPU(v) \ 88#define BF_CLKCTRL_CPU_DIV_CPU(v) \
@@ -129,10 +93,6 @@
129#define HW_CLKCTRL_HBUS_CLR (0x00000038) 93#define HW_CLKCTRL_HBUS_CLR (0x00000038)
130#define HW_CLKCTRL_HBUS_TOG (0x0000003c) 94#define HW_CLKCTRL_HBUS_TOG (0x0000003c)
131 95
132#define BP_CLKCTRL_HBUS_RSRVD4 30
133#define BM_CLKCTRL_HBUS_RSRVD4 0xC0000000
134#define BF_CLKCTRL_HBUS_RSRVD4(v) \
135 (((v) << 30) & BM_CLKCTRL_HBUS_RSRVD4)
136#define BM_CLKCTRL_HBUS_BUSY 0x20000000 96#define BM_CLKCTRL_HBUS_BUSY 0x20000000
137#define BM_CLKCTRL_HBUS_DCP_AS_ENABLE 0x10000000 97#define BM_CLKCTRL_HBUS_DCP_AS_ENABLE 0x10000000
138#define BM_CLKCTRL_HBUS_PXP_AS_ENABLE 0x08000000 98#define BM_CLKCTRL_HBUS_PXP_AS_ENABLE 0x08000000
@@ -143,7 +103,6 @@
143#define BM_CLKCTRL_HBUS_CPU_DATA_AS_ENABLE 0x00400000 103#define BM_CLKCTRL_HBUS_CPU_DATA_AS_ENABLE 0x00400000
144#define BM_CLKCTRL_HBUS_CPU_INSTR_AS_ENABLE 0x00200000 104#define BM_CLKCTRL_HBUS_CPU_INSTR_AS_ENABLE 0x00200000
145#define BM_CLKCTRL_HBUS_AUTO_SLOW_MODE 0x00100000 105#define BM_CLKCTRL_HBUS_AUTO_SLOW_MODE 0x00100000
146#define BM_CLKCTRL_HBUS_RSRVD2 0x00080000
147#define BP_CLKCTRL_HBUS_SLOW_DIV 16 106#define BP_CLKCTRL_HBUS_SLOW_DIV 16
148#define BM_CLKCTRL_HBUS_SLOW_DIV 0x00070000 107#define BM_CLKCTRL_HBUS_SLOW_DIV 0x00070000
149#define BF_CLKCTRL_HBUS_SLOW_DIV(v) \ 108#define BF_CLKCTRL_HBUS_SLOW_DIV(v) \
@@ -154,10 +113,6 @@
154#define BV_CLKCTRL_HBUS_SLOW_DIV__BY8 0x3 113#define BV_CLKCTRL_HBUS_SLOW_DIV__BY8 0x3
155#define BV_CLKCTRL_HBUS_SLOW_DIV__BY16 0x4 114#define BV_CLKCTRL_HBUS_SLOW_DIV__BY16 0x4
156#define BV_CLKCTRL_HBUS_SLOW_DIV__BY32 0x5 115#define BV_CLKCTRL_HBUS_SLOW_DIV__BY32 0x5
157#define BP_CLKCTRL_HBUS_RSRVD1 6
158#define BM_CLKCTRL_HBUS_RSRVD1 0x0000FFC0
159#define BF_CLKCTRL_HBUS_RSRVD1(v) \
160 (((v) << 6) & BM_CLKCTRL_HBUS_RSRVD1)
161#define BM_CLKCTRL_HBUS_DIV_FRAC_EN 0x00000020 116#define BM_CLKCTRL_HBUS_DIV_FRAC_EN 0x00000020
162#define BP_CLKCTRL_HBUS_DIV 0 117#define BP_CLKCTRL_HBUS_DIV 0
163#define BM_CLKCTRL_HBUS_DIV 0x0000001F 118#define BM_CLKCTRL_HBUS_DIV 0x0000001F
@@ -167,10 +122,6 @@
167#define HW_CLKCTRL_XBUS (0x00000040) 122#define HW_CLKCTRL_XBUS (0x00000040)
168 123
169#define BM_CLKCTRL_XBUS_BUSY 0x80000000 124#define BM_CLKCTRL_XBUS_BUSY 0x80000000
170#define BP_CLKCTRL_XBUS_RSRVD1 11
171#define BM_CLKCTRL_XBUS_RSRVD1 0x7FFFF800
172#define BF_CLKCTRL_XBUS_RSRVD1(v) \
173 (((v) << 11) & BM_CLKCTRL_XBUS_RSRVD1)
174#define BM_CLKCTRL_XBUS_DIV_FRAC_EN 0x00000400 125#define BM_CLKCTRL_XBUS_DIV_FRAC_EN 0x00000400
175#define BP_CLKCTRL_XBUS_DIV 0 126#define BP_CLKCTRL_XBUS_DIV 0
176#define BM_CLKCTRL_XBUS_DIV 0x000003FF 127#define BM_CLKCTRL_XBUS_DIV 0x000003FF
@@ -192,10 +143,6 @@
192#define BM_CLKCTRL_XTAL_DIGCTRL_CLK1M_GATE 0x08000000 143#define BM_CLKCTRL_XTAL_DIGCTRL_CLK1M_GATE 0x08000000
193#define BP_CLKCTRL_XTAL_TIMROT_CLK32K_GATE 26 144#define BP_CLKCTRL_XTAL_TIMROT_CLK32K_GATE 26
194#define BM_CLKCTRL_XTAL_TIMROT_CLK32K_GATE 0x04000000 145#define BM_CLKCTRL_XTAL_TIMROT_CLK32K_GATE 0x04000000
195#define BP_CLKCTRL_XTAL_RSRVD1 2
196#define BM_CLKCTRL_XTAL_RSRVD1 0x03FFFFFC
197#define BF_CLKCTRL_XTAL_RSRVD1(v) \
198 (((v) << 2) & BM_CLKCTRL_XTAL_RSRVD1)
199#define BP_CLKCTRL_XTAL_DIV_UART 0 146#define BP_CLKCTRL_XTAL_DIV_UART 0
200#define BM_CLKCTRL_XTAL_DIV_UART 0x00000003 147#define BM_CLKCTRL_XTAL_DIV_UART 0x00000003
201#define BF_CLKCTRL_XTAL_DIV_UART(v) \ 148#define BF_CLKCTRL_XTAL_DIV_UART(v) \
@@ -205,12 +152,7 @@
205 152
206#define BP_CLKCTRL_PIX_CLKGATE 31 153#define BP_CLKCTRL_PIX_CLKGATE 31
207#define BM_CLKCTRL_PIX_CLKGATE 0x80000000 154#define BM_CLKCTRL_PIX_CLKGATE 0x80000000
208#define BM_CLKCTRL_PIX_RSRVD2 0x40000000
209#define BM_CLKCTRL_PIX_BUSY 0x20000000 155#define BM_CLKCTRL_PIX_BUSY 0x20000000
210#define BP_CLKCTRL_PIX_RSRVD1 13
211#define BM_CLKCTRL_PIX_RSRVD1 0x1FFFE000
212#define BF_CLKCTRL_PIX_RSRVD1(v) \
213 (((v) << 13) & BM_CLKCTRL_PIX_RSRVD1)
214#define BM_CLKCTRL_PIX_DIV_FRAC_EN 0x00001000 156#define BM_CLKCTRL_PIX_DIV_FRAC_EN 0x00001000
215#define BP_CLKCTRL_PIX_DIV 0 157#define BP_CLKCTRL_PIX_DIV 0
216#define BM_CLKCTRL_PIX_DIV 0x00000FFF 158#define BM_CLKCTRL_PIX_DIV 0x00000FFF
@@ -221,12 +163,7 @@
221 163
222#define BP_CLKCTRL_SSP_CLKGATE 31 164#define BP_CLKCTRL_SSP_CLKGATE 31
223#define BM_CLKCTRL_SSP_CLKGATE 0x80000000 165#define BM_CLKCTRL_SSP_CLKGATE 0x80000000
224#define BM_CLKCTRL_SSP_RSRVD2 0x40000000
225#define BM_CLKCTRL_SSP_BUSY 0x20000000 166#define BM_CLKCTRL_SSP_BUSY 0x20000000
226#define BP_CLKCTRL_SSP_RSRVD1 10
227#define BM_CLKCTRL_SSP_RSRVD1 0x1FFFFC00
228#define BF_CLKCTRL_SSP_RSRVD1(v) \
229 (((v) << 10) & BM_CLKCTRL_SSP_RSRVD1)
230#define BM_CLKCTRL_SSP_DIV_FRAC_EN 0x00000200 167#define BM_CLKCTRL_SSP_DIV_FRAC_EN 0x00000200
231#define BP_CLKCTRL_SSP_DIV 0 168#define BP_CLKCTRL_SSP_DIV 0
232#define BM_CLKCTRL_SSP_DIV 0x000001FF 169#define BM_CLKCTRL_SSP_DIV 0x000001FF
@@ -237,12 +174,7 @@
237 174
238#define BP_CLKCTRL_GPMI_CLKGATE 31 175#define BP_CLKCTRL_GPMI_CLKGATE 31
239#define BM_CLKCTRL_GPMI_CLKGATE 0x80000000 176#define BM_CLKCTRL_GPMI_CLKGATE 0x80000000
240#define BM_CLKCTRL_GPMI_RSRVD2 0x40000000
241#define BM_CLKCTRL_GPMI_BUSY 0x20000000 177#define BM_CLKCTRL_GPMI_BUSY 0x20000000
242#define BP_CLKCTRL_GPMI_RSRVD1 11
243#define BM_CLKCTRL_GPMI_RSRVD1 0x1FFFF800
244#define BF_CLKCTRL_GPMI_RSRVD1(v) \
245 (((v) << 11) & BM_CLKCTRL_GPMI_RSRVD1)
246#define BM_CLKCTRL_GPMI_DIV_FRAC_EN 0x00000400 178#define BM_CLKCTRL_GPMI_DIV_FRAC_EN 0x00000400
247#define BP_CLKCTRL_GPMI_DIV 0 179#define BP_CLKCTRL_GPMI_DIV 0
248#define BM_CLKCTRL_GPMI_DIV 0x000003FF 180#define BM_CLKCTRL_GPMI_DIV 0x000003FF
@@ -252,10 +184,6 @@
252#define HW_CLKCTRL_SPDIF (0x00000090) 184#define HW_CLKCTRL_SPDIF (0x00000090)
253 185
254#define BM_CLKCTRL_SPDIF_CLKGATE 0x80000000 186#define BM_CLKCTRL_SPDIF_CLKGATE 0x80000000
255#define BP_CLKCTRL_SPDIF_RSRVD 0
256#define BM_CLKCTRL_SPDIF_RSRVD 0x7FFFFFFF
257#define BF_CLKCTRL_SPDIF_RSRVD(v) \
258 (((v) << 0) & BM_CLKCTRL_SPDIF_RSRVD)
259 187
260#define HW_CLKCTRL_EMI (0x000000a0) 188#define HW_CLKCTRL_EMI (0x000000a0)
261 189
@@ -266,24 +194,12 @@
266#define BM_CLKCTRL_EMI_BUSY_REF_EMI 0x10000000 194#define BM_CLKCTRL_EMI_BUSY_REF_EMI 0x10000000
267#define BM_CLKCTRL_EMI_BUSY_REF_CPU 0x08000000 195#define BM_CLKCTRL_EMI_BUSY_REF_CPU 0x08000000
268#define BM_CLKCTRL_EMI_BUSY_SYNC_MODE 0x04000000 196#define BM_CLKCTRL_EMI_BUSY_SYNC_MODE 0x04000000
269#define BP_CLKCTRL_EMI_RSRVD3 18
270#define BM_CLKCTRL_EMI_RSRVD3 0x03FC0000
271#define BF_CLKCTRL_EMI_RSRVD3(v) \
272 (((v) << 18) & BM_CLKCTRL_EMI_RSRVD3)
273#define BM_CLKCTRL_EMI_BUSY_DCC_RESYNC 0x00020000 197#define BM_CLKCTRL_EMI_BUSY_DCC_RESYNC 0x00020000
274#define BM_CLKCTRL_EMI_DCC_RESYNC_ENABLE 0x00010000 198#define BM_CLKCTRL_EMI_DCC_RESYNC_ENABLE 0x00010000
275#define BP_CLKCTRL_EMI_RSRVD2 12
276#define BM_CLKCTRL_EMI_RSRVD2 0x0000F000
277#define BF_CLKCTRL_EMI_RSRVD2(v) \
278 (((v) << 12) & BM_CLKCTRL_EMI_RSRVD2)
279#define BP_CLKCTRL_EMI_DIV_XTAL 8 199#define BP_CLKCTRL_EMI_DIV_XTAL 8
280#define BM_CLKCTRL_EMI_DIV_XTAL 0x00000F00 200#define BM_CLKCTRL_EMI_DIV_XTAL 0x00000F00
281#define BF_CLKCTRL_EMI_DIV_XTAL(v) \ 201#define BF_CLKCTRL_EMI_DIV_XTAL(v) \
282 (((v) << 8) & BM_CLKCTRL_EMI_DIV_XTAL) 202 (((v) << 8) & BM_CLKCTRL_EMI_DIV_XTAL)
283#define BP_CLKCTRL_EMI_RSRVD1 6
284#define BM_CLKCTRL_EMI_RSRVD1 0x000000C0
285#define BF_CLKCTRL_EMI_RSRVD1(v) \
286 (((v) << 6) & BM_CLKCTRL_EMI_RSRVD1)
287#define BP_CLKCTRL_EMI_DIV_EMI 0 203#define BP_CLKCTRL_EMI_DIV_EMI 0
288#define BM_CLKCTRL_EMI_DIV_EMI 0x0000003F 204#define BM_CLKCTRL_EMI_DIV_EMI 0x0000003F
289#define BF_CLKCTRL_EMI_DIV_EMI(v) \ 205#define BF_CLKCTRL_EMI_DIV_EMI(v) \
@@ -292,22 +208,13 @@
292#define HW_CLKCTRL_IR (0x000000b0) 208#define HW_CLKCTRL_IR (0x000000b0)
293 209
294#define BM_CLKCTRL_IR_CLKGATE 0x80000000 210#define BM_CLKCTRL_IR_CLKGATE 0x80000000
295#define BM_CLKCTRL_IR_RSRVD3 0x40000000
296#define BM_CLKCTRL_IR_AUTO_DIV 0x20000000 211#define BM_CLKCTRL_IR_AUTO_DIV 0x20000000
297#define BM_CLKCTRL_IR_IR_BUSY 0x10000000 212#define BM_CLKCTRL_IR_IR_BUSY 0x10000000
298#define BM_CLKCTRL_IR_IROV_BUSY 0x08000000 213#define BM_CLKCTRL_IR_IROV_BUSY 0x08000000
299#define BP_CLKCTRL_IR_RSRVD2 25
300#define BM_CLKCTRL_IR_RSRVD2 0x06000000
301#define BF_CLKCTRL_IR_RSRVD2(v) \
302 (((v) << 25) & BM_CLKCTRL_IR_RSRVD2)
303#define BP_CLKCTRL_IR_IROV_DIV 16 214#define BP_CLKCTRL_IR_IROV_DIV 16
304#define BM_CLKCTRL_IR_IROV_DIV 0x01FF0000 215#define BM_CLKCTRL_IR_IROV_DIV 0x01FF0000
305#define BF_CLKCTRL_IR_IROV_DIV(v) \ 216#define BF_CLKCTRL_IR_IROV_DIV(v) \
306 (((v) << 16) & BM_CLKCTRL_IR_IROV_DIV) 217 (((v) << 16) & BM_CLKCTRL_IR_IROV_DIV)
307#define BP_CLKCTRL_IR_RSRVD1 10
308#define BM_CLKCTRL_IR_RSRVD1 0x0000FC00
309#define BF_CLKCTRL_IR_RSRVD1(v) \
310 (((v) << 10) & BM_CLKCTRL_IR_RSRVD1)
311#define BP_CLKCTRL_IR_IR_DIV 0 218#define BP_CLKCTRL_IR_IR_DIV 0
312#define BM_CLKCTRL_IR_IR_DIV 0x000003FF 219#define BM_CLKCTRL_IR_IR_DIV 0x000003FF
313#define BF_CLKCTRL_IR_IR_DIV(v) \ 220#define BF_CLKCTRL_IR_IR_DIV(v) \
@@ -316,12 +223,7 @@
316#define HW_CLKCTRL_SAIF (0x000000c0) 223#define HW_CLKCTRL_SAIF (0x000000c0)
317 224
318#define BM_CLKCTRL_SAIF_CLKGATE 0x80000000 225#define BM_CLKCTRL_SAIF_CLKGATE 0x80000000
319#define BM_CLKCTRL_SAIF_RSRVD2 0x40000000
320#define BM_CLKCTRL_SAIF_BUSY 0x20000000 226#define BM_CLKCTRL_SAIF_BUSY 0x20000000
321#define BP_CLKCTRL_SAIF_RSRVD1 17
322#define BM_CLKCTRL_SAIF_RSRVD1 0x1FFE0000
323#define BF_CLKCTRL_SAIF_RSRVD1(v) \
324 (((v) << 17) & BM_CLKCTRL_SAIF_RSRVD1)
325#define BM_CLKCTRL_SAIF_DIV_FRAC_EN 0x00010000 227#define BM_CLKCTRL_SAIF_DIV_FRAC_EN 0x00010000
326#define BP_CLKCTRL_SAIF_DIV 0 228#define BP_CLKCTRL_SAIF_DIV 0
327#define BM_CLKCTRL_SAIF_DIV 0x0000FFFF 229#define BM_CLKCTRL_SAIF_DIV 0x0000FFFF
@@ -332,20 +234,11 @@
332 234
333#define BM_CLKCTRL_TV_CLK_TV108M_GATE 0x80000000 235#define BM_CLKCTRL_TV_CLK_TV108M_GATE 0x80000000
334#define BM_CLKCTRL_TV_CLK_TV_GATE 0x40000000 236#define BM_CLKCTRL_TV_CLK_TV_GATE 0x40000000
335#define BP_CLKCTRL_TV_RSRVD 0
336#define BM_CLKCTRL_TV_RSRVD 0x3FFFFFFF
337#define BF_CLKCTRL_TV_RSRVD(v) \
338 (((v) << 0) & BM_CLKCTRL_TV_RSRVD)
339 237
340#define HW_CLKCTRL_ETM (0x000000e0) 238#define HW_CLKCTRL_ETM (0x000000e0)
341 239
342#define BM_CLKCTRL_ETM_CLKGATE 0x80000000 240#define BM_CLKCTRL_ETM_CLKGATE 0x80000000
343#define BM_CLKCTRL_ETM_RSRVD2 0x40000000
344#define BM_CLKCTRL_ETM_BUSY 0x20000000 241#define BM_CLKCTRL_ETM_BUSY 0x20000000
345#define BP_CLKCTRL_ETM_RSRVD1 7
346#define BM_CLKCTRL_ETM_RSRVD1 0x1FFFFF80
347#define BF_CLKCTRL_ETM_RSRVD1(v) \
348 (((v) << 7) & BM_CLKCTRL_ETM_RSRVD1)
349#define BM_CLKCTRL_ETM_DIV_FRAC_EN 0x00000040 242#define BM_CLKCTRL_ETM_DIV_FRAC_EN 0x00000040
350#define BP_CLKCTRL_ETM_DIV 0 243#define BP_CLKCTRL_ETM_DIV 0
351#define BM_CLKCTRL_ETM_DIV 0x0000003F 244#define BM_CLKCTRL_ETM_DIV 0x0000003F
@@ -393,36 +286,23 @@
393 286
394#define BM_CLKCTRL_FRAC1_CLKGATEVID 0x80000000 287#define BM_CLKCTRL_FRAC1_CLKGATEVID 0x80000000
395#define BM_CLKCTRL_FRAC1_VID_STABLE 0x40000000 288#define BM_CLKCTRL_FRAC1_VID_STABLE 0x40000000
396#define BP_CLKCTRL_FRAC1_RSRVD1 0
397#define BM_CLKCTRL_FRAC1_RSRVD1 0x3FFFFFFF
398#define BF_CLKCTRL_FRAC1_RSRVD1(v) \
399 (((v) << 0) & BM_CLKCTRL_FRAC1_RSRVD1)
400 289
401#define HW_CLKCTRL_CLKSEQ (0x00000110) 290#define HW_CLKCTRL_CLKSEQ (0x00000110)
402#define HW_CLKCTRL_CLKSEQ_SET (0x00000114) 291#define HW_CLKCTRL_CLKSEQ_SET (0x00000114)
403#define HW_CLKCTRL_CLKSEQ_CLR (0x00000118) 292#define HW_CLKCTRL_CLKSEQ_CLR (0x00000118)
404#define HW_CLKCTRL_CLKSEQ_TOG (0x0000011c) 293#define HW_CLKCTRL_CLKSEQ_TOG (0x0000011c)
405 294
406#define BP_CLKCTRL_CLKSEQ_RSRVD1 9
407#define BM_CLKCTRL_CLKSEQ_RSRVD1 0xFFFFFE00
408#define BF_CLKCTRL_CLKSEQ_RSRVD1(v) \
409 (((v) << 9) & BM_CLKCTRL_CLKSEQ_RSRVD1)
410#define BM_CLKCTRL_CLKSEQ_BYPASS_ETM 0x00000100 295#define BM_CLKCTRL_CLKSEQ_BYPASS_ETM 0x00000100
411#define BM_CLKCTRL_CLKSEQ_BYPASS_CPU 0x00000080 296#define BM_CLKCTRL_CLKSEQ_BYPASS_CPU 0x00000080
412#define BM_CLKCTRL_CLKSEQ_BYPASS_EMI 0x00000040 297#define BM_CLKCTRL_CLKSEQ_BYPASS_EMI 0x00000040
413#define BM_CLKCTRL_CLKSEQ_BYPASS_SSP 0x00000020 298#define BM_CLKCTRL_CLKSEQ_BYPASS_SSP 0x00000020
414#define BM_CLKCTRL_CLKSEQ_BYPASS_GPMI 0x00000010 299#define BM_CLKCTRL_CLKSEQ_BYPASS_GPMI 0x00000010
415#define BM_CLKCTRL_CLKSEQ_BYPASS_IR 0x00000008 300#define BM_CLKCTRL_CLKSEQ_BYPASS_IR 0x00000008
416#define BM_CLKCTRL_CLKSEQ_RSRVD0 0x00000004
417#define BM_CLKCTRL_CLKSEQ_BYPASS_PIX 0x00000002 301#define BM_CLKCTRL_CLKSEQ_BYPASS_PIX 0x00000002
418#define BM_CLKCTRL_CLKSEQ_BYPASS_SAIF 0x00000001 302#define BM_CLKCTRL_CLKSEQ_BYPASS_SAIF 0x00000001
419 303
420#define HW_CLKCTRL_RESET (0x00000120) 304#define HW_CLKCTRL_RESET (0x00000120)
421 305
422#define BP_CLKCTRL_RESET_RSRVD 2
423#define BM_CLKCTRL_RESET_RSRVD 0xFFFFFFFC
424#define BF_CLKCTRL_RESET_RSRVD(v) \
425 (((v) << 2) & BM_CLKCTRL_RESET_RSRVD)
426#define BM_CLKCTRL_RESET_CHIP 0x00000002 306#define BM_CLKCTRL_RESET_CHIP 0x00000002
427#define BM_CLKCTRL_RESET_DIG 0x00000001 307#define BM_CLKCTRL_RESET_DIG 0x00000001
428 308
@@ -432,10 +312,6 @@
432#define BM_CLKCTRL_STATUS_CPU_LIMIT 0xC0000000 312#define BM_CLKCTRL_STATUS_CPU_LIMIT 0xC0000000
433#define BF_CLKCTRL_STATUS_CPU_LIMIT(v) \ 313#define BF_CLKCTRL_STATUS_CPU_LIMIT(v) \
434 (((v) << 30) & BM_CLKCTRL_STATUS_CPU_LIMIT) 314 (((v) << 30) & BM_CLKCTRL_STATUS_CPU_LIMIT)
435#define BP_CLKCTRL_STATUS_RSRVD 0
436#define BM_CLKCTRL_STATUS_RSRVD 0x3FFFFFFF
437#define BF_CLKCTRL_STATUS_RSRVD(v) \
438 (((v) << 0) & BM_CLKCTRL_STATUS_RSRVD)
439 315
440#define HW_CLKCTRL_VERSION (0x00000140) 316#define HW_CLKCTRL_VERSION (0x00000140)
441 317
diff --git a/arch/arm/mach-mxs/regs-clkctrl-mx28.h b/arch/arm/mach-mxs/regs-clkctrl-mx28.h
index 661df18755f7..7d1b061d7943 100644
--- a/arch/arm/mach-mxs/regs-clkctrl-mx28.h
+++ b/arch/arm/mach-mxs/regs-clkctrl-mx28.h
@@ -31,10 +31,6 @@
31#define HW_CLKCTRL_PLL0CTRL0_CLR (0x00000008) 31#define HW_CLKCTRL_PLL0CTRL0_CLR (0x00000008)
32#define HW_CLKCTRL_PLL0CTRL0_TOG (0x0000000c) 32#define HW_CLKCTRL_PLL0CTRL0_TOG (0x0000000c)
33 33
34#define BP_CLKCTRL_PLL0CTRL0_RSRVD6 30
35#define BM_CLKCTRL_PLL0CTRL0_RSRVD6 0xC0000000
36#define BF_CLKCTRL_PLL0CTRL0_RSRVD6(v) \
37 (((v) << 30) & BM_CLKCTRL_PLL0CTRL0_RSRVD6)
38#define BP_CLKCTRL_PLL0CTRL0_LFR_SEL 28 34#define BP_CLKCTRL_PLL0CTRL0_LFR_SEL 28
39#define BM_CLKCTRL_PLL0CTRL0_LFR_SEL 0x30000000 35#define BM_CLKCTRL_PLL0CTRL0_LFR_SEL 0x30000000
40#define BF_CLKCTRL_PLL0CTRL0_LFR_SEL(v) \ 36#define BF_CLKCTRL_PLL0CTRL0_LFR_SEL(v) \
@@ -43,10 +39,6 @@
43#define BV_CLKCTRL_PLL0CTRL0_LFR_SEL__TIMES_2 0x1 39#define BV_CLKCTRL_PLL0CTRL0_LFR_SEL__TIMES_2 0x1
44#define BV_CLKCTRL_PLL0CTRL0_LFR_SEL__TIMES_05 0x2 40#define BV_CLKCTRL_PLL0CTRL0_LFR_SEL__TIMES_05 0x2
45#define BV_CLKCTRL_PLL0CTRL0_LFR_SEL__UNDEFINED 0x3 41#define BV_CLKCTRL_PLL0CTRL0_LFR_SEL__UNDEFINED 0x3
46#define BP_CLKCTRL_PLL0CTRL0_RSRVD5 26
47#define BM_CLKCTRL_PLL0CTRL0_RSRVD5 0x0C000000
48#define BF_CLKCTRL_PLL0CTRL0_RSRVD5(v) \
49 (((v) << 26) & BM_CLKCTRL_PLL0CTRL0_RSRVD5)
50#define BP_CLKCTRL_PLL0CTRL0_CP_SEL 24 42#define BP_CLKCTRL_PLL0CTRL0_CP_SEL 24
51#define BM_CLKCTRL_PLL0CTRL0_CP_SEL 0x03000000 43#define BM_CLKCTRL_PLL0CTRL0_CP_SEL 0x03000000
52#define BF_CLKCTRL_PLL0CTRL0_CP_SEL(v) \ 44#define BF_CLKCTRL_PLL0CTRL0_CP_SEL(v) \
@@ -55,10 +47,6 @@
55#define BV_CLKCTRL_PLL0CTRL0_CP_SEL__TIMES_2 0x1 47#define BV_CLKCTRL_PLL0CTRL0_CP_SEL__TIMES_2 0x1
56#define BV_CLKCTRL_PLL0CTRL0_CP_SEL__TIMES_05 0x2 48#define BV_CLKCTRL_PLL0CTRL0_CP_SEL__TIMES_05 0x2
57#define BV_CLKCTRL_PLL0CTRL0_CP_SEL__UNDEFINED 0x3 49#define BV_CLKCTRL_PLL0CTRL0_CP_SEL__UNDEFINED 0x3
58#define BP_CLKCTRL_PLL0CTRL0_RSRVD4 22
59#define BM_CLKCTRL_PLL0CTRL0_RSRVD4 0x00C00000
60#define BF_CLKCTRL_PLL0CTRL0_RSRVD4(v) \
61 (((v) << 22) & BM_CLKCTRL_PLL0CTRL0_RSRVD4)
62#define BP_CLKCTRL_PLL0CTRL0_DIV_SEL 20 50#define BP_CLKCTRL_PLL0CTRL0_DIV_SEL 20
63#define BM_CLKCTRL_PLL0CTRL0_DIV_SEL 0x00300000 51#define BM_CLKCTRL_PLL0CTRL0_DIV_SEL 0x00300000
64#define BF_CLKCTRL_PLL0CTRL0_DIV_SEL(v) \ 52#define BF_CLKCTRL_PLL0CTRL0_DIV_SEL(v) \
@@ -67,22 +55,13 @@
67#define BV_CLKCTRL_PLL0CTRL0_DIV_SEL__LOWER 0x1 55#define BV_CLKCTRL_PLL0CTRL0_DIV_SEL__LOWER 0x1
68#define BV_CLKCTRL_PLL0CTRL0_DIV_SEL__LOWEST 0x2 56#define BV_CLKCTRL_PLL0CTRL0_DIV_SEL__LOWEST 0x2
69#define BV_CLKCTRL_PLL0CTRL0_DIV_SEL__UNDEFINED 0x3 57#define BV_CLKCTRL_PLL0CTRL0_DIV_SEL__UNDEFINED 0x3
70#define BM_CLKCTRL_PLL0CTRL0_RSRVD3 0x00080000
71#define BM_CLKCTRL_PLL0CTRL0_EN_USB_CLKS 0x00040000 58#define BM_CLKCTRL_PLL0CTRL0_EN_USB_CLKS 0x00040000
72#define BM_CLKCTRL_PLL0CTRL0_POWER 0x00020000 59#define BM_CLKCTRL_PLL0CTRL0_POWER 0x00020000
73#define BP_CLKCTRL_PLL0CTRL0_RSRVD1 0
74#define BM_CLKCTRL_PLL0CTRL0_RSRVD1 0x0001FFFF
75#define BF_CLKCTRL_PLL0CTRL0_RSRVD1(v) \
76 (((v) << 0) & BM_CLKCTRL_PLL0CTRL0_RSRVD1)
77 60
78#define HW_CLKCTRL_PLL0CTRL1 (0x00000010) 61#define HW_CLKCTRL_PLL0CTRL1 (0x00000010)
79 62
80#define BM_CLKCTRL_PLL0CTRL1_LOCK 0x80000000 63#define BM_CLKCTRL_PLL0CTRL1_LOCK 0x80000000
81#define BM_CLKCTRL_PLL0CTRL1_FORCE_LOCK 0x40000000 64#define BM_CLKCTRL_PLL0CTRL1_FORCE_LOCK 0x40000000
82#define BP_CLKCTRL_PLL0CTRL1_RSRVD1 16
83#define BM_CLKCTRL_PLL0CTRL1_RSRVD1 0x3FFF0000
84#define BF_CLKCTRL_PLL0CTRL1_RSRVD1(v) \
85 (((v) << 16) & BM_CLKCTRL_PLL0CTRL1_RSRVD1)
86#define BP_CLKCTRL_PLL0CTRL1_LOCK_COUNT 0 65#define BP_CLKCTRL_PLL0CTRL1_LOCK_COUNT 0
87#define BM_CLKCTRL_PLL0CTRL1_LOCK_COUNT 0x0000FFFF 66#define BM_CLKCTRL_PLL0CTRL1_LOCK_COUNT 0x0000FFFF
88#define BF_CLKCTRL_PLL0CTRL1_LOCK_COUNT(v) \ 67#define BF_CLKCTRL_PLL0CTRL1_LOCK_COUNT(v) \
@@ -94,7 +73,6 @@
94#define HW_CLKCTRL_PLL1CTRL0_TOG (0x0000002c) 73#define HW_CLKCTRL_PLL1CTRL0_TOG (0x0000002c)
95 74
96#define BM_CLKCTRL_PLL1CTRL0_CLKGATEEMI 0x80000000 75#define BM_CLKCTRL_PLL1CTRL0_CLKGATEEMI 0x80000000
97#define BM_CLKCTRL_PLL1CTRL0_RSRVD6 0x40000000
98#define BP_CLKCTRL_PLL1CTRL0_LFR_SEL 28 76#define BP_CLKCTRL_PLL1CTRL0_LFR_SEL 28
99#define BM_CLKCTRL_PLL1CTRL0_LFR_SEL 0x30000000 77#define BM_CLKCTRL_PLL1CTRL0_LFR_SEL 0x30000000
100#define BF_CLKCTRL_PLL1CTRL0_LFR_SEL(v) \ 78#define BF_CLKCTRL_PLL1CTRL0_LFR_SEL(v) \
@@ -103,10 +81,6 @@
103#define BV_CLKCTRL_PLL1CTRL0_LFR_SEL__TIMES_2 0x1 81#define BV_CLKCTRL_PLL1CTRL0_LFR_SEL__TIMES_2 0x1
104#define BV_CLKCTRL_PLL1CTRL0_LFR_SEL__TIMES_05 0x2 82#define BV_CLKCTRL_PLL1CTRL0_LFR_SEL__TIMES_05 0x2
105#define BV_CLKCTRL_PLL1CTRL0_LFR_SEL__UNDEFINED 0x3 83#define BV_CLKCTRL_PLL1CTRL0_LFR_SEL__UNDEFINED 0x3
106#define BP_CLKCTRL_PLL1CTRL0_RSRVD5 26
107#define BM_CLKCTRL_PLL1CTRL0_RSRVD5 0x0C000000
108#define BF_CLKCTRL_PLL1CTRL0_RSRVD5(v) \
109 (((v) << 26) & BM_CLKCTRL_PLL1CTRL0_RSRVD5)
110#define BP_CLKCTRL_PLL1CTRL0_CP_SEL 24 84#define BP_CLKCTRL_PLL1CTRL0_CP_SEL 24
111#define BM_CLKCTRL_PLL1CTRL0_CP_SEL 0x03000000 85#define BM_CLKCTRL_PLL1CTRL0_CP_SEL 0x03000000
112#define BF_CLKCTRL_PLL1CTRL0_CP_SEL(v) \ 86#define BF_CLKCTRL_PLL1CTRL0_CP_SEL(v) \
@@ -115,10 +89,6 @@
115#define BV_CLKCTRL_PLL1CTRL0_CP_SEL__TIMES_2 0x1 89#define BV_CLKCTRL_PLL1CTRL0_CP_SEL__TIMES_2 0x1
116#define BV_CLKCTRL_PLL1CTRL0_CP_SEL__TIMES_05 0x2 90#define BV_CLKCTRL_PLL1CTRL0_CP_SEL__TIMES_05 0x2
117#define BV_CLKCTRL_PLL1CTRL0_CP_SEL__UNDEFINED 0x3 91#define BV_CLKCTRL_PLL1CTRL0_CP_SEL__UNDEFINED 0x3
118#define BP_CLKCTRL_PLL1CTRL0_RSRVD4 22
119#define BM_CLKCTRL_PLL1CTRL0_RSRVD4 0x00C00000
120#define BF_CLKCTRL_PLL1CTRL0_RSRVD4(v) \
121 (((v) << 22) & BM_CLKCTRL_PLL1CTRL0_RSRVD4)
122#define BP_CLKCTRL_PLL1CTRL0_DIV_SEL 20 92#define BP_CLKCTRL_PLL1CTRL0_DIV_SEL 20
123#define BM_CLKCTRL_PLL1CTRL0_DIV_SEL 0x00300000 93#define BM_CLKCTRL_PLL1CTRL0_DIV_SEL 0x00300000
124#define BF_CLKCTRL_PLL1CTRL0_DIV_SEL(v) \ 94#define BF_CLKCTRL_PLL1CTRL0_DIV_SEL(v) \
@@ -127,22 +97,13 @@
127#define BV_CLKCTRL_PLL1CTRL0_DIV_SEL__LOWER 0x1 97#define BV_CLKCTRL_PLL1CTRL0_DIV_SEL__LOWER 0x1
128#define BV_CLKCTRL_PLL1CTRL0_DIV_SEL__LOWEST 0x2 98#define BV_CLKCTRL_PLL1CTRL0_DIV_SEL__LOWEST 0x2
129#define BV_CLKCTRL_PLL1CTRL0_DIV_SEL__UNDEFINED 0x3 99#define BV_CLKCTRL_PLL1CTRL0_DIV_SEL__UNDEFINED 0x3
130#define BM_CLKCTRL_PLL1CTRL0_RSRVD3 0x00080000
131#define BM_CLKCTRL_PLL1CTRL0_EN_USB_CLKS 0x00040000 100#define BM_CLKCTRL_PLL1CTRL0_EN_USB_CLKS 0x00040000
132#define BM_CLKCTRL_PLL1CTRL0_POWER 0x00020000 101#define BM_CLKCTRL_PLL1CTRL0_POWER 0x00020000
133#define BP_CLKCTRL_PLL1CTRL0_RSRVD1 0
134#define BM_CLKCTRL_PLL1CTRL0_RSRVD1 0x0001FFFF
135#define BF_CLKCTRL_PLL1CTRL0_RSRVD1(v) \
136 (((v) << 0) & BM_CLKCTRL_PLL1CTRL0_RSRVD1)
137 102
138#define HW_CLKCTRL_PLL1CTRL1 (0x00000030) 103#define HW_CLKCTRL_PLL1CTRL1 (0x00000030)
139 104
140#define BM_CLKCTRL_PLL1CTRL1_LOCK 0x80000000 105#define BM_CLKCTRL_PLL1CTRL1_LOCK 0x80000000
141#define BM_CLKCTRL_PLL1CTRL1_FORCE_LOCK 0x40000000 106#define BM_CLKCTRL_PLL1CTRL1_FORCE_LOCK 0x40000000
142#define BP_CLKCTRL_PLL1CTRL1_RSRVD1 16
143#define BM_CLKCTRL_PLL1CTRL1_RSRVD1 0x3FFF0000
144#define BF_CLKCTRL_PLL1CTRL1_RSRVD1(v) \
145 (((v) << 16) & BM_CLKCTRL_PLL1CTRL1_RSRVD1)
146#define BP_CLKCTRL_PLL1CTRL1_LOCK_COUNT 0 107#define BP_CLKCTRL_PLL1CTRL1_LOCK_COUNT 0
147#define BM_CLKCTRL_PLL1CTRL1_LOCK_COUNT 0x0000FFFF 108#define BM_CLKCTRL_PLL1CTRL1_LOCK_COUNT 0x0000FFFF
148#define BF_CLKCTRL_PLL1CTRL1_LOCK_COUNT(v) \ 109#define BF_CLKCTRL_PLL1CTRL1_LOCK_COUNT(v) \
@@ -154,51 +115,31 @@
154#define HW_CLKCTRL_PLL2CTRL0_TOG (0x0000004c) 115#define HW_CLKCTRL_PLL2CTRL0_TOG (0x0000004c)
155 116
156#define BM_CLKCTRL_PLL2CTRL0_CLKGATE 0x80000000 117#define BM_CLKCTRL_PLL2CTRL0_CLKGATE 0x80000000
157#define BM_CLKCTRL_PLL2CTRL0_RSRVD3 0x40000000
158#define BP_CLKCTRL_PLL2CTRL0_LFR_SEL 28 118#define BP_CLKCTRL_PLL2CTRL0_LFR_SEL 28
159#define BM_CLKCTRL_PLL2CTRL0_LFR_SEL 0x30000000 119#define BM_CLKCTRL_PLL2CTRL0_LFR_SEL 0x30000000
160#define BF_CLKCTRL_PLL2CTRL0_LFR_SEL(v) \ 120#define BF_CLKCTRL_PLL2CTRL0_LFR_SEL(v) \
161 (((v) << 28) & BM_CLKCTRL_PLL2CTRL0_LFR_SEL) 121 (((v) << 28) & BM_CLKCTRL_PLL2CTRL0_LFR_SEL)
162#define BM_CLKCTRL_PLL2CTRL0_RSRVD2 0x08000000
163#define BM_CLKCTRL_PLL2CTRL0_HOLD_RING_OFF_B 0x04000000 122#define BM_CLKCTRL_PLL2CTRL0_HOLD_RING_OFF_B 0x04000000
164#define BP_CLKCTRL_PLL2CTRL0_CP_SEL 24 123#define BP_CLKCTRL_PLL2CTRL0_CP_SEL 24
165#define BM_CLKCTRL_PLL2CTRL0_CP_SEL 0x03000000 124#define BM_CLKCTRL_PLL2CTRL0_CP_SEL 0x03000000
166#define BF_CLKCTRL_PLL2CTRL0_CP_SEL(v) \ 125#define BF_CLKCTRL_PLL2CTRL0_CP_SEL(v) \
167 (((v) << 24) & BM_CLKCTRL_PLL2CTRL0_CP_SEL) 126 (((v) << 24) & BM_CLKCTRL_PLL2CTRL0_CP_SEL)
168#define BM_CLKCTRL_PLL2CTRL0_POWER 0x00800000 127#define BM_CLKCTRL_PLL2CTRL0_POWER 0x00800000
169#define BP_CLKCTRL_PLL2CTRL0_RSRVD1 0
170#define BM_CLKCTRL_PLL2CTRL0_RSRVD1 0x007FFFFF
171#define BF_CLKCTRL_PLL2CTRL0_RSRVD1(v) \
172 (((v) << 0) & BM_CLKCTRL_PLL2CTRL0_RSRVD1)
173 128
174#define HW_CLKCTRL_CPU (0x00000050) 129#define HW_CLKCTRL_CPU (0x00000050)
175#define HW_CLKCTRL_CPU_SET (0x00000054) 130#define HW_CLKCTRL_CPU_SET (0x00000054)
176#define HW_CLKCTRL_CPU_CLR (0x00000058) 131#define HW_CLKCTRL_CPU_CLR (0x00000058)
177#define HW_CLKCTRL_CPU_TOG (0x0000005c) 132#define HW_CLKCTRL_CPU_TOG (0x0000005c)
178 133
179#define BP_CLKCTRL_CPU_RSRVD5 30
180#define BM_CLKCTRL_CPU_RSRVD5 0xC0000000
181#define BF_CLKCTRL_CPU_RSRVD5(v) \
182 (((v) << 30) & BM_CLKCTRL_CPU_RSRVD5)
183#define BM_CLKCTRL_CPU_BUSY_REF_XTAL 0x20000000 134#define BM_CLKCTRL_CPU_BUSY_REF_XTAL 0x20000000
184#define BM_CLKCTRL_CPU_BUSY_REF_CPU 0x10000000 135#define BM_CLKCTRL_CPU_BUSY_REF_CPU 0x10000000
185#define BM_CLKCTRL_CPU_RSRVD4 0x08000000
186#define BM_CLKCTRL_CPU_DIV_XTAL_FRAC_EN 0x04000000 136#define BM_CLKCTRL_CPU_DIV_XTAL_FRAC_EN 0x04000000
187#define BP_CLKCTRL_CPU_DIV_XTAL 16 137#define BP_CLKCTRL_CPU_DIV_XTAL 16
188#define BM_CLKCTRL_CPU_DIV_XTAL 0x03FF0000 138#define BM_CLKCTRL_CPU_DIV_XTAL 0x03FF0000
189#define BF_CLKCTRL_CPU_DIV_XTAL(v) \ 139#define BF_CLKCTRL_CPU_DIV_XTAL(v) \
190 (((v) << 16) & BM_CLKCTRL_CPU_DIV_XTAL) 140 (((v) << 16) & BM_CLKCTRL_CPU_DIV_XTAL)
191#define BP_CLKCTRL_CPU_RSRVD3 13
192#define BM_CLKCTRL_CPU_RSRVD3 0x0000E000
193#define BF_CLKCTRL_CPU_RSRVD3(v) \
194 (((v) << 13) & BM_CLKCTRL_CPU_RSRVD3)
195#define BM_CLKCTRL_CPU_INTERRUPT_WAIT 0x00001000 141#define BM_CLKCTRL_CPU_INTERRUPT_WAIT 0x00001000
196#define BM_CLKCTRL_CPU_RSRVD2 0x00000800
197#define BM_CLKCTRL_CPU_DIV_CPU_FRAC_EN 0x00000400 142#define BM_CLKCTRL_CPU_DIV_CPU_FRAC_EN 0x00000400
198#define BP_CLKCTRL_CPU_RSRVD1 6
199#define BM_CLKCTRL_CPU_RSRVD1 0x000003C0
200#define BF_CLKCTRL_CPU_RSRVD1(v) \
201 (((v) << 6) & BM_CLKCTRL_CPU_RSRVD1)
202#define BP_CLKCTRL_CPU_DIV_CPU 0 143#define BP_CLKCTRL_CPU_DIV_CPU 0
203#define BM_CLKCTRL_CPU_DIV_CPU 0x0000003F 144#define BM_CLKCTRL_CPU_DIV_CPU 0x0000003F
204#define BF_CLKCTRL_CPU_DIV_CPU(v) \ 145#define BF_CLKCTRL_CPU_DIV_CPU(v) \
@@ -212,7 +153,6 @@
212#define BM_CLKCTRL_HBUS_ASM_BUSY 0x80000000 153#define BM_CLKCTRL_HBUS_ASM_BUSY 0x80000000
213#define BM_CLKCTRL_HBUS_DCP_AS_ENABLE 0x40000000 154#define BM_CLKCTRL_HBUS_DCP_AS_ENABLE 0x40000000
214#define BM_CLKCTRL_HBUS_PXP_AS_ENABLE 0x20000000 155#define BM_CLKCTRL_HBUS_PXP_AS_ENABLE 0x20000000
215#define BM_CLKCTRL_HBUS_RSRVD2 0x10000000
216#define BM_CLKCTRL_HBUS_ASM_EMIPORT_AS_ENABLE 0x08000000 156#define BM_CLKCTRL_HBUS_ASM_EMIPORT_AS_ENABLE 0x08000000
217#define BM_CLKCTRL_HBUS_APBHDMA_AS_ENABLE 0x04000000 157#define BM_CLKCTRL_HBUS_APBHDMA_AS_ENABLE 0x04000000
218#define BM_CLKCTRL_HBUS_APBXDMA_AS_ENABLE 0x02000000 158#define BM_CLKCTRL_HBUS_APBXDMA_AS_ENABLE 0x02000000
@@ -232,10 +172,6 @@
232#define BV_CLKCTRL_HBUS_SLOW_DIV__BY8 0x3 172#define BV_CLKCTRL_HBUS_SLOW_DIV__BY8 0x3
233#define BV_CLKCTRL_HBUS_SLOW_DIV__BY16 0x4 173#define BV_CLKCTRL_HBUS_SLOW_DIV__BY16 0x4
234#define BV_CLKCTRL_HBUS_SLOW_DIV__BY32 0x5 174#define BV_CLKCTRL_HBUS_SLOW_DIV__BY32 0x5
235#define BP_CLKCTRL_HBUS_RSRVD1 6
236#define BM_CLKCTRL_HBUS_RSRVD1 0x0000FFC0
237#define BF_CLKCTRL_HBUS_RSRVD1(v) \
238 (((v) << 6) & BM_CLKCTRL_HBUS_RSRVD1)
239#define BM_CLKCTRL_HBUS_DIV_FRAC_EN 0x00000020 175#define BM_CLKCTRL_HBUS_DIV_FRAC_EN 0x00000020
240#define BP_CLKCTRL_HBUS_DIV 0 176#define BP_CLKCTRL_HBUS_DIV 0
241#define BM_CLKCTRL_HBUS_DIV 0x0000001F 177#define BM_CLKCTRL_HBUS_DIV 0x0000001F
@@ -245,10 +181,6 @@
245#define HW_CLKCTRL_XBUS (0x00000070) 181#define HW_CLKCTRL_XBUS (0x00000070)
246 182
247#define BM_CLKCTRL_XBUS_BUSY 0x80000000 183#define BM_CLKCTRL_XBUS_BUSY 0x80000000
248#define BP_CLKCTRL_XBUS_RSRVD1 12
249#define BM_CLKCTRL_XBUS_RSRVD1 0x7FFFF000
250#define BF_CLKCTRL_XBUS_RSRVD1(v) \
251 (((v) << 12) & BM_CLKCTRL_XBUS_RSRVD1)
252#define BM_CLKCTRL_XBUS_AUTO_CLEAR_DIV_ENABLE 0x00000800 184#define BM_CLKCTRL_XBUS_AUTO_CLEAR_DIV_ENABLE 0x00000800
253#define BM_CLKCTRL_XBUS_DIV_FRAC_EN 0x00000400 185#define BM_CLKCTRL_XBUS_DIV_FRAC_EN 0x00000400
254#define BP_CLKCTRL_XBUS_DIV 0 186#define BP_CLKCTRL_XBUS_DIV 0
@@ -263,19 +195,10 @@
263 195
264#define BP_CLKCTRL_XTAL_UART_CLK_GATE 31 196#define BP_CLKCTRL_XTAL_UART_CLK_GATE 31
265#define BM_CLKCTRL_XTAL_UART_CLK_GATE 0x80000000 197#define BM_CLKCTRL_XTAL_UART_CLK_GATE 0x80000000
266#define BM_CLKCTRL_XTAL_RSRVD3 0x40000000
267#define BP_CLKCTRL_XTAL_PWM_CLK24M_GATE 29 198#define BP_CLKCTRL_XTAL_PWM_CLK24M_GATE 29
268#define BM_CLKCTRL_XTAL_PWM_CLK24M_GATE 0x20000000 199#define BM_CLKCTRL_XTAL_PWM_CLK24M_GATE 0x20000000
269#define BP_CLKCTRL_XTAL_RSRVD2 27
270#define BM_CLKCTRL_XTAL_RSRVD2 0x18000000
271#define BF_CLKCTRL_XTAL_RSRVD2(v) \
272 (((v) << 27) & BM_CLKCTRL_XTAL_RSRVD2)
273#define BP_CLKCTRL_XTAL_TIMROT_CLK32K_GATE 26 200#define BP_CLKCTRL_XTAL_TIMROT_CLK32K_GATE 26
274#define BM_CLKCTRL_XTAL_TIMROT_CLK32K_GATE 0x04000000 201#define BM_CLKCTRL_XTAL_TIMROT_CLK32K_GATE 0x04000000
275#define BP_CLKCTRL_XTAL_RSRVD1 2
276#define BM_CLKCTRL_XTAL_RSRVD1 0x03FFFFFC
277#define BF_CLKCTRL_XTAL_RSRVD1(v) \
278 (((v) << 2) & BM_CLKCTRL_XTAL_RSRVD1)
279#define BP_CLKCTRL_XTAL_DIV_UART 0 202#define BP_CLKCTRL_XTAL_DIV_UART 0
280#define BM_CLKCTRL_XTAL_DIV_UART 0x00000003 203#define BM_CLKCTRL_XTAL_DIV_UART 0x00000003
281#define BF_CLKCTRL_XTAL_DIV_UART(v) \ 204#define BF_CLKCTRL_XTAL_DIV_UART(v) \
@@ -285,12 +208,7 @@
285 208
286#define BP_CLKCTRL_SSP0_CLKGATE 31 209#define BP_CLKCTRL_SSP0_CLKGATE 31
287#define BM_CLKCTRL_SSP0_CLKGATE 0x80000000 210#define BM_CLKCTRL_SSP0_CLKGATE 0x80000000
288#define BM_CLKCTRL_SSP0_RSRVD2 0x40000000
289#define BM_CLKCTRL_SSP0_BUSY 0x20000000 211#define BM_CLKCTRL_SSP0_BUSY 0x20000000
290#define BP_CLKCTRL_SSP0_RSRVD1 10
291#define BM_CLKCTRL_SSP0_RSRVD1 0x1FFFFC00
292#define BF_CLKCTRL_SSP0_RSRVD1(v) \
293 (((v) << 10) & BM_CLKCTRL_SSP0_RSRVD1)
294#define BM_CLKCTRL_SSP0_DIV_FRAC_EN 0x00000200 212#define BM_CLKCTRL_SSP0_DIV_FRAC_EN 0x00000200
295#define BP_CLKCTRL_SSP0_DIV 0 213#define BP_CLKCTRL_SSP0_DIV 0
296#define BM_CLKCTRL_SSP0_DIV 0x000001FF 214#define BM_CLKCTRL_SSP0_DIV 0x000001FF
@@ -301,12 +219,7 @@
301 219
302#define BP_CLKCTRL_SSP1_CLKGATE 31 220#define BP_CLKCTRL_SSP1_CLKGATE 31
303#define BM_CLKCTRL_SSP1_CLKGATE 0x80000000 221#define BM_CLKCTRL_SSP1_CLKGATE 0x80000000
304#define BM_CLKCTRL_SSP1_RSRVD2 0x40000000
305#define BM_CLKCTRL_SSP1_BUSY 0x20000000 222#define BM_CLKCTRL_SSP1_BUSY 0x20000000
306#define BP_CLKCTRL_SSP1_RSRVD1 10
307#define BM_CLKCTRL_SSP1_RSRVD1 0x1FFFFC00
308#define BF_CLKCTRL_SSP1_RSRVD1(v) \
309 (((v) << 10) & BM_CLKCTRL_SSP1_RSRVD1)
310#define BM_CLKCTRL_SSP1_DIV_FRAC_EN 0x00000200 223#define BM_CLKCTRL_SSP1_DIV_FRAC_EN 0x00000200
311#define BP_CLKCTRL_SSP1_DIV 0 224#define BP_CLKCTRL_SSP1_DIV 0
312#define BM_CLKCTRL_SSP1_DIV 0x000001FF 225#define BM_CLKCTRL_SSP1_DIV 0x000001FF
@@ -317,12 +230,7 @@
317 230
318#define BP_CLKCTRL_SSP2_CLKGATE 31 231#define BP_CLKCTRL_SSP2_CLKGATE 31
319#define BM_CLKCTRL_SSP2_CLKGATE 0x80000000 232#define BM_CLKCTRL_SSP2_CLKGATE 0x80000000
320#define BM_CLKCTRL_SSP2_RSRVD2 0x40000000
321#define BM_CLKCTRL_SSP2_BUSY 0x20000000 233#define BM_CLKCTRL_SSP2_BUSY 0x20000000
322#define BP_CLKCTRL_SSP2_RSRVD1 10
323#define BM_CLKCTRL_SSP2_RSRVD1 0x1FFFFC00
324#define BF_CLKCTRL_SSP2_RSRVD1(v) \
325 (((v) << 10) & BM_CLKCTRL_SSP2_RSRVD1)
326#define BM_CLKCTRL_SSP2_DIV_FRAC_EN 0x00000200 234#define BM_CLKCTRL_SSP2_DIV_FRAC_EN 0x00000200
327#define BP_CLKCTRL_SSP2_DIV 0 235#define BP_CLKCTRL_SSP2_DIV 0
328#define BM_CLKCTRL_SSP2_DIV 0x000001FF 236#define BM_CLKCTRL_SSP2_DIV 0x000001FF
@@ -333,12 +241,7 @@
333 241
334#define BP_CLKCTRL_SSP3_CLKGATE 31 242#define BP_CLKCTRL_SSP3_CLKGATE 31
335#define BM_CLKCTRL_SSP3_CLKGATE 0x80000000 243#define BM_CLKCTRL_SSP3_CLKGATE 0x80000000
336#define BM_CLKCTRL_SSP3_RSRVD2 0x40000000
337#define BM_CLKCTRL_SSP3_BUSY 0x20000000 244#define BM_CLKCTRL_SSP3_BUSY 0x20000000
338#define BP_CLKCTRL_SSP3_RSRVD1 10
339#define BM_CLKCTRL_SSP3_RSRVD1 0x1FFFFC00
340#define BF_CLKCTRL_SSP3_RSRVD1(v) \
341 (((v) << 10) & BM_CLKCTRL_SSP3_RSRVD1)
342#define BM_CLKCTRL_SSP3_DIV_FRAC_EN 0x00000200 245#define BM_CLKCTRL_SSP3_DIV_FRAC_EN 0x00000200
343#define BP_CLKCTRL_SSP3_DIV 0 246#define BP_CLKCTRL_SSP3_DIV 0
344#define BM_CLKCTRL_SSP3_DIV 0x000001FF 247#define BM_CLKCTRL_SSP3_DIV 0x000001FF
@@ -349,12 +252,7 @@
349 252
350#define BP_CLKCTRL_GPMI_CLKGATE 31 253#define BP_CLKCTRL_GPMI_CLKGATE 31
351#define BM_CLKCTRL_GPMI_CLKGATE 0x80000000 254#define BM_CLKCTRL_GPMI_CLKGATE 0x80000000
352#define BM_CLKCTRL_GPMI_RSRVD2 0x40000000
353#define BM_CLKCTRL_GPMI_BUSY 0x20000000 255#define BM_CLKCTRL_GPMI_BUSY 0x20000000
354#define BP_CLKCTRL_GPMI_RSRVD1 11
355#define BM_CLKCTRL_GPMI_RSRVD1 0x1FFFF800
356#define BF_CLKCTRL_GPMI_RSRVD1(v) \
357 (((v) << 11) & BM_CLKCTRL_GPMI_RSRVD1)
358#define BM_CLKCTRL_GPMI_DIV_FRAC_EN 0x00000400 256#define BM_CLKCTRL_GPMI_DIV_FRAC_EN 0x00000400
359#define BP_CLKCTRL_GPMI_DIV 0 257#define BP_CLKCTRL_GPMI_DIV 0
360#define BM_CLKCTRL_GPMI_DIV 0x000003FF 258#define BM_CLKCTRL_GPMI_DIV 0x000003FF
@@ -365,10 +263,6 @@
365 263
366#define BP_CLKCTRL_SPDIF_CLKGATE 31 264#define BP_CLKCTRL_SPDIF_CLKGATE 31
367#define BM_CLKCTRL_SPDIF_CLKGATE 0x80000000 265#define BM_CLKCTRL_SPDIF_CLKGATE 0x80000000
368#define BP_CLKCTRL_SPDIF_RSRVD 0
369#define BM_CLKCTRL_SPDIF_RSRVD 0x7FFFFFFF
370#define BF_CLKCTRL_SPDIF_RSRVD(v) \
371 (((v) << 0) & BM_CLKCTRL_SPDIF_RSRVD)
372 266
373#define HW_CLKCTRL_EMI (0x000000f0) 267#define HW_CLKCTRL_EMI (0x000000f0)
374 268
@@ -379,24 +273,12 @@
379#define BM_CLKCTRL_EMI_BUSY_REF_EMI 0x10000000 273#define BM_CLKCTRL_EMI_BUSY_REF_EMI 0x10000000
380#define BM_CLKCTRL_EMI_BUSY_REF_CPU 0x08000000 274#define BM_CLKCTRL_EMI_BUSY_REF_CPU 0x08000000
381#define BM_CLKCTRL_EMI_BUSY_SYNC_MODE 0x04000000 275#define BM_CLKCTRL_EMI_BUSY_SYNC_MODE 0x04000000
382#define BP_CLKCTRL_EMI_RSRVD3 18
383#define BM_CLKCTRL_EMI_RSRVD3 0x03FC0000
384#define BF_CLKCTRL_EMI_RSRVD3(v) \
385 (((v) << 18) & BM_CLKCTRL_EMI_RSRVD3)
386#define BM_CLKCTRL_EMI_BUSY_DCC_RESYNC 0x00020000 276#define BM_CLKCTRL_EMI_BUSY_DCC_RESYNC 0x00020000
387#define BM_CLKCTRL_EMI_DCC_RESYNC_ENABLE 0x00010000 277#define BM_CLKCTRL_EMI_DCC_RESYNC_ENABLE 0x00010000
388#define BP_CLKCTRL_EMI_RSRVD2 12
389#define BM_CLKCTRL_EMI_RSRVD2 0x0000F000
390#define BF_CLKCTRL_EMI_RSRVD2(v) \
391 (((v) << 12) & BM_CLKCTRL_EMI_RSRVD2)
392#define BP_CLKCTRL_EMI_DIV_XTAL 8 278#define BP_CLKCTRL_EMI_DIV_XTAL 8
393#define BM_CLKCTRL_EMI_DIV_XTAL 0x00000F00 279#define BM_CLKCTRL_EMI_DIV_XTAL 0x00000F00
394#define BF_CLKCTRL_EMI_DIV_XTAL(v) \ 280#define BF_CLKCTRL_EMI_DIV_XTAL(v) \
395 (((v) << 8) & BM_CLKCTRL_EMI_DIV_XTAL) 281 (((v) << 8) & BM_CLKCTRL_EMI_DIV_XTAL)
396#define BP_CLKCTRL_EMI_RSRVD1 6
397#define BM_CLKCTRL_EMI_RSRVD1 0x000000C0
398#define BF_CLKCTRL_EMI_RSRVD1(v) \
399 (((v) << 6) & BM_CLKCTRL_EMI_RSRVD1)
400#define BP_CLKCTRL_EMI_DIV_EMI 0 282#define BP_CLKCTRL_EMI_DIV_EMI 0
401#define BM_CLKCTRL_EMI_DIV_EMI 0x0000003F 283#define BM_CLKCTRL_EMI_DIV_EMI 0x0000003F
402#define BF_CLKCTRL_EMI_DIV_EMI(v) \ 284#define BF_CLKCTRL_EMI_DIV_EMI(v) \
@@ -406,12 +288,7 @@
406 288
407#define BP_CLKCTRL_SAIF0_CLKGATE 31 289#define BP_CLKCTRL_SAIF0_CLKGATE 31
408#define BM_CLKCTRL_SAIF0_CLKGATE 0x80000000 290#define BM_CLKCTRL_SAIF0_CLKGATE 0x80000000
409#define BM_CLKCTRL_SAIF0_RSRVD2 0x40000000
410#define BM_CLKCTRL_SAIF0_BUSY 0x20000000 291#define BM_CLKCTRL_SAIF0_BUSY 0x20000000
411#define BP_CLKCTRL_SAIF0_RSRVD1 17
412#define BM_CLKCTRL_SAIF0_RSRVD1 0x1FFE0000
413#define BF_CLKCTRL_SAIF0_RSRVD1(v) \
414 (((v) << 17) & BM_CLKCTRL_SAIF0_RSRVD1)
415#define BM_CLKCTRL_SAIF0_DIV_FRAC_EN 0x00010000 292#define BM_CLKCTRL_SAIF0_DIV_FRAC_EN 0x00010000
416#define BP_CLKCTRL_SAIF0_DIV 0 293#define BP_CLKCTRL_SAIF0_DIV 0
417#define BM_CLKCTRL_SAIF0_DIV 0x0000FFFF 294#define BM_CLKCTRL_SAIF0_DIV 0x0000FFFF
@@ -422,12 +299,7 @@
422 299
423#define BP_CLKCTRL_SAIF1_CLKGATE 31 300#define BP_CLKCTRL_SAIF1_CLKGATE 31
424#define BM_CLKCTRL_SAIF1_CLKGATE 0x80000000 301#define BM_CLKCTRL_SAIF1_CLKGATE 0x80000000
425#define BM_CLKCTRL_SAIF1_RSRVD2 0x40000000
426#define BM_CLKCTRL_SAIF1_BUSY 0x20000000 302#define BM_CLKCTRL_SAIF1_BUSY 0x20000000
427#define BP_CLKCTRL_SAIF1_RSRVD1 17
428#define BM_CLKCTRL_SAIF1_RSRVD1 0x1FFE0000
429#define BF_CLKCTRL_SAIF1_RSRVD1(v) \
430 (((v) << 17) & BM_CLKCTRL_SAIF1_RSRVD1)
431#define BM_CLKCTRL_SAIF1_DIV_FRAC_EN 0x00010000 303#define BM_CLKCTRL_SAIF1_DIV_FRAC_EN 0x00010000
432#define BP_CLKCTRL_SAIF1_DIV 0 304#define BP_CLKCTRL_SAIF1_DIV 0
433#define BM_CLKCTRL_SAIF1_DIV 0x0000FFFF 305#define BM_CLKCTRL_SAIF1_DIV 0x0000FFFF
@@ -438,12 +310,7 @@
438 310
439#define BP_CLKCTRL_DIS_LCDIF_CLKGATE 31 311#define BP_CLKCTRL_DIS_LCDIF_CLKGATE 31
440#define BM_CLKCTRL_DIS_LCDIF_CLKGATE 0x80000000 312#define BM_CLKCTRL_DIS_LCDIF_CLKGATE 0x80000000
441#define BM_CLKCTRL_DIS_LCDIF_RSRVD2 0x40000000
442#define BM_CLKCTRL_DIS_LCDIF_BUSY 0x20000000 313#define BM_CLKCTRL_DIS_LCDIF_BUSY 0x20000000
443#define BP_CLKCTRL_DIS_LCDIF_RSRVD1 14
444#define BM_CLKCTRL_DIS_LCDIF_RSRVD1 0x1FFFC000
445#define BF_CLKCTRL_DIS_LCDIF_RSRVD1(v) \
446 (((v) << 14) & BM_CLKCTRL_DIS_LCDIF_RSRVD1)
447#define BM_CLKCTRL_DIS_LCDIF_DIV_FRAC_EN 0x00002000 314#define BM_CLKCTRL_DIS_LCDIF_DIV_FRAC_EN 0x00002000
448#define BP_CLKCTRL_DIS_LCDIF_DIV 0 315#define BP_CLKCTRL_DIS_LCDIF_DIV 0
449#define BM_CLKCTRL_DIS_LCDIF_DIV 0x00001FFF 316#define BM_CLKCTRL_DIS_LCDIF_DIV 0x00001FFF
@@ -453,12 +320,7 @@
453#define HW_CLKCTRL_ETM (0x00000130) 320#define HW_CLKCTRL_ETM (0x00000130)
454 321
455#define BM_CLKCTRL_ETM_CLKGATE 0x80000000 322#define BM_CLKCTRL_ETM_CLKGATE 0x80000000
456#define BM_CLKCTRL_ETM_RSRVD2 0x40000000
457#define BM_CLKCTRL_ETM_BUSY 0x20000000 323#define BM_CLKCTRL_ETM_BUSY 0x20000000
458#define BP_CLKCTRL_ETM_RSRVD1 8
459#define BM_CLKCTRL_ETM_RSRVD1 0x1FFFFF00
460#define BF_CLKCTRL_ETM_RSRVD1(v) \
461 (((v) << 8) & BM_CLKCTRL_ETM_RSRVD1)
462#define BM_CLKCTRL_ETM_DIV_FRAC_EN 0x00000080 324#define BM_CLKCTRL_ETM_DIV_FRAC_EN 0x00000080
463#define BP_CLKCTRL_ETM_DIV 0 325#define BP_CLKCTRL_ETM_DIV 0
464#define BM_CLKCTRL_ETM_DIV 0x0000007F 326#define BM_CLKCTRL_ETM_DIV 0x0000007F
@@ -471,7 +333,6 @@
471#define BP_CLKCTRL_ENET_DISABLE 30 333#define BP_CLKCTRL_ENET_DISABLE 30
472#define BM_CLKCTRL_ENET_DISABLE 0x40000000 334#define BM_CLKCTRL_ENET_DISABLE 0x40000000
473#define BM_CLKCTRL_ENET_STATUS 0x20000000 335#define BM_CLKCTRL_ENET_STATUS 0x20000000
474#define BM_CLKCTRL_ENET_RSRVD1 0x10000000
475#define BM_CLKCTRL_ENET_BUSY_TIME 0x08000000 336#define BM_CLKCTRL_ENET_BUSY_TIME 0x08000000
476#define BP_CLKCTRL_ENET_DIV_TIME 21 337#define BP_CLKCTRL_ENET_DIV_TIME 21
477#define BM_CLKCTRL_ENET_DIV_TIME 0x07E00000 338#define BM_CLKCTRL_ENET_DIV_TIME 0x07E00000
@@ -493,37 +354,23 @@
493#define BM_CLKCTRL_ENET_CLK_OUT_EN 0x00040000 354#define BM_CLKCTRL_ENET_CLK_OUT_EN 0x00040000
494#define BM_CLKCTRL_ENET_RESET_BY_SW_CHIP 0x00020000 355#define BM_CLKCTRL_ENET_RESET_BY_SW_CHIP 0x00020000
495#define BM_CLKCTRL_ENET_RESET_BY_SW 0x00010000 356#define BM_CLKCTRL_ENET_RESET_BY_SW 0x00010000
496#define BP_CLKCTRL_ENET_RSRVD0 0
497#define BM_CLKCTRL_ENET_RSRVD0 0x0000FFFF
498#define BF_CLKCTRL_ENET_RSRVD0(v) \
499 (((v) << 0) & BM_CLKCTRL_ENET_RSRVD0)
500 357
501#define HW_CLKCTRL_HSADC (0x00000150) 358#define HW_CLKCTRL_HSADC (0x00000150)
502 359
503#define BM_CLKCTRL_HSADC_RSRVD2 0x80000000
504#define BM_CLKCTRL_HSADC_RESETB 0x40000000 360#define BM_CLKCTRL_HSADC_RESETB 0x40000000
505#define BP_CLKCTRL_HSADC_FREQDIV 28 361#define BP_CLKCTRL_HSADC_FREQDIV 28
506#define BM_CLKCTRL_HSADC_FREQDIV 0x30000000 362#define BM_CLKCTRL_HSADC_FREQDIV 0x30000000
507#define BF_CLKCTRL_HSADC_FREQDIV(v) \ 363#define BF_CLKCTRL_HSADC_FREQDIV(v) \
508 (((v) << 28) & BM_CLKCTRL_HSADC_FREQDIV) 364 (((v) << 28) & BM_CLKCTRL_HSADC_FREQDIV)
509#define BP_CLKCTRL_HSADC_RSRVD1 0
510#define BM_CLKCTRL_HSADC_RSRVD1 0x0FFFFFFF
511#define BF_CLKCTRL_HSADC_RSRVD1(v) \
512 (((v) << 0) & BM_CLKCTRL_HSADC_RSRVD1)
513 365
514#define HW_CLKCTRL_FLEXCAN (0x00000160) 366#define HW_CLKCTRL_FLEXCAN (0x00000160)
515 367
516#define BM_CLKCTRL_FLEXCAN_RSRVD2 0x80000000
517#define BP_CLKCTRL_FLEXCAN_STOP_CAN0 30 368#define BP_CLKCTRL_FLEXCAN_STOP_CAN0 30
518#define BM_CLKCTRL_FLEXCAN_STOP_CAN0 0x40000000 369#define BM_CLKCTRL_FLEXCAN_STOP_CAN0 0x40000000
519#define BM_CLKCTRL_FLEXCAN_CAN0_STATUS 0x20000000 370#define BM_CLKCTRL_FLEXCAN_CAN0_STATUS 0x20000000
520#define BP_CLKCTRL_FLEXCAN_STOP_CAN1 28 371#define BP_CLKCTRL_FLEXCAN_STOP_CAN1 28
521#define BM_CLKCTRL_FLEXCAN_STOP_CAN1 0x10000000 372#define BM_CLKCTRL_FLEXCAN_STOP_CAN1 0x10000000
522#define BM_CLKCTRL_FLEXCAN_CAN1_STATUS 0x08000000 373#define BM_CLKCTRL_FLEXCAN_CAN1_STATUS 0x08000000
523#define BP_CLKCTRL_FLEXCAN_RSRVD1 0
524#define BM_CLKCTRL_FLEXCAN_RSRVD1 0x07FFFFFF
525#define BF_CLKCTRL_FLEXCAN_RSRVD1(v) \
526 (((v) << 0) & BM_CLKCTRL_FLEXCAN_RSRVD1)
527 374
528#define HW_CLKCTRL_FRAC0 (0x000001b0) 375#define HW_CLKCTRL_FRAC0 (0x000001b0)
529#define HW_CLKCTRL_FRAC0_SET (0x000001b4) 376#define HW_CLKCTRL_FRAC0_SET (0x000001b4)
@@ -564,10 +411,6 @@
564#define HW_CLKCTRL_FRAC1_CLR (0x000001c8) 411#define HW_CLKCTRL_FRAC1_CLR (0x000001c8)
565#define HW_CLKCTRL_FRAC1_TOG (0x000001cc) 412#define HW_CLKCTRL_FRAC1_TOG (0x000001cc)
566 413
567#define BP_CLKCTRL_FRAC1_RSRVD2 24
568#define BM_CLKCTRL_FRAC1_RSRVD2 0xFF000000
569#define BF_CLKCTRL_FRAC1_RSRVD2(v) \
570 (((v) << 24) & BM_CLKCTRL_FRAC1_RSRVD2)
571#define BP_CLKCTRL_FRAC1_CLKGATEGPMI 23 414#define BP_CLKCTRL_FRAC1_CLKGATEGPMI 23
572#define BM_CLKCTRL_FRAC1_CLKGATEGPMI 0x00800000 415#define BM_CLKCTRL_FRAC1_CLKGATEGPMI 0x00800000
573#define BM_CLKCTRL_FRAC1_GPMI_STABLE 0x00400000 416#define BM_CLKCTRL_FRAC1_GPMI_STABLE 0x00400000
@@ -595,22 +438,10 @@
595#define HW_CLKCTRL_CLKSEQ_CLR (0x000001d8) 438#define HW_CLKCTRL_CLKSEQ_CLR (0x000001d8)
596#define HW_CLKCTRL_CLKSEQ_TOG (0x000001dc) 439#define HW_CLKCTRL_CLKSEQ_TOG (0x000001dc)
597 440
598#define BP_CLKCTRL_CLKSEQ_RSRVD0 19
599#define BM_CLKCTRL_CLKSEQ_RSRVD0 0xFFF80000
600#define BF_CLKCTRL_CLKSEQ_RSRVD0(v) \
601 (((v) << 19) & BM_CLKCTRL_CLKSEQ_RSRVD0)
602#define BM_CLKCTRL_CLKSEQ_BYPASS_CPU 0x00040000 441#define BM_CLKCTRL_CLKSEQ_BYPASS_CPU 0x00040000
603#define BP_CLKCTRL_CLKSEQ_RSRVD1 15
604#define BM_CLKCTRL_CLKSEQ_RSRVD1 0x00038000
605#define BF_CLKCTRL_CLKSEQ_RSRVD1(v) \
606 (((v) << 15) & BM_CLKCTRL_CLKSEQ_RSRVD1)
607#define BM_CLKCTRL_CLKSEQ_BYPASS_DIS_LCDIF 0x00004000 442#define BM_CLKCTRL_CLKSEQ_BYPASS_DIS_LCDIF 0x00004000
608#define BV_CLKCTRL_CLKSEQ_BYPASS_DIS_LCDIF__BYPASS 0x1 443#define BV_CLKCTRL_CLKSEQ_BYPASS_DIS_LCDIF__BYPASS 0x1
609#define BV_CLKCTRL_CLKSEQ_BYPASS_DIS_LCDIF__PFD 0x0 444#define BV_CLKCTRL_CLKSEQ_BYPASS_DIS_LCDIF__PFD 0x0
610#define BP_CLKCTRL_CLKSEQ_RSRVD2 9
611#define BM_CLKCTRL_CLKSEQ_RSRVD2 0x00003E00
612#define BF_CLKCTRL_CLKSEQ_RSRVD2(v) \
613 (((v) << 9) & BM_CLKCTRL_CLKSEQ_RSRVD2)
614#define BM_CLKCTRL_CLKSEQ_BYPASS_ETM 0x00000100 445#define BM_CLKCTRL_CLKSEQ_BYPASS_ETM 0x00000100
615#define BM_CLKCTRL_CLKSEQ_BYPASS_EMI 0x00000080 446#define BM_CLKCTRL_CLKSEQ_BYPASS_EMI 0x00000080
616#define BM_CLKCTRL_CLKSEQ_BYPASS_SSP3 0x00000040 447#define BM_CLKCTRL_CLKSEQ_BYPASS_SSP3 0x00000040
@@ -623,10 +454,6 @@
623 454
624#define HW_CLKCTRL_RESET (0x000001e0) 455#define HW_CLKCTRL_RESET (0x000001e0)
625 456
626#define BP_CLKCTRL_RESET_RSRVD 6
627#define BM_CLKCTRL_RESET_RSRVD 0xFFFFFFC0
628#define BF_CLKCTRL_RESET_RSRVD(v) \
629 (((v) << 6) & BM_CLKCTRL_RESET_RSRVD)
630#define BM_CLKCTRL_RESET_WDOG_POR_DISABLE 0x00000020 457#define BM_CLKCTRL_RESET_WDOG_POR_DISABLE 0x00000020
631#define BM_CLKCTRL_RESET_EXTERNAL_RESET_ENABLE 0x00000010 458#define BM_CLKCTRL_RESET_EXTERNAL_RESET_ENABLE 0x00000010
632#define BM_CLKCTRL_RESET_THERMAL_RESET_ENABLE 0x00000008 459#define BM_CLKCTRL_RESET_THERMAL_RESET_ENABLE 0x00000008
@@ -640,10 +467,6 @@
640#define BM_CLKCTRL_STATUS_CPU_LIMIT 0xC0000000 467#define BM_CLKCTRL_STATUS_CPU_LIMIT 0xC0000000
641#define BF_CLKCTRL_STATUS_CPU_LIMIT(v) \ 468#define BF_CLKCTRL_STATUS_CPU_LIMIT(v) \
642 (((v) << 30) & BM_CLKCTRL_STATUS_CPU_LIMIT) 469 (((v) << 30) & BM_CLKCTRL_STATUS_CPU_LIMIT)
643#define BP_CLKCTRL_STATUS_RSRVD 0
644#define BM_CLKCTRL_STATUS_RSRVD 0x3FFFFFFF
645#define BF_CLKCTRL_STATUS_RSRVD(v) \
646 (((v) << 0) & BM_CLKCTRL_STATUS_RSRVD)
647 470
648#define HW_CLKCTRL_VERSION (0x00000200) 471#define HW_CLKCTRL_VERSION (0x00000200)
649 472
diff --git a/arch/arm/mach-mxs/system.c b/arch/arm/mach-mxs/system.c
index 9343d7edd4f6..20ec3bddf7cd 100644
--- a/arch/arm/mach-mxs/system.c
+++ b/arch/arm/mach-mxs/system.c
@@ -22,6 +22,7 @@
22#include <linux/err.h> 22#include <linux/err.h>
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/module.h>
25 26
26#include <asm/proc-fns.h> 27#include <asm/proc-fns.h>
27#include <asm/system.h> 28#include <asm/system.h>
@@ -135,3 +136,4 @@ error:
135 pr_err("%s(%p): module reset timeout\n", __func__, reset_addr); 136 pr_err("%s(%p): module reset timeout\n", __func__, reset_addr);
136 return -ETIMEDOUT; 137 return -ETIMEDOUT;
137} 138}
139EXPORT_SYMBOL(mxs_reset_block);
diff --git a/arch/arm/mach-netx/include/mach/memory.h b/arch/arm/mach-netx/include/mach/memory.h
index 9a363f297f90..59561496c36e 100644
--- a/arch/arm/mach-netx/include/mach/memory.h
+++ b/arch/arm/mach-netx/include/mach/memory.h
@@ -20,7 +20,7 @@
20#ifndef __ASM_ARCH_MEMORY_H 20#ifndef __ASM_ARCH_MEMORY_H
21#define __ASM_ARCH_MEMORY_H 21#define __ASM_ARCH_MEMORY_H
22 22
23#define PHYS_OFFSET UL(0x80000000) 23#define PLAT_PHYS_OFFSET UL(0x80000000)
24 24
25#endif 25#endif
26 26
diff --git a/arch/arm/mach-nomadik/include/mach/memory.h b/arch/arm/mach-nomadik/include/mach/memory.h
index 1e5689d98ecd..d3325211ba6a 100644
--- a/arch/arm/mach-nomadik/include/mach/memory.h
+++ b/arch/arm/mach-nomadik/include/mach/memory.h
@@ -23,6 +23,6 @@
23/* 23/*
24 * Physical DRAM offset. 24 * Physical DRAM offset.
25 */ 25 */
26#define PHYS_OFFSET UL(0x00000000) 26#define PLAT_PHYS_OFFSET UL(0x00000000)
27 27
28#endif 28#endif
diff --git a/arch/arm/mach-ns9xxx/include/mach/memory.h b/arch/arm/mach-ns9xxx/include/mach/memory.h
index 6107193adbfe..5c65aee6e7a9 100644
--- a/arch/arm/mach-ns9xxx/include/mach/memory.h
+++ b/arch/arm/mach-ns9xxx/include/mach/memory.h
@@ -19,6 +19,6 @@
19#define NS9XXX_CS2STAT_LENGTH UL(0x1000) 19#define NS9XXX_CS2STAT_LENGTH UL(0x1000)
20#define NS9XXX_CS3STAT_LENGTH UL(0x1000) 20#define NS9XXX_CS3STAT_LENGTH UL(0x1000)
21 21
22#define PHYS_OFFSET UL(0x00000000) 22#define PLAT_PHYS_OFFSET UL(0x00000000)
23 23
24#endif 24#endif
diff --git a/arch/arm/mach-nuc93x/include/mach/memory.h b/arch/arm/mach-nuc93x/include/mach/memory.h
index 323ab0db3f7d..ef9864b002a6 100644
--- a/arch/arm/mach-nuc93x/include/mach/memory.h
+++ b/arch/arm/mach-nuc93x/include/mach/memory.h
@@ -16,6 +16,6 @@
16#ifndef __ASM_ARCH_MEMORY_H 16#ifndef __ASM_ARCH_MEMORY_H
17#define __ASM_ARCH_MEMORY_H 17#define __ASM_ARCH_MEMORY_H
18 18
19#define PHYS_OFFSET UL(0x00000000) 19#define PLAT_PHYS_OFFSET UL(0x00000000)
20 20
21#endif 21#endif
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig
index 8d2f2daba0c0..e0a028161dde 100644
--- a/arch/arm/mach-omap1/Kconfig
+++ b/arch/arm/mach-omap1/Kconfig
@@ -9,6 +9,7 @@ config ARCH_OMAP730
9 depends on ARCH_OMAP1 9 depends on ARCH_OMAP1
10 bool "OMAP730 Based System" 10 bool "OMAP730 Based System"
11 select CPU_ARM926T 11 select CPU_ARM926T
12 select OMAP_MPU_TIMER
12 select ARCH_OMAP_OTG 13 select ARCH_OMAP_OTG
13 14
14config ARCH_OMAP850 15config ARCH_OMAP850
@@ -22,6 +23,7 @@ config ARCH_OMAP15XX
22 default y 23 default y
23 bool "OMAP15xx Based System" 24 bool "OMAP15xx Based System"
24 select CPU_ARM925T 25 select CPU_ARM925T
26 select OMAP_MPU_TIMER
25 27
26config ARCH_OMAP16XX 28config ARCH_OMAP16XX
27 depends on ARCH_OMAP1 29 depends on ARCH_OMAP1
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
index 6ee19504845f..af98117043d2 100644
--- a/arch/arm/mach-omap1/Makefile
+++ b/arch/arm/mach-omap1/Makefile
@@ -3,12 +3,11 @@
3# 3#
4 4
5# Common support 5# Common support
6obj-y := io.o id.o sram.o irq.o mux.o flash.o serial.o devices.o dma.o 6obj-y := io.o id.o sram.o time.o irq.o mux.o flash.o serial.o devices.o dma.o
7obj-y += clock.o clock_data.o opp_data.o 7obj-y += clock.o clock_data.o opp_data.o reset.o
8 8
9obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o 9obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
10 10
11obj-$(CONFIG_OMAP_MPU_TIMER) += time.o
12obj-$(CONFIG_OMAP_32K_TIMER) += timer32k.o 11obj-$(CONFIG_OMAP_32K_TIMER) += timer32k.o
13 12
14# Power Management 13# Power Management
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 22cc8c8df6cb..de88c9297b68 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -165,7 +165,7 @@ static struct map_desc ams_delta_io_desc[] __initdata = {
165 } 165 }
166}; 166};
167 167
168static struct omap_lcd_config ams_delta_lcd_config __initdata = { 168static struct omap_lcd_config ams_delta_lcd_config = {
169 .ctrl_name = "internal", 169 .ctrl_name = "internal",
170}; 170};
171 171
@@ -175,7 +175,7 @@ static struct omap_usb_config ams_delta_usb_config __initdata = {
175 .pins[0] = 2, 175 .pins[0] = 2,
176}; 176};
177 177
178static struct omap_board_config_kernel ams_delta_config[] = { 178static struct omap_board_config_kernel ams_delta_config[] __initdata = {
179 { OMAP_TAG_LCD, &ams_delta_lcd_config }, 179 { OMAP_TAG_LCD, &ams_delta_lcd_config },
180}; 180};
181 181
@@ -208,14 +208,14 @@ static const struct matrix_keymap_data ams_delta_keymap_data = {
208 .keymap_size = ARRAY_SIZE(ams_delta_keymap), 208 .keymap_size = ARRAY_SIZE(ams_delta_keymap),
209}; 209};
210 210
211static struct omap_kp_platform_data ams_delta_kp_data = { 211static struct omap_kp_platform_data ams_delta_kp_data __initdata = {
212 .rows = 8, 212 .rows = 8,
213 .cols = 8, 213 .cols = 8,
214 .keymap_data = &ams_delta_keymap_data, 214 .keymap_data = &ams_delta_keymap_data,
215 .delay = 9, 215 .delay = 9,
216}; 216};
217 217
218static struct platform_device ams_delta_kp_device = { 218static struct platform_device ams_delta_kp_device __initdata = {
219 .name = "omap-keypad", 219 .name = "omap-keypad",
220 .id = -1, 220 .id = -1,
221 .dev = { 221 .dev = {
@@ -225,12 +225,12 @@ static struct platform_device ams_delta_kp_device = {
225 .resource = ams_delta_kp_resources, 225 .resource = ams_delta_kp_resources,
226}; 226};
227 227
228static struct platform_device ams_delta_lcd_device = { 228static struct platform_device ams_delta_lcd_device __initdata = {
229 .name = "lcd_ams_delta", 229 .name = "lcd_ams_delta",
230 .id = -1, 230 .id = -1,
231}; 231};
232 232
233static struct platform_device ams_delta_led_device = { 233static struct platform_device ams_delta_led_device __initdata = {
234 .name = "ams-delta-led", 234 .name = "ams-delta-led",
235 .id = -1 235 .id = -1
236}; 236};
@@ -259,7 +259,7 @@ static int ams_delta_camera_power(struct device *dev, int power)
259#define ams_delta_camera_power NULL 259#define ams_delta_camera_power NULL
260#endif 260#endif
261 261
262static struct soc_camera_link __initdata ams_delta_iclink = { 262static struct soc_camera_link ams_delta_iclink = {
263 .bus_id = 0, /* OMAP1 SoC camera bus */ 263 .bus_id = 0, /* OMAP1 SoC camera bus */
264 .i2c_adapter_id = 1, 264 .i2c_adapter_id = 1,
265 .board_info = &ams_delta_camera_board_info[0], 265 .board_info = &ams_delta_camera_board_info[0],
@@ -267,7 +267,7 @@ static struct soc_camera_link __initdata ams_delta_iclink = {
267 .power = ams_delta_camera_power, 267 .power = ams_delta_camera_power,
268}; 268};
269 269
270static struct platform_device ams_delta_camera_device = { 270static struct platform_device ams_delta_camera_device __initdata = {
271 .name = "soc-camera-pdrv", 271 .name = "soc-camera-pdrv",
272 .id = 0, 272 .id = 0,
273 .dev = { 273 .dev = {
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index 0efb9dbae44c..87f173d93557 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -287,11 +287,11 @@ static struct platform_device *devices[] __initdata = {
287 &lcd_device, 287 &lcd_device,
288}; 288};
289 289
290static struct omap_lcd_config fsample_lcd_config __initdata = { 290static struct omap_lcd_config fsample_lcd_config = {
291 .ctrl_name = "internal", 291 .ctrl_name = "internal",
292}; 292};
293 293
294static struct omap_board_config_kernel fsample_config[] = { 294static struct omap_board_config_kernel fsample_config[] __initdata = {
295 { OMAP_TAG_LCD, &fsample_lcd_config }, 295 { OMAP_TAG_LCD, &fsample_lcd_config },
296}; 296};
297 297
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index 28b84aa9bdba..ba3bd09c4754 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -202,7 +202,7 @@ static int h2_nand_dev_ready(struct mtd_info *mtd)
202 202
203static const char *h2_part_probes[] = { "cmdlinepart", NULL }; 203static const char *h2_part_probes[] = { "cmdlinepart", NULL };
204 204
205struct platform_nand_data h2_nand_platdata = { 205static struct platform_nand_data h2_nand_platdata = {
206 .chip = { 206 .chip = {
207 .nr_chips = 1, 207 .nr_chips = 1,
208 .chip_offset = 0, 208 .chip_offset = 0,
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index dbc8b8d882ba..ac48677672ee 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -204,7 +204,7 @@ static int nand_dev_ready(struct mtd_info *mtd)
204 204
205static const char *part_probes[] = { "cmdlinepart", NULL }; 205static const char *part_probes[] = { "cmdlinepart", NULL };
206 206
207struct platform_nand_data nand_platdata = { 207static struct platform_nand_data nand_platdata = {
208 .chip = { 208 .chip = {
209 .nr_chips = 1, 209 .nr_chips = 1,
210 .chip_offset = 0, 210 .chip_offset = 0,
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
index f2c5c585bc83..ba05a51f9408 100644
--- a/arch/arm/mach-omap1/board-htcherald.c
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -331,7 +331,7 @@ static struct resource htcpld_resources[] = {
331 }, 331 },
332}; 332};
333 333
334struct htcpld_chip_platform_data htcpld_chips[] = { 334static struct htcpld_chip_platform_data htcpld_chips[] = {
335 [0] = { 335 [0] = {
336 .addr = 0x03, 336 .addr = 0x03,
337 .reset = 0x04, 337 .reset = 0x04,
@@ -366,7 +366,7 @@ struct htcpld_chip_platform_data htcpld_chips[] = {
366 }, 366 },
367}; 367};
368 368
369struct htcpld_core_platform_data htcpld_pfdata = { 369static struct htcpld_core_platform_data htcpld_pfdata = {
370 .int_reset_gpio_hi = HTCPLD_GPIO_INT_RESET_HI, 370 .int_reset_gpio_hi = HTCPLD_GPIO_INT_RESET_HI,
371 .int_reset_gpio_lo = HTCPLD_GPIO_INT_RESET_LO, 371 .int_reset_gpio_lo = HTCPLD_GPIO_INT_RESET_LO,
372 .i2c_adapter_id = 1, 372 .i2c_adapter_id = 1,
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index a36e6742bf9b..2d9b8cbd7a14 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -365,7 +365,7 @@ static struct omap_mmc_platform_data mmc1_data = {
365 365
366static struct omap_mmc_platform_data *mmc_data[OMAP16XX_NR_MMC]; 366static struct omap_mmc_platform_data *mmc_data[OMAP16XX_NR_MMC];
367 367
368void __init innovator_mmc_init(void) 368static void __init innovator_mmc_init(void)
369{ 369{
370 mmc_data[0] = &mmc1_data; 370 mmc_data[0] = &mmc1_data;
371 omap1_init_mmc(mmc_data, OMAP15XX_NR_MMC); 371 omap1_init_mmc(mmc_data, OMAP15XX_NR_MMC);
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index d21f09dc78f4..cfd084926146 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -115,7 +115,7 @@ static struct mipid_platform_data nokia770_mipid_platform_data = {
115 .shutdown = mipid_shutdown, 115 .shutdown = mipid_shutdown,
116}; 116};
117 117
118static void mipid_dev_init(void) 118static void __init mipid_dev_init(void)
119{ 119{
120 const struct omap_lcd_config *conf; 120 const struct omap_lcd_config *conf;
121 121
@@ -126,7 +126,7 @@ static void mipid_dev_init(void)
126 } 126 }
127} 127}
128 128
129static void ads7846_dev_init(void) 129static void __init ads7846_dev_init(void)
130{ 130{
131 if (gpio_request(ADS7846_PENDOWN_GPIO, "ADS7846 pendown") < 0) 131 if (gpio_request(ADS7846_PENDOWN_GPIO, "ADS7846 pendown") < 0)
132 printk(KERN_ERR "can't get ads7846 pen down GPIO\n"); 132 printk(KERN_ERR "can't get ads7846 pen down GPIO\n");
@@ -170,7 +170,7 @@ static struct hwa742_platform_data nokia770_hwa742_platform_data = {
170 .te_connected = 1, 170 .te_connected = 1,
171}; 171};
172 172
173static void hwa742_dev_init(void) 173static void __init hwa742_dev_init(void)
174{ 174{
175 clk_add_alias("hwa_sys_ck", NULL, "bclk", NULL); 175 clk_add_alias("hwa_sys_ck", NULL, "bclk", NULL);
176 omapfb_set_ctrl_platform_data(&nokia770_hwa742_platform_data); 176 omapfb_set_ctrl_platform_data(&nokia770_hwa742_platform_data);
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index fb51ce6123d8..c9d38f47845f 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -230,19 +230,6 @@ static struct spi_board_info palmte_spi_info[] __initdata = {
230 }, 230 },
231}; 231};
232 232
233static void palmte_headphones_detect(void *data, int state)
234{
235 if (state) {
236 /* Headphones connected, disable speaker */
237 gpio_set_value(PALMTE_SPEAKER_GPIO, 0);
238 printk(KERN_INFO "PM: speaker off\n");
239 } else {
240 /* Headphones unplugged, re-enable speaker */
241 gpio_set_value(PALMTE_SPEAKER_GPIO, 1);
242 printk(KERN_INFO "PM: speaker on\n");
243 }
244}
245
246static void __init palmte_misc_gpio_setup(void) 233static void __init palmte_misc_gpio_setup(void)
247{ 234{
248 /* Set TSC2102 PINTDAV pin as input (used by TSC2102 driver) */ 235 /* Set TSC2102 PINTDAV pin as input (used by TSC2102 driver) */
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index 815a69ce821d..bdc0ac8dc21f 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -26,10 +26,12 @@
26#include <linux/smc91x.h> 26#include <linux/smc91x.h>
27 27
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <mach/system.h>
29#include <asm/mach-types.h> 30#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
31#include <asm/mach/map.h> 32#include <asm/mach/map.h>
32 33
34#include <plat/board-voiceblue.h>
33#include <plat/common.h> 35#include <plat/common.h>
34#include <mach/gpio.h> 36#include <mach/gpio.h>
35#include <plat/flash.h> 37#include <plat/flash.h>
@@ -163,52 +165,6 @@ static void __init voiceblue_init_irq(void)
163 omap_init_irq(); 165 omap_init_irq();
164} 166}
165 167
166static void __init voiceblue_init(void)
167{
168 /* mux pins for uarts */
169 omap_cfg_reg(UART1_TX);
170 omap_cfg_reg(UART1_RTS);
171 omap_cfg_reg(UART2_TX);
172 omap_cfg_reg(UART2_RTS);
173 omap_cfg_reg(UART3_TX);
174 omap_cfg_reg(UART3_RX);
175
176 /* Watchdog */
177 gpio_request(0, "Watchdog");
178 /* smc91x reset */
179 gpio_request(7, "SMC91x reset");
180 gpio_direction_output(7, 1);
181 udelay(2); /* wait at least 100ns */
182 gpio_set_value(7, 0);
183 mdelay(50); /* 50ms until PHY ready */
184 /* smc91x interrupt pin */
185 gpio_request(8, "SMC91x irq");
186 /* 16C554 reset*/
187 gpio_request(6, "16C554 reset");
188 gpio_direction_output(6, 0);
189 /* 16C554 interrupt pins */
190 gpio_request(12, "16C554 irq");
191 gpio_request(13, "16C554 irq");
192 gpio_request(14, "16C554 irq");
193 gpio_request(15, "16C554 irq");
194 set_irq_type(gpio_to_irq(12), IRQ_TYPE_EDGE_RISING);
195 set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING);
196 set_irq_type(gpio_to_irq(14), IRQ_TYPE_EDGE_RISING);
197 set_irq_type(gpio_to_irq(15), IRQ_TYPE_EDGE_RISING);
198
199 platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices));
200 omap_board_config = voiceblue_config;
201 omap_board_config_size = ARRAY_SIZE(voiceblue_config);
202 omap_serial_init();
203 omap1_usb_init(&voiceblue_usb_config);
204 omap_register_i2c_bus(1, 100, NULL, 0);
205
206 /* There is a good chance board is going up, so enable power LED
207 * (it is connected through invertor) */
208 omap_writeb(0x00, OMAP_LPG1_LCR);
209 omap_writeb(0x00, OMAP_LPG1_PMR); /* Disable clock */
210}
211
212static void __init voiceblue_map_io(void) 168static void __init voiceblue_map_io(void)
213{ 169{
214 omap1_map_common_io(); 170 omap1_map_common_io();
@@ -275,8 +231,17 @@ void voiceblue_wdt_ping(void)
275 gpio_set_value(0, wdt_gpio_state); 231 gpio_set_value(0, wdt_gpio_state);
276} 232}
277 233
278void voiceblue_reset(void) 234static void voiceblue_reset(char mode, const char *cmd)
279{ 235{
236 /*
237 * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28
238 * "Global Software Reset Affects Traffic Controller Frequency".
239 */
240 if (cpu_is_omap5912()) {
241 omap_writew(omap_readw(DPLL_CTL) & ~(1 << 4), DPLL_CTL);
242 omap_writew(0x8, ARM_RSTCT1);
243 }
244
280 set_bit(MACHINE_REBOOT, &machine_state); 245 set_bit(MACHINE_REBOOT, &machine_state);
281 voiceblue_wdt_enable(); 246 voiceblue_wdt_enable();
282 while (1) ; 247 while (1) ;
@@ -286,6 +251,54 @@ EXPORT_SYMBOL(voiceblue_wdt_enable);
286EXPORT_SYMBOL(voiceblue_wdt_disable); 251EXPORT_SYMBOL(voiceblue_wdt_disable);
287EXPORT_SYMBOL(voiceblue_wdt_ping); 252EXPORT_SYMBOL(voiceblue_wdt_ping);
288 253
254static void __init voiceblue_init(void)
255{
256 /* mux pins for uarts */
257 omap_cfg_reg(UART1_TX);
258 omap_cfg_reg(UART1_RTS);
259 omap_cfg_reg(UART2_TX);
260 omap_cfg_reg(UART2_RTS);
261 omap_cfg_reg(UART3_TX);
262 omap_cfg_reg(UART3_RX);
263
264 /* Watchdog */
265 gpio_request(0, "Watchdog");
266 /* smc91x reset */
267 gpio_request(7, "SMC91x reset");
268 gpio_direction_output(7, 1);
269 udelay(2); /* wait at least 100ns */
270 gpio_set_value(7, 0);
271 mdelay(50); /* 50ms until PHY ready */
272 /* smc91x interrupt pin */
273 gpio_request(8, "SMC91x irq");
274 /* 16C554 reset*/
275 gpio_request(6, "16C554 reset");
276 gpio_direction_output(6, 0);
277 /* 16C554 interrupt pins */
278 gpio_request(12, "16C554 irq");
279 gpio_request(13, "16C554 irq");
280 gpio_request(14, "16C554 irq");
281 gpio_request(15, "16C554 irq");
282 set_irq_type(gpio_to_irq(12), IRQ_TYPE_EDGE_RISING);
283 set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING);
284 set_irq_type(gpio_to_irq(14), IRQ_TYPE_EDGE_RISING);
285 set_irq_type(gpio_to_irq(15), IRQ_TYPE_EDGE_RISING);
286
287 platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices));
288 omap_board_config = voiceblue_config;
289 omap_board_config_size = ARRAY_SIZE(voiceblue_config);
290 omap_serial_init();
291 omap1_usb_init(&voiceblue_usb_config);
292 omap_register_i2c_bus(1, 100, NULL, 0);
293
294 /* There is a good chance board is going up, so enable power LED
295 * (it is connected through invertor) */
296 omap_writeb(0x00, OMAP_LPG1_LCR);
297 omap_writeb(0x00, OMAP_LPG1_PMR); /* Disable clock */
298
299 arch_reset = voiceblue_reset;
300}
301
289MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910") 302MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
290 /* Maintainer: Ladislav Michl <michl@2n.cz> */ 303 /* Maintainer: Ladislav Michl <michl@2n.cz> */
291 .boot_params = 0x10000100, 304 .boot_params = 0x10000100,
diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
index 6a0fa0462365..62856044eb63 100644
--- a/arch/arm/mach-omap1/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
@@ -17,6 +17,9 @@
17 17
18#include <plat/serial.h> 18#include <plat/serial.h>
19 19
20#define omap_uart_v2p(x) ((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET)
21#define omap_uart_p2v(x) ((x) - PLAT_PHYS_OFFSET + PAGE_OFFSET)
22
20 .pushsection .data 23 .pushsection .data
21omap_uart_phys: .word 0x0 24omap_uart_phys: .word 0x0
22omap_uart_virt: .word 0x0 25omap_uart_virt: .word 0x0
@@ -33,7 +36,7 @@ omap_uart_virt: .word 0x0
33 /* Use omap_uart_phys/virt if already configured */ 36 /* Use omap_uart_phys/virt if already configured */
349: mrc p15, 0, \rp, c1, c0 379: mrc p15, 0, \rp, c1, c0
35 tst \rp, #1 @ MMU enabled? 38 tst \rp, #1 @ MMU enabled?
36 ldreq \rp, =__virt_to_phys(omap_uart_phys) @ MMU not enabled 39 ldreq \rp, =omap_uart_v2p(omap_uart_phys) @ MMU disabled
37 ldrne \rp, =omap_uart_phys @ MMU enabled 40 ldrne \rp, =omap_uart_phys @ MMU enabled
38 add \rv, \rp, #4 @ omap_uart_virt 41 add \rv, \rp, #4 @ omap_uart_virt
39 ldr \rp, [\rp, #0] 42 ldr \rp, [\rp, #0]
@@ -46,7 +49,7 @@ omap_uart_virt: .word 0x0
46 mrc p15, 0, \rp, c1, c0 49 mrc p15, 0, \rp, c1, c0
47 tst \rp, #1 @ MMU enabled? 50 tst \rp, #1 @ MMU enabled?
48 ldreq \rp, =OMAP_UART_INFO @ MMU not enabled 51 ldreq \rp, =OMAP_UART_INFO @ MMU not enabled
49 ldrne \rp, =__phys_to_virt(OMAP_UART_INFO) @ MMU enabled 52 ldrne \rp, =omap_uart_p2v(OMAP_UART_INFO) @ MMU enabled
50 ldr \rp, [\rp, #0] 53 ldr \rp, [\rp, #0]
51 54
52 /* Select the UART to use based on the UART1 scratchpad value */ 55 /* Select the UART to use based on the UART1 scratchpad value */
@@ -73,7 +76,7 @@ omap_uart_virt: .word 0x0
7398: add \rp, \rp, #0xff000000 @ phys base 7698: add \rp, \rp, #0xff000000 @ phys base
74 mrc p15, 0, \rv, c1, c0 77 mrc p15, 0, \rv, c1, c0
75 tst \rv, #1 @ MMU enabled? 78 tst \rv, #1 @ MMU enabled?
76 ldreq \rv, =__virt_to_phys(omap_uart_phys) @ MMU not enabled 79 ldreq \rv, =omap_uart_v2p(omap_uart_phys) @ MMU disabled
77 ldrne \rv, =omap_uart_phys @ MMU enabled 80 ldrne \rv, =omap_uart_phys @ MMU enabled
78 str \rp, [\rv, #0] 81 str \rp, [\rv, #0]
79 sub \rp, \rp, #0xff000000 @ phys base 82 sub \rp, \rp, #0xff000000 @ phys base
diff --git a/arch/arm/mach-omap1/include/mach/entry-macro.S b/arch/arm/mach-omap1/include/mach/entry-macro.S
index c9be6d4d83e2..bfb4fb1d7382 100644
--- a/arch/arm/mach-omap1/include/mach/entry-macro.S
+++ b/arch/arm/mach-omap1/include/mach/entry-macro.S
@@ -14,19 +14,6 @@
14#include <mach/irqs.h> 14#include <mach/irqs.h>
15#include <asm/hardware/gic.h> 15#include <asm/hardware/gic.h>
16 16
17/*
18 * We use __glue to avoid errors with multiple definitions of
19 * .globl omap_irq_flags as it's included from entry-armv.S but not
20 * from entry-common.S.
21 */
22#ifdef __glue
23 .pushsection .data
24 .globl omap_irq_flags
25omap_irq_flags:
26 .word 0
27 .popsection
28#endif
29
30 .macro disable_fiq 17 .macro disable_fiq
31 .endm 18 .endm
32 19
diff --git a/arch/arm/mach-omap1/irq.c b/arch/arm/mach-omap1/irq.c
index 47701584df35..731dd33bff51 100644
--- a/arch/arm/mach-omap1/irq.c
+++ b/arch/arm/mach-omap1/irq.c
@@ -57,6 +57,7 @@ struct omap_irq_bank {
57 unsigned long wake_enable; 57 unsigned long wake_enable;
58}; 58};
59 59
60u32 omap_irq_flags;
60static unsigned int irq_bank_count; 61static unsigned int irq_bank_count;
61static struct omap_irq_bank *irq_banks; 62static struct omap_irq_bank *irq_banks;
62 63
@@ -176,7 +177,6 @@ static struct irq_chip omap_irq_chip = {
176 177
177void __init omap_init_irq(void) 178void __init omap_init_irq(void)
178{ 179{
179 extern unsigned int omap_irq_flags;
180 int i, j; 180 int i, j;
181 181
182#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) 182#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
diff --git a/arch/arm/mach-omap1/lcd_dma.c b/arch/arm/mach-omap1/lcd_dma.c
index c9088d85da04..453809359ba6 100644
--- a/arch/arm/mach-omap1/lcd_dma.c
+++ b/arch/arm/mach-omap1/lcd_dma.c
@@ -37,7 +37,7 @@ int omap_lcd_dma_running(void)
37 * On OMAP1510, internal LCD controller will start the transfer 37 * On OMAP1510, internal LCD controller will start the transfer
38 * when it gets enabled, so assume DMA running if LCD enabled. 38 * when it gets enabled, so assume DMA running if LCD enabled.
39 */ 39 */
40 if (cpu_is_omap1510()) 40 if (cpu_is_omap15xx())
41 if (omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN) 41 if (omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN)
42 return 1; 42 return 1;
43 43
@@ -95,7 +95,7 @@ EXPORT_SYMBOL(omap_set_lcd_dma_single_transfer);
95 95
96void omap_set_lcd_dma_b1_rotation(int rotate) 96void omap_set_lcd_dma_b1_rotation(int rotate)
97{ 97{
98 if (cpu_is_omap1510()) { 98 if (cpu_is_omap15xx()) {
99 printk(KERN_ERR "DMA rotation is not supported in 1510 mode\n"); 99 printk(KERN_ERR "DMA rotation is not supported in 1510 mode\n");
100 BUG(); 100 BUG();
101 return; 101 return;
@@ -106,7 +106,7 @@ EXPORT_SYMBOL(omap_set_lcd_dma_b1_rotation);
106 106
107void omap_set_lcd_dma_b1_mirror(int mirror) 107void omap_set_lcd_dma_b1_mirror(int mirror)
108{ 108{
109 if (cpu_is_omap1510()) { 109 if (cpu_is_omap15xx()) {
110 printk(KERN_ERR "DMA mirror is not supported in 1510 mode\n"); 110 printk(KERN_ERR "DMA mirror is not supported in 1510 mode\n");
111 BUG(); 111 BUG();
112 } 112 }
@@ -116,7 +116,7 @@ EXPORT_SYMBOL(omap_set_lcd_dma_b1_mirror);
116 116
117void omap_set_lcd_dma_b1_vxres(unsigned long vxres) 117void omap_set_lcd_dma_b1_vxres(unsigned long vxres)
118{ 118{
119 if (cpu_is_omap1510()) { 119 if (cpu_is_omap15xx()) {
120 printk(KERN_ERR "DMA virtual resulotion is not supported " 120 printk(KERN_ERR "DMA virtual resulotion is not supported "
121 "in 1510 mode\n"); 121 "in 1510 mode\n");
122 BUG(); 122 BUG();
@@ -127,7 +127,7 @@ EXPORT_SYMBOL(omap_set_lcd_dma_b1_vxres);
127 127
128void omap_set_lcd_dma_b1_scale(unsigned int xscale, unsigned int yscale) 128void omap_set_lcd_dma_b1_scale(unsigned int xscale, unsigned int yscale)
129{ 129{
130 if (cpu_is_omap1510()) { 130 if (cpu_is_omap15xx()) {
131 printk(KERN_ERR "DMA scale is not supported in 1510 mode\n"); 131 printk(KERN_ERR "DMA scale is not supported in 1510 mode\n");
132 BUG(); 132 BUG();
133 } 133 }
@@ -177,7 +177,7 @@ static void set_b1_regs(void)
177 bottom = PIXADDR(lcd_dma.xres - 1, lcd_dma.yres - 1); 177 bottom = PIXADDR(lcd_dma.xres - 1, lcd_dma.yres - 1);
178 /* 1510 DMA requires the bottom address to be 2 more 178 /* 1510 DMA requires the bottom address to be 2 more
179 * than the actual last memory access location. */ 179 * than the actual last memory access location. */
180 if (cpu_is_omap1510() && 180 if (cpu_is_omap15xx() &&
181 lcd_dma.data_type == OMAP_DMA_DATA_TYPE_S32) 181 lcd_dma.data_type == OMAP_DMA_DATA_TYPE_S32)
182 bottom += 2; 182 bottom += 2;
183 ei = PIXSTEP(0, 0, 1, 0); 183 ei = PIXSTEP(0, 0, 1, 0);
@@ -241,7 +241,7 @@ static void set_b1_regs(void)
241 return; /* Suppress warning about uninitialized vars */ 241 return; /* Suppress warning about uninitialized vars */
242 } 242 }
243 243
244 if (cpu_is_omap1510()) { 244 if (cpu_is_omap15xx()) {
245 omap_writew(top >> 16, OMAP1510_DMA_LCD_TOP_F1_U); 245 omap_writew(top >> 16, OMAP1510_DMA_LCD_TOP_F1_U);
246 omap_writew(top, OMAP1510_DMA_LCD_TOP_F1_L); 246 omap_writew(top, OMAP1510_DMA_LCD_TOP_F1_L);
247 omap_writew(bottom >> 16, OMAP1510_DMA_LCD_BOT_F1_U); 247 omap_writew(bottom >> 16, OMAP1510_DMA_LCD_BOT_F1_U);
@@ -343,7 +343,7 @@ void omap_free_lcd_dma(void)
343 BUG(); 343 BUG();
344 return; 344 return;
345 } 345 }
346 if (!cpu_is_omap1510()) 346 if (!cpu_is_omap15xx())
347 omap_writew(omap_readw(OMAP1610_DMA_LCD_CCR) & ~1, 347 omap_writew(omap_readw(OMAP1610_DMA_LCD_CCR) & ~1,
348 OMAP1610_DMA_LCD_CCR); 348 OMAP1610_DMA_LCD_CCR);
349 lcd_dma.reserved = 0; 349 lcd_dma.reserved = 0;
@@ -360,7 +360,7 @@ void omap_enable_lcd_dma(void)
360 * connected. Otherwise the OMAP internal controller will 360 * connected. Otherwise the OMAP internal controller will
361 * start the transfer when it gets enabled. 361 * start the transfer when it gets enabled.
362 */ 362 */
363 if (cpu_is_omap1510() || !lcd_dma.ext_ctrl) 363 if (cpu_is_omap15xx() || !lcd_dma.ext_ctrl)
364 return; 364 return;
365 365
366 w = omap_readw(OMAP1610_DMA_LCD_CTRL); 366 w = omap_readw(OMAP1610_DMA_LCD_CTRL);
@@ -378,14 +378,14 @@ EXPORT_SYMBOL(omap_enable_lcd_dma);
378void omap_setup_lcd_dma(void) 378void omap_setup_lcd_dma(void)
379{ 379{
380 BUG_ON(lcd_dma.active); 380 BUG_ON(lcd_dma.active);
381 if (!cpu_is_omap1510()) { 381 if (!cpu_is_omap15xx()) {
382 /* Set some reasonable defaults */ 382 /* Set some reasonable defaults */
383 omap_writew(0x5440, OMAP1610_DMA_LCD_CCR); 383 omap_writew(0x5440, OMAP1610_DMA_LCD_CCR);
384 omap_writew(0x9102, OMAP1610_DMA_LCD_CSDP); 384 omap_writew(0x9102, OMAP1610_DMA_LCD_CSDP);
385 omap_writew(0x0004, OMAP1610_DMA_LCD_LCH_CTRL); 385 omap_writew(0x0004, OMAP1610_DMA_LCD_LCH_CTRL);
386 } 386 }
387 set_b1_regs(); 387 set_b1_regs();
388 if (!cpu_is_omap1510()) { 388 if (!cpu_is_omap15xx()) {
389 u16 w; 389 u16 w;
390 390
391 w = omap_readw(OMAP1610_DMA_LCD_CCR); 391 w = omap_readw(OMAP1610_DMA_LCD_CCR);
@@ -407,7 +407,7 @@ void omap_stop_lcd_dma(void)
407 u16 w; 407 u16 w;
408 408
409 lcd_dma.active = 0; 409 lcd_dma.active = 0;
410 if (cpu_is_omap1510() || !lcd_dma.ext_ctrl) 410 if (cpu_is_omap15xx() || !lcd_dma.ext_ctrl)
411 return; 411 return;
412 412
413 w = omap_readw(OMAP1610_DMA_LCD_CCR); 413 w = omap_readw(OMAP1610_DMA_LCD_CCR);
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index 820973666f34..d9af9811dedd 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -10,6 +10,7 @@
10 * 10 *
11 * Multichannel mode not supported. 11 * Multichannel mode not supported.
12 */ 12 */
13#include <linux/ioport.h>
13#include <linux/module.h> 14#include <linux/module.h>
14#include <linux/init.h> 15#include <linux/init.h>
15#include <linux/clk.h> 16#include <linux/clk.h>
@@ -78,100 +79,294 @@ static struct omap_mcbsp_ops omap1_mcbsp_ops = {
78}; 79};
79 80
80#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) 81#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
82struct resource omap7xx_mcbsp_res[][6] = {
83 {
84 {
85 .start = OMAP7XX_MCBSP1_BASE,
86 .end = OMAP7XX_MCBSP1_BASE + SZ_256,
87 .flags = IORESOURCE_MEM,
88 },
89 {
90 .name = "rx",
91 .start = INT_7XX_McBSP1RX,
92 .flags = IORESOURCE_IRQ,
93 },
94 {
95 .name = "tx",
96 .start = INT_7XX_McBSP1TX,
97 .flags = IORESOURCE_IRQ,
98 },
99 {
100 .name = "rx",
101 .start = OMAP_DMA_MCBSP1_RX,
102 .flags = IORESOURCE_DMA,
103 },
104 {
105 .name = "tx",
106 .start = OMAP_DMA_MCBSP1_TX,
107 .flags = IORESOURCE_DMA,
108 },
109 },
110 {
111 {
112 .start = OMAP7XX_MCBSP2_BASE,
113 .end = OMAP7XX_MCBSP2_BASE + SZ_256,
114 .flags = IORESOURCE_MEM,
115 },
116 {
117 .name = "rx",
118 .start = INT_7XX_McBSP2RX,
119 .flags = IORESOURCE_IRQ,
120 },
121 {
122 .name = "tx",
123 .start = INT_7XX_McBSP2TX,
124 .flags = IORESOURCE_IRQ,
125 },
126 {
127 .name = "rx",
128 .start = OMAP_DMA_MCBSP3_RX,
129 .flags = IORESOURCE_DMA,
130 },
131 {
132 .name = "tx",
133 .start = OMAP_DMA_MCBSP3_TX,
134 .flags = IORESOURCE_DMA,
135 },
136 },
137};
138
139#define omap7xx_mcbsp_res_0 omap7xx_mcbsp_res[0]
140
81static struct omap_mcbsp_platform_data omap7xx_mcbsp_pdata[] = { 141static struct omap_mcbsp_platform_data omap7xx_mcbsp_pdata[] = {
82 { 142 {
83 .phys_base = OMAP7XX_MCBSP1_BASE,
84 .dma_rx_sync = OMAP_DMA_MCBSP1_RX,
85 .dma_tx_sync = OMAP_DMA_MCBSP1_TX,
86 .rx_irq = INT_7XX_McBSP1RX,
87 .tx_irq = INT_7XX_McBSP1TX,
88 .ops = &omap1_mcbsp_ops, 143 .ops = &omap1_mcbsp_ops,
89 }, 144 },
90 { 145 {
91 .phys_base = OMAP7XX_MCBSP2_BASE,
92 .dma_rx_sync = OMAP_DMA_MCBSP3_RX,
93 .dma_tx_sync = OMAP_DMA_MCBSP3_TX,
94 .rx_irq = INT_7XX_McBSP2RX,
95 .tx_irq = INT_7XX_McBSP2TX,
96 .ops = &omap1_mcbsp_ops, 146 .ops = &omap1_mcbsp_ops,
97 }, 147 },
98}; 148};
99#define OMAP7XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap7xx_mcbsp_pdata) 149#define OMAP7XX_MCBSP_RES_SZ ARRAY_SIZE(omap7xx_mcbsp_res[1])
100#define OMAP7XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_XCERH / sizeof(u16) + 1) 150#define OMAP7XX_MCBSP_COUNT ARRAY_SIZE(omap7xx_mcbsp_res)
101#else 151#else
152#define omap7xx_mcbsp_res_0 NULL
102#define omap7xx_mcbsp_pdata NULL 153#define omap7xx_mcbsp_pdata NULL
103#define OMAP7XX_MCBSP_PDATA_SZ 0 154#define OMAP7XX_MCBSP_RES_SZ 0
104#define OMAP7XX_MCBSP_REG_NUM 0 155#define OMAP7XX_MCBSP_COUNT 0
105#endif 156#endif
106 157
107#ifdef CONFIG_ARCH_OMAP15XX 158#ifdef CONFIG_ARCH_OMAP15XX
159struct resource omap15xx_mcbsp_res[][6] = {
160 {
161 {
162 .start = OMAP1510_MCBSP1_BASE,
163 .end = OMAP1510_MCBSP1_BASE + SZ_256,
164 .flags = IORESOURCE_MEM,
165 },
166 {
167 .name = "rx",
168 .start = INT_McBSP1RX,
169 .flags = IORESOURCE_IRQ,
170 },
171 {
172 .name = "tx",
173 .start = INT_McBSP1TX,
174 .flags = IORESOURCE_IRQ,
175 },
176 {
177 .name = "rx",
178 .start = OMAP_DMA_MCBSP1_RX,
179 .flags = IORESOURCE_DMA,
180 },
181 {
182 .name = "tx",
183 .start = OMAP_DMA_MCBSP1_TX,
184 .flags = IORESOURCE_DMA,
185 },
186 },
187 {
188 {
189 .start = OMAP1510_MCBSP2_BASE,
190 .end = OMAP1510_MCBSP2_BASE + SZ_256,
191 .flags = IORESOURCE_MEM,
192 },
193 {
194 .name = "rx",
195 .start = INT_1510_SPI_RX,
196 .flags = IORESOURCE_IRQ,
197 },
198 {
199 .name = "tx",
200 .start = INT_1510_SPI_TX,
201 .flags = IORESOURCE_IRQ,
202 },
203 {
204 .name = "rx",
205 .start = OMAP_DMA_MCBSP2_RX,
206 .flags = IORESOURCE_DMA,
207 },
208 {
209 .name = "tx",
210 .start = OMAP_DMA_MCBSP2_TX,
211 .flags = IORESOURCE_DMA,
212 },
213 },
214 {
215 {
216 .start = OMAP1510_MCBSP3_BASE,
217 .end = OMAP1510_MCBSP3_BASE + SZ_256,
218 .flags = IORESOURCE_MEM,
219 },
220 {
221 .name = "rx",
222 .start = INT_McBSP3RX,
223 .flags = IORESOURCE_IRQ,
224 },
225 {
226 .name = "tx",
227 .start = INT_McBSP3TX,
228 .flags = IORESOURCE_IRQ,
229 },
230 {
231 .name = "rx",
232 .start = OMAP_DMA_MCBSP3_RX,
233 .flags = IORESOURCE_DMA,
234 },
235 {
236 .name = "tx",
237 .start = OMAP_DMA_MCBSP3_TX,
238 .flags = IORESOURCE_DMA,
239 },
240 },
241};
242
243#define omap15xx_mcbsp_res_0 omap15xx_mcbsp_res[0]
244
108static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = { 245static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = {
109 { 246 {
110 .phys_base = OMAP1510_MCBSP1_BASE,
111 .dma_rx_sync = OMAP_DMA_MCBSP1_RX,
112 .dma_tx_sync = OMAP_DMA_MCBSP1_TX,
113 .rx_irq = INT_McBSP1RX,
114 .tx_irq = INT_McBSP1TX,
115 .ops = &omap1_mcbsp_ops, 247 .ops = &omap1_mcbsp_ops,
116 }, 248 },
117 { 249 {
118 .phys_base = OMAP1510_MCBSP2_BASE,
119 .dma_rx_sync = OMAP_DMA_MCBSP2_RX,
120 .dma_tx_sync = OMAP_DMA_MCBSP2_TX,
121 .rx_irq = INT_1510_SPI_RX,
122 .tx_irq = INT_1510_SPI_TX,
123 .ops = &omap1_mcbsp_ops, 250 .ops = &omap1_mcbsp_ops,
124 }, 251 },
125 { 252 {
126 .phys_base = OMAP1510_MCBSP3_BASE,
127 .dma_rx_sync = OMAP_DMA_MCBSP3_RX,
128 .dma_tx_sync = OMAP_DMA_MCBSP3_TX,
129 .rx_irq = INT_McBSP3RX,
130 .tx_irq = INT_McBSP3TX,
131 .ops = &omap1_mcbsp_ops, 253 .ops = &omap1_mcbsp_ops,
132 }, 254 },
133}; 255};
134#define OMAP15XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap15xx_mcbsp_pdata) 256#define OMAP15XX_MCBSP_RES_SZ ARRAY_SIZE(omap15xx_mcbsp_res[1])
135#define OMAP15XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_XCERH / sizeof(u16) + 1) 257#define OMAP15XX_MCBSP_COUNT ARRAY_SIZE(omap15xx_mcbsp_res)
136#else 258#else
259#define omap15xx_mcbsp_res_0 NULL
137#define omap15xx_mcbsp_pdata NULL 260#define omap15xx_mcbsp_pdata NULL
138#define OMAP15XX_MCBSP_PDATA_SZ 0 261#define OMAP15XX_MCBSP_RES_SZ 0
139#define OMAP15XX_MCBSP_REG_NUM 0 262#define OMAP15XX_MCBSP_COUNT 0
140#endif 263#endif
141 264
142#ifdef CONFIG_ARCH_OMAP16XX 265#ifdef CONFIG_ARCH_OMAP16XX
266struct resource omap16xx_mcbsp_res[][6] = {
267 {
268 {
269 .start = OMAP1610_MCBSP1_BASE,
270 .end = OMAP1610_MCBSP1_BASE + SZ_256,
271 .flags = IORESOURCE_MEM,
272 },
273 {
274 .name = "rx",
275 .start = INT_McBSP1RX,
276 .flags = IORESOURCE_IRQ,
277 },
278 {
279 .name = "tx",
280 .start = INT_McBSP1TX,
281 .flags = IORESOURCE_IRQ,
282 },
283 {
284 .name = "rx",
285 .start = OMAP_DMA_MCBSP1_RX,
286 .flags = IORESOURCE_DMA,
287 },
288 {
289 .name = "tx",
290 .start = OMAP_DMA_MCBSP1_TX,
291 .flags = IORESOURCE_DMA,
292 },
293 },
294 {
295 {
296 .start = OMAP1610_MCBSP2_BASE,
297 .end = OMAP1610_MCBSP2_BASE + SZ_256,
298 .flags = IORESOURCE_MEM,
299 },
300 {
301 .name = "rx",
302 .start = INT_1610_McBSP2_RX,
303 .flags = IORESOURCE_IRQ,
304 },
305 {
306 .name = "tx",
307 .start = INT_1610_McBSP2_TX,
308 .flags = IORESOURCE_IRQ,
309 },
310 {
311 .name = "rx",
312 .start = OMAP_DMA_MCBSP2_RX,
313 .flags = IORESOURCE_DMA,
314 },
315 {
316 .name = "tx",
317 .start = OMAP_DMA_MCBSP2_TX,
318 .flags = IORESOURCE_DMA,
319 },
320 },
321 {
322 {
323 .start = OMAP1610_MCBSP3_BASE,
324 .end = OMAP1610_MCBSP3_BASE + SZ_256,
325 .flags = IORESOURCE_MEM,
326 },
327 {
328 .name = "rx",
329 .start = INT_McBSP3RX,
330 .flags = IORESOURCE_IRQ,
331 },
332 {
333 .name = "tx",
334 .start = INT_McBSP3TX,
335 .flags = IORESOURCE_IRQ,
336 },
337 {
338 .name = "rx",
339 .start = OMAP_DMA_MCBSP3_RX,
340 .flags = IORESOURCE_DMA,
341 },
342 {
343 .name = "tx",
344 .start = OMAP_DMA_MCBSP3_TX,
345 .flags = IORESOURCE_DMA,
346 },
347 },
348};
349
350#define omap16xx_mcbsp_res_0 omap16xx_mcbsp_res[0]
351
143static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = { 352static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
144 { 353 {
145 .phys_base = OMAP1610_MCBSP1_BASE,
146 .dma_rx_sync = OMAP_DMA_MCBSP1_RX,
147 .dma_tx_sync = OMAP_DMA_MCBSP1_TX,
148 .rx_irq = INT_McBSP1RX,
149 .tx_irq = INT_McBSP1TX,
150 .ops = &omap1_mcbsp_ops, 354 .ops = &omap1_mcbsp_ops,
151 }, 355 },
152 { 356 {
153 .phys_base = OMAP1610_MCBSP2_BASE,
154 .dma_rx_sync = OMAP_DMA_MCBSP2_RX,
155 .dma_tx_sync = OMAP_DMA_MCBSP2_TX,
156 .rx_irq = INT_1610_McBSP2_RX,
157 .tx_irq = INT_1610_McBSP2_TX,
158 .ops = &omap1_mcbsp_ops, 357 .ops = &omap1_mcbsp_ops,
159 }, 358 },
160 { 359 {
161 .phys_base = OMAP1610_MCBSP3_BASE,
162 .dma_rx_sync = OMAP_DMA_MCBSP3_RX,
163 .dma_tx_sync = OMAP_DMA_MCBSP3_TX,
164 .rx_irq = INT_McBSP3RX,
165 .tx_irq = INT_McBSP3TX,
166 .ops = &omap1_mcbsp_ops, 360 .ops = &omap1_mcbsp_ops,
167 }, 361 },
168}; 362};
169#define OMAP16XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap16xx_mcbsp_pdata) 363#define OMAP16XX_MCBSP_RES_SZ ARRAY_SIZE(omap16xx_mcbsp_res[1])
170#define OMAP16XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_XCERH / sizeof(u16) + 1) 364#define OMAP16XX_MCBSP_COUNT ARRAY_SIZE(omap16xx_mcbsp_res)
171#else 365#else
366#define omap16xx_mcbsp_res_0 NULL
172#define omap16xx_mcbsp_pdata NULL 367#define omap16xx_mcbsp_pdata NULL
173#define OMAP16XX_MCBSP_PDATA_SZ 0 368#define OMAP16XX_MCBSP_RES_SZ 0
174#define OMAP16XX_MCBSP_REG_NUM 0 369#define OMAP16XX_MCBSP_COUNT 0
175#endif 370#endif
176 371
177static int __init omap1_mcbsp_init(void) 372static int __init omap1_mcbsp_init(void)
@@ -179,16 +374,12 @@ static int __init omap1_mcbsp_init(void)
179 if (!cpu_class_is_omap1()) 374 if (!cpu_class_is_omap1())
180 return -ENODEV; 375 return -ENODEV;
181 376
182 if (cpu_is_omap7xx()) { 377 if (cpu_is_omap7xx())
183 omap_mcbsp_count = OMAP7XX_MCBSP_PDATA_SZ; 378 omap_mcbsp_count = OMAP7XX_MCBSP_COUNT;
184 omap_mcbsp_cache_size = OMAP7XX_MCBSP_REG_NUM * sizeof(u16); 379 else if (cpu_is_omap15xx())
185 } else if (cpu_is_omap15xx()) { 380 omap_mcbsp_count = OMAP15XX_MCBSP_COUNT;
186 omap_mcbsp_count = OMAP15XX_MCBSP_PDATA_SZ; 381 else if (cpu_is_omap16xx())
187 omap_mcbsp_cache_size = OMAP15XX_MCBSP_REG_NUM * sizeof(u16); 382 omap_mcbsp_count = OMAP16XX_MCBSP_COUNT;
188 } else if (cpu_is_omap16xx()) {
189 omap_mcbsp_count = OMAP16XX_MCBSP_PDATA_SZ;
190 omap_mcbsp_cache_size = OMAP16XX_MCBSP_REG_NUM * sizeof(u16);
191 }
192 383
193 mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), 384 mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *),
194 GFP_KERNEL); 385 GFP_KERNEL);
@@ -196,16 +387,22 @@ static int __init omap1_mcbsp_init(void)
196 return -ENOMEM; 387 return -ENOMEM;
197 388
198 if (cpu_is_omap7xx()) 389 if (cpu_is_omap7xx())
199 omap_mcbsp_register_board_cfg(omap7xx_mcbsp_pdata, 390 omap_mcbsp_register_board_cfg(omap7xx_mcbsp_res_0,
200 OMAP7XX_MCBSP_PDATA_SZ); 391 OMAP7XX_MCBSP_RES_SZ,
392 omap7xx_mcbsp_pdata,
393 OMAP7XX_MCBSP_COUNT);
201 394
202 if (cpu_is_omap15xx()) 395 if (cpu_is_omap15xx())
203 omap_mcbsp_register_board_cfg(omap15xx_mcbsp_pdata, 396 omap_mcbsp_register_board_cfg(omap15xx_mcbsp_res_0,
204 OMAP15XX_MCBSP_PDATA_SZ); 397 OMAP15XX_MCBSP_RES_SZ,
398 omap15xx_mcbsp_pdata,
399 OMAP15XX_MCBSP_COUNT);
205 400
206 if (cpu_is_omap16xx()) 401 if (cpu_is_omap16xx())
207 omap_mcbsp_register_board_cfg(omap16xx_mcbsp_pdata, 402 omap_mcbsp_register_board_cfg(omap16xx_mcbsp_res_0,
208 OMAP16XX_MCBSP_PDATA_SZ); 403 OMAP16XX_MCBSP_RES_SZ,
404 omap16xx_mcbsp_pdata,
405 OMAP16XX_MCBSP_COUNT);
209 406
210 return omap_mcbsp_init(); 407 return omap_mcbsp_init();
211} 408}
diff --git a/arch/arm/mach-omap1/pm.h b/arch/arm/mach-omap1/pm.h
index 56a647986ae9..cd926dcb5e7f 100644
--- a/arch/arm/mach-omap1/pm.h
+++ b/arch/arm/mach-omap1/pm.h
@@ -123,9 +123,9 @@ extern void allow_idle_sleep(void);
123extern void omap1_pm_idle(void); 123extern void omap1_pm_idle(void);
124extern void omap1_pm_suspend(void); 124extern void omap1_pm_suspend(void);
125 125
126extern void omap7xx_cpu_suspend(unsigned short, unsigned short); 126extern void omap7xx_cpu_suspend(unsigned long, unsigned long);
127extern void omap1510_cpu_suspend(unsigned short, unsigned short); 127extern void omap1510_cpu_suspend(unsigned long, unsigned long);
128extern void omap1610_cpu_suspend(unsigned short, unsigned short); 128extern void omap1610_cpu_suspend(unsigned long, unsigned long);
129extern void omap7xx_idle_loop_suspend(void); 129extern void omap7xx_idle_loop_suspend(void);
130extern void omap1510_idle_loop_suspend(void); 130extern void omap1510_idle_loop_suspend(void);
131extern void omap1610_idle_loop_suspend(void); 131extern void omap1610_idle_loop_suspend(void);
diff --git a/arch/arm/mach-omap1/reset.c b/arch/arm/mach-omap1/reset.c
new file mode 100644
index 000000000000..ad951ee69205
--- /dev/null
+++ b/arch/arm/mach-omap1/reset.c
@@ -0,0 +1,25 @@
1/*
2 * OMAP1 reset support
3 */
4#include <linux/kernel.h>
5#include <linux/io.h>
6
7#include <mach/hardware.h>
8#include <mach/system.h>
9#include <plat/prcm.h>
10
11void omap1_arch_reset(char mode, const char *cmd)
12{
13 /*
14 * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28
15 * "Global Software Reset Affects Traffic Controller Frequency".
16 */
17 if (cpu_is_omap5912()) {
18 omap_writew(omap_readw(DPLL_CTL) & ~(1 << 4), DPLL_CTL);
19 omap_writew(0x8, ARM_RSTCT1);
20 }
21
22 omap_writew(1, ARM_RSTCT1);
23}
24
25void (*arch_reset)(char, const char *) = omap1_arch_reset;
diff --git a/arch/arm/mach-omap1/sleep.S b/arch/arm/mach-omap1/sleep.S
index ef771ce8b030..c875bdc902c5 100644
--- a/arch/arm/mach-omap1/sleep.S
+++ b/arch/arm/mach-omap1/sleep.S
@@ -58,6 +58,7 @@
58 */ 58 */
59 59
60#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) 60#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
61 .align 3
61ENTRY(omap7xx_cpu_suspend) 62ENTRY(omap7xx_cpu_suspend)
62 63
63 @ save registers on stack 64 @ save registers on stack
@@ -137,6 +138,7 @@ ENTRY(omap7xx_cpu_suspend_sz)
137#endif /* CONFIG_ARCH_OMAP730 || CONFIG_ARCH_OMAP850 */ 138#endif /* CONFIG_ARCH_OMAP730 || CONFIG_ARCH_OMAP850 */
138 139
139#ifdef CONFIG_ARCH_OMAP15XX 140#ifdef CONFIG_ARCH_OMAP15XX
141 .align 3
140ENTRY(omap1510_cpu_suspend) 142ENTRY(omap1510_cpu_suspend)
141 143
142 @ save registers on stack 144 @ save registers on stack
@@ -211,6 +213,7 @@ ENTRY(omap1510_cpu_suspend_sz)
211#endif /* CONFIG_ARCH_OMAP15XX */ 213#endif /* CONFIG_ARCH_OMAP15XX */
212 214
213#if defined(CONFIG_ARCH_OMAP16XX) 215#if defined(CONFIG_ARCH_OMAP16XX)
216 .align 3
214ENTRY(omap1610_cpu_suspend) 217ENTRY(omap1610_cpu_suspend)
215 218
216 @ save registers on stack 219 @ save registers on stack
diff --git a/arch/arm/mach-omap1/sram.S b/arch/arm/mach-omap1/sram.S
index 7724e520d07c..692587d07ea5 100644
--- a/arch/arm/mach-omap1/sram.S
+++ b/arch/arm/mach-omap1/sram.S
@@ -18,6 +18,7 @@
18/* 18/*
19 * Reprograms ULPD and CKCTL. 19 * Reprograms ULPD and CKCTL.
20 */ 20 */
21 .align 3
21ENTRY(omap1_sram_reprogram_clock) 22ENTRY(omap1_sram_reprogram_clock)
22 stmfd sp!, {r0 - r12, lr} @ save registers on stack 23 stmfd sp!, {r0 - r12, lr} @ save registers on stack
23 24
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index ed7a61ff916a..6885d2fac183 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -49,11 +49,15 @@
49#include <mach/hardware.h> 49#include <mach/hardware.h>
50#include <asm/leds.h> 50#include <asm/leds.h>
51#include <asm/irq.h> 51#include <asm/irq.h>
52#include <asm/sched_clock.h>
53
52#include <asm/mach/irq.h> 54#include <asm/mach/irq.h>
53#include <asm/mach/time.h> 55#include <asm/mach/time.h>
54 56
55#include <plat/common.h> 57#include <plat/common.h>
56 58
59#ifdef CONFIG_OMAP_MPU_TIMER
60
57#define OMAP_MPU_TIMER_BASE OMAP_MPU_TIMER1_BASE 61#define OMAP_MPU_TIMER_BASE OMAP_MPU_TIMER1_BASE
58#define OMAP_MPU_TIMER_OFFSET 0x100 62#define OMAP_MPU_TIMER_OFFSET 0x100
59 63
@@ -67,7 +71,7 @@ typedef struct {
67((volatile omap_mpu_timer_regs_t*)OMAP1_IO_ADDRESS(OMAP_MPU_TIMER_BASE + \ 71((volatile omap_mpu_timer_regs_t*)OMAP1_IO_ADDRESS(OMAP_MPU_TIMER_BASE + \
68 (n)*OMAP_MPU_TIMER_OFFSET)) 72 (n)*OMAP_MPU_TIMER_OFFSET))
69 73
70static inline unsigned long omap_mpu_timer_read(int nr) 74static inline unsigned long notrace omap_mpu_timer_read(int nr)
71{ 75{
72 volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); 76 volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr);
73 return timer->read_tim; 77 return timer->read_tim;
@@ -212,6 +216,32 @@ static struct clocksource clocksource_mpu = {
212 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 216 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
213}; 217};
214 218
219static DEFINE_CLOCK_DATA(cd);
220
221static inline unsigned long long notrace _omap_mpu_sched_clock(void)
222{
223 u32 cyc = mpu_read(&clocksource_mpu);
224 return cyc_to_sched_clock(&cd, cyc, (u32)~0);
225}
226
227#ifndef CONFIG_OMAP_32K_TIMER
228unsigned long long notrace sched_clock(void)
229{
230 return _omap_mpu_sched_clock();
231}
232#else
233static unsigned long long notrace omap_mpu_sched_clock(void)
234{
235 return _omap_mpu_sched_clock();
236}
237#endif
238
239static void notrace mpu_update_sched_clock(void)
240{
241 u32 cyc = mpu_read(&clocksource_mpu);
242 update_sched_clock(&cd, cyc, (u32)~0);
243}
244
215static void __init omap_init_clocksource(unsigned long rate) 245static void __init omap_init_clocksource(unsigned long rate)
216{ 246{
217 static char err[] __initdata = KERN_ERR 247 static char err[] __initdata = KERN_ERR
@@ -219,17 +249,13 @@ static void __init omap_init_clocksource(unsigned long rate)
219 249
220 setup_irq(INT_TIMER2, &omap_mpu_timer2_irq); 250 setup_irq(INT_TIMER2, &omap_mpu_timer2_irq);
221 omap_mpu_timer_start(1, ~0, 1); 251 omap_mpu_timer_start(1, ~0, 1);
252 init_sched_clock(&cd, mpu_update_sched_clock, 32, rate);
222 253
223 if (clocksource_register_hz(&clocksource_mpu, rate)) 254 if (clocksource_register_hz(&clocksource_mpu, rate))
224 printk(err, clocksource_mpu.name); 255 printk(err, clocksource_mpu.name);
225} 256}
226 257
227/* 258static void __init omap_mpu_timer_init(void)
228 * ---------------------------------------------------------------------------
229 * Timer initialization
230 * ---------------------------------------------------------------------------
231 */
232static void __init omap_timer_init(void)
233{ 259{
234 struct clk *ck_ref = clk_get(NULL, "ck_ref"); 260 struct clk *ck_ref = clk_get(NULL, "ck_ref");
235 unsigned long rate; 261 unsigned long rate;
@@ -246,6 +272,66 @@ static void __init omap_timer_init(void)
246 omap_init_clocksource(rate); 272 omap_init_clocksource(rate);
247} 273}
248 274
275#else
276static inline void omap_mpu_timer_init(void)
277{
278 pr_err("Bogus timer, should not happen\n");
279}
280#endif /* CONFIG_OMAP_MPU_TIMER */
281
282#if defined(CONFIG_OMAP_MPU_TIMER) && defined(CONFIG_OMAP_32K_TIMER)
283static unsigned long long (*preferred_sched_clock)(void);
284
285unsigned long long notrace sched_clock(void)
286{
287 if (!preferred_sched_clock)
288 return 0;
289
290 return preferred_sched_clock();
291}
292
293static inline void preferred_sched_clock_init(bool use_32k_sched_clock)
294{
295 if (use_32k_sched_clock)
296 preferred_sched_clock = omap_32k_sched_clock;
297 else
298 preferred_sched_clock = omap_mpu_sched_clock;
299}
300#else
301static inline void preferred_sched_clock_init(bool use_32k_sched_clcok)
302{
303}
304#endif
305
306static inline int omap_32k_timer_usable(void)
307{
308 int res = false;
309
310 if (cpu_is_omap730() || cpu_is_omap15xx())
311 return res;
312
313#ifdef CONFIG_OMAP_32K_TIMER
314 res = omap_32k_timer_init();
315#endif
316
317 return res;
318}
319
320/*
321 * ---------------------------------------------------------------------------
322 * Timer initialization
323 * ---------------------------------------------------------------------------
324 */
325static void __init omap_timer_init(void)
326{
327 if (omap_32k_timer_usable()) {
328 preferred_sched_clock_init(1);
329 } else {
330 omap_mpu_timer_init();
331 preferred_sched_clock_init(0);
332 }
333}
334
249struct sys_timer omap_timer = { 335struct sys_timer omap_timer = {
250 .init = omap_timer_init, 336 .init = omap_timer_init,
251}; 337};
diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c
index 20cfbcc6c60c..13d7b8f145bd 100644
--- a/arch/arm/mach-omap1/timer32k.c
+++ b/arch/arm/mach-omap1/timer32k.c
@@ -52,10 +52,9 @@
52#include <asm/irq.h> 52#include <asm/irq.h>
53#include <asm/mach/irq.h> 53#include <asm/mach/irq.h>
54#include <asm/mach/time.h> 54#include <asm/mach/time.h>
55#include <plat/common.h>
55#include <plat/dmtimer.h> 56#include <plat/dmtimer.h>
56 57
57struct sys_timer omap_timer;
58
59/* 58/*
60 * --------------------------------------------------------------------------- 59 * ---------------------------------------------------------------------------
61 * 32KHz OS timer 60 * 32KHz OS timer
@@ -181,14 +180,14 @@ static __init void omap_init_32k_timer(void)
181 * Timer initialization 180 * Timer initialization
182 * --------------------------------------------------------------------------- 181 * ---------------------------------------------------------------------------
183 */ 182 */
184static void __init omap_timer_init(void) 183bool __init omap_32k_timer_init(void)
185{ 184{
185 omap_init_clocksource_32k();
186
186#ifdef CONFIG_OMAP_DM_TIMER 187#ifdef CONFIG_OMAP_DM_TIMER
187 omap_dm_timer_init(); 188 omap_dm_timer_init();
188#endif 189#endif
189 omap_init_32k_timer(); 190 omap_init_32k_timer();
190}
191 191
192struct sys_timer omap_timer = { 192 return true;
193 .init = omap_timer_init, 193}
194};
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 1a2cf6226a55..b997a35830fc 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -44,7 +44,9 @@ config ARCH_OMAP4
44 depends on ARCH_OMAP2PLUS 44 depends on ARCH_OMAP2PLUS
45 select CPU_V7 45 select CPU_V7
46 select ARM_GIC 46 select ARM_GIC
47 select LOCAL_TIMERS if SMP
47 select PL310_ERRATA_588369 48 select PL310_ERRATA_588369
49 select PL310_ERRATA_727915
48 select ARM_ERRATA_720789 50 select ARM_ERRATA_720789
49 select ARCH_HAS_OPP 51 select ARCH_HAS_OPP
50 select PM_OPP if PM 52 select PM_OPP if PM
@@ -53,25 +55,30 @@ config ARCH_OMAP4
53comment "OMAP Core Type" 55comment "OMAP Core Type"
54 depends on ARCH_OMAP2 56 depends on ARCH_OMAP2
55 57
56config ARCH_OMAP2420 58config SOC_OMAP2420
57 bool "OMAP2420 support" 59 bool "OMAP2420 support"
58 depends on ARCH_OMAP2 60 depends on ARCH_OMAP2
59 default y 61 default y
60 select OMAP_DM_TIMER 62 select OMAP_DM_TIMER
61 select ARCH_OMAP_OTG 63 select ARCH_OMAP_OTG
62 64
63config ARCH_OMAP2430 65config SOC_OMAP2430
64 bool "OMAP2430 support" 66 bool "OMAP2430 support"
65 depends on ARCH_OMAP2 67 depends on ARCH_OMAP2
66 default y 68 default y
67 select ARCH_OMAP_OTG 69 select ARCH_OMAP_OTG
68 70
69config ARCH_OMAP3430 71config SOC_OMAP3430
70 bool "OMAP3430 support" 72 bool "OMAP3430 support"
71 depends on ARCH_OMAP3 73 depends on ARCH_OMAP3
72 default y 74 default y
73 select ARCH_OMAP_OTG 75 select ARCH_OMAP_OTG
74 76
77config SOC_OMAPTI816X
78 bool "TI816X support"
79 depends on ARCH_OMAP3
80 default y
81
75config OMAP_PACKAGE_ZAF 82config OMAP_PACKAGE_ZAF
76 bool 83 bool
77 84
@@ -106,25 +113,25 @@ config MACH_OMAP_GENERIC
106 113
107config MACH_OMAP2_TUSB6010 114config MACH_OMAP2_TUSB6010
108 bool 115 bool
109 depends on ARCH_OMAP2 && ARCH_OMAP2420 116 depends on ARCH_OMAP2 && SOC_OMAP2420
110 default y if MACH_NOKIA_N8X0 117 default y if MACH_NOKIA_N8X0
111 118
112config MACH_OMAP_H4 119config MACH_OMAP_H4
113 bool "OMAP 2420 H4 board" 120 bool "OMAP 2420 H4 board"
114 depends on ARCH_OMAP2420 121 depends on SOC_OMAP2420
115 default y 122 default y
116 select OMAP_PACKAGE_ZAF 123 select OMAP_PACKAGE_ZAF
117 select OMAP_DEBUG_DEVICES 124 select OMAP_DEBUG_DEVICES
118 125
119config MACH_OMAP_APOLLON 126config MACH_OMAP_APOLLON
120 bool "OMAP 2420 Apollon board" 127 bool "OMAP 2420 Apollon board"
121 depends on ARCH_OMAP2420 128 depends on SOC_OMAP2420
122 default y 129 default y
123 select OMAP_PACKAGE_ZAC 130 select OMAP_PACKAGE_ZAC
124 131
125config MACH_OMAP_2430SDP 132config MACH_OMAP_2430SDP
126 bool "OMAP 2430 SDP board" 133 bool "OMAP 2430 SDP board"
127 depends on ARCH_OMAP2430 134 depends on SOC_OMAP2430
128 default y 135 default y
129 select OMAP_PACKAGE_ZAC 136 select OMAP_PACKAGE_ZAC
130 137
@@ -219,7 +226,7 @@ config MACH_NOKIA_N810_WIMAX
219 226
220config MACH_NOKIA_N8X0 227config MACH_NOKIA_N8X0
221 bool "Nokia N800/N810" 228 bool "Nokia N800/N810"
222 depends on ARCH_OMAP2420 229 depends on SOC_OMAP2420
223 default y 230 default y
224 select OMAP_PACKAGE_ZAC 231 select OMAP_PACKAGE_ZAC
225 select MACH_NOKIA_N800 232 select MACH_NOKIA_N800
@@ -294,12 +301,18 @@ config MACH_OMAP_3630SDP
294 default y 301 default y
295 select OMAP_PACKAGE_CBP 302 select OMAP_PACKAGE_CBP
296 303
304config MACH_TI8168EVM
305 bool "TI8168 Evaluation Module"
306 depends on SOC_OMAPTI816X
307 default y
308
297config MACH_OMAP_4430SDP 309config MACH_OMAP_4430SDP
298 bool "OMAP 4430 SDP board" 310 bool "OMAP 4430 SDP board"
299 default y 311 default y
300 depends on ARCH_OMAP4 312 depends on ARCH_OMAP4
301 select OMAP_PACKAGE_CBL 313 select OMAP_PACKAGE_CBL
302 select OMAP_PACKAGE_CBS 314 select OMAP_PACKAGE_CBS
315 select REGULATOR_FIXED_VOLTAGE
303 316
304config MACH_OMAP4_PANDA 317config MACH_OMAP4_PANDA
305 bool "OMAP4 Panda Board" 318 bool "OMAP4 Panda Board"
@@ -307,6 +320,7 @@ config MACH_OMAP4_PANDA
307 depends on ARCH_OMAP4 320 depends on ARCH_OMAP4
308 select OMAP_PACKAGE_CBL 321 select OMAP_PACKAGE_CBL
309 select OMAP_PACKAGE_CBS 322 select OMAP_PACKAGE_CBS
323 select REGULATOR_FIXED_VOLTAGE
310 324
311config OMAP3_EMU 325config OMAP3_EMU
312 bool "OMAP3 debugging peripherals" 326 bool "OMAP3 debugging peripherals"
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 1c0c2b02d870..a45cd6409686 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -31,8 +31,8 @@ AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a$(plus_sec)
31AFLAGS_omap44xx-smc.o :=-Wa,-march=armv7-a$(plus_sec) 31AFLAGS_omap44xx-smc.o :=-Wa,-march=armv7-a$(plus_sec)
32 32
33# Functions loaded to SRAM 33# Functions loaded to SRAM
34obj-$(CONFIG_ARCH_OMAP2420) += sram242x.o 34obj-$(CONFIG_SOC_OMAP2420) += sram242x.o
35obj-$(CONFIG_ARCH_OMAP2430) += sram243x.o 35obj-$(CONFIG_SOC_OMAP2430) += sram243x.o
36obj-$(CONFIG_ARCH_OMAP3) += sram34xx.o 36obj-$(CONFIG_ARCH_OMAP3) += sram34xx.o
37 37
38AFLAGS_sram242x.o :=-Wa,-march=armv6 38AFLAGS_sram242x.o :=-Wa,-march=armv6
@@ -40,8 +40,8 @@ AFLAGS_sram243x.o :=-Wa,-march=armv6
40AFLAGS_sram34xx.o :=-Wa,-march=armv7-a 40AFLAGS_sram34xx.o :=-Wa,-march=armv7-a
41 41
42# Pin multiplexing 42# Pin multiplexing
43obj-$(CONFIG_ARCH_OMAP2420) += mux2420.o 43obj-$(CONFIG_SOC_OMAP2420) += mux2420.o
44obj-$(CONFIG_ARCH_OMAP2430) += mux2430.o 44obj-$(CONFIG_SOC_OMAP2430) += mux2430.o
45obj-$(CONFIG_ARCH_OMAP3) += mux34xx.o 45obj-$(CONFIG_ARCH_OMAP3) += mux34xx.o
46obj-$(CONFIG_ARCH_OMAP4) += mux44xx.o 46obj-$(CONFIG_ARCH_OMAP4) += mux44xx.o
47 47
@@ -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 voltage.o 62obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o pm_bus.o
63obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o voltage.o \ 63obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o \
64 cpuidle34xx.o pm_bus.o 64 cpuidle34xx.o pm_bus.o
65obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o voltage.o pm_bus.o 65obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o pm_bus.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
@@ -78,13 +78,25 @@ endif
78 78
79# PRCM 79# PRCM
80obj-$(CONFIG_ARCH_OMAP2) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o 80obj-$(CONFIG_ARCH_OMAP2) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
81obj-$(CONFIG_ARCH_OMAP3) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o 81obj-$(CONFIG_ARCH_OMAP3) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o \
82 vc3xxx_data.o vp3xxx_data.o
82# XXX The presence of cm2xxx_3xxx.o on the line below is temporary and 83# XXX The presence of cm2xxx_3xxx.o on the line below is temporary and
83# will be removed once the OMAP4 part of the codebase is converted to 84# will be removed once the OMAP4 part of the codebase is converted to
84# use OMAP4-specific PRCM functions. 85# use OMAP4-specific PRCM functions.
85obj-$(CONFIG_ARCH_OMAP4) += prcm.o cm2xxx_3xxx.o cminst44xx.o \ 86obj-$(CONFIG_ARCH_OMAP4) += prcm.o cm2xxx_3xxx.o cminst44xx.o \
86 cm44xx.o prcm_mpu44xx.o \ 87 cm44xx.o prcm_mpu44xx.o \
87 prminst44xx.o 88 prminst44xx.o vc44xx_data.o \
89 vp44xx_data.o
90
91# OMAP voltage domains
92ifeq ($(CONFIG_PM),y)
93voltagedomain-common := voltage.o
94obj-$(CONFIG_ARCH_OMAP2) += $(voltagedomain-common)
95obj-$(CONFIG_ARCH_OMAP3) += $(voltagedomain-common) \
96 voltagedomains3xxx_data.o
97obj-$(CONFIG_ARCH_OMAP4) += $(voltagedomain-common) \
98 voltagedomains44xx_data.o
99endif
88 100
89# OMAP powerdomain framework 101# OMAP powerdomain framework
90powerdomain-common += powerdomain.o powerdomain-common.o 102powerdomain-common += powerdomain.o powerdomain-common.o
@@ -102,39 +114,49 @@ obj-$(CONFIG_ARCH_OMAP4) += $(powerdomain-common) \
102 114
103# PRCM clockdomain control 115# PRCM clockdomain control
104obj-$(CONFIG_ARCH_OMAP2) += clockdomain.o \ 116obj-$(CONFIG_ARCH_OMAP2) += clockdomain.o \
117 clockdomain2xxx_3xxx.o \
105 clockdomains2xxx_3xxx_data.o 118 clockdomains2xxx_3xxx_data.o
106obj-$(CONFIG_ARCH_OMAP3) += clockdomain.o \ 119obj-$(CONFIG_ARCH_OMAP3) += clockdomain.o \
120 clockdomain2xxx_3xxx.o \
107 clockdomains2xxx_3xxx_data.o 121 clockdomains2xxx_3xxx_data.o
108obj-$(CONFIG_ARCH_OMAP4) += clockdomain.o \ 122obj-$(CONFIG_ARCH_OMAP4) += clockdomain.o \
123 clockdomain44xx.o \
109 clockdomains44xx_data.o 124 clockdomains44xx_data.o
125
110# Clock framework 126# Clock framework
111obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o \ 127obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o \
112 clkt2xxx_sys.o \ 128 clkt2xxx_sys.o \
113 clkt2xxx_dpllcore.o \ 129 clkt2xxx_dpllcore.o \
114 clkt2xxx_virt_prcm_set.o \ 130 clkt2xxx_virt_prcm_set.o \
115 clkt2xxx_apll.o clkt2xxx_osc.o 131 clkt2xxx_apll.o clkt2xxx_osc.o \
116obj-$(CONFIG_ARCH_OMAP2420) += clock2420_data.o 132 clkt2xxx_dpll.o clkt_iclk.o
117obj-$(CONFIG_ARCH_OMAP2430) += clock2430.o clock2430_data.o 133obj-$(CONFIG_SOC_OMAP2420) += clock2420_data.o
134obj-$(CONFIG_SOC_OMAP2430) += clock2430.o clock2430_data.o
118obj-$(CONFIG_ARCH_OMAP3) += $(clock-common) clock3xxx.o \ 135obj-$(CONFIG_ARCH_OMAP3) += $(clock-common) clock3xxx.o \
119 clock34xx.o clkt34xx_dpll3m2.o \ 136 clock34xx.o clkt34xx_dpll3m2.o \
120 clock3517.o clock36xx.o \ 137 clock3517.o clock36xx.o \
121 dpll3xxx.o clock3xxx_data.o 138 dpll3xxx.o clock3xxx_data.o \
139 clkt_iclk.o
122obj-$(CONFIG_ARCH_OMAP4) += $(clock-common) clock44xx_data.o \ 140obj-$(CONFIG_ARCH_OMAP4) += $(clock-common) clock44xx_data.o \
123 dpll3xxx.o 141 dpll3xxx.o dpll44xx.o
124 142
125# OMAP2 clock rate set data (old "OPP" data) 143# OMAP2 clock rate set data (old "OPP" data)
126obj-$(CONFIG_ARCH_OMAP2420) += opp2420_data.o 144obj-$(CONFIG_SOC_OMAP2420) += opp2420_data.o
127obj-$(CONFIG_ARCH_OMAP2430) += opp2430_data.o 145obj-$(CONFIG_SOC_OMAP2430) += opp2430_data.o
128 146
129# hwmod data 147# hwmod data
130obj-$(CONFIG_ARCH_OMAP2420) += omap_hwmod_2420_data.o 148obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2420_data.o
131obj-$(CONFIG_ARCH_OMAP2430) += omap_hwmod_2430_data.o 149obj-$(CONFIG_SOC_OMAP2430) += omap_hwmod_2430_data.o
132obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_3xxx_data.o 150obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_3xxx_data.o
133obj-$(CONFIG_ARCH_OMAP4) += omap_hwmod_44xx_data.o 151obj-$(CONFIG_ARCH_OMAP4) += omap_hwmod_44xx_data.o
134 152
135# EMU peripherals 153# EMU peripherals
136obj-$(CONFIG_OMAP3_EMU) += emu.o 154obj-$(CONFIG_OMAP3_EMU) += emu.o
137 155
156# L3 interconnect
157obj-$(CONFIG_ARCH_OMAP3) += omap_l3_smx.o
158obj-$(CONFIG_ARCH_OMAP4) += omap_l3_noc.o
159
138obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o 160obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o
139mailbox_mach-objs := mailbox.o 161mailbox_mach-objs := mailbox.o
140 162
@@ -218,18 +240,20 @@ obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o \
218 hsmmc.o \ 240 hsmmc.o \
219 omap_phy_internal.o 241 omap_phy_internal.o
220 242
221obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o 243obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o \
244 omap_phy_internal.o \
222 245
223obj-$(CONFIG_MACH_CRANEBOARD) += board-am3517crane.o 246obj-$(CONFIG_MACH_CRANEBOARD) += board-am3517crane.o
224 247
225obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \ 248obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \
226 hsmmc.o 249 hsmmc.o
250obj-$(CONFIG_MACH_TI8168EVM) += board-ti8168evm.o
227# Platform specific device init code 251# Platform specific device init code
228usbfs-$(CONFIG_ARCH_OMAP_OTG) := usb-fs.o 252usbfs-$(CONFIG_ARCH_OMAP_OTG) := usb-fs.o
229obj-y += $(usbfs-m) $(usbfs-y) 253obj-y += $(usbfs-m) $(usbfs-y)
230obj-y += usb-musb.o 254obj-y += usb-musb.o
231obj-$(CONFIG_MACH_OMAP2_TUSB6010) += usb-tusb6010.o 255obj-$(CONFIG_MACH_OMAP2_TUSB6010) += usb-tusb6010.o
232obj-y += usb-ehci.o 256obj-y += usb-host.o
233 257
234onenand-$(CONFIG_MTD_ONENAND_OMAP2) := gpmc-onenand.o 258onenand-$(CONFIG_MTD_ONENAND_OMAP2) := gpmc-onenand.o
235obj-y += $(onenand-m) $(onenand-y) 259obj-y += $(onenand-m) $(onenand-y)
@@ -242,3 +266,7 @@ obj-y += $(smc91x-m) $(smc91x-y)
242 266
243smsc911x-$(CONFIG_SMSC911X) := gpmc-smsc911x.o 267smsc911x-$(CONFIG_SMSC911X) := gpmc-smsc911x.o
244obj-y += $(smsc911x-m) $(smsc911x-y) 268obj-y += $(smsc911x-m) $(smsc911x-y)
269obj-$(CONFIG_ARCH_OMAP4) += hwspinlock.o
270
271disp-$(CONFIG_OMAP2_DSS) := display.o
272obj-y += $(disp-m) $(disp-y)
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index e0661777f599..1fa6bb896f41 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -22,6 +22,7 @@
22#include <linux/mmc/host.h> 22#include <linux/mmc/host.h>
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/i2c/twl.h> 24#include <linux/i2c/twl.h>
25#include <linux/regulator/machine.h>
25#include <linux/err.h> 26#include <linux/err.h>
26#include <linux/clk.h> 27#include <linux/clk.h>
27#include <linux/io.h> 28#include <linux/io.h>
@@ -139,15 +140,31 @@ static struct omap_board_config_kernel sdp2430_config[] __initdata = {
139 {OMAP_TAG_LCD, &sdp2430_lcd_config}, 140 {OMAP_TAG_LCD, &sdp2430_lcd_config},
140}; 141};
141 142
142static void __init omap_2430sdp_init_irq(void) 143static void __init omap_2430sdp_init_early(void)
143{ 144{
144 omap_board_config = sdp2430_config;
145 omap_board_config_size = ARRAY_SIZE(sdp2430_config);
146 omap2_init_common_infrastructure(); 145 omap2_init_common_infrastructure();
147 omap2_init_common_devices(NULL, NULL); 146 omap2_init_common_devices(NULL, NULL);
148 omap_init_irq();
149} 147}
150 148
149static struct regulator_consumer_supply sdp2430_vmmc1_supplies[] = {
150 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
151};
152
153/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
154static struct regulator_init_data sdp2430_vmmc1 = {
155 .constraints = {
156 .min_uV = 1850000,
157 .max_uV = 3150000,
158 .valid_modes_mask = REGULATOR_MODE_NORMAL
159 | REGULATOR_MODE_STANDBY,
160 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
161 | REGULATOR_CHANGE_MODE
162 | REGULATOR_CHANGE_STATUS,
163 },
164 .num_consumer_supplies = ARRAY_SIZE(sdp2430_vmmc1_supplies),
165 .consumer_supplies = &sdp2430_vmmc1_supplies[0],
166};
167
151static struct twl4030_gpio_platform_data sdp2430_gpio_data = { 168static struct twl4030_gpio_platform_data sdp2430_gpio_data = {
152 .gpio_base = OMAP_MAX_GPIO_LINES, 169 .gpio_base = OMAP_MAX_GPIO_LINES,
153 .irq_base = TWL4030_GPIO_IRQ_BASE, 170 .irq_base = TWL4030_GPIO_IRQ_BASE,
@@ -160,6 +177,7 @@ static struct twl4030_platform_data sdp2430_twldata = {
160 177
161 /* platform_data for children goes here */ 178 /* platform_data for children goes here */
162 .gpio = &sdp2430_gpio_data, 179 .gpio = &sdp2430_gpio_data,
180 .vmmc1 = &sdp2430_vmmc1,
163}; 181};
164 182
165static struct i2c_board_info __initdata sdp2430_i2c_boardinfo[] = { 183static struct i2c_board_info __initdata sdp2430_i2c_boardinfo[] = {
@@ -226,6 +244,9 @@ static void __init omap_2430sdp_init(void)
226 244
227 omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC); 245 omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC);
228 246
247 omap_board_config = sdp2430_config;
248 omap_board_config_size = ARRAY_SIZE(sdp2430_config);
249
229 omap2430_i2c_init(); 250 omap2430_i2c_init();
230 251
231 platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); 252 platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));
@@ -253,9 +274,10 @@ static void __init omap_2430sdp_map_io(void)
253MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board") 274MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
254 /* Maintainer: Syed Khasim - Texas Instruments Inc */ 275 /* Maintainer: Syed Khasim - Texas Instruments Inc */
255 .boot_params = 0x80000100, 276 .boot_params = 0x80000100,
256 .map_io = omap_2430sdp_map_io,
257 .reserve = omap_reserve, 277 .reserve = omap_reserve,
258 .init_irq = omap_2430sdp_init_irq, 278 .map_io = omap_2430sdp_map_io,
279 .init_early = omap_2430sdp_init_early,
280 .init_irq = omap_init_irq,
259 .init_machine = omap_2430sdp_init, 281 .init_machine = omap_2430sdp_init,
260 .timer = &omap_timer, 282 .timer = &omap_timer,
261MACHINE_END 283MACHINE_END
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index d4e41ef86aa5..9afd087cc29c 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -307,34 +307,13 @@ static struct omap_dss_board_info sdp3430_dss_data = {
307 .default_device = &sdp3430_lcd_device, 307 .default_device = &sdp3430_lcd_device,
308}; 308};
309 309
310static struct platform_device sdp3430_dss_device = {
311 .name = "omapdss",
312 .id = -1,
313 .dev = {
314 .platform_data = &sdp3430_dss_data,
315 },
316};
317
318static struct regulator_consumer_supply sdp3430_vdda_dac_supply = {
319 .supply = "vdda_dac",
320 .dev = &sdp3430_dss_device.dev,
321};
322
323static struct platform_device *sdp3430_devices[] __initdata = {
324 &sdp3430_dss_device,
325};
326
327static struct omap_board_config_kernel sdp3430_config[] __initdata = { 310static struct omap_board_config_kernel sdp3430_config[] __initdata = {
328}; 311};
329 312
330static void __init omap_3430sdp_init_irq(void) 313static void __init omap_3430sdp_init_early(void)
331{ 314{
332 omap_board_config = sdp3430_config;
333 omap_board_config_size = ARRAY_SIZE(sdp3430_config);
334 omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
335 omap2_init_common_infrastructure(); 315 omap2_init_common_infrastructure();
336 omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL); 316 omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL);
337 omap_init_irq();
338} 317}
339 318
340static int sdp3430_batt_table[] = { 319static int sdp3430_batt_table[] = {
@@ -370,18 +349,6 @@ static struct omap2_hsmmc_info mmc[] = {
370 {} /* Terminator */ 349 {} /* Terminator */
371}; 350};
372 351
373static struct regulator_consumer_supply sdp3430_vmmc1_supply = {
374 .supply = "vmmc",
375};
376
377static struct regulator_consumer_supply sdp3430_vsim_supply = {
378 .supply = "vmmc_aux",
379};
380
381static struct regulator_consumer_supply sdp3430_vmmc2_supply = {
382 .supply = "vmmc",
383};
384
385static int sdp3430_twl_gpio_setup(struct device *dev, 352static int sdp3430_twl_gpio_setup(struct device *dev,
386 unsigned gpio, unsigned ngpio) 353 unsigned gpio, unsigned ngpio)
387{ 354{
@@ -392,13 +359,6 @@ static int sdp3430_twl_gpio_setup(struct device *dev,
392 mmc[1].gpio_cd = gpio + 1; 359 mmc[1].gpio_cd = gpio + 1;
393 omap2_hsmmc_init(mmc); 360 omap2_hsmmc_init(mmc);
394 361
395 /* link regulators to MMC adapters ... we "know" the
396 * regulators will be set up only *after* we return.
397 */
398 sdp3430_vmmc1_supply.dev = mmc[0].dev;
399 sdp3430_vsim_supply.dev = mmc[0].dev;
400 sdp3430_vmmc2_supply.dev = mmc[1].dev;
401
402 /* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */ 362 /* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */
403 gpio_request(gpio + 7, "sub_lcd_en_bkl"); 363 gpio_request(gpio + 7, "sub_lcd_en_bkl");
404 gpio_direction_output(gpio + 7, 0); 364 gpio_direction_output(gpio + 7, 0);
@@ -427,6 +387,35 @@ static struct twl4030_madc_platform_data sdp3430_madc_data = {
427 .irq_line = 1, 387 .irq_line = 1,
428}; 388};
429 389
390/* regulator consumer mappings */
391
392/* ads7846 on SPI */
393static struct regulator_consumer_supply sdp3430_vaux3_supplies[] = {
394 REGULATOR_SUPPLY("vcc", "spi1.0"),
395};
396
397static struct regulator_consumer_supply sdp3430_vdda_dac_supplies[] = {
398 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
399};
400
401/* VPLL2 for digital video outputs */
402static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
403 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
404 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
405};
406
407static struct regulator_consumer_supply sdp3430_vmmc1_supplies[] = {
408 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
409};
410
411static struct regulator_consumer_supply sdp3430_vsim_supplies[] = {
412 REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"),
413};
414
415static struct regulator_consumer_supply sdp3430_vmmc2_supplies[] = {
416 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
417};
418
430/* 419/*
431 * Apply all the fixed voltages since most versions of U-Boot 420 * Apply all the fixed voltages since most versions of U-Boot
432 * don't bother with that initialization. 421 * don't bother with that initialization.
@@ -469,6 +458,8 @@ static struct regulator_init_data sdp3430_vaux3 = {
469 .valid_ops_mask = REGULATOR_CHANGE_MODE 458 .valid_ops_mask = REGULATOR_CHANGE_MODE
470 | REGULATOR_CHANGE_STATUS, 459 | REGULATOR_CHANGE_STATUS,
471 }, 460 },
461 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vaux3_supplies),
462 .consumer_supplies = sdp3430_vaux3_supplies,
472}; 463};
473 464
474/* VAUX4 for OMAP VDD_CSI2 (camera) */ 465/* VAUX4 for OMAP VDD_CSI2 (camera) */
@@ -495,8 +486,8 @@ static struct regulator_init_data sdp3430_vmmc1 = {
495 | REGULATOR_CHANGE_MODE 486 | REGULATOR_CHANGE_MODE
496 | REGULATOR_CHANGE_STATUS, 487 | REGULATOR_CHANGE_STATUS,
497 }, 488 },
498 .num_consumer_supplies = 1, 489 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vmmc1_supplies),
499 .consumer_supplies = &sdp3430_vmmc1_supply, 490 .consumer_supplies = sdp3430_vmmc1_supplies,
500}; 491};
501 492
502/* VMMC2 for MMC2 card */ 493/* VMMC2 for MMC2 card */
@@ -510,8 +501,8 @@ static struct regulator_init_data sdp3430_vmmc2 = {
510 .valid_ops_mask = REGULATOR_CHANGE_MODE 501 .valid_ops_mask = REGULATOR_CHANGE_MODE
511 | REGULATOR_CHANGE_STATUS, 502 | REGULATOR_CHANGE_STATUS,
512 }, 503 },
513 .num_consumer_supplies = 1, 504 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vmmc2_supplies),
514 .consumer_supplies = &sdp3430_vmmc2_supply, 505 .consumer_supplies = sdp3430_vmmc2_supplies,
515}; 506};
516 507
517/* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */ 508/* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */
@@ -525,8 +516,8 @@ static struct regulator_init_data sdp3430_vsim = {
525 | REGULATOR_CHANGE_MODE 516 | REGULATOR_CHANGE_MODE
526 | REGULATOR_CHANGE_STATUS, 517 | REGULATOR_CHANGE_STATUS,
527 }, 518 },
528 .num_consumer_supplies = 1, 519 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vsim_supplies),
529 .consumer_supplies = &sdp3430_vsim_supply, 520 .consumer_supplies = sdp3430_vsim_supplies,
530}; 521};
531 522
532/* VDAC for DSS driving S-Video */ 523/* VDAC for DSS driving S-Video */
@@ -540,16 +531,8 @@ static struct regulator_init_data sdp3430_vdac = {
540 .valid_ops_mask = REGULATOR_CHANGE_MODE 531 .valid_ops_mask = REGULATOR_CHANGE_MODE
541 | REGULATOR_CHANGE_STATUS, 532 | REGULATOR_CHANGE_STATUS,
542 }, 533 },
543 .num_consumer_supplies = 1, 534 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vdda_dac_supplies),
544 .consumer_supplies = &sdp3430_vdda_dac_supply, 535 .consumer_supplies = sdp3430_vdda_dac_supplies,
545};
546
547/* VPLL2 for digital video outputs */
548static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
549 {
550 .supply = "vdds_dsi",
551 .dev = &sdp3430_dss_device.dev,
552 }
553}; 536};
554 537
555static struct regulator_init_data sdp3430_vpll2 = { 538static struct regulator_init_data sdp3430_vpll2 = {
@@ -567,9 +550,7 @@ static struct regulator_init_data sdp3430_vpll2 = {
567 .consumer_supplies = sdp3430_vpll2_supplies, 550 .consumer_supplies = sdp3430_vpll2_supplies,
568}; 551};
569 552
570static struct twl4030_codec_audio_data sdp3430_audio = { 553static struct twl4030_codec_audio_data sdp3430_audio;
571 .audio_mclk = 26000000,
572};
573 554
574static struct twl4030_codec_data sdp3430_codec = { 555static struct twl4030_codec_data sdp3430_codec = {
575 .audio_mclk = 26000000, 556 .audio_mclk = 26000000,
@@ -653,11 +634,11 @@ static void enable_board_wakeup_source(void)
653 OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP); 634 OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
654} 635}
655 636
656static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { 637static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
657 638
658 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, 639 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
659 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, 640 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
660 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, 641 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
661 642
662 .phy_reset = true, 643 .phy_reset = true,
663 .reset_gpio_port[0] = 57, 644 .reset_gpio_port[0] = 57,
@@ -669,6 +650,106 @@ static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
669static struct omap_board_mux board_mux[] __initdata = { 650static struct omap_board_mux board_mux[] __initdata = {
670 { .reg_offset = OMAP_MUX_TERMINATOR }, 651 { .reg_offset = OMAP_MUX_TERMINATOR },
671}; 652};
653
654static struct omap_device_pad serial1_pads[] __initdata = {
655 /*
656 * Note that off output enable is an active low
657 * signal. So setting this means pin is a
658 * input enabled in off mode
659 */
660 OMAP_MUX_STATIC("uart1_cts.uart1_cts",
661 OMAP_PIN_INPUT |
662 OMAP_PIN_OFF_INPUT_PULLDOWN |
663 OMAP_OFFOUT_EN |
664 OMAP_MUX_MODE0),
665 OMAP_MUX_STATIC("uart1_rts.uart1_rts",
666 OMAP_PIN_OUTPUT |
667 OMAP_OFF_EN |
668 OMAP_MUX_MODE0),
669 OMAP_MUX_STATIC("uart1_rx.uart1_rx",
670 OMAP_PIN_INPUT |
671 OMAP_PIN_OFF_INPUT_PULLDOWN |
672 OMAP_OFFOUT_EN |
673 OMAP_MUX_MODE0),
674 OMAP_MUX_STATIC("uart1_tx.uart1_tx",
675 OMAP_PIN_OUTPUT |
676 OMAP_OFF_EN |
677 OMAP_MUX_MODE0),
678};
679
680static struct omap_device_pad serial2_pads[] __initdata = {
681 OMAP_MUX_STATIC("uart2_cts.uart2_cts",
682 OMAP_PIN_INPUT_PULLUP |
683 OMAP_PIN_OFF_INPUT_PULLDOWN |
684 OMAP_OFFOUT_EN |
685 OMAP_MUX_MODE0),
686 OMAP_MUX_STATIC("uart2_rts.uart2_rts",
687 OMAP_PIN_OUTPUT |
688 OMAP_OFF_EN |
689 OMAP_MUX_MODE0),
690 OMAP_MUX_STATIC("uart2_rx.uart2_rx",
691 OMAP_PIN_INPUT |
692 OMAP_PIN_OFF_INPUT_PULLDOWN |
693 OMAP_OFFOUT_EN |
694 OMAP_MUX_MODE0),
695 OMAP_MUX_STATIC("uart2_tx.uart2_tx",
696 OMAP_PIN_OUTPUT |
697 OMAP_OFF_EN |
698 OMAP_MUX_MODE0),
699};
700
701static struct omap_device_pad serial3_pads[] __initdata = {
702 OMAP_MUX_STATIC("uart3_cts_rctx.uart3_cts_rctx",
703 OMAP_PIN_INPUT_PULLDOWN |
704 OMAP_PIN_OFF_INPUT_PULLDOWN |
705 OMAP_OFFOUT_EN |
706 OMAP_MUX_MODE0),
707 OMAP_MUX_STATIC("uart3_rts_sd.uart3_rts_sd",
708 OMAP_PIN_OUTPUT |
709 OMAP_OFF_EN |
710 OMAP_MUX_MODE0),
711 OMAP_MUX_STATIC("uart3_rx_irrx.uart3_rx_irrx",
712 OMAP_PIN_INPUT |
713 OMAP_PIN_OFF_INPUT_PULLDOWN |
714 OMAP_OFFOUT_EN |
715 OMAP_MUX_MODE0),
716 OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx",
717 OMAP_PIN_OUTPUT |
718 OMAP_OFF_EN |
719 OMAP_MUX_MODE0),
720};
721
722static struct omap_board_data serial1_data = {
723 .id = 0,
724 .pads = serial1_pads,
725 .pads_cnt = ARRAY_SIZE(serial1_pads),
726};
727
728static struct omap_board_data serial2_data = {
729 .id = 1,
730 .pads = serial2_pads,
731 .pads_cnt = ARRAY_SIZE(serial2_pads),
732};
733
734static struct omap_board_data serial3_data = {
735 .id = 2,
736 .pads = serial3_pads,
737 .pads_cnt = ARRAY_SIZE(serial3_pads),
738};
739
740static inline void board_serial_init(void)
741{
742 omap_serial_init_port(&serial1_data);
743 omap_serial_init_port(&serial2_data);
744 omap_serial_init_port(&serial3_data);
745}
746#else
747#define board_mux NULL
748
749static inline void board_serial_init(void)
750{
751 omap_serial_init();
752}
672#endif 753#endif
673 754
674/* 755/*
@@ -800,8 +881,11 @@ static struct omap_musb_board_data musb_board_data = {
800static void __init omap_3430sdp_init(void) 881static void __init omap_3430sdp_init(void)
801{ 882{
802 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 883 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
884 omap_board_config = sdp3430_config;
885 omap_board_config_size = ARRAY_SIZE(sdp3430_config);
886 omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
803 omap3430_i2c_init(); 887 omap3430_i2c_init();
804 platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices)); 888 omap_display_init(&sdp3430_dss_data);
805 if (omap_rev() > OMAP3430_REV_ES1_0) 889 if (omap_rev() > OMAP3430_REV_ES1_0)
806 ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2; 890 ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2;
807 else 891 else
@@ -810,21 +894,22 @@ static void __init omap_3430sdp_init(void)
810 spi_register_board_info(sdp3430_spi_board_info, 894 spi_register_board_info(sdp3430_spi_board_info,
811 ARRAY_SIZE(sdp3430_spi_board_info)); 895 ARRAY_SIZE(sdp3430_spi_board_info));
812 ads7846_dev_init(); 896 ads7846_dev_init();
813 omap_serial_init(); 897 board_serial_init();
814 usb_musb_init(&musb_board_data); 898 usb_musb_init(&musb_board_data);
815 board_smc91x_init(); 899 board_smc91x_init();
816 board_flash_init(sdp_flash_partitions, chip_sel_3430); 900 board_flash_init(sdp_flash_partitions, chip_sel_3430, 0);
817 sdp3430_display_init(); 901 sdp3430_display_init();
818 enable_board_wakeup_source(); 902 enable_board_wakeup_source();
819 usb_ehci_init(&ehci_pdata); 903 usbhs_init(&usbhs_bdata);
820} 904}
821 905
822MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board") 906MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
823 /* Maintainer: Syed Khasim - Texas Instruments Inc */ 907 /* Maintainer: Syed Khasim - Texas Instruments Inc */
824 .boot_params = 0x80000100, 908 .boot_params = 0x80000100,
825 .map_io = omap3_map_io,
826 .reserve = omap_reserve, 909 .reserve = omap_reserve,
827 .init_irq = omap_3430sdp_init_irq, 910 .map_io = omap3_map_io,
911 .init_early = omap_3430sdp_init_early,
912 .init_irq = omap_init_irq,
828 .init_machine = omap_3430sdp_init, 913 .init_machine = omap_3430sdp_init,
829 .timer = &omap_timer, 914 .timer = &omap_timer,
830MACHINE_END 915MACHINE_END
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index 62645640f5e4..a5933cc15caa 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -11,6 +11,7 @@
11#include <linux/platform_device.h> 11#include <linux/platform_device.h>
12#include <linux/input.h> 12#include <linux/input.h>
13#include <linux/gpio.h> 13#include <linux/gpio.h>
14#include <linux/mtd/nand.h>
14 15
15#include <asm/mach-types.h> 16#include <asm/mach-types.h>
16#include <asm/mach/arch.h> 17#include <asm/mach/arch.h>
@@ -54,11 +55,11 @@ static void enable_board_wakeup_source(void)
54 OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP); 55 OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
55} 56}
56 57
57static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { 58static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
58 59
59 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, 60 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
60 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, 61 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
61 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, 62 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
62 63
63 .phy_reset = true, 64 .phy_reset = true,
64 .reset_gpio_port[0] = 126, 65 .reset_gpio_port[0] = 126,
@@ -69,14 +70,11 @@ static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
69static struct omap_board_config_kernel sdp_config[] __initdata = { 70static struct omap_board_config_kernel sdp_config[] __initdata = {
70}; 71};
71 72
72static void __init omap_sdp_init_irq(void) 73static void __init omap_sdp_init_early(void)
73{ 74{
74 omap_board_config = sdp_config;
75 omap_board_config_size = ARRAY_SIZE(sdp_config);
76 omap2_init_common_infrastructure(); 75 omap2_init_common_infrastructure();
77 omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params, 76 omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params,
78 h8mbx00u0mer0em_sdrc_params); 77 h8mbx00u0mer0em_sdrc_params);
79 omap_init_irq();
80} 78}
81 79
82#ifdef CONFIG_OMAP_MUX 80#ifdef CONFIG_OMAP_MUX
@@ -206,19 +204,22 @@ static struct flash_partitions sdp_flash_partitions[] = {
206static void __init omap_sdp_init(void) 204static void __init omap_sdp_init(void)
207{ 205{
208 omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); 206 omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
207 omap_board_config = sdp_config;
208 omap_board_config_size = ARRAY_SIZE(sdp_config);
209 zoom_peripherals_init(); 209 zoom_peripherals_init();
210 zoom_display_init(); 210 zoom_display_init();
211 board_smc91x_init(); 211 board_smc91x_init();
212 board_flash_init(sdp_flash_partitions, chip_sel_sdp); 212 board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16);
213 enable_board_wakeup_source(); 213 enable_board_wakeup_source();
214 usb_ehci_init(&ehci_pdata); 214 usbhs_init(&usbhs_bdata);
215} 215}
216 216
217MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board") 217MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
218 .boot_params = 0x80000100, 218 .boot_params = 0x80000100,
219 .map_io = omap3_map_io,
220 .reserve = omap_reserve, 219 .reserve = omap_reserve,
221 .init_irq = omap_sdp_init_irq, 220 .map_io = omap3_map_io,
221 .init_early = omap_sdp_init_early,
222 .init_irq = omap_init_irq,
222 .init_machine = omap_sdp_init, 223 .init_machine = omap_sdp_init,
223 .timer = &omap_timer, 224 .timer = &omap_timer,
224MACHINE_END 225MACHINE_END
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 07d1b20b1148..56702c5e577f 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -35,6 +35,8 @@
35#include <plat/common.h> 35#include <plat/common.h>
36#include <plat/usb.h> 36#include <plat/usb.h>
37#include <plat/mmc.h> 37#include <plat/mmc.h>
38#include <plat/omap4-keypad.h>
39#include <plat/display.h>
38 40
39#include "mux.h" 41#include "mux.h"
40#include "hsmmc.h" 42#include "hsmmc.h"
@@ -44,10 +46,95 @@
44#define ETH_KS8851_IRQ 34 46#define ETH_KS8851_IRQ 34
45#define ETH_KS8851_POWER_ON 48 47#define ETH_KS8851_POWER_ON 48
46#define ETH_KS8851_QUART 138 48#define ETH_KS8851_QUART 138
47#define OMAP4SDP_MDM_PWR_EN_GPIO 157
48#define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184 49#define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184
49#define OMAP4_SFH7741_ENABLE_GPIO 188 50#define OMAP4_SFH7741_ENABLE_GPIO 188
50 51#define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */
52#define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
53
54static const int sdp4430_keymap[] = {
55 KEY(0, 0, KEY_E),
56 KEY(0, 1, KEY_R),
57 KEY(0, 2, KEY_T),
58 KEY(0, 3, KEY_HOME),
59 KEY(0, 4, KEY_F5),
60 KEY(0, 5, KEY_UNKNOWN),
61 KEY(0, 6, KEY_I),
62 KEY(0, 7, KEY_LEFTSHIFT),
63
64 KEY(1, 0, KEY_D),
65 KEY(1, 1, KEY_F),
66 KEY(1, 2, KEY_G),
67 KEY(1, 3, KEY_SEND),
68 KEY(1, 4, KEY_F6),
69 KEY(1, 5, KEY_UNKNOWN),
70 KEY(1, 6, KEY_K),
71 KEY(1, 7, KEY_ENTER),
72
73 KEY(2, 0, KEY_X),
74 KEY(2, 1, KEY_C),
75 KEY(2, 2, KEY_V),
76 KEY(2, 3, KEY_END),
77 KEY(2, 4, KEY_F7),
78 KEY(2, 5, KEY_UNKNOWN),
79 KEY(2, 6, KEY_DOT),
80 KEY(2, 7, KEY_CAPSLOCK),
81
82 KEY(3, 0, KEY_Z),
83 KEY(3, 1, KEY_KPPLUS),
84 KEY(3, 2, KEY_B),
85 KEY(3, 3, KEY_F1),
86 KEY(3, 4, KEY_F8),
87 KEY(3, 5, KEY_UNKNOWN),
88 KEY(3, 6, KEY_O),
89 KEY(3, 7, KEY_SPACE),
90
91 KEY(4, 0, KEY_W),
92 KEY(4, 1, KEY_Y),
93 KEY(4, 2, KEY_U),
94 KEY(4, 3, KEY_F2),
95 KEY(4, 4, KEY_VOLUMEUP),
96 KEY(4, 5, KEY_UNKNOWN),
97 KEY(4, 6, KEY_L),
98 KEY(4, 7, KEY_LEFT),
99
100 KEY(5, 0, KEY_S),
101 KEY(5, 1, KEY_H),
102 KEY(5, 2, KEY_J),
103 KEY(5, 3, KEY_F3),
104 KEY(5, 4, KEY_F9),
105 KEY(5, 5, KEY_VOLUMEDOWN),
106 KEY(5, 6, KEY_M),
107 KEY(5, 7, KEY_RIGHT),
108
109 KEY(6, 0, KEY_Q),
110 KEY(6, 1, KEY_A),
111 KEY(6, 2, KEY_N),
112 KEY(6, 3, KEY_BACK),
113 KEY(6, 4, KEY_BACKSPACE),
114 KEY(6, 5, KEY_UNKNOWN),
115 KEY(6, 6, KEY_P),
116 KEY(6, 7, KEY_UP),
117
118 KEY(7, 0, KEY_PROG1),
119 KEY(7, 1, KEY_PROG2),
120 KEY(7, 2, KEY_PROG3),
121 KEY(7, 3, KEY_PROG4),
122 KEY(7, 4, KEY_F4),
123 KEY(7, 5, KEY_UNKNOWN),
124 KEY(7, 6, KEY_OK),
125 KEY(7, 7, KEY_DOWN),
126};
127
128static struct matrix_keymap_data sdp4430_keymap_data = {
129 .keymap = sdp4430_keymap,
130 .keymap_size = ARRAY_SIZE(sdp4430_keymap),
131};
132
133static struct omap4_keypad_platform_data sdp4430_keypad_data = {
134 .keymap_data = &sdp4430_keymap_data,
135 .rows = 8,
136 .cols = 8,
137};
51static struct gpio_led sdp4430_gpio_leds[] = { 138static struct gpio_led sdp4430_gpio_leds[] = {
52 { 139 {
53 .name = "omap4:green:debug0", 140 .name = "omap4:green:debug0",
@@ -239,28 +326,15 @@ static struct omap_board_config_kernel sdp4430_config[] __initdata = {
239 { OMAP_TAG_LCD, &sdp4430_lcd_config }, 326 { OMAP_TAG_LCD, &sdp4430_lcd_config },
240}; 327};
241 328
242static void __init omap_4430sdp_init_irq(void) 329static void __init omap_4430sdp_init_early(void)
243{ 330{
244 omap_board_config = sdp4430_config;
245 omap_board_config_size = ARRAY_SIZE(sdp4430_config);
246 omap2_init_common_infrastructure(); 331 omap2_init_common_infrastructure();
247 omap2_init_common_devices(NULL, NULL); 332 omap2_init_common_devices(NULL, NULL);
248#ifdef CONFIG_OMAP_32K_TIMER 333#ifdef CONFIG_OMAP_32K_TIMER
249 omap2_gp_clockevent_set_gptimer(1); 334 omap2_gp_clockevent_set_gptimer(1);
250#endif 335#endif
251 gic_init_irq();
252} 336}
253 337
254static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
255 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
256 .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
257 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
258 .phy_reset = false,
259 .reset_gpio_port[0] = -EINVAL,
260 .reset_gpio_port[1] = -EINVAL,
261 .reset_gpio_port[2] = -EINVAL,
262};
263
264static struct omap_musb_board_data musb_board_data = { 338static struct omap_musb_board_data musb_board_data = {
265 .interface_type = MUSB_INTERFACE_UTMI, 339 .interface_type = MUSB_INTERFACE_UTMI,
266 .mode = MUSB_OTG, 340 .mode = MUSB_OTG,
@@ -272,15 +346,11 @@ static struct twl4030_usb_data omap4_usbphy_data = {
272 .phy_exit = omap4430_phy_exit, 346 .phy_exit = omap4430_phy_exit,
273 .phy_power = omap4430_phy_power, 347 .phy_power = omap4430_phy_power,
274 .phy_set_clock = omap4430_phy_set_clk, 348 .phy_set_clock = omap4430_phy_set_clk,
349 .phy_suspend = omap4430_phy_suspend,
275}; 350};
276 351
277static struct omap2_hsmmc_info mmc[] = { 352static struct omap2_hsmmc_info mmc[] = {
278 { 353 {
279 .mmc = 1,
280 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
281 .gpio_wp = -EINVAL,
282 },
283 {
284 .mmc = 2, 354 .mmc = 2,
285 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, 355 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
286 .gpio_cd = -EINVAL, 356 .gpio_cd = -EINVAL,
@@ -288,19 +358,24 @@ static struct omap2_hsmmc_info mmc[] = {
288 .nonremovable = true, 358 .nonremovable = true,
289 .ocr_mask = MMC_VDD_29_30, 359 .ocr_mask = MMC_VDD_29_30,
290 }, 360 },
361 {
362 .mmc = 1,
363 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
364 .gpio_wp = -EINVAL,
365 },
291 {} /* Terminator */ 366 {} /* Terminator */
292}; 367};
293 368
294static struct regulator_consumer_supply sdp4430_vaux_supply[] = { 369static struct regulator_consumer_supply sdp4430_vaux_supply[] = {
295 { 370 {
296 .supply = "vmmc", 371 .supply = "vmmc",
297 .dev_name = "mmci-omap-hs.1", 372 .dev_name = "omap_hsmmc.1",
298 }, 373 },
299}; 374};
300static struct regulator_consumer_supply sdp4430_vmmc_supply[] = { 375static struct regulator_consumer_supply sdp4430_vmmc_supply[] = {
301 { 376 {
302 .supply = "vmmc", 377 .supply = "vmmc",
303 .dev_name = "mmci-omap-hs.0", 378 .dev_name = "omap_hsmmc.0",
304 }, 379 },
305}; 380};
306 381
@@ -434,7 +509,6 @@ static struct regulator_init_data sdp4430_vana = {
434 .constraints = { 509 .constraints = {
435 .min_uV = 2100000, 510 .min_uV = 2100000,
436 .max_uV = 2100000, 511 .max_uV = 2100000,
437 .apply_uV = true,
438 .valid_modes_mask = REGULATOR_MODE_NORMAL 512 .valid_modes_mask = REGULATOR_MODE_NORMAL
439 | REGULATOR_MODE_STANDBY, 513 | REGULATOR_MODE_STANDBY,
440 .valid_ops_mask = REGULATOR_CHANGE_MODE 514 .valid_ops_mask = REGULATOR_CHANGE_MODE
@@ -446,7 +520,6 @@ static struct regulator_init_data sdp4430_vcxio = {
446 .constraints = { 520 .constraints = {
447 .min_uV = 1800000, 521 .min_uV = 1800000,
448 .max_uV = 1800000, 522 .max_uV = 1800000,
449 .apply_uV = true,
450 .valid_modes_mask = REGULATOR_MODE_NORMAL 523 .valid_modes_mask = REGULATOR_MODE_NORMAL
451 | REGULATOR_MODE_STANDBY, 524 | REGULATOR_MODE_STANDBY,
452 .valid_ops_mask = REGULATOR_CHANGE_MODE 525 .valid_ops_mask = REGULATOR_CHANGE_MODE
@@ -458,7 +531,6 @@ static struct regulator_init_data sdp4430_vdac = {
458 .constraints = { 531 .constraints = {
459 .min_uV = 1800000, 532 .min_uV = 1800000,
460 .max_uV = 1800000, 533 .max_uV = 1800000,
461 .apply_uV = true,
462 .valid_modes_mask = REGULATOR_MODE_NORMAL 534 .valid_modes_mask = REGULATOR_MODE_NORMAL
463 | REGULATOR_MODE_STANDBY, 535 | REGULATOR_MODE_STANDBY,
464 .valid_ops_mask = REGULATOR_CHANGE_MODE 536 .valid_ops_mask = REGULATOR_CHANGE_MODE
@@ -478,6 +550,12 @@ static struct regulator_init_data sdp4430_vusb = {
478 }, 550 },
479}; 551};
480 552
553static struct regulator_init_data sdp4430_clk32kg = {
554 .constraints = {
555 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
556 },
557};
558
481static struct twl4030_platform_data sdp4430_twldata = { 559static struct twl4030_platform_data sdp4430_twldata = {
482 .irq_base = TWL6030_IRQ_BASE, 560 .irq_base = TWL6030_IRQ_BASE,
483 .irq_end = TWL6030_IRQ_END, 561 .irq_end = TWL6030_IRQ_END,
@@ -493,6 +571,7 @@ static struct twl4030_platform_data sdp4430_twldata = {
493 .vaux1 = &sdp4430_vaux1, 571 .vaux1 = &sdp4430_vaux1,
494 .vaux2 = &sdp4430_vaux2, 572 .vaux2 = &sdp4430_vaux2,
495 .vaux3 = &sdp4430_vaux3, 573 .vaux3 = &sdp4430_vaux3,
574 .clk32kg = &sdp4430_clk32kg,
496 .usb = &omap4_usbphy_data 575 .usb = &omap4_usbphy_data
497}; 576};
498 577
@@ -552,14 +631,151 @@ static void __init omap_sfh7741prox_init(void)
552 } 631 }
553} 632}
554 633
634static void sdp4430_hdmi_mux_init(void)
635{
636 /* PAD0_HDMI_HPD_PAD1_HDMI_CEC */
637 omap_mux_init_signal("hdmi_hpd",
638 OMAP_PIN_INPUT_PULLUP);
639 omap_mux_init_signal("hdmi_cec",
640 OMAP_PIN_INPUT_PULLUP);
641 /* PAD0_HDMI_DDC_SCL_PAD1_HDMI_DDC_SDA */
642 omap_mux_init_signal("hdmi_ddc_scl",
643 OMAP_PIN_INPUT_PULLUP);
644 omap_mux_init_signal("hdmi_ddc_sda",
645 OMAP_PIN_INPUT_PULLUP);
646}
647
648static int sdp4430_panel_enable_hdmi(struct omap_dss_device *dssdev)
649{
650 int status;
651
652 status = gpio_request_one(HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH,
653 "hdmi_gpio_hpd");
654 if (status) {
655 pr_err("Cannot request GPIO %d\n", HDMI_GPIO_HPD);
656 return status;
657 }
658 status = gpio_request_one(HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH,
659 "hdmi_gpio_ls_oe");
660 if (status) {
661 pr_err("Cannot request GPIO %d\n", HDMI_GPIO_LS_OE);
662 goto error1;
663 }
664
665 return 0;
666
667error1:
668 gpio_free(HDMI_GPIO_HPD);
669
670 return status;
671}
672
673static void sdp4430_panel_disable_hdmi(struct omap_dss_device *dssdev)
674{
675 gpio_free(HDMI_GPIO_LS_OE);
676 gpio_free(HDMI_GPIO_HPD);
677}
678
679static struct omap_dss_device sdp4430_hdmi_device = {
680 .name = "hdmi",
681 .driver_name = "hdmi_panel",
682 .type = OMAP_DISPLAY_TYPE_HDMI,
683 .platform_enable = sdp4430_panel_enable_hdmi,
684 .platform_disable = sdp4430_panel_disable_hdmi,
685 .channel = OMAP_DSS_CHANNEL_DIGIT,
686};
687
688static struct omap_dss_device *sdp4430_dss_devices[] = {
689 &sdp4430_hdmi_device,
690};
691
692static struct omap_dss_board_info sdp4430_dss_data = {
693 .num_devices = ARRAY_SIZE(sdp4430_dss_devices),
694 .devices = sdp4430_dss_devices,
695 .default_device = &sdp4430_hdmi_device,
696};
697
698void omap_4430sdp_display_init(void)
699{
700 sdp4430_hdmi_mux_init();
701 omap_display_init(&sdp4430_dss_data);
702}
703
555#ifdef CONFIG_OMAP_MUX 704#ifdef CONFIG_OMAP_MUX
556static struct omap_board_mux board_mux[] __initdata = { 705static struct omap_board_mux board_mux[] __initdata = {
557 OMAP4_MUX(USBB2_ULPITLL_CLK, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), 706 OMAP4_MUX(USBB2_ULPITLL_CLK, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
558 { .reg_offset = OMAP_MUX_TERMINATOR }, 707 { .reg_offset = OMAP_MUX_TERMINATOR },
559}; 708};
709
710static struct omap_device_pad serial2_pads[] __initdata = {
711 OMAP_MUX_STATIC("uart2_cts.uart2_cts",
712 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
713 OMAP_MUX_STATIC("uart2_rts.uart2_rts",
714 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
715 OMAP_MUX_STATIC("uart2_rx.uart2_rx",
716 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
717 OMAP_MUX_STATIC("uart2_tx.uart2_tx",
718 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
719};
720
721static struct omap_device_pad serial3_pads[] __initdata = {
722 OMAP_MUX_STATIC("uart3_cts_rctx.uart3_cts_rctx",
723 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
724 OMAP_MUX_STATIC("uart3_rts_sd.uart3_rts_sd",
725 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
726 OMAP_MUX_STATIC("uart3_rx_irrx.uart3_rx_irrx",
727 OMAP_PIN_INPUT | OMAP_MUX_MODE0),
728 OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx",
729 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
730};
731
732static struct omap_device_pad serial4_pads[] __initdata = {
733 OMAP_MUX_STATIC("uart4_rx.uart4_rx",
734 OMAP_PIN_INPUT | OMAP_MUX_MODE0),
735 OMAP_MUX_STATIC("uart4_tx.uart4_tx",
736 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
737};
738
739static struct omap_board_data serial2_data = {
740 .id = 1,
741 .pads = serial2_pads,
742 .pads_cnt = ARRAY_SIZE(serial2_pads),
743};
744
745static struct omap_board_data serial3_data = {
746 .id = 2,
747 .pads = serial3_pads,
748 .pads_cnt = ARRAY_SIZE(serial3_pads),
749};
750
751static struct omap_board_data serial4_data = {
752 .id = 3,
753 .pads = serial4_pads,
754 .pads_cnt = ARRAY_SIZE(serial4_pads),
755};
756
757static inline void board_serial_init(void)
758{
759 struct omap_board_data bdata;
760 bdata.flags = 0;
761 bdata.pads = NULL;
762 bdata.pads_cnt = 0;
763 bdata.id = 0;
764 /* pass dummy data for UART1 */
765 omap_serial_init_port(&bdata);
766
767 omap_serial_init_port(&serial2_data);
768 omap_serial_init_port(&serial3_data);
769 omap_serial_init_port(&serial4_data);
770}
560#else 771#else
561#define board_mux NULL 772#define board_mux NULL
562#endif 773
774static inline void board_serial_init(void)
775{
776 omap_serial_init();
777}
778 #endif
563 779
564static void __init omap_4430sdp_init(void) 780static void __init omap_4430sdp_init(void)
565{ 781{
@@ -570,20 +786,15 @@ static void __init omap_4430sdp_init(void)
570 package = OMAP_PACKAGE_CBL; 786 package = OMAP_PACKAGE_CBL;
571 omap4_mux_init(board_mux, package); 787 omap4_mux_init(board_mux, package);
572 788
789 omap_board_config = sdp4430_config;
790 omap_board_config_size = ARRAY_SIZE(sdp4430_config);
791
573 omap4_i2c_init(); 792 omap4_i2c_init();
574 omap_sfh7741prox_init(); 793 omap_sfh7741prox_init();
575 platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); 794 platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
576 omap_serial_init(); 795 board_serial_init();
577 omap4_twl6030_hsmmc_init(mmc); 796 omap4_twl6030_hsmmc_init(mmc);
578 797
579 /* Power on the ULPI PHY */
580 status = gpio_request(OMAP4SDP_MDM_PWR_EN_GPIO, "USBB1 PHY VMDM_3V3");
581 if (status)
582 pr_err("%s: Could not get USBB1 PHY GPIO\n", __func__);
583 else
584 gpio_direction_output(OMAP4SDP_MDM_PWR_EN_GPIO, 1);
585
586 usb_ehci_init(&ehci_pdata);
587 usb_musb_init(&musb_board_data); 798 usb_musb_init(&musb_board_data);
588 799
589 status = omap_ethernet_init(); 800 status = omap_ethernet_init();
@@ -594,6 +805,12 @@ static void __init omap_4430sdp_init(void)
594 spi_register_board_info(sdp4430_spi_board_info, 805 spi_register_board_info(sdp4430_spi_board_info,
595 ARRAY_SIZE(sdp4430_spi_board_info)); 806 ARRAY_SIZE(sdp4430_spi_board_info));
596 } 807 }
808
809 status = omap4_keyboard_init(&sdp4430_keypad_data);
810 if (status)
811 pr_err("Keypad initialization failed: %d\n", status);
812
813 omap_4430sdp_display_init();
597} 814}
598 815
599static void __init omap_4430sdp_map_io(void) 816static void __init omap_4430sdp_map_io(void)
@@ -605,9 +822,10 @@ static void __init omap_4430sdp_map_io(void)
605MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board") 822MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
606 /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */ 823 /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
607 .boot_params = 0x80000100, 824 .boot_params = 0x80000100,
608 .map_io = omap_4430sdp_map_io,
609 .reserve = omap_reserve, 825 .reserve = omap_reserve,
610 .init_irq = omap_4430sdp_init_irq, 826 .map_io = omap_4430sdp_map_io,
827 .init_early = omap_4430sdp_init_early,
828 .init_irq = gic_init_irq,
611 .init_machine = omap_4430sdp_init, 829 .init_machine = omap_4430sdp_init,
612 .timer = &omap_timer, 830 .timer = &omap_timer,
613MACHINE_END 831MACHINE_END
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c
index 71acb5ab281c..a890d244fec6 100644
--- a/arch/arm/mach-omap2/board-am3517crane.c
+++ b/arch/arm/mach-omap2/board-am3517crane.c
@@ -49,20 +49,16 @@ static struct omap_board_mux board_mux[] __initdata = {
49#define board_mux NULL 49#define board_mux NULL
50#endif 50#endif
51 51
52static void __init am3517_crane_init_irq(void) 52static void __init am3517_crane_init_early(void)
53{ 53{
54 omap_board_config = am3517_crane_config;
55 omap_board_config_size = ARRAY_SIZE(am3517_crane_config);
56
57 omap2_init_common_infrastructure(); 54 omap2_init_common_infrastructure();
58 omap2_init_common_devices(NULL, NULL); 55 omap2_init_common_devices(NULL, NULL);
59 omap_init_irq();
60} 56}
61 57
62static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = { 58static struct usbhs_omap_board_data usbhs_bdata __initdata = {
63 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, 59 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
64 .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN, 60 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
65 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, 61 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
66 62
67 .phy_reset = true, 63 .phy_reset = true,
68 .reset_gpio_port[0] = GPIO_USB_NRESET, 64 .reset_gpio_port[0] = GPIO_USB_NRESET,
@@ -77,6 +73,9 @@ static void __init am3517_crane_init(void)
77 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 73 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
78 omap_serial_init(); 74 omap_serial_init();
79 75
76 omap_board_config = am3517_crane_config;
77 omap_board_config_size = ARRAY_SIZE(am3517_crane_config);
78
80 /* Configure GPIO for EHCI port */ 79 /* Configure GPIO for EHCI port */
81 if (omap_mux_init_gpio(GPIO_USB_NRESET, OMAP_PIN_OUTPUT)) { 80 if (omap_mux_init_gpio(GPIO_USB_NRESET, OMAP_PIN_OUTPUT)) {
82 pr_err("Can not configure mux for GPIO_USB_NRESET %d\n", 81 pr_err("Can not configure mux for GPIO_USB_NRESET %d\n",
@@ -103,14 +102,15 @@ static void __init am3517_crane_init(void)
103 return; 102 return;
104 } 103 }
105 104
106 usb_ehci_init(&ehci_pdata); 105 usbhs_init(&usbhs_bdata);
107} 106}
108 107
109MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD") 108MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD")
110 .boot_params = 0x80000100, 109 .boot_params = 0x80000100,
111 .map_io = omap3_map_io,
112 .reserve = omap_reserve, 110 .reserve = omap_reserve,
113 .init_irq = am3517_crane_init_irq, 111 .map_io = omap3_map_io,
112 .init_early = am3517_crane_init_early,
113 .init_irq = omap_init_irq,
114 .init_machine = am3517_crane_init, 114 .init_machine = am3517_crane_init,
115 .timer = &omap_timer, 115 .timer = &omap_timer,
116MACHINE_END 116MACHINE_END
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 10d60b7743cf..ce7d5e6e4150 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -200,6 +200,9 @@ static struct pca953x_platform_data am3517evm_gpio_expander_info_0 = {
200}; 200};
201static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = { 201static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = {
202 { 202 {
203 I2C_BOARD_INFO("tlv320aic23", 0x1A),
204 },
205 {
203 I2C_BOARD_INFO("tca6416", 0x21), 206 I2C_BOARD_INFO("tca6416", 0x21),
204 .platform_data = &am3517evm_gpio_expander_info_0, 207 .platform_data = &am3517evm_gpio_expander_info_0,
205 }, 208 },
@@ -378,37 +381,23 @@ static struct omap_dss_board_info am3517_evm_dss_data = {
378 .default_device = &am3517_evm_lcd_device, 381 .default_device = &am3517_evm_lcd_device,
379}; 382};
380 383
381static struct platform_device am3517_evm_dss_device = {
382 .name = "omapdss",
383 .id = -1,
384 .dev = {
385 .platform_data = &am3517_evm_dss_data,
386 },
387};
388
389/* 384/*
390 * Board initialization 385 * Board initialization
391 */ 386 */
392static struct omap_board_config_kernel am3517_evm_config[] __initdata = { 387static void __init am3517_evm_init_early(void)
393};
394
395static struct platform_device *am3517_evm_devices[] __initdata = {
396 &am3517_evm_dss_device,
397};
398
399static void __init am3517_evm_init_irq(void)
400{ 388{
401 omap_board_config = am3517_evm_config;
402 omap_board_config_size = ARRAY_SIZE(am3517_evm_config);
403 omap2_init_common_infrastructure(); 389 omap2_init_common_infrastructure();
404 omap2_init_common_devices(NULL, NULL); 390 omap2_init_common_devices(NULL, NULL);
405 omap_init_irq();
406} 391}
407 392
408static struct omap_musb_board_data musb_board_data = { 393static struct omap_musb_board_data musb_board_data = {
409 .interface_type = MUSB_INTERFACE_ULPI, 394 .interface_type = MUSB_INTERFACE_ULPI,
410 .mode = MUSB_OTG, 395 .mode = MUSB_OTG,
411 .power = 500, 396 .power = 500,
397 .set_phy_power = am35x_musb_phy_power,
398 .clear_irq = am35x_musb_clear_irq,
399 .set_mode = am35x_musb_set_mode,
400 .reset = am35x_musb_reset,
412}; 401};
413 402
414static __init void am3517_evm_musb_init(void) 403static __init void am3517_evm_musb_init(void)
@@ -430,15 +419,15 @@ static __init void am3517_evm_musb_init(void)
430 usb_musb_init(&musb_board_data); 419 usb_musb_init(&musb_board_data);
431} 420}
432 421
433static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { 422static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
434 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, 423 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
435#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \ 424#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
436 defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE) 425 defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
437 .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN, 426 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
438#else 427#else
439 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, 428 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
440#endif 429#endif
441 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, 430 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
442 431
443 .phy_reset = true, 432 .phy_reset = true,
444 .reset_gpio_port[0] = 57, 433 .reset_gpio_port[0] = 57,
@@ -490,19 +479,22 @@ static void am3517_evm_hecc_init(struct ti_hecc_platform_data *pdata)
490 platform_device_register(&am3517_hecc_device); 479 platform_device_register(&am3517_hecc_device);
491} 480}
492 481
482static struct omap_board_config_kernel am3517_evm_config[] __initdata = {
483};
484
493static void __init am3517_evm_init(void) 485static void __init am3517_evm_init(void)
494{ 486{
487 omap_board_config = am3517_evm_config;
488 omap_board_config_size = ARRAY_SIZE(am3517_evm_config);
495 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 489 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
496 490
497 am3517_evm_i2c_init(); 491 am3517_evm_i2c_init();
498 platform_add_devices(am3517_evm_devices, 492 omap_display_init(&am3517_evm_dss_data);
499 ARRAY_SIZE(am3517_evm_devices));
500
501 omap_serial_init(); 493 omap_serial_init();
502 494
503 /* Configure GPIO for EHCI port */ 495 /* Configure GPIO for EHCI port */
504 omap_mux_init_gpio(57, OMAP_PIN_OUTPUT); 496 omap_mux_init_gpio(57, OMAP_PIN_OUTPUT);
505 usb_ehci_init(&ehci_pdata); 497 usbhs_init(&usbhs_bdata);
506 am3517_evm_hecc_init(&am3517_evm_hecc_pdata); 498 am3517_evm_hecc_init(&am3517_evm_hecc_pdata);
507 /* DSS */ 499 /* DSS */
508 am3517_evm_display_init(); 500 am3517_evm_display_init();
@@ -521,9 +513,10 @@ static void __init am3517_evm_init(void)
521 513
522MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM") 514MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM")
523 .boot_params = 0x80000100, 515 .boot_params = 0x80000100,
524 .map_io = omap3_map_io,
525 .reserve = omap_reserve, 516 .reserve = omap_reserve,
526 .init_irq = am3517_evm_init_irq, 517 .map_io = omap3_map_io,
518 .init_early = am3517_evm_init_early,
519 .init_irq = omap_init_irq,
527 .init_machine = am3517_evm_init, 520 .init_machine = am3517_evm_init,
528 .timer = &omap_timer, 521 .timer = &omap_timer,
529MACHINE_END 522MACHINE_END
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index 9f55b68687f7..f4f8374a0298 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -274,13 +274,10 @@ static struct omap_board_config_kernel apollon_config[] __initdata = {
274 { OMAP_TAG_LCD, &apollon_lcd_config }, 274 { OMAP_TAG_LCD, &apollon_lcd_config },
275}; 275};
276 276
277static void __init omap_apollon_init_irq(void) 277static void __init omap_apollon_init_early(void)
278{ 278{
279 omap_board_config = apollon_config;
280 omap_board_config_size = ARRAY_SIZE(apollon_config);
281 omap2_init_common_infrastructure(); 279 omap2_init_common_infrastructure();
282 omap2_init_common_devices(NULL, NULL); 280 omap2_init_common_devices(NULL, NULL);
283 omap_init_irq();
284} 281}
285 282
286static void __init apollon_led_init(void) 283static void __init apollon_led_init(void)
@@ -320,6 +317,8 @@ static void __init omap_apollon_init(void)
320 u32 v; 317 u32 v;
321 318
322 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC); 319 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
320 omap_board_config = apollon_config;
321 omap_board_config_size = ARRAY_SIZE(apollon_config);
323 322
324 apollon_init_smc91x(); 323 apollon_init_smc91x();
325 apollon_led_init(); 324 apollon_led_init();
@@ -355,9 +354,10 @@ static void __init omap_apollon_map_io(void)
355MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon") 354MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon")
356 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */ 355 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
357 .boot_params = 0x80000100, 356 .boot_params = 0x80000100,
358 .map_io = omap_apollon_map_io,
359 .reserve = omap_reserve, 357 .reserve = omap_reserve,
360 .init_irq = omap_apollon_init_irq, 358 .map_io = omap_apollon_map_io,
359 .init_early = omap_apollon_init_early,
360 .init_irq = omap_init_irq,
361 .init_machine = omap_apollon_init, 361 .init_machine = omap_apollon_init,
362 .timer = &omap_timer, 362 .timer = &omap_timer,
363MACHINE_END 363MACHINE_END
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index dac141610666..02a12b41c0ff 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -401,14 +401,6 @@ static struct omap_dss_board_info cm_t35_dss_data = {
401 .default_device = &cm_t35_dvi_device, 401 .default_device = &cm_t35_dvi_device,
402}; 402};
403 403
404static struct platform_device cm_t35_dss_device = {
405 .name = "omapdss",
406 .id = -1,
407 .dev = {
408 .platform_data = &cm_t35_dss_data,
409 },
410};
411
412static struct omap2_mcspi_device_config tdo24m_mcspi_config = { 404static struct omap2_mcspi_device_config tdo24m_mcspi_config = {
413 .turbo_mode = 0, 405 .turbo_mode = 0,
414 .single_channel = 1, /* 0: slave, 1: master */ 406 .single_channel = 1, /* 0: slave, 1: master */
@@ -468,7 +460,7 @@ static void __init cm_t35_init_display(void)
468 msleep(50); 460 msleep(50);
469 gpio_set_value(lcd_en_gpio, 1); 461 gpio_set_value(lcd_en_gpio, 1);
470 462
471 err = platform_device_register(&cm_t35_dss_device); 463 err = omap_display_init(&cm_t35_dss_data);
472 if (err) { 464 if (err) {
473 pr_err("CM-T35: failed to register DSS device\n"); 465 pr_err("CM-T35: failed to register DSS device\n");
474 goto err_dev_reg; 466 goto err_dev_reg;
@@ -495,15 +487,11 @@ static struct regulator_consumer_supply cm_t35_vsim_supply = {
495 .supply = "vmmc_aux", 487 .supply = "vmmc_aux",
496}; 488};
497 489
498static struct regulator_consumer_supply cm_t35_vdac_supply = { 490static struct regulator_consumer_supply cm_t35_vdac_supply =
499 .supply = "vdda_dac", 491 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc");
500 .dev = &cm_t35_dss_device.dev,
501};
502 492
503static struct regulator_consumer_supply cm_t35_vdvi_supply = { 493static struct regulator_consumer_supply cm_t35_vdvi_supply =
504 .supply = "vdvi", 494 REGULATOR_SUPPLY("vdvi", "omapdss");
505 .dev = &cm_t35_dss_device.dev,
506};
507 495
508/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ 496/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
509static struct regulator_init_data cm_t35_vmmc1 = { 497static struct regulator_init_data cm_t35_vmmc1 = {
@@ -605,10 +593,10 @@ static struct omap2_hsmmc_info mmc[] = {
605 {} /* Terminator */ 593 {} /* Terminator */
606}; 594};
607 595
608static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = { 596static struct usbhs_omap_board_data usbhs_bdata __initdata = {
609 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, 597 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
610 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, 598 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
611 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, 599 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
612 600
613 .phy_reset = true, 601 .phy_reset = true,
614 .reset_gpio_port[0] = OMAP_MAX_GPIO_LINES + 6, 602 .reset_gpio_port[0] = OMAP_MAX_GPIO_LINES + 6,
@@ -680,20 +668,14 @@ static void __init cm_t35_init_i2c(void)
680 ARRAY_SIZE(cm_t35_i2c_boardinfo)); 668 ARRAY_SIZE(cm_t35_i2c_boardinfo));
681} 669}
682 670
683static struct omap_board_config_kernel cm_t35_config[] __initdata = { 671static void __init cm_t35_init_early(void)
684};
685
686static void __init cm_t35_init_irq(void)
687{ 672{
688 omap_board_config = cm_t35_config;
689 omap_board_config_size = ARRAY_SIZE(cm_t35_config);
690
691 omap2_init_common_infrastructure(); 673 omap2_init_common_infrastructure();
692 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, 674 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
693 mt46h32m32lf6_sdrc_params); 675 mt46h32m32lf6_sdrc_params);
694 omap_init_irq();
695} 676}
696 677
678#ifdef CONFIG_OMAP_MUX
697static struct omap_board_mux board_mux[] __initdata = { 679static struct omap_board_mux board_mux[] __initdata = {
698 /* nCS and IRQ for CM-T35 ethernet */ 680 /* nCS and IRQ for CM-T35 ethernet */
699 OMAP3_MUX(GPMC_NCS5, OMAP_MUX_MODE0), 681 OMAP3_MUX(GPMC_NCS5, OMAP_MUX_MODE0),
@@ -791,6 +773,7 @@ static struct omap_board_mux board_mux[] __initdata = {
791 773
792 { .reg_offset = OMAP_MUX_TERMINATOR }, 774 { .reg_offset = OMAP_MUX_TERMINATOR },
793}; 775};
776#endif
794 777
795static struct omap_musb_board_data musb_board_data = { 778static struct omap_musb_board_data musb_board_data = {
796 .interface_type = MUSB_INTERFACE_ULPI, 779 .interface_type = MUSB_INTERFACE_ULPI,
@@ -798,8 +781,13 @@ static struct omap_musb_board_data musb_board_data = {
798 .power = 100, 781 .power = 100,
799}; 782};
800 783
784static struct omap_board_config_kernel cm_t35_config[] __initdata = {
785};
786
801static void __init cm_t35_init(void) 787static void __init cm_t35_init(void)
802{ 788{
789 omap_board_config = cm_t35_config;
790 omap_board_config_size = ARRAY_SIZE(cm_t35_config);
803 omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); 791 omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
804 omap_serial_init(); 792 omap_serial_init();
805 cm_t35_init_i2c(); 793 cm_t35_init_i2c();
@@ -810,14 +798,15 @@ static void __init cm_t35_init(void)
810 cm_t35_init_display(); 798 cm_t35_init_display();
811 799
812 usb_musb_init(&musb_board_data); 800 usb_musb_init(&musb_board_data);
813 usb_ehci_init(&ehci_pdata); 801 usbhs_init(&usbhs_bdata);
814} 802}
815 803
816MACHINE_START(CM_T35, "Compulab CM-T35") 804MACHINE_START(CM_T35, "Compulab CM-T35")
817 .boot_params = 0x80000100, 805 .boot_params = 0x80000100,
818 .map_io = omap3_map_io,
819 .reserve = omap_reserve, 806 .reserve = omap_reserve,
820 .init_irq = cm_t35_init_irq, 807 .map_io = omap3_map_io,
808 .init_early = cm_t35_init_early,
809 .init_irq = omap_init_irq,
821 .init_machine = cm_t35_init, 810 .init_machine = cm_t35_init,
822 .timer = &omap_timer, 811 .timer = &omap_timer,
823MACHINE_END 812MACHINE_END
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index 5b0c77732dfc..a27e3eee8292 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -124,8 +124,9 @@ static inline void cm_t3517_init_hecc(void) {}
124#if defined(CONFIG_RTC_DRV_V3020) || defined(CONFIG_RTC_DRV_V3020_MODULE) 124#if defined(CONFIG_RTC_DRV_V3020) || defined(CONFIG_RTC_DRV_V3020_MODULE)
125#define RTC_IO_GPIO (153) 125#define RTC_IO_GPIO (153)
126#define RTC_WR_GPIO (154) 126#define RTC_WR_GPIO (154)
127#define RTC_RD_GPIO (160) 127#define RTC_RD_GPIO (53)
128#define RTC_CS_GPIO (163) 128#define RTC_CS_GPIO (163)
129#define RTC_CS_EN_GPIO (160)
129 130
130struct v3020_platform_data cm_t3517_v3020_pdata = { 131struct v3020_platform_data cm_t3517_v3020_pdata = {
131 .use_gpio = 1, 132 .use_gpio = 1,
@@ -145,6 +146,16 @@ static struct platform_device cm_t3517_rtc_device = {
145 146
146static void __init cm_t3517_init_rtc(void) 147static void __init cm_t3517_init_rtc(void)
147{ 148{
149 int err;
150
151 err = gpio_request(RTC_CS_EN_GPIO, "rtc cs en");
152 if (err) {
153 pr_err("CM-T3517: rtc cs en gpio request failed: %d\n", err);
154 return;
155 }
156
157 gpio_direction_output(RTC_CS_EN_GPIO, 1);
158
148 platform_device_register(&cm_t3517_rtc_device); 159 platform_device_register(&cm_t3517_rtc_device);
149} 160}
150#else 161#else
@@ -156,10 +167,10 @@ static inline void cm_t3517_init_rtc(void) {}
156#define HSUSB2_RESET_GPIO (147) 167#define HSUSB2_RESET_GPIO (147)
157#define USB_HUB_RESET_GPIO (152) 168#define USB_HUB_RESET_GPIO (152)
158 169
159static struct ehci_hcd_omap_platform_data cm_t3517_ehci_pdata __initdata = { 170static struct usbhs_omap_board_data cm_t3517_ehci_pdata __initdata = {
160 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, 171 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
161 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, 172 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
162 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, 173 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
163 174
164 .phy_reset = true, 175 .phy_reset = true,
165 .reset_gpio_port[0] = HSUSB1_RESET_GPIO, 176 .reset_gpio_port[0] = HSUSB1_RESET_GPIO,
@@ -181,7 +192,7 @@ static int cm_t3517_init_usbh(void)
181 msleep(1); 192 msleep(1);
182 } 193 }
183 194
184 usb_ehci_init(&cm_t3517_ehci_pdata); 195 usbhs_init(&cm_t3517_ehci_pdata);
185 196
186 return 0; 197 return 0;
187} 198}
@@ -214,12 +225,12 @@ static struct mtd_partition cm_t3517_nand_partitions[] = {
214 }, 225 },
215 { 226 {
216 .name = "linux", 227 .name = "linux",
217 .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */ 228 .offset = MTDPART_OFS_APPEND, /* Offset = 0x2A0000 */
218 .size = 32 * NAND_BLOCK_SIZE, 229 .size = 32 * NAND_BLOCK_SIZE,
219 }, 230 },
220 { 231 {
221 .name = "rootfs", 232 .name = "rootfs",
222 .offset = MTDPART_OFS_APPEND, /* Offset = 0x680000 */ 233 .offset = MTDPART_OFS_APPEND, /* Offset = 0x6A0000 */
223 .size = MTDPART_SIZ_FULL, 234 .size = MTDPART_SIZ_FULL,
224 }, 235 },
225}; 236};
@@ -243,24 +254,29 @@ static inline void cm_t3517_init_nand(void) {}
243static struct omap_board_config_kernel cm_t3517_config[] __initdata = { 254static struct omap_board_config_kernel cm_t3517_config[] __initdata = {
244}; 255};
245 256
246static void __init cm_t3517_init_irq(void) 257static void __init cm_t3517_init_early(void)
247{ 258{
248 omap_board_config = cm_t3517_config;
249 omap_board_config_size = ARRAY_SIZE(cm_t3517_config);
250
251 omap2_init_common_infrastructure(); 259 omap2_init_common_infrastructure();
252 omap2_init_common_devices(NULL, NULL); 260 omap2_init_common_devices(NULL, NULL);
253 omap_init_irq();
254} 261}
255 262
263#ifdef CONFIG_OMAP_MUX
256static struct omap_board_mux board_mux[] __initdata = { 264static struct omap_board_mux board_mux[] __initdata = {
257 /* GPIO186 - Green LED */ 265 /* GPIO186 - Green LED */
258 OMAP3_MUX(SYS_CLKOUT2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), 266 OMAP3_MUX(SYS_CLKOUT2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
259 /* RTC GPIOs: IO, WR#, RD#, CS# */ 267
268 /* RTC GPIOs: */
269 /* IO - GPIO153 */
260 OMAP3_MUX(MCBSP4_DR, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), 270 OMAP3_MUX(MCBSP4_DR, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
271 /* WR# - GPIO154 */
261 OMAP3_MUX(MCBSP4_DX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), 272 OMAP3_MUX(MCBSP4_DX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
262 OMAP3_MUX(MCBSP_CLKS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), 273 /* RD# - GPIO53 */
274 OMAP3_MUX(GPMC_NCS2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
275 /* CS# - GPIO163 */
263 OMAP3_MUX(UART3_CTS_RCTX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), 276 OMAP3_MUX(UART3_CTS_RCTX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
277 /* CS EN - GPIO160 */
278 OMAP3_MUX(MCBSP_CLKS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
279
264 /* HSUSB1 RESET */ 280 /* HSUSB1 RESET */
265 OMAP3_MUX(UART2_TX, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), 281 OMAP3_MUX(UART2_TX, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
266 /* HSUSB2 RESET */ 282 /* HSUSB2 RESET */
@@ -270,11 +286,14 @@ static struct omap_board_mux board_mux[] __initdata = {
270 286
271 { .reg_offset = OMAP_MUX_TERMINATOR }, 287 { .reg_offset = OMAP_MUX_TERMINATOR },
272}; 288};
289#endif
273 290
274static void __init cm_t3517_init(void) 291static void __init cm_t3517_init(void)
275{ 292{
276 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 293 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
277 omap_serial_init(); 294 omap_serial_init();
295 omap_board_config = cm_t3517_config;
296 omap_board_config_size = ARRAY_SIZE(cm_t3517_config);
278 cm_t3517_init_leds(); 297 cm_t3517_init_leds();
279 cm_t3517_init_nand(); 298 cm_t3517_init_nand();
280 cm_t3517_init_rtc(); 299 cm_t3517_init_rtc();
@@ -284,9 +303,10 @@ static void __init cm_t3517_init(void)
284 303
285MACHINE_START(CM_T3517, "Compulab CM-T3517") 304MACHINE_START(CM_T3517, "Compulab CM-T3517")
286 .boot_params = 0x80000100, 305 .boot_params = 0x80000100,
287 .map_io = omap3_map_io,
288 .reserve = omap_reserve, 306 .reserve = omap_reserve,
289 .init_irq = cm_t3517_init_irq, 307 .map_io = omap3_map_io,
308 .init_early = cm_t3517_init_early,
309 .init_irq = omap_init_irq,
290 .init_machine = cm_t3517_init, 310 .init_machine = cm_t3517_init,
291 .timer = &omap_timer, 311 .timer = &omap_timer,
292MACHINE_END 312MACHINE_END
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 00bb1fc5e017..65f9fde2c567 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -115,9 +115,6 @@ static struct omap2_hsmmc_info mmc[] = {
115 115
116static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev) 116static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev)
117{ 117{
118 twl_i2c_write_u8(TWL4030_MODULE_GPIO, 0x80, REG_GPIODATADIR1);
119 twl_i2c_write_u8(TWL4030_MODULE_LED, 0x0, 0x0);
120
121 if (gpio_is_valid(dssdev->reset_gpio)) 118 if (gpio_is_valid(dssdev->reset_gpio))
122 gpio_set_value_cansleep(dssdev->reset_gpio, 1); 119 gpio_set_value_cansleep(dssdev->reset_gpio, 1);
123 return 0; 120 return 0;
@@ -143,7 +140,7 @@ static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev)
143} 140}
144 141
145static struct regulator_consumer_supply devkit8000_vmmc1_supply = 142static struct regulator_consumer_supply devkit8000_vmmc1_supply =
146 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); 143 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0");
147 144
148 145
149/* ads7846 on SPI */ 146/* ads7846 on SPI */
@@ -198,16 +195,8 @@ static struct omap_dss_board_info devkit8000_dss_data = {
198 .default_device = &devkit8000_lcd_device, 195 .default_device = &devkit8000_lcd_device,
199}; 196};
200 197
201static struct platform_device devkit8000_dss_device = {
202 .name = "omapdss",
203 .id = -1,
204 .dev = {
205 .platform_data = &devkit8000_dss_data,
206 },
207};
208
209static struct regulator_consumer_supply devkit8000_vdda_dac_supply = 198static struct regulator_consumer_supply devkit8000_vdda_dac_supply =
210 REGULATOR_SUPPLY("vdda_dac", "omapdss"); 199 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc");
211 200
212static uint32_t board_keymap[] = { 201static uint32_t board_keymap[] = {
213 KEY(0, 0, KEY_1), 202 KEY(0, 0, KEY_1),
@@ -247,6 +236,8 @@ static struct gpio_led gpio_leds[];
247static int devkit8000_twl_gpio_setup(struct device *dev, 236static int devkit8000_twl_gpio_setup(struct device *dev,
248 unsigned gpio, unsigned ngpio) 237 unsigned gpio, unsigned ngpio)
249{ 238{
239 int ret;
240
250 omap_mux_init_gpio(29, OMAP_PIN_INPUT); 241 omap_mux_init_gpio(29, OMAP_PIN_INPUT);
251 /* gpio + 0 is "mmc0_cd" (input/IRQ) */ 242 /* gpio + 0 is "mmc0_cd" (input/IRQ) */
252 mmc[0].gpio_cd = gpio + 0; 243 mmc[0].gpio_cd = gpio + 0;
@@ -255,17 +246,23 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
255 /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ 246 /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
256 gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; 247 gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
257 248
258 /* gpio + 1 is "LCD_PWREN" (out, active high) */ 249 /* TWL4030_GPIO_MAX + 0 is "LCD_PWREN" (out, active high) */
259 devkit8000_lcd_device.reset_gpio = gpio + 1; 250 devkit8000_lcd_device.reset_gpio = gpio + TWL4030_GPIO_MAX + 0;
260 gpio_request(devkit8000_lcd_device.reset_gpio, "LCD_PWREN"); 251 ret = gpio_request_one(devkit8000_lcd_device.reset_gpio,
261 /* Disable until needed */ 252 GPIOF_DIR_OUT | GPIOF_INIT_LOW, "LCD_PWREN");
262 gpio_direction_output(devkit8000_lcd_device.reset_gpio, 0); 253 if (ret < 0) {
254 devkit8000_lcd_device.reset_gpio = -EINVAL;
255 printk(KERN_ERR "Failed to request GPIO for LCD_PWRN\n");
256 }
263 257
264 /* gpio + 7 is "DVI_PD" (out, active low) */ 258 /* gpio + 7 is "DVI_PD" (out, active low) */
265 devkit8000_dvi_device.reset_gpio = gpio + 7; 259 devkit8000_dvi_device.reset_gpio = gpio + 7;
266 gpio_request(devkit8000_dvi_device.reset_gpio, "DVI PowerDown"); 260 ret = gpio_request_one(devkit8000_dvi_device.reset_gpio,
267 /* Disable until needed */ 261 GPIOF_DIR_OUT | GPIOF_INIT_LOW, "DVI PowerDown");
268 gpio_direction_output(devkit8000_dvi_device.reset_gpio, 0); 262 if (ret < 0) {
263 devkit8000_dvi_device.reset_gpio = -EINVAL;
264 printk(KERN_ERR "Failed to request GPIO for DVI PowerDown\n");
265 }
269 266
270 return 0; 267 return 0;
271} 268}
@@ -275,14 +272,15 @@ static struct twl4030_gpio_platform_data devkit8000_gpio_data = {
275 .irq_base = TWL4030_GPIO_IRQ_BASE, 272 .irq_base = TWL4030_GPIO_IRQ_BASE,
276 .irq_end = TWL4030_GPIO_IRQ_END, 273 .irq_end = TWL4030_GPIO_IRQ_END,
277 .use_leds = true, 274 .use_leds = true,
278 .pullups = BIT(1), 275 .pulldowns = BIT(1) | BIT(2) | BIT(6) | BIT(8) | BIT(13)
279 .pulldowns = BIT(2) | BIT(6) | BIT(7) | BIT(8) | BIT(13)
280 | BIT(15) | BIT(16) | BIT(17), 276 | BIT(15) | BIT(16) | BIT(17),
281 .setup = devkit8000_twl_gpio_setup, 277 .setup = devkit8000_twl_gpio_setup,
282}; 278};
283 279
284static struct regulator_consumer_supply devkit8000_vpll1_supply = 280static struct regulator_consumer_supply devkit8000_vpll1_supplies[] = {
285 REGULATOR_SUPPLY("vdds_dsi", "omapdss"); 281 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
282 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
283};
286 284
287/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ 285/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
288static struct regulator_init_data devkit8000_vmmc1 = { 286static struct regulator_init_data devkit8000_vmmc1 = {
@@ -323,8 +321,8 @@ static struct regulator_init_data devkit8000_vpll1 = {
323 .valid_ops_mask = REGULATOR_CHANGE_MODE 321 .valid_ops_mask = REGULATOR_CHANGE_MODE
324 | REGULATOR_CHANGE_STATUS, 322 | REGULATOR_CHANGE_STATUS,
325 }, 323 },
326 .num_consumer_supplies = 1, 324 .num_consumer_supplies = ARRAY_SIZE(devkit8000_vpll1_supplies),
327 .consumer_supplies = &devkit8000_vpll1_supply, 325 .consumer_supplies = devkit8000_vpll1_supplies,
328}; 326};
329 327
330/* VAUX4 for ads7846 and nubs */ 328/* VAUX4 for ads7846 and nubs */
@@ -346,9 +344,7 @@ static struct twl4030_usb_data devkit8000_usb_data = {
346 .usb_mode = T2_USB_MODE_ULPI, 344 .usb_mode = T2_USB_MODE_ULPI,
347}; 345};
348 346
349static struct twl4030_codec_audio_data devkit8000_audio_data = { 347static struct twl4030_codec_audio_data devkit8000_audio_data;
350 .audio_mclk = 26000000,
351};
352 348
353static struct twl4030_codec_data devkit8000_codec_data = { 349static struct twl4030_codec_data devkit8000_codec_data = {
354 .audio_mclk = 26000000, 350 .audio_mclk = 26000000,
@@ -452,11 +448,15 @@ static struct platform_device keys_gpio = {
452}; 448};
453 449
454 450
455static void __init devkit8000_init_irq(void) 451static void __init devkit8000_init_early(void)
456{ 452{
457 omap2_init_common_infrastructure(); 453 omap2_init_common_infrastructure();
458 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, 454 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
459 mt46h32m32lf6_sdrc_params); 455 mt46h32m32lf6_sdrc_params);
456}
457
458static void __init devkit8000_init_irq(void)
459{
460 omap_init_irq(); 460 omap_init_irq();
461#ifdef CONFIG_OMAP_32K_TIMER 461#ifdef CONFIG_OMAP_32K_TIMER
462 omap2_gp_clockevent_set_gptimer(12); 462 omap2_gp_clockevent_set_gptimer(12);
@@ -571,7 +571,6 @@ static void __init omap_dm9000_init(void)
571} 571}
572 572
573static struct platform_device *devkit8000_devices[] __initdata = { 573static struct platform_device *devkit8000_devices[] __initdata = {
574 &devkit8000_dss_device,
575 &leds_gpio, 574 &leds_gpio,
576 &keys_gpio, 575 &keys_gpio,
577 &omap_dm9000_dev, 576 &omap_dm9000_dev,
@@ -616,11 +615,11 @@ static struct omap_musb_board_data musb_board_data = {
616 .power = 100, 615 .power = 100,
617}; 616};
618 617
619static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { 618static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
620 619
621 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, 620 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
622 .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN, 621 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
623 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, 622 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
624 623
625 .phy_reset = true, 624 .phy_reset = true,
626 .reset_gpio_port[0] = -EINVAL, 625 .reset_gpio_port[0] = -EINVAL,
@@ -628,6 +627,7 @@ static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
628 .reset_gpio_port[2] = -EINVAL 627 .reset_gpio_port[2] = -EINVAL
629}; 628};
630 629
630#ifdef CONFIG_OMAP_MUX
631static struct omap_board_mux board_mux[] __initdata = { 631static struct omap_board_mux board_mux[] __initdata = {
632 /* nCS and IRQ for Devkit8000 ethernet */ 632 /* nCS and IRQ for Devkit8000 ethernet */
633 OMAP3_MUX(GPMC_NCS6, OMAP_MUX_MODE0), 633 OMAP3_MUX(GPMC_NCS6, OMAP_MUX_MODE0),
@@ -781,6 +781,7 @@ static struct omap_board_mux board_mux[] __initdata = {
781 781
782 { .reg_offset = OMAP_MUX_TERMINATOR }, 782 { .reg_offset = OMAP_MUX_TERMINATOR },
783}; 783};
784#endif
784 785
785static void __init devkit8000_init(void) 786static void __init devkit8000_init(void)
786{ 787{
@@ -793,13 +794,14 @@ static void __init devkit8000_init(void)
793 platform_add_devices(devkit8000_devices, 794 platform_add_devices(devkit8000_devices,
794 ARRAY_SIZE(devkit8000_devices)); 795 ARRAY_SIZE(devkit8000_devices));
795 796
797 omap_display_init(&devkit8000_dss_data);
796 spi_register_board_info(devkit8000_spi_board_info, 798 spi_register_board_info(devkit8000_spi_board_info,
797 ARRAY_SIZE(devkit8000_spi_board_info)); 799 ARRAY_SIZE(devkit8000_spi_board_info));
798 800
799 devkit8000_ads7846_init(); 801 devkit8000_ads7846_init();
800 802
801 usb_musb_init(&musb_board_data); 803 usb_musb_init(&musb_board_data);
802 usb_ehci_init(&ehci_pdata); 804 usbhs_init(&usbhs_bdata);
803 devkit8000_flash_init(); 805 devkit8000_flash_init();
804 806
805 /* Ensure SDRC pins are mux'd for self-refresh */ 807 /* Ensure SDRC pins are mux'd for self-refresh */
@@ -809,8 +811,9 @@ static void __init devkit8000_init(void)
809 811
810MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000") 812MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000")
811 .boot_params = 0x80000100, 813 .boot_params = 0x80000100,
812 .map_io = omap3_map_io,
813 .reserve = omap_reserve, 814 .reserve = omap_reserve,
815 .map_io = omap3_map_io,
816 .init_early = devkit8000_init_early,
814 .init_irq = devkit8000_init_irq, 817 .init_irq = devkit8000_init_irq,
815 .init_machine = devkit8000_init, 818 .init_machine = devkit8000_init,
816 .timer = &omap_timer, 819 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
index fd38c05bb47f..729892fdcf2e 100644
--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * board-sdp-flash.c 2 * board-flash.c
3 * Modified from mach-omap2/board-3430sdp-flash.c 3 * Modified from mach-omap2/board-3430sdp-flash.c
4 * 4 *
5 * Copyright (C) 2009 Nokia Corporation 5 * Copyright (C) 2009 Nokia Corporation
@@ -16,6 +16,7 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/mtd/physmap.h> 17#include <linux/mtd/physmap.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <plat/irqs.h>
19 20
20#include <plat/gpmc.h> 21#include <plat/gpmc.h>
21#include <plat/nand.h> 22#include <plat/nand.h>
@@ -73,11 +74,11 @@ __init board_nor_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs)
73 + FLASH_SIZE_SDPV1 - 1; 74 + FLASH_SIZE_SDPV1 - 1;
74 } 75 }
75 if (err < 0) { 76 if (err < 0) {
76 printk(KERN_ERR "NOR: Can't request GPMC CS\n"); 77 pr_err("NOR: Can't request GPMC CS\n");
77 return; 78 return;
78 } 79 }
79 if (platform_device_register(&board_nor_device) < 0) 80 if (platform_device_register(&board_nor_device) < 0)
80 printk(KERN_ERR "Unable to register NOR device\n"); 81 pr_err("Unable to register NOR device\n");
81} 82}
82 83
83#if defined(CONFIG_MTD_ONENAND_OMAP2) || \ 84#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
@@ -139,17 +140,21 @@ static struct omap_nand_platform_data board_nand_data = {
139}; 140};
140 141
141void 142void
142__init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs) 143__init board_nand_init(struct mtd_partition *nand_parts,
144 u8 nr_parts, u8 cs, int nand_type)
143{ 145{
144 board_nand_data.cs = cs; 146 board_nand_data.cs = cs;
145 board_nand_data.parts = nand_parts; 147 board_nand_data.parts = nand_parts;
146 board_nand_data.nr_parts = nr_parts; 148 board_nand_data.nr_parts = nr_parts;
149 board_nand_data.devsize = nand_type;
147 150
151 board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT;
152 board_nand_data.gpmc_irq = OMAP_GPMC_IRQ_BASE + cs;
148 gpmc_nand_init(&board_nand_data); 153 gpmc_nand_init(&board_nand_data);
149} 154}
150#else 155#else
151void 156void
152__init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs) 157__init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs, int nand_type)
153{ 158{
154} 159}
155#endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ 160#endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */
@@ -189,12 +194,12 @@ unmap:
189} 194}
190 195
191/** 196/**
192 * sdp3430_flash_init - Identify devices connected to GPMC and register. 197 * board_flash_init - Identify devices connected to GPMC and register.
193 * 198 *
194 * @return - void. 199 * @return - void.
195 */ 200 */
196void board_flash_init(struct flash_partitions partition_info[], 201void board_flash_init(struct flash_partitions partition_info[],
197 char chip_sel_board[][GPMC_CS_NUM]) 202 char chip_sel_board[][GPMC_CS_NUM], int nand_type)
198{ 203{
199 u8 cs = 0; 204 u8 cs = 0;
200 u8 norcs = GPMC_CS_NUM + 1; 205 u8 norcs = GPMC_CS_NUM + 1;
@@ -208,7 +213,7 @@ void board_flash_init(struct flash_partitions partition_info[],
208 */ 213 */
209 idx = get_gpmc0_type(); 214 idx = get_gpmc0_type();
210 if (idx >= MAX_SUPPORTED_GPMC_CONFIG) { 215 if (idx >= MAX_SUPPORTED_GPMC_CONFIG) {
211 printk(KERN_ERR "%s: Invalid chip select: %d\n", __func__, cs); 216 pr_err("%s: Invalid chip select: %d\n", __func__, cs);
212 return; 217 return;
213 } 218 }
214 config_sel = (unsigned char *)(chip_sel_board[idx]); 219 config_sel = (unsigned char *)(chip_sel_board[idx]);
@@ -232,23 +237,20 @@ void board_flash_init(struct flash_partitions partition_info[],
232 } 237 }
233 238
234 if (norcs > GPMC_CS_NUM) 239 if (norcs > GPMC_CS_NUM)
235 printk(KERN_INFO "NOR: Unable to find configuration " 240 pr_err("NOR: Unable to find configuration in GPMC\n");
236 "in GPMC\n");
237 else 241 else
238 board_nor_init(partition_info[0].parts, 242 board_nor_init(partition_info[0].parts,
239 partition_info[0].nr_parts, norcs); 243 partition_info[0].nr_parts, norcs);
240 244
241 if (onenandcs > GPMC_CS_NUM) 245 if (onenandcs > GPMC_CS_NUM)
242 printk(KERN_INFO "OneNAND: Unable to find configuration " 246 pr_err("OneNAND: Unable to find configuration in GPMC\n");
243 "in GPMC\n");
244 else 247 else
245 board_onenand_init(partition_info[1].parts, 248 board_onenand_init(partition_info[1].parts,
246 partition_info[1].nr_parts, onenandcs); 249 partition_info[1].nr_parts, onenandcs);
247 250
248 if (nandcs > GPMC_CS_NUM) 251 if (nandcs > GPMC_CS_NUM)
249 printk(KERN_INFO "NAND: Unable to find configuration " 252 pr_err("NAND: Unable to find configuration in GPMC\n");
250 "in GPMC\n");
251 else 253 else
252 board_nand_init(partition_info[2].parts, 254 board_nand_init(partition_info[2].parts,
253 partition_info[2].nr_parts, nandcs); 255 partition_info[2].nr_parts, nandcs, nand_type);
254} 256}
diff --git a/arch/arm/mach-omap2/board-flash.h b/arch/arm/mach-omap2/board-flash.h
index 69befe00dd2f..c240a3f8d163 100644
--- a/arch/arm/mach-omap2/board-flash.h
+++ b/arch/arm/mach-omap2/board-flash.h
@@ -25,6 +25,6 @@ struct flash_partitions {
25}; 25};
26 26
27extern void board_flash_init(struct flash_partitions [], 27extern void board_flash_init(struct flash_partitions [],
28 char chip_sel[][GPMC_CS_NUM]); 28 char chip_sel[][GPMC_CS_NUM], int nand_type);
29extern void board_nand_init(struct mtd_partition *nand_parts, 29extern void board_nand_init(struct mtd_partition *nand_parts,
30 u8 nr_parts, u8 cs); 30 u8 nr_parts, u8 cs, int nand_type);
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 0e3d81e09f89..73e3c31e8508 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -33,18 +33,17 @@
33static struct omap_board_config_kernel generic_config[] = { 33static struct omap_board_config_kernel generic_config[] = {
34}; 34};
35 35
36static void __init omap_generic_init_irq(void) 36static void __init omap_generic_init_early(void)
37{ 37{
38 omap_board_config = generic_config;
39 omap_board_config_size = ARRAY_SIZE(generic_config);
40 omap2_init_common_infrastructure(); 38 omap2_init_common_infrastructure();
41 omap2_init_common_devices(NULL, NULL); 39 omap2_init_common_devices(NULL, NULL);
42 omap_init_irq();
43} 40}
44 41
45static void __init omap_generic_init(void) 42static void __init omap_generic_init(void)
46{ 43{
47 omap_serial_init(); 44 omap_serial_init();
45 omap_board_config = generic_config;
46 omap_board_config_size = ARRAY_SIZE(generic_config);
48} 47}
49 48
50static void __init omap_generic_map_io(void) 49static void __init omap_generic_map_io(void)
@@ -68,9 +67,10 @@ static void __init omap_generic_map_io(void)
68MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx") 67MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx")
69 /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */ 68 /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */
70 .boot_params = 0x80000100, 69 .boot_params = 0x80000100,
71 .map_io = omap_generic_map_io,
72 .reserve = omap_reserve, 70 .reserve = omap_reserve,
73 .init_irq = omap_generic_init_irq, 71 .map_io = omap_generic_map_io,
72 .init_early = omap_generic_init_early,
73 .init_irq = omap_init_irq,
74 .init_machine = omap_generic_init, 74 .init_machine = omap_generic_init,
75 .timer = &omap_timer, 75 .timer = &omap_timer,
76MACHINE_END 76MACHINE_END
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 25cc9dad4b02..bac7933b8cbb 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -290,14 +290,15 @@ static struct omap_board_config_kernel h4_config[] __initdata = {
290 { OMAP_TAG_LCD, &h4_lcd_config }, 290 { OMAP_TAG_LCD, &h4_lcd_config },
291}; 291};
292 292
293static void __init omap_h4_init_irq(void) 293static void __init omap_h4_init_early(void)
294{ 294{
295 omap_board_config = h4_config;
296 omap_board_config_size = ARRAY_SIZE(h4_config);
297 omap2_init_common_infrastructure(); 295 omap2_init_common_infrastructure();
298 omap2_init_common_devices(NULL, NULL); 296 omap2_init_common_devices(NULL, NULL);
297}
298
299static void __init omap_h4_init_irq(void)
300{
299 omap_init_irq(); 301 omap_init_irq();
300 h4_init_flash();
301} 302}
302 303
303static struct at24_platform_data m24c01 = { 304static struct at24_platform_data m24c01 = {
@@ -330,6 +331,9 @@ static void __init omap_h4_init(void)
330{ 331{
331 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAF); 332 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAF);
332 333
334 omap_board_config = h4_config;
335 omap_board_config_size = ARRAY_SIZE(h4_config);
336
333 /* 337 /*
334 * Make sure the serial ports are muxed on at this point. 338 * Make sure the serial ports are muxed on at this point.
335 * You have to mux them off in device drivers later on 339 * You have to mux them off in device drivers later on
@@ -367,6 +371,7 @@ static void __init omap_h4_init(void)
367 platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices)); 371 platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
368 omap2_usbfs_init(&h4_usb_config); 372 omap2_usbfs_init(&h4_usb_config);
369 omap_serial_init(); 373 omap_serial_init();
374 h4_init_flash();
370} 375}
371 376
372static void __init omap_h4_map_io(void) 377static void __init omap_h4_map_io(void)
@@ -378,8 +383,9 @@ static void __init omap_h4_map_io(void)
378MACHINE_START(OMAP_H4, "OMAP2420 H4 board") 383MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
379 /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */ 384 /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */
380 .boot_params = 0x80000100, 385 .boot_params = 0x80000100,
381 .map_io = omap_h4_map_io,
382 .reserve = omap_reserve, 386 .reserve = omap_reserve,
387 .map_io = omap_h4_map_io,
388 .init_early = omap_h4_init_early,
383 .init_irq = omap_h4_init_irq, 389 .init_irq = omap_h4_init_irq,
384 .init_machine = omap_h4_init, 390 .init_machine = omap_h4_init,
385 .timer = &omap_timer, 391 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 3be85a1f55f4..5f8a2fd06337 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -250,7 +250,7 @@ static inline void __init igep2_init_smsc911x(void) { }
250#endif 250#endif
251 251
252static struct regulator_consumer_supply igep2_vmmc1_supply = 252static struct regulator_consumer_supply igep2_vmmc1_supply =
253 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); 253 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0");
254 254
255/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ 255/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
256static struct regulator_init_data igep2_vmmc1 = { 256static struct regulator_init_data igep2_vmmc1 = {
@@ -268,7 +268,7 @@ static struct regulator_init_data igep2_vmmc1 = {
268}; 268};
269 269
270static struct regulator_consumer_supply igep2_vio_supply = 270static struct regulator_consumer_supply igep2_vio_supply =
271 REGULATOR_SUPPLY("vmmc_aux", "mmci-omap-hs.1"); 271 REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1");
272 272
273static struct regulator_init_data igep2_vio = { 273static struct regulator_init_data igep2_vio = {
274 .constraints = { 274 .constraints = {
@@ -286,7 +286,7 @@ static struct regulator_init_data igep2_vio = {
286}; 286};
287 287
288static struct regulator_consumer_supply igep2_vmmc2_supply = 288static struct regulator_consumer_supply igep2_vmmc2_supply =
289 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); 289 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1");
290 290
291static struct regulator_init_data igep2_vmmc2 = { 291static struct regulator_init_data igep2_vmmc2 = {
292 .constraints = { 292 .constraints = {
@@ -485,17 +485,9 @@ static struct omap_dss_board_info igep2_dss_data = {
485 .default_device = &igep2_dvi_device, 485 .default_device = &igep2_dvi_device,
486}; 486};
487 487
488static struct platform_device igep2_dss_device = { 488static struct regulator_consumer_supply igep2_vpll2_supplies[] = {
489 .name = "omapdss", 489 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
490 .id = -1, 490 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
491 .dev = {
492 .platform_data = &igep2_dss_data,
493 },
494};
495
496static struct regulator_consumer_supply igep2_vpll2_supply = {
497 .supply = "vdds_dsi",
498 .dev = &igep2_dss_device.dev,
499}; 491};
500 492
501static struct regulator_init_data igep2_vpll2 = { 493static struct regulator_init_data igep2_vpll2 = {
@@ -509,8 +501,8 @@ static struct regulator_init_data igep2_vpll2 = {
509 .valid_ops_mask = REGULATOR_CHANGE_MODE 501 .valid_ops_mask = REGULATOR_CHANGE_MODE
510 | REGULATOR_CHANGE_STATUS, 502 | REGULATOR_CHANGE_STATUS,
511 }, 503 },
512 .num_consumer_supplies = 1, 504 .num_consumer_supplies = ARRAY_SIZE(igep2_vpll2_supplies),
513 .consumer_supplies = &igep2_vpll2_supply, 505 .consumer_supplies = igep2_vpll2_supplies,
514}; 506};
515 507
516static void __init igep2_display_init(void) 508static void __init igep2_display_init(void)
@@ -521,21 +513,17 @@ static void __init igep2_display_init(void)
521} 513}
522 514
523static struct platform_device *igep2_devices[] __initdata = { 515static struct platform_device *igep2_devices[] __initdata = {
524 &igep2_dss_device,
525 &igep2_vwlan_device, 516 &igep2_vwlan_device,
526}; 517};
527 518
528static void __init igep2_init_irq(void) 519static void __init igep2_init_early(void)
529{ 520{
530 omap2_init_common_infrastructure(); 521 omap2_init_common_infrastructure();
531 omap2_init_common_devices(m65kxxxxam_sdrc_params, 522 omap2_init_common_devices(m65kxxxxam_sdrc_params,
532 m65kxxxxam_sdrc_params); 523 m65kxxxxam_sdrc_params);
533 omap_init_irq();
534} 524}
535 525
536static struct twl4030_codec_audio_data igep2_audio_data = { 526static struct twl4030_codec_audio_data igep2_audio_data;
537 .audio_mclk = 26000000,
538};
539 527
540static struct twl4030_codec_data igep2_codec_data = { 528static struct twl4030_codec_data igep2_codec_data = {
541 .audio_mclk = 26000000, 529 .audio_mclk = 26000000,
@@ -627,10 +615,10 @@ static struct omap_musb_board_data musb_board_data = {
627 .power = 100, 615 .power = 100,
628}; 616};
629 617
630static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { 618static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
631 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, 619 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
632 .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN, 620 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
633 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, 621 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
634 622
635 .phy_reset = true, 623 .phy_reset = true,
636 .reset_gpio_port[0] = IGEP2_GPIO_USBH_NRESET, 624 .reset_gpio_port[0] = IGEP2_GPIO_USBH_NRESET,
@@ -697,9 +685,10 @@ static void __init igep2_init(void)
697 /* Register I2C busses and drivers */ 685 /* Register I2C busses and drivers */
698 igep2_i2c_init(); 686 igep2_i2c_init();
699 platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices)); 687 platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices));
688 omap_display_init(&igep2_dss_data);
700 omap_serial_init(); 689 omap_serial_init();
701 usb_musb_init(&musb_board_data); 690 usb_musb_init(&musb_board_data);
702 usb_ehci_init(&ehci_pdata); 691 usbhs_init(&usbhs_bdata);
703 692
704 igep2_flash_init(); 693 igep2_flash_init();
705 igep2_leds_init(); 694 igep2_leds_init();
@@ -716,9 +705,10 @@ static void __init igep2_init(void)
716 705
717MACHINE_START(IGEP0020, "IGEP v2 board") 706MACHINE_START(IGEP0020, "IGEP v2 board")
718 .boot_params = 0x80000100, 707 .boot_params = 0x80000100,
719 .map_io = omap3_map_io,
720 .reserve = omap_reserve, 708 .reserve = omap_reserve,
721 .init_irq = igep2_init_irq, 709 .map_io = omap3_map_io,
710 .init_early = igep2_init_early,
711 .init_irq = omap_init_irq,
722 .init_machine = igep2_init, 712 .init_machine = igep2_init,
723 .timer = &omap_timer, 713 .timer = &omap_timer,
724MACHINE_END 714MACHINE_END
diff --git a/arch/arm/mach-omap2/board-igep0030.c b/arch/arm/mach-omap2/board-igep0030.c
index 4dc62a9b9cb2..b10db0e6ee62 100644
--- a/arch/arm/mach-omap2/board-igep0030.c
+++ b/arch/arm/mach-omap2/board-igep0030.c
@@ -142,7 +142,7 @@ static void __init igep3_flash_init(void) {}
142#endif 142#endif
143 143
144static struct regulator_consumer_supply igep3_vmmc1_supply = 144static struct regulator_consumer_supply igep3_vmmc1_supply =
145 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); 145 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0");
146 146
147/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ 147/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
148static struct regulator_init_data igep3_vmmc1 = { 148static struct regulator_init_data igep3_vmmc1 = {
@@ -160,7 +160,7 @@ static struct regulator_init_data igep3_vmmc1 = {
160}; 160};
161 161
162static struct regulator_consumer_supply igep3_vio_supply = 162static struct regulator_consumer_supply igep3_vio_supply =
163 REGULATOR_SUPPLY("vmmc_aux", "mmci-omap-hs.1"); 163 REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1");
164 164
165static struct regulator_init_data igep3_vio = { 165static struct regulator_init_data igep3_vio = {
166 .constraints = { 166 .constraints = {
@@ -178,7 +178,7 @@ static struct regulator_init_data igep3_vio = {
178}; 178};
179 179
180static struct regulator_consumer_supply igep3_vmmc2_supply = 180static struct regulator_consumer_supply igep3_vmmc2_supply =
181 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); 181 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1");
182 182
183static struct regulator_init_data igep3_vmmc2 = { 183static struct regulator_init_data igep3_vmmc2 = {
184 .constraints = { 184 .constraints = {
@@ -331,12 +331,11 @@ static struct platform_device *igep3_devices[] __initdata = {
331 &igep3_vwlan_device, 331 &igep3_vwlan_device,
332}; 332};
333 333
334static void __init igep3_init_irq(void) 334static void __init igep3_init_early(void)
335{ 335{
336 omap2_init_common_infrastructure(); 336 omap2_init_common_infrastructure();
337 omap2_init_common_devices(m65kxxxxam_sdrc_params, 337 omap2_init_common_devices(m65kxxxxam_sdrc_params,
338 m65kxxxxam_sdrc_params); 338 m65kxxxxam_sdrc_params);
339 omap_init_irq();
340} 339}
341 340
342static struct twl4030_platform_data igep3_twl4030_pdata = { 341static struct twl4030_platform_data igep3_twl4030_pdata = {
@@ -408,10 +407,10 @@ static void __init igep3_wifi_bt_init(void)
408void __init igep3_wifi_bt_init(void) {} 407void __init igep3_wifi_bt_init(void) {}
409#endif 408#endif
410 409
411static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { 410static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
412 .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN, 411 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
413 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, 412 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
414 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, 413 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
415 414
416 .phy_reset = true, 415 .phy_reset = true,
417 .reset_gpio_port[0] = -EINVAL, 416 .reset_gpio_port[0] = -EINVAL,
@@ -435,7 +434,7 @@ static void __init igep3_init(void)
435 platform_add_devices(igep3_devices, ARRAY_SIZE(igep3_devices)); 434 platform_add_devices(igep3_devices, ARRAY_SIZE(igep3_devices));
436 omap_serial_init(); 435 omap_serial_init();
437 usb_musb_init(&musb_board_data); 436 usb_musb_init(&musb_board_data);
438 usb_ehci_init(&ehci_pdata); 437 usbhs_init(&usbhs_bdata);
439 438
440 igep3_flash_init(); 439 igep3_flash_init();
441 igep3_leds_init(); 440 igep3_leds_init();
@@ -452,7 +451,8 @@ MACHINE_START(IGEP0030, "IGEP OMAP3 module")
452 .boot_params = 0x80000100, 451 .boot_params = 0x80000100,
453 .reserve = omap_reserve, 452 .reserve = omap_reserve,
454 .map_io = omap3_map_io, 453 .map_io = omap3_map_io,
455 .init_irq = igep3_init_irq, 454 .init_early = igep3_init_early,
455 .init_irq = omap_init_irq,
456 .init_machine = igep3_init, 456 .init_machine = igep3_init,
457 .timer = &omap_timer, 457 .timer = &omap_timer,
458MACHINE_END 458MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index e5dc74875f9d..e2ba77957a8c 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -288,13 +288,10 @@ static struct omap_board_config_kernel ldp_config[] __initdata = {
288 { OMAP_TAG_LCD, &ldp_lcd_config }, 288 { OMAP_TAG_LCD, &ldp_lcd_config },
289}; 289};
290 290
291static void __init omap_ldp_init_irq(void) 291static void __init omap_ldp_init_early(void)
292{ 292{
293 omap_board_config = ldp_config;
294 omap_board_config_size = ARRAY_SIZE(ldp_config);
295 omap2_init_common_infrastructure(); 293 omap2_init_common_infrastructure();
296 omap2_init_common_devices(NULL, NULL); 294 omap2_init_common_devices(NULL, NULL);
297 omap_init_irq();
298} 295}
299 296
300static struct twl4030_usb_data ldp_usb_data = { 297static struct twl4030_usb_data ldp_usb_data = {
@@ -330,6 +327,26 @@ static struct regulator_init_data ldp_vmmc1 = {
330 .consumer_supplies = &ldp_vmmc1_supply, 327 .consumer_supplies = &ldp_vmmc1_supply,
331}; 328};
332 329
330/* ads7846 on SPI */
331static struct regulator_consumer_supply ldp_vaux1_supplies[] = {
332 REGULATOR_SUPPLY("vcc", "spi1.0"),
333};
334
335/* VAUX1 */
336static struct regulator_init_data ldp_vaux1 = {
337 .constraints = {
338 .min_uV = 3000000,
339 .max_uV = 3000000,
340 .apply_uV = true,
341 .valid_modes_mask = REGULATOR_MODE_NORMAL
342 | REGULATOR_MODE_STANDBY,
343 .valid_ops_mask = REGULATOR_CHANGE_MODE
344 | REGULATOR_CHANGE_STATUS,
345 },
346 .num_consumer_supplies = ARRAY_SIZE(ldp_vaux1_supplies),
347 .consumer_supplies = ldp_vaux1_supplies,
348};
349
333static struct twl4030_platform_data ldp_twldata = { 350static struct twl4030_platform_data ldp_twldata = {
334 .irq_base = TWL4030_IRQ_BASE, 351 .irq_base = TWL4030_IRQ_BASE,
335 .irq_end = TWL4030_IRQ_END, 352 .irq_end = TWL4030_IRQ_END,
@@ -338,6 +355,7 @@ static struct twl4030_platform_data ldp_twldata = {
338 .madc = &ldp_madc_data, 355 .madc = &ldp_madc_data,
339 .usb = &ldp_usb_data, 356 .usb = &ldp_usb_data,
340 .vmmc1 = &ldp_vmmc1, 357 .vmmc1 = &ldp_vmmc1,
358 .vaux1 = &ldp_vaux1,
341 .gpio = &ldp_gpio_data, 359 .gpio = &ldp_gpio_data,
342 .keypad = &ldp_kp_twl4030_data, 360 .keypad = &ldp_kp_twl4030_data,
343}; 361};
@@ -423,6 +441,8 @@ static struct mtd_partition ldp_nand_partitions[] = {
423static void __init omap_ldp_init(void) 441static void __init omap_ldp_init(void)
424{ 442{
425 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 443 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
444 omap_board_config = ldp_config;
445 omap_board_config_size = ARRAY_SIZE(ldp_config);
426 ldp_init_smsc911x(); 446 ldp_init_smsc911x();
427 omap_i2c_init(); 447 omap_i2c_init();
428 platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); 448 platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
@@ -434,7 +454,7 @@ static void __init omap_ldp_init(void)
434 omap_serial_init(); 454 omap_serial_init();
435 usb_musb_init(&musb_board_data); 455 usb_musb_init(&musb_board_data);
436 board_nand_init(ldp_nand_partitions, 456 board_nand_init(ldp_nand_partitions,
437 ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS); 457 ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0);
438 458
439 omap2_hsmmc_init(mmc); 459 omap2_hsmmc_init(mmc);
440 /* link regulators to MMC adapters */ 460 /* link regulators to MMC adapters */
@@ -443,9 +463,10 @@ static void __init omap_ldp_init(void)
443 463
444MACHINE_START(OMAP_LDP, "OMAP LDP board") 464MACHINE_START(OMAP_LDP, "OMAP LDP board")
445 .boot_params = 0x80000100, 465 .boot_params = 0x80000100,
446 .map_io = omap3_map_io,
447 .reserve = omap_reserve, 466 .reserve = omap_reserve,
448 .init_irq = omap_ldp_init_irq, 467 .map_io = omap3_map_io,
468 .init_early = omap_ldp_init_early,
469 .init_irq = omap_init_irq,
449 .init_machine = omap_ldp_init, 470 .init_machine = omap_ldp_init,
450 .timer = &omap_timer, 471 .timer = &omap_timer,
451MACHINE_END 472MACHINE_END
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index f396756872b7..e710cd9e079b 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -536,7 +536,7 @@ static void __init n8x0_mmc_init(void)
536 } 536 }
537 537
538 mmc_data[0] = &mmc1_data; 538 mmc_data[0] = &mmc1_data;
539 omap2_init_mmc(mmc_data, OMAP24XX_NR_MMC); 539 omap242x_init_mmc(mmc_data);
540} 540}
541#else 541#else
542 542
@@ -628,11 +628,10 @@ static void __init n8x0_map_io(void)
628 omap242x_map_common_io(); 628 omap242x_map_common_io();
629} 629}
630 630
631static void __init n8x0_init_irq(void) 631static void __init n8x0_init_early(void)
632{ 632{
633 omap2_init_common_infrastructure(); 633 omap2_init_common_infrastructure();
634 omap2_init_common_devices(NULL, NULL); 634 omap2_init_common_devices(NULL, NULL);
635 omap_init_irq();
636} 635}
637 636
638#ifdef CONFIG_OMAP_MUX 637#ifdef CONFIG_OMAP_MUX
@@ -703,27 +702,30 @@ static void __init n8x0_init_machine(void)
703 702
704MACHINE_START(NOKIA_N800, "Nokia N800") 703MACHINE_START(NOKIA_N800, "Nokia N800")
705 .boot_params = 0x80000100, 704 .boot_params = 0x80000100,
706 .map_io = n8x0_map_io,
707 .reserve = omap_reserve, 705 .reserve = omap_reserve,
708 .init_irq = n8x0_init_irq, 706 .map_io = n8x0_map_io,
707 .init_early = n8x0_init_early,
708 .init_irq = omap_init_irq,
709 .init_machine = n8x0_init_machine, 709 .init_machine = n8x0_init_machine,
710 .timer = &omap_timer, 710 .timer = &omap_timer,
711MACHINE_END 711MACHINE_END
712 712
713MACHINE_START(NOKIA_N810, "Nokia N810") 713MACHINE_START(NOKIA_N810, "Nokia N810")
714 .boot_params = 0x80000100, 714 .boot_params = 0x80000100,
715 .map_io = n8x0_map_io,
716 .reserve = omap_reserve, 715 .reserve = omap_reserve,
717 .init_irq = n8x0_init_irq, 716 .map_io = n8x0_map_io,
717 .init_early = n8x0_init_early,
718 .init_irq = omap_init_irq,
718 .init_machine = n8x0_init_machine, 719 .init_machine = n8x0_init_machine,
719 .timer = &omap_timer, 720 .timer = &omap_timer,
720MACHINE_END 721MACHINE_END
721 722
722MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX") 723MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
723 .boot_params = 0x80000100, 724 .boot_params = 0x80000100,
724 .map_io = n8x0_map_io,
725 .reserve = omap_reserve, 725 .reserve = omap_reserve,
726 .init_irq = n8x0_init_irq, 726 .map_io = n8x0_map_io,
727 .init_early = n8x0_init_early,
728 .init_irq = omap_init_irq,
727 .init_machine = n8x0_init_machine, 729 .init_machine = n8x0_init_machine,
728 .timer = &omap_timer, 730 .timer = &omap_timer,
729MACHINE_END 731MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 46d814ab5656..33007fd4a083 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -23,6 +23,7 @@
23#include <linux/gpio.h> 23#include <linux/gpio.h>
24#include <linux/input.h> 24#include <linux/input.h>
25#include <linux/gpio_keys.h> 25#include <linux/gpio_keys.h>
26#include <linux/opp.h>
26 27
27#include <linux/mtd/mtd.h> 28#include <linux/mtd/mtd.h>
28#include <linux/mtd/partitions.h> 29#include <linux/mtd/partitions.h>
@@ -45,10 +46,12 @@
45#include <plat/gpmc.h> 46#include <plat/gpmc.h>
46#include <plat/nand.h> 47#include <plat/nand.h>
47#include <plat/usb.h> 48#include <plat/usb.h>
49#include <plat/omap_device.h>
48 50
49#include "mux.h" 51#include "mux.h"
50#include "hsmmc.h" 52#include "hsmmc.h"
51#include "timer-gp.h" 53#include "timer-gp.h"
54#include "pm.h"
52 55
53#define NAND_BLOCK_SIZE SZ_128K 56#define NAND_BLOCK_SIZE SZ_128K
54 57
@@ -228,19 +231,13 @@ static struct omap_dss_board_info beagle_dss_data = {
228 .default_device = &beagle_dvi_device, 231 .default_device = &beagle_dvi_device,
229}; 232};
230 233
231static struct platform_device beagle_dss_device = {
232 .name = "omapdss",
233 .id = -1,
234 .dev = {
235 .platform_data = &beagle_dss_data,
236 },
237};
238
239static struct regulator_consumer_supply beagle_vdac_supply = 234static struct regulator_consumer_supply beagle_vdac_supply =
240 REGULATOR_SUPPLY("vdda_dac", "omapdss"); 235 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc");
241 236
242static struct regulator_consumer_supply beagle_vdvi_supply = 237static struct regulator_consumer_supply beagle_vdvi_supplies[] = {
243 REGULATOR_SUPPLY("vdds_dsi", "omapdss"); 238 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
239 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
240};
244 241
245static void __init beagle_display_init(void) 242static void __init beagle_display_init(void)
246{ 243{
@@ -427,17 +424,15 @@ static struct regulator_init_data beagle_vpll2 = {
427 .valid_ops_mask = REGULATOR_CHANGE_MODE 424 .valid_ops_mask = REGULATOR_CHANGE_MODE
428 | REGULATOR_CHANGE_STATUS, 425 | REGULATOR_CHANGE_STATUS,
429 }, 426 },
430 .num_consumer_supplies = 1, 427 .num_consumer_supplies = ARRAY_SIZE(beagle_vdvi_supplies),
431 .consumer_supplies = &beagle_vdvi_supply, 428 .consumer_supplies = beagle_vdvi_supplies,
432}; 429};
433 430
434static struct twl4030_usb_data beagle_usb_data = { 431static struct twl4030_usb_data beagle_usb_data = {
435 .usb_mode = T2_USB_MODE_ULPI, 432 .usb_mode = T2_USB_MODE_ULPI,
436}; 433};
437 434
438static struct twl4030_codec_audio_data beagle_audio_data = { 435static struct twl4030_codec_audio_data beagle_audio_data;
439 .audio_mclk = 26000000,
440};
441 436
442static struct twl4030_codec_data beagle_codec_data = { 437static struct twl4030_codec_data beagle_codec_data = {
443 .audio_mclk = 26000000, 438 .audio_mclk = 26000000,
@@ -536,11 +531,15 @@ static struct platform_device keys_gpio = {
536 }, 531 },
537}; 532};
538 533
539static void __init omap3_beagle_init_irq(void) 534static void __init omap3_beagle_init_early(void)
540{ 535{
541 omap2_init_common_infrastructure(); 536 omap2_init_common_infrastructure();
542 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, 537 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
543 mt46h32m32lf6_sdrc_params); 538 mt46h32m32lf6_sdrc_params);
539}
540
541static void __init omap3_beagle_init_irq(void)
542{
544 omap_init_irq(); 543 omap_init_irq();
545#ifdef CONFIG_OMAP_32K_TIMER 544#ifdef CONFIG_OMAP_32K_TIMER
546 omap2_gp_clockevent_set_gptimer(12); 545 omap2_gp_clockevent_set_gptimer(12);
@@ -550,7 +549,6 @@ static void __init omap3_beagle_init_irq(void)
550static struct platform_device *omap3_beagle_devices[] __initdata = { 549static struct platform_device *omap3_beagle_devices[] __initdata = {
551 &leds_gpio, 550 &leds_gpio,
552 &keys_gpio, 551 &keys_gpio,
553 &beagle_dss_device,
554}; 552};
555 553
556static void __init omap3beagle_flash_init(void) 554static void __init omap3beagle_flash_init(void)
@@ -586,11 +584,11 @@ static void __init omap3beagle_flash_init(void)
586 } 584 }
587} 585}
588 586
589static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { 587static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
590 588
591 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, 589 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
592 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, 590 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
593 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, 591 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
594 592
595 .phy_reset = true, 593 .phy_reset = true,
596 .reset_gpio_port[0] = -EINVAL, 594 .reset_gpio_port[0] = -EINVAL,
@@ -610,6 +608,52 @@ static struct omap_musb_board_data musb_board_data = {
610 .power = 100, 608 .power = 100,
611}; 609};
612 610
611static void __init beagle_opp_init(void)
612{
613 int r = 0;
614
615 /* Initialize the omap3 opp table */
616 if (omap3_opp_init()) {
617 pr_err("%s: opp default init failed\n", __func__);
618 return;
619 }
620
621 /* Custom OPP enabled for XM */
622 if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
623 struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
624 struct omap_hwmod *dh = omap_hwmod_lookup("iva");
625 struct device *dev;
626
627 if (!mh || !dh) {
628 pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
629 __func__, mh, dh);
630 return;
631 }
632 /* Enable MPU 1GHz and lower opps */
633 dev = &mh->od->pdev.dev;
634 r = opp_enable(dev, 800000000);
635 /* TODO: MPU 1GHz needs SR and ABB */
636
637 /* Enable IVA 800MHz and lower opps */
638 dev = &dh->od->pdev.dev;
639 r |= opp_enable(dev, 660000000);
640 /* TODO: DSP 800MHz needs SR and ABB */
641 if (r) {
642 pr_err("%s: failed to enable higher opp %d\n",
643 __func__, r);
644 /*
645 * Cleanup - disable the higher freqs - we dont care
646 * about the results
647 */
648 dev = &mh->od->pdev.dev;
649 opp_disable(dev, 800000000);
650 dev = &dh->od->pdev.dev;
651 opp_disable(dev, 660000000);
652 }
653 }
654 return;
655}
656
613static void __init omap3_beagle_init(void) 657static void __init omap3_beagle_init(void)
614{ 658{
615 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 659 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -617,6 +661,7 @@ static void __init omap3_beagle_init(void)
617 omap3_beagle_i2c_init(); 661 omap3_beagle_i2c_init();
618 platform_add_devices(omap3_beagle_devices, 662 platform_add_devices(omap3_beagle_devices,
619 ARRAY_SIZE(omap3_beagle_devices)); 663 ARRAY_SIZE(omap3_beagle_devices));
664 omap_display_init(&beagle_dss_data);
620 omap_serial_init(); 665 omap_serial_init();
621 666
622 omap_mux_init_gpio(170, OMAP_PIN_INPUT); 667 omap_mux_init_gpio(170, OMAP_PIN_INPUT);
@@ -625,7 +670,7 @@ static void __init omap3_beagle_init(void)
625 gpio_direction_output(170, true); 670 gpio_direction_output(170, true);
626 671
627 usb_musb_init(&musb_board_data); 672 usb_musb_init(&musb_board_data);
628 usb_ehci_init(&ehci_pdata); 673 usbhs_init(&usbhs_bdata);
629 omap3beagle_flash_init(); 674 omap3beagle_flash_init();
630 675
631 /* Ensure SDRC pins are mux'd for self-refresh */ 676 /* Ensure SDRC pins are mux'd for self-refresh */
@@ -633,13 +678,15 @@ static void __init omap3_beagle_init(void)
633 omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); 678 omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
634 679
635 beagle_display_init(); 680 beagle_display_init();
681 beagle_opp_init();
636} 682}
637 683
638MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") 684MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
639 /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */ 685 /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */
640 .boot_params = 0x80000100, 686 .boot_params = 0x80000100,
641 .map_io = omap3_map_io,
642 .reserve = omap_reserve, 687 .reserve = omap_reserve,
688 .map_io = omap3_map_io,
689 .init_early = omap3_beagle_init_early,
643 .init_irq = omap3_beagle_init_irq, 690 .init_irq = omap3_beagle_init_irq,
644 .init_machine = omap3_beagle_init, 691 .init_machine = omap3_beagle_init,
645 .timer = &omap_timer, 692 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 323c3809ce39..5a1a916e5cc8 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -30,6 +30,8 @@
30#include <linux/usb/otg.h> 30#include <linux/usb/otg.h>
31#include <linux/smsc911x.h> 31#include <linux/smsc911x.h>
32 32
33#include <linux/wl12xx.h>
34#include <linux/regulator/fixed.h>
33#include <linux/regulator/machine.h> 35#include <linux/regulator/machine.h>
34#include <linux/mmc/host.h> 36#include <linux/mmc/host.h>
35 37
@@ -58,6 +60,13 @@
58#define OMAP3EVM_ETHR_ID_REV 0x50 60#define OMAP3EVM_ETHR_ID_REV 0x50
59#define OMAP3EVM_ETHR_GPIO_IRQ 176 61#define OMAP3EVM_ETHR_GPIO_IRQ 176
60#define OMAP3EVM_SMSC911X_CS 5 62#define OMAP3EVM_SMSC911X_CS 5
63/*
64 * Eth Reset signal
65 * 64 = Generation 1 (<=RevD)
66 * 7 = Generation 2 (>=RevE)
67 */
68#define OMAP3EVM_GEN1_ETHR_GPIO_RST 64
69#define OMAP3EVM_GEN2_ETHR_GPIO_RST 7
61 70
62static u8 omap3_evm_version; 71static u8 omap3_evm_version;
63 72
@@ -124,10 +133,15 @@ static struct platform_device omap3evm_smsc911x_device = {
124 133
125static inline void __init omap3evm_init_smsc911x(void) 134static inline void __init omap3evm_init_smsc911x(void)
126{ 135{
127 int eth_cs; 136 int eth_cs, eth_rst;
128 struct clk *l3ck; 137 struct clk *l3ck;
129 unsigned int rate; 138 unsigned int rate;
130 139
140 if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1)
141 eth_rst = OMAP3EVM_GEN1_ETHR_GPIO_RST;
142 else
143 eth_rst = OMAP3EVM_GEN2_ETHR_GPIO_RST;
144
131 eth_cs = OMAP3EVM_SMSC911X_CS; 145 eth_cs = OMAP3EVM_SMSC911X_CS;
132 146
133 l3ck = clk_get(NULL, "l3_ck"); 147 l3ck = clk_get(NULL, "l3_ck");
@@ -136,6 +150,27 @@ static inline void __init omap3evm_init_smsc911x(void)
136 else 150 else
137 rate = clk_get_rate(l3ck); 151 rate = clk_get_rate(l3ck);
138 152
153 /* Configure ethernet controller reset gpio */
154 if (cpu_is_omap3430()) {
155 if (gpio_request(eth_rst, "SMSC911x gpio") < 0) {
156 pr_err(KERN_ERR "Failed to request %d for smsc911x\n",
157 eth_rst);
158 return;
159 }
160
161 if (gpio_direction_output(eth_rst, 1) < 0) {
162 pr_err(KERN_ERR "Failed to set direction of %d for" \
163 " smsc911x\n", eth_rst);
164 return;
165 }
166 /* reset pulse to ethernet controller*/
167 usleep_range(150, 220);
168 gpio_set_value(eth_rst, 0);
169 usleep_range(150, 220);
170 gpio_set_value(eth_rst, 1);
171 usleep_range(1, 2);
172 }
173
139 if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) { 174 if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) {
140 printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", 175 printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
141 OMAP3EVM_ETHR_GPIO_IRQ); 176 OMAP3EVM_ETHR_GPIO_IRQ);
@@ -235,9 +270,9 @@ static int omap3_evm_enable_lcd(struct omap_dss_device *dssdev)
235 gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 0); 270 gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 0);
236 271
237 if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) 272 if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
238 gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); 273 gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0);
239 else 274 else
240 gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); 275 gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1);
241 276
242 lcd_enabled = 1; 277 lcd_enabled = 1;
243 return 0; 278 return 0;
@@ -248,9 +283,9 @@ static void omap3_evm_disable_lcd(struct omap_dss_device *dssdev)
248 gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 1); 283 gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 1);
249 284
250 if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) 285 if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
251 gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); 286 gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1);
252 else 287 else
253 gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); 288 gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0);
254 289
255 lcd_enabled = 0; 290 lcd_enabled = 0;
256} 291}
@@ -289,7 +324,7 @@ static int omap3_evm_enable_dvi(struct omap_dss_device *dssdev)
289 return -EINVAL; 324 return -EINVAL;
290 } 325 }
291 326
292 gpio_set_value(OMAP3EVM_DVI_PANEL_EN_GPIO, 1); 327 gpio_set_value_cansleep(OMAP3EVM_DVI_PANEL_EN_GPIO, 1);
293 328
294 dvi_enabled = 1; 329 dvi_enabled = 1;
295 return 0; 330 return 0;
@@ -297,7 +332,7 @@ static int omap3_evm_enable_dvi(struct omap_dss_device *dssdev)
297 332
298static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev) 333static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev)
299{ 334{
300 gpio_set_value(OMAP3EVM_DVI_PANEL_EN_GPIO, 0); 335 gpio_set_value_cansleep(OMAP3EVM_DVI_PANEL_EN_GPIO, 0);
301 336
302 dvi_enabled = 0; 337 dvi_enabled = 0;
303} 338}
@@ -328,14 +363,6 @@ static struct omap_dss_board_info omap3_evm_dss_data = {
328 .default_device = &omap3_evm_lcd_device, 363 .default_device = &omap3_evm_lcd_device,
329}; 364};
330 365
331static struct platform_device omap3_evm_dss_device = {
332 .name = "omapdss",
333 .id = -1,
334 .dev = {
335 .platform_data = &omap3_evm_dss_data,
336 },
337};
338
339static struct regulator_consumer_supply omap3evm_vmmc1_supply = { 366static struct regulator_consumer_supply omap3evm_vmmc1_supply = {
340 .supply = "vmmc", 367 .supply = "vmmc",
341}; 368};
@@ -381,6 +408,16 @@ static struct omap2_hsmmc_info mmc[] = {
381 .gpio_cd = -EINVAL, 408 .gpio_cd = -EINVAL,
382 .gpio_wp = 63, 409 .gpio_wp = 63,
383 }, 410 },
411#ifdef CONFIG_WL12XX_PLATFORM_DATA
412 {
413 .name = "wl1271",
414 .mmc = 2,
415 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
416 .gpio_wp = -EINVAL,
417 .gpio_cd = -EINVAL,
418 .nonremovable = true,
419 },
420#endif
384 {} /* Terminator */ 421 {} /* Terminator */
385}; 422};
386 423
@@ -411,6 +448,8 @@ static struct platform_device leds_gpio = {
411static int omap3evm_twl_gpio_setup(struct device *dev, 448static int omap3evm_twl_gpio_setup(struct device *dev,
412 unsigned gpio, unsigned ngpio) 449 unsigned gpio, unsigned ngpio)
413{ 450{
451 int r;
452
414 /* gpio + 0 is "mmc0_cd" (input/IRQ) */ 453 /* gpio + 0 is "mmc0_cd" (input/IRQ) */
415 omap_mux_init_gpio(63, OMAP_PIN_INPUT); 454 omap_mux_init_gpio(63, OMAP_PIN_INPUT);
416 mmc[0].gpio_cd = gpio + 0; 455 mmc[0].gpio_cd = gpio + 0;
@@ -426,8 +465,12 @@ static int omap3evm_twl_gpio_setup(struct device *dev,
426 */ 465 */
427 466
428 /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */ 467 /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */
429 gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL"); 468 r = gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL");
430 gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); 469 if (!r)
470 r = gpio_direction_output(gpio + TWL4030_GPIO_MAX,
471 (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) ? 1 : 0);
472 if (r)
473 printk(KERN_ERR "failed to get/set lcd_bkl gpio\n");
431 474
432 /* gpio + 7 == DVI Enable */ 475 /* gpio + 7 == DVI Enable */
433 gpio_request(gpio + 7, "EN_DVI"); 476 gpio_request(gpio + 7, "EN_DVI");
@@ -491,19 +534,15 @@ static struct twl4030_madc_platform_data omap3evm_madc_data = {
491 .irq_line = 1, 534 .irq_line = 1,
492}; 535};
493 536
494static struct twl4030_codec_audio_data omap3evm_audio_data = { 537static struct twl4030_codec_audio_data omap3evm_audio_data;
495 .audio_mclk = 26000000,
496};
497 538
498static struct twl4030_codec_data omap3evm_codec_data = { 539static struct twl4030_codec_data omap3evm_codec_data = {
499 .audio_mclk = 26000000, 540 .audio_mclk = 26000000,
500 .audio = &omap3evm_audio_data, 541 .audio = &omap3evm_audio_data,
501}; 542};
502 543
503static struct regulator_consumer_supply omap3_evm_vdda_dac_supply = { 544static struct regulator_consumer_supply omap3_evm_vdda_dac_supply =
504 .supply = "vdda_dac", 545 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc");
505 .dev = &omap3_evm_dss_device.dev,
506};
507 546
508/* VDAC for DSS driving S-Video */ 547/* VDAC for DSS driving S-Video */
509static struct regulator_init_data omap3_evm_vdac = { 548static struct regulator_init_data omap3_evm_vdac = {
@@ -521,8 +560,10 @@ static struct regulator_init_data omap3_evm_vdac = {
521}; 560};
522 561
523/* VPLL2 for digital video outputs */ 562/* VPLL2 for digital video outputs */
524static struct regulator_consumer_supply omap3_evm_vpll2_supply = 563static struct regulator_consumer_supply omap3_evm_vpll2_supplies[] = {
525 REGULATOR_SUPPLY("vdds_dsi", "omapdss"); 564 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
565 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
566};
526 567
527static struct regulator_init_data omap3_evm_vpll2 = { 568static struct regulator_init_data omap3_evm_vpll2 = {
528 .constraints = { 569 .constraints = {
@@ -534,10 +575,70 @@ static struct regulator_init_data omap3_evm_vpll2 = {
534 .valid_ops_mask = REGULATOR_CHANGE_MODE 575 .valid_ops_mask = REGULATOR_CHANGE_MODE
535 | REGULATOR_CHANGE_STATUS, 576 | REGULATOR_CHANGE_STATUS,
536 }, 577 },
578 .num_consumer_supplies = ARRAY_SIZE(omap3_evm_vpll2_supplies),
579 .consumer_supplies = omap3_evm_vpll2_supplies,
580};
581
582/* ads7846 on SPI */
583static struct regulator_consumer_supply omap3evm_vio_supply =
584 REGULATOR_SUPPLY("vcc", "spi1.0");
585
586/* VIO for ads7846 */
587static struct regulator_init_data omap3evm_vio = {
588 .constraints = {
589 .min_uV = 1800000,
590 .max_uV = 1800000,
591 .apply_uV = true,
592 .valid_modes_mask = REGULATOR_MODE_NORMAL
593 | REGULATOR_MODE_STANDBY,
594 .valid_ops_mask = REGULATOR_CHANGE_MODE
595 | REGULATOR_CHANGE_STATUS,
596 },
537 .num_consumer_supplies = 1, 597 .num_consumer_supplies = 1,
538 .consumer_supplies = &omap3_evm_vpll2_supply, 598 .consumer_supplies = &omap3evm_vio_supply,
539}; 599};
540 600
601#ifdef CONFIG_WL12XX_PLATFORM_DATA
602
603#define OMAP3EVM_WLAN_PMENA_GPIO (150)
604#define OMAP3EVM_WLAN_IRQ_GPIO (149)
605
606static struct regulator_consumer_supply omap3evm_vmmc2_supply =
607 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1");
608
609/* VMMC2 for driving the WL12xx module */
610static struct regulator_init_data omap3evm_vmmc2 = {
611 .constraints = {
612 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
613 },
614 .num_consumer_supplies = 1,
615 .consumer_supplies = &omap3evm_vmmc2_supply,
616};
617
618static struct fixed_voltage_config omap3evm_vwlan = {
619 .supply_name = "vwl1271",
620 .microvolts = 1800000, /* 1.80V */
621 .gpio = OMAP3EVM_WLAN_PMENA_GPIO,
622 .startup_delay = 70000, /* 70ms */
623 .enable_high = 1,
624 .enabled_at_boot = 0,
625 .init_data = &omap3evm_vmmc2,
626};
627
628static struct platform_device omap3evm_wlan_regulator = {
629 .name = "reg-fixed-voltage",
630 .id = 1,
631 .dev = {
632 .platform_data = &omap3evm_vwlan,
633 },
634};
635
636struct wl12xx_platform_data omap3evm_wlan_data __initdata = {
637 .irq = OMAP_GPIO_IRQ(OMAP3EVM_WLAN_IRQ_GPIO),
638 .board_ref_clock = WL12XX_REFCLOCK_38, /* 38.4 MHz */
639};
640#endif
641
541static struct twl4030_platform_data omap3evm_twldata = { 642static struct twl4030_platform_data omap3evm_twldata = {
542 .irq_base = TWL4030_IRQ_BASE, 643 .irq_base = TWL4030_IRQ_BASE,
543 .irq_end = TWL4030_IRQ_END, 644 .irq_end = TWL4030_IRQ_END,
@@ -550,6 +651,7 @@ static struct twl4030_platform_data omap3evm_twldata = {
550 .codec = &omap3evm_codec_data, 651 .codec = &omap3evm_codec_data,
551 .vdac = &omap3_evm_vdac, 652 .vdac = &omap3_evm_vdac,
552 .vpll2 = &omap3_evm_vpll2, 653 .vpll2 = &omap3_evm_vpll2,
654 .vio = &omap3evm_vio,
553}; 655};
554 656
555static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = { 657static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = {
@@ -625,24 +727,17 @@ static struct spi_board_info omap3evm_spi_board_info[] = {
625static struct omap_board_config_kernel omap3_evm_config[] __initdata = { 727static struct omap_board_config_kernel omap3_evm_config[] __initdata = {
626}; 728};
627 729
628static void __init omap3_evm_init_irq(void) 730static void __init omap3_evm_init_early(void)
629{ 731{
630 omap_board_config = omap3_evm_config;
631 omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
632 omap2_init_common_infrastructure(); 732 omap2_init_common_infrastructure();
633 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL); 733 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL);
634 omap_init_irq();
635} 734}
636 735
637static struct platform_device *omap3_evm_devices[] __initdata = { 736static struct usbhs_omap_board_data usbhs_bdata __initdata = {
638 &omap3_evm_dss_device,
639};
640 737
641static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = { 738 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
642 739 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
643 .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN, 740 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
644 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
645 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
646 741
647 .phy_reset = true, 742 .phy_reset = true,
648 /* PHY reset GPIO will be runtime programmed based on EVM version */ 743 /* PHY reset GPIO will be runtime programmed based on EVM version */
@@ -652,14 +747,76 @@ static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {
652}; 747};
653 748
654#ifdef CONFIG_OMAP_MUX 749#ifdef CONFIG_OMAP_MUX
655static struct omap_board_mux board_mux[] __initdata = { 750static struct omap_board_mux omap35x_board_mux[] __initdata = {
751 OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP |
752 OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW |
753 OMAP_PIN_OFF_WAKEUPENABLE),
754 OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
755 OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW |
756 OMAP_PIN_OFF_WAKEUPENABLE),
757 OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
758 OMAP_PIN_OFF_NONE),
759 OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
760 OMAP_PIN_OFF_NONE),
761#ifdef CONFIG_WL12XX_PLATFORM_DATA
762 /* WLAN IRQ - GPIO 149 */
763 OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
764
765 /* WLAN POWER ENABLE - GPIO 150 */
766 OMAP3_MUX(UART1_CTS, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
767
768 /* MMC2 SDIO pin muxes for WL12xx */
769 OMAP3_MUX(SDMMC2_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
770 OMAP3_MUX(SDMMC2_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
771 OMAP3_MUX(SDMMC2_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
772 OMAP3_MUX(SDMMC2_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
773 OMAP3_MUX(SDMMC2_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
774 OMAP3_MUX(SDMMC2_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
775#endif
776 { .reg_offset = OMAP_MUX_TERMINATOR },
777};
778
779static struct omap_board_mux omap36x_board_mux[] __initdata = {
656 OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP | 780 OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP |
657 OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW | 781 OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW |
658 OMAP_PIN_OFF_WAKEUPENABLE), 782 OMAP_PIN_OFF_WAKEUPENABLE),
659 OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | 783 OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
660 OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW), 784 OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW |
785 OMAP_PIN_OFF_WAKEUPENABLE),
786 /* AM/DM37x EVM: DSS data bus muxed with sys_boot */
787 OMAP3_MUX(DSS_DATA18, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
788 OMAP3_MUX(DSS_DATA19, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
789 OMAP3_MUX(DSS_DATA22, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
790 OMAP3_MUX(DSS_DATA21, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
791 OMAP3_MUX(DSS_DATA22, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
792 OMAP3_MUX(DSS_DATA23, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
793 OMAP3_MUX(SYS_BOOT0, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
794 OMAP3_MUX(SYS_BOOT1, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
795 OMAP3_MUX(SYS_BOOT3, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
796 OMAP3_MUX(SYS_BOOT4, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
797 OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
798 OMAP3_MUX(SYS_BOOT6, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
799#ifdef CONFIG_WL12XX_PLATFORM_DATA
800 /* WLAN IRQ - GPIO 149 */
801 OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
802
803 /* WLAN POWER ENABLE - GPIO 150 */
804 OMAP3_MUX(UART1_CTS, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
805
806 /* MMC2 SDIO pin muxes for WL12xx */
807 OMAP3_MUX(SDMMC2_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
808 OMAP3_MUX(SDMMC2_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
809 OMAP3_MUX(SDMMC2_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
810 OMAP3_MUX(SDMMC2_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
811 OMAP3_MUX(SDMMC2_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
812 OMAP3_MUX(SDMMC2_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
813#endif
814
661 { .reg_offset = OMAP_MUX_TERMINATOR }, 815 { .reg_offset = OMAP_MUX_TERMINATOR },
662}; 816};
817#else
818#define omap35x_board_mux NULL
819#define omap36x_board_mux NULL
663#endif 820#endif
664 821
665static struct omap_musb_board_data musb_board_data = { 822static struct omap_musb_board_data musb_board_data = {
@@ -671,11 +828,18 @@ static struct omap_musb_board_data musb_board_data = {
671static void __init omap3_evm_init(void) 828static void __init omap3_evm_init(void)
672{ 829{
673 omap3_evm_get_revision(); 830 omap3_evm_get_revision();
674 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 831
832 if (cpu_is_omap3630())
833 omap3_mux_init(omap36x_board_mux, OMAP_PACKAGE_CBB);
834 else
835 omap3_mux_init(omap35x_board_mux, OMAP_PACKAGE_CBB);
836
837 omap_board_config = omap3_evm_config;
838 omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
675 839
676 omap3_evm_i2c_init(); 840 omap3_evm_i2c_init();
677 841
678 platform_add_devices(omap3_evm_devices, ARRAY_SIZE(omap3_evm_devices)); 842 omap_display_init(&omap3_evm_dss_data);
679 843
680 spi_register_board_info(omap3evm_spi_board_info, 844 spi_register_board_info(omap3evm_spi_board_info,
681 ARRAY_SIZE(omap3evm_spi_board_info)); 845 ARRAY_SIZE(omap3evm_spi_board_info));
@@ -700,7 +864,7 @@ static void __init omap3_evm_init(void)
700 864
701 /* setup EHCI phy reset config */ 865 /* setup EHCI phy reset config */
702 omap_mux_init_gpio(21, OMAP_PIN_INPUT_PULLUP); 866 omap_mux_init_gpio(21, OMAP_PIN_INPUT_PULLUP);
703 ehci_pdata.reset_gpio_port[1] = 21; 867 usbhs_bdata.reset_gpio_port[1] = 21;
704 868
705 /* EVM REV >= E can supply 500mA with EXTVBUS programming */ 869 /* EVM REV >= E can supply 500mA with EXTVBUS programming */
706 musb_board_data.power = 500; 870 musb_board_data.power = 500;
@@ -708,21 +872,29 @@ static void __init omap3_evm_init(void)
708 } else { 872 } else {
709 /* setup EHCI phy reset on MDC */ 873 /* setup EHCI phy reset on MDC */
710 omap_mux_init_gpio(135, OMAP_PIN_OUTPUT); 874 omap_mux_init_gpio(135, OMAP_PIN_OUTPUT);
711 ehci_pdata.reset_gpio_port[1] = 135; 875 usbhs_bdata.reset_gpio_port[1] = 135;
712 } 876 }
713 usb_musb_init(&musb_board_data); 877 usb_musb_init(&musb_board_data);
714 usb_ehci_init(&ehci_pdata); 878 usbhs_init(&usbhs_bdata);
715 ads7846_dev_init(); 879 ads7846_dev_init();
716 omap3evm_init_smsc911x(); 880 omap3evm_init_smsc911x();
717 omap3_evm_display_init(); 881 omap3_evm_display_init();
882
883#ifdef CONFIG_WL12XX_PLATFORM_DATA
884 /* WL12xx WLAN Init */
885 if (wl12xx_set_platform_data(&omap3evm_wlan_data))
886 pr_err("error setting wl12xx data\n");
887 platform_device_register(&omap3evm_wlan_regulator);
888#endif
718} 889}
719 890
720MACHINE_START(OMAP3EVM, "OMAP3 EVM") 891MACHINE_START(OMAP3EVM, "OMAP3 EVM")
721 /* Maintainer: Syed Mohammed Khasim - Texas Instruments */ 892 /* Maintainer: Syed Mohammed Khasim - Texas Instruments */
722 .boot_params = 0x80000100, 893 .boot_params = 0x80000100,
723 .map_io = omap3_map_io,
724 .reserve = omap_reserve, 894 .reserve = omap_reserve,
725 .init_irq = omap3_evm_init_irq, 895 .map_io = omap3_map_io,
896 .init_early = omap3_evm_init_early,
897 .init_irq = omap_init_irq,
726 .init_machine = omap3_evm_init, 898 .init_machine = omap3_evm_init,
727 .timer = &omap_timer, 899 .timer = &omap_timer,
728MACHINE_END 900MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index 15e4b08e99ba..b726943d7c93 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -195,11 +195,10 @@ static inline void __init board_smsc911x_init(void)
195 gpmc_smsc911x_init(&board_smsc911x_data); 195 gpmc_smsc911x_init(&board_smsc911x_data);
196} 196}
197 197
198static void __init omap3logic_init_irq(void) 198static void __init omap3logic_init_early(void)
199{ 199{
200 omap2_init_common_infrastructure(); 200 omap2_init_common_infrastructure();
201 omap2_init_common_devices(NULL, NULL); 201 omap2_init_common_devices(NULL, NULL);
202 omap_init_irq();
203} 202}
204 203
205#ifdef CONFIG_OMAP_MUX 204#ifdef CONFIG_OMAP_MUX
@@ -225,7 +224,8 @@ static void __init omap3logic_init(void)
225MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board") 224MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board")
226 .boot_params = 0x80000100, 225 .boot_params = 0x80000100,
227 .map_io = omap3_map_io, 226 .map_io = omap3_map_io,
228 .init_irq = omap3logic_init_irq, 227 .init_early = omap3logic_init_early,
228 .init_irq = omap_init_irq,
229 .init_machine = omap3logic_init, 229 .init_machine = omap3logic_init,
230 .timer = &omap_timer, 230 .timer = &omap_timer,
231MACHINE_END 231MACHINE_END
@@ -233,7 +233,8 @@ MACHINE_END
233MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board") 233MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board")
234 .boot_params = 0x80000100, 234 .boot_params = 0x80000100,
235 .map_io = omap3_map_io, 235 .map_io = omap3_map_io,
236 .init_irq = omap3logic_init_irq, 236 .init_early = omap3logic_init_early,
237 .init_irq = omap_init_irq,
237 .init_machine = omap3logic_init, 238 .init_machine = omap3logic_init,
238 .timer = &omap_timer, 239 .timer = &omap_timer,
239MACHINE_END 240MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 0b34beded11f..07dba888f450 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -253,14 +253,6 @@ static struct omap_dss_board_info pandora_dss_data = {
253 .default_device = &pandora_lcd_device, 253 .default_device = &pandora_lcd_device,
254}; 254};
255 255
256static struct platform_device pandora_dss_device = {
257 .name = "omapdss",
258 .id = -1,
259 .dev = {
260 .platform_data = &pandora_dss_data,
261 },
262};
263
264static void pandora_wl1251_init_card(struct mmc_card *card) 256static void pandora_wl1251_init_card(struct mmc_card *card)
265{ 257{
266 /* 258 /*
@@ -341,20 +333,21 @@ static struct twl4030_gpio_platform_data omap3pandora_gpio_data = {
341}; 333};
342 334
343static struct regulator_consumer_supply pandora_vmmc1_supply = 335static struct regulator_consumer_supply pandora_vmmc1_supply =
344 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); 336 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0");
345 337
346static struct regulator_consumer_supply pandora_vmmc2_supply = 338static struct regulator_consumer_supply pandora_vmmc2_supply =
347 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); 339 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1");
348 340
349static struct regulator_consumer_supply pandora_vmmc3_supply = 341static struct regulator_consumer_supply pandora_vmmc3_supply =
350 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.2"); 342 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.2");
351 343
352static struct regulator_consumer_supply pandora_vdda_dac_supply = 344static struct regulator_consumer_supply pandora_vdda_dac_supply =
353 REGULATOR_SUPPLY("vdda_dac", "omapdss"); 345 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc");
354 346
355static struct regulator_consumer_supply pandora_vdds_supplies[] = { 347static struct regulator_consumer_supply pandora_vdds_supplies[] = {
356 REGULATOR_SUPPLY("vdds_sdi", "omapdss"), 348 REGULATOR_SUPPLY("vdds_sdi", "omapdss"),
357 REGULATOR_SUPPLY("vdds_dsi", "omapdss"), 349 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
350 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
358}; 351};
359 352
360static struct regulator_consumer_supply pandora_vcc_lcd_supply = 353static struct regulator_consumer_supply pandora_vcc_lcd_supply =
@@ -524,9 +517,7 @@ static struct twl4030_usb_data omap3pandora_usb_data = {
524 .usb_mode = T2_USB_MODE_ULPI, 517 .usb_mode = T2_USB_MODE_ULPI,
525}; 518};
526 519
527static struct twl4030_codec_audio_data omap3pandora_audio_data = { 520static struct twl4030_codec_audio_data omap3pandora_audio_data;
528 .audio_mclk = 26000000,
529};
530 521
531static struct twl4030_codec_data omap3pandora_codec_data = { 522static struct twl4030_codec_data omap3pandora_codec_data = {
532 .audio_mclk = 26000000, 523 .audio_mclk = 26000000,
@@ -634,12 +625,11 @@ static struct spi_board_info omap3pandora_spi_board_info[] __initdata = {
634 } 625 }
635}; 626};
636 627
637static void __init omap3pandora_init_irq(void) 628static void __init omap3pandora_init_early(void)
638{ 629{
639 omap2_init_common_infrastructure(); 630 omap2_init_common_infrastructure();
640 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, 631 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
641 mt46h32m32lf6_sdrc_params); 632 mt46h32m32lf6_sdrc_params);
642 omap_init_irq();
643} 633}
644 634
645static void __init pandora_wl1251_init(void) 635static void __init pandora_wl1251_init(void)
@@ -677,15 +667,14 @@ fail:
677static struct platform_device *omap3pandora_devices[] __initdata = { 667static struct platform_device *omap3pandora_devices[] __initdata = {
678 &pandora_leds_gpio, 668 &pandora_leds_gpio,
679 &pandora_keys_gpio, 669 &pandora_keys_gpio,
680 &pandora_dss_device,
681 &pandora_vwlan_device, 670 &pandora_vwlan_device,
682}; 671};
683 672
684static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { 673static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
685 674
686 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, 675 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
687 .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN, 676 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
688 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, 677 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
689 678
690 .phy_reset = true, 679 .phy_reset = true,
691 .reset_gpio_port[0] = 16, 680 .reset_gpio_port[0] = 16,
@@ -712,11 +701,12 @@ static void __init omap3pandora_init(void)
712 pandora_wl1251_init(); 701 pandora_wl1251_init();
713 platform_add_devices(omap3pandora_devices, 702 platform_add_devices(omap3pandora_devices,
714 ARRAY_SIZE(omap3pandora_devices)); 703 ARRAY_SIZE(omap3pandora_devices));
704 omap_display_init(&pandora_dss_data);
715 omap_serial_init(); 705 omap_serial_init();
716 spi_register_board_info(omap3pandora_spi_board_info, 706 spi_register_board_info(omap3pandora_spi_board_info,
717 ARRAY_SIZE(omap3pandora_spi_board_info)); 707 ARRAY_SIZE(omap3pandora_spi_board_info));
718 omap3pandora_ads7846_init(); 708 omap3pandora_ads7846_init();
719 usb_ehci_init(&ehci_pdata); 709 usbhs_init(&usbhs_bdata);
720 usb_musb_init(&musb_board_data); 710 usb_musb_init(&musb_board_data);
721 gpmc_nand_init(&pandora_nand_data); 711 gpmc_nand_init(&pandora_nand_data);
722 712
@@ -727,9 +717,10 @@ static void __init omap3pandora_init(void)
727 717
728MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console") 718MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
729 .boot_params = 0x80000100, 719 .boot_params = 0x80000100,
730 .map_io = omap3_map_io,
731 .reserve = omap_reserve, 720 .reserve = omap_reserve,
732 .init_irq = omap3pandora_init_irq, 721 .map_io = omap3_map_io,
722 .init_early = omap3pandora_init_early,
723 .init_irq = omap_init_irq,
733 .init_machine = omap3pandora_init, 724 .init_machine = omap3pandora_init,
734 .timer = &omap_timer, 725 .timer = &omap_timer,
735MACHINE_END 726MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index 2a2dad447e86..a6e0b9161c99 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -240,14 +240,6 @@ static struct omap_dss_board_info omap3_stalker_dss_data = {
240 .default_device = &omap3_stalker_dvi_device, 240 .default_device = &omap3_stalker_dvi_device,
241}; 241};
242 242
243static struct platform_device omap3_stalker_dss_device = {
244 .name = "omapdss",
245 .id = -1,
246 .dev = {
247 .platform_data = &omap3_stalker_dss_data,
248 },
249};
250
251static struct regulator_consumer_supply omap3stalker_vmmc1_supply = { 243static struct regulator_consumer_supply omap3stalker_vmmc1_supply = {
252 .supply = "vmmc", 244 .supply = "vmmc",
253}; 245};
@@ -439,19 +431,15 @@ static struct twl4030_madc_platform_data omap3stalker_madc_data = {
439 .irq_line = 1, 431 .irq_line = 1,
440}; 432};
441 433
442static struct twl4030_codec_audio_data omap3stalker_audio_data = { 434static struct twl4030_codec_audio_data omap3stalker_audio_data;
443 .audio_mclk = 26000000,
444};
445 435
446static struct twl4030_codec_data omap3stalker_codec_data = { 436static struct twl4030_codec_data omap3stalker_codec_data = {
447 .audio_mclk = 26000000, 437 .audio_mclk = 26000000,
448 .audio = &omap3stalker_audio_data, 438 .audio = &omap3stalker_audio_data,
449}; 439};
450 440
451static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply = { 441static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply =
452 .supply = "vdda_dac", 442 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc");
453 .dev = &omap3_stalker_dss_device.dev,
454};
455 443
456/* VDAC for DSS driving S-Video */ 444/* VDAC for DSS driving S-Video */
457static struct regulator_init_data omap3_stalker_vdac = { 445static struct regulator_init_data omap3_stalker_vdac = {
@@ -469,9 +457,9 @@ static struct regulator_init_data omap3_stalker_vdac = {
469}; 457};
470 458
471/* VPLL2 for digital video outputs */ 459/* VPLL2 for digital video outputs */
472static struct regulator_consumer_supply omap3_stalker_vpll2_supply = { 460static struct regulator_consumer_supply omap3_stalker_vpll2_supplies[] = {
473 .supply = "vdds_dsi", 461 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
474 .dev = &omap3_stalker_lcd_device.dev, 462 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
475}; 463};
476 464
477static struct regulator_init_data omap3_stalker_vpll2 = { 465static struct regulator_init_data omap3_stalker_vpll2 = {
@@ -485,8 +473,8 @@ static struct regulator_init_data omap3_stalker_vpll2 = {
485 .valid_ops_mask = REGULATOR_CHANGE_MODE 473 .valid_ops_mask = REGULATOR_CHANGE_MODE
486 | REGULATOR_CHANGE_STATUS, 474 | REGULATOR_CHANGE_STATUS,
487 }, 475 },
488 .num_consumer_supplies = 1, 476 .num_consumer_supplies = ARRAY_SIZE(omap3_stalker_vpll2_supplies),
489 .consumer_supplies = &omap3_stalker_vpll2_supply, 477 .consumer_supplies = omap3_stalker_vpll2_supplies,
490}; 478};
491 479
492static struct twl4030_platform_data omap3stalker_twldata = { 480static struct twl4030_platform_data omap3stalker_twldata = {
@@ -591,12 +579,14 @@ static struct spi_board_info omap3stalker_spi_board_info[] = {
591static struct omap_board_config_kernel omap3_stalker_config[] __initdata = { 579static struct omap_board_config_kernel omap3_stalker_config[] __initdata = {
592}; 580};
593 581
594static void __init omap3_stalker_init_irq(void) 582static void __init omap3_stalker_init_early(void)
595{ 583{
596 omap_board_config = omap3_stalker_config;
597 omap_board_config_size = ARRAY_SIZE(omap3_stalker_config);
598 omap2_init_common_infrastructure(); 584 omap2_init_common_infrastructure();
599 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL); 585 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL);
586}
587
588static void __init omap3_stalker_init_irq(void)
589{
600 omap_init_irq(); 590 omap_init_irq();
601#ifdef CONFIG_OMAP_32K_TIMER 591#ifdef CONFIG_OMAP_32K_TIMER
602 omap2_gp_clockevent_set_gptimer(12); 592 omap2_gp_clockevent_set_gptimer(12);
@@ -604,14 +594,13 @@ static void __init omap3_stalker_init_irq(void)
604} 594}
605 595
606static struct platform_device *omap3_stalker_devices[] __initdata = { 596static struct platform_device *omap3_stalker_devices[] __initdata = {
607 &omap3_stalker_dss_device,
608 &keys_gpio, 597 &keys_gpio,
609}; 598};
610 599
611static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { 600static struct usbhs_omap_board_data usbhs_bdata __initconst = {
612 .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN, 601 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
613 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, 602 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
614 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, 603 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
615 604
616 .phy_reset = true, 605 .phy_reset = true,
617 .reset_gpio_port[0] = -EINVAL, 606 .reset_gpio_port[0] = -EINVAL,
@@ -638,18 +627,21 @@ static struct omap_musb_board_data musb_board_data = {
638static void __init omap3_stalker_init(void) 627static void __init omap3_stalker_init(void)
639{ 628{
640 omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); 629 omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
630 omap_board_config = omap3_stalker_config;
631 omap_board_config_size = ARRAY_SIZE(omap3_stalker_config);
641 632
642 omap3_stalker_i2c_init(); 633 omap3_stalker_i2c_init();
643 634
644 platform_add_devices(omap3_stalker_devices, 635 platform_add_devices(omap3_stalker_devices,
645 ARRAY_SIZE(omap3_stalker_devices)); 636 ARRAY_SIZE(omap3_stalker_devices));
646 637
638 omap_display_init(&omap3_stalker_dss_data);
647 spi_register_board_info(omap3stalker_spi_board_info, 639 spi_register_board_info(omap3stalker_spi_board_info,
648 ARRAY_SIZE(omap3stalker_spi_board_info)); 640 ARRAY_SIZE(omap3stalker_spi_board_info));
649 641
650 omap_serial_init(); 642 omap_serial_init();
651 usb_musb_init(&musb_board_data); 643 usb_musb_init(&musb_board_data);
652 usb_ehci_init(&ehci_pdata); 644 usbhs_init(&usbhs_bdata);
653 ads7846_dev_init(); 645 ads7846_dev_init();
654 646
655 omap_mux_init_gpio(21, OMAP_PIN_OUTPUT); 647 omap_mux_init_gpio(21, OMAP_PIN_OUTPUT);
@@ -666,6 +658,7 @@ MACHINE_START(SBC3530, "OMAP3 STALKER")
666 /* Maintainer: Jason Lam -lzg@ema-tech.com */ 658 /* Maintainer: Jason Lam -lzg@ema-tech.com */
667 .boot_params = 0x80000100, 659 .boot_params = 0x80000100,
668 .map_io = omap3_map_io, 660 .map_io = omap3_map_io,
661 .init_early = omap3_stalker_init_early,
669 .init_irq = omap3_stalker_init_irq, 662 .init_irq = omap3_stalker_init_irq,
670 .init_machine = omap3_stalker_init, 663 .init_machine = omap3_stalker_init,
671 .timer = &omap_timer, 664 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index db1f74fe6c4f..127cb1752bdd 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -252,9 +252,7 @@ static struct twl4030_usb_data touchbook_usb_data = {
252 .usb_mode = T2_USB_MODE_ULPI, 252 .usb_mode = T2_USB_MODE_ULPI,
253}; 253};
254 254
255static struct twl4030_codec_audio_data touchbook_audio_data = { 255static struct twl4030_codec_audio_data touchbook_audio_data;
256 .audio_mclk = 26000000,
257};
258 256
259static struct twl4030_codec_data touchbook_codec_data = { 257static struct twl4030_codec_data touchbook_codec_data = {
260 .audio_mclk = 26000000, 258 .audio_mclk = 26000000,
@@ -415,14 +413,15 @@ static struct omap_board_mux board_mux[] __initdata = {
415}; 413};
416#endif 414#endif
417 415
418static void __init omap3_touchbook_init_irq(void) 416static void __init omap3_touchbook_init_early(void)
419{ 417{
420 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
421 omap_board_config = omap3_touchbook_config;
422 omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config);
423 omap2_init_common_infrastructure(); 418 omap2_init_common_infrastructure();
424 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, 419 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
425 mt46h32m32lf6_sdrc_params); 420 mt46h32m32lf6_sdrc_params);
421}
422
423static void __init omap3_touchbook_init_irq(void)
424{
426 omap_init_irq(); 425 omap_init_irq();
427#ifdef CONFIG_OMAP_32K_TIMER 426#ifdef CONFIG_OMAP_32K_TIMER
428 omap2_gp_clockevent_set_gptimer(12); 427 omap2_gp_clockevent_set_gptimer(12);
@@ -468,11 +467,11 @@ static void __init omap3touchbook_flash_init(void)
468 } 467 }
469} 468}
470 469
471static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { 470static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
472 471
473 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, 472 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
474 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, 473 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
475 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, 474 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
476 475
477 .phy_reset = true, 476 .phy_reset = true,
478 .reset_gpio_port[0] = -EINVAL, 477 .reset_gpio_port[0] = -EINVAL,
@@ -510,6 +509,10 @@ static struct omap_musb_board_data musb_board_data = {
510 509
511static void __init omap3_touchbook_init(void) 510static void __init omap3_touchbook_init(void)
512{ 511{
512 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
513 omap_board_config = omap3_touchbook_config;
514 omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config);
515
513 pm_power_off = omap3_touchbook_poweroff; 516 pm_power_off = omap3_touchbook_poweroff;
514 517
515 omap3_touchbook_i2c_init(); 518 omap3_touchbook_i2c_init();
@@ -527,7 +530,7 @@ static void __init omap3_touchbook_init(void)
527 ARRAY_SIZE(omap3_ads7846_spi_board_info)); 530 ARRAY_SIZE(omap3_ads7846_spi_board_info));
528 omap3_ads7846_init(); 531 omap3_ads7846_init();
529 usb_musb_init(&musb_board_data); 532 usb_musb_init(&musb_board_data);
530 usb_ehci_init(&ehci_pdata); 533 usbhs_init(&usbhs_bdata);
531 omap3touchbook_flash_init(); 534 omap3touchbook_flash_init();
532 535
533 /* Ensure SDRC pins are mux'd for self-refresh */ 536 /* Ensure SDRC pins are mux'd for self-refresh */
@@ -538,8 +541,9 @@ static void __init omap3_touchbook_init(void)
538MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board") 541MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board")
539 /* Maintainer: Gregoire Gentil - http://www.alwaysinnovating.com */ 542 /* Maintainer: Gregoire Gentil - http://www.alwaysinnovating.com */
540 .boot_params = 0x80000100, 543 .boot_params = 0x80000100,
541 .map_io = omap3_map_io,
542 .reserve = omap_reserve, 544 .reserve = omap_reserve,
545 .map_io = omap3_map_io,
546 .init_early = omap3_touchbook_init_early,
543 .init_irq = omap3_touchbook_init_irq, 547 .init_irq = omap3_touchbook_init_irq,
544 .init_machine = omap3_touchbook_init, 548 .init_machine = omap3_touchbook_init,
545 .timer = &omap_timer, 549 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index e001a048dc0c..c936c6d7ded0 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -26,17 +26,21 @@
26#include <linux/usb/otg.h> 26#include <linux/usb/otg.h>
27#include <linux/i2c/twl.h> 27#include <linux/i2c/twl.h>
28#include <linux/regulator/machine.h> 28#include <linux/regulator/machine.h>
29#include <linux/regulator/fixed.h>
30#include <linux/wl12xx.h>
29 31
30#include <mach/hardware.h> 32#include <mach/hardware.h>
31#include <mach/omap4-common.h> 33#include <mach/omap4-common.h>
32#include <asm/mach-types.h> 34#include <asm/mach-types.h>
33#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
34#include <asm/mach/map.h> 36#include <asm/mach/map.h>
37#include <plat/display.h>
35 38
36#include <plat/board.h> 39#include <plat/board.h>
37#include <plat/common.h> 40#include <plat/common.h>
38#include <plat/usb.h> 41#include <plat/usb.h>
39#include <plat/mmc.h> 42#include <plat/mmc.h>
43#include <plat/panel-generic-dpi.h>
40#include "timer-gp.h" 44#include "timer-gp.h"
41 45
42#include "hsmmc.h" 46#include "hsmmc.h"
@@ -45,6 +49,20 @@
45 49
46#define GPIO_HUB_POWER 1 50#define GPIO_HUB_POWER 1
47#define GPIO_HUB_NRESET 62 51#define GPIO_HUB_NRESET 62
52#define GPIO_WIFI_PMENA 43
53#define GPIO_WIFI_IRQ 53
54#define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */
55#define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
56
57/* wl127x BT, FM, GPS connectivity chip */
58static int wl1271_gpios[] = {46, -1, -1};
59static struct platform_device wl1271_device = {
60 .name = "kim",
61 .id = -1,
62 .dev = {
63 .platform_data = &wl1271_gpios,
64 },
65};
48 66
49static struct gpio_led gpio_leds[] = { 67static struct gpio_led gpio_leds[] = {
50 { 68 {
@@ -74,19 +92,19 @@ static struct platform_device leds_gpio = {
74 92
75static struct platform_device *panda_devices[] __initdata = { 93static struct platform_device *panda_devices[] __initdata = {
76 &leds_gpio, 94 &leds_gpio,
95 &wl1271_device,
77}; 96};
78 97
79static void __init omap4_panda_init_irq(void) 98static void __init omap4_panda_init_early(void)
80{ 99{
81 omap2_init_common_infrastructure(); 100 omap2_init_common_infrastructure();
82 omap2_init_common_devices(NULL, NULL); 101 omap2_init_common_devices(NULL, NULL);
83 gic_init_irq();
84} 102}
85 103
86static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { 104static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
87 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, 105 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
88 .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN, 106 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
89 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, 107 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
90 .phy_reset = false, 108 .phy_reset = false,
91 .reset_gpio_port[0] = -EINVAL, 109 .reset_gpio_port[0] = -EINVAL,
92 .reset_gpio_port[1] = -EINVAL, 110 .reset_gpio_port[1] = -EINVAL,
@@ -128,7 +146,7 @@ static void __init omap4_ehci_init(void)
128 gpio_set_value(GPIO_HUB_NRESET, 0); 146 gpio_set_value(GPIO_HUB_NRESET, 0);
129 gpio_set_value(GPIO_HUB_NRESET, 1); 147 gpio_set_value(GPIO_HUB_NRESET, 1);
130 148
131 usb_ehci_init(&ehci_pdata); 149 usbhs_init(&usbhs_bdata);
132 150
133 /* enable power to hub */ 151 /* enable power to hub */
134 gpio_set_value(GPIO_HUB_POWER, 1); 152 gpio_set_value(GPIO_HUB_POWER, 1);
@@ -153,6 +171,7 @@ static struct twl4030_usb_data omap4_usbphy_data = {
153 .phy_exit = omap4430_phy_exit, 171 .phy_exit = omap4430_phy_exit,
154 .phy_power = omap4430_phy_power, 172 .phy_power = omap4430_phy_power,
155 .phy_set_clock = omap4430_phy_set_clk, 173 .phy_set_clock = omap4430_phy_set_clk,
174 .phy_suspend = omap4430_phy_suspend,
156}; 175};
157 176
158static struct omap2_hsmmc_info mmc[] = { 177static struct omap2_hsmmc_info mmc[] = {
@@ -162,14 +181,60 @@ static struct omap2_hsmmc_info mmc[] = {
162 .gpio_wp = -EINVAL, 181 .gpio_wp = -EINVAL,
163 .gpio_cd = -EINVAL, 182 .gpio_cd = -EINVAL,
164 }, 183 },
184 {
185 .name = "wl1271",
186 .mmc = 5,
187 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
188 .gpio_wp = -EINVAL,
189 .gpio_cd = -EINVAL,
190 .ocr_mask = MMC_VDD_165_195,
191 .nonremovable = true,
192 },
165 {} /* Terminator */ 193 {} /* Terminator */
166}; 194};
167 195
168static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = { 196static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = {
169 { 197 {
170 .supply = "vmmc", 198 .supply = "vmmc",
171 .dev_name = "mmci-omap-hs.0", 199 .dev_name = "omap_hsmmc.0",
200 },
201};
202
203static struct regulator_consumer_supply omap4_panda_vmmc5_supply = {
204 .supply = "vmmc",
205 .dev_name = "omap_hsmmc.4",
206};
207
208static struct regulator_init_data panda_vmmc5 = {
209 .constraints = {
210 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
172 }, 211 },
212 .num_consumer_supplies = 1,
213 .consumer_supplies = &omap4_panda_vmmc5_supply,
214};
215
216static struct fixed_voltage_config panda_vwlan = {
217 .supply_name = "vwl1271",
218 .microvolts = 1800000, /* 1.8V */
219 .gpio = GPIO_WIFI_PMENA,
220 .startup_delay = 70000, /* 70msec */
221 .enable_high = 1,
222 .enabled_at_boot = 0,
223 .init_data = &panda_vmmc5,
224};
225
226static struct platform_device omap_vwlan_device = {
227 .name = "reg-fixed-voltage",
228 .id = 1,
229 .dev = {
230 .platform_data = &panda_vwlan,
231 },
232};
233
234struct wl12xx_platform_data omap_panda_wlan_data __initdata = {
235 .irq = OMAP_GPIO_IRQ(GPIO_WIFI_IRQ),
236 /* PANDA ref clock is 38.4 MHz */
237 .board_ref_clock = 2,
173}; 238};
174 239
175static int omap4_twl6030_hsmmc_late_init(struct device *dev) 240static int omap4_twl6030_hsmmc_late_init(struct device *dev)
@@ -305,7 +370,6 @@ static struct regulator_init_data omap4_panda_vana = {
305 .constraints = { 370 .constraints = {
306 .min_uV = 2100000, 371 .min_uV = 2100000,
307 .max_uV = 2100000, 372 .max_uV = 2100000,
308 .apply_uV = true,
309 .valid_modes_mask = REGULATOR_MODE_NORMAL 373 .valid_modes_mask = REGULATOR_MODE_NORMAL
310 | REGULATOR_MODE_STANDBY, 374 | REGULATOR_MODE_STANDBY,
311 .valid_ops_mask = REGULATOR_CHANGE_MODE 375 .valid_ops_mask = REGULATOR_CHANGE_MODE
@@ -317,7 +381,6 @@ static struct regulator_init_data omap4_panda_vcxio = {
317 .constraints = { 381 .constraints = {
318 .min_uV = 1800000, 382 .min_uV = 1800000,
319 .max_uV = 1800000, 383 .max_uV = 1800000,
320 .apply_uV = true,
321 .valid_modes_mask = REGULATOR_MODE_NORMAL 384 .valid_modes_mask = REGULATOR_MODE_NORMAL
322 | REGULATOR_MODE_STANDBY, 385 | REGULATOR_MODE_STANDBY,
323 .valid_ops_mask = REGULATOR_CHANGE_MODE 386 .valid_ops_mask = REGULATOR_CHANGE_MODE
@@ -329,7 +392,6 @@ static struct regulator_init_data omap4_panda_vdac = {
329 .constraints = { 392 .constraints = {
330 .min_uV = 1800000, 393 .min_uV = 1800000,
331 .max_uV = 1800000, 394 .max_uV = 1800000,
332 .apply_uV = true,
333 .valid_modes_mask = REGULATOR_MODE_NORMAL 395 .valid_modes_mask = REGULATOR_MODE_NORMAL
334 | REGULATOR_MODE_STANDBY, 396 | REGULATOR_MODE_STANDBY,
335 .valid_ops_mask = REGULATOR_CHANGE_MODE 397 .valid_ops_mask = REGULATOR_CHANGE_MODE
@@ -349,6 +411,12 @@ static struct regulator_init_data omap4_panda_vusb = {
349 }, 411 },
350}; 412};
351 413
414static struct regulator_init_data omap4_panda_clk32kg = {
415 .constraints = {
416 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
417 },
418};
419
352static struct twl4030_platform_data omap4_panda_twldata = { 420static struct twl4030_platform_data omap4_panda_twldata = {
353 .irq_base = TWL6030_IRQ_BASE, 421 .irq_base = TWL6030_IRQ_BASE,
354 .irq_end = TWL6030_IRQ_END, 422 .irq_end = TWL6030_IRQ_END,
@@ -364,6 +432,7 @@ static struct twl4030_platform_data omap4_panda_twldata = {
364 .vaux1 = &omap4_panda_vaux1, 432 .vaux1 = &omap4_panda_vaux1,
365 .vaux2 = &omap4_panda_vaux2, 433 .vaux2 = &omap4_panda_vaux2,
366 .vaux3 = &omap4_panda_vaux3, 434 .vaux3 = &omap4_panda_vaux3,
435 .clk32kg = &omap4_panda_clk32kg,
367 .usb = &omap4_usbphy_data, 436 .usb = &omap4_usbphy_data,
368}; 437};
369 438
@@ -375,6 +444,17 @@ static struct i2c_board_info __initdata omap4_panda_i2c_boardinfo[] = {
375 .platform_data = &omap4_panda_twldata, 444 .platform_data = &omap4_panda_twldata,
376 }, 445 },
377}; 446};
447
448/*
449 * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM
450 * is connected as I2C slave device, and can be accessed at address 0x50
451 */
452static struct i2c_board_info __initdata panda_i2c_eeprom[] = {
453 {
454 I2C_BOARD_INFO("eeprom", 0x50),
455 },
456};
457
378static int __init omap4_panda_i2c_init(void) 458static int __init omap4_panda_i2c_init(void)
379{ 459{
380 /* 460 /*
@@ -384,19 +464,284 @@ static int __init omap4_panda_i2c_init(void)
384 omap_register_i2c_bus(1, 400, omap4_panda_i2c_boardinfo, 464 omap_register_i2c_bus(1, 400, omap4_panda_i2c_boardinfo,
385 ARRAY_SIZE(omap4_panda_i2c_boardinfo)); 465 ARRAY_SIZE(omap4_panda_i2c_boardinfo));
386 omap_register_i2c_bus(2, 400, NULL, 0); 466 omap_register_i2c_bus(2, 400, NULL, 0);
387 omap_register_i2c_bus(3, 400, NULL, 0); 467 /*
468 * Bus 3 is attached to the DVI port where devices like the pico DLP
469 * projector don't work reliably with 400kHz
470 */
471 omap_register_i2c_bus(3, 100, panda_i2c_eeprom,
472 ARRAY_SIZE(panda_i2c_eeprom));
388 omap_register_i2c_bus(4, 400, NULL, 0); 473 omap_register_i2c_bus(4, 400, NULL, 0);
389 return 0; 474 return 0;
390} 475}
391 476
392#ifdef CONFIG_OMAP_MUX 477#ifdef CONFIG_OMAP_MUX
393static struct omap_board_mux board_mux[] __initdata = { 478static struct omap_board_mux board_mux[] __initdata = {
479 /* WLAN IRQ - GPIO 53 */
480 OMAP4_MUX(GPMC_NCS3, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
481 /* WLAN POWER ENABLE - GPIO 43 */
482 OMAP4_MUX(GPMC_A19, OMAP_MUX_MODE3 | OMAP_PIN_OUTPUT),
483 /* WLAN SDIO: MMC5 CMD */
484 OMAP4_MUX(SDMMC5_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
485 /* WLAN SDIO: MMC5 CLK */
486 OMAP4_MUX(SDMMC5_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
487 /* WLAN SDIO: MMC5 DAT[0-3] */
488 OMAP4_MUX(SDMMC5_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
489 OMAP4_MUX(SDMMC5_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
490 OMAP4_MUX(SDMMC5_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
491 OMAP4_MUX(SDMMC5_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
492 /* gpio 0 - TFP410 PD */
493 OMAP4_MUX(KPD_COL1, OMAP_PIN_OUTPUT | OMAP_MUX_MODE3),
494 /* dispc2_data23 */
495 OMAP4_MUX(USBB2_ULPITLL_STP, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
496 /* dispc2_data22 */
497 OMAP4_MUX(USBB2_ULPITLL_DIR, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
498 /* dispc2_data21 */
499 OMAP4_MUX(USBB2_ULPITLL_NXT, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
500 /* dispc2_data20 */
501 OMAP4_MUX(USBB2_ULPITLL_DAT0, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
502 /* dispc2_data19 */
503 OMAP4_MUX(USBB2_ULPITLL_DAT1, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
504 /* dispc2_data18 */
505 OMAP4_MUX(USBB2_ULPITLL_DAT2, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
506 /* dispc2_data15 */
507 OMAP4_MUX(USBB2_ULPITLL_DAT3, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
508 /* dispc2_data14 */
509 OMAP4_MUX(USBB2_ULPITLL_DAT4, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
510 /* dispc2_data13 */
511 OMAP4_MUX(USBB2_ULPITLL_DAT5, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
512 /* dispc2_data12 */
513 OMAP4_MUX(USBB2_ULPITLL_DAT6, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
514 /* dispc2_data11 */
515 OMAP4_MUX(USBB2_ULPITLL_DAT7, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
516 /* dispc2_data10 */
517 OMAP4_MUX(DPM_EMU3, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
518 /* dispc2_data9 */
519 OMAP4_MUX(DPM_EMU4, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
520 /* dispc2_data16 */
521 OMAP4_MUX(DPM_EMU5, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
522 /* dispc2_data17 */
523 OMAP4_MUX(DPM_EMU6, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
524 /* dispc2_hsync */
525 OMAP4_MUX(DPM_EMU7, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
526 /* dispc2_pclk */
527 OMAP4_MUX(DPM_EMU8, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
528 /* dispc2_vsync */
529 OMAP4_MUX(DPM_EMU9, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
530 /* dispc2_de */
531 OMAP4_MUX(DPM_EMU10, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
532 /* dispc2_data8 */
533 OMAP4_MUX(DPM_EMU11, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
534 /* dispc2_data7 */
535 OMAP4_MUX(DPM_EMU12, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
536 /* dispc2_data6 */
537 OMAP4_MUX(DPM_EMU13, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
538 /* dispc2_data5 */
539 OMAP4_MUX(DPM_EMU14, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
540 /* dispc2_data4 */
541 OMAP4_MUX(DPM_EMU15, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
542 /* dispc2_data3 */
543 OMAP4_MUX(DPM_EMU16, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
544 /* dispc2_data2 */
545 OMAP4_MUX(DPM_EMU17, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
546 /* dispc2_data1 */
547 OMAP4_MUX(DPM_EMU18, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
548 /* dispc2_data0 */
549 OMAP4_MUX(DPM_EMU19, OMAP_PIN_OUTPUT | OMAP_MUX_MODE5),
394 { .reg_offset = OMAP_MUX_TERMINATOR }, 550 { .reg_offset = OMAP_MUX_TERMINATOR },
395}; 551};
552
553static struct omap_device_pad serial2_pads[] __initdata = {
554 OMAP_MUX_STATIC("uart2_cts.uart2_cts",
555 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
556 OMAP_MUX_STATIC("uart2_rts.uart2_rts",
557 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
558 OMAP_MUX_STATIC("uart2_rx.uart2_rx",
559 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
560 OMAP_MUX_STATIC("uart2_tx.uart2_tx",
561 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
562};
563
564static struct omap_device_pad serial3_pads[] __initdata = {
565 OMAP_MUX_STATIC("uart3_cts_rctx.uart3_cts_rctx",
566 OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0),
567 OMAP_MUX_STATIC("uart3_rts_sd.uart3_rts_sd",
568 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
569 OMAP_MUX_STATIC("uart3_rx_irrx.uart3_rx_irrx",
570 OMAP_PIN_INPUT | OMAP_MUX_MODE0),
571 OMAP_MUX_STATIC("uart3_tx_irtx.uart3_tx_irtx",
572 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
573};
574
575static struct omap_device_pad serial4_pads[] __initdata = {
576 OMAP_MUX_STATIC("uart4_rx.uart4_rx",
577 OMAP_PIN_INPUT | OMAP_MUX_MODE0),
578 OMAP_MUX_STATIC("uart4_tx.uart4_tx",
579 OMAP_PIN_OUTPUT | OMAP_MUX_MODE0),
580};
581
582static struct omap_board_data serial2_data = {
583 .id = 1,
584 .pads = serial2_pads,
585 .pads_cnt = ARRAY_SIZE(serial2_pads),
586};
587
588static struct omap_board_data serial3_data = {
589 .id = 2,
590 .pads = serial3_pads,
591 .pads_cnt = ARRAY_SIZE(serial3_pads),
592};
593
594static struct omap_board_data serial4_data = {
595 .id = 3,
596 .pads = serial4_pads,
597 .pads_cnt = ARRAY_SIZE(serial4_pads),
598};
599
600static inline void board_serial_init(void)
601{
602 struct omap_board_data bdata;
603 bdata.flags = 0;
604 bdata.pads = NULL;
605 bdata.pads_cnt = 0;
606 bdata.id = 0;
607 /* pass dummy data for UART1 */
608 omap_serial_init_port(&bdata);
609
610 omap_serial_init_port(&serial2_data);
611 omap_serial_init_port(&serial3_data);
612 omap_serial_init_port(&serial4_data);
613}
396#else 614#else
397#define board_mux NULL 615#define board_mux NULL
616
617static inline void board_serial_init(void)
618{
619 omap_serial_init();
620}
398#endif 621#endif
399 622
623/* Display DVI */
624#define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0
625
626static int omap4_panda_enable_dvi(struct omap_dss_device *dssdev)
627{
628 gpio_set_value(dssdev->reset_gpio, 1);
629 return 0;
630}
631
632static void omap4_panda_disable_dvi(struct omap_dss_device *dssdev)
633{
634 gpio_set_value(dssdev->reset_gpio, 0);
635}
636
637/* Using generic display panel */
638static struct panel_generic_dpi_data omap4_dvi_panel = {
639 .name = "generic",
640 .platform_enable = omap4_panda_enable_dvi,
641 .platform_disable = omap4_panda_disable_dvi,
642};
643
644struct omap_dss_device omap4_panda_dvi_device = {
645 .type = OMAP_DISPLAY_TYPE_DPI,
646 .name = "dvi",
647 .driver_name = "generic_dpi_panel",
648 .data = &omap4_dvi_panel,
649 .phy.dpi.data_lines = 24,
650 .reset_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
651 .channel = OMAP_DSS_CHANNEL_LCD2,
652};
653
654int __init omap4_panda_dvi_init(void)
655{
656 int r;
657
658 /* Requesting TFP410 DVI GPIO and disabling it, at bootup */
659 r = gpio_request_one(omap4_panda_dvi_device.reset_gpio,
660 GPIOF_OUT_INIT_LOW, "DVI PD");
661 if (r)
662 pr_err("Failed to get DVI powerdown GPIO\n");
663
664 return r;
665}
666
667
668static void omap4_panda_hdmi_mux_init(void)
669{
670 /* PAD0_HDMI_HPD_PAD1_HDMI_CEC */
671 omap_mux_init_signal("hdmi_hpd",
672 OMAP_PIN_INPUT_PULLUP);
673 omap_mux_init_signal("hdmi_cec",
674 OMAP_PIN_INPUT_PULLUP);
675 /* PAD0_HDMI_DDC_SCL_PAD1_HDMI_DDC_SDA */
676 omap_mux_init_signal("hdmi_ddc_scl",
677 OMAP_PIN_INPUT_PULLUP);
678 omap_mux_init_signal("hdmi_ddc_sda",
679 OMAP_PIN_INPUT_PULLUP);
680}
681
682static int omap4_panda_panel_enable_hdmi(struct omap_dss_device *dssdev)
683{
684 int status;
685
686 status = gpio_request_one(HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH,
687 "hdmi_gpio_hpd");
688 if (status) {
689 pr_err("Cannot request GPIO %d\n", HDMI_GPIO_HPD);
690 return status;
691 }
692 status = gpio_request_one(HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH,
693 "hdmi_gpio_ls_oe");
694 if (status) {
695 pr_err("Cannot request GPIO %d\n", HDMI_GPIO_LS_OE);
696 goto error1;
697 }
698
699 return 0;
700
701error1:
702 gpio_free(HDMI_GPIO_HPD);
703
704 return status;
705}
706
707static void omap4_panda_panel_disable_hdmi(struct omap_dss_device *dssdev)
708{
709 gpio_free(HDMI_GPIO_LS_OE);
710 gpio_free(HDMI_GPIO_HPD);
711}
712
713static struct omap_dss_device omap4_panda_hdmi_device = {
714 .name = "hdmi",
715 .driver_name = "hdmi_panel",
716 .type = OMAP_DISPLAY_TYPE_HDMI,
717 .platform_enable = omap4_panda_panel_enable_hdmi,
718 .platform_disable = omap4_panda_panel_disable_hdmi,
719 .channel = OMAP_DSS_CHANNEL_DIGIT,
720};
721
722static struct omap_dss_device *omap4_panda_dss_devices[] = {
723 &omap4_panda_dvi_device,
724 &omap4_panda_hdmi_device,
725};
726
727static struct omap_dss_board_info omap4_panda_dss_data = {
728 .num_devices = ARRAY_SIZE(omap4_panda_dss_devices),
729 .devices = omap4_panda_dss_devices,
730 .default_device = &omap4_panda_dvi_device,
731};
732
733void omap4_panda_display_init(void)
734{
735 int r;
736
737 r = omap4_panda_dvi_init();
738 if (r)
739 pr_err("error initializing panda DVI\n");
740
741 omap4_panda_hdmi_mux_init();
742 omap_display_init(&omap4_panda_dss_data);
743}
744
400static void __init omap4_panda_init(void) 745static void __init omap4_panda_init(void)
401{ 746{
402 int package = OMAP_PACKAGE_CBS; 747 int package = OMAP_PACKAGE_CBS;
@@ -405,14 +750,17 @@ static void __init omap4_panda_init(void)
405 package = OMAP_PACKAGE_CBL; 750 package = OMAP_PACKAGE_CBL;
406 omap4_mux_init(board_mux, package); 751 omap4_mux_init(board_mux, package);
407 752
753 if (wl12xx_set_platform_data(&omap_panda_wlan_data))
754 pr_err("error setting wl12xx data\n");
755
408 omap4_panda_i2c_init(); 756 omap4_panda_i2c_init();
409 platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices)); 757 platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
410 omap_serial_init(); 758 platform_device_register(&omap_vwlan_device);
759 board_serial_init();
411 omap4_twl6030_hsmmc_init(mmc); 760 omap4_twl6030_hsmmc_init(mmc);
412 /* OMAP4 Panda uses internal transceiver so register nop transceiver */
413 usb_nop_xceiv_register();
414 omap4_ehci_init(); 761 omap4_ehci_init();
415 usb_musb_init(&musb_board_data); 762 usb_musb_init(&musb_board_data);
763 omap4_panda_display_init();
416} 764}
417 765
418static void __init omap4_panda_map_io(void) 766static void __init omap4_panda_map_io(void)
@@ -426,7 +774,8 @@ MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
426 .boot_params = 0x80000100, 774 .boot_params = 0x80000100,
427 .reserve = omap_reserve, 775 .reserve = omap_reserve,
428 .map_io = omap4_panda_map_io, 776 .map_io = omap4_panda_map_io,
429 .init_irq = omap4_panda_init_irq, 777 .init_early = omap4_panda_init_early,
778 .init_irq = gic_init_irq,
430 .init_machine = omap4_panda_init, 779 .init_machine = omap4_panda_init,
431 .timer = &omap_timer, 780 .timer = &omap_timer,
432MACHINE_END 781MACHINE_END
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index cb26e5d8268d..59ca33326b8c 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -28,6 +28,8 @@
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29#include <linux/i2c/twl.h> 29#include <linux/i2c/twl.h>
30#include <linux/regulator/machine.h> 30#include <linux/regulator/machine.h>
31#include <linux/regulator/fixed.h>
32#include <linux/spi/spi.h>
31 33
32#include <linux/mtd/mtd.h> 34#include <linux/mtd/mtd.h>
33#include <linux/mtd/nand.h> 35#include <linux/mtd/nand.h>
@@ -41,10 +43,14 @@
41 43
42#include <plat/board.h> 44#include <plat/board.h>
43#include <plat/common.h> 45#include <plat/common.h>
46#include <plat/display.h>
47#include <plat/panel-generic-dpi.h>
44#include <mach/gpio.h> 48#include <mach/gpio.h>
45#include <plat/gpmc.h> 49#include <plat/gpmc.h>
46#include <mach/hardware.h> 50#include <mach/hardware.h>
47#include <plat/nand.h> 51#include <plat/nand.h>
52#include <plat/mcspi.h>
53#include <plat/mux.h>
48#include <plat/usb.h> 54#include <plat/usb.h>
49 55
50#include "mux.h" 56#include "mux.h"
@@ -68,8 +74,6 @@
68#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ 74#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
69 defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) 75 defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
70 76
71#include <plat/mcspi.h>
72#include <linux/spi/spi.h>
73#include <linux/spi/ads7846.h> 77#include <linux/spi/ads7846.h>
74 78
75static struct omap2_mcspi_device_config ads7846_mcspi_config = { 79static struct omap2_mcspi_device_config ads7846_mcspi_config = {
@@ -94,16 +98,32 @@ static struct ads7846_platform_data ads7846_config = {
94 .keep_vref_on = 1, 98 .keep_vref_on = 1,
95}; 99};
96 100
97static struct spi_board_info overo_spi_board_info[] __initdata = { 101/* fixed regulator for ads7846 */
98 { 102static struct regulator_consumer_supply ads7846_supply =
99 .modalias = "ads7846", 103 REGULATOR_SUPPLY("vcc", "spi1.0");
100 .bus_num = 1, 104
101 .chip_select = 0, 105static struct regulator_init_data vads7846_regulator = {
102 .max_speed_hz = 1500000, 106 .constraints = {
103 .controller_data = &ads7846_mcspi_config, 107 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
104 .irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN), 108 },
105 .platform_data = &ads7846_config, 109 .num_consumer_supplies = 1,
106 } 110 .consumer_supplies = &ads7846_supply,
111};
112
113static struct fixed_voltage_config vads7846 = {
114 .supply_name = "vads7846",
115 .microvolts = 3300000, /* 3.3V */
116 .gpio = -EINVAL,
117 .startup_delay = 0,
118 .init_data = &vads7846_regulator,
119};
120
121static struct platform_device vads7846_device = {
122 .name = "reg-fixed-voltage",
123 .id = 1,
124 .dev = {
125 .platform_data = &vads7846,
126 },
107}; 127};
108 128
109static void __init overo_ads7846_init(void) 129static void __init overo_ads7846_init(void)
@@ -116,8 +136,7 @@ static void __init overo_ads7846_init(void)
116 return; 136 return;
117 } 137 }
118 138
119 spi_register_board_info(overo_spi_board_info, 139 platform_device_register(&vads7846_device);
120 ARRAY_SIZE(overo_spi_board_info));
121} 140}
122 141
123#else 142#else
@@ -233,6 +252,137 @@ static inline void __init overo_init_smsc911x(void)
233static inline void __init overo_init_smsc911x(void) { return; } 252static inline void __init overo_init_smsc911x(void) { return; }
234#endif 253#endif
235 254
255/* DSS */
256static int lcd_enabled;
257static int dvi_enabled;
258
259#define OVERO_GPIO_LCD_EN 144
260#define OVERO_GPIO_LCD_BL 145
261
262static void __init overo_display_init(void)
263{
264 if ((gpio_request(OVERO_GPIO_LCD_EN, "OVERO_GPIO_LCD_EN") == 0) &&
265 (gpio_direction_output(OVERO_GPIO_LCD_EN, 1) == 0))
266 gpio_export(OVERO_GPIO_LCD_EN, 0);
267 else
268 printk(KERN_ERR "could not obtain gpio for "
269 "OVERO_GPIO_LCD_EN\n");
270
271 if ((gpio_request(OVERO_GPIO_LCD_BL, "OVERO_GPIO_LCD_BL") == 0) &&
272 (gpio_direction_output(OVERO_GPIO_LCD_BL, 1) == 0))
273 gpio_export(OVERO_GPIO_LCD_BL, 0);
274 else
275 printk(KERN_ERR "could not obtain gpio for "
276 "OVERO_GPIO_LCD_BL\n");
277}
278
279static int overo_panel_enable_dvi(struct omap_dss_device *dssdev)
280{
281 if (lcd_enabled) {
282 printk(KERN_ERR "cannot enable DVI, LCD is enabled\n");
283 return -EINVAL;
284 }
285 dvi_enabled = 1;
286
287 return 0;
288}
289
290static void overo_panel_disable_dvi(struct omap_dss_device *dssdev)
291{
292 dvi_enabled = 0;
293}
294
295static struct panel_generic_dpi_data dvi_panel = {
296 .name = "generic",
297 .platform_enable = overo_panel_enable_dvi,
298 .platform_disable = overo_panel_disable_dvi,
299};
300
301static struct omap_dss_device overo_dvi_device = {
302 .name = "dvi",
303 .type = OMAP_DISPLAY_TYPE_DPI,
304 .driver_name = "generic_dpi_panel",
305 .data = &dvi_panel,
306 .phy.dpi.data_lines = 24,
307};
308
309static struct omap_dss_device overo_tv_device = {
310 .name = "tv",
311 .driver_name = "venc",
312 .type = OMAP_DISPLAY_TYPE_VENC,
313 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
314};
315
316static int overo_panel_enable_lcd(struct omap_dss_device *dssdev)
317{
318 if (dvi_enabled) {
319 printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
320 return -EINVAL;
321 }
322
323 gpio_set_value(OVERO_GPIO_LCD_EN, 1);
324 gpio_set_value(OVERO_GPIO_LCD_BL, 1);
325 lcd_enabled = 1;
326 return 0;
327}
328
329static void overo_panel_disable_lcd(struct omap_dss_device *dssdev)
330{
331 gpio_set_value(OVERO_GPIO_LCD_EN, 0);
332 gpio_set_value(OVERO_GPIO_LCD_BL, 0);
333 lcd_enabled = 0;
334}
335
336static struct panel_generic_dpi_data lcd43_panel = {
337 .name = "samsung_lte430wq_f0c",
338 .platform_enable = overo_panel_enable_lcd,
339 .platform_disable = overo_panel_disable_lcd,
340};
341
342static struct omap_dss_device overo_lcd43_device = {
343 .name = "lcd43",
344 .type = OMAP_DISPLAY_TYPE_DPI,
345 .driver_name = "generic_dpi_panel",
346 .data = &lcd43_panel,
347 .phy.dpi.data_lines = 24,
348};
349
350#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
351 defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
352static struct omap_dss_device overo_lcd35_device = {
353 .type = OMAP_DISPLAY_TYPE_DPI,
354 .name = "lcd35",
355 .driver_name = "lgphilips_lb035q02_panel",
356 .phy.dpi.data_lines = 24,
357 .platform_enable = overo_panel_enable_lcd,
358 .platform_disable = overo_panel_disable_lcd,
359};
360#endif
361
362static struct omap_dss_device *overo_dss_devices[] = {
363 &overo_dvi_device,
364 &overo_tv_device,
365#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
366 defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
367 &overo_lcd35_device,
368#endif
369 &overo_lcd43_device,
370};
371
372static struct omap_dss_board_info overo_dss_data = {
373 .num_devices = ARRAY_SIZE(overo_dss_devices),
374 .devices = overo_dss_devices,
375 .default_device = &overo_dvi_device,
376};
377
378static struct regulator_consumer_supply overo_vdda_dac_supply =
379 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc");
380
381static struct regulator_consumer_supply overo_vdds_dsi_supply[] = {
382 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
383 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
384};
385
236static struct mtd_partition overo_nand_partitions[] = { 386static struct mtd_partition overo_nand_partitions[] = {
237 { 387 {
238 .name = "xloader", 388 .name = "xloader",
@@ -323,6 +473,93 @@ static struct regulator_consumer_supply overo_vmmc1_supply = {
323 .supply = "vmmc", 473 .supply = "vmmc",
324}; 474};
325 475
476#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
477#include <linux/leds.h>
478
479static struct gpio_led gpio_leds[] = {
480 {
481 .name = "overo:red:gpio21",
482 .default_trigger = "heartbeat",
483 .gpio = 21,
484 .active_low = true,
485 },
486 {
487 .name = "overo:blue:gpio22",
488 .default_trigger = "none",
489 .gpio = 22,
490 .active_low = true,
491 },
492 {
493 .name = "overo:blue:COM",
494 .default_trigger = "mmc0",
495 .gpio = -EINVAL, /* gets replaced */
496 .active_low = true,
497 },
498};
499
500static struct gpio_led_platform_data gpio_leds_pdata = {
501 .leds = gpio_leds,
502 .num_leds = ARRAY_SIZE(gpio_leds),
503};
504
505static struct platform_device gpio_leds_device = {
506 .name = "leds-gpio",
507 .id = -1,
508 .dev = {
509 .platform_data = &gpio_leds_pdata,
510 },
511};
512
513static void __init overo_init_led(void)
514{
515 platform_device_register(&gpio_leds_device);
516}
517
518#else
519static inline void __init overo_init_led(void) { return; }
520#endif
521
522#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
523#include <linux/input.h>
524#include <linux/gpio_keys.h>
525
526static struct gpio_keys_button gpio_buttons[] = {
527 {
528 .code = BTN_0,
529 .gpio = 23,
530 .desc = "button0",
531 .wakeup = 1,
532 },
533 {
534 .code = BTN_1,
535 .gpio = 14,
536 .desc = "button1",
537 .wakeup = 1,
538 },
539};
540
541static struct gpio_keys_platform_data gpio_keys_pdata = {
542 .buttons = gpio_buttons,
543 .nbuttons = ARRAY_SIZE(gpio_buttons),
544};
545
546static struct platform_device gpio_keys_device = {
547 .name = "gpio-keys",
548 .id = -1,
549 .dev = {
550 .platform_data = &gpio_keys_pdata,
551 },
552};
553
554static void __init overo_init_keys(void)
555{
556 platform_device_register(&gpio_keys_device);
557}
558
559#else
560static inline void __init overo_init_keys(void) { return; }
561#endif
562
326static int overo_twl_gpio_setup(struct device *dev, 563static int overo_twl_gpio_setup(struct device *dev,
327 unsigned gpio, unsigned ngpio) 564 unsigned gpio, unsigned ngpio)
328{ 565{
@@ -330,6 +567,11 @@ static int overo_twl_gpio_setup(struct device *dev,
330 567
331 overo_vmmc1_supply.dev = mmc[0].dev; 568 overo_vmmc1_supply.dev = mmc[0].dev;
332 569
570#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
571 /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
572 gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
573#endif
574
333 return 0; 575 return 0;
334} 576}
335 577
@@ -337,6 +579,7 @@ static struct twl4030_gpio_platform_data overo_gpio_data = {
337 .gpio_base = OMAP_MAX_GPIO_LINES, 579 .gpio_base = OMAP_MAX_GPIO_LINES,
338 .irq_base = TWL4030_GPIO_IRQ_BASE, 580 .irq_base = TWL4030_GPIO_IRQ_BASE,
339 .irq_end = TWL4030_GPIO_IRQ_END, 581 .irq_end = TWL4030_GPIO_IRQ_END,
582 .use_leds = true,
340 .setup = overo_twl_gpio_setup, 583 .setup = overo_twl_gpio_setup,
341}; 584};
342 585
@@ -358,17 +601,42 @@ static struct regulator_init_data overo_vmmc1 = {
358 .consumer_supplies = &overo_vmmc1_supply, 601 .consumer_supplies = &overo_vmmc1_supply,
359}; 602};
360 603
361static struct twl4030_codec_audio_data overo_audio_data = { 604/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */
362 .audio_mclk = 26000000, 605static struct regulator_init_data overo_vdac = {
606 .constraints = {
607 .min_uV = 1800000,
608 .max_uV = 1800000,
609 .valid_modes_mask = REGULATOR_MODE_NORMAL
610 | REGULATOR_MODE_STANDBY,
611 .valid_ops_mask = REGULATOR_CHANGE_MODE
612 | REGULATOR_CHANGE_STATUS,
613 },
614 .num_consumer_supplies = 1,
615 .consumer_supplies = &overo_vdda_dac_supply,
363}; 616};
364 617
618/* VPLL2 for digital video outputs */
619static struct regulator_init_data overo_vpll2 = {
620 .constraints = {
621 .name = "VDVI",
622 .min_uV = 1800000,
623 .max_uV = 1800000,
624 .valid_modes_mask = REGULATOR_MODE_NORMAL
625 | REGULATOR_MODE_STANDBY,
626 .valid_ops_mask = REGULATOR_CHANGE_MODE
627 | REGULATOR_CHANGE_STATUS,
628 },
629 .num_consumer_supplies = ARRAY_SIZE(overo_vdds_dsi_supply),
630 .consumer_supplies = overo_vdds_dsi_supply,
631};
632
633static struct twl4030_codec_audio_data overo_audio_data;
634
365static struct twl4030_codec_data overo_codec_data = { 635static struct twl4030_codec_data overo_codec_data = {
366 .audio_mclk = 26000000, 636 .audio_mclk = 26000000,
367 .audio = &overo_audio_data, 637 .audio = &overo_audio_data,
368}; 638};
369 639
370/* mmc2 (WLAN) and Bluetooth don't use twl4030 regulators */
371
372static struct twl4030_platform_data overo_twldata = { 640static struct twl4030_platform_data overo_twldata = {
373 .irq_base = TWL4030_IRQ_BASE, 641 .irq_base = TWL4030_IRQ_BASE,
374 .irq_end = TWL4030_IRQ_END, 642 .irq_end = TWL4030_IRQ_END,
@@ -376,6 +644,8 @@ static struct twl4030_platform_data overo_twldata = {
376 .usb = &overo_usb_data, 644 .usb = &overo_usb_data,
377 .codec = &overo_codec_data, 645 .codec = &overo_codec_data,
378 .vmmc1 = &overo_vmmc1, 646 .vmmc1 = &overo_vmmc1,
647 .vdac = &overo_vdac,
648 .vpll2 = &overo_vpll2,
379}; 649};
380 650
381static struct i2c_board_info __initdata overo_i2c_boardinfo[] = { 651static struct i2c_board_info __initdata overo_i2c_boardinfo[] = {
@@ -396,38 +666,50 @@ static int __init overo_i2c_init(void)
396 return 0; 666 return 0;
397} 667}
398 668
399static struct platform_device overo_lcd_device = { 669static struct spi_board_info overo_spi_board_info[] __initdata = {
400 .name = "overo_lcd", 670#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
401 .id = -1, 671 defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
402}; 672 {
403 673 .modalias = "ads7846",
404static struct omap_lcd_config overo_lcd_config __initdata = { 674 .bus_num = 1,
405 .ctrl_name = "internal", 675 .chip_select = 0,
676 .max_speed_hz = 1500000,
677 .controller_data = &ads7846_mcspi_config,
678 .irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN),
679 .platform_data = &ads7846_config,
680 },
681#endif
682#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
683 defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
684 {
685 .modalias = "lgphilips_lb035q02_panel-spi",
686 .bus_num = 1,
687 .chip_select = 1,
688 .max_speed_hz = 500000,
689 .mode = SPI_MODE_3,
690 },
691#endif
406}; 692};
407 693
408static struct omap_board_config_kernel overo_config[] __initdata = { 694static int __init overo_spi_init(void)
409 { OMAP_TAG_LCD, &overo_lcd_config }, 695{
410}; 696 overo_ads7846_init();
697 spi_register_board_info(overo_spi_board_info,
698 ARRAY_SIZE(overo_spi_board_info));
699 return 0;
700}
411 701
412static void __init overo_init_irq(void) 702static void __init overo_init_early(void)
413{ 703{
414 omap_board_config = overo_config;
415 omap_board_config_size = ARRAY_SIZE(overo_config);
416 omap2_init_common_infrastructure(); 704 omap2_init_common_infrastructure();
417 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, 705 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
418 mt46h32m32lf6_sdrc_params); 706 mt46h32m32lf6_sdrc_params);
419 omap_init_irq();
420} 707}
421 708
422static struct platform_device *overo_devices[] __initdata = { 709static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
423 &overo_lcd_device, 710 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
424}; 711 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
425 712 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
426static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
427 .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN,
428 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
429 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
430
431 .phy_reset = true, 713 .phy_reset = true,
432 .reset_gpio_port[0] = -EINVAL, 714 .reset_gpio_port[0] = -EINVAL,
433 .reset_gpio_port[1] = OVERO_GPIO_USBH_NRESET, 715 .reset_gpio_port[1] = OVERO_GPIO_USBH_NRESET,
@@ -450,13 +732,17 @@ static void __init overo_init(void)
450{ 732{
451 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 733 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
452 overo_i2c_init(); 734 overo_i2c_init();
453 platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices)); 735 omap_display_init(&overo_dss_data);
454 omap_serial_init(); 736 omap_serial_init();
455 overo_flash_init(); 737 overo_flash_init();
456 usb_musb_init(&musb_board_data); 738 usb_musb_init(&musb_board_data);
457 usb_ehci_init(&ehci_pdata); 739 usbhs_init(&usbhs_bdata);
740 overo_spi_init();
458 overo_ads7846_init(); 741 overo_ads7846_init();
459 overo_init_smsc911x(); 742 overo_init_smsc911x();
743 overo_display_init();
744 overo_init_led();
745 overo_init_keys();
460 746
461 /* Ensure SDRC pins are mux'd for self-refresh */ 747 /* Ensure SDRC pins are mux'd for self-refresh */
462 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); 748 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
@@ -501,9 +787,10 @@ static void __init overo_init(void)
501 787
502MACHINE_START(OVERO, "Gumstix Overo") 788MACHINE_START(OVERO, "Gumstix Overo")
503 .boot_params = 0x80000100, 789 .boot_params = 0x80000100,
504 .map_io = omap3_map_io,
505 .reserve = omap_reserve, 790 .reserve = omap_reserve,
506 .init_irq = overo_init_irq, 791 .map_io = omap3_map_io,
792 .init_early = overo_init_early,
793 .init_irq = omap_init_irq,
507 .init_machine = overo_init, 794 .init_machine = overo_init,
508 .timer = &omap_timer, 795 .timer = &omap_timer,
509MACHINE_END 796MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c
index cb77be7ac44f..2af8b05e786d 100644
--- a/arch/arm/mach-omap2/board-rm680.c
+++ b/arch/arm/mach-omap2/board-rm680.c
@@ -33,16 +33,13 @@
33#include "sdram-nokia.h" 33#include "sdram-nokia.h"
34 34
35static struct regulator_consumer_supply rm680_vemmc_consumers[] = { 35static struct regulator_consumer_supply rm680_vemmc_consumers[] = {
36 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"), 36 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
37}; 37};
38 38
39/* Fixed regulator for internal eMMC */ 39/* Fixed regulator for internal eMMC */
40static struct regulator_init_data rm680_vemmc = { 40static struct regulator_init_data rm680_vemmc = {
41 .constraints = { 41 .constraints = {
42 .name = "rm680_vemmc", 42 .name = "rm680_vemmc",
43 .min_uV = 2900000,
44 .max_uV = 2900000,
45 .apply_uV = 1,
46 .valid_modes_mask = REGULATOR_MODE_NORMAL 43 .valid_modes_mask = REGULATOR_MODE_NORMAL
47 | REGULATOR_MODE_STANDBY, 44 | REGULATOR_MODE_STANDBY,
48 .valid_ops_mask = REGULATOR_CHANGE_STATUS 45 .valid_ops_mask = REGULATOR_CHANGE_STATUS
@@ -141,14 +138,13 @@ static void __init rm680_peripherals_init(void)
141 omap2_hsmmc_init(mmc); 138 omap2_hsmmc_init(mmc);
142} 139}
143 140
144static void __init rm680_init_irq(void) 141static void __init rm680_init_early(void)
145{ 142{
146 struct omap_sdrc_params *sdrc_params; 143 struct omap_sdrc_params *sdrc_params;
147 144
148 omap2_init_common_infrastructure(); 145 omap2_init_common_infrastructure();
149 sdrc_params = nokia_get_sdram_timings(); 146 sdrc_params = nokia_get_sdram_timings();
150 omap2_init_common_devices(sdrc_params, sdrc_params); 147 omap2_init_common_devices(sdrc_params, sdrc_params);
151 omap_init_irq();
152} 148}
153 149
154#ifdef CONFIG_OMAP_MUX 150#ifdef CONFIG_OMAP_MUX
@@ -179,9 +175,10 @@ static void __init rm680_map_io(void)
179 175
180MACHINE_START(NOKIA_RM680, "Nokia RM-680 board") 176MACHINE_START(NOKIA_RM680, "Nokia RM-680 board")
181 .boot_params = 0x80000100, 177 .boot_params = 0x80000100,
182 .map_io = rm680_map_io,
183 .reserve = omap_reserve, 178 .reserve = omap_reserve,
184 .init_irq = rm680_init_irq, 179 .map_io = rm680_map_io,
180 .init_early = rm680_init_early,
181 .init_irq = omap_init_irq,
185 .init_machine = rm680_init, 182 .init_machine = rm680_init,
186 .timer = &omap_timer, 183 .timer = &omap_timer,
187MACHINE_END 184MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index e75e240cad67..bbcb6775a6a3 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -36,6 +36,8 @@
36 36
37#include <sound/tlv320aic3x.h> 37#include <sound/tlv320aic3x.h>
38#include <sound/tpa6130a2-plat.h> 38#include <sound/tpa6130a2-plat.h>
39#include <media/radio-si4713.h>
40#include <media/si4713.h>
39 41
40#include <../drivers/staging/iio/light/tsl2563.h> 42#include <../drivers/staging/iio/light/tsl2563.h>
41 43
@@ -47,6 +49,8 @@
47 49
48#define RX51_WL1251_POWER_GPIO 87 50#define RX51_WL1251_POWER_GPIO 87
49#define RX51_WL1251_IRQ_GPIO 42 51#define RX51_WL1251_IRQ_GPIO 42
52#define RX51_FMTX_RESET_GPIO 163
53#define RX51_FMTX_IRQ 53
50 54
51/* list all spi devices here */ 55/* list all spi devices here */
52enum { 56enum {
@@ -331,13 +335,13 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
331}; 335};
332 336
333static struct regulator_consumer_supply rx51_vmmc1_supply = 337static struct regulator_consumer_supply rx51_vmmc1_supply =
334 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); 338 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0");
335 339
336static struct regulator_consumer_supply rx51_vaux3_supply = 340static struct regulator_consumer_supply rx51_vaux3_supply =
337 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); 341 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1");
338 342
339static struct regulator_consumer_supply rx51_vsim_supply = 343static struct regulator_consumer_supply rx51_vsim_supply =
340 REGULATOR_SUPPLY("vmmc_aux", "mmci-omap-hs.1"); 344 REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1");
341 345
342static struct regulator_consumer_supply rx51_vmmc2_supplies[] = { 346static struct regulator_consumer_supply rx51_vmmc2_supplies[] = {
343 /* tlv320aic3x analog supplies */ 347 /* tlv320aic3x analog supplies */
@@ -348,7 +352,7 @@ static struct regulator_consumer_supply rx51_vmmc2_supplies[] = {
348 /* tpa6130a2 */ 352 /* tpa6130a2 */
349 REGULATOR_SUPPLY("Vdd", "2-0060"), 353 REGULATOR_SUPPLY("Vdd", "2-0060"),
350 /* Keep vmmc as last item. It is not iterated for newer boards */ 354 /* Keep vmmc as last item. It is not iterated for newer boards */
351 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"), 355 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
352}; 356};
353 357
354static struct regulator_consumer_supply rx51_vio_supplies[] = { 358static struct regulator_consumer_supply rx51_vio_supplies[] = {
@@ -357,14 +361,18 @@ static struct regulator_consumer_supply rx51_vio_supplies[] = {
357 REGULATOR_SUPPLY("DVDD", "2-0018"), 361 REGULATOR_SUPPLY("DVDD", "2-0018"),
358 REGULATOR_SUPPLY("IOVDD", "2-0019"), 362 REGULATOR_SUPPLY("IOVDD", "2-0019"),
359 REGULATOR_SUPPLY("DVDD", "2-0019"), 363 REGULATOR_SUPPLY("DVDD", "2-0019"),
364 /* Si4713 IO supply */
365 REGULATOR_SUPPLY("vio", "2-0063"),
360}; 366};
361 367
362static struct regulator_consumer_supply rx51_vaux1_consumers[] = { 368static struct regulator_consumer_supply rx51_vaux1_consumers[] = {
363 REGULATOR_SUPPLY("vdds_sdi", "omapdss"), 369 REGULATOR_SUPPLY("vdds_sdi", "omapdss"),
370 /* Si4713 supply */
371 REGULATOR_SUPPLY("vdd", "2-0063"),
364}; 372};
365 373
366static struct regulator_consumer_supply rx51_vdac_supply[] = { 374static struct regulator_consumer_supply rx51_vdac_supply[] = {
367 REGULATOR_SUPPLY("vdda_dac", "omapdss"), 375 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
368}; 376};
369 377
370static struct regulator_init_data rx51_vaux1 = { 378static struct regulator_init_data rx51_vaux1 = {
@@ -511,6 +519,41 @@ static struct regulator_init_data rx51_vio = {
511 .consumer_supplies = rx51_vio_supplies, 519 .consumer_supplies = rx51_vio_supplies,
512}; 520};
513 521
522static struct si4713_platform_data rx51_si4713_i2c_data __initdata_or_module = {
523 .gpio_reset = RX51_FMTX_RESET_GPIO,
524};
525
526static struct i2c_board_info rx51_si4713_board_info __initdata_or_module = {
527 I2C_BOARD_INFO("si4713", SI4713_I2C_ADDR_BUSEN_HIGH),
528 .platform_data = &rx51_si4713_i2c_data,
529};
530
531static struct radio_si4713_platform_data rx51_si4713_data __initdata_or_module = {
532 .i2c_bus = 2,
533 .subdev_board_info = &rx51_si4713_board_info,
534};
535
536static struct platform_device rx51_si4713_dev __initdata_or_module = {
537 .name = "radio-si4713",
538 .id = -1,
539 .dev = {
540 .platform_data = &rx51_si4713_data,
541 },
542};
543
544static __init void rx51_init_si4713(void)
545{
546 int err;
547
548 err = gpio_request_one(RX51_FMTX_IRQ, GPIOF_DIR_IN, "si4713 irq");
549 if (err) {
550 printk(KERN_ERR "Cannot request si4713 irq gpio. %d\n", err);
551 return;
552 }
553 rx51_si4713_board_info.irq = gpio_to_irq(RX51_FMTX_IRQ);
554 platform_device_register(&rx51_si4713_dev);
555}
556
514static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n) 557static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n)
515{ 558{
516 /* FIXME this gpio setup is just a placeholder for now */ 559 /* FIXME this gpio setup is just a placeholder for now */
@@ -699,6 +742,14 @@ static struct twl4030_power_data rx51_t2scripts_data __initdata = {
699 .resource_config = twl4030_rconfig, 742 .resource_config = twl4030_rconfig,
700}; 743};
701 744
745struct twl4030_codec_vibra_data rx51_vibra_data __initdata = {
746 .coexist = 0,
747};
748
749struct twl4030_codec_data rx51_codec_data __initdata = {
750 .audio_mclk = 26000000,
751 .vibra = &rx51_vibra_data,
752};
702 753
703static struct twl4030_platform_data rx51_twldata __initdata = { 754static struct twl4030_platform_data rx51_twldata __initdata = {
704 .irq_base = TWL4030_IRQ_BASE, 755 .irq_base = TWL4030_IRQ_BASE,
@@ -710,6 +761,7 @@ static struct twl4030_platform_data rx51_twldata __initdata = {
710 .madc = &rx51_madc_data, 761 .madc = &rx51_madc_data,
711 .usb = &rx51_usb_data, 762 .usb = &rx51_usb_data,
712 .power = &rx51_t2scripts_data, 763 .power = &rx51_t2scripts_data,
764 .codec = &rx51_codec_data,
713 765
714 .vaux1 = &rx51_vaux1, 766 .vaux1 = &rx51_vaux1,
715 .vaux2 = &rx51_vaux2, 767 .vaux2 = &rx51_vaux2,
@@ -921,6 +973,7 @@ void __init rx51_peripherals_init(void)
921 board_smc91x_init(); 973 board_smc91x_init();
922 rx51_add_gpio_keys(); 974 rx51_add_gpio_keys();
923 rx51_init_wl1251(); 975 rx51_init_wl1251();
976 rx51_init_si4713();
924 spi_register_board_info(rx51_peripherals_spi_board_info, 977 spi_register_board_info(rx51_peripherals_spi_board_info,
925 ARRAY_SIZE(rx51_peripherals_spi_board_info)); 978 ARRAY_SIZE(rx51_peripherals_spi_board_info));
926 979
diff --git a/arch/arm/mach-omap2/board-rx51-video.c b/arch/arm/mach-omap2/board-rx51-video.c
index acd670054d9a..89a66db8b77d 100644
--- a/arch/arm/mach-omap2/board-rx51-video.c
+++ b/arch/arm/mach-omap2/board-rx51-video.c
@@ -66,18 +66,6 @@ static struct omap_dss_board_info rx51_dss_board_info = {
66 .default_device = &rx51_lcd_device, 66 .default_device = &rx51_lcd_device,
67}; 67};
68 68
69struct platform_device rx51_display_device = {
70 .name = "omapdss",
71 .id = -1,
72 .dev = {
73 .platform_data = &rx51_dss_board_info,
74 },
75};
76
77static struct platform_device *rx51_video_devices[] __initdata = {
78 &rx51_display_device,
79};
80
81static int __init rx51_video_init(void) 69static int __init rx51_video_init(void)
82{ 70{
83 if (!machine_is_nokia_rx51()) 71 if (!machine_is_nokia_rx51())
@@ -95,8 +83,7 @@ static int __init rx51_video_init(void)
95 83
96 gpio_direction_output(RX51_LCD_RESET_GPIO, 1); 84 gpio_direction_output(RX51_LCD_RESET_GPIO, 1);
97 85
98 platform_add_devices(rx51_video_devices, 86 omap_display_init(&rx51_dss_board_info);
99 ARRAY_SIZE(rx51_video_devices));
100 return 0; 87 return 0;
101} 88}
102 89
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index f53fc551c58f..e964895b80e8 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -98,17 +98,13 @@ static struct omap_board_config_kernel rx51_config[] = {
98 { OMAP_TAG_LCD, &rx51_lcd_config }, 98 { OMAP_TAG_LCD, &rx51_lcd_config },
99}; 99};
100 100
101static void __init rx51_init_irq(void) 101static void __init rx51_init_early(void)
102{ 102{
103 struct omap_sdrc_params *sdrc_params; 103 struct omap_sdrc_params *sdrc_params;
104 104
105 omap_board_config = rx51_config;
106 omap_board_config_size = ARRAY_SIZE(rx51_config);
107 omap3_pm_init_cpuidle(rx51_cpuidle_params);
108 omap2_init_common_infrastructure(); 105 omap2_init_common_infrastructure();
109 sdrc_params = nokia_get_sdram_timings(); 106 sdrc_params = nokia_get_sdram_timings();
110 omap2_init_common_devices(sdrc_params, sdrc_params); 107 omap2_init_common_devices(sdrc_params, sdrc_params);
111 omap_init_irq();
112} 108}
113 109
114extern void __init rx51_peripherals_init(void); 110extern void __init rx51_peripherals_init(void);
@@ -128,6 +124,9 @@ static struct omap_musb_board_data musb_board_data = {
128static void __init rx51_init(void) 124static void __init rx51_init(void)
129{ 125{
130 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 126 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
127 omap_board_config = rx51_config;
128 omap_board_config_size = ARRAY_SIZE(rx51_config);
129 omap3_pm_init_cpuidle(rx51_cpuidle_params);
131 omap_serial_init(); 130 omap_serial_init();
132 usb_musb_init(&musb_board_data); 131 usb_musb_init(&musb_board_data);
133 rx51_peripherals_init(); 132 rx51_peripherals_init();
@@ -149,9 +148,10 @@ static void __init rx51_map_io(void)
149MACHINE_START(NOKIA_RX51, "Nokia RX-51 board") 148MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
150 /* Maintainer: Lauri Leukkunen <lauri.leukkunen@nokia.com> */ 149 /* Maintainer: Lauri Leukkunen <lauri.leukkunen@nokia.com> */
151 .boot_params = 0x80000100, 150 .boot_params = 0x80000100,
152 .map_io = rx51_map_io,
153 .reserve = omap_reserve, 151 .reserve = omap_reserve,
154 .init_irq = rx51_init_irq, 152 .map_io = rx51_map_io,
153 .init_early = rx51_init_early,
154 .init_irq = omap_init_irq,
155 .init_machine = rx51_init, 155 .init_machine = rx51_init,
156 .timer = &omap_timer, 156 .timer = &omap_timer,
157MACHINE_END 157MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c
new file mode 100644
index 000000000000..09fa7bfff8d6
--- /dev/null
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -0,0 +1,62 @@
1/*
2 * Code for TI8168 EVM.
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15#include <linux/kernel.h>
16#include <linux/init.h>
17
18#include <mach/hardware.h>
19#include <asm/mach-types.h>
20#include <asm/mach/arch.h>
21#include <asm/mach/map.h>
22
23#include <plat/irqs.h>
24#include <plat/board.h>
25#include <plat/common.h>
26
27static struct omap_board_config_kernel ti8168_evm_config[] __initdata = {
28};
29
30static void __init ti8168_init_early(void)
31{
32 omap2_init_common_infrastructure();
33 omap2_init_common_devices(NULL, NULL);
34}
35
36static void __init ti8168_evm_init_irq(void)
37{
38 omap_init_irq();
39}
40
41static void __init ti8168_evm_init(void)
42{
43 omap_serial_init();
44 omap_board_config = ti8168_evm_config;
45 omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
46}
47
48static void __init ti8168_evm_map_io(void)
49{
50 omap2_set_globals_ti816x();
51 omapti816x_map_common_io();
52}
53
54MACHINE_START(TI8168EVM, "ti8168evm")
55 /* Maintainer: Texas Instruments */
56 .boot_params = 0x80000100,
57 .map_io = ti8168_evm_map_io,
58 .init_early = ti8168_init_early,
59 .init_irq = ti8168_evm_init_irq,
60 .timer = &omap_timer,
61 .init_machine = ti8168_evm_init,
62MACHINE_END
diff --git a/arch/arm/mach-omap2/board-zoom-display.c b/arch/arm/mach-omap2/board-zoom-display.c
index 6bcd43657aed..37b84c2b850f 100644
--- a/arch/arm/mach-omap2/board-zoom-display.c
+++ b/arch/arm/mach-omap2/board-zoom-display.c
@@ -130,14 +130,6 @@ static struct omap_dss_board_info zoom_dss_data = {
130 .default_device = &zoom_lcd_device, 130 .default_device = &zoom_lcd_device,
131}; 131};
132 132
133static struct platform_device zoom_dss_device = {
134 .name = "omapdss",
135 .id = -1,
136 .dev = {
137 .platform_data = &zoom_dss_data,
138 },
139};
140
141static struct omap2_mcspi_device_config dss_lcd_mcspi_config = { 133static struct omap2_mcspi_device_config dss_lcd_mcspi_config = {
142 .turbo_mode = 1, 134 .turbo_mode = 1,
143 .single_channel = 1, /* 0: slave, 1: master */ 135 .single_channel = 1, /* 0: slave, 1: master */
@@ -153,14 +145,9 @@ static struct spi_board_info nec_8048_spi_board_info[] __initdata = {
153 }, 145 },
154}; 146};
155 147
156static struct platform_device *zoom_display_devices[] __initdata = {
157 &zoom_dss_device,
158};
159
160void __init zoom_display_init(void) 148void __init zoom_display_init(void)
161{ 149{
162 platform_add_devices(zoom_display_devices, 150 omap_display_init(&zoom_dss_data);
163 ARRAY_SIZE(zoom_display_devices));
164 spi_register_board_info(nec_8048_spi_board_info, 151 spi_register_board_info(nec_8048_spi_board_info,
165 ARRAY_SIZE(nec_8048_spi_board_info)); 152 ARRAY_SIZE(nec_8048_spi_board_info));
166 zoom_lcd_panel_init(); 153 zoom_lcd_panel_init();
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
index e0e040f34c68..8dee7549fbdf 100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -118,7 +118,7 @@ static struct regulator_consumer_supply zoom_vmmc2_supply = {
118 118
119static struct regulator_consumer_supply zoom_vmmc3_supply = { 119static struct regulator_consumer_supply zoom_vmmc3_supply = {
120 .supply = "vmmc", 120 .supply = "vmmc",
121 .dev_name = "mmci-omap-hs.2", 121 .dev_name = "omap_hsmmc.2",
122}; 122};
123 123
124/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ 124/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
@@ -226,11 +226,13 @@ static struct omap2_hsmmc_info mmc[] = {
226 {} /* Terminator */ 226 {} /* Terminator */
227}; 227};
228 228
229static struct regulator_consumer_supply zoom_vpll2_supply = 229static struct regulator_consumer_supply zoom_vpll2_supplies[] = {
230 REGULATOR_SUPPLY("vdds_dsi", "omapdss"); 230 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
231 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"),
232};
231 233
232static struct regulator_consumer_supply zoom_vdda_dac_supply = 234static struct regulator_consumer_supply zoom_vdda_dac_supply =
233 REGULATOR_SUPPLY("vdda_dac", "omapdss"); 235 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc");
234 236
235static struct regulator_init_data zoom_vpll2 = { 237static struct regulator_init_data zoom_vpll2 = {
236 .constraints = { 238 .constraints = {
@@ -241,8 +243,8 @@ static struct regulator_init_data zoom_vpll2 = {
241 .valid_ops_mask = REGULATOR_CHANGE_MODE 243 .valid_ops_mask = REGULATOR_CHANGE_MODE
242 | REGULATOR_CHANGE_STATUS, 244 | REGULATOR_CHANGE_STATUS,
243 }, 245 },
244 .num_consumer_supplies = 1, 246 .num_consumer_supplies = ARRAY_SIZE(zoom_vpll2_supplies),
245 .consumer_supplies = &zoom_vpll2_supply, 247 .consumer_supplies = zoom_vpll2_supplies,
246}; 248};
247 249
248static struct regulator_init_data zoom_vdac = { 250static struct regulator_init_data zoom_vdac = {
@@ -322,9 +324,7 @@ static struct twl4030_madc_platform_data zoom_madc_data = {
322 .irq_line = 1, 324 .irq_line = 1,
323}; 325};
324 326
325static struct twl4030_codec_audio_data zoom_audio_data = { 327static struct twl4030_codec_audio_data zoom_audio_data;
326 .audio_mclk = 26000000,
327};
328 328
329static struct twl4030_codec_data zoom_codec_data = { 329static struct twl4030_codec_data zoom_codec_data = {
330 .audio_mclk = 26000000, 330 .audio_mclk = 26000000,
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
index e26754c24ee8..4b133d75c935 100644
--- a/arch/arm/mach-omap2/board-zoom.c
+++ b/arch/arm/mach-omap2/board-zoom.c
@@ -16,6 +16,7 @@
16#include <linux/input.h> 16#include <linux/input.h>
17#include <linux/gpio.h> 17#include <linux/gpio.h>
18#include <linux/i2c/twl.h> 18#include <linux/i2c/twl.h>
19#include <linux/mtd/nand.h>
19 20
20#include <asm/mach-types.h> 21#include <asm/mach-types.h>
21#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
@@ -33,7 +34,7 @@
33 34
34#define ZOOM3_EHCI_RESET_GPIO 64 35#define ZOOM3_EHCI_RESET_GPIO 64
35 36
36static void __init omap_zoom_init_irq(void) 37static void __init omap_zoom_init_early(void)
37{ 38{
38 omap2_init_common_infrastructure(); 39 omap2_init_common_infrastructure();
39 if (machine_is_omap_zoom2()) 40 if (machine_is_omap_zoom2())
@@ -42,14 +43,12 @@ static void __init omap_zoom_init_irq(void)
42 else if (machine_is_omap_zoom3()) 43 else if (machine_is_omap_zoom3())
43 omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params, 44 omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params,
44 h8mbx00u0mer0em_sdrc_params); 45 h8mbx00u0mer0em_sdrc_params);
45
46 omap_init_irq();
47} 46}
48 47
49#ifdef CONFIG_OMAP_MUX 48#ifdef CONFIG_OMAP_MUX
50static struct omap_board_mux board_mux[] __initdata = { 49static struct omap_board_mux board_mux[] __initdata = {
51 /* WLAN IRQ - GPIO 162 */ 50 /* WLAN IRQ - GPIO 162 */
52 OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP), 51 OMAP3_MUX(MCBSP1_CLKX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
53 /* WLAN POWER ENABLE - GPIO 101 */ 52 /* WLAN POWER ENABLE - GPIO 101 */
54 OMAP3_MUX(CAM_D2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), 53 OMAP3_MUX(CAM_D2, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
55 /* WLAN SDIO: MMC3 CMD */ 54 /* WLAN SDIO: MMC3 CMD */
@@ -106,10 +105,10 @@ static struct mtd_partition zoom_nand_partitions[] = {
106 }, 105 },
107}; 106};
108 107
109static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { 108static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
110 .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN, 109 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
111 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, 110 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
112 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, 111 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
113 .phy_reset = true, 112 .phy_reset = true,
114 .reset_gpio_port[0] = -EINVAL, 113 .reset_gpio_port[0] = -EINVAL,
115 .reset_gpio_port[1] = ZOOM3_EHCI_RESET_GPIO, 114 .reset_gpio_port[1] = ZOOM3_EHCI_RESET_GPIO,
@@ -123,11 +122,11 @@ static void __init omap_zoom_init(void)
123 } else if (machine_is_omap_zoom3()) { 122 } else if (machine_is_omap_zoom3()) {
124 omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); 123 omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
125 omap_mux_init_gpio(ZOOM3_EHCI_RESET_GPIO, OMAP_PIN_OUTPUT); 124 omap_mux_init_gpio(ZOOM3_EHCI_RESET_GPIO, OMAP_PIN_OUTPUT);
126 usb_ehci_init(&ehci_pdata); 125 usbhs_init(&usbhs_bdata);
127 } 126 }
128 127
129 board_nand_init(zoom_nand_partitions, 128 board_nand_init(zoom_nand_partitions, ARRAY_SIZE(zoom_nand_partitions),
130 ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS); 129 ZOOM_NAND_CS, NAND_BUSWIDTH_16);
131 zoom_debugboard_init(); 130 zoom_debugboard_init();
132 zoom_peripherals_init(); 131 zoom_peripherals_init();
133 zoom_display_init(); 132 zoom_display_init();
@@ -135,18 +134,20 @@ static void __init omap_zoom_init(void)
135 134
136MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board") 135MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
137 .boot_params = 0x80000100, 136 .boot_params = 0x80000100,
138 .map_io = omap3_map_io,
139 .reserve = omap_reserve, 137 .reserve = omap_reserve,
140 .init_irq = omap_zoom_init_irq, 138 .map_io = omap3_map_io,
139 .init_early = omap_zoom_init_early,
140 .init_irq = omap_init_irq,
141 .init_machine = omap_zoom_init, 141 .init_machine = omap_zoom_init,
142 .timer = &omap_timer, 142 .timer = &omap_timer,
143MACHINE_END 143MACHINE_END
144 144
145MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board") 145MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
146 .boot_params = 0x80000100, 146 .boot_params = 0x80000100,
147 .map_io = omap3_map_io,
148 .reserve = omap_reserve, 147 .reserve = omap_reserve,
149 .init_irq = omap_zoom_init_irq, 148 .map_io = omap3_map_io,
149 .init_early = omap_zoom_init_early,
150 .init_irq = omap_init_irq,
150 .init_machine = omap_zoom_init, 151 .init_machine = omap_zoom_init,
151 .timer = &omap_timer, 152 .timer = &omap_timer,
152MACHINE_END 153MACHINE_END
diff --git a/arch/arm/mach-omap2/clkt2xxx_apll.c b/arch/arm/mach-omap2/clkt2xxx_apll.c
index f51cffd1fc53..b19a1f7234ae 100644
--- a/arch/arm/mach-omap2/clkt2xxx_apll.c
+++ b/arch/arm/mach-omap2/clkt2xxx_apll.c
@@ -78,6 +78,26 @@ static int omap2_clk_apll54_enable(struct clk *clk)
78 return omap2_clk_apll_enable(clk, OMAP24XX_ST_54M_APLL_MASK); 78 return omap2_clk_apll_enable(clk, OMAP24XX_ST_54M_APLL_MASK);
79} 79}
80 80
81static void _apll96_allow_idle(struct clk *clk)
82{
83 omap2xxx_cm_set_apll96_auto_low_power_stop();
84}
85
86static void _apll96_deny_idle(struct clk *clk)
87{
88 omap2xxx_cm_set_apll96_disable_autoidle();
89}
90
91static void _apll54_allow_idle(struct clk *clk)
92{
93 omap2xxx_cm_set_apll54_auto_low_power_stop();
94}
95
96static void _apll54_deny_idle(struct clk *clk)
97{
98 omap2xxx_cm_set_apll54_disable_autoidle();
99}
100
81/* Stop APLL */ 101/* Stop APLL */
82static void omap2_clk_apll_disable(struct clk *clk) 102static void omap2_clk_apll_disable(struct clk *clk)
83{ 103{
@@ -93,11 +113,15 @@ static void omap2_clk_apll_disable(struct clk *clk)
93const struct clkops clkops_apll96 = { 113const struct clkops clkops_apll96 = {
94 .enable = omap2_clk_apll96_enable, 114 .enable = omap2_clk_apll96_enable,
95 .disable = omap2_clk_apll_disable, 115 .disable = omap2_clk_apll_disable,
116 .allow_idle = _apll96_allow_idle,
117 .deny_idle = _apll96_deny_idle,
96}; 118};
97 119
98const struct clkops clkops_apll54 = { 120const struct clkops clkops_apll54 = {
99 .enable = omap2_clk_apll54_enable, 121 .enable = omap2_clk_apll54_enable,
100 .disable = omap2_clk_apll_disable, 122 .disable = omap2_clk_apll_disable,
123 .allow_idle = _apll54_allow_idle,
124 .deny_idle = _apll54_deny_idle,
101}; 125};
102 126
103/* Public functions */ 127/* Public functions */
diff --git a/arch/arm/mach-omap2/clkt2xxx_dpll.c b/arch/arm/mach-omap2/clkt2xxx_dpll.c
new file mode 100644
index 000000000000..1502a7bc20bb
--- /dev/null
+++ b/arch/arm/mach-omap2/clkt2xxx_dpll.c
@@ -0,0 +1,63 @@
1/*
2 * OMAP2-specific DPLL control functions
3 *
4 * Copyright (C) 2011 Nokia Corporation
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/errno.h>
14#include <linux/clk.h>
15#include <linux/io.h>
16
17#include <plat/clock.h>
18
19#include "clock.h"
20#include "cm2xxx_3xxx.h"
21#include "cm-regbits-24xx.h"
22
23/* Private functions */
24
25/**
26 * _allow_idle - enable DPLL autoidle bits
27 * @clk: struct clk * of the DPLL to operate on
28 *
29 * Enable DPLL automatic idle control. The DPLL will enter low-power
30 * stop when its downstream clocks are gated. No return value.
31 * REVISIT: DPLL can optionally enter low-power bypass by writing 0x1
32 * instead. Add some mechanism to optionally enter this mode.
33 */
34static void _allow_idle(struct clk *clk)
35{
36 if (!clk || !clk->dpll_data)
37 return;
38
39 omap2xxx_cm_set_dpll_auto_low_power_stop();
40}
41
42/**
43 * _deny_idle - prevent DPLL from automatically idling
44 * @clk: struct clk * of the DPLL to operate on
45 *
46 * Disable DPLL automatic idle control. No return value.
47 */
48static void _deny_idle(struct clk *clk)
49{
50 if (!clk || !clk->dpll_data)
51 return;
52
53 omap2xxx_cm_set_dpll_disable_autoidle();
54}
55
56
57/* Public data */
58
59const struct clkops clkops_omap2xxx_dpll_ops = {
60 .allow_idle = _allow_idle,
61 .deny_idle = _deny_idle,
62};
63
diff --git a/arch/arm/mach-omap2/clkt2xxx_osc.c b/arch/arm/mach-omap2/clkt2xxx_osc.c
index df7b80506483..c3460928b5e0 100644
--- a/arch/arm/mach-omap2/clkt2xxx_osc.c
+++ b/arch/arm/mach-omap2/clkt2xxx_osc.c
@@ -30,6 +30,13 @@
30#include "prm2xxx_3xxx.h" 30#include "prm2xxx_3xxx.h"
31#include "prm-regbits-24xx.h" 31#include "prm-regbits-24xx.h"
32 32
33/*
34 * XXX This does not actually enable the osc_ck, since the osc_ck must
35 * be running for this function to be called. Instead, this function
36 * is used to disable an autoidle mode on the osc_ck. The existing
37 * clk_enable/clk_disable()-based usecounting for osc_ck should be
38 * replaced with autoidle-based usecounting.
39 */
33static int omap2_enable_osc_ck(struct clk *clk) 40static int omap2_enable_osc_ck(struct clk *clk)
34{ 41{
35 u32 pcc; 42 u32 pcc;
@@ -41,6 +48,13 @@ static int omap2_enable_osc_ck(struct clk *clk)
41 return 0; 48 return 0;
42} 49}
43 50
51/*
52 * XXX This does not actually disable the osc_ck, since doing so would
53 * immediately halt the system. Instead, this function is used to
54 * enable an autoidle mode on the osc_ck. The existing
55 * clk_enable/clk_disable()-based usecounting for osc_ck should be
56 * replaced with autoidle-based usecounting.
57 */
44static void omap2_disable_osc_ck(struct clk *clk) 58static void omap2_disable_osc_ck(struct clk *clk)
45{ 59{
46 u32 pcc; 60 u32 pcc;
diff --git a/arch/arm/mach-omap2/clkt_clksel.c b/arch/arm/mach-omap2/clkt_clksel.c
index a781cd6795a4..e25364de028a 100644
--- a/arch/arm/mach-omap2/clkt_clksel.c
+++ b/arch/arm/mach-omap2/clkt_clksel.c
@@ -97,7 +97,7 @@ static u8 _get_div_and_fieldval(struct clk *src_clk, struct clk *clk,
97 u32 *field_val) 97 u32 *field_val)
98{ 98{
99 const struct clksel *clks; 99 const struct clksel *clks;
100 const struct clksel_rate *clkr, *max_clkr; 100 const struct clksel_rate *clkr, *max_clkr = NULL;
101 u8 max_div = 0; 101 u8 max_div = 0;
102 102
103 clks = _get_clksel_by_parent(clk, src_clk); 103 clks = _get_clksel_by_parent(clk, src_clk);
diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c
index 337392c3f549..bcffee001bfa 100644
--- a/arch/arm/mach-omap2/clkt_dpll.c
+++ b/arch/arm/mach-omap2/clkt_dpll.c
@@ -77,7 +77,7 @@ static int _dpll_test_fint(struct clk *clk, u8 n)
77 dd = clk->dpll_data; 77 dd = clk->dpll_data;
78 78
79 /* DPLL divider must result in a valid jitter correction val */ 79 /* DPLL divider must result in a valid jitter correction val */
80 fint = clk->parent->rate / (n + 1); 80 fint = clk->parent->rate / n;
81 if (fint < DPLL_FINT_BAND1_MIN) { 81 if (fint < DPLL_FINT_BAND1_MIN) {
82 82
83 pr_debug("rejecting n=%d due to Fint failure, " 83 pr_debug("rejecting n=%d due to Fint failure, "
@@ -178,12 +178,11 @@ void omap2_init_dpll_parent(struct clk *clk)
178 if (!dd) 178 if (!dd)
179 return; 179 return;
180 180
181 /* Return bypass rate if DPLL is bypassed */
182 v = __raw_readl(dd->control_reg); 181 v = __raw_readl(dd->control_reg);
183 v &= dd->enable_mask; 182 v &= dd->enable_mask;
184 v >>= __ffs(dd->enable_mask); 183 v >>= __ffs(dd->enable_mask);
185 184
186 /* Reparent in case the dpll is in bypass */ 185 /* Reparent the struct clk in case the dpll is in bypass */
187 if (cpu_is_omap24xx()) { 186 if (cpu_is_omap24xx()) {
188 if (v == OMAP2XXX_EN_DPLL_LPBYPASS || 187 if (v == OMAP2XXX_EN_DPLL_LPBYPASS ||
189 v == OMAP2XXX_EN_DPLL_FRBYPASS) 188 v == OMAP2XXX_EN_DPLL_FRBYPASS)
@@ -260,50 +259,22 @@ u32 omap2_get_dpll_rate(struct clk *clk)
260/* DPLL rate rounding code */ 259/* DPLL rate rounding code */
261 260
262/** 261/**
263 * omap2_dpll_set_rate_tolerance: set the error tolerance during rate rounding
264 * @clk: struct clk * of the DPLL
265 * @tolerance: maximum rate error tolerance
266 *
267 * Set the maximum DPLL rate error tolerance for the rate rounding
268 * algorithm. The rate tolerance is an attempt to balance DPLL power
269 * saving (the least divider value "n") vs. rate fidelity (the least
270 * difference between the desired DPLL target rate and the rounded
271 * rate out of the algorithm). So, increasing the tolerance is likely
272 * to decrease DPLL power consumption and increase DPLL rate error.
273 * Returns -EINVAL if provided a null clock ptr or a clk that is not a
274 * DPLL; or 0 upon success.
275 */
276int omap2_dpll_set_rate_tolerance(struct clk *clk, unsigned int tolerance)
277{
278 if (!clk || !clk->dpll_data)
279 return -EINVAL;
280
281 clk->dpll_data->rate_tolerance = tolerance;
282
283 return 0;
284}
285
286/**
287 * omap2_dpll_round_rate - round a target rate for an OMAP DPLL 262 * omap2_dpll_round_rate - round a target rate for an OMAP DPLL
288 * @clk: struct clk * for a DPLL 263 * @clk: struct clk * for a DPLL
289 * @target_rate: desired DPLL clock rate 264 * @target_rate: desired DPLL clock rate
290 * 265 *
291 * Given a DPLL, a desired target rate, and a rate tolerance, round 266 * Given a DPLL and a desired target rate, round the target rate to a
292 * the target rate to a possible, programmable rate for this DPLL. 267 * possible, programmable rate for this DPLL. Attempts to select the
293 * Rate tolerance is assumed to be set by the caller before this 268 * minimum possible n. Stores the computed (m, n) in the DPLL's
294 * function is called. Attempts to select the minimum possible n 269 * dpll_data structure so set_rate() will not need to call this
295 * within the tolerance to reduce power consumption. Stores the 270 * (expensive) function again. Returns ~0 if the target rate cannot
296 * computed (m, n) in the DPLL's dpll_data structure so set_rate() 271 * be rounded, or the rounded rate upon success.
297 * will not need to call this (expensive) function again. Returns ~0
298 * if the target rate cannot be rounded, either because the rate is
299 * too low or because the rate tolerance is set too tightly; or the
300 * rounded rate upon success.
301 */ 272 */
302long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate) 273long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate)
303{ 274{
304 int m, n, r, e, scaled_max_m; 275 int m, n, r, scaled_max_m;
305 unsigned long scaled_rt_rp, new_rate; 276 unsigned long scaled_rt_rp;
306 int min_e = -1, min_e_m = -1, min_e_n = -1; 277 unsigned long new_rate = 0;
307 struct dpll_data *dd; 278 struct dpll_data *dd;
308 279
309 if (!clk || !clk->dpll_data) 280 if (!clk || !clk->dpll_data)
@@ -311,8 +282,8 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate)
311 282
312 dd = clk->dpll_data; 283 dd = clk->dpll_data;
313 284
314 pr_debug("clock: starting DPLL round_rate for clock %s, target rate " 285 pr_debug("clock: %s: starting DPLL round_rate, target rate %ld\n",
315 "%ld\n", clk->name, target_rate); 286 clk->name, target_rate);
316 287
317 scaled_rt_rp = target_rate / (dd->clk_ref->rate / DPLL_SCALE_FACTOR); 288 scaled_rt_rp = target_rate / (dd->clk_ref->rate / DPLL_SCALE_FACTOR);
318 scaled_max_m = dd->max_multiplier * DPLL_SCALE_FACTOR; 289 scaled_max_m = dd->max_multiplier * DPLL_SCALE_FACTOR;
@@ -347,39 +318,23 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate)
347 if (r == DPLL_MULT_UNDERFLOW) 318 if (r == DPLL_MULT_UNDERFLOW)
348 continue; 319 continue;
349 320
350 e = target_rate - new_rate; 321 pr_debug("clock: %s: m = %d: n = %d: new_rate = %ld\n",
351 pr_debug("clock: n = %d: m = %d: rate error is %d " 322 clk->name, m, n, new_rate);
352 "(new_rate = %ld)\n", n, m, e, new_rate);
353
354 if (min_e == -1 ||
355 min_e >= (int)(abs(e) - dd->rate_tolerance)) {
356 min_e = e;
357 min_e_m = m;
358 min_e_n = n;
359
360 pr_debug("clock: found new least error %d\n", min_e);
361 323
362 /* We found good settings -- bail out now */ 324 if (target_rate == new_rate) {
363 if (min_e <= dd->rate_tolerance) 325 dd->last_rounded_m = m;
364 break; 326 dd->last_rounded_n = n;
327 dd->last_rounded_rate = target_rate;
328 break;
365 } 329 }
366 } 330 }
367 331
368 if (min_e < 0) { 332 if (target_rate != new_rate) {
369 pr_debug("clock: error: target rate or tolerance too low\n"); 333 pr_debug("clock: %s: cannot round to rate %ld\n", clk->name,
334 target_rate);
370 return ~0; 335 return ~0;
371 } 336 }
372 337
373 dd->last_rounded_m = min_e_m; 338 return target_rate;
374 dd->last_rounded_n = min_e_n;
375 dd->last_rounded_rate = _dpll_compute_new_rate(dd->clk_ref->rate,
376 min_e_m, min_e_n);
377
378 pr_debug("clock: final least error: e = %d, m = %d, n = %d\n",
379 min_e, min_e_m, min_e_n);
380 pr_debug("clock: final rate: %ld (target rate: %ld)\n",
381 dd->last_rounded_rate, target_rate);
382
383 return dd->last_rounded_rate;
384} 339}
385 340
diff --git a/arch/arm/mach-omap2/clkt_iclk.c b/arch/arm/mach-omap2/clkt_iclk.c
new file mode 100644
index 000000000000..3d43fba2542f
--- /dev/null
+++ b/arch/arm/mach-omap2/clkt_iclk.c
@@ -0,0 +1,82 @@
1/*
2 * OMAP2/3 interface clock control
3 *
4 * Copyright (C) 2011 Nokia Corporation
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#undef DEBUG
12
13#include <linux/kernel.h>
14#include <linux/clk.h>
15#include <linux/io.h>
16
17#include <plat/clock.h>
18#include <plat/prcm.h>
19
20#include "clock.h"
21#include "clock2xxx.h"
22#include "cm2xxx_3xxx.h"
23#include "cm-regbits-24xx.h"
24
25/* Private functions */
26
27/* XXX */
28void omap2_clkt_iclk_allow_idle(struct clk *clk)
29{
30 u32 v, r;
31
32 r = ((__force u32)clk->enable_reg ^ (CM_AUTOIDLE ^ CM_ICLKEN));
33
34 v = __raw_readl((__force void __iomem *)r);
35 v |= (1 << clk->enable_bit);
36 __raw_writel(v, (__force void __iomem *)r);
37}
38
39/* XXX */
40void omap2_clkt_iclk_deny_idle(struct clk *clk)
41{
42 u32 v, r;
43
44 r = ((__force u32)clk->enable_reg ^ (CM_AUTOIDLE ^ CM_ICLKEN));
45
46 v = __raw_readl((__force void __iomem *)r);
47 v &= ~(1 << clk->enable_bit);
48 __raw_writel(v, (__force void __iomem *)r);
49}
50
51/* Public data */
52
53const struct clkops clkops_omap2_iclk_dflt_wait = {
54 .enable = omap2_dflt_clk_enable,
55 .disable = omap2_dflt_clk_disable,
56 .find_companion = omap2_clk_dflt_find_companion,
57 .find_idlest = omap2_clk_dflt_find_idlest,
58 .allow_idle = omap2_clkt_iclk_allow_idle,
59 .deny_idle = omap2_clkt_iclk_deny_idle,
60};
61
62const struct clkops clkops_omap2_iclk_dflt = {
63 .enable = omap2_dflt_clk_enable,
64 .disable = omap2_dflt_clk_disable,
65 .allow_idle = omap2_clkt_iclk_allow_idle,
66 .deny_idle = omap2_clkt_iclk_deny_idle,
67};
68
69const struct clkops clkops_omap2_iclk_idle_only = {
70 .allow_idle = omap2_clkt_iclk_allow_idle,
71 .deny_idle = omap2_clkt_iclk_deny_idle,
72};
73
74const struct clkops clkops_omap2_mdmclk_dflt_wait = {
75 .enable = omap2_dflt_clk_enable,
76 .disable = omap2_dflt_clk_disable,
77 .find_companion = omap2_clk_dflt_find_companion,
78 .find_idlest = omap2_clk_dflt_find_idlest,
79 .allow_idle = omap2_clkt_iclk_allow_idle,
80 .deny_idle = omap2_clkt_iclk_deny_idle,
81};
82
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 2a2f15213add..180299e4a838 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -22,7 +22,9 @@
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/bitops.h> 24#include <linux/bitops.h>
25#include <trace/events/power.h>
25 26
27#include <asm/cpu.h>
26#include <plat/clock.h> 28#include <plat/clock.h>
27#include "clockdomain.h" 29#include "clockdomain.h"
28#include <plat/cpu.h> 30#include <plat/cpu.h>
@@ -261,10 +263,13 @@ void omap2_clk_disable(struct clk *clk)
261 263
262 pr_debug("clock: %s: disabling in hardware\n", clk->name); 264 pr_debug("clock: %s: disabling in hardware\n", clk->name);
263 265
264 clk->ops->disable(clk); 266 if (clk->ops && clk->ops->disable) {
267 trace_clock_disable(clk->name, 0, smp_processor_id());
268 clk->ops->disable(clk);
269 }
265 270
266 if (clk->clkdm) 271 if (clk->clkdm)
267 omap2_clkdm_clk_disable(clk->clkdm, clk); 272 clkdm_clk_disable(clk->clkdm, clk);
268 273
269 if (clk->parent) 274 if (clk->parent)
270 omap2_clk_disable(clk->parent); 275 omap2_clk_disable(clk->parent);
@@ -304,7 +309,7 @@ int omap2_clk_enable(struct clk *clk)
304 } 309 }
305 310
306 if (clk->clkdm) { 311 if (clk->clkdm) {
307 ret = omap2_clkdm_clk_enable(clk->clkdm, clk); 312 ret = clkdm_clk_enable(clk->clkdm, clk);
308 if (ret) { 313 if (ret) {
309 WARN(1, "clock: %s: could not enable clockdomain %s: " 314 WARN(1, "clock: %s: could not enable clockdomain %s: "
310 "%d\n", clk->name, clk->clkdm->name, ret); 315 "%d\n", clk->name, clk->clkdm->name, ret);
@@ -312,17 +317,21 @@ int omap2_clk_enable(struct clk *clk)
312 } 317 }
313 } 318 }
314 319
315 ret = clk->ops->enable(clk); 320 if (clk->ops && clk->ops->enable) {
316 if (ret) { 321 trace_clock_enable(clk->name, 1, smp_processor_id());
317 WARN(1, "clock: %s: could not enable: %d\n", clk->name, ret); 322 ret = clk->ops->enable(clk);
318 goto oce_err3; 323 if (ret) {
324 WARN(1, "clock: %s: could not enable: %d\n",
325 clk->name, ret);
326 goto oce_err3;
327 }
319 } 328 }
320 329
321 return 0; 330 return 0;
322 331
323oce_err3: 332oce_err3:
324 if (clk->clkdm) 333 if (clk->clkdm)
325 omap2_clkdm_clk_disable(clk->clkdm, clk); 334 clkdm_clk_disable(clk->clkdm, clk);
326oce_err2: 335oce_err2:
327 if (clk->parent) 336 if (clk->parent)
328 omap2_clk_disable(clk->parent); 337 omap2_clk_disable(clk->parent);
@@ -349,8 +358,10 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
349 pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate); 358 pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate);
350 359
351 /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */ 360 /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
352 if (clk->set_rate) 361 if (clk->set_rate) {
362 trace_clock_set_rate(clk->name, rate, smp_processor_id());
353 ret = clk->set_rate(clk, rate); 363 ret = clk->set_rate(clk, rate);
364 }
354 365
355 return ret; 366 return ret;
356} 367}
@@ -373,10 +384,16 @@ int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent)
373const struct clkops clkops_omap3_noncore_dpll_ops = { 384const struct clkops clkops_omap3_noncore_dpll_ops = {
374 .enable = omap3_noncore_dpll_enable, 385 .enable = omap3_noncore_dpll_enable,
375 .disable = omap3_noncore_dpll_disable, 386 .disable = omap3_noncore_dpll_disable,
387 .allow_idle = omap3_dpll_allow_idle,
388 .deny_idle = omap3_dpll_deny_idle,
376}; 389};
377 390
378#endif 391const struct clkops clkops_omap3_core_dpll_ops = {
392 .allow_idle = omap3_dpll_allow_idle,
393 .deny_idle = omap3_dpll_deny_idle,
394};
379 395
396#endif
380 397
381/* 398/*
382 * OMAP2+ clock reset and init functions 399 * OMAP2+ clock reset and init functions
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 896584e3c4ab..e10ff2b54844 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -2,7 +2,7 @@
2 * linux/arch/arm/mach-omap2/clock.h 2 * linux/arch/arm/mach-omap2/clock.h
3 * 3 *
4 * Copyright (C) 2005-2009 Texas Instruments, Inc. 4 * Copyright (C) 2005-2009 Texas Instruments, Inc.
5 * Copyright (C) 2004-2009 Nokia Corporation 5 * Copyright (C) 2004-2011 Nokia Corporation
6 * 6 *
7 * Contacts: 7 * Contacts:
8 * Richard Woodruff <r-woodruff2@ti.com> 8 * Richard Woodruff <r-woodruff2@ti.com>
@@ -18,9 +18,6 @@
18 18
19#include <plat/clock.h> 19#include <plat/clock.h>
20 20
21/* The maximum error between a target DPLL rate and the rounded rate in Hz */
22#define DEFAULT_DPLL_RATE_TOLERANCE 50000
23
24/* CM_CLKSEL2_PLL.CORE_CLK_SRC bits (2XXX) */ 21/* CM_CLKSEL2_PLL.CORE_CLK_SRC bits (2XXX) */
25#define CORE_CLK_SRC_32K 0x0 22#define CORE_CLK_SRC_32K 0x0
26#define CORE_CLK_SRC_DPLL 0x1 23#define CORE_CLK_SRC_DPLL 0x1
@@ -55,7 +52,6 @@ void omap2_clk_disable(struct clk *clk);
55long omap2_clk_round_rate(struct clk *clk, unsigned long rate); 52long omap2_clk_round_rate(struct clk *clk, unsigned long rate);
56int omap2_clk_set_rate(struct clk *clk, unsigned long rate); 53int omap2_clk_set_rate(struct clk *clk, unsigned long rate);
57int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent); 54int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent);
58int omap2_dpll_set_rate_tolerance(struct clk *clk, unsigned int tolerance);
59long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate); 55long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate);
60unsigned long omap3_dpll_recalc(struct clk *clk); 56unsigned long omap3_dpll_recalc(struct clk *clk);
61unsigned long omap3_clkoutx2_recalc(struct clk *clk); 57unsigned long omap3_clkoutx2_recalc(struct clk *clk);
@@ -65,6 +61,9 @@ u32 omap3_dpll_autoidle_read(struct clk *clk);
65int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate); 61int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate);
66int omap3_noncore_dpll_enable(struct clk *clk); 62int omap3_noncore_dpll_enable(struct clk *clk);
67void omap3_noncore_dpll_disable(struct clk *clk); 63void omap3_noncore_dpll_disable(struct clk *clk);
64int omap4_dpllmx_gatectrl_read(struct clk *clk);
65void omap4_dpllmx_allow_gatectrl(struct clk *clk);
66void omap4_dpllmx_deny_gatectrl(struct clk *clk);
68 67
69#ifdef CONFIG_OMAP_RESET_CLOCKS 68#ifdef CONFIG_OMAP_RESET_CLOCKS
70void omap2_clk_disable_unused(struct clk *clk); 69void omap2_clk_disable_unused(struct clk *clk);
@@ -83,6 +82,10 @@ long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate);
83int omap2_clksel_set_rate(struct clk *clk, unsigned long rate); 82int omap2_clksel_set_rate(struct clk *clk, unsigned long rate);
84int omap2_clksel_set_parent(struct clk *clk, struct clk *new_parent); 83int omap2_clksel_set_parent(struct clk *clk, struct clk *new_parent);
85 84
85/* clkt_iclk.c public functions */
86extern void omap2_clkt_iclk_allow_idle(struct clk *clk);
87extern void omap2_clkt_iclk_deny_idle(struct clk *clk);
88
86u32 omap2_get_dpll_rate(struct clk *clk); 89u32 omap2_get_dpll_rate(struct clk *clk);
87void omap2_init_dpll_parent(struct clk *clk); 90void omap2_init_dpll_parent(struct clk *clk);
88 91
@@ -136,6 +139,7 @@ extern struct clk *vclk, *sclk;
136extern const struct clksel_rate gpt_32k_rates[]; 139extern const struct clksel_rate gpt_32k_rates[];
137extern const struct clksel_rate gpt_sys_rates[]; 140extern const struct clksel_rate gpt_sys_rates[];
138extern const struct clksel_rate gfx_l3_rates[]; 141extern const struct clksel_rate gfx_l3_rates[];
142extern const struct clksel_rate dsp_ick_rates[];
139 143
140#if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_CPU_FREQ) 144#if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_CPU_FREQ)
141extern void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table); 145extern void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table);
@@ -145,6 +149,13 @@ extern void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table)
145#define omap2_clk_exit_cpufreq_table 0 149#define omap2_clk_exit_cpufreq_table 0
146#endif 150#endif
147 151
152extern const struct clkops clkops_omap2_iclk_dflt_wait;
153extern const struct clkops clkops_omap2_iclk_dflt;
154extern const struct clkops clkops_omap2_iclk_idle_only;
155extern const struct clkops clkops_omap2_mdmclk_dflt_wait;
156extern const struct clkops clkops_omap2xxx_dpll_ops;
148extern const struct clkops clkops_omap3_noncore_dpll_ops; 157extern const struct clkops clkops_omap3_noncore_dpll_ops;
158extern const struct clkops clkops_omap3_core_dpll_ops;
159extern const struct clkops clkops_omap4_dpllmx_ops;
149 160
150#endif 161#endif
diff --git a/arch/arm/mach-omap2/clock2420_data.c b/arch/arm/mach-omap2/clock2420_data.c
index 0a992bc8d0d8..2926d028b6e9 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -1,12 +1,12 @@
1/* 1/*
2 * linux/arch/arm/mach-omap2/clock2420_data.c 2 * OMAP2420 clock data
3 * 3 *
4 * Copyright (C) 2005-2009 Texas Instruments, Inc. 4 * Copyright (C) 2005-2009 Texas Instruments, Inc.
5 * Copyright (C) 2004-2010 Nokia Corporation 5 * Copyright (C) 2004-2011 Nokia Corporation
6 * 6 *
7 * Contacts: 7 * Contacts:
8 * Richard Woodruff <r-woodruff2@ti.com> 8 * Richard Woodruff <r-woodruff2@ti.com>
9 * Paul Walmsley 9 * Paul Walmsley
10 * 10 *
11 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as 12 * it under the terms of the GNU General Public License version 2 as
@@ -34,18 +34,15 @@
34/* 34/*
35 * 2420 clock tree. 35 * 2420 clock tree.
36 * 36 *
37 * NOTE:In many cases here we are assigning a 'default' parent. In many 37 * NOTE:In many cases here we are assigning a 'default' parent. In
38 * cases the parent is selectable. The get/set parent calls will also 38 * many cases the parent is selectable. The set parent calls will
39 * switch sources. 39 * also switch sources.
40 *
41 * Many some clocks say always_enabled, but they can be auto idled for
42 * power savings. They will always be available upon clock request.
43 * 40 *
44 * Several sources are given initial rates which may be wrong, this will 41 * Several sources are given initial rates which may be wrong, this will
45 * be fixed up in the init func. 42 * be fixed up in the init func.
46 * 43 *
47 * Things are broadly separated below by clock domains. It is 44 * Things are broadly separated below by clock domains. It is
48 * noteworthy that most periferals have dependencies on multiple clock 45 * noteworthy that most peripherals have dependencies on multiple clock
49 * domains. Many get their interface clocks from the L4 domain, but get 46 * domains. Many get their interface clocks from the L4 domain, but get
50 * functional clocks from fixed sources or other core domain derived 47 * functional clocks from fixed sources or other core domain derived
51 * clocks. 48 * clocks.
@@ -55,7 +52,7 @@
55static struct clk func_32k_ck = { 52static struct clk func_32k_ck = {
56 .name = "func_32k_ck", 53 .name = "func_32k_ck",
57 .ops = &clkops_null, 54 .ops = &clkops_null,
58 .rate = 32000, 55 .rate = 32768,
59 .clkdm_name = "wkup_clkdm", 56 .clkdm_name = "wkup_clkdm",
60}; 57};
61 58
@@ -116,7 +113,6 @@ static struct dpll_data dpll_dd = {
116 .max_multiplier = 1023, 113 .max_multiplier = 1023,
117 .min_divider = 1, 114 .min_divider = 1,
118 .max_divider = 16, 115 .max_divider = 16,
119 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
120}; 116};
121 117
122/* 118/*
@@ -125,7 +121,7 @@ static struct dpll_data dpll_dd = {
125 */ 121 */
126static struct clk dpll_ck = { 122static struct clk dpll_ck = {
127 .name = "dpll_ck", 123 .name = "dpll_ck",
128 .ops = &clkops_null, 124 .ops = &clkops_omap2xxx_dpll_ops,
129 .parent = &sys_ck, /* Can be func_32k also */ 125 .parent = &sys_ck, /* Can be func_32k also */
130 .dpll_data = &dpll_dd, 126 .dpll_data = &dpll_dd,
131 .clkdm_name = "wkup_clkdm", 127 .clkdm_name = "wkup_clkdm",
@@ -455,36 +451,22 @@ static struct clk dsp_fck = {
455 .recalc = &omap2_clksel_recalc, 451 .recalc = &omap2_clksel_recalc,
456}; 452};
457 453
458/* DSP interface clock */ 454static const struct clksel dsp_ick_clksel[] = {
459static const struct clksel_rate dsp_irate_ick_rates[] = { 455 { .parent = &dsp_fck, .rates = dsp_ick_rates },
460 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
461 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
462 { .div = 0 },
463};
464
465static const struct clksel dsp_irate_ick_clksel[] = {
466 { .parent = &dsp_fck, .rates = dsp_irate_ick_rates },
467 { .parent = NULL } 456 { .parent = NULL }
468}; 457};
469 458
470/* This clock does not exist as such in the TRM. */
471static struct clk dsp_irate_ick = {
472 .name = "dsp_irate_ick",
473 .ops = &clkops_null,
474 .parent = &dsp_fck,
475 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
476 .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK,
477 .clksel = dsp_irate_ick_clksel,
478 .recalc = &omap2_clksel_recalc,
479};
480
481/* 2420 only */
482static struct clk dsp_ick = { 459static struct clk dsp_ick = {
483 .name = "dsp_ick", /* apparently ipi and isp */ 460 .name = "dsp_ick", /* apparently ipi and isp */
484 .ops = &clkops_omap2_dflt_wait, 461 .ops = &clkops_omap2_iclk_dflt_wait,
485 .parent = &dsp_irate_ick, 462 .parent = &dsp_fck,
463 .clkdm_name = "dsp_clkdm",
486 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN), 464 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN),
487 .enable_bit = OMAP2420_EN_DSP_IPI_SHIFT, /* for ipi */ 465 .enable_bit = OMAP2420_EN_DSP_IPI_SHIFT, /* for ipi */
466 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
467 .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK,
468 .clksel = dsp_ick_clksel,
469 .recalc = &omap2_clksel_recalc,
488}; 470};
489 471
490/* 472/*
@@ -579,7 +561,7 @@ static const struct clksel usb_l4_ick_clksel[] = {
579/* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */ 561/* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */
580static struct clk usb_l4_ick = { /* FS-USB interface clock */ 562static struct clk usb_l4_ick = { /* FS-USB interface clock */
581 .name = "usb_l4_ick", 563 .name = "usb_l4_ick",
582 .ops = &clkops_omap2_dflt_wait, 564 .ops = &clkops_omap2_iclk_dflt_wait,
583 .parent = &core_l3_ck, 565 .parent = &core_l3_ck,
584 .clkdm_name = "core_l4_clkdm", 566 .clkdm_name = "core_l4_clkdm",
585 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 567 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -661,7 +643,7 @@ static struct clk ssi_ssr_sst_fck = {
661 */ 643 */
662static struct clk ssi_l4_ick = { 644static struct clk ssi_l4_ick = {
663 .name = "ssi_l4_ick", 645 .name = "ssi_l4_ick",
664 .ops = &clkops_omap2_dflt_wait, 646 .ops = &clkops_omap2_iclk_dflt_wait,
665 .parent = &l4_ck, 647 .parent = &l4_ck,
666 .clkdm_name = "core_l4_clkdm", 648 .clkdm_name = "core_l4_clkdm",
667 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 649 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -716,6 +698,7 @@ static struct clk gfx_2d_fck = {
716 .recalc = &omap2_clksel_recalc, 698 .recalc = &omap2_clksel_recalc,
717}; 699};
718 700
701/* This interface clock does not have a CM_AUTOIDLE bit */
719static struct clk gfx_ick = { 702static struct clk gfx_ick = {
720 .name = "gfx_ick", /* From l3 */ 703 .name = "gfx_ick", /* From l3 */
721 .ops = &clkops_omap2_dflt_wait, 704 .ops = &clkops_omap2_dflt_wait,
@@ -763,7 +746,7 @@ static const struct clksel dss1_fck_clksel[] = {
763 746
764static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */ 747static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */
765 .name = "dss_ick", 748 .name = "dss_ick",
766 .ops = &clkops_omap2_dflt, 749 .ops = &clkops_omap2_iclk_dflt,
767 .parent = &l4_ck, /* really both l3 and l4 */ 750 .parent = &l4_ck, /* really both l3 and l4 */
768 .clkdm_name = "dss_clkdm", 751 .clkdm_name = "dss_clkdm",
769 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 752 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -825,6 +808,14 @@ static struct clk dss_54m_fck = { /* Alt clk used in power management */
825 .recalc = &followparent_recalc, 808 .recalc = &followparent_recalc,
826}; 809};
827 810
811static struct clk wu_l4_ick = {
812 .name = "wu_l4_ick",
813 .ops = &clkops_null,
814 .parent = &sys_ck,
815 .clkdm_name = "wkup_clkdm",
816 .recalc = &followparent_recalc,
817};
818
828/* 819/*
829 * CORE power domain ICLK & FCLK defines. 820 * CORE power domain ICLK & FCLK defines.
830 * Many of the these can have more than one possible parent. Entries 821 * Many of the these can have more than one possible parent. Entries
@@ -845,9 +836,9 @@ static const struct clksel omap24xx_gpt_clksel[] = {
845 836
846static struct clk gpt1_ick = { 837static struct clk gpt1_ick = {
847 .name = "gpt1_ick", 838 .name = "gpt1_ick",
848 .ops = &clkops_omap2_dflt_wait, 839 .ops = &clkops_omap2_iclk_dflt_wait,
849 .parent = &l4_ck, 840 .parent = &wu_l4_ick,
850 .clkdm_name = "core_l4_clkdm", 841 .clkdm_name = "wkup_clkdm",
851 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 842 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
852 .enable_bit = OMAP24XX_EN_GPT1_SHIFT, 843 .enable_bit = OMAP24XX_EN_GPT1_SHIFT,
853 .recalc = &followparent_recalc, 844 .recalc = &followparent_recalc,
@@ -871,7 +862,7 @@ static struct clk gpt1_fck = {
871 862
872static struct clk gpt2_ick = { 863static struct clk gpt2_ick = {
873 .name = "gpt2_ick", 864 .name = "gpt2_ick",
874 .ops = &clkops_omap2_dflt_wait, 865 .ops = &clkops_omap2_iclk_dflt_wait,
875 .parent = &l4_ck, 866 .parent = &l4_ck,
876 .clkdm_name = "core_l4_clkdm", 867 .clkdm_name = "core_l4_clkdm",
877 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 868 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -895,7 +886,7 @@ static struct clk gpt2_fck = {
895 886
896static struct clk gpt3_ick = { 887static struct clk gpt3_ick = {
897 .name = "gpt3_ick", 888 .name = "gpt3_ick",
898 .ops = &clkops_omap2_dflt_wait, 889 .ops = &clkops_omap2_iclk_dflt_wait,
899 .parent = &l4_ck, 890 .parent = &l4_ck,
900 .clkdm_name = "core_l4_clkdm", 891 .clkdm_name = "core_l4_clkdm",
901 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 892 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -919,7 +910,7 @@ static struct clk gpt3_fck = {
919 910
920static struct clk gpt4_ick = { 911static struct clk gpt4_ick = {
921 .name = "gpt4_ick", 912 .name = "gpt4_ick",
922 .ops = &clkops_omap2_dflt_wait, 913 .ops = &clkops_omap2_iclk_dflt_wait,
923 .parent = &l4_ck, 914 .parent = &l4_ck,
924 .clkdm_name = "core_l4_clkdm", 915 .clkdm_name = "core_l4_clkdm",
925 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 916 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -943,7 +934,7 @@ static struct clk gpt4_fck = {
943 934
944static struct clk gpt5_ick = { 935static struct clk gpt5_ick = {
945 .name = "gpt5_ick", 936 .name = "gpt5_ick",
946 .ops = &clkops_omap2_dflt_wait, 937 .ops = &clkops_omap2_iclk_dflt_wait,
947 .parent = &l4_ck, 938 .parent = &l4_ck,
948 .clkdm_name = "core_l4_clkdm", 939 .clkdm_name = "core_l4_clkdm",
949 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 940 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -967,7 +958,7 @@ static struct clk gpt5_fck = {
967 958
968static struct clk gpt6_ick = { 959static struct clk gpt6_ick = {
969 .name = "gpt6_ick", 960 .name = "gpt6_ick",
970 .ops = &clkops_omap2_dflt_wait, 961 .ops = &clkops_omap2_iclk_dflt_wait,
971 .parent = &l4_ck, 962 .parent = &l4_ck,
972 .clkdm_name = "core_l4_clkdm", 963 .clkdm_name = "core_l4_clkdm",
973 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 964 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -991,8 +982,9 @@ static struct clk gpt6_fck = {
991 982
992static struct clk gpt7_ick = { 983static struct clk gpt7_ick = {
993 .name = "gpt7_ick", 984 .name = "gpt7_ick",
994 .ops = &clkops_omap2_dflt_wait, 985 .ops = &clkops_omap2_iclk_dflt_wait,
995 .parent = &l4_ck, 986 .parent = &l4_ck,
987 .clkdm_name = "core_l4_clkdm",
996 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 988 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
997 .enable_bit = OMAP24XX_EN_GPT7_SHIFT, 989 .enable_bit = OMAP24XX_EN_GPT7_SHIFT,
998 .recalc = &followparent_recalc, 990 .recalc = &followparent_recalc,
@@ -1014,7 +1006,7 @@ static struct clk gpt7_fck = {
1014 1006
1015static struct clk gpt8_ick = { 1007static struct clk gpt8_ick = {
1016 .name = "gpt8_ick", 1008 .name = "gpt8_ick",
1017 .ops = &clkops_omap2_dflt_wait, 1009 .ops = &clkops_omap2_iclk_dflt_wait,
1018 .parent = &l4_ck, 1010 .parent = &l4_ck,
1019 .clkdm_name = "core_l4_clkdm", 1011 .clkdm_name = "core_l4_clkdm",
1020 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1012 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1038,7 +1030,7 @@ static struct clk gpt8_fck = {
1038 1030
1039static struct clk gpt9_ick = { 1031static struct clk gpt9_ick = {
1040 .name = "gpt9_ick", 1032 .name = "gpt9_ick",
1041 .ops = &clkops_omap2_dflt_wait, 1033 .ops = &clkops_omap2_iclk_dflt_wait,
1042 .parent = &l4_ck, 1034 .parent = &l4_ck,
1043 .clkdm_name = "core_l4_clkdm", 1035 .clkdm_name = "core_l4_clkdm",
1044 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1036 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1062,7 +1054,7 @@ static struct clk gpt9_fck = {
1062 1054
1063static struct clk gpt10_ick = { 1055static struct clk gpt10_ick = {
1064 .name = "gpt10_ick", 1056 .name = "gpt10_ick",
1065 .ops = &clkops_omap2_dflt_wait, 1057 .ops = &clkops_omap2_iclk_dflt_wait,
1066 .parent = &l4_ck, 1058 .parent = &l4_ck,
1067 .clkdm_name = "core_l4_clkdm", 1059 .clkdm_name = "core_l4_clkdm",
1068 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1060 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1086,7 +1078,7 @@ static struct clk gpt10_fck = {
1086 1078
1087static struct clk gpt11_ick = { 1079static struct clk gpt11_ick = {
1088 .name = "gpt11_ick", 1080 .name = "gpt11_ick",
1089 .ops = &clkops_omap2_dflt_wait, 1081 .ops = &clkops_omap2_iclk_dflt_wait,
1090 .parent = &l4_ck, 1082 .parent = &l4_ck,
1091 .clkdm_name = "core_l4_clkdm", 1083 .clkdm_name = "core_l4_clkdm",
1092 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1084 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1110,7 +1102,7 @@ static struct clk gpt11_fck = {
1110 1102
1111static struct clk gpt12_ick = { 1103static struct clk gpt12_ick = {
1112 .name = "gpt12_ick", 1104 .name = "gpt12_ick",
1113 .ops = &clkops_omap2_dflt_wait, 1105 .ops = &clkops_omap2_iclk_dflt_wait,
1114 .parent = &l4_ck, 1106 .parent = &l4_ck,
1115 .clkdm_name = "core_l4_clkdm", 1107 .clkdm_name = "core_l4_clkdm",
1116 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1108 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1134,7 +1126,7 @@ static struct clk gpt12_fck = {
1134 1126
1135static struct clk mcbsp1_ick = { 1127static struct clk mcbsp1_ick = {
1136 .name = "mcbsp1_ick", 1128 .name = "mcbsp1_ick",
1137 .ops = &clkops_omap2_dflt_wait, 1129 .ops = &clkops_omap2_iclk_dflt_wait,
1138 .parent = &l4_ck, 1130 .parent = &l4_ck,
1139 .clkdm_name = "core_l4_clkdm", 1131 .clkdm_name = "core_l4_clkdm",
1140 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1132 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1174,7 +1166,7 @@ static struct clk mcbsp1_fck = {
1174 1166
1175static struct clk mcbsp2_ick = { 1167static struct clk mcbsp2_ick = {
1176 .name = "mcbsp2_ick", 1168 .name = "mcbsp2_ick",
1177 .ops = &clkops_omap2_dflt_wait, 1169 .ops = &clkops_omap2_iclk_dflt_wait,
1178 .parent = &l4_ck, 1170 .parent = &l4_ck,
1179 .clkdm_name = "core_l4_clkdm", 1171 .clkdm_name = "core_l4_clkdm",
1180 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1172 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1198,7 +1190,7 @@ static struct clk mcbsp2_fck = {
1198 1190
1199static struct clk mcspi1_ick = { 1191static struct clk mcspi1_ick = {
1200 .name = "mcspi1_ick", 1192 .name = "mcspi1_ick",
1201 .ops = &clkops_omap2_dflt_wait, 1193 .ops = &clkops_omap2_iclk_dflt_wait,
1202 .parent = &l4_ck, 1194 .parent = &l4_ck,
1203 .clkdm_name = "core_l4_clkdm", 1195 .clkdm_name = "core_l4_clkdm",
1204 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1196 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1218,7 +1210,7 @@ static struct clk mcspi1_fck = {
1218 1210
1219static struct clk mcspi2_ick = { 1211static struct clk mcspi2_ick = {
1220 .name = "mcspi2_ick", 1212 .name = "mcspi2_ick",
1221 .ops = &clkops_omap2_dflt_wait, 1213 .ops = &clkops_omap2_iclk_dflt_wait,
1222 .parent = &l4_ck, 1214 .parent = &l4_ck,
1223 .clkdm_name = "core_l4_clkdm", 1215 .clkdm_name = "core_l4_clkdm",
1224 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1216 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1238,7 +1230,7 @@ static struct clk mcspi2_fck = {
1238 1230
1239static struct clk uart1_ick = { 1231static struct clk uart1_ick = {
1240 .name = "uart1_ick", 1232 .name = "uart1_ick",
1241 .ops = &clkops_omap2_dflt_wait, 1233 .ops = &clkops_omap2_iclk_dflt_wait,
1242 .parent = &l4_ck, 1234 .parent = &l4_ck,
1243 .clkdm_name = "core_l4_clkdm", 1235 .clkdm_name = "core_l4_clkdm",
1244 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1236 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1258,7 +1250,7 @@ static struct clk uart1_fck = {
1258 1250
1259static struct clk uart2_ick = { 1251static struct clk uart2_ick = {
1260 .name = "uart2_ick", 1252 .name = "uart2_ick",
1261 .ops = &clkops_omap2_dflt_wait, 1253 .ops = &clkops_omap2_iclk_dflt_wait,
1262 .parent = &l4_ck, 1254 .parent = &l4_ck,
1263 .clkdm_name = "core_l4_clkdm", 1255 .clkdm_name = "core_l4_clkdm",
1264 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1256 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1278,7 +1270,7 @@ static struct clk uart2_fck = {
1278 1270
1279static struct clk uart3_ick = { 1271static struct clk uart3_ick = {
1280 .name = "uart3_ick", 1272 .name = "uart3_ick",
1281 .ops = &clkops_omap2_dflt_wait, 1273 .ops = &clkops_omap2_iclk_dflt_wait,
1282 .parent = &l4_ck, 1274 .parent = &l4_ck,
1283 .clkdm_name = "core_l4_clkdm", 1275 .clkdm_name = "core_l4_clkdm",
1284 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1276 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1298,9 +1290,9 @@ static struct clk uart3_fck = {
1298 1290
1299static struct clk gpios_ick = { 1291static struct clk gpios_ick = {
1300 .name = "gpios_ick", 1292 .name = "gpios_ick",
1301 .ops = &clkops_omap2_dflt_wait, 1293 .ops = &clkops_omap2_iclk_dflt_wait,
1302 .parent = &l4_ck, 1294 .parent = &wu_l4_ick,
1303 .clkdm_name = "core_l4_clkdm", 1295 .clkdm_name = "wkup_clkdm",
1304 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1296 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1305 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, 1297 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
1306 .recalc = &followparent_recalc, 1298 .recalc = &followparent_recalc,
@@ -1318,9 +1310,9 @@ static struct clk gpios_fck = {
1318 1310
1319static struct clk mpu_wdt_ick = { 1311static struct clk mpu_wdt_ick = {
1320 .name = "mpu_wdt_ick", 1312 .name = "mpu_wdt_ick",
1321 .ops = &clkops_omap2_dflt_wait, 1313 .ops = &clkops_omap2_iclk_dflt_wait,
1322 .parent = &l4_ck, 1314 .parent = &wu_l4_ick,
1323 .clkdm_name = "core_l4_clkdm", 1315 .clkdm_name = "wkup_clkdm",
1324 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1316 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1325 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, 1317 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
1326 .recalc = &followparent_recalc, 1318 .recalc = &followparent_recalc,
@@ -1338,10 +1330,10 @@ static struct clk mpu_wdt_fck = {
1338 1330
1339static struct clk sync_32k_ick = { 1331static struct clk sync_32k_ick = {
1340 .name = "sync_32k_ick", 1332 .name = "sync_32k_ick",
1341 .ops = &clkops_omap2_dflt_wait, 1333 .ops = &clkops_omap2_iclk_dflt_wait,
1342 .parent = &l4_ck, 1334 .parent = &wu_l4_ick,
1335 .clkdm_name = "wkup_clkdm",
1343 .flags = ENABLE_ON_INIT, 1336 .flags = ENABLE_ON_INIT,
1344 .clkdm_name = "core_l4_clkdm",
1345 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1337 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1346 .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT, 1338 .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT,
1347 .recalc = &followparent_recalc, 1339 .recalc = &followparent_recalc,
@@ -1349,9 +1341,9 @@ static struct clk sync_32k_ick = {
1349 1341
1350static struct clk wdt1_ick = { 1342static struct clk wdt1_ick = {
1351 .name = "wdt1_ick", 1343 .name = "wdt1_ick",
1352 .ops = &clkops_omap2_dflt_wait, 1344 .ops = &clkops_omap2_iclk_dflt_wait,
1353 .parent = &l4_ck, 1345 .parent = &wu_l4_ick,
1354 .clkdm_name = "core_l4_clkdm", 1346 .clkdm_name = "wkup_clkdm",
1355 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1347 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1356 .enable_bit = OMAP24XX_EN_WDT1_SHIFT, 1348 .enable_bit = OMAP24XX_EN_WDT1_SHIFT,
1357 .recalc = &followparent_recalc, 1349 .recalc = &followparent_recalc,
@@ -1359,10 +1351,10 @@ static struct clk wdt1_ick = {
1359 1351
1360static struct clk omapctrl_ick = { 1352static struct clk omapctrl_ick = {
1361 .name = "omapctrl_ick", 1353 .name = "omapctrl_ick",
1362 .ops = &clkops_omap2_dflt_wait, 1354 .ops = &clkops_omap2_iclk_dflt_wait,
1363 .parent = &l4_ck, 1355 .parent = &wu_l4_ick,
1356 .clkdm_name = "wkup_clkdm",
1364 .flags = ENABLE_ON_INIT, 1357 .flags = ENABLE_ON_INIT,
1365 .clkdm_name = "core_l4_clkdm",
1366 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1358 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1367 .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT, 1359 .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT,
1368 .recalc = &followparent_recalc, 1360 .recalc = &followparent_recalc,
@@ -1370,7 +1362,7 @@ static struct clk omapctrl_ick = {
1370 1362
1371static struct clk cam_ick = { 1363static struct clk cam_ick = {
1372 .name = "cam_ick", 1364 .name = "cam_ick",
1373 .ops = &clkops_omap2_dflt, 1365 .ops = &clkops_omap2_iclk_dflt,
1374 .parent = &l4_ck, 1366 .parent = &l4_ck,
1375 .clkdm_name = "core_l4_clkdm", 1367 .clkdm_name = "core_l4_clkdm",
1376 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1368 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1395,7 +1387,7 @@ static struct clk cam_fck = {
1395 1387
1396static struct clk mailboxes_ick = { 1388static struct clk mailboxes_ick = {
1397 .name = "mailboxes_ick", 1389 .name = "mailboxes_ick",
1398 .ops = &clkops_omap2_dflt_wait, 1390 .ops = &clkops_omap2_iclk_dflt_wait,
1399 .parent = &l4_ck, 1391 .parent = &l4_ck,
1400 .clkdm_name = "core_l4_clkdm", 1392 .clkdm_name = "core_l4_clkdm",
1401 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1393 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1405,7 +1397,7 @@ static struct clk mailboxes_ick = {
1405 1397
1406static struct clk wdt4_ick = { 1398static struct clk wdt4_ick = {
1407 .name = "wdt4_ick", 1399 .name = "wdt4_ick",
1408 .ops = &clkops_omap2_dflt_wait, 1400 .ops = &clkops_omap2_iclk_dflt_wait,
1409 .parent = &l4_ck, 1401 .parent = &l4_ck,
1410 .clkdm_name = "core_l4_clkdm", 1402 .clkdm_name = "core_l4_clkdm",
1411 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1403 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1425,7 +1417,7 @@ static struct clk wdt4_fck = {
1425 1417
1426static struct clk wdt3_ick = { 1418static struct clk wdt3_ick = {
1427 .name = "wdt3_ick", 1419 .name = "wdt3_ick",
1428 .ops = &clkops_omap2_dflt_wait, 1420 .ops = &clkops_omap2_iclk_dflt_wait,
1429 .parent = &l4_ck, 1421 .parent = &l4_ck,
1430 .clkdm_name = "core_l4_clkdm", 1422 .clkdm_name = "core_l4_clkdm",
1431 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1423 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1445,7 +1437,7 @@ static struct clk wdt3_fck = {
1445 1437
1446static struct clk mspro_ick = { 1438static struct clk mspro_ick = {
1447 .name = "mspro_ick", 1439 .name = "mspro_ick",
1448 .ops = &clkops_omap2_dflt_wait, 1440 .ops = &clkops_omap2_iclk_dflt_wait,
1449 .parent = &l4_ck, 1441 .parent = &l4_ck,
1450 .clkdm_name = "core_l4_clkdm", 1442 .clkdm_name = "core_l4_clkdm",
1451 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1443 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1465,7 +1457,7 @@ static struct clk mspro_fck = {
1465 1457
1466static struct clk mmc_ick = { 1458static struct clk mmc_ick = {
1467 .name = "mmc_ick", 1459 .name = "mmc_ick",
1468 .ops = &clkops_omap2_dflt_wait, 1460 .ops = &clkops_omap2_iclk_dflt_wait,
1469 .parent = &l4_ck, 1461 .parent = &l4_ck,
1470 .clkdm_name = "core_l4_clkdm", 1462 .clkdm_name = "core_l4_clkdm",
1471 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1463 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1485,7 +1477,7 @@ static struct clk mmc_fck = {
1485 1477
1486static struct clk fac_ick = { 1478static struct clk fac_ick = {
1487 .name = "fac_ick", 1479 .name = "fac_ick",
1488 .ops = &clkops_omap2_dflt_wait, 1480 .ops = &clkops_omap2_iclk_dflt_wait,
1489 .parent = &l4_ck, 1481 .parent = &l4_ck,
1490 .clkdm_name = "core_l4_clkdm", 1482 .clkdm_name = "core_l4_clkdm",
1491 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1483 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1505,7 +1497,7 @@ static struct clk fac_fck = {
1505 1497
1506static struct clk eac_ick = { 1498static struct clk eac_ick = {
1507 .name = "eac_ick", 1499 .name = "eac_ick",
1508 .ops = &clkops_omap2_dflt_wait, 1500 .ops = &clkops_omap2_iclk_dflt_wait,
1509 .parent = &l4_ck, 1501 .parent = &l4_ck,
1510 .clkdm_name = "core_l4_clkdm", 1502 .clkdm_name = "core_l4_clkdm",
1511 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1503 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1525,7 +1517,7 @@ static struct clk eac_fck = {
1525 1517
1526static struct clk hdq_ick = { 1518static struct clk hdq_ick = {
1527 .name = "hdq_ick", 1519 .name = "hdq_ick",
1528 .ops = &clkops_omap2_dflt_wait, 1520 .ops = &clkops_omap2_iclk_dflt_wait,
1529 .parent = &l4_ck, 1521 .parent = &l4_ck,
1530 .clkdm_name = "core_l4_clkdm", 1522 .clkdm_name = "core_l4_clkdm",
1531 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1523 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1545,7 +1537,7 @@ static struct clk hdq_fck = {
1545 1537
1546static struct clk i2c2_ick = { 1538static struct clk i2c2_ick = {
1547 .name = "i2c2_ick", 1539 .name = "i2c2_ick",
1548 .ops = &clkops_omap2_dflt_wait, 1540 .ops = &clkops_omap2_iclk_dflt_wait,
1549 .parent = &l4_ck, 1541 .parent = &l4_ck,
1550 .clkdm_name = "core_l4_clkdm", 1542 .clkdm_name = "core_l4_clkdm",
1551 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1543 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1565,7 +1557,7 @@ static struct clk i2c2_fck = {
1565 1557
1566static struct clk i2c1_ick = { 1558static struct clk i2c1_ick = {
1567 .name = "i2c1_ick", 1559 .name = "i2c1_ick",
1568 .ops = &clkops_omap2_dflt_wait, 1560 .ops = &clkops_omap2_iclk_dflt_wait,
1569 .parent = &l4_ck, 1561 .parent = &l4_ck,
1570 .clkdm_name = "core_l4_clkdm", 1562 .clkdm_name = "core_l4_clkdm",
1571 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1563 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1583,12 +1575,18 @@ static struct clk i2c1_fck = {
1583 .recalc = &followparent_recalc, 1575 .recalc = &followparent_recalc,
1584}; 1576};
1585 1577
1578/*
1579 * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE
1580 * accesses derived from this data.
1581 */
1586static struct clk gpmc_fck = { 1582static struct clk gpmc_fck = {
1587 .name = "gpmc_fck", 1583 .name = "gpmc_fck",
1588 .ops = &clkops_null, /* RMK: missing? */ 1584 .ops = &clkops_omap2_iclk_idle_only,
1589 .parent = &core_l3_ck, 1585 .parent = &core_l3_ck,
1590 .flags = ENABLE_ON_INIT, 1586 .flags = ENABLE_ON_INIT,
1591 .clkdm_name = "core_l3_clkdm", 1587 .clkdm_name = "core_l3_clkdm",
1588 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1589 .enable_bit = OMAP24XX_AUTO_GPMC_SHIFT,
1592 .recalc = &followparent_recalc, 1590 .recalc = &followparent_recalc,
1593}; 1591};
1594 1592
@@ -1600,17 +1598,38 @@ static struct clk sdma_fck = {
1600 .recalc = &followparent_recalc, 1598 .recalc = &followparent_recalc,
1601}; 1599};
1602 1600
1601/*
1602 * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE
1603 * accesses derived from this data.
1604 */
1603static struct clk sdma_ick = { 1605static struct clk sdma_ick = {
1604 .name = "sdma_ick", 1606 .name = "sdma_ick",
1605 .ops = &clkops_null, /* RMK: missing? */ 1607 .ops = &clkops_omap2_iclk_idle_only,
1606 .parent = &l4_ck, 1608 .parent = &core_l3_ck,
1609 .clkdm_name = "core_l3_clkdm",
1610 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1611 .enable_bit = OMAP24XX_AUTO_SDMA_SHIFT,
1612 .recalc = &followparent_recalc,
1613};
1614
1615/*
1616 * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE
1617 * accesses derived from this data.
1618 */
1619static struct clk sdrc_ick = {
1620 .name = "sdrc_ick",
1621 .ops = &clkops_omap2_iclk_idle_only,
1622 .parent = &core_l3_ck,
1623 .flags = ENABLE_ON_INIT,
1607 .clkdm_name = "core_l3_clkdm", 1624 .clkdm_name = "core_l3_clkdm",
1625 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1626 .enable_bit = OMAP24XX_AUTO_SDRC_SHIFT,
1608 .recalc = &followparent_recalc, 1627 .recalc = &followparent_recalc,
1609}; 1628};
1610 1629
1611static struct clk vlynq_ick = { 1630static struct clk vlynq_ick = {
1612 .name = "vlynq_ick", 1631 .name = "vlynq_ick",
1613 .ops = &clkops_omap2_dflt_wait, 1632 .ops = &clkops_omap2_iclk_dflt_wait,
1614 .parent = &core_l3_ck, 1633 .parent = &core_l3_ck,
1615 .clkdm_name = "core_l3_clkdm", 1634 .clkdm_name = "core_l3_clkdm",
1616 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1635 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1659,7 +1678,7 @@ static struct clk vlynq_fck = {
1659 1678
1660static struct clk des_ick = { 1679static struct clk des_ick = {
1661 .name = "des_ick", 1680 .name = "des_ick",
1662 .ops = &clkops_omap2_dflt_wait, 1681 .ops = &clkops_omap2_iclk_dflt_wait,
1663 .parent = &l4_ck, 1682 .parent = &l4_ck,
1664 .clkdm_name = "core_l4_clkdm", 1683 .clkdm_name = "core_l4_clkdm",
1665 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 1684 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
@@ -1669,7 +1688,7 @@ static struct clk des_ick = {
1669 1688
1670static struct clk sha_ick = { 1689static struct clk sha_ick = {
1671 .name = "sha_ick", 1690 .name = "sha_ick",
1672 .ops = &clkops_omap2_dflt_wait, 1691 .ops = &clkops_omap2_iclk_dflt_wait,
1673 .parent = &l4_ck, 1692 .parent = &l4_ck,
1674 .clkdm_name = "core_l4_clkdm", 1693 .clkdm_name = "core_l4_clkdm",
1675 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 1694 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
@@ -1679,7 +1698,7 @@ static struct clk sha_ick = {
1679 1698
1680static struct clk rng_ick = { 1699static struct clk rng_ick = {
1681 .name = "rng_ick", 1700 .name = "rng_ick",
1682 .ops = &clkops_omap2_dflt_wait, 1701 .ops = &clkops_omap2_iclk_dflt_wait,
1683 .parent = &l4_ck, 1702 .parent = &l4_ck,
1684 .clkdm_name = "core_l4_clkdm", 1703 .clkdm_name = "core_l4_clkdm",
1685 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 1704 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
@@ -1689,7 +1708,7 @@ static struct clk rng_ick = {
1689 1708
1690static struct clk aes_ick = { 1709static struct clk aes_ick = {
1691 .name = "aes_ick", 1710 .name = "aes_ick",
1692 .ops = &clkops_omap2_dflt_wait, 1711 .ops = &clkops_omap2_iclk_dflt_wait,
1693 .parent = &l4_ck, 1712 .parent = &l4_ck,
1694 .clkdm_name = "core_l4_clkdm", 1713 .clkdm_name = "core_l4_clkdm",
1695 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 1714 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
@@ -1699,7 +1718,7 @@ static struct clk aes_ick = {
1699 1718
1700static struct clk pka_ick = { 1719static struct clk pka_ick = {
1701 .name = "pka_ick", 1720 .name = "pka_ick",
1702 .ops = &clkops_omap2_dflt_wait, 1721 .ops = &clkops_omap2_iclk_dflt_wait,
1703 .parent = &l4_ck, 1722 .parent = &l4_ck,
1704 .clkdm_name = "core_l4_clkdm", 1723 .clkdm_name = "core_l4_clkdm",
1705 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 1724 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
@@ -1777,7 +1796,6 @@ static struct omap_clk omap2420_clks[] = {
1777 CLK(NULL, "mpu_ck", &mpu_ck, CK_242X), 1796 CLK(NULL, "mpu_ck", &mpu_ck, CK_242X),
1778 /* dsp domain clocks */ 1797 /* dsp domain clocks */
1779 CLK(NULL, "dsp_fck", &dsp_fck, CK_242X), 1798 CLK(NULL, "dsp_fck", &dsp_fck, CK_242X),
1780 CLK(NULL, "dsp_irate_ick", &dsp_irate_ick, CK_242X),
1781 CLK(NULL, "dsp_ick", &dsp_ick, CK_242X), 1799 CLK(NULL, "dsp_ick", &dsp_ick, CK_242X),
1782 CLK(NULL, "iva1_ifck", &iva1_ifck, CK_242X), 1800 CLK(NULL, "iva1_ifck", &iva1_ifck, CK_242X),
1783 CLK(NULL, "iva1_mpu_int_ifck", &iva1_mpu_int_ifck, CK_242X), 1801 CLK(NULL, "iva1_mpu_int_ifck", &iva1_mpu_int_ifck, CK_242X),
@@ -1786,10 +1804,10 @@ static struct omap_clk omap2420_clks[] = {
1786 CLK(NULL, "gfx_2d_fck", &gfx_2d_fck, CK_242X), 1804 CLK(NULL, "gfx_2d_fck", &gfx_2d_fck, CK_242X),
1787 CLK(NULL, "gfx_ick", &gfx_ick, CK_242X), 1805 CLK(NULL, "gfx_ick", &gfx_ick, CK_242X),
1788 /* DSS domain clocks */ 1806 /* DSS domain clocks */
1789 CLK("omapdss", "ick", &dss_ick, CK_242X), 1807 CLK("omapdss_dss", "ick", &dss_ick, CK_242X),
1790 CLK("omapdss", "dss1_fck", &dss1_fck, CK_242X), 1808 CLK("omapdss_dss", "fck", &dss1_fck, CK_242X),
1791 CLK("omapdss", "dss2_fck", &dss2_fck, CK_242X), 1809 CLK("omapdss_dss", "sys_clk", &dss2_fck, CK_242X),
1792 CLK("omapdss", "tv_fck", &dss_54m_fck, CK_242X), 1810 CLK("omapdss_dss", "tv_clk", &dss_54m_fck, CK_242X),
1793 /* L3 domain clocks */ 1811 /* L3 domain clocks */
1794 CLK(NULL, "core_l3_ck", &core_l3_ck, CK_242X), 1812 CLK(NULL, "core_l3_ck", &core_l3_ck, CK_242X),
1795 CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_242X), 1813 CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_242X),
@@ -1797,6 +1815,7 @@ static struct omap_clk omap2420_clks[] = {
1797 /* L4 domain clocks */ 1815 /* L4 domain clocks */
1798 CLK(NULL, "l4_ck", &l4_ck, CK_242X), 1816 CLK(NULL, "l4_ck", &l4_ck, CK_242X),
1799 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_242X), 1817 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_242X),
1818 CLK(NULL, "wu_l4_ick", &wu_l4_ick, CK_242X),
1800 /* virtual meta-group clock */ 1819 /* virtual meta-group clock */
1801 CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_242X), 1820 CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_242X),
1802 /* general l4 interface ck, multi-parent functional clk */ 1821 /* general l4 interface ck, multi-parent functional clk */
@@ -1869,6 +1888,7 @@ static struct omap_clk omap2420_clks[] = {
1869 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_242X), 1888 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_242X),
1870 CLK(NULL, "sdma_fck", &sdma_fck, CK_242X), 1889 CLK(NULL, "sdma_fck", &sdma_fck, CK_242X),
1871 CLK(NULL, "sdma_ick", &sdma_ick, CK_242X), 1890 CLK(NULL, "sdma_ick", &sdma_ick, CK_242X),
1891 CLK(NULL, "sdrc_ick", &sdrc_ick, CK_242X),
1872 CLK(NULL, "vlynq_ick", &vlynq_ick, CK_242X), 1892 CLK(NULL, "vlynq_ick", &vlynq_ick, CK_242X),
1873 CLK(NULL, "vlynq_fck", &vlynq_fck, CK_242X), 1893 CLK(NULL, "vlynq_fck", &vlynq_fck, CK_242X),
1874 CLK(NULL, "des_ick", &des_ick, CK_242X), 1894 CLK(NULL, "des_ick", &des_ick, CK_242X),
@@ -1913,6 +1933,9 @@ int __init omap2420_clk_init(void)
1913 omap2_init_clk_clkdm(c->lk.clk); 1933 omap2_init_clk_clkdm(c->lk.clk);
1914 } 1934 }
1915 1935
1936 /* Disable autoidle on all clocks; let the PM code enable it later */
1937 omap_clk_disable_autoidle_all();
1938
1916 /* Check the MPU rate set by bootloader */ 1939 /* Check the MPU rate set by bootloader */
1917 clkrate = omap2xxx_clk_get_core_rate(&dpll_ck); 1940 clkrate = omap2xxx_clk_get_core_rate(&dpll_ck);
1918 for (prcm = rate_table; prcm->mpu_speed; prcm++) { 1941 for (prcm = rate_table; prcm->mpu_speed; prcm++) {
diff --git a/arch/arm/mach-omap2/clock2430_data.c b/arch/arm/mach-omap2/clock2430_data.c
index c047dcd007e5..0c79d39e3021 100644
--- a/arch/arm/mach-omap2/clock2430_data.c
+++ b/arch/arm/mach-omap2/clock2430_data.c
@@ -1,12 +1,12 @@
1/* 1/*
2 * linux/arch/arm/mach-omap2/clock2430_data.c 2 * OMAP2430 clock data
3 * 3 *
4 * Copyright (C) 2005-2009 Texas Instruments, Inc. 4 * Copyright (C) 2005-2009 Texas Instruments, Inc.
5 * Copyright (C) 2004-2010 Nokia Corporation 5 * Copyright (C) 2004-2011 Nokia Corporation
6 * 6 *
7 * Contacts: 7 * Contacts:
8 * Richard Woodruff <r-woodruff2@ti.com> 8 * Richard Woodruff <r-woodruff2@ti.com>
9 * Paul Walmsley 9 * Paul Walmsley
10 * 10 *
11 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as 12 * it under the terms of the GNU General Public License version 2 as
@@ -34,18 +34,15 @@
34/* 34/*
35 * 2430 clock tree. 35 * 2430 clock tree.
36 * 36 *
37 * NOTE:In many cases here we are assigning a 'default' parent. In many 37 * NOTE:In many cases here we are assigning a 'default' parent. In
38 * cases the parent is selectable. The get/set parent calls will also 38 * many cases the parent is selectable. The set parent calls will
39 * switch sources. 39 * also switch sources.
40 *
41 * Many some clocks say always_enabled, but they can be auto idled for
42 * power savings. They will always be available upon clock request.
43 * 40 *
44 * Several sources are given initial rates which may be wrong, this will 41 * Several sources are given initial rates which may be wrong, this will
45 * be fixed up in the init func. 42 * be fixed up in the init func.
46 * 43 *
47 * Things are broadly separated below by clock domains. It is 44 * Things are broadly separated below by clock domains. It is
48 * noteworthy that most periferals have dependencies on multiple clock 45 * noteworthy that most peripherals have dependencies on multiple clock
49 * domains. Many get their interface clocks from the L4 domain, but get 46 * domains. Many get their interface clocks from the L4 domain, but get
50 * functional clocks from fixed sources or other core domain derived 47 * functional clocks from fixed sources or other core domain derived
51 * clocks. 48 * clocks.
@@ -55,7 +52,7 @@
55static struct clk func_32k_ck = { 52static struct clk func_32k_ck = {
56 .name = "func_32k_ck", 53 .name = "func_32k_ck",
57 .ops = &clkops_null, 54 .ops = &clkops_null,
58 .rate = 32000, 55 .rate = 32768,
59 .clkdm_name = "wkup_clkdm", 56 .clkdm_name = "wkup_clkdm",
60}; 57};
61 58
@@ -116,7 +113,6 @@ static struct dpll_data dpll_dd = {
116 .max_multiplier = 1023, 113 .max_multiplier = 1023,
117 .min_divider = 1, 114 .min_divider = 1,
118 .max_divider = 16, 115 .max_divider = 16,
119 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
120}; 116};
121 117
122/* 118/*
@@ -125,7 +121,7 @@ static struct dpll_data dpll_dd = {
125 */ 121 */
126static struct clk dpll_ck = { 122static struct clk dpll_ck = {
127 .name = "dpll_ck", 123 .name = "dpll_ck",
128 .ops = &clkops_null, 124 .ops = &clkops_omap2xxx_dpll_ops,
129 .parent = &sys_ck, /* Can be func_32k also */ 125 .parent = &sys_ck, /* Can be func_32k also */
130 .dpll_data = &dpll_dd, 126 .dpll_data = &dpll_dd,
131 .clkdm_name = "wkup_clkdm", 127 .clkdm_name = "wkup_clkdm",
@@ -434,37 +430,23 @@ static struct clk dsp_fck = {
434 .recalc = &omap2_clksel_recalc, 430 .recalc = &omap2_clksel_recalc,
435}; 431};
436 432
437/* DSP interface clock */ 433static const struct clksel dsp_ick_clksel[] = {
438static const struct clksel_rate dsp_irate_ick_rates[] = { 434 { .parent = &dsp_fck, .rates = dsp_ick_rates },
439 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
440 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
441 { .div = 3, .val = 3, .flags = RATE_IN_243X },
442 { .div = 0 },
443};
444
445static const struct clksel dsp_irate_ick_clksel[] = {
446 { .parent = &dsp_fck, .rates = dsp_irate_ick_rates },
447 { .parent = NULL } 435 { .parent = NULL }
448}; 436};
449 437
450/* This clock does not exist as such in the TRM. */
451static struct clk dsp_irate_ick = {
452 .name = "dsp_irate_ick",
453 .ops = &clkops_null,
454 .parent = &dsp_fck,
455 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
456 .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK,
457 .clksel = dsp_irate_ick_clksel,
458 .recalc = &omap2_clksel_recalc,
459};
460
461/* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */ 438/* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */
462static struct clk iva2_1_ick = { 439static struct clk iva2_1_ick = {
463 .name = "iva2_1_ick", 440 .name = "iva2_1_ick",
464 .ops = &clkops_omap2_dflt_wait, 441 .ops = &clkops_omap2_dflt_wait,
465 .parent = &dsp_irate_ick, 442 .parent = &dsp_fck,
443 .clkdm_name = "dsp_clkdm",
466 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), 444 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
467 .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, 445 .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
446 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
447 .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK,
448 .clksel = dsp_ick_clksel,
449 .recalc = &omap2_clksel_recalc,
468}; 450};
469 451
470/* 452/*
@@ -525,7 +507,7 @@ static const struct clksel usb_l4_ick_clksel[] = {
525/* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */ 507/* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */
526static struct clk usb_l4_ick = { /* FS-USB interface clock */ 508static struct clk usb_l4_ick = { /* FS-USB interface clock */
527 .name = "usb_l4_ick", 509 .name = "usb_l4_ick",
528 .ops = &clkops_omap2_dflt_wait, 510 .ops = &clkops_omap2_iclk_dflt_wait,
529 .parent = &core_l3_ck, 511 .parent = &core_l3_ck,
530 .clkdm_name = "core_l4_clkdm", 512 .clkdm_name = "core_l4_clkdm",
531 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 513 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -606,7 +588,7 @@ static struct clk ssi_ssr_sst_fck = {
606 */ 588 */
607static struct clk ssi_l4_ick = { 589static struct clk ssi_l4_ick = {
608 .name = "ssi_l4_ick", 590 .name = "ssi_l4_ick",
609 .ops = &clkops_omap2_dflt_wait, 591 .ops = &clkops_omap2_iclk_dflt_wait,
610 .parent = &l4_ck, 592 .parent = &l4_ck,
611 .clkdm_name = "core_l4_clkdm", 593 .clkdm_name = "core_l4_clkdm",
612 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 594 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -661,6 +643,7 @@ static struct clk gfx_2d_fck = {
661 .recalc = &omap2_clksel_recalc, 643 .recalc = &omap2_clksel_recalc,
662}; 644};
663 645
646/* This interface clock does not have a CM_AUTOIDLE bit */
664static struct clk gfx_ick = { 647static struct clk gfx_ick = {
665 .name = "gfx_ick", /* From l3 */ 648 .name = "gfx_ick", /* From l3 */
666 .ops = &clkops_omap2_dflt_wait, 649 .ops = &clkops_omap2_dflt_wait,
@@ -693,7 +676,7 @@ static const struct clksel mdm_ick_clksel[] = {
693 676
694static struct clk mdm_ick = { /* used both as a ick and fck */ 677static struct clk mdm_ick = { /* used both as a ick and fck */
695 .name = "mdm_ick", 678 .name = "mdm_ick",
696 .ops = &clkops_omap2_dflt_wait, 679 .ops = &clkops_omap2_iclk_dflt_wait,
697 .parent = &core_ck, 680 .parent = &core_ck,
698 .clkdm_name = "mdm_clkdm", 681 .clkdm_name = "mdm_clkdm",
699 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN), 682 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN),
@@ -706,7 +689,7 @@ static struct clk mdm_ick = { /* used both as a ick and fck */
706 689
707static struct clk mdm_osc_ck = { 690static struct clk mdm_osc_ck = {
708 .name = "mdm_osc_ck", 691 .name = "mdm_osc_ck",
709 .ops = &clkops_omap2_dflt_wait, 692 .ops = &clkops_omap2_mdmclk_dflt_wait,
710 .parent = &osc_ck, 693 .parent = &osc_ck,
711 .clkdm_name = "mdm_clkdm", 694 .clkdm_name = "mdm_clkdm",
712 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN), 695 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN),
@@ -751,7 +734,7 @@ static const struct clksel dss1_fck_clksel[] = {
751 734
752static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */ 735static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */
753 .name = "dss_ick", 736 .name = "dss_ick",
754 .ops = &clkops_omap2_dflt, 737 .ops = &clkops_omap2_iclk_dflt,
755 .parent = &l4_ck, /* really both l3 and l4 */ 738 .parent = &l4_ck, /* really both l3 and l4 */
756 .clkdm_name = "dss_clkdm", 739 .clkdm_name = "dss_clkdm",
757 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 740 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -813,6 +796,14 @@ static struct clk dss_54m_fck = { /* Alt clk used in power management */
813 .recalc = &followparent_recalc, 796 .recalc = &followparent_recalc,
814}; 797};
815 798
799static struct clk wu_l4_ick = {
800 .name = "wu_l4_ick",
801 .ops = &clkops_null,
802 .parent = &sys_ck,
803 .clkdm_name = "wkup_clkdm",
804 .recalc = &followparent_recalc,
805};
806
816/* 807/*
817 * CORE power domain ICLK & FCLK defines. 808 * CORE power domain ICLK & FCLK defines.
818 * Many of the these can have more than one possible parent. Entries 809 * Many of the these can have more than one possible parent. Entries
@@ -833,9 +824,9 @@ static const struct clksel omap24xx_gpt_clksel[] = {
833 824
834static struct clk gpt1_ick = { 825static struct clk gpt1_ick = {
835 .name = "gpt1_ick", 826 .name = "gpt1_ick",
836 .ops = &clkops_omap2_dflt_wait, 827 .ops = &clkops_omap2_iclk_dflt_wait,
837 .parent = &l4_ck, 828 .parent = &wu_l4_ick,
838 .clkdm_name = "core_l4_clkdm", 829 .clkdm_name = "wkup_clkdm",
839 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 830 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
840 .enable_bit = OMAP24XX_EN_GPT1_SHIFT, 831 .enable_bit = OMAP24XX_EN_GPT1_SHIFT,
841 .recalc = &followparent_recalc, 832 .recalc = &followparent_recalc,
@@ -859,7 +850,7 @@ static struct clk gpt1_fck = {
859 850
860static struct clk gpt2_ick = { 851static struct clk gpt2_ick = {
861 .name = "gpt2_ick", 852 .name = "gpt2_ick",
862 .ops = &clkops_omap2_dflt_wait, 853 .ops = &clkops_omap2_iclk_dflt_wait,
863 .parent = &l4_ck, 854 .parent = &l4_ck,
864 .clkdm_name = "core_l4_clkdm", 855 .clkdm_name = "core_l4_clkdm",
865 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 856 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -883,7 +874,7 @@ static struct clk gpt2_fck = {
883 874
884static struct clk gpt3_ick = { 875static struct clk gpt3_ick = {
885 .name = "gpt3_ick", 876 .name = "gpt3_ick",
886 .ops = &clkops_omap2_dflt_wait, 877 .ops = &clkops_omap2_iclk_dflt_wait,
887 .parent = &l4_ck, 878 .parent = &l4_ck,
888 .clkdm_name = "core_l4_clkdm", 879 .clkdm_name = "core_l4_clkdm",
889 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 880 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -907,7 +898,7 @@ static struct clk gpt3_fck = {
907 898
908static struct clk gpt4_ick = { 899static struct clk gpt4_ick = {
909 .name = "gpt4_ick", 900 .name = "gpt4_ick",
910 .ops = &clkops_omap2_dflt_wait, 901 .ops = &clkops_omap2_iclk_dflt_wait,
911 .parent = &l4_ck, 902 .parent = &l4_ck,
912 .clkdm_name = "core_l4_clkdm", 903 .clkdm_name = "core_l4_clkdm",
913 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 904 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -931,7 +922,7 @@ static struct clk gpt4_fck = {
931 922
932static struct clk gpt5_ick = { 923static struct clk gpt5_ick = {
933 .name = "gpt5_ick", 924 .name = "gpt5_ick",
934 .ops = &clkops_omap2_dflt_wait, 925 .ops = &clkops_omap2_iclk_dflt_wait,
935 .parent = &l4_ck, 926 .parent = &l4_ck,
936 .clkdm_name = "core_l4_clkdm", 927 .clkdm_name = "core_l4_clkdm",
937 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 928 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -955,7 +946,7 @@ static struct clk gpt5_fck = {
955 946
956static struct clk gpt6_ick = { 947static struct clk gpt6_ick = {
957 .name = "gpt6_ick", 948 .name = "gpt6_ick",
958 .ops = &clkops_omap2_dflt_wait, 949 .ops = &clkops_omap2_iclk_dflt_wait,
959 .parent = &l4_ck, 950 .parent = &l4_ck,
960 .clkdm_name = "core_l4_clkdm", 951 .clkdm_name = "core_l4_clkdm",
961 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 952 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -979,8 +970,9 @@ static struct clk gpt6_fck = {
979 970
980static struct clk gpt7_ick = { 971static struct clk gpt7_ick = {
981 .name = "gpt7_ick", 972 .name = "gpt7_ick",
982 .ops = &clkops_omap2_dflt_wait, 973 .ops = &clkops_omap2_iclk_dflt_wait,
983 .parent = &l4_ck, 974 .parent = &l4_ck,
975 .clkdm_name = "core_l4_clkdm",
984 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 976 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
985 .enable_bit = OMAP24XX_EN_GPT7_SHIFT, 977 .enable_bit = OMAP24XX_EN_GPT7_SHIFT,
986 .recalc = &followparent_recalc, 978 .recalc = &followparent_recalc,
@@ -1002,7 +994,7 @@ static struct clk gpt7_fck = {
1002 994
1003static struct clk gpt8_ick = { 995static struct clk gpt8_ick = {
1004 .name = "gpt8_ick", 996 .name = "gpt8_ick",
1005 .ops = &clkops_omap2_dflt_wait, 997 .ops = &clkops_omap2_iclk_dflt_wait,
1006 .parent = &l4_ck, 998 .parent = &l4_ck,
1007 .clkdm_name = "core_l4_clkdm", 999 .clkdm_name = "core_l4_clkdm",
1008 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1000 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1026,7 +1018,7 @@ static struct clk gpt8_fck = {
1026 1018
1027static struct clk gpt9_ick = { 1019static struct clk gpt9_ick = {
1028 .name = "gpt9_ick", 1020 .name = "gpt9_ick",
1029 .ops = &clkops_omap2_dflt_wait, 1021 .ops = &clkops_omap2_iclk_dflt_wait,
1030 .parent = &l4_ck, 1022 .parent = &l4_ck,
1031 .clkdm_name = "core_l4_clkdm", 1023 .clkdm_name = "core_l4_clkdm",
1032 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1024 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1050,7 +1042,7 @@ static struct clk gpt9_fck = {
1050 1042
1051static struct clk gpt10_ick = { 1043static struct clk gpt10_ick = {
1052 .name = "gpt10_ick", 1044 .name = "gpt10_ick",
1053 .ops = &clkops_omap2_dflt_wait, 1045 .ops = &clkops_omap2_iclk_dflt_wait,
1054 .parent = &l4_ck, 1046 .parent = &l4_ck,
1055 .clkdm_name = "core_l4_clkdm", 1047 .clkdm_name = "core_l4_clkdm",
1056 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1048 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1074,7 +1066,7 @@ static struct clk gpt10_fck = {
1074 1066
1075static struct clk gpt11_ick = { 1067static struct clk gpt11_ick = {
1076 .name = "gpt11_ick", 1068 .name = "gpt11_ick",
1077 .ops = &clkops_omap2_dflt_wait, 1069 .ops = &clkops_omap2_iclk_dflt_wait,
1078 .parent = &l4_ck, 1070 .parent = &l4_ck,
1079 .clkdm_name = "core_l4_clkdm", 1071 .clkdm_name = "core_l4_clkdm",
1080 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1072 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1098,7 +1090,7 @@ static struct clk gpt11_fck = {
1098 1090
1099static struct clk gpt12_ick = { 1091static struct clk gpt12_ick = {
1100 .name = "gpt12_ick", 1092 .name = "gpt12_ick",
1101 .ops = &clkops_omap2_dflt_wait, 1093 .ops = &clkops_omap2_iclk_dflt_wait,
1102 .parent = &l4_ck, 1094 .parent = &l4_ck,
1103 .clkdm_name = "core_l4_clkdm", 1095 .clkdm_name = "core_l4_clkdm",
1104 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1096 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1122,7 +1114,7 @@ static struct clk gpt12_fck = {
1122 1114
1123static struct clk mcbsp1_ick = { 1115static struct clk mcbsp1_ick = {
1124 .name = "mcbsp1_ick", 1116 .name = "mcbsp1_ick",
1125 .ops = &clkops_omap2_dflt_wait, 1117 .ops = &clkops_omap2_iclk_dflt_wait,
1126 .parent = &l4_ck, 1118 .parent = &l4_ck,
1127 .clkdm_name = "core_l4_clkdm", 1119 .clkdm_name = "core_l4_clkdm",
1128 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1120 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1162,7 +1154,7 @@ static struct clk mcbsp1_fck = {
1162 1154
1163static struct clk mcbsp2_ick = { 1155static struct clk mcbsp2_ick = {
1164 .name = "mcbsp2_ick", 1156 .name = "mcbsp2_ick",
1165 .ops = &clkops_omap2_dflt_wait, 1157 .ops = &clkops_omap2_iclk_dflt_wait,
1166 .parent = &l4_ck, 1158 .parent = &l4_ck,
1167 .clkdm_name = "core_l4_clkdm", 1159 .clkdm_name = "core_l4_clkdm",
1168 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1160 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1186,7 +1178,7 @@ static struct clk mcbsp2_fck = {
1186 1178
1187static struct clk mcbsp3_ick = { 1179static struct clk mcbsp3_ick = {
1188 .name = "mcbsp3_ick", 1180 .name = "mcbsp3_ick",
1189 .ops = &clkops_omap2_dflt_wait, 1181 .ops = &clkops_omap2_iclk_dflt_wait,
1190 .parent = &l4_ck, 1182 .parent = &l4_ck,
1191 .clkdm_name = "core_l4_clkdm", 1183 .clkdm_name = "core_l4_clkdm",
1192 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1184 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1210,7 +1202,7 @@ static struct clk mcbsp3_fck = {
1210 1202
1211static struct clk mcbsp4_ick = { 1203static struct clk mcbsp4_ick = {
1212 .name = "mcbsp4_ick", 1204 .name = "mcbsp4_ick",
1213 .ops = &clkops_omap2_dflt_wait, 1205 .ops = &clkops_omap2_iclk_dflt_wait,
1214 .parent = &l4_ck, 1206 .parent = &l4_ck,
1215 .clkdm_name = "core_l4_clkdm", 1207 .clkdm_name = "core_l4_clkdm",
1216 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1208 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1234,7 +1226,7 @@ static struct clk mcbsp4_fck = {
1234 1226
1235static struct clk mcbsp5_ick = { 1227static struct clk mcbsp5_ick = {
1236 .name = "mcbsp5_ick", 1228 .name = "mcbsp5_ick",
1237 .ops = &clkops_omap2_dflt_wait, 1229 .ops = &clkops_omap2_iclk_dflt_wait,
1238 .parent = &l4_ck, 1230 .parent = &l4_ck,
1239 .clkdm_name = "core_l4_clkdm", 1231 .clkdm_name = "core_l4_clkdm",
1240 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1232 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1258,7 +1250,7 @@ static struct clk mcbsp5_fck = {
1258 1250
1259static struct clk mcspi1_ick = { 1251static struct clk mcspi1_ick = {
1260 .name = "mcspi1_ick", 1252 .name = "mcspi1_ick",
1261 .ops = &clkops_omap2_dflt_wait, 1253 .ops = &clkops_omap2_iclk_dflt_wait,
1262 .parent = &l4_ck, 1254 .parent = &l4_ck,
1263 .clkdm_name = "core_l4_clkdm", 1255 .clkdm_name = "core_l4_clkdm",
1264 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1256 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1278,7 +1270,7 @@ static struct clk mcspi1_fck = {
1278 1270
1279static struct clk mcspi2_ick = { 1271static struct clk mcspi2_ick = {
1280 .name = "mcspi2_ick", 1272 .name = "mcspi2_ick",
1281 .ops = &clkops_omap2_dflt_wait, 1273 .ops = &clkops_omap2_iclk_dflt_wait,
1282 .parent = &l4_ck, 1274 .parent = &l4_ck,
1283 .clkdm_name = "core_l4_clkdm", 1275 .clkdm_name = "core_l4_clkdm",
1284 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1276 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1298,7 +1290,7 @@ static struct clk mcspi2_fck = {
1298 1290
1299static struct clk mcspi3_ick = { 1291static struct clk mcspi3_ick = {
1300 .name = "mcspi3_ick", 1292 .name = "mcspi3_ick",
1301 .ops = &clkops_omap2_dflt_wait, 1293 .ops = &clkops_omap2_iclk_dflt_wait,
1302 .parent = &l4_ck, 1294 .parent = &l4_ck,
1303 .clkdm_name = "core_l4_clkdm", 1295 .clkdm_name = "core_l4_clkdm",
1304 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1296 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1318,7 +1310,7 @@ static struct clk mcspi3_fck = {
1318 1310
1319static struct clk uart1_ick = { 1311static struct clk uart1_ick = {
1320 .name = "uart1_ick", 1312 .name = "uart1_ick",
1321 .ops = &clkops_omap2_dflt_wait, 1313 .ops = &clkops_omap2_iclk_dflt_wait,
1322 .parent = &l4_ck, 1314 .parent = &l4_ck,
1323 .clkdm_name = "core_l4_clkdm", 1315 .clkdm_name = "core_l4_clkdm",
1324 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1316 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1338,7 +1330,7 @@ static struct clk uart1_fck = {
1338 1330
1339static struct clk uart2_ick = { 1331static struct clk uart2_ick = {
1340 .name = "uart2_ick", 1332 .name = "uart2_ick",
1341 .ops = &clkops_omap2_dflt_wait, 1333 .ops = &clkops_omap2_iclk_dflt_wait,
1342 .parent = &l4_ck, 1334 .parent = &l4_ck,
1343 .clkdm_name = "core_l4_clkdm", 1335 .clkdm_name = "core_l4_clkdm",
1344 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1336 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1358,7 +1350,7 @@ static struct clk uart2_fck = {
1358 1350
1359static struct clk uart3_ick = { 1351static struct clk uart3_ick = {
1360 .name = "uart3_ick", 1352 .name = "uart3_ick",
1361 .ops = &clkops_omap2_dflt_wait, 1353 .ops = &clkops_omap2_iclk_dflt_wait,
1362 .parent = &l4_ck, 1354 .parent = &l4_ck,
1363 .clkdm_name = "core_l4_clkdm", 1355 .clkdm_name = "core_l4_clkdm",
1364 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1356 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1378,9 +1370,9 @@ static struct clk uart3_fck = {
1378 1370
1379static struct clk gpios_ick = { 1371static struct clk gpios_ick = {
1380 .name = "gpios_ick", 1372 .name = "gpios_ick",
1381 .ops = &clkops_omap2_dflt_wait, 1373 .ops = &clkops_omap2_iclk_dflt_wait,
1382 .parent = &l4_ck, 1374 .parent = &wu_l4_ick,
1383 .clkdm_name = "core_l4_clkdm", 1375 .clkdm_name = "wkup_clkdm",
1384 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1376 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1385 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, 1377 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
1386 .recalc = &followparent_recalc, 1378 .recalc = &followparent_recalc,
@@ -1398,9 +1390,9 @@ static struct clk gpios_fck = {
1398 1390
1399static struct clk mpu_wdt_ick = { 1391static struct clk mpu_wdt_ick = {
1400 .name = "mpu_wdt_ick", 1392 .name = "mpu_wdt_ick",
1401 .ops = &clkops_omap2_dflt_wait, 1393 .ops = &clkops_omap2_iclk_dflt_wait,
1402 .parent = &l4_ck, 1394 .parent = &wu_l4_ick,
1403 .clkdm_name = "core_l4_clkdm", 1395 .clkdm_name = "wkup_clkdm",
1404 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1396 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1405 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, 1397 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
1406 .recalc = &followparent_recalc, 1398 .recalc = &followparent_recalc,
@@ -1418,10 +1410,10 @@ static struct clk mpu_wdt_fck = {
1418 1410
1419static struct clk sync_32k_ick = { 1411static struct clk sync_32k_ick = {
1420 .name = "sync_32k_ick", 1412 .name = "sync_32k_ick",
1421 .ops = &clkops_omap2_dflt_wait, 1413 .ops = &clkops_omap2_iclk_dflt_wait,
1422 .parent = &l4_ck,
1423 .flags = ENABLE_ON_INIT, 1414 .flags = ENABLE_ON_INIT,
1424 .clkdm_name = "core_l4_clkdm", 1415 .parent = &wu_l4_ick,
1416 .clkdm_name = "wkup_clkdm",
1425 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1417 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1426 .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT, 1418 .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT,
1427 .recalc = &followparent_recalc, 1419 .recalc = &followparent_recalc,
@@ -1429,9 +1421,9 @@ static struct clk sync_32k_ick = {
1429 1421
1430static struct clk wdt1_ick = { 1422static struct clk wdt1_ick = {
1431 .name = "wdt1_ick", 1423 .name = "wdt1_ick",
1432 .ops = &clkops_omap2_dflt_wait, 1424 .ops = &clkops_omap2_iclk_dflt_wait,
1433 .parent = &l4_ck, 1425 .parent = &wu_l4_ick,
1434 .clkdm_name = "core_l4_clkdm", 1426 .clkdm_name = "wkup_clkdm",
1435 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1427 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1436 .enable_bit = OMAP24XX_EN_WDT1_SHIFT, 1428 .enable_bit = OMAP24XX_EN_WDT1_SHIFT,
1437 .recalc = &followparent_recalc, 1429 .recalc = &followparent_recalc,
@@ -1439,10 +1431,10 @@ static struct clk wdt1_ick = {
1439 1431
1440static struct clk omapctrl_ick = { 1432static struct clk omapctrl_ick = {
1441 .name = "omapctrl_ick", 1433 .name = "omapctrl_ick",
1442 .ops = &clkops_omap2_dflt_wait, 1434 .ops = &clkops_omap2_iclk_dflt_wait,
1443 .parent = &l4_ck,
1444 .flags = ENABLE_ON_INIT, 1435 .flags = ENABLE_ON_INIT,
1445 .clkdm_name = "core_l4_clkdm", 1436 .parent = &wu_l4_ick,
1437 .clkdm_name = "wkup_clkdm",
1446 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1438 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1447 .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT, 1439 .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT,
1448 .recalc = &followparent_recalc, 1440 .recalc = &followparent_recalc,
@@ -1450,9 +1442,9 @@ static struct clk omapctrl_ick = {
1450 1442
1451static struct clk icr_ick = { 1443static struct clk icr_ick = {
1452 .name = "icr_ick", 1444 .name = "icr_ick",
1453 .ops = &clkops_omap2_dflt_wait, 1445 .ops = &clkops_omap2_iclk_dflt_wait,
1454 .parent = &l4_ck, 1446 .parent = &wu_l4_ick,
1455 .clkdm_name = "core_l4_clkdm", 1447 .clkdm_name = "wkup_clkdm",
1456 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1448 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1457 .enable_bit = OMAP2430_EN_ICR_SHIFT, 1449 .enable_bit = OMAP2430_EN_ICR_SHIFT,
1458 .recalc = &followparent_recalc, 1450 .recalc = &followparent_recalc,
@@ -1460,7 +1452,7 @@ static struct clk icr_ick = {
1460 1452
1461static struct clk cam_ick = { 1453static struct clk cam_ick = {
1462 .name = "cam_ick", 1454 .name = "cam_ick",
1463 .ops = &clkops_omap2_dflt, 1455 .ops = &clkops_omap2_iclk_dflt,
1464 .parent = &l4_ck, 1456 .parent = &l4_ck,
1465 .clkdm_name = "core_l4_clkdm", 1457 .clkdm_name = "core_l4_clkdm",
1466 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1458 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1485,7 +1477,7 @@ static struct clk cam_fck = {
1485 1477
1486static struct clk mailboxes_ick = { 1478static struct clk mailboxes_ick = {
1487 .name = "mailboxes_ick", 1479 .name = "mailboxes_ick",
1488 .ops = &clkops_omap2_dflt_wait, 1480 .ops = &clkops_omap2_iclk_dflt_wait,
1489 .parent = &l4_ck, 1481 .parent = &l4_ck,
1490 .clkdm_name = "core_l4_clkdm", 1482 .clkdm_name = "core_l4_clkdm",
1491 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1483 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1495,7 +1487,7 @@ static struct clk mailboxes_ick = {
1495 1487
1496static struct clk wdt4_ick = { 1488static struct clk wdt4_ick = {
1497 .name = "wdt4_ick", 1489 .name = "wdt4_ick",
1498 .ops = &clkops_omap2_dflt_wait, 1490 .ops = &clkops_omap2_iclk_dflt_wait,
1499 .parent = &l4_ck, 1491 .parent = &l4_ck,
1500 .clkdm_name = "core_l4_clkdm", 1492 .clkdm_name = "core_l4_clkdm",
1501 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1493 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1515,7 +1507,7 @@ static struct clk wdt4_fck = {
1515 1507
1516static struct clk mspro_ick = { 1508static struct clk mspro_ick = {
1517 .name = "mspro_ick", 1509 .name = "mspro_ick",
1518 .ops = &clkops_omap2_dflt_wait, 1510 .ops = &clkops_omap2_iclk_dflt_wait,
1519 .parent = &l4_ck, 1511 .parent = &l4_ck,
1520 .clkdm_name = "core_l4_clkdm", 1512 .clkdm_name = "core_l4_clkdm",
1521 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1513 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1535,7 +1527,7 @@ static struct clk mspro_fck = {
1535 1527
1536static struct clk fac_ick = { 1528static struct clk fac_ick = {
1537 .name = "fac_ick", 1529 .name = "fac_ick",
1538 .ops = &clkops_omap2_dflt_wait, 1530 .ops = &clkops_omap2_iclk_dflt_wait,
1539 .parent = &l4_ck, 1531 .parent = &l4_ck,
1540 .clkdm_name = "core_l4_clkdm", 1532 .clkdm_name = "core_l4_clkdm",
1541 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1533 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1555,7 +1547,7 @@ static struct clk fac_fck = {
1555 1547
1556static struct clk hdq_ick = { 1548static struct clk hdq_ick = {
1557 .name = "hdq_ick", 1549 .name = "hdq_ick",
1558 .ops = &clkops_omap2_dflt_wait, 1550 .ops = &clkops_omap2_iclk_dflt_wait,
1559 .parent = &l4_ck, 1551 .parent = &l4_ck,
1560 .clkdm_name = "core_l4_clkdm", 1552 .clkdm_name = "core_l4_clkdm",
1561 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1553 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1579,7 +1571,7 @@ static struct clk hdq_fck = {
1579 */ 1571 */
1580static struct clk i2c2_ick = { 1572static struct clk i2c2_ick = {
1581 .name = "i2c2_ick", 1573 .name = "i2c2_ick",
1582 .ops = &clkops_omap2_dflt_wait, 1574 .ops = &clkops_omap2_iclk_dflt_wait,
1583 .parent = &l4_ck, 1575 .parent = &l4_ck,
1584 .clkdm_name = "core_l4_clkdm", 1576 .clkdm_name = "core_l4_clkdm",
1585 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1577 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1603,7 +1595,7 @@ static struct clk i2chs2_fck = {
1603 */ 1595 */
1604static struct clk i2c1_ick = { 1596static struct clk i2c1_ick = {
1605 .name = "i2c1_ick", 1597 .name = "i2c1_ick",
1606 .ops = &clkops_omap2_dflt_wait, 1598 .ops = &clkops_omap2_iclk_dflt_wait,
1607 .parent = &l4_ck, 1599 .parent = &l4_ck,
1608 .clkdm_name = "core_l4_clkdm", 1600 .clkdm_name = "core_l4_clkdm",
1609 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1601 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1621,12 +1613,18 @@ static struct clk i2chs1_fck = {
1621 .recalc = &followparent_recalc, 1613 .recalc = &followparent_recalc,
1622}; 1614};
1623 1615
1616/*
1617 * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE
1618 * accesses derived from this data.
1619 */
1624static struct clk gpmc_fck = { 1620static struct clk gpmc_fck = {
1625 .name = "gpmc_fck", 1621 .name = "gpmc_fck",
1626 .ops = &clkops_null, /* RMK: missing? */ 1622 .ops = &clkops_omap2_iclk_idle_only,
1627 .parent = &core_l3_ck, 1623 .parent = &core_l3_ck,
1628 .flags = ENABLE_ON_INIT, 1624 .flags = ENABLE_ON_INIT,
1629 .clkdm_name = "core_l3_clkdm", 1625 .clkdm_name = "core_l3_clkdm",
1626 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1627 .enable_bit = OMAP24XX_AUTO_GPMC_SHIFT,
1630 .recalc = &followparent_recalc, 1628 .recalc = &followparent_recalc,
1631}; 1629};
1632 1630
@@ -1638,20 +1636,26 @@ static struct clk sdma_fck = {
1638 .recalc = &followparent_recalc, 1636 .recalc = &followparent_recalc,
1639}; 1637};
1640 1638
1639/*
1640 * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE
1641 * accesses derived from this data.
1642 */
1641static struct clk sdma_ick = { 1643static struct clk sdma_ick = {
1642 .name = "sdma_ick", 1644 .name = "sdma_ick",
1643 .ops = &clkops_null, /* RMK: missing? */ 1645 .ops = &clkops_omap2_iclk_idle_only,
1644 .parent = &l4_ck, 1646 .parent = &core_l3_ck,
1645 .clkdm_name = "core_l3_clkdm", 1647 .clkdm_name = "core_l3_clkdm",
1648 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1649 .enable_bit = OMAP24XX_AUTO_SDMA_SHIFT,
1646 .recalc = &followparent_recalc, 1650 .recalc = &followparent_recalc,
1647}; 1651};
1648 1652
1649static struct clk sdrc_ick = { 1653static struct clk sdrc_ick = {
1650 .name = "sdrc_ick", 1654 .name = "sdrc_ick",
1651 .ops = &clkops_omap2_dflt_wait, 1655 .ops = &clkops_omap2_iclk_idle_only,
1652 .parent = &l4_ck, 1656 .parent = &core_l3_ck,
1653 .flags = ENABLE_ON_INIT, 1657 .flags = ENABLE_ON_INIT,
1654 .clkdm_name = "core_l4_clkdm", 1658 .clkdm_name = "core_l3_clkdm",
1655 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), 1659 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1656 .enable_bit = OMAP2430_EN_SDRC_SHIFT, 1660 .enable_bit = OMAP2430_EN_SDRC_SHIFT,
1657 .recalc = &followparent_recalc, 1661 .recalc = &followparent_recalc,
@@ -1659,7 +1663,7 @@ static struct clk sdrc_ick = {
1659 1663
1660static struct clk des_ick = { 1664static struct clk des_ick = {
1661 .name = "des_ick", 1665 .name = "des_ick",
1662 .ops = &clkops_omap2_dflt_wait, 1666 .ops = &clkops_omap2_iclk_dflt_wait,
1663 .parent = &l4_ck, 1667 .parent = &l4_ck,
1664 .clkdm_name = "core_l4_clkdm", 1668 .clkdm_name = "core_l4_clkdm",
1665 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 1669 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
@@ -1669,7 +1673,7 @@ static struct clk des_ick = {
1669 1673
1670static struct clk sha_ick = { 1674static struct clk sha_ick = {
1671 .name = "sha_ick", 1675 .name = "sha_ick",
1672 .ops = &clkops_omap2_dflt_wait, 1676 .ops = &clkops_omap2_iclk_dflt_wait,
1673 .parent = &l4_ck, 1677 .parent = &l4_ck,
1674 .clkdm_name = "core_l4_clkdm", 1678 .clkdm_name = "core_l4_clkdm",
1675 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 1679 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
@@ -1679,7 +1683,7 @@ static struct clk sha_ick = {
1679 1683
1680static struct clk rng_ick = { 1684static struct clk rng_ick = {
1681 .name = "rng_ick", 1685 .name = "rng_ick",
1682 .ops = &clkops_omap2_dflt_wait, 1686 .ops = &clkops_omap2_iclk_dflt_wait,
1683 .parent = &l4_ck, 1687 .parent = &l4_ck,
1684 .clkdm_name = "core_l4_clkdm", 1688 .clkdm_name = "core_l4_clkdm",
1685 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 1689 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
@@ -1689,7 +1693,7 @@ static struct clk rng_ick = {
1689 1693
1690static struct clk aes_ick = { 1694static struct clk aes_ick = {
1691 .name = "aes_ick", 1695 .name = "aes_ick",
1692 .ops = &clkops_omap2_dflt_wait, 1696 .ops = &clkops_omap2_iclk_dflt_wait,
1693 .parent = &l4_ck, 1697 .parent = &l4_ck,
1694 .clkdm_name = "core_l4_clkdm", 1698 .clkdm_name = "core_l4_clkdm",
1695 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 1699 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
@@ -1699,7 +1703,7 @@ static struct clk aes_ick = {
1699 1703
1700static struct clk pka_ick = { 1704static struct clk pka_ick = {
1701 .name = "pka_ick", 1705 .name = "pka_ick",
1702 .ops = &clkops_omap2_dflt_wait, 1706 .ops = &clkops_omap2_iclk_dflt_wait,
1703 .parent = &l4_ck, 1707 .parent = &l4_ck,
1704 .clkdm_name = "core_l4_clkdm", 1708 .clkdm_name = "core_l4_clkdm",
1705 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 1709 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
@@ -1719,7 +1723,7 @@ static struct clk usb_fck = {
1719 1723
1720static struct clk usbhs_ick = { 1724static struct clk usbhs_ick = {
1721 .name = "usbhs_ick", 1725 .name = "usbhs_ick",
1722 .ops = &clkops_omap2_dflt_wait, 1726 .ops = &clkops_omap2_iclk_dflt_wait,
1723 .parent = &core_l3_ck, 1727 .parent = &core_l3_ck,
1724 .clkdm_name = "core_l3_clkdm", 1728 .clkdm_name = "core_l3_clkdm",
1725 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1729 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1729,7 +1733,7 @@ static struct clk usbhs_ick = {
1729 1733
1730static struct clk mmchs1_ick = { 1734static struct clk mmchs1_ick = {
1731 .name = "mmchs1_ick", 1735 .name = "mmchs1_ick",
1732 .ops = &clkops_omap2_dflt_wait, 1736 .ops = &clkops_omap2_iclk_dflt_wait,
1733 .parent = &l4_ck, 1737 .parent = &l4_ck,
1734 .clkdm_name = "core_l4_clkdm", 1738 .clkdm_name = "core_l4_clkdm",
1735 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1739 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1741,7 +1745,7 @@ static struct clk mmchs1_fck = {
1741 .name = "mmchs1_fck", 1745 .name = "mmchs1_fck",
1742 .ops = &clkops_omap2_dflt_wait, 1746 .ops = &clkops_omap2_dflt_wait,
1743 .parent = &func_96m_ck, 1747 .parent = &func_96m_ck,
1744 .clkdm_name = "core_l3_clkdm", 1748 .clkdm_name = "core_l4_clkdm",
1745 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 1749 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1746 .enable_bit = OMAP2430_EN_MMCHS1_SHIFT, 1750 .enable_bit = OMAP2430_EN_MMCHS1_SHIFT,
1747 .recalc = &followparent_recalc, 1751 .recalc = &followparent_recalc,
@@ -1749,7 +1753,7 @@ static struct clk mmchs1_fck = {
1749 1753
1750static struct clk mmchs2_ick = { 1754static struct clk mmchs2_ick = {
1751 .name = "mmchs2_ick", 1755 .name = "mmchs2_ick",
1752 .ops = &clkops_omap2_dflt_wait, 1756 .ops = &clkops_omap2_iclk_dflt_wait,
1753 .parent = &l4_ck, 1757 .parent = &l4_ck,
1754 .clkdm_name = "core_l4_clkdm", 1758 .clkdm_name = "core_l4_clkdm",
1755 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1759 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1761,6 +1765,7 @@ static struct clk mmchs2_fck = {
1761 .name = "mmchs2_fck", 1765 .name = "mmchs2_fck",
1762 .ops = &clkops_omap2_dflt_wait, 1766 .ops = &clkops_omap2_dflt_wait,
1763 .parent = &func_96m_ck, 1767 .parent = &func_96m_ck,
1768 .clkdm_name = "core_l4_clkdm",
1764 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 1769 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1765 .enable_bit = OMAP2430_EN_MMCHS2_SHIFT, 1770 .enable_bit = OMAP2430_EN_MMCHS2_SHIFT,
1766 .recalc = &followparent_recalc, 1771 .recalc = &followparent_recalc,
@@ -1768,7 +1773,7 @@ static struct clk mmchs2_fck = {
1768 1773
1769static struct clk gpio5_ick = { 1774static struct clk gpio5_ick = {
1770 .name = "gpio5_ick", 1775 .name = "gpio5_ick",
1771 .ops = &clkops_omap2_dflt_wait, 1776 .ops = &clkops_omap2_iclk_dflt_wait,
1772 .parent = &l4_ck, 1777 .parent = &l4_ck,
1773 .clkdm_name = "core_l4_clkdm", 1778 .clkdm_name = "core_l4_clkdm",
1774 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1779 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1788,7 +1793,7 @@ static struct clk gpio5_fck = {
1788 1793
1789static struct clk mdm_intc_ick = { 1794static struct clk mdm_intc_ick = {
1790 .name = "mdm_intc_ick", 1795 .name = "mdm_intc_ick",
1791 .ops = &clkops_omap2_dflt_wait, 1796 .ops = &clkops_omap2_iclk_dflt_wait,
1792 .parent = &l4_ck, 1797 .parent = &l4_ck,
1793 .clkdm_name = "core_l4_clkdm", 1798 .clkdm_name = "core_l4_clkdm",
1794 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1799 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1880,7 +1885,6 @@ static struct omap_clk omap2430_clks[] = {
1880 CLK(NULL, "mpu_ck", &mpu_ck, CK_243X), 1885 CLK(NULL, "mpu_ck", &mpu_ck, CK_243X),
1881 /* dsp domain clocks */ 1886 /* dsp domain clocks */
1882 CLK(NULL, "dsp_fck", &dsp_fck, CK_243X), 1887 CLK(NULL, "dsp_fck", &dsp_fck, CK_243X),
1883 CLK(NULL, "dsp_irate_ick", &dsp_irate_ick, CK_243X),
1884 CLK(NULL, "iva2_1_ick", &iva2_1_ick, CK_243X), 1888 CLK(NULL, "iva2_1_ick", &iva2_1_ick, CK_243X),
1885 /* GFX domain clocks */ 1889 /* GFX domain clocks */
1886 CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_243X), 1890 CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_243X),
@@ -1890,10 +1894,10 @@ static struct omap_clk omap2430_clks[] = {
1890 CLK(NULL, "mdm_ick", &mdm_ick, CK_243X), 1894 CLK(NULL, "mdm_ick", &mdm_ick, CK_243X),
1891 CLK(NULL, "mdm_osc_ck", &mdm_osc_ck, CK_243X), 1895 CLK(NULL, "mdm_osc_ck", &mdm_osc_ck, CK_243X),
1892 /* DSS domain clocks */ 1896 /* DSS domain clocks */
1893 CLK("omapdss", "ick", &dss_ick, CK_243X), 1897 CLK("omapdss_dss", "ick", &dss_ick, CK_243X),
1894 CLK("omapdss", "dss1_fck", &dss1_fck, CK_243X), 1898 CLK("omapdss_dss", "fck", &dss1_fck, CK_243X),
1895 CLK("omapdss", "dss2_fck", &dss2_fck, CK_243X), 1899 CLK("omapdss_dss", "sys_clk", &dss2_fck, CK_243X),
1896 CLK("omapdss", "tv_fck", &dss_54m_fck, CK_243X), 1900 CLK("omapdss_dss", "tv_clk", &dss_54m_fck, CK_243X),
1897 /* L3 domain clocks */ 1901 /* L3 domain clocks */
1898 CLK(NULL, "core_l3_ck", &core_l3_ck, CK_243X), 1902 CLK(NULL, "core_l3_ck", &core_l3_ck, CK_243X),
1899 CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_243X), 1903 CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_243X),
@@ -1901,6 +1905,7 @@ static struct omap_clk omap2430_clks[] = {
1901 /* L4 domain clocks */ 1905 /* L4 domain clocks */
1902 CLK(NULL, "l4_ck", &l4_ck, CK_243X), 1906 CLK(NULL, "l4_ck", &l4_ck, CK_243X),
1903 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X), 1907 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X),
1908 CLK(NULL, "wu_l4_ick", &wu_l4_ick, CK_243X),
1904 /* virtual meta-group clock */ 1909 /* virtual meta-group clock */
1905 CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X), 1910 CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X),
1906 /* general l4 interface ck, multi-parent functional clk */ 1911 /* general l4 interface ck, multi-parent functional clk */
@@ -1984,15 +1989,15 @@ static struct omap_clk omap2430_clks[] = {
1984 CLK(NULL, "pka_ick", &pka_ick, CK_243X), 1989 CLK(NULL, "pka_ick", &pka_ick, CK_243X),
1985 CLK(NULL, "usb_fck", &usb_fck, CK_243X), 1990 CLK(NULL, "usb_fck", &usb_fck, CK_243X),
1986 CLK("musb-omap2430", "ick", &usbhs_ick, CK_243X), 1991 CLK("musb-omap2430", "ick", &usbhs_ick, CK_243X),
1987 CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_243X), 1992 CLK("omap_hsmmc.0", "ick", &mmchs1_ick, CK_243X),
1988 CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_243X), 1993 CLK("omap_hsmmc.0", "fck", &mmchs1_fck, CK_243X),
1989 CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_243X), 1994 CLK("omap_hsmmc.1", "ick", &mmchs2_ick, CK_243X),
1990 CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_243X), 1995 CLK("omap_hsmmc.1", "fck", &mmchs2_fck, CK_243X),
1991 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X), 1996 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X),
1992 CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X), 1997 CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X),
1993 CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X), 1998 CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X),
1994 CLK("mmci-omap-hs.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X), 1999 CLK("omap_hsmmc.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X),
1995 CLK("mmci-omap-hs.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X), 2000 CLK("omap_hsmmc.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X),
1996}; 2001};
1997 2002
1998/* 2003/*
@@ -2028,6 +2033,9 @@ int __init omap2430_clk_init(void)
2028 omap2_init_clk_clkdm(c->lk.clk); 2033 omap2_init_clk_clkdm(c->lk.clk);
2029 } 2034 }
2030 2035
2036 /* Disable autoidle on all clocks; let the PM code enable it later */
2037 omap_clk_disable_autoidle_all();
2038
2031 /* Check the MPU rate set by bootloader */ 2039 /* Check the MPU rate set by bootloader */
2032 clkrate = omap2xxx_clk_get_core_rate(&dpll_ck); 2040 clkrate = omap2xxx_clk_get_core_rate(&dpll_ck);
2033 for (prcm = rate_table; prcm->mpu_speed; prcm++) { 2041 for (prcm = rate_table; prcm->mpu_speed; prcm++) {
diff --git a/arch/arm/mach-omap2/clock2xxx.h b/arch/arm/mach-omap2/clock2xxx.h
index 6a658b890c17..cb6df8ca9e4a 100644
--- a/arch/arm/mach-omap2/clock2xxx.h
+++ b/arch/arm/mach-omap2/clock2xxx.h
@@ -20,16 +20,16 @@ u32 omap2xxx_get_apll_clkin(void);
20u32 omap2xxx_get_sysclkdiv(void); 20u32 omap2xxx_get_sysclkdiv(void);
21void omap2xxx_clk_prepare_for_reboot(void); 21void omap2xxx_clk_prepare_for_reboot(void);
22 22
23#ifdef CONFIG_ARCH_OMAP2420 23#ifdef CONFIG_SOC_OMAP2420
24int omap2420_clk_init(void); 24int omap2420_clk_init(void);
25#else 25#else
26#define omap2420_clk_init() 0 26#define omap2420_clk_init() do { } while(0)
27#endif 27#endif
28 28
29#ifdef CONFIG_ARCH_OMAP2430 29#ifdef CONFIG_SOC_OMAP2430
30int omap2430_clk_init(void); 30int omap2430_clk_init(void);
31#else 31#else
32#define omap2430_clk_init() 0 32#define omap2430_clk_init() do { } while(0)
33#endif 33#endif
34 34
35extern void __iomem *prcm_clksrc_ctrl, *cm_idlest_pll; 35extern void __iomem *prcm_clksrc_ctrl, *cm_idlest_pll;
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index 287abc480924..1fc96b9ee330 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -2,7 +2,7 @@
2 * OMAP3-specific clock framework functions 2 * OMAP3-specific clock framework functions
3 * 3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008 Texas Instruments, Inc.
5 * Copyright (C) 2007-2010 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 * 6 *
7 * Paul Walmsley 7 * Paul Walmsley
8 * Jouni Högander 8 * Jouni Högander
@@ -59,6 +59,15 @@ const struct clkops clkops_omap3430es2_ssi_wait = {
59 .find_companion = omap2_clk_dflt_find_companion, 59 .find_companion = omap2_clk_dflt_find_companion,
60}; 60};
61 61
62const struct clkops clkops_omap3430es2_iclk_ssi_wait = {
63 .enable = omap2_dflt_clk_enable,
64 .disable = omap2_dflt_clk_disable,
65 .find_idlest = omap3430es2_clk_ssi_find_idlest,
66 .find_companion = omap2_clk_dflt_find_companion,
67 .allow_idle = omap2_clkt_iclk_allow_idle,
68 .deny_idle = omap2_clkt_iclk_deny_idle,
69};
70
62/** 71/**
63 * omap3430es2_clk_dss_usbhost_find_idlest - CM_IDLEST info for DSS, USBHOST 72 * omap3430es2_clk_dss_usbhost_find_idlest - CM_IDLEST info for DSS, USBHOST
64 * @clk: struct clk * being enabled 73 * @clk: struct clk * being enabled
@@ -94,6 +103,15 @@ const struct clkops clkops_omap3430es2_dss_usbhost_wait = {
94 .find_companion = omap2_clk_dflt_find_companion, 103 .find_companion = omap2_clk_dflt_find_companion,
95}; 104};
96 105
106const struct clkops clkops_omap3430es2_iclk_dss_usbhost_wait = {
107 .enable = omap2_dflt_clk_enable,
108 .disable = omap2_dflt_clk_disable,
109 .find_idlest = omap3430es2_clk_dss_usbhost_find_idlest,
110 .find_companion = omap2_clk_dflt_find_companion,
111 .allow_idle = omap2_clkt_iclk_allow_idle,
112 .deny_idle = omap2_clkt_iclk_deny_idle,
113};
114
97/** 115/**
98 * omap3430es2_clk_hsotgusb_find_idlest - return CM_IDLEST info for HSOTGUSB 116 * omap3430es2_clk_hsotgusb_find_idlest - return CM_IDLEST info for HSOTGUSB
99 * @clk: struct clk * being enabled 117 * @clk: struct clk * being enabled
@@ -124,3 +142,12 @@ const struct clkops clkops_omap3430es2_hsotgusb_wait = {
124 .find_idlest = omap3430es2_clk_hsotgusb_find_idlest, 142 .find_idlest = omap3430es2_clk_hsotgusb_find_idlest,
125 .find_companion = omap2_clk_dflt_find_companion, 143 .find_companion = omap2_clk_dflt_find_companion,
126}; 144};
145
146const struct clkops clkops_omap3430es2_iclk_hsotgusb_wait = {
147 .enable = omap2_dflt_clk_enable,
148 .disable = omap2_dflt_clk_disable,
149 .find_idlest = omap3430es2_clk_hsotgusb_find_idlest,
150 .find_companion = omap2_clk_dflt_find_companion,
151 .allow_idle = omap2_clkt_iclk_allow_idle,
152 .deny_idle = omap2_clkt_iclk_deny_idle,
153};
diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h
index 628e8de57680..084ba71b2b31 100644
--- a/arch/arm/mach-omap2/clock34xx.h
+++ b/arch/arm/mach-omap2/clock34xx.h
@@ -2,14 +2,17 @@
2 * OMAP34xx clock function prototypes and macros 2 * OMAP34xx clock function prototypes and macros
3 * 3 *
4 * Copyright (C) 2007-2010 Texas Instruments, Inc. 4 * Copyright (C) 2007-2010 Texas Instruments, Inc.
5 * Copyright (C) 2007-2010 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 */ 6 */
7 7
8#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H 8#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H
9#define __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H 9#define __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H
10 10
11extern const struct clkops clkops_omap3430es2_ssi_wait; 11extern const struct clkops clkops_omap3430es2_ssi_wait;
12extern const struct clkops clkops_omap3430es2_iclk_ssi_wait;
12extern const struct clkops clkops_omap3430es2_hsotgusb_wait; 13extern const struct clkops clkops_omap3430es2_hsotgusb_wait;
14extern const struct clkops clkops_omap3430es2_iclk_hsotgusb_wait;
13extern const struct clkops clkops_omap3430es2_dss_usbhost_wait; 15extern const struct clkops clkops_omap3430es2_dss_usbhost_wait;
16extern const struct clkops clkops_omap3430es2_iclk_dss_usbhost_wait;
14 17
15#endif 18#endif
diff --git a/arch/arm/mach-omap2/clock3517.c b/arch/arm/mach-omap2/clock3517.c
index 74116a3cf099..2e97d08f0e56 100644
--- a/arch/arm/mach-omap2/clock3517.c
+++ b/arch/arm/mach-omap2/clock3517.c
@@ -2,7 +2,7 @@
2 * OMAP3517/3505-specific clock framework functions 2 * OMAP3517/3505-specific clock framework functions
3 * 3 *
4 * Copyright (C) 2010 Texas Instruments, Inc. 4 * Copyright (C) 2010 Texas Instruments, Inc.
5 * Copyright (C) 2010 Nokia Corporation 5 * Copyright (C) 2011 Nokia Corporation
6 * 6 *
7 * Ranjith Lohithakshan 7 * Ranjith Lohithakshan
8 * Paul Walmsley 8 * Paul Walmsley
@@ -119,6 +119,8 @@ const struct clkops clkops_am35xx_ipss_wait = {
119 .disable = omap2_dflt_clk_disable, 119 .disable = omap2_dflt_clk_disable,
120 .find_idlest = am35xx_clk_ipss_find_idlest, 120 .find_idlest = am35xx_clk_ipss_find_idlest,
121 .find_companion = omap2_clk_dflt_find_companion, 121 .find_companion = omap2_clk_dflt_find_companion,
122 .allow_idle = omap2_clkt_iclk_allow_idle,
123 .deny_idle = omap2_clkt_iclk_deny_idle,
122}; 124};
123 125
124 126
diff --git a/arch/arm/mach-omap2/clock3xxx.c b/arch/arm/mach-omap2/clock3xxx.c
index e9f66b6dec18..952c3e01c9eb 100644
--- a/arch/arm/mach-omap2/clock3xxx.c
+++ b/arch/arm/mach-omap2/clock3xxx.c
@@ -65,9 +65,6 @@ void __init omap3_clk_lock_dpll5(void)
65 clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST); 65 clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST);
66 clk_enable(dpll5_clk); 66 clk_enable(dpll5_clk);
67 67
68 /* Enable autoidle to allow it to enter low power bypass */
69 omap3_dpll_allow_idle(dpll5_clk);
70
71 /* Program dpll5_m2_clk divider for no division */ 68 /* Program dpll5_m2_clk divider for no division */
72 dpll5_m2_clk = clk_get(NULL, "dpll5_m2_ck"); 69 dpll5_m2_clk = clk_get(NULL, "dpll5_m2_ck");
73 clk_enable(dpll5_m2_clk); 70 clk_enable(dpll5_m2_clk);
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c
index 403a4a1d3f9c..75b119bd9cda 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -2,7 +2,7 @@
2 * OMAP3 clock data 2 * OMAP3 clock data
3 * 3 *
4 * Copyright (C) 2007-2010 Texas Instruments, Inc. 4 * Copyright (C) 2007-2010 Texas Instruments, Inc.
5 * Copyright (C) 2007-2010 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 * 6 *
7 * Written by Paul Walmsley 7 * Written by Paul Walmsley
8 * With many device clock fixes by Kevin Hilman and Jouni Högander 8 * With many device clock fixes by Kevin Hilman and Jouni Högander
@@ -291,12 +291,11 @@ static struct dpll_data dpll1_dd = {
291 .max_multiplier = OMAP3_MAX_DPLL_MULT, 291 .max_multiplier = OMAP3_MAX_DPLL_MULT,
292 .min_divider = 1, 292 .min_divider = 1,
293 .max_divider = OMAP3_MAX_DPLL_DIV, 293 .max_divider = OMAP3_MAX_DPLL_DIV,
294 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
295}; 294};
296 295
297static struct clk dpll1_ck = { 296static struct clk dpll1_ck = {
298 .name = "dpll1_ck", 297 .name = "dpll1_ck",
299 .ops = &clkops_null, 298 .ops = &clkops_omap3_noncore_dpll_ops,
300 .parent = &sys_ck, 299 .parent = &sys_ck,
301 .dpll_data = &dpll1_dd, 300 .dpll_data = &dpll1_dd,
302 .round_rate = &omap2_dpll_round_rate, 301 .round_rate = &omap2_dpll_round_rate,
@@ -364,7 +363,6 @@ static struct dpll_data dpll2_dd = {
364 .max_multiplier = OMAP3_MAX_DPLL_MULT, 363 .max_multiplier = OMAP3_MAX_DPLL_MULT,
365 .min_divider = 1, 364 .min_divider = 1,
366 .max_divider = OMAP3_MAX_DPLL_DIV, 365 .max_divider = OMAP3_MAX_DPLL_DIV,
367 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
368}; 366};
369 367
370static struct clk dpll2_ck = { 368static struct clk dpll2_ck = {
@@ -424,12 +422,11 @@ static struct dpll_data dpll3_dd = {
424 .max_multiplier = OMAP3_MAX_DPLL_MULT, 422 .max_multiplier = OMAP3_MAX_DPLL_MULT,
425 .min_divider = 1, 423 .min_divider = 1,
426 .max_divider = OMAP3_MAX_DPLL_DIV, 424 .max_divider = OMAP3_MAX_DPLL_DIV,
427 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
428}; 425};
429 426
430static struct clk dpll3_ck = { 427static struct clk dpll3_ck = {
431 .name = "dpll3_ck", 428 .name = "dpll3_ck",
432 .ops = &clkops_null, 429 .ops = &clkops_omap3_core_dpll_ops,
433 .parent = &sys_ck, 430 .parent = &sys_ck,
434 .dpll_data = &dpll3_dd, 431 .dpll_data = &dpll3_dd,
435 .round_rate = &omap2_dpll_round_rate, 432 .round_rate = &omap2_dpll_round_rate,
@@ -583,7 +580,6 @@ static struct dpll_data dpll4_dd_34xx __initdata = {
583 .max_multiplier = OMAP3_MAX_DPLL_MULT, 580 .max_multiplier = OMAP3_MAX_DPLL_MULT,
584 .min_divider = 1, 581 .min_divider = 1,
585 .max_divider = OMAP3_MAX_DPLL_DIV, 582 .max_divider = OMAP3_MAX_DPLL_DIV,
586 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
587}; 583};
588 584
589static struct dpll_data dpll4_dd_3630 __initdata = { 585static struct dpll_data dpll4_dd_3630 __initdata = {
@@ -607,7 +603,6 @@ static struct dpll_data dpll4_dd_3630 __initdata = {
607 .max_multiplier = OMAP3630_MAX_JTYPE_DPLL_MULT, 603 .max_multiplier = OMAP3630_MAX_JTYPE_DPLL_MULT,
608 .min_divider = 1, 604 .min_divider = 1,
609 .max_divider = OMAP3_MAX_DPLL_DIV, 605 .max_divider = OMAP3_MAX_DPLL_DIV,
610 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE,
611 .flags = DPLL_J_TYPE 606 .flags = DPLL_J_TYPE
612}; 607};
613 608
@@ -939,7 +934,6 @@ static struct dpll_data dpll5_dd = {
939 .max_multiplier = OMAP3_MAX_DPLL_MULT, 934 .max_multiplier = OMAP3_MAX_DPLL_MULT,
940 .min_divider = 1, 935 .min_divider = 1,
941 .max_divider = OMAP3_MAX_DPLL_DIV, 936 .max_divider = OMAP3_MAX_DPLL_DIV,
942 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
943}; 937};
944 938
945static struct clk dpll5_ck = { 939static struct clk dpll5_ck = {
@@ -1205,7 +1199,10 @@ static const struct clksel gfx_l3_clksel[] = {
1205 { .parent = NULL } 1199 { .parent = NULL }
1206}; 1200};
1207 1201
1208/* Virtual parent clock for gfx_l3_ick and gfx_l3_fck */ 1202/*
1203 * Virtual parent clock for gfx_l3_ick and gfx_l3_fck
1204 * This interface clock does not have a CM_AUTOIDLE bit
1205 */
1209static struct clk gfx_l3_ck = { 1206static struct clk gfx_l3_ck = {
1210 .name = "gfx_l3_ck", 1207 .name = "gfx_l3_ck",
1211 .ops = &clkops_omap2_dflt_wait, 1208 .ops = &clkops_omap2_dflt_wait,
@@ -1304,6 +1301,7 @@ static struct clk sgx_fck = {
1304 .round_rate = &omap2_clksel_round_rate 1301 .round_rate = &omap2_clksel_round_rate
1305}; 1302};
1306 1303
1304/* This interface clock does not have a CM_AUTOIDLE bit */
1307static struct clk sgx_ick = { 1305static struct clk sgx_ick = {
1308 .name = "sgx_ick", 1306 .name = "sgx_ick",
1309 .ops = &clkops_omap2_dflt_wait, 1307 .ops = &clkops_omap2_dflt_wait,
@@ -1328,7 +1326,7 @@ static struct clk d2d_26m_fck = {
1328 1326
1329static struct clk modem_fck = { 1327static struct clk modem_fck = {
1330 .name = "modem_fck", 1328 .name = "modem_fck",
1331 .ops = &clkops_omap2_dflt_wait, 1329 .ops = &clkops_omap2_mdmclk_dflt_wait,
1332 .parent = &sys_ck, 1330 .parent = &sys_ck,
1333 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1331 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1334 .enable_bit = OMAP3430_EN_MODEM_SHIFT, 1332 .enable_bit = OMAP3430_EN_MODEM_SHIFT,
@@ -1338,7 +1336,7 @@ static struct clk modem_fck = {
1338 1336
1339static struct clk sad2d_ick = { 1337static struct clk sad2d_ick = {
1340 .name = "sad2d_ick", 1338 .name = "sad2d_ick",
1341 .ops = &clkops_omap2_dflt_wait, 1339 .ops = &clkops_omap2_iclk_dflt_wait,
1342 .parent = &l3_ick, 1340 .parent = &l3_ick,
1343 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1341 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1344 .enable_bit = OMAP3430_EN_SAD2D_SHIFT, 1342 .enable_bit = OMAP3430_EN_SAD2D_SHIFT,
@@ -1348,7 +1346,7 @@ static struct clk sad2d_ick = {
1348 1346
1349static struct clk mad2d_ick = { 1347static struct clk mad2d_ick = {
1350 .name = "mad2d_ick", 1348 .name = "mad2d_ick",
1351 .ops = &clkops_omap2_dflt_wait, 1349 .ops = &clkops_omap2_iclk_dflt_wait,
1352 .parent = &l3_ick, 1350 .parent = &l3_ick,
1353 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), 1351 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1354 .enable_bit = OMAP3430_EN_MAD2D_SHIFT, 1352 .enable_bit = OMAP3430_EN_MAD2D_SHIFT,
@@ -1718,7 +1716,7 @@ static struct clk core_l3_ick = {
1718 1716
1719static struct clk hsotgusb_ick_3430es1 = { 1717static struct clk hsotgusb_ick_3430es1 = {
1720 .name = "hsotgusb_ick", 1718 .name = "hsotgusb_ick",
1721 .ops = &clkops_omap2_dflt, 1719 .ops = &clkops_omap2_iclk_dflt,
1722 .parent = &core_l3_ick, 1720 .parent = &core_l3_ick,
1723 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1721 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1724 .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT, 1722 .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT,
@@ -1728,7 +1726,7 @@ static struct clk hsotgusb_ick_3430es1 = {
1728 1726
1729static struct clk hsotgusb_ick_3430es2 = { 1727static struct clk hsotgusb_ick_3430es2 = {
1730 .name = "hsotgusb_ick", 1728 .name = "hsotgusb_ick",
1731 .ops = &clkops_omap3430es2_hsotgusb_wait, 1729 .ops = &clkops_omap3430es2_iclk_hsotgusb_wait,
1732 .parent = &core_l3_ick, 1730 .parent = &core_l3_ick,
1733 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1731 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1734 .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT, 1732 .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT,
@@ -1736,6 +1734,7 @@ static struct clk hsotgusb_ick_3430es2 = {
1736 .recalc = &followparent_recalc, 1734 .recalc = &followparent_recalc,
1737}; 1735};
1738 1736
1737/* This interface clock does not have a CM_AUTOIDLE bit */
1739static struct clk sdrc_ick = { 1738static struct clk sdrc_ick = {
1740 .name = "sdrc_ick", 1739 .name = "sdrc_ick",
1741 .ops = &clkops_omap2_dflt_wait, 1740 .ops = &clkops_omap2_dflt_wait,
@@ -1767,7 +1766,7 @@ static struct clk security_l3_ick = {
1767 1766
1768static struct clk pka_ick = { 1767static struct clk pka_ick = {
1769 .name = "pka_ick", 1768 .name = "pka_ick",
1770 .ops = &clkops_omap2_dflt_wait, 1769 .ops = &clkops_omap2_iclk_dflt_wait,
1771 .parent = &security_l3_ick, 1770 .parent = &security_l3_ick,
1772 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1771 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1773 .enable_bit = OMAP3430_EN_PKA_SHIFT, 1772 .enable_bit = OMAP3430_EN_PKA_SHIFT,
@@ -1786,7 +1785,7 @@ static struct clk core_l4_ick = {
1786 1785
1787static struct clk usbtll_ick = { 1786static struct clk usbtll_ick = {
1788 .name = "usbtll_ick", 1787 .name = "usbtll_ick",
1789 .ops = &clkops_omap2_dflt_wait, 1788 .ops = &clkops_omap2_iclk_dflt_wait,
1790 .parent = &core_l4_ick, 1789 .parent = &core_l4_ick,
1791 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), 1790 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1792 .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT, 1791 .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT,
@@ -1796,7 +1795,7 @@ static struct clk usbtll_ick = {
1796 1795
1797static struct clk mmchs3_ick = { 1796static struct clk mmchs3_ick = {
1798 .name = "mmchs3_ick", 1797 .name = "mmchs3_ick",
1799 .ops = &clkops_omap2_dflt_wait, 1798 .ops = &clkops_omap2_iclk_dflt_wait,
1800 .parent = &core_l4_ick, 1799 .parent = &core_l4_ick,
1801 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1800 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1802 .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT, 1801 .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT,
@@ -1807,7 +1806,7 @@ static struct clk mmchs3_ick = {
1807/* Intersystem Communication Registers - chassis mode only */ 1806/* Intersystem Communication Registers - chassis mode only */
1808static struct clk icr_ick = { 1807static struct clk icr_ick = {
1809 .name = "icr_ick", 1808 .name = "icr_ick",
1810 .ops = &clkops_omap2_dflt_wait, 1809 .ops = &clkops_omap2_iclk_dflt_wait,
1811 .parent = &core_l4_ick, 1810 .parent = &core_l4_ick,
1812 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1811 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1813 .enable_bit = OMAP3430_EN_ICR_SHIFT, 1812 .enable_bit = OMAP3430_EN_ICR_SHIFT,
@@ -1817,7 +1816,7 @@ static struct clk icr_ick = {
1817 1816
1818static struct clk aes2_ick = { 1817static struct clk aes2_ick = {
1819 .name = "aes2_ick", 1818 .name = "aes2_ick",
1820 .ops = &clkops_omap2_dflt_wait, 1819 .ops = &clkops_omap2_iclk_dflt_wait,
1821 .parent = &core_l4_ick, 1820 .parent = &core_l4_ick,
1822 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1821 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1823 .enable_bit = OMAP3430_EN_AES2_SHIFT, 1822 .enable_bit = OMAP3430_EN_AES2_SHIFT,
@@ -1827,7 +1826,7 @@ static struct clk aes2_ick = {
1827 1826
1828static struct clk sha12_ick = { 1827static struct clk sha12_ick = {
1829 .name = "sha12_ick", 1828 .name = "sha12_ick",
1830 .ops = &clkops_omap2_dflt_wait, 1829 .ops = &clkops_omap2_iclk_dflt_wait,
1831 .parent = &core_l4_ick, 1830 .parent = &core_l4_ick,
1832 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1831 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1833 .enable_bit = OMAP3430_EN_SHA12_SHIFT, 1832 .enable_bit = OMAP3430_EN_SHA12_SHIFT,
@@ -1837,7 +1836,7 @@ static struct clk sha12_ick = {
1837 1836
1838static struct clk des2_ick = { 1837static struct clk des2_ick = {
1839 .name = "des2_ick", 1838 .name = "des2_ick",
1840 .ops = &clkops_omap2_dflt_wait, 1839 .ops = &clkops_omap2_iclk_dflt_wait,
1841 .parent = &core_l4_ick, 1840 .parent = &core_l4_ick,
1842 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1841 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1843 .enable_bit = OMAP3430_EN_DES2_SHIFT, 1842 .enable_bit = OMAP3430_EN_DES2_SHIFT,
@@ -1847,7 +1846,7 @@ static struct clk des2_ick = {
1847 1846
1848static struct clk mmchs2_ick = { 1847static struct clk mmchs2_ick = {
1849 .name = "mmchs2_ick", 1848 .name = "mmchs2_ick",
1850 .ops = &clkops_omap2_dflt_wait, 1849 .ops = &clkops_omap2_iclk_dflt_wait,
1851 .parent = &core_l4_ick, 1850 .parent = &core_l4_ick,
1852 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1851 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1853 .enable_bit = OMAP3430_EN_MMC2_SHIFT, 1852 .enable_bit = OMAP3430_EN_MMC2_SHIFT,
@@ -1857,7 +1856,7 @@ static struct clk mmchs2_ick = {
1857 1856
1858static struct clk mmchs1_ick = { 1857static struct clk mmchs1_ick = {
1859 .name = "mmchs1_ick", 1858 .name = "mmchs1_ick",
1860 .ops = &clkops_omap2_dflt_wait, 1859 .ops = &clkops_omap2_iclk_dflt_wait,
1861 .parent = &core_l4_ick, 1860 .parent = &core_l4_ick,
1862 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1861 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1863 .enable_bit = OMAP3430_EN_MMC1_SHIFT, 1862 .enable_bit = OMAP3430_EN_MMC1_SHIFT,
@@ -1867,7 +1866,7 @@ static struct clk mmchs1_ick = {
1867 1866
1868static struct clk mspro_ick = { 1867static struct clk mspro_ick = {
1869 .name = "mspro_ick", 1868 .name = "mspro_ick",
1870 .ops = &clkops_omap2_dflt_wait, 1869 .ops = &clkops_omap2_iclk_dflt_wait,
1871 .parent = &core_l4_ick, 1870 .parent = &core_l4_ick,
1872 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1871 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1873 .enable_bit = OMAP3430_EN_MSPRO_SHIFT, 1872 .enable_bit = OMAP3430_EN_MSPRO_SHIFT,
@@ -1877,7 +1876,7 @@ static struct clk mspro_ick = {
1877 1876
1878static struct clk hdq_ick = { 1877static struct clk hdq_ick = {
1879 .name = "hdq_ick", 1878 .name = "hdq_ick",
1880 .ops = &clkops_omap2_dflt_wait, 1879 .ops = &clkops_omap2_iclk_dflt_wait,
1881 .parent = &core_l4_ick, 1880 .parent = &core_l4_ick,
1882 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1881 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1883 .enable_bit = OMAP3430_EN_HDQ_SHIFT, 1882 .enable_bit = OMAP3430_EN_HDQ_SHIFT,
@@ -1887,7 +1886,7 @@ static struct clk hdq_ick = {
1887 1886
1888static struct clk mcspi4_ick = { 1887static struct clk mcspi4_ick = {
1889 .name = "mcspi4_ick", 1888 .name = "mcspi4_ick",
1890 .ops = &clkops_omap2_dflt_wait, 1889 .ops = &clkops_omap2_iclk_dflt_wait,
1891 .parent = &core_l4_ick, 1890 .parent = &core_l4_ick,
1892 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1891 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1893 .enable_bit = OMAP3430_EN_MCSPI4_SHIFT, 1892 .enable_bit = OMAP3430_EN_MCSPI4_SHIFT,
@@ -1897,7 +1896,7 @@ static struct clk mcspi4_ick = {
1897 1896
1898static struct clk mcspi3_ick = { 1897static struct clk mcspi3_ick = {
1899 .name = "mcspi3_ick", 1898 .name = "mcspi3_ick",
1900 .ops = &clkops_omap2_dflt_wait, 1899 .ops = &clkops_omap2_iclk_dflt_wait,
1901 .parent = &core_l4_ick, 1900 .parent = &core_l4_ick,
1902 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1901 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1903 .enable_bit = OMAP3430_EN_MCSPI3_SHIFT, 1902 .enable_bit = OMAP3430_EN_MCSPI3_SHIFT,
@@ -1907,7 +1906,7 @@ static struct clk mcspi3_ick = {
1907 1906
1908static struct clk mcspi2_ick = { 1907static struct clk mcspi2_ick = {
1909 .name = "mcspi2_ick", 1908 .name = "mcspi2_ick",
1910 .ops = &clkops_omap2_dflt_wait, 1909 .ops = &clkops_omap2_iclk_dflt_wait,
1911 .parent = &core_l4_ick, 1910 .parent = &core_l4_ick,
1912 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1911 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1913 .enable_bit = OMAP3430_EN_MCSPI2_SHIFT, 1912 .enable_bit = OMAP3430_EN_MCSPI2_SHIFT,
@@ -1917,7 +1916,7 @@ static struct clk mcspi2_ick = {
1917 1916
1918static struct clk mcspi1_ick = { 1917static struct clk mcspi1_ick = {
1919 .name = "mcspi1_ick", 1918 .name = "mcspi1_ick",
1920 .ops = &clkops_omap2_dflt_wait, 1919 .ops = &clkops_omap2_iclk_dflt_wait,
1921 .parent = &core_l4_ick, 1920 .parent = &core_l4_ick,
1922 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1921 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1923 .enable_bit = OMAP3430_EN_MCSPI1_SHIFT, 1922 .enable_bit = OMAP3430_EN_MCSPI1_SHIFT,
@@ -1927,7 +1926,7 @@ static struct clk mcspi1_ick = {
1927 1926
1928static struct clk i2c3_ick = { 1927static struct clk i2c3_ick = {
1929 .name = "i2c3_ick", 1928 .name = "i2c3_ick",
1930 .ops = &clkops_omap2_dflt_wait, 1929 .ops = &clkops_omap2_iclk_dflt_wait,
1931 .parent = &core_l4_ick, 1930 .parent = &core_l4_ick,
1932 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1931 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1933 .enable_bit = OMAP3430_EN_I2C3_SHIFT, 1932 .enable_bit = OMAP3430_EN_I2C3_SHIFT,
@@ -1937,7 +1936,7 @@ static struct clk i2c3_ick = {
1937 1936
1938static struct clk i2c2_ick = { 1937static struct clk i2c2_ick = {
1939 .name = "i2c2_ick", 1938 .name = "i2c2_ick",
1940 .ops = &clkops_omap2_dflt_wait, 1939 .ops = &clkops_omap2_iclk_dflt_wait,
1941 .parent = &core_l4_ick, 1940 .parent = &core_l4_ick,
1942 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1941 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1943 .enable_bit = OMAP3430_EN_I2C2_SHIFT, 1942 .enable_bit = OMAP3430_EN_I2C2_SHIFT,
@@ -1947,7 +1946,7 @@ static struct clk i2c2_ick = {
1947 1946
1948static struct clk i2c1_ick = { 1947static struct clk i2c1_ick = {
1949 .name = "i2c1_ick", 1948 .name = "i2c1_ick",
1950 .ops = &clkops_omap2_dflt_wait, 1949 .ops = &clkops_omap2_iclk_dflt_wait,
1951 .parent = &core_l4_ick, 1950 .parent = &core_l4_ick,
1952 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1951 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1953 .enable_bit = OMAP3430_EN_I2C1_SHIFT, 1952 .enable_bit = OMAP3430_EN_I2C1_SHIFT,
@@ -1957,7 +1956,7 @@ static struct clk i2c1_ick = {
1957 1956
1958static struct clk uart2_ick = { 1957static struct clk uart2_ick = {
1959 .name = "uart2_ick", 1958 .name = "uart2_ick",
1960 .ops = &clkops_omap2_dflt_wait, 1959 .ops = &clkops_omap2_iclk_dflt_wait,
1961 .parent = &core_l4_ick, 1960 .parent = &core_l4_ick,
1962 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1961 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1963 .enable_bit = OMAP3430_EN_UART2_SHIFT, 1962 .enable_bit = OMAP3430_EN_UART2_SHIFT,
@@ -1967,7 +1966,7 @@ static struct clk uart2_ick = {
1967 1966
1968static struct clk uart1_ick = { 1967static struct clk uart1_ick = {
1969 .name = "uart1_ick", 1968 .name = "uart1_ick",
1970 .ops = &clkops_omap2_dflt_wait, 1969 .ops = &clkops_omap2_iclk_dflt_wait,
1971 .parent = &core_l4_ick, 1970 .parent = &core_l4_ick,
1972 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1971 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1973 .enable_bit = OMAP3430_EN_UART1_SHIFT, 1972 .enable_bit = OMAP3430_EN_UART1_SHIFT,
@@ -1977,7 +1976,7 @@ static struct clk uart1_ick = {
1977 1976
1978static struct clk gpt11_ick = { 1977static struct clk gpt11_ick = {
1979 .name = "gpt11_ick", 1978 .name = "gpt11_ick",
1980 .ops = &clkops_omap2_dflt_wait, 1979 .ops = &clkops_omap2_iclk_dflt_wait,
1981 .parent = &core_l4_ick, 1980 .parent = &core_l4_ick,
1982 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1981 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1983 .enable_bit = OMAP3430_EN_GPT11_SHIFT, 1982 .enable_bit = OMAP3430_EN_GPT11_SHIFT,
@@ -1987,7 +1986,7 @@ static struct clk gpt11_ick = {
1987 1986
1988static struct clk gpt10_ick = { 1987static struct clk gpt10_ick = {
1989 .name = "gpt10_ick", 1988 .name = "gpt10_ick",
1990 .ops = &clkops_omap2_dflt_wait, 1989 .ops = &clkops_omap2_iclk_dflt_wait,
1991 .parent = &core_l4_ick, 1990 .parent = &core_l4_ick,
1992 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1991 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1993 .enable_bit = OMAP3430_EN_GPT10_SHIFT, 1992 .enable_bit = OMAP3430_EN_GPT10_SHIFT,
@@ -1997,7 +1996,7 @@ static struct clk gpt10_ick = {
1997 1996
1998static struct clk mcbsp5_ick = { 1997static struct clk mcbsp5_ick = {
1999 .name = "mcbsp5_ick", 1998 .name = "mcbsp5_ick",
2000 .ops = &clkops_omap2_dflt_wait, 1999 .ops = &clkops_omap2_iclk_dflt_wait,
2001 .parent = &core_l4_ick, 2000 .parent = &core_l4_ick,
2002 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2001 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2003 .enable_bit = OMAP3430_EN_MCBSP5_SHIFT, 2002 .enable_bit = OMAP3430_EN_MCBSP5_SHIFT,
@@ -2007,7 +2006,7 @@ static struct clk mcbsp5_ick = {
2007 2006
2008static struct clk mcbsp1_ick = { 2007static struct clk mcbsp1_ick = {
2009 .name = "mcbsp1_ick", 2008 .name = "mcbsp1_ick",
2010 .ops = &clkops_omap2_dflt_wait, 2009 .ops = &clkops_omap2_iclk_dflt_wait,
2011 .parent = &core_l4_ick, 2010 .parent = &core_l4_ick,
2012 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2011 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2013 .enable_bit = OMAP3430_EN_MCBSP1_SHIFT, 2012 .enable_bit = OMAP3430_EN_MCBSP1_SHIFT,
@@ -2017,7 +2016,7 @@ static struct clk mcbsp1_ick = {
2017 2016
2018static struct clk fac_ick = { 2017static struct clk fac_ick = {
2019 .name = "fac_ick", 2018 .name = "fac_ick",
2020 .ops = &clkops_omap2_dflt_wait, 2019 .ops = &clkops_omap2_iclk_dflt_wait,
2021 .parent = &core_l4_ick, 2020 .parent = &core_l4_ick,
2022 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2021 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2023 .enable_bit = OMAP3430ES1_EN_FAC_SHIFT, 2022 .enable_bit = OMAP3430ES1_EN_FAC_SHIFT,
@@ -2027,7 +2026,7 @@ static struct clk fac_ick = {
2027 2026
2028static struct clk mailboxes_ick = { 2027static struct clk mailboxes_ick = {
2029 .name = "mailboxes_ick", 2028 .name = "mailboxes_ick",
2030 .ops = &clkops_omap2_dflt_wait, 2029 .ops = &clkops_omap2_iclk_dflt_wait,
2031 .parent = &core_l4_ick, 2030 .parent = &core_l4_ick,
2032 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2031 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2033 .enable_bit = OMAP3430_EN_MAILBOXES_SHIFT, 2032 .enable_bit = OMAP3430_EN_MAILBOXES_SHIFT,
@@ -2037,7 +2036,7 @@ static struct clk mailboxes_ick = {
2037 2036
2038static struct clk omapctrl_ick = { 2037static struct clk omapctrl_ick = {
2039 .name = "omapctrl_ick", 2038 .name = "omapctrl_ick",
2040 .ops = &clkops_omap2_dflt_wait, 2039 .ops = &clkops_omap2_iclk_dflt_wait,
2041 .parent = &core_l4_ick, 2040 .parent = &core_l4_ick,
2042 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2041 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2043 .enable_bit = OMAP3430_EN_OMAPCTRL_SHIFT, 2042 .enable_bit = OMAP3430_EN_OMAPCTRL_SHIFT,
@@ -2057,7 +2056,7 @@ static struct clk ssi_l4_ick = {
2057 2056
2058static struct clk ssi_ick_3430es1 = { 2057static struct clk ssi_ick_3430es1 = {
2059 .name = "ssi_ick", 2058 .name = "ssi_ick",
2060 .ops = &clkops_omap2_dflt, 2059 .ops = &clkops_omap2_iclk_dflt,
2061 .parent = &ssi_l4_ick, 2060 .parent = &ssi_l4_ick,
2062 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2061 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2063 .enable_bit = OMAP3430_EN_SSI_SHIFT, 2062 .enable_bit = OMAP3430_EN_SSI_SHIFT,
@@ -2067,7 +2066,7 @@ static struct clk ssi_ick_3430es1 = {
2067 2066
2068static struct clk ssi_ick_3430es2 = { 2067static struct clk ssi_ick_3430es2 = {
2069 .name = "ssi_ick", 2068 .name = "ssi_ick",
2070 .ops = &clkops_omap3430es2_ssi_wait, 2069 .ops = &clkops_omap3430es2_iclk_ssi_wait,
2071 .parent = &ssi_l4_ick, 2070 .parent = &ssi_l4_ick,
2072 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2071 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2073 .enable_bit = OMAP3430_EN_SSI_SHIFT, 2072 .enable_bit = OMAP3430_EN_SSI_SHIFT,
@@ -2085,7 +2084,7 @@ static const struct clksel usb_l4_clksel[] = {
2085 2084
2086static struct clk usb_l4_ick = { 2085static struct clk usb_l4_ick = {
2087 .name = "usb_l4_ick", 2086 .name = "usb_l4_ick",
2088 .ops = &clkops_omap2_dflt_wait, 2087 .ops = &clkops_omap2_iclk_dflt_wait,
2089 .parent = &l4_ick, 2088 .parent = &l4_ick,
2090 .init = &omap2_init_clksel_parent, 2089 .init = &omap2_init_clksel_parent,
2091 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2090 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -2107,7 +2106,7 @@ static struct clk security_l4_ick2 = {
2107 2106
2108static struct clk aes1_ick = { 2107static struct clk aes1_ick = {
2109 .name = "aes1_ick", 2108 .name = "aes1_ick",
2110 .ops = &clkops_omap2_dflt_wait, 2109 .ops = &clkops_omap2_iclk_dflt_wait,
2111 .parent = &security_l4_ick2, 2110 .parent = &security_l4_ick2,
2112 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 2111 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2113 .enable_bit = OMAP3430_EN_AES1_SHIFT, 2112 .enable_bit = OMAP3430_EN_AES1_SHIFT,
@@ -2116,7 +2115,7 @@ static struct clk aes1_ick = {
2116 2115
2117static struct clk rng_ick = { 2116static struct clk rng_ick = {
2118 .name = "rng_ick", 2117 .name = "rng_ick",
2119 .ops = &clkops_omap2_dflt_wait, 2118 .ops = &clkops_omap2_iclk_dflt_wait,
2120 .parent = &security_l4_ick2, 2119 .parent = &security_l4_ick2,
2121 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 2120 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2122 .enable_bit = OMAP3430_EN_RNG_SHIFT, 2121 .enable_bit = OMAP3430_EN_RNG_SHIFT,
@@ -2125,7 +2124,7 @@ static struct clk rng_ick = {
2125 2124
2126static struct clk sha11_ick = { 2125static struct clk sha11_ick = {
2127 .name = "sha11_ick", 2126 .name = "sha11_ick",
2128 .ops = &clkops_omap2_dflt_wait, 2127 .ops = &clkops_omap2_iclk_dflt_wait,
2129 .parent = &security_l4_ick2, 2128 .parent = &security_l4_ick2,
2130 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 2129 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2131 .enable_bit = OMAP3430_EN_SHA11_SHIFT, 2130 .enable_bit = OMAP3430_EN_SHA11_SHIFT,
@@ -2134,7 +2133,7 @@ static struct clk sha11_ick = {
2134 2133
2135static struct clk des1_ick = { 2134static struct clk des1_ick = {
2136 .name = "des1_ick", 2135 .name = "des1_ick",
2137 .ops = &clkops_omap2_dflt_wait, 2136 .ops = &clkops_omap2_iclk_dflt_wait,
2138 .parent = &security_l4_ick2, 2137 .parent = &security_l4_ick2,
2139 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 2138 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2140 .enable_bit = OMAP3430_EN_DES1_SHIFT, 2139 .enable_bit = OMAP3430_EN_DES1_SHIFT,
@@ -2195,7 +2194,7 @@ static struct clk dss2_alwon_fck = {
2195static struct clk dss_ick_3430es1 = { 2194static struct clk dss_ick_3430es1 = {
2196 /* Handles both L3 and L4 clocks */ 2195 /* Handles both L3 and L4 clocks */
2197 .name = "dss_ick", 2196 .name = "dss_ick",
2198 .ops = &clkops_omap2_dflt, 2197 .ops = &clkops_omap2_iclk_dflt,
2199 .parent = &l4_ick, 2198 .parent = &l4_ick,
2200 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN), 2199 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN),
2201 .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT, 2200 .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT,
@@ -2206,7 +2205,7 @@ static struct clk dss_ick_3430es1 = {
2206static struct clk dss_ick_3430es2 = { 2205static struct clk dss_ick_3430es2 = {
2207 /* Handles both L3 and L4 clocks */ 2206 /* Handles both L3 and L4 clocks */
2208 .name = "dss_ick", 2207 .name = "dss_ick",
2209 .ops = &clkops_omap3430es2_dss_usbhost_wait, 2208 .ops = &clkops_omap3430es2_iclk_dss_usbhost_wait,
2210 .parent = &l4_ick, 2209 .parent = &l4_ick,
2211 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN), 2210 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN),
2212 .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT, 2211 .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT,
@@ -2229,7 +2228,7 @@ static struct clk cam_mclk = {
2229static struct clk cam_ick = { 2228static struct clk cam_ick = {
2230 /* Handles both L3 and L4 clocks */ 2229 /* Handles both L3 and L4 clocks */
2231 .name = "cam_ick", 2230 .name = "cam_ick",
2232 .ops = &clkops_omap2_dflt, 2231 .ops = &clkops_omap2_iclk_dflt,
2233 .parent = &l4_ick, 2232 .parent = &l4_ick,
2234 .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN), 2233 .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN),
2235 .enable_bit = OMAP3430_EN_CAM_SHIFT, 2234 .enable_bit = OMAP3430_EN_CAM_SHIFT,
@@ -2272,7 +2271,7 @@ static struct clk usbhost_48m_fck = {
2272static struct clk usbhost_ick = { 2271static struct clk usbhost_ick = {
2273 /* Handles both L3 and L4 clocks */ 2272 /* Handles both L3 and L4 clocks */
2274 .name = "usbhost_ick", 2273 .name = "usbhost_ick",
2275 .ops = &clkops_omap3430es2_dss_usbhost_wait, 2274 .ops = &clkops_omap3430es2_iclk_dss_usbhost_wait,
2276 .parent = &l4_ick, 2275 .parent = &l4_ick,
2277 .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN), 2276 .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN),
2278 .enable_bit = OMAP3430ES2_EN_USBHOST_SHIFT, 2277 .enable_bit = OMAP3430ES2_EN_USBHOST_SHIFT,
@@ -2372,7 +2371,7 @@ static struct clk wkup_l4_ick = {
2372/* Never specifically named in the TRM, so we have to infer a likely name */ 2371/* Never specifically named in the TRM, so we have to infer a likely name */
2373static struct clk usim_ick = { 2372static struct clk usim_ick = {
2374 .name = "usim_ick", 2373 .name = "usim_ick",
2375 .ops = &clkops_omap2_dflt_wait, 2374 .ops = &clkops_omap2_iclk_dflt_wait,
2376 .parent = &wkup_l4_ick, 2375 .parent = &wkup_l4_ick,
2377 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2376 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2378 .enable_bit = OMAP3430ES2_EN_USIMOCP_SHIFT, 2377 .enable_bit = OMAP3430ES2_EN_USIMOCP_SHIFT,
@@ -2382,7 +2381,7 @@ static struct clk usim_ick = {
2382 2381
2383static struct clk wdt2_ick = { 2382static struct clk wdt2_ick = {
2384 .name = "wdt2_ick", 2383 .name = "wdt2_ick",
2385 .ops = &clkops_omap2_dflt_wait, 2384 .ops = &clkops_omap2_iclk_dflt_wait,
2386 .parent = &wkup_l4_ick, 2385 .parent = &wkup_l4_ick,
2387 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2386 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2388 .enable_bit = OMAP3430_EN_WDT2_SHIFT, 2387 .enable_bit = OMAP3430_EN_WDT2_SHIFT,
@@ -2392,7 +2391,7 @@ static struct clk wdt2_ick = {
2392 2391
2393static struct clk wdt1_ick = { 2392static struct clk wdt1_ick = {
2394 .name = "wdt1_ick", 2393 .name = "wdt1_ick",
2395 .ops = &clkops_omap2_dflt_wait, 2394 .ops = &clkops_omap2_iclk_dflt_wait,
2396 .parent = &wkup_l4_ick, 2395 .parent = &wkup_l4_ick,
2397 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2396 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2398 .enable_bit = OMAP3430_EN_WDT1_SHIFT, 2397 .enable_bit = OMAP3430_EN_WDT1_SHIFT,
@@ -2402,7 +2401,7 @@ static struct clk wdt1_ick = {
2402 2401
2403static struct clk gpio1_ick = { 2402static struct clk gpio1_ick = {
2404 .name = "gpio1_ick", 2403 .name = "gpio1_ick",
2405 .ops = &clkops_omap2_dflt_wait, 2404 .ops = &clkops_omap2_iclk_dflt_wait,
2406 .parent = &wkup_l4_ick, 2405 .parent = &wkup_l4_ick,
2407 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2406 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2408 .enable_bit = OMAP3430_EN_GPIO1_SHIFT, 2407 .enable_bit = OMAP3430_EN_GPIO1_SHIFT,
@@ -2412,7 +2411,7 @@ static struct clk gpio1_ick = {
2412 2411
2413static struct clk omap_32ksync_ick = { 2412static struct clk omap_32ksync_ick = {
2414 .name = "omap_32ksync_ick", 2413 .name = "omap_32ksync_ick",
2415 .ops = &clkops_omap2_dflt_wait, 2414 .ops = &clkops_omap2_iclk_dflt_wait,
2416 .parent = &wkup_l4_ick, 2415 .parent = &wkup_l4_ick,
2417 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2416 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2418 .enable_bit = OMAP3430_EN_32KSYNC_SHIFT, 2417 .enable_bit = OMAP3430_EN_32KSYNC_SHIFT,
@@ -2423,7 +2422,7 @@ static struct clk omap_32ksync_ick = {
2423/* XXX This clock no longer exists in 3430 TRM rev F */ 2422/* XXX This clock no longer exists in 3430 TRM rev F */
2424static struct clk gpt12_ick = { 2423static struct clk gpt12_ick = {
2425 .name = "gpt12_ick", 2424 .name = "gpt12_ick",
2426 .ops = &clkops_omap2_dflt_wait, 2425 .ops = &clkops_omap2_iclk_dflt_wait,
2427 .parent = &wkup_l4_ick, 2426 .parent = &wkup_l4_ick,
2428 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2427 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2429 .enable_bit = OMAP3430_EN_GPT12_SHIFT, 2428 .enable_bit = OMAP3430_EN_GPT12_SHIFT,
@@ -2433,7 +2432,7 @@ static struct clk gpt12_ick = {
2433 2432
2434static struct clk gpt1_ick = { 2433static struct clk gpt1_ick = {
2435 .name = "gpt1_ick", 2434 .name = "gpt1_ick",
2436 .ops = &clkops_omap2_dflt_wait, 2435 .ops = &clkops_omap2_iclk_dflt_wait,
2437 .parent = &wkup_l4_ick, 2436 .parent = &wkup_l4_ick,
2438 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2437 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2439 .enable_bit = OMAP3430_EN_GPT1_SHIFT, 2438 .enable_bit = OMAP3430_EN_GPT1_SHIFT,
@@ -2663,7 +2662,7 @@ static struct clk per_l4_ick = {
2663 2662
2664static struct clk gpio6_ick = { 2663static struct clk gpio6_ick = {
2665 .name = "gpio6_ick", 2664 .name = "gpio6_ick",
2666 .ops = &clkops_omap2_dflt_wait, 2665 .ops = &clkops_omap2_iclk_dflt_wait,
2667 .parent = &per_l4_ick, 2666 .parent = &per_l4_ick,
2668 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2667 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2669 .enable_bit = OMAP3430_EN_GPIO6_SHIFT, 2668 .enable_bit = OMAP3430_EN_GPIO6_SHIFT,
@@ -2673,7 +2672,7 @@ static struct clk gpio6_ick = {
2673 2672
2674static struct clk gpio5_ick = { 2673static struct clk gpio5_ick = {
2675 .name = "gpio5_ick", 2674 .name = "gpio5_ick",
2676 .ops = &clkops_omap2_dflt_wait, 2675 .ops = &clkops_omap2_iclk_dflt_wait,
2677 .parent = &per_l4_ick, 2676 .parent = &per_l4_ick,
2678 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2677 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2679 .enable_bit = OMAP3430_EN_GPIO5_SHIFT, 2678 .enable_bit = OMAP3430_EN_GPIO5_SHIFT,
@@ -2683,7 +2682,7 @@ static struct clk gpio5_ick = {
2683 2682
2684static struct clk gpio4_ick = { 2683static struct clk gpio4_ick = {
2685 .name = "gpio4_ick", 2684 .name = "gpio4_ick",
2686 .ops = &clkops_omap2_dflt_wait, 2685 .ops = &clkops_omap2_iclk_dflt_wait,
2687 .parent = &per_l4_ick, 2686 .parent = &per_l4_ick,
2688 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2687 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2689 .enable_bit = OMAP3430_EN_GPIO4_SHIFT, 2688 .enable_bit = OMAP3430_EN_GPIO4_SHIFT,
@@ -2693,7 +2692,7 @@ static struct clk gpio4_ick = {
2693 2692
2694static struct clk gpio3_ick = { 2693static struct clk gpio3_ick = {
2695 .name = "gpio3_ick", 2694 .name = "gpio3_ick",
2696 .ops = &clkops_omap2_dflt_wait, 2695 .ops = &clkops_omap2_iclk_dflt_wait,
2697 .parent = &per_l4_ick, 2696 .parent = &per_l4_ick,
2698 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2697 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2699 .enable_bit = OMAP3430_EN_GPIO3_SHIFT, 2698 .enable_bit = OMAP3430_EN_GPIO3_SHIFT,
@@ -2703,7 +2702,7 @@ static struct clk gpio3_ick = {
2703 2702
2704static struct clk gpio2_ick = { 2703static struct clk gpio2_ick = {
2705 .name = "gpio2_ick", 2704 .name = "gpio2_ick",
2706 .ops = &clkops_omap2_dflt_wait, 2705 .ops = &clkops_omap2_iclk_dflt_wait,
2707 .parent = &per_l4_ick, 2706 .parent = &per_l4_ick,
2708 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2707 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2709 .enable_bit = OMAP3430_EN_GPIO2_SHIFT, 2708 .enable_bit = OMAP3430_EN_GPIO2_SHIFT,
@@ -2713,7 +2712,7 @@ static struct clk gpio2_ick = {
2713 2712
2714static struct clk wdt3_ick = { 2713static struct clk wdt3_ick = {
2715 .name = "wdt3_ick", 2714 .name = "wdt3_ick",
2716 .ops = &clkops_omap2_dflt_wait, 2715 .ops = &clkops_omap2_iclk_dflt_wait,
2717 .parent = &per_l4_ick, 2716 .parent = &per_l4_ick,
2718 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2717 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2719 .enable_bit = OMAP3430_EN_WDT3_SHIFT, 2718 .enable_bit = OMAP3430_EN_WDT3_SHIFT,
@@ -2723,7 +2722,7 @@ static struct clk wdt3_ick = {
2723 2722
2724static struct clk uart3_ick = { 2723static struct clk uart3_ick = {
2725 .name = "uart3_ick", 2724 .name = "uart3_ick",
2726 .ops = &clkops_omap2_dflt_wait, 2725 .ops = &clkops_omap2_iclk_dflt_wait,
2727 .parent = &per_l4_ick, 2726 .parent = &per_l4_ick,
2728 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2727 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2729 .enable_bit = OMAP3430_EN_UART3_SHIFT, 2728 .enable_bit = OMAP3430_EN_UART3_SHIFT,
@@ -2733,7 +2732,7 @@ static struct clk uart3_ick = {
2733 2732
2734static struct clk uart4_ick = { 2733static struct clk uart4_ick = {
2735 .name = "uart4_ick", 2734 .name = "uart4_ick",
2736 .ops = &clkops_omap2_dflt_wait, 2735 .ops = &clkops_omap2_iclk_dflt_wait,
2737 .parent = &per_l4_ick, 2736 .parent = &per_l4_ick,
2738 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2737 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2739 .enable_bit = OMAP3630_EN_UART4_SHIFT, 2738 .enable_bit = OMAP3630_EN_UART4_SHIFT,
@@ -2743,7 +2742,7 @@ static struct clk uart4_ick = {
2743 2742
2744static struct clk gpt9_ick = { 2743static struct clk gpt9_ick = {
2745 .name = "gpt9_ick", 2744 .name = "gpt9_ick",
2746 .ops = &clkops_omap2_dflt_wait, 2745 .ops = &clkops_omap2_iclk_dflt_wait,
2747 .parent = &per_l4_ick, 2746 .parent = &per_l4_ick,
2748 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2747 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2749 .enable_bit = OMAP3430_EN_GPT9_SHIFT, 2748 .enable_bit = OMAP3430_EN_GPT9_SHIFT,
@@ -2753,7 +2752,7 @@ static struct clk gpt9_ick = {
2753 2752
2754static struct clk gpt8_ick = { 2753static struct clk gpt8_ick = {
2755 .name = "gpt8_ick", 2754 .name = "gpt8_ick",
2756 .ops = &clkops_omap2_dflt_wait, 2755 .ops = &clkops_omap2_iclk_dflt_wait,
2757 .parent = &per_l4_ick, 2756 .parent = &per_l4_ick,
2758 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2757 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2759 .enable_bit = OMAP3430_EN_GPT8_SHIFT, 2758 .enable_bit = OMAP3430_EN_GPT8_SHIFT,
@@ -2763,7 +2762,7 @@ static struct clk gpt8_ick = {
2763 2762
2764static struct clk gpt7_ick = { 2763static struct clk gpt7_ick = {
2765 .name = "gpt7_ick", 2764 .name = "gpt7_ick",
2766 .ops = &clkops_omap2_dflt_wait, 2765 .ops = &clkops_omap2_iclk_dflt_wait,
2767 .parent = &per_l4_ick, 2766 .parent = &per_l4_ick,
2768 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2767 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2769 .enable_bit = OMAP3430_EN_GPT7_SHIFT, 2768 .enable_bit = OMAP3430_EN_GPT7_SHIFT,
@@ -2773,7 +2772,7 @@ static struct clk gpt7_ick = {
2773 2772
2774static struct clk gpt6_ick = { 2773static struct clk gpt6_ick = {
2775 .name = "gpt6_ick", 2774 .name = "gpt6_ick",
2776 .ops = &clkops_omap2_dflt_wait, 2775 .ops = &clkops_omap2_iclk_dflt_wait,
2777 .parent = &per_l4_ick, 2776 .parent = &per_l4_ick,
2778 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2777 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2779 .enable_bit = OMAP3430_EN_GPT6_SHIFT, 2778 .enable_bit = OMAP3430_EN_GPT6_SHIFT,
@@ -2783,7 +2782,7 @@ static struct clk gpt6_ick = {
2783 2782
2784static struct clk gpt5_ick = { 2783static struct clk gpt5_ick = {
2785 .name = "gpt5_ick", 2784 .name = "gpt5_ick",
2786 .ops = &clkops_omap2_dflt_wait, 2785 .ops = &clkops_omap2_iclk_dflt_wait,
2787 .parent = &per_l4_ick, 2786 .parent = &per_l4_ick,
2788 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2787 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2789 .enable_bit = OMAP3430_EN_GPT5_SHIFT, 2788 .enable_bit = OMAP3430_EN_GPT5_SHIFT,
@@ -2793,7 +2792,7 @@ static struct clk gpt5_ick = {
2793 2792
2794static struct clk gpt4_ick = { 2793static struct clk gpt4_ick = {
2795 .name = "gpt4_ick", 2794 .name = "gpt4_ick",
2796 .ops = &clkops_omap2_dflt_wait, 2795 .ops = &clkops_omap2_iclk_dflt_wait,
2797 .parent = &per_l4_ick, 2796 .parent = &per_l4_ick,
2798 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2797 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2799 .enable_bit = OMAP3430_EN_GPT4_SHIFT, 2798 .enable_bit = OMAP3430_EN_GPT4_SHIFT,
@@ -2803,7 +2802,7 @@ static struct clk gpt4_ick = {
2803 2802
2804static struct clk gpt3_ick = { 2803static struct clk gpt3_ick = {
2805 .name = "gpt3_ick", 2804 .name = "gpt3_ick",
2806 .ops = &clkops_omap2_dflt_wait, 2805 .ops = &clkops_omap2_iclk_dflt_wait,
2807 .parent = &per_l4_ick, 2806 .parent = &per_l4_ick,
2808 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2807 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2809 .enable_bit = OMAP3430_EN_GPT3_SHIFT, 2808 .enable_bit = OMAP3430_EN_GPT3_SHIFT,
@@ -2813,7 +2812,7 @@ static struct clk gpt3_ick = {
2813 2812
2814static struct clk gpt2_ick = { 2813static struct clk gpt2_ick = {
2815 .name = "gpt2_ick", 2814 .name = "gpt2_ick",
2816 .ops = &clkops_omap2_dflt_wait, 2815 .ops = &clkops_omap2_iclk_dflt_wait,
2817 .parent = &per_l4_ick, 2816 .parent = &per_l4_ick,
2818 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2817 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2819 .enable_bit = OMAP3430_EN_GPT2_SHIFT, 2818 .enable_bit = OMAP3430_EN_GPT2_SHIFT,
@@ -2823,7 +2822,7 @@ static struct clk gpt2_ick = {
2823 2822
2824static struct clk mcbsp2_ick = { 2823static struct clk mcbsp2_ick = {
2825 .name = "mcbsp2_ick", 2824 .name = "mcbsp2_ick",
2826 .ops = &clkops_omap2_dflt_wait, 2825 .ops = &clkops_omap2_iclk_dflt_wait,
2827 .parent = &per_l4_ick, 2826 .parent = &per_l4_ick,
2828 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2827 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2829 .enable_bit = OMAP3430_EN_MCBSP2_SHIFT, 2828 .enable_bit = OMAP3430_EN_MCBSP2_SHIFT,
@@ -2833,7 +2832,7 @@ static struct clk mcbsp2_ick = {
2833 2832
2834static struct clk mcbsp3_ick = { 2833static struct clk mcbsp3_ick = {
2835 .name = "mcbsp3_ick", 2834 .name = "mcbsp3_ick",
2836 .ops = &clkops_omap2_dflt_wait, 2835 .ops = &clkops_omap2_iclk_dflt_wait,
2837 .parent = &per_l4_ick, 2836 .parent = &per_l4_ick,
2838 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2837 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2839 .enable_bit = OMAP3430_EN_MCBSP3_SHIFT, 2838 .enable_bit = OMAP3430_EN_MCBSP3_SHIFT,
@@ -2843,7 +2842,7 @@ static struct clk mcbsp3_ick = {
2843 2842
2844static struct clk mcbsp4_ick = { 2843static struct clk mcbsp4_ick = {
2845 .name = "mcbsp4_ick", 2844 .name = "mcbsp4_ick",
2846 .ops = &clkops_omap2_dflt_wait, 2845 .ops = &clkops_omap2_iclk_dflt_wait,
2847 .parent = &per_l4_ick, 2846 .parent = &per_l4_ick,
2848 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2847 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2849 .enable_bit = OMAP3430_EN_MCBSP4_SHIFT, 2848 .enable_bit = OMAP3430_EN_MCBSP4_SHIFT,
@@ -3186,7 +3185,7 @@ static struct clk vpfe_fck = {
3186 */ 3185 */
3187static struct clk uart4_ick_am35xx = { 3186static struct clk uart4_ick_am35xx = {
3188 .name = "uart4_ick", 3187 .name = "uart4_ick",
3189 .ops = &clkops_omap2_dflt_wait, 3188 .ops = &clkops_omap2_iclk_dflt_wait,
3190 .parent = &core_l4_ick, 3189 .parent = &core_l4_ick,
3191 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 3190 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
3192 .enable_bit = AM35XX_EN_UART4_SHIFT, 3191 .enable_bit = AM35XX_EN_UART4_SHIFT,
@@ -3286,14 +3285,14 @@ static struct omap_clk omap3xxx_clks[] = {
3286 CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3285 CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3287 CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3286 CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3288 CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3287 CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3289 CLK("ehci-omap.0", "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3288 CLK("usbhs-omap.0", "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3290 CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX), 3289 CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX),
3291 CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX), 3290 CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX),
3292 CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX), 3291 CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX),
3293 CLK("mmci-omap-hs.2", "fck", &mmchs3_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3292 CLK("omap_hsmmc.2", "fck", &mmchs3_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3294 CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_3XXX), 3293 CLK("omap_hsmmc.1", "fck", &mmchs2_fck, CK_3XXX),
3295 CLK(NULL, "mspro_fck", &mspro_fck, CK_34XX | CK_36XX), 3294 CLK(NULL, "mspro_fck", &mspro_fck, CK_34XX | CK_36XX),
3296 CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_3XXX), 3295 CLK("omap_hsmmc.0", "fck", &mmchs1_fck, CK_3XXX),
3297 CLK("omap_i2c.3", "fck", &i2c3_fck, CK_3XXX), 3296 CLK("omap_i2c.3", "fck", &i2c3_fck, CK_3XXX),
3298 CLK("omap_i2c.2", "fck", &i2c2_fck, CK_3XXX), 3297 CLK("omap_i2c.2", "fck", &i2c2_fck, CK_3XXX),
3299 CLK("omap_i2c.1", "fck", &i2c1_fck, CK_3XXX), 3298 CLK("omap_i2c.1", "fck", &i2c1_fck, CK_3XXX),
@@ -3322,14 +3321,14 @@ static struct omap_clk omap3xxx_clks[] = {
3322 CLK(NULL, "pka_ick", &pka_ick, CK_34XX | CK_36XX), 3321 CLK(NULL, "pka_ick", &pka_ick, CK_34XX | CK_36XX),
3323 CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX), 3322 CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX),
3324 CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3323 CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3325 CLK("ehci-omap.0", "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3324 CLK("usbhs-omap.0", "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3326 CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3325 CLK("omap_hsmmc.2", "ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3327 CLK(NULL, "icr_ick", &icr_ick, CK_34XX | CK_36XX), 3326 CLK(NULL, "icr_ick", &icr_ick, CK_34XX | CK_36XX),
3328 CLK("omap-aes", "ick", &aes2_ick, CK_34XX | CK_36XX), 3327 CLK("omap-aes", "ick", &aes2_ick, CK_34XX | CK_36XX),
3329 CLK("omap-sham", "ick", &sha12_ick, CK_34XX | CK_36XX), 3328 CLK("omap-sham", "ick", &sha12_ick, CK_34XX | CK_36XX),
3330 CLK(NULL, "des2_ick", &des2_ick, CK_34XX | CK_36XX), 3329 CLK(NULL, "des2_ick", &des2_ick, CK_34XX | CK_36XX),
3331 CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_3XXX), 3330 CLK("omap_hsmmc.1", "ick", &mmchs2_ick, CK_3XXX),
3332 CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_3XXX), 3331 CLK("omap_hsmmc.0", "ick", &mmchs1_ick, CK_3XXX),
3333 CLK(NULL, "mspro_ick", &mspro_ick, CK_34XX | CK_36XX), 3332 CLK(NULL, "mspro_ick", &mspro_ick, CK_34XX | CK_36XX),
3334 CLK("omap_hdq.0", "ick", &hdq_ick, CK_3XXX), 3333 CLK("omap_hdq.0", "ick", &hdq_ick, CK_3XXX),
3335 CLK("omap2_mcspi.4", "ick", &mcspi4_ick, CK_3XXX), 3334 CLK("omap2_mcspi.4", "ick", &mcspi4_ick, CK_3XXX),
@@ -3357,22 +3356,31 @@ static struct omap_clk omap3xxx_clks[] = {
3357 CLK("omap_rng", "ick", &rng_ick, CK_34XX | CK_36XX), 3356 CLK("omap_rng", "ick", &rng_ick, CK_34XX | CK_36XX),
3358 CLK(NULL, "sha11_ick", &sha11_ick, CK_34XX | CK_36XX), 3357 CLK(NULL, "sha11_ick", &sha11_ick, CK_34XX | CK_36XX),
3359 CLK(NULL, "des1_ick", &des1_ick, CK_34XX | CK_36XX), 3358 CLK(NULL, "des1_ick", &des1_ick, CK_34XX | CK_36XX),
3360 CLK("omapdss", "dss1_fck", &dss1_alwon_fck_3430es1, CK_3430ES1), 3359 CLK("omapdss_dss", "fck", &dss1_alwon_fck_3430es1, CK_3430ES1),
3361 CLK("omapdss", "dss1_fck", &dss1_alwon_fck_3430es2, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3360 CLK("omapdss_dss", "fck", &dss1_alwon_fck_3430es2, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3362 CLK("omapdss", "tv_fck", &dss_tv_fck, CK_3XXX), 3361 CLK("omapdss_dss", "tv_clk", &dss_tv_fck, CK_3XXX),
3363 CLK("omapdss", "video_fck", &dss_96m_fck, CK_3XXX), 3362 CLK("omapdss_dss", "video_clk", &dss_96m_fck, CK_3XXX),
3364 CLK("omapdss", "dss2_fck", &dss2_alwon_fck, CK_3XXX), 3363 CLK("omapdss_dss", "sys_clk", &dss2_alwon_fck, CK_3XXX),
3365 CLK("omapdss", "ick", &dss_ick_3430es1, CK_3430ES1), 3364 CLK("omapdss_dss", "ick", &dss_ick_3430es1, CK_3430ES1),
3366 CLK("omapdss", "ick", &dss_ick_3430es2, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3365 CLK("omapdss_dss", "ick", &dss_ick_3430es2, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3367 CLK(NULL, "cam_mclk", &cam_mclk, CK_34XX | CK_36XX), 3366 CLK(NULL, "cam_mclk", &cam_mclk, CK_34XX | CK_36XX),
3368 CLK(NULL, "cam_ick", &cam_ick, CK_34XX | CK_36XX), 3367 CLK(NULL, "cam_ick", &cam_ick, CK_34XX | CK_36XX),
3369 CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_34XX | CK_36XX), 3368 CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_34XX | CK_36XX),
3370 CLK(NULL, "usbhost_120m_fck", &usbhost_120m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3369 CLK(NULL, "usbhost_120m_fck", &usbhost_120m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3371 CLK("ehci-omap.0", "hs_fck", &usbhost_120m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3370 CLK("usbhs-omap.0", "hs_fck", &usbhost_120m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3372 CLK(NULL, "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3371 CLK(NULL, "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3373 CLK("ehci-omap.0", "fs_fck", &usbhost_48m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3372 CLK("usbhs-omap.0", "fs_fck", &usbhost_48m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3374 CLK(NULL, "usbhost_ick", &usbhost_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3373 CLK(NULL, "usbhost_ick", &usbhost_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3375 CLK("ehci-omap.0", "usbhost_ick", &usbhost_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3374 CLK("usbhs-omap.0", "usbhost_ick", &usbhost_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3375 CLK("usbhs-omap.0", "utmi_p1_gfclk", &dummy_ck, CK_3XXX),
3376 CLK("usbhs-omap.0", "utmi_p2_gfclk", &dummy_ck, CK_3XXX),
3377 CLK("usbhs-omap.0", "xclk60mhsp1_ck", &dummy_ck, CK_3XXX),
3378 CLK("usbhs-omap.0", "xclk60mhsp2_ck", &dummy_ck, CK_3XXX),
3379 CLK("usbhs-omap.0", "usb_host_hs_utmi_p1_clk", &dummy_ck, CK_3XXX),
3380 CLK("usbhs-omap.0", "usb_host_hs_utmi_p2_clk", &dummy_ck, CK_3XXX),
3381 CLK("usbhs-omap.0", "usb_tll_hs_usb_ch0_clk", &dummy_ck, CK_3XXX),
3382 CLK("usbhs-omap.0", "usb_tll_hs_usb_ch1_clk", &dummy_ck, CK_3XXX),
3383 CLK("usbhs-omap.0", "init_60m_fclk", &dummy_ck, CK_3XXX),
3376 CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2PLUS | CK_36XX), 3384 CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2PLUS | CK_36XX),
3377 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX), 3385 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX),
3378 CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_3XXX), 3386 CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_3XXX),
@@ -3471,6 +3479,9 @@ int __init omap3xxx_clk_init(void)
3471 } else if (cpu_is_omap3630()) { 3479 } else if (cpu_is_omap3630()) {
3472 cpu_mask = (RATE_IN_34XX | RATE_IN_36XX); 3480 cpu_mask = (RATE_IN_34XX | RATE_IN_36XX);
3473 cpu_clkflg = CK_36XX; 3481 cpu_clkflg = CK_36XX;
3482 } else if (cpu_is_ti816x()) {
3483 cpu_mask = RATE_IN_TI816X;
3484 cpu_clkflg = CK_TI816X;
3474 } else if (cpu_is_omap34xx()) { 3485 } else if (cpu_is_omap34xx()) {
3475 if (omap_rev() == OMAP3430_REV_ES1_0) { 3486 if (omap_rev() == OMAP3430_REV_ES1_0) {
3476 cpu_mask = RATE_IN_3430ES1; 3487 cpu_mask = RATE_IN_3430ES1;
@@ -3535,6 +3546,9 @@ int __init omap3xxx_clk_init(void)
3535 omap2_init_clk_clkdm(c->lk.clk); 3546 omap2_init_clk_clkdm(c->lk.clk);
3536 } 3547 }
3537 3548
3549 /* Disable autoidle on all clocks; let the PM code enable it later */
3550 omap_clk_disable_autoidle_all();
3551
3538 recalculate_root_clocks(); 3552 recalculate_root_clocks();
3539 3553
3540 pr_info("Clocking rate (Crystal/Core/MPU): %ld.%01ld/%ld/%ld MHz\n", 3554 pr_info("Clocking rate (Crystal/Core/MPU): %ld.%01ld/%ld/%ld MHz\n",
@@ -3548,9 +3562,10 @@ int __init omap3xxx_clk_init(void)
3548 clk_enable_init_clocks(); 3562 clk_enable_init_clocks();
3549 3563
3550 /* 3564 /*
3551 * Lock DPLL5 and put it in autoidle. 3565 * Lock DPLL5 -- here only until other device init code can
3566 * handle this
3552 */ 3567 */
3553 if (omap_rev() >= OMAP3430_REV_ES2_0) 3568 if (!cpu_is_ti816x() && (omap_rev() >= OMAP3430_REV_ES2_0))
3554 omap3_clk_lock_dpll5(); 3569 omap3_clk_lock_dpll5();
3555 3570
3556 /* Avoid sleeping during omap3_core_dpll_m2_set_rate() */ 3571 /* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
index e8cb32fd7f13..276992d3b7fb 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -34,7 +34,6 @@
34#include "cm2_44xx.h" 34#include "cm2_44xx.h"
35#include "cm-regbits-44xx.h" 35#include "cm-regbits-44xx.h"
36#include "prm44xx.h" 36#include "prm44xx.h"
37#include "prm44xx.h"
38#include "prm-regbits-44xx.h" 37#include "prm-regbits-44xx.h"
39#include "control.h" 38#include "control.h"
40#include "scrm44xx.h" 39#include "scrm44xx.h"
@@ -279,8 +278,10 @@ static struct clk dpll_abe_ck = {
279static struct clk dpll_abe_x2_ck = { 278static struct clk dpll_abe_x2_ck = {
280 .name = "dpll_abe_x2_ck", 279 .name = "dpll_abe_x2_ck",
281 .parent = &dpll_abe_ck, 280 .parent = &dpll_abe_ck,
282 .ops = &clkops_null, 281 .flags = CLOCK_CLKOUTX2,
282 .ops = &clkops_omap4_dpllmx_ops,
283 .recalc = &omap3_clkoutx2_recalc, 283 .recalc = &omap3_clkoutx2_recalc,
284 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE,
284}; 285};
285 286
286static const struct clksel_rate div31_1to31_rates[] = { 287static const struct clksel_rate div31_1to31_rates[] = {
@@ -329,7 +330,7 @@ static struct clk dpll_abe_m2x2_ck = {
329 .clksel = dpll_abe_m2x2_div, 330 .clksel = dpll_abe_m2x2_div,
330 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE, 331 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE,
331 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, 332 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
332 .ops = &clkops_null, 333 .ops = &clkops_omap4_dpllmx_ops,
333 .recalc = &omap2_clksel_recalc, 334 .recalc = &omap2_clksel_recalc,
334 .round_rate = &omap2_clksel_round_rate, 335 .round_rate = &omap2_clksel_round_rate,
335 .set_rate = &omap2_clksel_set_rate, 336 .set_rate = &omap2_clksel_set_rate,
@@ -396,7 +397,7 @@ static struct clk dpll_abe_m3x2_ck = {
396 .clksel = dpll_abe_m2x2_div, 397 .clksel = dpll_abe_m2x2_div,
397 .clksel_reg = OMAP4430_CM_DIV_M3_DPLL_ABE, 398 .clksel_reg = OMAP4430_CM_DIV_M3_DPLL_ABE,
398 .clksel_mask = OMAP4430_DPLL_CLKOUTHIF_DIV_MASK, 399 .clksel_mask = OMAP4430_DPLL_CLKOUTHIF_DIV_MASK,
399 .ops = &clkops_null, 400 .ops = &clkops_omap4_dpllmx_ops,
400 .recalc = &omap2_clksel_recalc, 401 .recalc = &omap2_clksel_recalc,
401 .round_rate = &omap2_clksel_round_rate, 402 .round_rate = &omap2_clksel_round_rate,
402 .set_rate = &omap2_clksel_set_rate, 403 .set_rate = &omap2_clksel_set_rate,
@@ -444,13 +445,14 @@ static struct clk dpll_core_ck = {
444 .parent = &sys_clkin_ck, 445 .parent = &sys_clkin_ck,
445 .dpll_data = &dpll_core_dd, 446 .dpll_data = &dpll_core_dd,
446 .init = &omap2_init_dpll_parent, 447 .init = &omap2_init_dpll_parent,
447 .ops = &clkops_null, 448 .ops = &clkops_omap3_core_dpll_ops,
448 .recalc = &omap3_dpll_recalc, 449 .recalc = &omap3_dpll_recalc,
449}; 450};
450 451
451static struct clk dpll_core_x2_ck = { 452static struct clk dpll_core_x2_ck = {
452 .name = "dpll_core_x2_ck", 453 .name = "dpll_core_x2_ck",
453 .parent = &dpll_core_ck, 454 .parent = &dpll_core_ck,
455 .flags = CLOCK_CLKOUTX2,
454 .ops = &clkops_null, 456 .ops = &clkops_null,
455 .recalc = &omap3_clkoutx2_recalc, 457 .recalc = &omap3_clkoutx2_recalc,
456}; 458};
@@ -466,7 +468,7 @@ static struct clk dpll_core_m6x2_ck = {
466 .clksel = dpll_core_m6x2_div, 468 .clksel = dpll_core_m6x2_div,
467 .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_CORE, 469 .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_CORE,
468 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK, 470 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK,
469 .ops = &clkops_null, 471 .ops = &clkops_omap4_dpllmx_ops,
470 .recalc = &omap2_clksel_recalc, 472 .recalc = &omap2_clksel_recalc,
471 .round_rate = &omap2_clksel_round_rate, 473 .round_rate = &omap2_clksel_round_rate,
472 .set_rate = &omap2_clksel_set_rate, 474 .set_rate = &omap2_clksel_set_rate,
@@ -496,7 +498,7 @@ static struct clk dpll_core_m2_ck = {
496 .clksel = dpll_core_m2_div, 498 .clksel = dpll_core_m2_div,
497 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_CORE, 499 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_CORE,
498 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, 500 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
499 .ops = &clkops_null, 501 .ops = &clkops_omap4_dpllmx_ops,
500 .recalc = &omap2_clksel_recalc, 502 .recalc = &omap2_clksel_recalc,
501 .round_rate = &omap2_clksel_round_rate, 503 .round_rate = &omap2_clksel_round_rate,
502 .set_rate = &omap2_clksel_set_rate, 504 .set_rate = &omap2_clksel_set_rate,
@@ -516,7 +518,7 @@ static struct clk dpll_core_m5x2_ck = {
516 .clksel = dpll_core_m6x2_div, 518 .clksel = dpll_core_m6x2_div,
517 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_CORE, 519 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_CORE,
518 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, 520 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK,
519 .ops = &clkops_null, 521 .ops = &clkops_omap4_dpllmx_ops,
520 .recalc = &omap2_clksel_recalc, 522 .recalc = &omap2_clksel_recalc,
521 .round_rate = &omap2_clksel_round_rate, 523 .round_rate = &omap2_clksel_round_rate,
522 .set_rate = &omap2_clksel_set_rate, 524 .set_rate = &omap2_clksel_set_rate,
@@ -582,7 +584,7 @@ static struct clk dpll_core_m4x2_ck = {
582 .clksel = dpll_core_m6x2_div, 584 .clksel = dpll_core_m6x2_div,
583 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_CORE, 585 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_CORE,
584 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, 586 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK,
585 .ops = &clkops_null, 587 .ops = &clkops_omap4_dpllmx_ops,
586 .recalc = &omap2_clksel_recalc, 588 .recalc = &omap2_clksel_recalc,
587 .round_rate = &omap2_clksel_round_rate, 589 .round_rate = &omap2_clksel_round_rate,
588 .set_rate = &omap2_clksel_set_rate, 590 .set_rate = &omap2_clksel_set_rate,
@@ -607,7 +609,7 @@ static struct clk dpll_abe_m2_ck = {
607 .clksel = dpll_abe_m2_div, 609 .clksel = dpll_abe_m2_div,
608 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE, 610 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE,
609 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, 611 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
610 .ops = &clkops_null, 612 .ops = &clkops_omap4_dpllmx_ops,
611 .recalc = &omap2_clksel_recalc, 613 .recalc = &omap2_clksel_recalc,
612 .round_rate = &omap2_clksel_round_rate, 614 .round_rate = &omap2_clksel_round_rate,
613 .set_rate = &omap2_clksel_set_rate, 615 .set_rate = &omap2_clksel_set_rate,
@@ -633,7 +635,7 @@ static struct clk dpll_core_m7x2_ck = {
633 .clksel = dpll_core_m6x2_div, 635 .clksel = dpll_core_m6x2_div,
634 .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_CORE, 636 .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_CORE,
635 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK, 637 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK,
636 .ops = &clkops_null, 638 .ops = &clkops_omap4_dpllmx_ops,
637 .recalc = &omap2_clksel_recalc, 639 .recalc = &omap2_clksel_recalc,
638 .round_rate = &omap2_clksel_round_rate, 640 .round_rate = &omap2_clksel_round_rate,
639 .set_rate = &omap2_clksel_set_rate, 641 .set_rate = &omap2_clksel_set_rate,
@@ -690,6 +692,7 @@ static struct clk dpll_iva_ck = {
690static struct clk dpll_iva_x2_ck = { 692static struct clk dpll_iva_x2_ck = {
691 .name = "dpll_iva_x2_ck", 693 .name = "dpll_iva_x2_ck",
692 .parent = &dpll_iva_ck, 694 .parent = &dpll_iva_ck,
695 .flags = CLOCK_CLKOUTX2,
693 .ops = &clkops_null, 696 .ops = &clkops_null,
694 .recalc = &omap3_clkoutx2_recalc, 697 .recalc = &omap3_clkoutx2_recalc,
695}; 698};
@@ -705,7 +708,7 @@ static struct clk dpll_iva_m4x2_ck = {
705 .clksel = dpll_iva_m4x2_div, 708 .clksel = dpll_iva_m4x2_div,
706 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_IVA, 709 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_IVA,
707 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, 710 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK,
708 .ops = &clkops_null, 711 .ops = &clkops_omap4_dpllmx_ops,
709 .recalc = &omap2_clksel_recalc, 712 .recalc = &omap2_clksel_recalc,
710 .round_rate = &omap2_clksel_round_rate, 713 .round_rate = &omap2_clksel_round_rate,
711 .set_rate = &omap2_clksel_set_rate, 714 .set_rate = &omap2_clksel_set_rate,
@@ -717,7 +720,7 @@ static struct clk dpll_iva_m5x2_ck = {
717 .clksel = dpll_iva_m4x2_div, 720 .clksel = dpll_iva_m4x2_div,
718 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_IVA, 721 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_IVA,
719 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, 722 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK,
720 .ops = &clkops_null, 723 .ops = &clkops_omap4_dpllmx_ops,
721 .recalc = &omap2_clksel_recalc, 724 .recalc = &omap2_clksel_recalc,
722 .round_rate = &omap2_clksel_round_rate, 725 .round_rate = &omap2_clksel_round_rate,
723 .set_rate = &omap2_clksel_set_rate, 726 .set_rate = &omap2_clksel_set_rate,
@@ -765,7 +768,7 @@ static struct clk dpll_mpu_m2_ck = {
765 .clksel = dpll_mpu_m2_div, 768 .clksel = dpll_mpu_m2_div,
766 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_MPU, 769 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_MPU,
767 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, 770 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
768 .ops = &clkops_null, 771 .ops = &clkops_omap4_dpllmx_ops,
769 .recalc = &omap2_clksel_recalc, 772 .recalc = &omap2_clksel_recalc,
770 .round_rate = &omap2_clksel_round_rate, 773 .round_rate = &omap2_clksel_round_rate,
771 .set_rate = &omap2_clksel_set_rate, 774 .set_rate = &omap2_clksel_set_rate,
@@ -838,7 +841,7 @@ static struct clk dpll_per_m2_ck = {
838 .clksel = dpll_per_m2_div, 841 .clksel = dpll_per_m2_div,
839 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER, 842 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER,
840 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, 843 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
841 .ops = &clkops_null, 844 .ops = &clkops_omap4_dpllmx_ops,
842 .recalc = &omap2_clksel_recalc, 845 .recalc = &omap2_clksel_recalc,
843 .round_rate = &omap2_clksel_round_rate, 846 .round_rate = &omap2_clksel_round_rate,
844 .set_rate = &omap2_clksel_set_rate, 847 .set_rate = &omap2_clksel_set_rate,
@@ -847,8 +850,10 @@ static struct clk dpll_per_m2_ck = {
847static struct clk dpll_per_x2_ck = { 850static struct clk dpll_per_x2_ck = {
848 .name = "dpll_per_x2_ck", 851 .name = "dpll_per_x2_ck",
849 .parent = &dpll_per_ck, 852 .parent = &dpll_per_ck,
850 .ops = &clkops_null, 853 .flags = CLOCK_CLKOUTX2,
854 .ops = &clkops_omap4_dpllmx_ops,
851 .recalc = &omap3_clkoutx2_recalc, 855 .recalc = &omap3_clkoutx2_recalc,
856 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER,
852}; 857};
853 858
854static const struct clksel dpll_per_m2x2_div[] = { 859static const struct clksel dpll_per_m2x2_div[] = {
@@ -862,7 +867,7 @@ static struct clk dpll_per_m2x2_ck = {
862 .clksel = dpll_per_m2x2_div, 867 .clksel = dpll_per_m2x2_div,
863 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER, 868 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER,
864 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, 869 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
865 .ops = &clkops_null, 870 .ops = &clkops_omap4_dpllmx_ops,
866 .recalc = &omap2_clksel_recalc, 871 .recalc = &omap2_clksel_recalc,
867 .round_rate = &omap2_clksel_round_rate, 872 .round_rate = &omap2_clksel_round_rate,
868 .set_rate = &omap2_clksel_set_rate, 873 .set_rate = &omap2_clksel_set_rate,
@@ -888,7 +893,7 @@ static struct clk dpll_per_m4x2_ck = {
888 .clksel = dpll_per_m2x2_div, 893 .clksel = dpll_per_m2x2_div,
889 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_PER, 894 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_PER,
890 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, 895 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK,
891 .ops = &clkops_null, 896 .ops = &clkops_omap4_dpllmx_ops,
892 .recalc = &omap2_clksel_recalc, 897 .recalc = &omap2_clksel_recalc,
893 .round_rate = &omap2_clksel_round_rate, 898 .round_rate = &omap2_clksel_round_rate,
894 .set_rate = &omap2_clksel_set_rate, 899 .set_rate = &omap2_clksel_set_rate,
@@ -900,7 +905,7 @@ static struct clk dpll_per_m5x2_ck = {
900 .clksel = dpll_per_m2x2_div, 905 .clksel = dpll_per_m2x2_div,
901 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_PER, 906 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_PER,
902 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, 907 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK,
903 .ops = &clkops_null, 908 .ops = &clkops_omap4_dpllmx_ops,
904 .recalc = &omap2_clksel_recalc, 909 .recalc = &omap2_clksel_recalc,
905 .round_rate = &omap2_clksel_round_rate, 910 .round_rate = &omap2_clksel_round_rate,
906 .set_rate = &omap2_clksel_set_rate, 911 .set_rate = &omap2_clksel_set_rate,
@@ -912,7 +917,7 @@ static struct clk dpll_per_m6x2_ck = {
912 .clksel = dpll_per_m2x2_div, 917 .clksel = dpll_per_m2x2_div,
913 .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_PER, 918 .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_PER,
914 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK, 919 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK,
915 .ops = &clkops_null, 920 .ops = &clkops_omap4_dpllmx_ops,
916 .recalc = &omap2_clksel_recalc, 921 .recalc = &omap2_clksel_recalc,
917 .round_rate = &omap2_clksel_round_rate, 922 .round_rate = &omap2_clksel_round_rate,
918 .set_rate = &omap2_clksel_set_rate, 923 .set_rate = &omap2_clksel_set_rate,
@@ -924,7 +929,7 @@ static struct clk dpll_per_m7x2_ck = {
924 .clksel = dpll_per_m2x2_div, 929 .clksel = dpll_per_m2x2_div,
925 .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_PER, 930 .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_PER,
926 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK, 931 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK,
927 .ops = &clkops_null, 932 .ops = &clkops_omap4_dpllmx_ops,
928 .recalc = &omap2_clksel_recalc, 933 .recalc = &omap2_clksel_recalc,
929 .round_rate = &omap2_clksel_round_rate, 934 .round_rate = &omap2_clksel_round_rate,
930 .set_rate = &omap2_clksel_set_rate, 935 .set_rate = &omap2_clksel_set_rate,
@@ -965,6 +970,7 @@ static struct clk dpll_unipro_ck = {
965static struct clk dpll_unipro_x2_ck = { 970static struct clk dpll_unipro_x2_ck = {
966 .name = "dpll_unipro_x2_ck", 971 .name = "dpll_unipro_x2_ck",
967 .parent = &dpll_unipro_ck, 972 .parent = &dpll_unipro_ck,
973 .flags = CLOCK_CLKOUTX2,
968 .ops = &clkops_null, 974 .ops = &clkops_null,
969 .recalc = &omap3_clkoutx2_recalc, 975 .recalc = &omap3_clkoutx2_recalc,
970}; 976};
@@ -980,7 +986,7 @@ static struct clk dpll_unipro_m2x2_ck = {
980 .clksel = dpll_unipro_m2x2_div, 986 .clksel = dpll_unipro_m2x2_div,
981 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_UNIPRO, 987 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_UNIPRO,
982 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, 988 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
983 .ops = &clkops_null, 989 .ops = &clkops_omap4_dpllmx_ops,
984 .recalc = &omap2_clksel_recalc, 990 .recalc = &omap2_clksel_recalc,
985 .round_rate = &omap2_clksel_round_rate, 991 .round_rate = &omap2_clksel_round_rate,
986 .set_rate = &omap2_clksel_set_rate, 992 .set_rate = &omap2_clksel_set_rate,
@@ -1029,7 +1035,8 @@ static struct clk dpll_usb_ck = {
1029static struct clk dpll_usb_clkdcoldo_ck = { 1035static struct clk dpll_usb_clkdcoldo_ck = {
1030 .name = "dpll_usb_clkdcoldo_ck", 1036 .name = "dpll_usb_clkdcoldo_ck",
1031 .parent = &dpll_usb_ck, 1037 .parent = &dpll_usb_ck,
1032 .ops = &clkops_null, 1038 .ops = &clkops_omap4_dpllmx_ops,
1039 .clksel_reg = OMAP4430_CM_CLKDCOLDO_DPLL_USB,
1033 .recalc = &followparent_recalc, 1040 .recalc = &followparent_recalc,
1034}; 1041};
1035 1042
@@ -1044,7 +1051,7 @@ static struct clk dpll_usb_m2_ck = {
1044 .clksel = dpll_usb_m2_div, 1051 .clksel = dpll_usb_m2_div,
1045 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_USB, 1052 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_USB,
1046 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_0_6_MASK, 1053 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_0_6_MASK,
1047 .ops = &clkops_null, 1054 .ops = &clkops_omap4_dpllmx_ops,
1048 .recalc = &omap2_clksel_recalc, 1055 .recalc = &omap2_clksel_recalc,
1049 .round_rate = &omap2_clksel_round_rate, 1056 .round_rate = &omap2_clksel_round_rate,
1050 .set_rate = &omap2_clksel_set_rate, 1057 .set_rate = &omap2_clksel_set_rate,
@@ -3107,11 +3114,16 @@ static struct omap_clk omap44xx_clks[] = {
3107 CLK(NULL, "dmic_sync_mux_ck", &dmic_sync_mux_ck, CK_443X), 3114 CLK(NULL, "dmic_sync_mux_ck", &dmic_sync_mux_ck, CK_443X),
3108 CLK(NULL, "dmic_fck", &dmic_fck, CK_443X), 3115 CLK(NULL, "dmic_fck", &dmic_fck, CK_443X),
3109 CLK(NULL, "dsp_fck", &dsp_fck, CK_443X), 3116 CLK(NULL, "dsp_fck", &dsp_fck, CK_443X),
3110 CLK(NULL, "dss_sys_clk", &dss_sys_clk, CK_443X), 3117 CLK("omapdss_dss", "sys_clk", &dss_sys_clk, CK_443X),
3111 CLK(NULL, "dss_tv_clk", &dss_tv_clk, CK_443X), 3118 CLK("omapdss_dss", "tv_clk", &dss_tv_clk, CK_443X),
3112 CLK(NULL, "dss_dss_clk", &dss_dss_clk, CK_443X), 3119 CLK("omapdss_dss", "dss_clk", &dss_dss_clk, CK_443X),
3113 CLK(NULL, "dss_48mhz_clk", &dss_48mhz_clk, CK_443X), 3120 CLK("omapdss_dss", "video_clk", &dss_48mhz_clk, CK_443X),
3114 CLK(NULL, "dss_fck", &dss_fck, CK_443X), 3121 CLK("omapdss_dss", "fck", &dss_fck, CK_443X),
3122 /*
3123 * On OMAP4, DSS ick is a dummy clock; this is needed for compatibility
3124 * with OMAP2/3.
3125 */
3126 CLK("omapdss_dss", "ick", &dummy_ck, CK_443X),
3115 CLK(NULL, "efuse_ctrl_cust_fck", &efuse_ctrl_cust_fck, CK_443X), 3127 CLK(NULL, "efuse_ctrl_cust_fck", &efuse_ctrl_cust_fck, CK_443X),
3116 CLK(NULL, "emif1_fck", &emif1_fck, CK_443X), 3128 CLK(NULL, "emif1_fck", &emif1_fck, CK_443X),
3117 CLK(NULL, "emif2_fck", &emif2_fck, CK_443X), 3129 CLK(NULL, "emif2_fck", &emif2_fck, CK_443X),
@@ -3159,11 +3171,11 @@ static struct omap_clk omap44xx_clks[] = {
3159 CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_443X), 3171 CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_443X),
3160 CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_443X), 3172 CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_443X),
3161 CLK("omap2_mcspi.4", "fck", &mcspi4_fck, CK_443X), 3173 CLK("omap2_mcspi.4", "fck", &mcspi4_fck, CK_443X),
3162 CLK("mmci-omap-hs.0", "fck", &mmc1_fck, CK_443X), 3174 CLK("omap_hsmmc.0", "fck", &mmc1_fck, CK_443X),
3163 CLK("mmci-omap-hs.1", "fck", &mmc2_fck, CK_443X), 3175 CLK("omap_hsmmc.1", "fck", &mmc2_fck, CK_443X),
3164 CLK("mmci-omap-hs.2", "fck", &mmc3_fck, CK_443X), 3176 CLK("omap_hsmmc.2", "fck", &mmc3_fck, CK_443X),
3165 CLK("mmci-omap-hs.3", "fck", &mmc4_fck, CK_443X), 3177 CLK("omap_hsmmc.3", "fck", &mmc4_fck, CK_443X),
3166 CLK("mmci-omap-hs.4", "fck", &mmc5_fck, CK_443X), 3178 CLK("omap_hsmmc.4", "fck", &mmc5_fck, CK_443X),
3167 CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m, CK_443X), 3179 CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m, CK_443X),
3168 CLK(NULL, "ocp2scp_usb_phy_ick", &ocp2scp_usb_phy_ick, CK_443X), 3180 CLK(NULL, "ocp2scp_usb_phy_ick", &ocp2scp_usb_phy_ick, CK_443X),
3169 CLK(NULL, "ocp_wp_noc_ick", &ocp_wp_noc_ick, CK_443X), 3181 CLK(NULL, "ocp_wp_noc_ick", &ocp_wp_noc_ick, CK_443X),
@@ -3198,7 +3210,7 @@ static struct omap_clk omap44xx_clks[] = {
3198 CLK(NULL, "uart3_fck", &uart3_fck, CK_443X), 3210 CLK(NULL, "uart3_fck", &uart3_fck, CK_443X),
3199 CLK(NULL, "uart4_fck", &uart4_fck, CK_443X), 3211 CLK(NULL, "uart4_fck", &uart4_fck, CK_443X),
3200 CLK(NULL, "usb_host_fs_fck", &usb_host_fs_fck, CK_443X), 3212 CLK(NULL, "usb_host_fs_fck", &usb_host_fs_fck, CK_443X),
3201 CLK("ehci-omap.0", "fs_fck", &usb_host_fs_fck, CK_443X), 3213 CLK("usbhs-omap.0", "fs_fck", &usb_host_fs_fck, CK_443X),
3202 CLK(NULL, "utmi_p1_gfclk", &utmi_p1_gfclk, CK_443X), 3214 CLK(NULL, "utmi_p1_gfclk", &utmi_p1_gfclk, CK_443X),
3203 CLK(NULL, "usb_host_hs_utmi_p1_clk", &usb_host_hs_utmi_p1_clk, CK_443X), 3215 CLK(NULL, "usb_host_hs_utmi_p1_clk", &usb_host_hs_utmi_p1_clk, CK_443X),
3204 CLK(NULL, "utmi_p2_gfclk", &utmi_p2_gfclk, CK_443X), 3216 CLK(NULL, "utmi_p2_gfclk", &utmi_p2_gfclk, CK_443X),
@@ -3210,8 +3222,8 @@ static struct omap_clk omap44xx_clks[] = {
3210 CLK(NULL, "usb_host_hs_hsic480m_p2_clk", &usb_host_hs_hsic480m_p2_clk, CK_443X), 3222 CLK(NULL, "usb_host_hs_hsic480m_p2_clk", &usb_host_hs_hsic480m_p2_clk, CK_443X),
3211 CLK(NULL, "usb_host_hs_func48mclk", &usb_host_hs_func48mclk, CK_443X), 3223 CLK(NULL, "usb_host_hs_func48mclk", &usb_host_hs_func48mclk, CK_443X),
3212 CLK(NULL, "usb_host_hs_fck", &usb_host_hs_fck, CK_443X), 3224 CLK(NULL, "usb_host_hs_fck", &usb_host_hs_fck, CK_443X),
3213 CLK("ehci-omap.0", "hs_fck", &usb_host_hs_fck, CK_443X), 3225 CLK("usbhs-omap.0", "hs_fck", &usb_host_hs_fck, CK_443X),
3214 CLK("ehci-omap.0", "usbhost_ick", &dummy_ck, CK_443X), 3226 CLK("usbhs-omap.0", "usbhost_ick", &dummy_ck, CK_443X),
3215 CLK(NULL, "otg_60m_gfclk", &otg_60m_gfclk, CK_443X), 3227 CLK(NULL, "otg_60m_gfclk", &otg_60m_gfclk, CK_443X),
3216 CLK(NULL, "usb_otg_hs_xclk", &usb_otg_hs_xclk, CK_443X), 3228 CLK(NULL, "usb_otg_hs_xclk", &usb_otg_hs_xclk, CK_443X),
3217 CLK("musb-omap2430", "ick", &usb_otg_hs_ick, CK_443X), 3229 CLK("musb-omap2430", "ick", &usb_otg_hs_ick, CK_443X),
@@ -3220,8 +3232,8 @@ static struct omap_clk omap44xx_clks[] = {
3220 CLK(NULL, "usb_tll_hs_usb_ch0_clk", &usb_tll_hs_usb_ch0_clk, CK_443X), 3232 CLK(NULL, "usb_tll_hs_usb_ch0_clk", &usb_tll_hs_usb_ch0_clk, CK_443X),
3221 CLK(NULL, "usb_tll_hs_usb_ch1_clk", &usb_tll_hs_usb_ch1_clk, CK_443X), 3233 CLK(NULL, "usb_tll_hs_usb_ch1_clk", &usb_tll_hs_usb_ch1_clk, CK_443X),
3222 CLK(NULL, "usb_tll_hs_ick", &usb_tll_hs_ick, CK_443X), 3234 CLK(NULL, "usb_tll_hs_ick", &usb_tll_hs_ick, CK_443X),
3223 CLK("ehci-omap.0", "usbtll_ick", &usb_tll_hs_ick, CK_443X), 3235 CLK("usbhs-omap.0", "usbtll_ick", &usb_tll_hs_ick, CK_443X),
3224 CLK("ehci-omap.0", "usbtll_fck", &dummy_ck, CK_443X), 3236 CLK("usbhs-omap.0", "usbtll_fck", &dummy_ck, CK_443X),
3225 CLK(NULL, "usim_ck", &usim_ck, CK_443X), 3237 CLK(NULL, "usim_ck", &usim_ck, CK_443X),
3226 CLK(NULL, "usim_fclk", &usim_fclk, CK_443X), 3238 CLK(NULL, "usim_fclk", &usim_fclk, CK_443X),
3227 CLK(NULL, "usim_fck", &usim_fck, CK_443X), 3239 CLK(NULL, "usim_fck", &usim_fck, CK_443X),
@@ -3246,11 +3258,11 @@ static struct omap_clk omap44xx_clks[] = {
3246 CLK("omap_i2c.2", "ick", &dummy_ck, CK_443X), 3258 CLK("omap_i2c.2", "ick", &dummy_ck, CK_443X),
3247 CLK("omap_i2c.3", "ick", &dummy_ck, CK_443X), 3259 CLK("omap_i2c.3", "ick", &dummy_ck, CK_443X),
3248 CLK("omap_i2c.4", "ick", &dummy_ck, CK_443X), 3260 CLK("omap_i2c.4", "ick", &dummy_ck, CK_443X),
3249 CLK("mmci-omap-hs.0", "ick", &dummy_ck, CK_443X), 3261 CLK("omap_hsmmc.0", "ick", &dummy_ck, CK_443X),
3250 CLK("mmci-omap-hs.1", "ick", &dummy_ck, CK_443X), 3262 CLK("omap_hsmmc.1", "ick", &dummy_ck, CK_443X),
3251 CLK("mmci-omap-hs.2", "ick", &dummy_ck, CK_443X), 3263 CLK("omap_hsmmc.2", "ick", &dummy_ck, CK_443X),
3252 CLK("mmci-omap-hs.3", "ick", &dummy_ck, CK_443X), 3264 CLK("omap_hsmmc.3", "ick", &dummy_ck, CK_443X),
3253 CLK("mmci-omap-hs.4", "ick", &dummy_ck, CK_443X), 3265 CLK("omap_hsmmc.4", "ick", &dummy_ck, CK_443X),
3254 CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_443X), 3266 CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_443X),
3255 CLK("omap-mcbsp.2", "ick", &dummy_ck, CK_443X), 3267 CLK("omap-mcbsp.2", "ick", &dummy_ck, CK_443X),
3256 CLK("omap-mcbsp.3", "ick", &dummy_ck, CK_443X), 3268 CLK("omap-mcbsp.3", "ick", &dummy_ck, CK_443X),
@@ -3302,6 +3314,9 @@ int __init omap4xxx_clk_init(void)
3302 omap2_init_clk_clkdm(c->lk.clk); 3314 omap2_init_clk_clkdm(c->lk.clk);
3303 } 3315 }
3304 3316
3317 /* Disable autoidle on all clocks; let the PM code enable it later */
3318 omap_clk_disable_autoidle_all();
3319
3305 recalculate_root_clocks(); 3320 recalculate_root_clocks();
3306 3321
3307 /* 3322 /*
diff --git a/arch/arm/mach-omap2/clock_common_data.c b/arch/arm/mach-omap2/clock_common_data.c
index 1cf8131205fa..6424d46be14a 100644
--- a/arch/arm/mach-omap2/clock_common_data.c
+++ b/arch/arm/mach-omap2/clock_common_data.c
@@ -37,3 +37,9 @@ const struct clksel_rate gfx_l3_rates[] = {
37 { .div = 0 } 37 { .div = 0 }
38}; 38};
39 39
40const struct clksel_rate dsp_ick_rates[] = {
41 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
42 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
43 { .div = 3, .val = 3, .flags = RATE_IN_243X },
44 { .div = 0 },
45};
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c
index e20b98636ab4..ab878545bd9b 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -26,17 +26,8 @@
26 26
27#include <linux/bitops.h> 27#include <linux/bitops.h>
28 28
29#include "prm2xxx_3xxx.h"
30#include "prm-regbits-24xx.h"
31#include "cm2xxx_3xxx.h"
32#include "cm-regbits-24xx.h"
33#include "cminst44xx.h"
34#include "prcm44xx.h"
35
36#include <plat/clock.h> 29#include <plat/clock.h>
37#include "powerdomain.h"
38#include "clockdomain.h" 30#include "clockdomain.h"
39#include <plat/prcm.h>
40 31
41/* clkdm_list contains all registered struct clockdomains */ 32/* clkdm_list contains all registered struct clockdomains */
42static LIST_HEAD(clkdm_list); 33static LIST_HEAD(clkdm_list);
@@ -44,6 +35,7 @@ static LIST_HEAD(clkdm_list);
44/* array of clockdomain deps to be added/removed when clkdm in hwsup mode */ 35/* array of clockdomain deps to be added/removed when clkdm in hwsup mode */
45static struct clkdm_autodep *autodeps; 36static struct clkdm_autodep *autodeps;
46 37
38static struct clkdm_ops *arch_clkdm;
47 39
48/* Private functions */ 40/* Private functions */
49 41
@@ -177,11 +169,11 @@ static void _autodep_lookup(struct clkdm_autodep *autodep)
177 * XXX autodeps are deprecated and should be removed at the earliest 169 * XXX autodeps are deprecated and should be removed at the earliest
178 * opportunity 170 * opportunity
179 */ 171 */
180static void _clkdm_add_autodeps(struct clockdomain *clkdm) 172void _clkdm_add_autodeps(struct clockdomain *clkdm)
181{ 173{
182 struct clkdm_autodep *autodep; 174 struct clkdm_autodep *autodep;
183 175
184 if (!autodeps) 176 if (!autodeps || clkdm->flags & CLKDM_NO_AUTODEPS)
185 return; 177 return;
186 178
187 for (autodep = autodeps; autodep->clkdm.ptr; autodep++) { 179 for (autodep = autodeps; autodep->clkdm.ptr; autodep++) {
@@ -211,11 +203,11 @@ static void _clkdm_add_autodeps(struct clockdomain *clkdm)
211 * XXX autodeps are deprecated and should be removed at the earliest 203 * XXX autodeps are deprecated and should be removed at the earliest
212 * opportunity 204 * opportunity
213 */ 205 */
214static void _clkdm_del_autodeps(struct clockdomain *clkdm) 206void _clkdm_del_autodeps(struct clockdomain *clkdm)
215{ 207{
216 struct clkdm_autodep *autodep; 208 struct clkdm_autodep *autodep;
217 209
218 if (!autodeps) 210 if (!autodeps || clkdm->flags & CLKDM_NO_AUTODEPS)
219 return; 211 return;
220 212
221 for (autodep = autodeps; autodep->clkdm.ptr; autodep++) { 213 for (autodep = autodeps; autodep->clkdm.ptr; autodep++) {
@@ -235,55 +227,29 @@ static void _clkdm_del_autodeps(struct clockdomain *clkdm)
235} 227}
236 228
237/** 229/**
238 * _enable_hwsup - place a clockdomain into hardware-supervised idle 230 * _resolve_clkdm_deps() - resolve clkdm_names in @clkdm_deps to clkdms
239 * @clkdm: struct clockdomain * 231 * @clkdm: clockdomain that we are resolving dependencies for
240 * 232 * @clkdm_deps: ptr to array of struct clkdm_deps to resolve
241 * Place the clockdomain into hardware-supervised idle mode. No return
242 * value.
243 *
244 * XXX Should this return an error if the clockdomain does not support
245 * hardware-supervised idle mode?
246 */
247static void _enable_hwsup(struct clockdomain *clkdm)
248{
249 if (cpu_is_omap24xx())
250 omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
251 clkdm->clktrctrl_mask);
252 else if (cpu_is_omap34xx())
253 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
254 clkdm->clktrctrl_mask);
255 else if (cpu_is_omap44xx())
256 return omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition,
257 clkdm->cm_inst,
258 clkdm->clkdm_offs);
259 else
260 BUG();
261}
262
263/**
264 * _disable_hwsup - place a clockdomain into software-supervised idle
265 * @clkdm: struct clockdomain *
266 * 233 *
267 * Place the clockdomain @clkdm into software-supervised idle mode. 234 * Iterates through @clkdm_deps, looking up the struct clockdomain named by
235 * clkdm_name and storing the clockdomain pointer in the struct clkdm_dep.
268 * No return value. 236 * No return value.
269 *
270 * XXX Should this return an error if the clockdomain does not support
271 * software-supervised idle mode?
272 */ 237 */
273static void _disable_hwsup(struct clockdomain *clkdm) 238static void _resolve_clkdm_deps(struct clockdomain *clkdm,
239 struct clkdm_dep *clkdm_deps)
274{ 240{
275 if (cpu_is_omap24xx()) 241 struct clkdm_dep *cd;
276 omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs, 242
277 clkdm->clktrctrl_mask); 243 for (cd = clkdm_deps; cd && cd->clkdm_name; cd++) {
278 else if (cpu_is_omap34xx()) 244 if (!omap_chip_is(cd->omap_chip))
279 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs, 245 continue;
280 clkdm->clktrctrl_mask); 246 if (cd->clkdm)
281 else if (cpu_is_omap44xx()) 247 continue;
282 return omap4_cminst_clkdm_disable_hwsup(clkdm->prcm_partition, 248 cd->clkdm = _clkdm_lookup(cd->clkdm_name);
283 clkdm->cm_inst, 249
284 clkdm->clkdm_offs); 250 WARN(!cd->clkdm, "clockdomain: %s: could not find clkdm %s while resolving dependencies - should never happen",
285 else 251 clkdm->name, cd->clkdm_name);
286 BUG(); 252 }
287} 253}
288 254
289/* Public functions */ 255/* Public functions */
@@ -292,6 +258,7 @@ static void _disable_hwsup(struct clockdomain *clkdm)
292 * clkdm_init - set up the clockdomain layer 258 * clkdm_init - set up the clockdomain layer
293 * @clkdms: optional pointer to an array of clockdomains to register 259 * @clkdms: optional pointer to an array of clockdomains to register
294 * @init_autodeps: optional pointer to an array of autodeps to register 260 * @init_autodeps: optional pointer to an array of autodeps to register
261 * @custom_funcs: func pointers for arch specfic implementations
295 * 262 *
296 * Set up internal state. If a pointer to an array of clockdomains 263 * Set up internal state. If a pointer to an array of clockdomains
297 * @clkdms was supplied, loop through the list of clockdomains, 264 * @clkdms was supplied, loop through the list of clockdomains,
@@ -300,12 +267,18 @@ static void _disable_hwsup(struct clockdomain *clkdm)
300 * @init_autodeps was provided, register those. No return value. 267 * @init_autodeps was provided, register those. No return value.
301 */ 268 */
302void clkdm_init(struct clockdomain **clkdms, 269void clkdm_init(struct clockdomain **clkdms,
303 struct clkdm_autodep *init_autodeps) 270 struct clkdm_autodep *init_autodeps,
271 struct clkdm_ops *custom_funcs)
304{ 272{
305 struct clockdomain **c = NULL; 273 struct clockdomain **c = NULL;
306 struct clockdomain *clkdm; 274 struct clockdomain *clkdm;
307 struct clkdm_autodep *autodep = NULL; 275 struct clkdm_autodep *autodep = NULL;
308 276
277 if (!custom_funcs)
278 WARN(1, "No custom clkdm functions registered\n");
279 else
280 arch_clkdm = custom_funcs;
281
309 if (clkdms) 282 if (clkdms)
310 for (c = clkdms; *c; c++) 283 for (c = clkdms; *c; c++)
311 _clkdm_register(*c); 284 _clkdm_register(*c);
@@ -321,11 +294,14 @@ void clkdm_init(struct clockdomain **clkdms,
321 */ 294 */
322 list_for_each_entry(clkdm, &clkdm_list, node) { 295 list_for_each_entry(clkdm, &clkdm_list, node) {
323 if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP) 296 if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)
324 omap2_clkdm_wakeup(clkdm); 297 clkdm_wakeup(clkdm);
325 else if (clkdm->flags & CLKDM_CAN_DISABLE_AUTO) 298 else if (clkdm->flags & CLKDM_CAN_DISABLE_AUTO)
326 omap2_clkdm_deny_idle(clkdm); 299 clkdm_deny_idle(clkdm);
327 300
301 _resolve_clkdm_deps(clkdm, clkdm->wkdep_srcs);
328 clkdm_clear_all_wkdeps(clkdm); 302 clkdm_clear_all_wkdeps(clkdm);
303
304 _resolve_clkdm_deps(clkdm, clkdm->sleepdep_srcs);
329 clkdm_clear_all_sleepdeps(clkdm); 305 clkdm_clear_all_sleepdeps(clkdm);
330 } 306 }
331} 307}
@@ -422,26 +398,32 @@ struct powerdomain *clkdm_get_pwrdm(struct clockdomain *clkdm)
422int clkdm_add_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) 398int clkdm_add_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
423{ 399{
424 struct clkdm_dep *cd; 400 struct clkdm_dep *cd;
401 int ret = 0;
425 402
426 if (!clkdm1 || !clkdm2) 403 if (!clkdm1 || !clkdm2)
427 return -EINVAL; 404 return -EINVAL;
428 405
429 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); 406 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs);
430 if (IS_ERR(cd)) { 407 if (IS_ERR(cd))
408 ret = PTR_ERR(cd);
409
410 if (!arch_clkdm || !arch_clkdm->clkdm_add_wkdep)
411 ret = -EINVAL;
412
413 if (ret) {
431 pr_debug("clockdomain: hardware cannot set/clear wake up of " 414 pr_debug("clockdomain: hardware cannot set/clear wake up of "
432 "%s when %s wakes up\n", clkdm1->name, clkdm2->name); 415 "%s when %s wakes up\n", clkdm1->name, clkdm2->name);
433 return PTR_ERR(cd); 416 return ret;
434 } 417 }
435 418
436 if (atomic_inc_return(&cd->wkdep_usecount) == 1) { 419 if (atomic_inc_return(&cd->wkdep_usecount) == 1) {
437 pr_debug("clockdomain: hardware will wake up %s when %s wakes " 420 pr_debug("clockdomain: hardware will wake up %s when %s wakes "
438 "up\n", clkdm1->name, clkdm2->name); 421 "up\n", clkdm1->name, clkdm2->name);
439 422
440 omap2_prm_set_mod_reg_bits((1 << clkdm2->dep_bit), 423 ret = arch_clkdm->clkdm_add_wkdep(clkdm1, clkdm2);
441 clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP);
442 } 424 }
443 425
444 return 0; 426 return ret;
445} 427}
446 428
447/** 429/**
@@ -457,26 +439,32 @@ int clkdm_add_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
457int clkdm_del_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) 439int clkdm_del_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
458{ 440{
459 struct clkdm_dep *cd; 441 struct clkdm_dep *cd;
442 int ret = 0;
460 443
461 if (!clkdm1 || !clkdm2) 444 if (!clkdm1 || !clkdm2)
462 return -EINVAL; 445 return -EINVAL;
463 446
464 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); 447 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs);
465 if (IS_ERR(cd)) { 448 if (IS_ERR(cd))
449 ret = PTR_ERR(cd);
450
451 if (!arch_clkdm || !arch_clkdm->clkdm_del_wkdep)
452 ret = -EINVAL;
453
454 if (ret) {
466 pr_debug("clockdomain: hardware cannot set/clear wake up of " 455 pr_debug("clockdomain: hardware cannot set/clear wake up of "
467 "%s when %s wakes up\n", clkdm1->name, clkdm2->name); 456 "%s when %s wakes up\n", clkdm1->name, clkdm2->name);
468 return PTR_ERR(cd); 457 return ret;
469 } 458 }
470 459
471 if (atomic_dec_return(&cd->wkdep_usecount) == 0) { 460 if (atomic_dec_return(&cd->wkdep_usecount) == 0) {
472 pr_debug("clockdomain: hardware will no longer wake up %s " 461 pr_debug("clockdomain: hardware will no longer wake up %s "
473 "after %s wakes up\n", clkdm1->name, clkdm2->name); 462 "after %s wakes up\n", clkdm1->name, clkdm2->name);
474 463
475 omap2_prm_clear_mod_reg_bits((1 << clkdm2->dep_bit), 464 ret = arch_clkdm->clkdm_del_wkdep(clkdm1, clkdm2);
476 clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP);
477 } 465 }
478 466
479 return 0; 467 return ret;
480} 468}
481 469
482/** 470/**
@@ -496,20 +484,26 @@ int clkdm_del_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
496int clkdm_read_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) 484int clkdm_read_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
497{ 485{
498 struct clkdm_dep *cd; 486 struct clkdm_dep *cd;
487 int ret = 0;
499 488
500 if (!clkdm1 || !clkdm2) 489 if (!clkdm1 || !clkdm2)
501 return -EINVAL; 490 return -EINVAL;
502 491
503 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); 492 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs);
504 if (IS_ERR(cd)) { 493 if (IS_ERR(cd))
494 ret = PTR_ERR(cd);
495
496 if (!arch_clkdm || !arch_clkdm->clkdm_read_wkdep)
497 ret = -EINVAL;
498
499 if (ret) {
505 pr_debug("clockdomain: hardware cannot set/clear wake up of " 500 pr_debug("clockdomain: hardware cannot set/clear wake up of "
506 "%s when %s wakes up\n", clkdm1->name, clkdm2->name); 501 "%s when %s wakes up\n", clkdm1->name, clkdm2->name);
507 return PTR_ERR(cd); 502 return ret;
508 } 503 }
509 504
510 /* XXX It's faster to return the atomic wkdep_usecount */ 505 /* XXX It's faster to return the atomic wkdep_usecount */
511 return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP, 506 return arch_clkdm->clkdm_read_wkdep(clkdm1, clkdm2);
512 (1 << clkdm2->dep_bit));
513} 507}
514 508
515/** 509/**
@@ -524,27 +518,13 @@ int clkdm_read_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
524 */ 518 */
525int clkdm_clear_all_wkdeps(struct clockdomain *clkdm) 519int clkdm_clear_all_wkdeps(struct clockdomain *clkdm)
526{ 520{
527 struct clkdm_dep *cd;
528 u32 mask = 0;
529
530 if (!clkdm) 521 if (!clkdm)
531 return -EINVAL; 522 return -EINVAL;
532 523
533 for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) { 524 if (!arch_clkdm || !arch_clkdm->clkdm_clear_all_wkdeps)
534 if (!omap_chip_is(cd->omap_chip)) 525 return -EINVAL;
535 continue;
536
537 if (!cd->clkdm && cd->clkdm_name)
538 cd->clkdm = _clkdm_lookup(cd->clkdm_name);
539
540 /* PRM accesses are slow, so minimize them */
541 mask |= 1 << cd->clkdm->dep_bit;
542 atomic_set(&cd->wkdep_usecount, 0);
543 }
544
545 omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs, PM_WKDEP);
546 526
547 return 0; 527 return arch_clkdm->clkdm_clear_all_wkdeps(clkdm);
548} 528}
549 529
550/** 530/**
@@ -562,31 +542,33 @@ int clkdm_clear_all_wkdeps(struct clockdomain *clkdm)
562int clkdm_add_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) 542int clkdm_add_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
563{ 543{
564 struct clkdm_dep *cd; 544 struct clkdm_dep *cd;
565 545 int ret = 0;
566 if (!cpu_is_omap34xx())
567 return -EINVAL;
568 546
569 if (!clkdm1 || !clkdm2) 547 if (!clkdm1 || !clkdm2)
570 return -EINVAL; 548 return -EINVAL;
571 549
572 cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs); 550 cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs);
573 if (IS_ERR(cd)) { 551 if (IS_ERR(cd))
552 ret = PTR_ERR(cd);
553
554 if (!arch_clkdm || !arch_clkdm->clkdm_add_sleepdep)
555 ret = -EINVAL;
556
557 if (ret) {
574 pr_debug("clockdomain: hardware cannot set/clear sleep " 558 pr_debug("clockdomain: hardware cannot set/clear sleep "
575 "dependency affecting %s from %s\n", clkdm1->name, 559 "dependency affecting %s from %s\n", clkdm1->name,
576 clkdm2->name); 560 clkdm2->name);
577 return PTR_ERR(cd); 561 return ret;
578 } 562 }
579 563
580 if (atomic_inc_return(&cd->sleepdep_usecount) == 1) { 564 if (atomic_inc_return(&cd->sleepdep_usecount) == 1) {
581 pr_debug("clockdomain: will prevent %s from sleeping if %s " 565 pr_debug("clockdomain: will prevent %s from sleeping if %s "
582 "is active\n", clkdm1->name, clkdm2->name); 566 "is active\n", clkdm1->name, clkdm2->name);
583 567
584 omap2_cm_set_mod_reg_bits((1 << clkdm2->dep_bit), 568 ret = arch_clkdm->clkdm_add_sleepdep(clkdm1, clkdm2);
585 clkdm1->pwrdm.ptr->prcm_offs,
586 OMAP3430_CM_SLEEPDEP);
587 } 569 }
588 570
589 return 0; 571 return ret;
590} 572}
591 573
592/** 574/**
@@ -604,19 +586,23 @@ int clkdm_add_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
604int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) 586int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
605{ 587{
606 struct clkdm_dep *cd; 588 struct clkdm_dep *cd;
607 589 int ret = 0;
608 if (!cpu_is_omap34xx())
609 return -EINVAL;
610 590
611 if (!clkdm1 || !clkdm2) 591 if (!clkdm1 || !clkdm2)
612 return -EINVAL; 592 return -EINVAL;
613 593
614 cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs); 594 cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs);
615 if (IS_ERR(cd)) { 595 if (IS_ERR(cd))
596 ret = PTR_ERR(cd);
597
598 if (!arch_clkdm || !arch_clkdm->clkdm_del_sleepdep)
599 ret = -EINVAL;
600
601 if (ret) {
616 pr_debug("clockdomain: hardware cannot set/clear sleep " 602 pr_debug("clockdomain: hardware cannot set/clear sleep "
617 "dependency affecting %s from %s\n", clkdm1->name, 603 "dependency affecting %s from %s\n", clkdm1->name,
618 clkdm2->name); 604 clkdm2->name);
619 return PTR_ERR(cd); 605 return ret;
620 } 606 }
621 607
622 if (atomic_dec_return(&cd->sleepdep_usecount) == 0) { 608 if (atomic_dec_return(&cd->sleepdep_usecount) == 0) {
@@ -624,12 +610,10 @@ int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
624 "sleeping if %s is active\n", clkdm1->name, 610 "sleeping if %s is active\n", clkdm1->name,
625 clkdm2->name); 611 clkdm2->name);
626 612
627 omap2_cm_clear_mod_reg_bits((1 << clkdm2->dep_bit), 613 ret = arch_clkdm->clkdm_del_sleepdep(clkdm1, clkdm2);
628 clkdm1->pwrdm.ptr->prcm_offs,
629 OMAP3430_CM_SLEEPDEP);
630 } 614 }
631 615
632 return 0; 616 return ret;
633} 617}
634 618
635/** 619/**
@@ -651,25 +635,27 @@ int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
651int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) 635int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
652{ 636{
653 struct clkdm_dep *cd; 637 struct clkdm_dep *cd;
654 638 int ret = 0;
655 if (!cpu_is_omap34xx())
656 return -EINVAL;
657 639
658 if (!clkdm1 || !clkdm2) 640 if (!clkdm1 || !clkdm2)
659 return -EINVAL; 641 return -EINVAL;
660 642
661 cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs); 643 cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs);
662 if (IS_ERR(cd)) { 644 if (IS_ERR(cd))
645 ret = PTR_ERR(cd);
646
647 if (!arch_clkdm || !arch_clkdm->clkdm_read_sleepdep)
648 ret = -EINVAL;
649
650 if (ret) {
663 pr_debug("clockdomain: hardware cannot set/clear sleep " 651 pr_debug("clockdomain: hardware cannot set/clear sleep "
664 "dependency affecting %s from %s\n", clkdm1->name, 652 "dependency affecting %s from %s\n", clkdm1->name,
665 clkdm2->name); 653 clkdm2->name);
666 return PTR_ERR(cd); 654 return ret;
667 } 655 }
668 656
669 /* XXX It's faster to return the atomic sleepdep_usecount */ 657 /* XXX It's faster to return the atomic sleepdep_usecount */
670 return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs, 658 return arch_clkdm->clkdm_read_sleepdep(clkdm1, clkdm2);
671 OMAP3430_CM_SLEEPDEP,
672 (1 << clkdm2->dep_bit));
673} 659}
674 660
675/** 661/**
@@ -684,35 +670,17 @@ int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
684 */ 670 */
685int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm) 671int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm)
686{ 672{
687 struct clkdm_dep *cd;
688 u32 mask = 0;
689
690 if (!cpu_is_omap34xx())
691 return -EINVAL;
692
693 if (!clkdm) 673 if (!clkdm)
694 return -EINVAL; 674 return -EINVAL;
695 675
696 for (cd = clkdm->sleepdep_srcs; cd && cd->clkdm_name; cd++) { 676 if (!arch_clkdm || !arch_clkdm->clkdm_clear_all_sleepdeps)
697 if (!omap_chip_is(cd->omap_chip)) 677 return -EINVAL;
698 continue;
699
700 if (!cd->clkdm && cd->clkdm_name)
701 cd->clkdm = _clkdm_lookup(cd->clkdm_name);
702
703 /* PRM accesses are slow, so minimize them */
704 mask |= 1 << cd->clkdm->dep_bit;
705 atomic_set(&cd->sleepdep_usecount, 0);
706 }
707
708 omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs,
709 OMAP3430_CM_SLEEPDEP);
710 678
711 return 0; 679 return arch_clkdm->clkdm_clear_all_sleepdeps(clkdm);
712} 680}
713 681
714/** 682/**
715 * omap2_clkdm_sleep - force clockdomain sleep transition 683 * clkdm_sleep - force clockdomain sleep transition
716 * @clkdm: struct clockdomain * 684 * @clkdm: struct clockdomain *
717 * 685 *
718 * Instruct the CM to force a sleep transition on the specified 686 * Instruct the CM to force a sleep transition on the specified
@@ -720,7 +688,7 @@ int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm)
720 * clockdomain does not support software-initiated sleep; 0 upon 688 * clockdomain does not support software-initiated sleep; 0 upon
721 * success. 689 * success.
722 */ 690 */
723int omap2_clkdm_sleep(struct clockdomain *clkdm) 691int clkdm_sleep(struct clockdomain *clkdm)
724{ 692{
725 if (!clkdm) 693 if (!clkdm)
726 return -EINVAL; 694 return -EINVAL;
@@ -731,33 +699,16 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm)
731 return -EINVAL; 699 return -EINVAL;
732 } 700 }
733 701
734 pr_debug("clockdomain: forcing sleep on %s\n", clkdm->name); 702 if (!arch_clkdm || !arch_clkdm->clkdm_sleep)
735 703 return -EINVAL;
736 if (cpu_is_omap24xx()) {
737
738 omap2_cm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
739 clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL);
740
741 } else if (cpu_is_omap34xx()) {
742
743 omap3xxx_cm_clkdm_force_sleep(clkdm->pwrdm.ptr->prcm_offs,
744 clkdm->clktrctrl_mask);
745
746 } else if (cpu_is_omap44xx()) {
747
748 omap4_cminst_clkdm_force_sleep(clkdm->prcm_partition,
749 clkdm->cm_inst,
750 clkdm->clkdm_offs);
751 704
752 } else { 705 pr_debug("clockdomain: forcing sleep on %s\n", clkdm->name);
753 BUG();
754 };
755 706
756 return 0; 707 return arch_clkdm->clkdm_sleep(clkdm);
757} 708}
758 709
759/** 710/**
760 * omap2_clkdm_wakeup - force clockdomain wakeup transition 711 * clkdm_wakeup - force clockdomain wakeup transition
761 * @clkdm: struct clockdomain * 712 * @clkdm: struct clockdomain *
762 * 713 *
763 * Instruct the CM to force a wakeup transition on the specified 714 * Instruct the CM to force a wakeup transition on the specified
@@ -765,7 +716,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm)
765 * clockdomain does not support software-controlled wakeup; 0 upon 716 * clockdomain does not support software-controlled wakeup; 0 upon
766 * success. 717 * success.
767 */ 718 */
768int omap2_clkdm_wakeup(struct clockdomain *clkdm) 719int clkdm_wakeup(struct clockdomain *clkdm)
769{ 720{
770 if (!clkdm) 721 if (!clkdm)
771 return -EINVAL; 722 return -EINVAL;
@@ -776,33 +727,16 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm)
776 return -EINVAL; 727 return -EINVAL;
777 } 728 }
778 729
779 pr_debug("clockdomain: forcing wakeup on %s\n", clkdm->name); 730 if (!arch_clkdm || !arch_clkdm->clkdm_wakeup)
780 731 return -EINVAL;
781 if (cpu_is_omap24xx()) {
782
783 omap2_cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
784 clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL);
785
786 } else if (cpu_is_omap34xx()) {
787
788 omap3xxx_cm_clkdm_force_wakeup(clkdm->pwrdm.ptr->prcm_offs,
789 clkdm->clktrctrl_mask);
790
791 } else if (cpu_is_omap44xx()) {
792
793 omap4_cminst_clkdm_force_wakeup(clkdm->prcm_partition,
794 clkdm->cm_inst,
795 clkdm->clkdm_offs);
796 732
797 } else { 733 pr_debug("clockdomain: forcing wakeup on %s\n", clkdm->name);
798 BUG();
799 };
800 734
801 return 0; 735 return arch_clkdm->clkdm_wakeup(clkdm);
802} 736}
803 737
804/** 738/**
805 * omap2_clkdm_allow_idle - enable hwsup idle transitions for clkdm 739 * clkdm_allow_idle - enable hwsup idle transitions for clkdm
806 * @clkdm: struct clockdomain * 740 * @clkdm: struct clockdomain *
807 * 741 *
808 * Allow the hardware to automatically switch the clockdomain @clkdm into 742 * Allow the hardware to automatically switch the clockdomain @clkdm into
@@ -811,7 +745,7 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm)
811 * framework, wkdep/sleepdep autodependencies are added; this is so 745 * framework, wkdep/sleepdep autodependencies are added; this is so
812 * device drivers can read and write to the device. No return value. 746 * device drivers can read and write to the device. No return value.
813 */ 747 */
814void omap2_clkdm_allow_idle(struct clockdomain *clkdm) 748void clkdm_allow_idle(struct clockdomain *clkdm)
815{ 749{
816 if (!clkdm) 750 if (!clkdm)
817 return; 751 return;
@@ -822,28 +756,18 @@ void omap2_clkdm_allow_idle(struct clockdomain *clkdm)
822 return; 756 return;
823 } 757 }
824 758
759 if (!arch_clkdm || !arch_clkdm->clkdm_allow_idle)
760 return;
761
825 pr_debug("clockdomain: enabling automatic idle transitions for %s\n", 762 pr_debug("clockdomain: enabling automatic idle transitions for %s\n",
826 clkdm->name); 763 clkdm->name);
827 764
828 /* 765 arch_clkdm->clkdm_allow_idle(clkdm);
829 * XXX This should be removed once TI adds wakeup/sleep
830 * dependency code and data for OMAP4.
831 */
832 if (cpu_is_omap44xx()) {
833 WARN_ONCE(1, "clockdomain: OMAP4 wakeup/sleep dependency "
834 "support is not yet implemented\n");
835 } else {
836 if (atomic_read(&clkdm->usecount) > 0)
837 _clkdm_add_autodeps(clkdm);
838 }
839
840 _enable_hwsup(clkdm);
841
842 pwrdm_clkdm_state_switch(clkdm); 766 pwrdm_clkdm_state_switch(clkdm);
843} 767}
844 768
845/** 769/**
846 * omap2_clkdm_deny_idle - disable hwsup idle transitions for clkdm 770 * clkdm_deny_idle - disable hwsup idle transitions for clkdm
847 * @clkdm: struct clockdomain * 771 * @clkdm: struct clockdomain *
848 * 772 *
849 * Prevent the hardware from automatically switching the clockdomain 773 * Prevent the hardware from automatically switching the clockdomain
@@ -851,7 +775,7 @@ void omap2_clkdm_allow_idle(struct clockdomain *clkdm)
851 * downstream clocks enabled in the clock framework, wkdep/sleepdep 775 * downstream clocks enabled in the clock framework, wkdep/sleepdep
852 * autodependencies are removed. No return value. 776 * autodependencies are removed. No return value.
853 */ 777 */
854void omap2_clkdm_deny_idle(struct clockdomain *clkdm) 778void clkdm_deny_idle(struct clockdomain *clkdm)
855{ 779{
856 if (!clkdm) 780 if (!clkdm)
857 return; 781 return;
@@ -862,29 +786,20 @@ void omap2_clkdm_deny_idle(struct clockdomain *clkdm)
862 return; 786 return;
863 } 787 }
864 788
789 if (!arch_clkdm || !arch_clkdm->clkdm_deny_idle)
790 return;
791
865 pr_debug("clockdomain: disabling automatic idle transitions for %s\n", 792 pr_debug("clockdomain: disabling automatic idle transitions for %s\n",
866 clkdm->name); 793 clkdm->name);
867 794
868 _disable_hwsup(clkdm); 795 arch_clkdm->clkdm_deny_idle(clkdm);
869
870 /*
871 * XXX This should be removed once TI adds wakeup/sleep
872 * dependency code and data for OMAP4.
873 */
874 if (cpu_is_omap44xx()) {
875 WARN_ONCE(1, "clockdomain: OMAP4 wakeup/sleep dependency "
876 "support is not yet implemented\n");
877 } else {
878 if (atomic_read(&clkdm->usecount) > 0)
879 _clkdm_del_autodeps(clkdm);
880 }
881} 796}
882 797
883 798
884/* Clockdomain-to-clock framework interface code */ 799/* Clockdomain-to-clock framework interface code */
885 800
886/** 801/**
887 * omap2_clkdm_clk_enable - add an enabled downstream clock to this clkdm 802 * clkdm_clk_enable - add an enabled downstream clock to this clkdm
888 * @clkdm: struct clockdomain * 803 * @clkdm: struct clockdomain *
889 * @clk: struct clk * of the enabled downstream clock 804 * @clk: struct clk * of the enabled downstream clock
890 * 805 *
@@ -897,10 +812,8 @@ void omap2_clkdm_deny_idle(struct clockdomain *clkdm)
897 * by on-chip processors. Returns -EINVAL if passed null pointers; 812 * by on-chip processors. Returns -EINVAL if passed null pointers;
898 * returns 0 upon success or if the clockdomain is in hwsup idle mode. 813 * returns 0 upon success or if the clockdomain is in hwsup idle mode.
899 */ 814 */
900int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) 815int clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
901{ 816{
902 bool hwsup = false;
903
904 /* 817 /*
905 * XXX Rewrite this code to maintain a list of enabled 818 * XXX Rewrite this code to maintain a list of enabled
906 * downstream clocks for debugging purposes? 819 * downstream clocks for debugging purposes?
@@ -909,6 +822,9 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
909 if (!clkdm || !clk) 822 if (!clkdm || !clk)
910 return -EINVAL; 823 return -EINVAL;
911 824
825 if (!arch_clkdm || !arch_clkdm->clkdm_clk_enable)
826 return -EINVAL;
827
912 if (atomic_inc_return(&clkdm->usecount) > 1) 828 if (atomic_inc_return(&clkdm->usecount) > 1)
913 return 0; 829 return 0;
914 830
@@ -917,31 +833,7 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
917 pr_debug("clockdomain: clkdm %s: clk %s now enabled\n", clkdm->name, 833 pr_debug("clockdomain: clkdm %s: clk %s now enabled\n", clkdm->name,
918 clk->name); 834 clk->name);
919 835
920 if (cpu_is_omap24xx() || cpu_is_omap34xx()) { 836 arch_clkdm->clkdm_clk_enable(clkdm);
921
922 if (!clkdm->clktrctrl_mask)
923 return 0;
924
925 hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
926 clkdm->clktrctrl_mask);
927
928 } else if (cpu_is_omap44xx()) {
929
930 hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition,
931 clkdm->cm_inst,
932 clkdm->clkdm_offs);
933
934 }
935
936 if (hwsup) {
937 /* Disable HW transitions when we are changing deps */
938 _disable_hwsup(clkdm);
939 _clkdm_add_autodeps(clkdm);
940 _enable_hwsup(clkdm);
941 } else {
942 omap2_clkdm_wakeup(clkdm);
943 }
944
945 pwrdm_wait_transition(clkdm->pwrdm.ptr); 837 pwrdm_wait_transition(clkdm->pwrdm.ptr);
946 pwrdm_clkdm_state_switch(clkdm); 838 pwrdm_clkdm_state_switch(clkdm);
947 839
@@ -949,7 +841,7 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
949} 841}
950 842
951/** 843/**
952 * omap2_clkdm_clk_disable - remove an enabled downstream clock from this clkdm 844 * clkdm_clk_disable - remove an enabled downstream clock from this clkdm
953 * @clkdm: struct clockdomain * 845 * @clkdm: struct clockdomain *
954 * @clk: struct clk * of the disabled downstream clock 846 * @clk: struct clk * of the disabled downstream clock
955 * 847 *
@@ -962,10 +854,8 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
962 * is enabled; or returns 0 upon success or if the clockdomain is in 854 * is enabled; or returns 0 upon success or if the clockdomain is in
963 * hwsup idle mode. 855 * hwsup idle mode.
964 */ 856 */
965int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk) 857int clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk)
966{ 858{
967 bool hwsup = false;
968
969 /* 859 /*
970 * XXX Rewrite this code to maintain a list of enabled 860 * XXX Rewrite this code to maintain a list of enabled
971 * downstream clocks for debugging purposes? 861 * downstream clocks for debugging purposes?
@@ -974,6 +864,9 @@ int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk)
974 if (!clkdm || !clk) 864 if (!clkdm || !clk)
975 return -EINVAL; 865 return -EINVAL;
976 866
867 if (!arch_clkdm || !arch_clkdm->clkdm_clk_disable)
868 return -EINVAL;
869
977#ifdef DEBUG 870#ifdef DEBUG
978 if (atomic_read(&clkdm->usecount) == 0) { 871 if (atomic_read(&clkdm->usecount) == 0) {
979 WARN_ON(1); /* underflow */ 872 WARN_ON(1); /* underflow */
@@ -989,31 +882,7 @@ int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk)
989 pr_debug("clockdomain: clkdm %s: clk %s now disabled\n", clkdm->name, 882 pr_debug("clockdomain: clkdm %s: clk %s now disabled\n", clkdm->name,
990 clk->name); 883 clk->name);
991 884
992 if (cpu_is_omap24xx() || cpu_is_omap34xx()) { 885 arch_clkdm->clkdm_clk_disable(clkdm);
993
994 if (!clkdm->clktrctrl_mask)
995 return 0;
996
997 hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
998 clkdm->clktrctrl_mask);
999
1000 } else if (cpu_is_omap44xx()) {
1001
1002 hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition,
1003 clkdm->cm_inst,
1004 clkdm->clkdm_offs);
1005
1006 }
1007
1008 if (hwsup) {
1009 /* Disable HW transitions when we are changing deps */
1010 _disable_hwsup(clkdm);
1011 _clkdm_del_autodeps(clkdm);
1012 _enable_hwsup(clkdm);
1013 } else {
1014 omap2_clkdm_sleep(clkdm);
1015 }
1016
1017 pwrdm_clkdm_state_switch(clkdm); 886 pwrdm_clkdm_state_switch(clkdm);
1018 887
1019 return 0; 888 return 0;
diff --git a/arch/arm/mach-omap2/clockdomain.h b/arch/arm/mach-omap2/clockdomain.h
index 9b459c26fb85..85b3dce65640 100644
--- a/arch/arm/mach-omap2/clockdomain.h
+++ b/arch/arm/mach-omap2/clockdomain.h
@@ -4,7 +4,7 @@
4 * OMAP2/3 clockdomain framework functions 4 * OMAP2/3 clockdomain framework functions
5 * 5 *
6 * Copyright (C) 2008 Texas Instruments, Inc. 6 * Copyright (C) 2008 Texas Instruments, Inc.
7 * Copyright (C) 2008-2010 Nokia Corporation 7 * Copyright (C) 2008-2011 Nokia Corporation
8 * 8 *
9 * Paul Walmsley 9 * Paul Walmsley
10 * 10 *
@@ -22,11 +22,19 @@
22#include <plat/clock.h> 22#include <plat/clock.h>
23#include <plat/cpu.h> 23#include <plat/cpu.h>
24 24
25/* Clockdomain capability flags */ 25/*
26 * Clockdomain flags
27 *
28 * XXX Document CLKDM_CAN_* flags
29 *
30 * CLKDM_NO_AUTODEPS: Prevent "autodeps" from being added/removed from this
31 * clockdomain. (Currently, this applies to OMAP3 clockdomains only.)
32 */
26#define CLKDM_CAN_FORCE_SLEEP (1 << 0) 33#define CLKDM_CAN_FORCE_SLEEP (1 << 0)
27#define CLKDM_CAN_FORCE_WAKEUP (1 << 1) 34#define CLKDM_CAN_FORCE_WAKEUP (1 << 1)
28#define CLKDM_CAN_ENABLE_AUTO (1 << 2) 35#define CLKDM_CAN_ENABLE_AUTO (1 << 2)
29#define CLKDM_CAN_DISABLE_AUTO (1 << 3) 36#define CLKDM_CAN_DISABLE_AUTO (1 << 3)
37#define CLKDM_NO_AUTODEPS (1 << 4)
30 38
31#define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO) 39#define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO)
32#define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP) 40#define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP)
@@ -116,7 +124,42 @@ struct clockdomain {
116 struct list_head node; 124 struct list_head node;
117}; 125};
118 126
119void clkdm_init(struct clockdomain **clkdms, struct clkdm_autodep *autodeps); 127/**
128 * struct clkdm_ops - Arch specfic function implementations
129 * @clkdm_add_wkdep: Add a wakeup dependency between clk domains
130 * @clkdm_del_wkdep: Delete a wakeup dependency between clk domains
131 * @clkdm_read_wkdep: Read wakeup dependency state between clk domains
132 * @clkdm_clear_all_wkdeps: Remove all wakeup dependencies from the clk domain
133 * @clkdm_add_sleepdep: Add a sleep dependency between clk domains
134 * @clkdm_del_sleepdep: Delete a sleep dependency between clk domains
135 * @clkdm_read_sleepdep: Read sleep dependency state between clk domains
136 * @clkdm_clear_all_sleepdeps: Remove all sleep dependencies from the clk domain
137 * @clkdm_sleep: Force a clockdomain to sleep
138 * @clkdm_wakeup: Force a clockdomain to wakeup
139 * @clkdm_allow_idle: Enable hw supervised idle transitions for clock domain
140 * @clkdm_deny_idle: Disable hw supervised idle transitions for clock domain
141 * @clkdm_clk_enable: Put the clkdm in right state for a clock enable
142 * @clkdm_clk_disable: Put the clkdm in right state for a clock disable
143 */
144struct clkdm_ops {
145 int (*clkdm_add_wkdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
146 int (*clkdm_del_wkdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
147 int (*clkdm_read_wkdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
148 int (*clkdm_clear_all_wkdeps)(struct clockdomain *clkdm);
149 int (*clkdm_add_sleepdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
150 int (*clkdm_del_sleepdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
151 int (*clkdm_read_sleepdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
152 int (*clkdm_clear_all_sleepdeps)(struct clockdomain *clkdm);
153 int (*clkdm_sleep)(struct clockdomain *clkdm);
154 int (*clkdm_wakeup)(struct clockdomain *clkdm);
155 void (*clkdm_allow_idle)(struct clockdomain *clkdm);
156 void (*clkdm_deny_idle)(struct clockdomain *clkdm);
157 int (*clkdm_clk_enable)(struct clockdomain *clkdm);
158 int (*clkdm_clk_disable)(struct clockdomain *clkdm);
159};
160
161void clkdm_init(struct clockdomain **clkdms, struct clkdm_autodep *autodeps,
162 struct clkdm_ops *custom_funcs);
120struct clockdomain *clkdm_lookup(const char *name); 163struct clockdomain *clkdm_lookup(const char *name);
121 164
122int clkdm_for_each(int (*fn)(struct clockdomain *clkdm, void *user), 165int clkdm_for_each(int (*fn)(struct clockdomain *clkdm, void *user),
@@ -132,16 +175,23 @@ int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
132int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2); 175int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
133int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm); 176int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm);
134 177
135void omap2_clkdm_allow_idle(struct clockdomain *clkdm); 178void clkdm_allow_idle(struct clockdomain *clkdm);
136void omap2_clkdm_deny_idle(struct clockdomain *clkdm); 179void clkdm_deny_idle(struct clockdomain *clkdm);
137 180
138int omap2_clkdm_wakeup(struct clockdomain *clkdm); 181int clkdm_wakeup(struct clockdomain *clkdm);
139int omap2_clkdm_sleep(struct clockdomain *clkdm); 182int clkdm_sleep(struct clockdomain *clkdm);
140 183
141int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk); 184int clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk);
142int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk); 185int clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk);
143 186
144extern void __init omap2_clockdomains_init(void); 187extern void __init omap2xxx_clockdomains_init(void);
188extern void __init omap3xxx_clockdomains_init(void);
145extern void __init omap44xx_clockdomains_init(void); 189extern void __init omap44xx_clockdomains_init(void);
190extern void _clkdm_add_autodeps(struct clockdomain *clkdm);
191extern void _clkdm_del_autodeps(struct clockdomain *clkdm);
192
193extern struct clkdm_ops omap2_clkdm_operations;
194extern struct clkdm_ops omap3_clkdm_operations;
195extern struct clkdm_ops omap4_clkdm_operations;
146 196
147#endif 197#endif
diff --git a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
new file mode 100644
index 000000000000..48d0db7e6069
--- /dev/null
+++ b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
@@ -0,0 +1,274 @@
1/*
2 * OMAP2 and OMAP3 clockdomain control
3 *
4 * Copyright (C) 2008-2010 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation
6 *
7 * Derived from mach-omap2/clockdomain.c written by Paul Walmsley
8 * Rajendra Nayak <rnayak@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/types.h>
16#include <plat/prcm.h>
17#include "prm.h"
18#include "prm2xxx_3xxx.h"
19#include "cm.h"
20#include "cm2xxx_3xxx.h"
21#include "cm-regbits-24xx.h"
22#include "cm-regbits-34xx.h"
23#include "prm-regbits-24xx.h"
24#include "clockdomain.h"
25
26static int omap2_clkdm_add_wkdep(struct clockdomain *clkdm1,
27 struct clockdomain *clkdm2)
28{
29 omap2_prm_set_mod_reg_bits((1 << clkdm2->dep_bit),
30 clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP);
31 return 0;
32}
33
34static int omap2_clkdm_del_wkdep(struct clockdomain *clkdm1,
35 struct clockdomain *clkdm2)
36{
37 omap2_prm_clear_mod_reg_bits((1 << clkdm2->dep_bit),
38 clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP);
39 return 0;
40}
41
42static int omap2_clkdm_read_wkdep(struct clockdomain *clkdm1,
43 struct clockdomain *clkdm2)
44{
45 return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs,
46 PM_WKDEP, (1 << clkdm2->dep_bit));
47}
48
49static int omap2_clkdm_clear_all_wkdeps(struct clockdomain *clkdm)
50{
51 struct clkdm_dep *cd;
52 u32 mask = 0;
53
54 for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) {
55 if (!omap_chip_is(cd->omap_chip))
56 continue;
57 if (!cd->clkdm)
58 continue; /* only happens if data is erroneous */
59
60 /* PRM accesses are slow, so minimize them */
61 mask |= 1 << cd->clkdm->dep_bit;
62 atomic_set(&cd->wkdep_usecount, 0);
63 }
64
65 omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs,
66 PM_WKDEP);
67 return 0;
68}
69
70static int omap3_clkdm_add_sleepdep(struct clockdomain *clkdm1,
71 struct clockdomain *clkdm2)
72{
73 omap2_cm_set_mod_reg_bits((1 << clkdm2->dep_bit),
74 clkdm1->pwrdm.ptr->prcm_offs,
75 OMAP3430_CM_SLEEPDEP);
76 return 0;
77}
78
79static int omap3_clkdm_del_sleepdep(struct clockdomain *clkdm1,
80 struct clockdomain *clkdm2)
81{
82 omap2_cm_clear_mod_reg_bits((1 << clkdm2->dep_bit),
83 clkdm1->pwrdm.ptr->prcm_offs,
84 OMAP3430_CM_SLEEPDEP);
85 return 0;
86}
87
88static int omap3_clkdm_read_sleepdep(struct clockdomain *clkdm1,
89 struct clockdomain *clkdm2)
90{
91 return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs,
92 OMAP3430_CM_SLEEPDEP, (1 << clkdm2->dep_bit));
93}
94
95static int omap3_clkdm_clear_all_sleepdeps(struct clockdomain *clkdm)
96{
97 struct clkdm_dep *cd;
98 u32 mask = 0;
99
100 for (cd = clkdm->sleepdep_srcs; cd && cd->clkdm_name; cd++) {
101 if (!omap_chip_is(cd->omap_chip))
102 continue;
103 if (!cd->clkdm)
104 continue; /* only happens if data is erroneous */
105
106 /* PRM accesses are slow, so minimize them */
107 mask |= 1 << cd->clkdm->dep_bit;
108 atomic_set(&cd->sleepdep_usecount, 0);
109 }
110 omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs,
111 OMAP3430_CM_SLEEPDEP);
112 return 0;
113}
114
115static int omap2_clkdm_sleep(struct clockdomain *clkdm)
116{
117 omap2_cm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
118 clkdm->pwrdm.ptr->prcm_offs,
119 OMAP2_PM_PWSTCTRL);
120 return 0;
121}
122
123static int omap2_clkdm_wakeup(struct clockdomain *clkdm)
124{
125 omap2_cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
126 clkdm->pwrdm.ptr->prcm_offs,
127 OMAP2_PM_PWSTCTRL);
128 return 0;
129}
130
131static void omap2_clkdm_allow_idle(struct clockdomain *clkdm)
132{
133 if (atomic_read(&clkdm->usecount) > 0)
134 _clkdm_add_autodeps(clkdm);
135
136 omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
137 clkdm->clktrctrl_mask);
138}
139
140static void omap2_clkdm_deny_idle(struct clockdomain *clkdm)
141{
142 omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
143 clkdm->clktrctrl_mask);
144
145 if (atomic_read(&clkdm->usecount) > 0)
146 _clkdm_del_autodeps(clkdm);
147}
148
149static void _enable_hwsup(struct clockdomain *clkdm)
150{
151 if (cpu_is_omap24xx())
152 omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
153 clkdm->clktrctrl_mask);
154 else if (cpu_is_omap34xx())
155 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
156 clkdm->clktrctrl_mask);
157}
158
159static void _disable_hwsup(struct clockdomain *clkdm)
160{
161 if (cpu_is_omap24xx())
162 omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
163 clkdm->clktrctrl_mask);
164 else if (cpu_is_omap34xx())
165 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
166 clkdm->clktrctrl_mask);
167}
168
169
170static int omap2_clkdm_clk_enable(struct clockdomain *clkdm)
171{
172 bool hwsup = false;
173
174 if (!clkdm->clktrctrl_mask)
175 return 0;
176
177 hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
178 clkdm->clktrctrl_mask);
179
180 if (hwsup) {
181 /* Disable HW transitions when we are changing deps */
182 _disable_hwsup(clkdm);
183 _clkdm_add_autodeps(clkdm);
184 _enable_hwsup(clkdm);
185 } else {
186 clkdm_wakeup(clkdm);
187 }
188
189 return 0;
190}
191
192static int omap2_clkdm_clk_disable(struct clockdomain *clkdm)
193{
194 bool hwsup = false;
195
196 if (!clkdm->clktrctrl_mask)
197 return 0;
198
199 hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
200 clkdm->clktrctrl_mask);
201
202 if (hwsup) {
203 /* Disable HW transitions when we are changing deps */
204 _disable_hwsup(clkdm);
205 _clkdm_del_autodeps(clkdm);
206 _enable_hwsup(clkdm);
207 } else {
208 clkdm_sleep(clkdm);
209 }
210
211 return 0;
212}
213
214static int omap3_clkdm_sleep(struct clockdomain *clkdm)
215{
216 omap3xxx_cm_clkdm_force_sleep(clkdm->pwrdm.ptr->prcm_offs,
217 clkdm->clktrctrl_mask);
218 return 0;
219}
220
221static int omap3_clkdm_wakeup(struct clockdomain *clkdm)
222{
223 omap3xxx_cm_clkdm_force_wakeup(clkdm->pwrdm.ptr->prcm_offs,
224 clkdm->clktrctrl_mask);
225 return 0;
226}
227
228static void omap3_clkdm_allow_idle(struct clockdomain *clkdm)
229{
230 if (atomic_read(&clkdm->usecount) > 0)
231 _clkdm_add_autodeps(clkdm);
232
233 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
234 clkdm->clktrctrl_mask);
235}
236
237static void omap3_clkdm_deny_idle(struct clockdomain *clkdm)
238{
239 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
240 clkdm->clktrctrl_mask);
241
242 if (atomic_read(&clkdm->usecount) > 0)
243 _clkdm_del_autodeps(clkdm);
244}
245
246struct clkdm_ops omap2_clkdm_operations = {
247 .clkdm_add_wkdep = omap2_clkdm_add_wkdep,
248 .clkdm_del_wkdep = omap2_clkdm_del_wkdep,
249 .clkdm_read_wkdep = omap2_clkdm_read_wkdep,
250 .clkdm_clear_all_wkdeps = omap2_clkdm_clear_all_wkdeps,
251 .clkdm_sleep = omap2_clkdm_sleep,
252 .clkdm_wakeup = omap2_clkdm_wakeup,
253 .clkdm_allow_idle = omap2_clkdm_allow_idle,
254 .clkdm_deny_idle = omap2_clkdm_deny_idle,
255 .clkdm_clk_enable = omap2_clkdm_clk_enable,
256 .clkdm_clk_disable = omap2_clkdm_clk_disable,
257};
258
259struct clkdm_ops omap3_clkdm_operations = {
260 .clkdm_add_wkdep = omap2_clkdm_add_wkdep,
261 .clkdm_del_wkdep = omap2_clkdm_del_wkdep,
262 .clkdm_read_wkdep = omap2_clkdm_read_wkdep,
263 .clkdm_clear_all_wkdeps = omap2_clkdm_clear_all_wkdeps,
264 .clkdm_add_sleepdep = omap3_clkdm_add_sleepdep,
265 .clkdm_del_sleepdep = omap3_clkdm_del_sleepdep,
266 .clkdm_read_sleepdep = omap3_clkdm_read_sleepdep,
267 .clkdm_clear_all_sleepdeps = omap3_clkdm_clear_all_sleepdeps,
268 .clkdm_sleep = omap3_clkdm_sleep,
269 .clkdm_wakeup = omap3_clkdm_wakeup,
270 .clkdm_allow_idle = omap3_clkdm_allow_idle,
271 .clkdm_deny_idle = omap3_clkdm_deny_idle,
272 .clkdm_clk_enable = omap2_clkdm_clk_enable,
273 .clkdm_clk_disable = omap2_clkdm_clk_disable,
274};
diff --git a/arch/arm/mach-omap2/clockdomain44xx.c b/arch/arm/mach-omap2/clockdomain44xx.c
new file mode 100644
index 000000000000..a1a4ecd26544
--- /dev/null
+++ b/arch/arm/mach-omap2/clockdomain44xx.c
@@ -0,0 +1,137 @@
1/*
2 * OMAP4 clockdomain control
3 *
4 * Copyright (C) 2008-2010 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation
6 *
7 * Derived from mach-omap2/clockdomain.c written by Paul Walmsley
8 * Rajendra Nayak <rnayak@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/kernel.h>
16#include "clockdomain.h"
17#include "cminst44xx.h"
18#include "cm44xx.h"
19
20static int omap4_clkdm_add_wkup_sleep_dep(struct clockdomain *clkdm1,
21 struct clockdomain *clkdm2)
22{
23 omap4_cminst_set_inst_reg_bits((1 << clkdm2->dep_bit),
24 clkdm1->prcm_partition,
25 clkdm1->cm_inst, clkdm1->clkdm_offs +
26 OMAP4_CM_STATICDEP);
27 return 0;
28}
29
30static int omap4_clkdm_del_wkup_sleep_dep(struct clockdomain *clkdm1,
31 struct clockdomain *clkdm2)
32{
33 omap4_cminst_clear_inst_reg_bits((1 << clkdm2->dep_bit),
34 clkdm1->prcm_partition,
35 clkdm1->cm_inst, clkdm1->clkdm_offs +
36 OMAP4_CM_STATICDEP);
37 return 0;
38}
39
40static int omap4_clkdm_read_wkup_sleep_dep(struct clockdomain *clkdm1,
41 struct clockdomain *clkdm2)
42{
43 return omap4_cminst_read_inst_reg_bits(clkdm1->prcm_partition,
44 clkdm1->cm_inst, clkdm1->clkdm_offs +
45 OMAP4_CM_STATICDEP,
46 (1 << clkdm2->dep_bit));
47}
48
49static int omap4_clkdm_clear_all_wkup_sleep_deps(struct clockdomain *clkdm)
50{
51 struct clkdm_dep *cd;
52 u32 mask = 0;
53
54 for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) {
55 if (!omap_chip_is(cd->omap_chip))
56 continue;
57 if (!cd->clkdm)
58 continue; /* only happens if data is erroneous */
59
60 mask |= 1 << cd->clkdm->dep_bit;
61 atomic_set(&cd->wkdep_usecount, 0);
62 }
63
64 omap4_cminst_clear_inst_reg_bits(mask, clkdm->prcm_partition,
65 clkdm->cm_inst, clkdm->clkdm_offs +
66 OMAP4_CM_STATICDEP);
67 return 0;
68}
69
70static int omap4_clkdm_sleep(struct clockdomain *clkdm)
71{
72 omap4_cminst_clkdm_force_sleep(clkdm->prcm_partition,
73 clkdm->cm_inst, clkdm->clkdm_offs);
74 return 0;
75}
76
77static int omap4_clkdm_wakeup(struct clockdomain *clkdm)
78{
79 omap4_cminst_clkdm_force_wakeup(clkdm->prcm_partition,
80 clkdm->cm_inst, clkdm->clkdm_offs);
81 return 0;
82}
83
84static void omap4_clkdm_allow_idle(struct clockdomain *clkdm)
85{
86 omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition,
87 clkdm->cm_inst, clkdm->clkdm_offs);
88}
89
90static void omap4_clkdm_deny_idle(struct clockdomain *clkdm)
91{
92 omap4_cminst_clkdm_disable_hwsup(clkdm->prcm_partition,
93 clkdm->cm_inst, clkdm->clkdm_offs);
94}
95
96static int omap4_clkdm_clk_enable(struct clockdomain *clkdm)
97{
98 bool hwsup = false;
99
100 hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition,
101 clkdm->cm_inst, clkdm->clkdm_offs);
102
103 if (!hwsup)
104 clkdm_wakeup(clkdm);
105
106 return 0;
107}
108
109static int omap4_clkdm_clk_disable(struct clockdomain *clkdm)
110{
111 bool hwsup = false;
112
113 hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition,
114 clkdm->cm_inst, clkdm->clkdm_offs);
115
116 if (!hwsup)
117 clkdm_sleep(clkdm);
118
119 return 0;
120}
121
122struct clkdm_ops omap4_clkdm_operations = {
123 .clkdm_add_wkdep = omap4_clkdm_add_wkup_sleep_dep,
124 .clkdm_del_wkdep = omap4_clkdm_del_wkup_sleep_dep,
125 .clkdm_read_wkdep = omap4_clkdm_read_wkup_sleep_dep,
126 .clkdm_clear_all_wkdeps = omap4_clkdm_clear_all_wkup_sleep_deps,
127 .clkdm_add_sleepdep = omap4_clkdm_add_wkup_sleep_dep,
128 .clkdm_del_sleepdep = omap4_clkdm_del_wkup_sleep_dep,
129 .clkdm_read_sleepdep = omap4_clkdm_read_wkup_sleep_dep,
130 .clkdm_clear_all_sleepdeps = omap4_clkdm_clear_all_wkup_sleep_deps,
131 .clkdm_sleep = omap4_clkdm_sleep,
132 .clkdm_wakeup = omap4_clkdm_wakeup,
133 .clkdm_allow_idle = omap4_clkdm_allow_idle,
134 .clkdm_deny_idle = omap4_clkdm_deny_idle,
135 .clkdm_clk_enable = omap4_clkdm_clk_enable,
136 .clkdm_clk_disable = omap4_clkdm_clk_disable,
137};
diff --git a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
index e4a7133ea3b3..13bde95b6790 100644
--- a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
+++ b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
@@ -89,6 +89,8 @@ static struct clkdm_dep gfx_sgx_wkdeps[] = {
89 89
90/* 24XX-specific possible dependencies */ 90/* 24XX-specific possible dependencies */
91 91
92#ifdef CONFIG_ARCH_OMAP2
93
92/* Wakeup dependency source arrays */ 94/* Wakeup dependency source arrays */
93 95
94/* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */ 96/* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */
@@ -168,10 +170,11 @@ static struct clkdm_dep core_24xx_wkdeps[] = {
168 { NULL }, 170 { NULL },
169}; 171};
170 172
173#endif /* CONFIG_ARCH_OMAP2 */
171 174
172/* 2430-specific possible wakeup dependencies */ 175/* 2430-specific possible wakeup dependencies */
173 176
174#ifdef CONFIG_ARCH_OMAP2430 177#ifdef CONFIG_SOC_OMAP2430
175 178
176/* 2430 PM_WKDEP_MDM: CORE, MPU, WKUP */ 179/* 2430 PM_WKDEP_MDM: CORE, MPU, WKUP */
177static struct clkdm_dep mdm_2430_wkdeps[] = { 180static struct clkdm_dep mdm_2430_wkdeps[] = {
@@ -194,7 +197,7 @@ static struct clkdm_dep mdm_2430_wkdeps[] = {
194 { NULL }, 197 { NULL },
195}; 198};
196 199
197#endif /* CONFIG_ARCH_OMAP2430 */ 200#endif /* CONFIG_SOC_OMAP2430 */
198 201
199 202
200/* OMAP3-specific possible dependencies */ 203/* OMAP3-specific possible dependencies */
@@ -450,7 +453,7 @@ static struct clockdomain cm_clkdm = {
450 * 2420-only clockdomains 453 * 2420-only clockdomains
451 */ 454 */
452 455
453#if defined(CONFIG_ARCH_OMAP2420) 456#if defined(CONFIG_SOC_OMAP2420)
454 457
455static struct clockdomain mpu_2420_clkdm = { 458static struct clockdomain mpu_2420_clkdm = {
456 .name = "mpu_clkdm", 459 .name = "mpu_clkdm",
@@ -514,14 +517,14 @@ static struct clockdomain dss_2420_clkdm = {
514 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 517 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
515}; 518};
516 519
517#endif /* CONFIG_ARCH_OMAP2420 */ 520#endif /* CONFIG_SOC_OMAP2420 */
518 521
519 522
520/* 523/*
521 * 2430-only clockdomains 524 * 2430-only clockdomains
522 */ 525 */
523 526
524#if defined(CONFIG_ARCH_OMAP2430) 527#if defined(CONFIG_SOC_OMAP2430)
525 528
526static struct clockdomain mpu_2430_clkdm = { 529static struct clockdomain mpu_2430_clkdm = {
527 .name = "mpu_clkdm", 530 .name = "mpu_clkdm",
@@ -600,7 +603,7 @@ static struct clockdomain dss_2430_clkdm = {
600 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 603 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
601}; 604};
602 605
603#endif /* CONFIG_ARCH_OMAP2430 */ 606#endif /* CONFIG_SOC_OMAP2430 */
604 607
605 608
606/* 609/*
@@ -811,7 +814,7 @@ static struct clockdomain *clockdomains_omap2[] __initdata = {
811 &cm_clkdm, 814 &cm_clkdm,
812 &prm_clkdm, 815 &prm_clkdm,
813 816
814#ifdef CONFIG_ARCH_OMAP2420 817#ifdef CONFIG_SOC_OMAP2420
815 &mpu_2420_clkdm, 818 &mpu_2420_clkdm,
816 &iva1_2420_clkdm, 819 &iva1_2420_clkdm,
817 &dsp_2420_clkdm, 820 &dsp_2420_clkdm,
@@ -821,7 +824,7 @@ static struct clockdomain *clockdomains_omap2[] __initdata = {
821 &dss_2420_clkdm, 824 &dss_2420_clkdm,
822#endif 825#endif
823 826
824#ifdef CONFIG_ARCH_OMAP2430 827#ifdef CONFIG_SOC_OMAP2430
825 &mpu_2430_clkdm, 828 &mpu_2430_clkdm,
826 &mdm_clkdm, 829 &mdm_clkdm,
827 &dsp_2430_clkdm, 830 &dsp_2430_clkdm,
@@ -854,7 +857,12 @@ static struct clockdomain *clockdomains_omap2[] __initdata = {
854 NULL, 857 NULL,
855}; 858};
856 859
857void __init omap2_clockdomains_init(void) 860void __init omap2xxx_clockdomains_init(void)
861{
862 clkdm_init(clockdomains_omap2, clkdm_autodeps, &omap2_clkdm_operations);
863}
864
865void __init omap3xxx_clockdomains_init(void)
858{ 866{
859 clkdm_init(clockdomains_omap2, clkdm_autodeps); 867 clkdm_init(clockdomains_omap2, clkdm_autodeps, &omap3_clkdm_operations);
860} 868}
diff --git a/arch/arm/mach-omap2/clockdomains44xx_data.c b/arch/arm/mach-omap2/clockdomains44xx_data.c
index 51920fc7fc52..a607ec196e8b 100644
--- a/arch/arm/mach-omap2/clockdomains44xx_data.c
+++ b/arch/arm/mach-omap2/clockdomains44xx_data.c
@@ -18,11 +18,6 @@
18 * published by the Free Software Foundation. 18 * published by the Free Software Foundation.
19 */ 19 */
20 20
21/*
22 * To-Do List
23 * -> Populate the Sleep/Wakeup dependencies for the domains
24 */
25
26#include <linux/kernel.h> 21#include <linux/kernel.h>
27#include <linux/io.h> 22#include <linux/io.h>
28 23
@@ -30,13 +25,360 @@
30#include "cm1_44xx.h" 25#include "cm1_44xx.h"
31#include "cm2_44xx.h" 26#include "cm2_44xx.h"
32 27
33#include "cm1_44xx.h"
34#include "cm2_44xx.h"
35#include "cm-regbits-44xx.h" 28#include "cm-regbits-44xx.h"
36#include "prm44xx.h" 29#include "prm44xx.h"
37#include "prcm44xx.h" 30#include "prcm44xx.h"
38#include "prcm_mpu44xx.h" 31#include "prcm_mpu44xx.h"
39 32
33/* Static Dependencies for OMAP4 Clock Domains */
34
35static struct clkdm_dep ducati_wkup_sleep_deps[] = {
36 {
37 .clkdm_name = "abe_clkdm",
38 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
39 },
40 {
41 .clkdm_name = "ivahd_clkdm",
42 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
43 },
44 {
45 .clkdm_name = "l3_1_clkdm",
46 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
47 },
48 {
49 .clkdm_name = "l3_2_clkdm",
50 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
51 },
52 {
53 .clkdm_name = "l3_dss_clkdm",
54 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
55 },
56 {
57 .clkdm_name = "l3_emif_clkdm",
58 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
59 },
60 {
61 .clkdm_name = "l3_gfx_clkdm",
62 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
63 },
64 {
65 .clkdm_name = "l3_init_clkdm",
66 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
67 },
68 {
69 .clkdm_name = "l4_cfg_clkdm",
70 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
71 },
72 {
73 .clkdm_name = "l4_per_clkdm",
74 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
75 },
76 {
77 .clkdm_name = "l4_secure_clkdm",
78 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
79 },
80 {
81 .clkdm_name = "l4_wkup_clkdm",
82 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
83 },
84 {
85 .clkdm_name = "tesla_clkdm",
86 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
87 },
88 { NULL },
89};
90
91static struct clkdm_dep iss_wkup_sleep_deps[] = {
92 {
93 .clkdm_name = "ivahd_clkdm",
94 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
95 },
96 {
97 .clkdm_name = "l3_1_clkdm",
98 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
99 },
100 {
101 .clkdm_name = "l3_emif_clkdm",
102 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
103 },
104 { NULL },
105};
106
107static struct clkdm_dep ivahd_wkup_sleep_deps[] = {
108 {
109 .clkdm_name = "l3_1_clkdm",
110 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
111 },
112 {
113 .clkdm_name = "l3_emif_clkdm",
114 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
115 },
116 { NULL },
117};
118
119static struct clkdm_dep l3_d2d_wkup_sleep_deps[] = {
120 {
121 .clkdm_name = "abe_clkdm",
122 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
123 },
124 {
125 .clkdm_name = "ivahd_clkdm",
126 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
127 },
128 {
129 .clkdm_name = "l3_1_clkdm",
130 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
131 },
132 {
133 .clkdm_name = "l3_2_clkdm",
134 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
135 },
136 {
137 .clkdm_name = "l3_emif_clkdm",
138 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
139 },
140 {
141 .clkdm_name = "l3_init_clkdm",
142 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
143 },
144 {
145 .clkdm_name = "l4_cfg_clkdm",
146 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
147 },
148 {
149 .clkdm_name = "l4_per_clkdm",
150 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
151 },
152 { NULL },
153};
154
155static struct clkdm_dep l3_dma_wkup_sleep_deps[] = {
156 {
157 .clkdm_name = "abe_clkdm",
158 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
159 },
160 {
161 .clkdm_name = "ducati_clkdm",
162 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
163 },
164 {
165 .clkdm_name = "ivahd_clkdm",
166 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
167 },
168 {
169 .clkdm_name = "l3_1_clkdm",
170 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
171 },
172 {
173 .clkdm_name = "l3_dss_clkdm",
174 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
175 },
176 {
177 .clkdm_name = "l3_emif_clkdm",
178 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
179 },
180 {
181 .clkdm_name = "l3_init_clkdm",
182 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
183 },
184 {
185 .clkdm_name = "l4_cfg_clkdm",
186 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
187 },
188 {
189 .clkdm_name = "l4_per_clkdm",
190 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
191 },
192 {
193 .clkdm_name = "l4_secure_clkdm",
194 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
195 },
196 {
197 .clkdm_name = "l4_wkup_clkdm",
198 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
199 },
200 { NULL },
201};
202
203static struct clkdm_dep l3_dss_wkup_sleep_deps[] = {
204 {
205 .clkdm_name = "ivahd_clkdm",
206 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
207 },
208 {
209 .clkdm_name = "l3_2_clkdm",
210 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
211 },
212 {
213 .clkdm_name = "l3_emif_clkdm",
214 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
215 },
216 { NULL },
217};
218
219static struct clkdm_dep l3_gfx_wkup_sleep_deps[] = {
220 {
221 .clkdm_name = "ivahd_clkdm",
222 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
223 },
224 {
225 .clkdm_name = "l3_1_clkdm",
226 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
227 },
228 {
229 .clkdm_name = "l3_emif_clkdm",
230 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
231 },
232 { NULL },
233};
234
235static struct clkdm_dep l3_init_wkup_sleep_deps[] = {
236 {
237 .clkdm_name = "abe_clkdm",
238 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
239 },
240 {
241 .clkdm_name = "ivahd_clkdm",
242 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
243 },
244 {
245 .clkdm_name = "l3_emif_clkdm",
246 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
247 },
248 {
249 .clkdm_name = "l4_cfg_clkdm",
250 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
251 },
252 {
253 .clkdm_name = "l4_per_clkdm",
254 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
255 },
256 {
257 .clkdm_name = "l4_secure_clkdm",
258 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
259 },
260 {
261 .clkdm_name = "l4_wkup_clkdm",
262 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
263 },
264 { NULL },
265};
266
267static struct clkdm_dep l4_secure_wkup_sleep_deps[] = {
268 {
269 .clkdm_name = "l3_1_clkdm",
270 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
271 },
272 {
273 .clkdm_name = "l3_emif_clkdm",
274 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
275 },
276 {
277 .clkdm_name = "l4_per_clkdm",
278 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
279 },
280 { NULL },
281};
282
283static struct clkdm_dep mpuss_wkup_sleep_deps[] = {
284 {
285 .clkdm_name = "abe_clkdm",
286 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
287 },
288 {
289 .clkdm_name = "ducati_clkdm",
290 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
291 },
292 {
293 .clkdm_name = "ivahd_clkdm",
294 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
295 },
296 {
297 .clkdm_name = "l3_1_clkdm",
298 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
299 },
300 {
301 .clkdm_name = "l3_2_clkdm",
302 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
303 },
304 {
305 .clkdm_name = "l3_dss_clkdm",
306 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
307 },
308 {
309 .clkdm_name = "l3_emif_clkdm",
310 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
311 },
312 {
313 .clkdm_name = "l3_gfx_clkdm",
314 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
315 },
316 {
317 .clkdm_name = "l3_init_clkdm",
318 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
319 },
320 {
321 .clkdm_name = "l4_cfg_clkdm",
322 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
323 },
324 {
325 .clkdm_name = "l4_per_clkdm",
326 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
327 },
328 {
329 .clkdm_name = "l4_secure_clkdm",
330 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
331 },
332 {
333 .clkdm_name = "l4_wkup_clkdm",
334 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
335 },
336 {
337 .clkdm_name = "tesla_clkdm",
338 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
339 },
340 { NULL },
341};
342
343static struct clkdm_dep tesla_wkup_sleep_deps[] = {
344 {
345 .clkdm_name = "abe_clkdm",
346 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
347 },
348 {
349 .clkdm_name = "ivahd_clkdm",
350 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
351 },
352 {
353 .clkdm_name = "l3_1_clkdm",
354 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
355 },
356 {
357 .clkdm_name = "l3_2_clkdm",
358 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
359 },
360 {
361 .clkdm_name = "l3_emif_clkdm",
362 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
363 },
364 {
365 .clkdm_name = "l3_init_clkdm",
366 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
367 },
368 {
369 .clkdm_name = "l4_cfg_clkdm",
370 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
371 },
372 {
373 .clkdm_name = "l4_per_clkdm",
374 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
375 },
376 {
377 .clkdm_name = "l4_wkup_clkdm",
378 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
379 },
380 { NULL },
381};
40 382
41static struct clockdomain l4_cefuse_44xx_clkdm = { 383static struct clockdomain l4_cefuse_44xx_clkdm = {
42 .name = "l4_cefuse_clkdm", 384 .name = "l4_cefuse_clkdm",
@@ -54,6 +396,7 @@ static struct clockdomain l4_cfg_44xx_clkdm = {
54 .prcm_partition = OMAP4430_CM2_PARTITION, 396 .prcm_partition = OMAP4430_CM2_PARTITION,
55 .cm_inst = OMAP4430_CM2_CORE_INST, 397 .cm_inst = OMAP4430_CM2_CORE_INST,
56 .clkdm_offs = OMAP4430_CM2_CORE_L4CFG_CDOFFS, 398 .clkdm_offs = OMAP4430_CM2_CORE_L4CFG_CDOFFS,
399 .dep_bit = OMAP4430_L4CFG_STATDEP_SHIFT,
57 .flags = CLKDM_CAN_HWSUP, 400 .flags = CLKDM_CAN_HWSUP,
58 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 401 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
59}; 402};
@@ -64,6 +407,9 @@ static struct clockdomain tesla_44xx_clkdm = {
64 .prcm_partition = OMAP4430_CM1_PARTITION, 407 .prcm_partition = OMAP4430_CM1_PARTITION,
65 .cm_inst = OMAP4430_CM1_TESLA_INST, 408 .cm_inst = OMAP4430_CM1_TESLA_INST,
66 .clkdm_offs = OMAP4430_CM1_TESLA_TESLA_CDOFFS, 409 .clkdm_offs = OMAP4430_CM1_TESLA_TESLA_CDOFFS,
410 .dep_bit = OMAP4430_TESLA_STATDEP_SHIFT,
411 .wkdep_srcs = tesla_wkup_sleep_deps,
412 .sleepdep_srcs = tesla_wkup_sleep_deps,
67 .flags = CLKDM_CAN_HWSUP_SWSUP, 413 .flags = CLKDM_CAN_HWSUP_SWSUP,
68 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 414 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
69}; 415};
@@ -74,6 +420,9 @@ static struct clockdomain l3_gfx_44xx_clkdm = {
74 .prcm_partition = OMAP4430_CM2_PARTITION, 420 .prcm_partition = OMAP4430_CM2_PARTITION,
75 .cm_inst = OMAP4430_CM2_GFX_INST, 421 .cm_inst = OMAP4430_CM2_GFX_INST,
76 .clkdm_offs = OMAP4430_CM2_GFX_GFX_CDOFFS, 422 .clkdm_offs = OMAP4430_CM2_GFX_GFX_CDOFFS,
423 .dep_bit = OMAP4430_GFX_STATDEP_SHIFT,
424 .wkdep_srcs = l3_gfx_wkup_sleep_deps,
425 .sleepdep_srcs = l3_gfx_wkup_sleep_deps,
77 .flags = CLKDM_CAN_HWSUP_SWSUP, 426 .flags = CLKDM_CAN_HWSUP_SWSUP,
78 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 427 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
79}; 428};
@@ -84,6 +433,9 @@ static struct clockdomain ivahd_44xx_clkdm = {
84 .prcm_partition = OMAP4430_CM2_PARTITION, 433 .prcm_partition = OMAP4430_CM2_PARTITION,
85 .cm_inst = OMAP4430_CM2_IVAHD_INST, 434 .cm_inst = OMAP4430_CM2_IVAHD_INST,
86 .clkdm_offs = OMAP4430_CM2_IVAHD_IVAHD_CDOFFS, 435 .clkdm_offs = OMAP4430_CM2_IVAHD_IVAHD_CDOFFS,
436 .dep_bit = OMAP4430_IVAHD_STATDEP_SHIFT,
437 .wkdep_srcs = ivahd_wkup_sleep_deps,
438 .sleepdep_srcs = ivahd_wkup_sleep_deps,
87 .flags = CLKDM_CAN_HWSUP_SWSUP, 439 .flags = CLKDM_CAN_HWSUP_SWSUP,
88 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 440 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
89}; 441};
@@ -94,6 +446,9 @@ static struct clockdomain l4_secure_44xx_clkdm = {
94 .prcm_partition = OMAP4430_CM2_PARTITION, 446 .prcm_partition = OMAP4430_CM2_PARTITION,
95 .cm_inst = OMAP4430_CM2_L4PER_INST, 447 .cm_inst = OMAP4430_CM2_L4PER_INST,
96 .clkdm_offs = OMAP4430_CM2_L4PER_L4SEC_CDOFFS, 448 .clkdm_offs = OMAP4430_CM2_L4PER_L4SEC_CDOFFS,
449 .dep_bit = OMAP4430_L4SEC_STATDEP_SHIFT,
450 .wkdep_srcs = l4_secure_wkup_sleep_deps,
451 .sleepdep_srcs = l4_secure_wkup_sleep_deps,
97 .flags = CLKDM_CAN_HWSUP_SWSUP, 452 .flags = CLKDM_CAN_HWSUP_SWSUP,
98 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 453 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
99}; 454};
@@ -104,6 +459,7 @@ static struct clockdomain l4_per_44xx_clkdm = {
104 .prcm_partition = OMAP4430_CM2_PARTITION, 459 .prcm_partition = OMAP4430_CM2_PARTITION,
105 .cm_inst = OMAP4430_CM2_L4PER_INST, 460 .cm_inst = OMAP4430_CM2_L4PER_INST,
106 .clkdm_offs = OMAP4430_CM2_L4PER_L4PER_CDOFFS, 461 .clkdm_offs = OMAP4430_CM2_L4PER_L4PER_CDOFFS,
462 .dep_bit = OMAP4430_L4PER_STATDEP_SHIFT,
107 .flags = CLKDM_CAN_HWSUP_SWSUP, 463 .flags = CLKDM_CAN_HWSUP_SWSUP,
108 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 464 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
109}; 465};
@@ -114,6 +470,7 @@ static struct clockdomain abe_44xx_clkdm = {
114 .prcm_partition = OMAP4430_CM1_PARTITION, 470 .prcm_partition = OMAP4430_CM1_PARTITION,
115 .cm_inst = OMAP4430_CM1_ABE_INST, 471 .cm_inst = OMAP4430_CM1_ABE_INST,
116 .clkdm_offs = OMAP4430_CM1_ABE_ABE_CDOFFS, 472 .clkdm_offs = OMAP4430_CM1_ABE_ABE_CDOFFS,
473 .dep_bit = OMAP4430_ABE_STATDEP_SHIFT,
117 .flags = CLKDM_CAN_HWSUP_SWSUP, 474 .flags = CLKDM_CAN_HWSUP_SWSUP,
118 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 475 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
119}; 476};
@@ -133,6 +490,9 @@ static struct clockdomain l3_init_44xx_clkdm = {
133 .prcm_partition = OMAP4430_CM2_PARTITION, 490 .prcm_partition = OMAP4430_CM2_PARTITION,
134 .cm_inst = OMAP4430_CM2_L3INIT_INST, 491 .cm_inst = OMAP4430_CM2_L3INIT_INST,
135 .clkdm_offs = OMAP4430_CM2_L3INIT_L3INIT_CDOFFS, 492 .clkdm_offs = OMAP4430_CM2_L3INIT_L3INIT_CDOFFS,
493 .dep_bit = OMAP4430_L3INIT_STATDEP_SHIFT,
494 .wkdep_srcs = l3_init_wkup_sleep_deps,
495 .sleepdep_srcs = l3_init_wkup_sleep_deps,
136 .flags = CLKDM_CAN_HWSUP_SWSUP, 496 .flags = CLKDM_CAN_HWSUP_SWSUP,
137 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 497 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
138}; 498};
@@ -143,6 +503,8 @@ static struct clockdomain mpuss_44xx_clkdm = {
143 .prcm_partition = OMAP4430_CM1_PARTITION, 503 .prcm_partition = OMAP4430_CM1_PARTITION,
144 .cm_inst = OMAP4430_CM1_MPU_INST, 504 .cm_inst = OMAP4430_CM1_MPU_INST,
145 .clkdm_offs = OMAP4430_CM1_MPU_MPU_CDOFFS, 505 .clkdm_offs = OMAP4430_CM1_MPU_MPU_CDOFFS,
506 .wkdep_srcs = mpuss_wkup_sleep_deps,
507 .sleepdep_srcs = mpuss_wkup_sleep_deps,
146 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 508 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
147 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 509 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
148}; 510};
@@ -152,7 +514,7 @@ static struct clockdomain mpu0_44xx_clkdm = {
152 .pwrdm = { .name = "cpu0_pwrdm" }, 514 .pwrdm = { .name = "cpu0_pwrdm" },
153 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, 515 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION,
154 .cm_inst = OMAP4430_PRCM_MPU_CPU0_INST, 516 .cm_inst = OMAP4430_PRCM_MPU_CPU0_INST,
155 .clkdm_offs = OMAP4430_PRCM_MPU_CPU0_MPU_CDOFFS, 517 .clkdm_offs = OMAP4430_PRCM_MPU_CPU0_CPU0_CDOFFS,
156 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 518 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
157 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 519 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
158}; 520};
@@ -162,7 +524,7 @@ static struct clockdomain mpu1_44xx_clkdm = {
162 .pwrdm = { .name = "cpu1_pwrdm" }, 524 .pwrdm = { .name = "cpu1_pwrdm" },
163 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, 525 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION,
164 .cm_inst = OMAP4430_PRCM_MPU_CPU1_INST, 526 .cm_inst = OMAP4430_PRCM_MPU_CPU1_INST,
165 .clkdm_offs = OMAP4430_PRCM_MPU_CPU1_MPU_CDOFFS, 527 .clkdm_offs = OMAP4430_PRCM_MPU_CPU1_CPU1_CDOFFS,
166 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 528 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
167 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 529 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
168}; 530};
@@ -173,6 +535,7 @@ static struct clockdomain l3_emif_44xx_clkdm = {
173 .prcm_partition = OMAP4430_CM2_PARTITION, 535 .prcm_partition = OMAP4430_CM2_PARTITION,
174 .cm_inst = OMAP4430_CM2_CORE_INST, 536 .cm_inst = OMAP4430_CM2_CORE_INST,
175 .clkdm_offs = OMAP4430_CM2_CORE_MEMIF_CDOFFS, 537 .clkdm_offs = OMAP4430_CM2_CORE_MEMIF_CDOFFS,
538 .dep_bit = OMAP4430_MEMIF_STATDEP_SHIFT,
176 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 539 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
177 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 540 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
178}; 541};
@@ -193,6 +556,9 @@ static struct clockdomain ducati_44xx_clkdm = {
193 .prcm_partition = OMAP4430_CM2_PARTITION, 556 .prcm_partition = OMAP4430_CM2_PARTITION,
194 .cm_inst = OMAP4430_CM2_CORE_INST, 557 .cm_inst = OMAP4430_CM2_CORE_INST,
195 .clkdm_offs = OMAP4430_CM2_CORE_DUCATI_CDOFFS, 558 .clkdm_offs = OMAP4430_CM2_CORE_DUCATI_CDOFFS,
559 .dep_bit = OMAP4430_DUCATI_STATDEP_SHIFT,
560 .wkdep_srcs = ducati_wkup_sleep_deps,
561 .sleepdep_srcs = ducati_wkup_sleep_deps,
196 .flags = CLKDM_CAN_HWSUP_SWSUP, 562 .flags = CLKDM_CAN_HWSUP_SWSUP,
197 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 563 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
198}; 564};
@@ -203,6 +569,7 @@ static struct clockdomain l3_2_44xx_clkdm = {
203 .prcm_partition = OMAP4430_CM2_PARTITION, 569 .prcm_partition = OMAP4430_CM2_PARTITION,
204 .cm_inst = OMAP4430_CM2_CORE_INST, 570 .cm_inst = OMAP4430_CM2_CORE_INST,
205 .clkdm_offs = OMAP4430_CM2_CORE_L3_2_CDOFFS, 571 .clkdm_offs = OMAP4430_CM2_CORE_L3_2_CDOFFS,
572 .dep_bit = OMAP4430_L3_2_STATDEP_SHIFT,
206 .flags = CLKDM_CAN_HWSUP, 573 .flags = CLKDM_CAN_HWSUP,
207 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 574 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
208}; 575};
@@ -213,6 +580,7 @@ static struct clockdomain l3_1_44xx_clkdm = {
213 .prcm_partition = OMAP4430_CM2_PARTITION, 580 .prcm_partition = OMAP4430_CM2_PARTITION,
214 .cm_inst = OMAP4430_CM2_CORE_INST, 581 .cm_inst = OMAP4430_CM2_CORE_INST,
215 .clkdm_offs = OMAP4430_CM2_CORE_L3_1_CDOFFS, 582 .clkdm_offs = OMAP4430_CM2_CORE_L3_1_CDOFFS,
583 .dep_bit = OMAP4430_L3_1_STATDEP_SHIFT,
216 .flags = CLKDM_CAN_HWSUP, 584 .flags = CLKDM_CAN_HWSUP,
217 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 585 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
218}; 586};
@@ -223,6 +591,8 @@ static struct clockdomain l3_d2d_44xx_clkdm = {
223 .prcm_partition = OMAP4430_CM2_PARTITION, 591 .prcm_partition = OMAP4430_CM2_PARTITION,
224 .cm_inst = OMAP4430_CM2_CORE_INST, 592 .cm_inst = OMAP4430_CM2_CORE_INST,
225 .clkdm_offs = OMAP4430_CM2_CORE_D2D_CDOFFS, 593 .clkdm_offs = OMAP4430_CM2_CORE_D2D_CDOFFS,
594 .wkdep_srcs = l3_d2d_wkup_sleep_deps,
595 .sleepdep_srcs = l3_d2d_wkup_sleep_deps,
226 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 596 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
227 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 597 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
228}; 598};
@@ -233,6 +603,8 @@ static struct clockdomain iss_44xx_clkdm = {
233 .prcm_partition = OMAP4430_CM2_PARTITION, 603 .prcm_partition = OMAP4430_CM2_PARTITION,
234 .cm_inst = OMAP4430_CM2_CAM_INST, 604 .cm_inst = OMAP4430_CM2_CAM_INST,
235 .clkdm_offs = OMAP4430_CM2_CAM_CAM_CDOFFS, 605 .clkdm_offs = OMAP4430_CM2_CAM_CAM_CDOFFS,
606 .wkdep_srcs = iss_wkup_sleep_deps,
607 .sleepdep_srcs = iss_wkup_sleep_deps,
236 .flags = CLKDM_CAN_HWSUP_SWSUP, 608 .flags = CLKDM_CAN_HWSUP_SWSUP,
237 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 609 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
238}; 610};
@@ -243,6 +615,9 @@ static struct clockdomain l3_dss_44xx_clkdm = {
243 .prcm_partition = OMAP4430_CM2_PARTITION, 615 .prcm_partition = OMAP4430_CM2_PARTITION,
244 .cm_inst = OMAP4430_CM2_DSS_INST, 616 .cm_inst = OMAP4430_CM2_DSS_INST,
245 .clkdm_offs = OMAP4430_CM2_DSS_DSS_CDOFFS, 617 .clkdm_offs = OMAP4430_CM2_DSS_DSS_CDOFFS,
618 .dep_bit = OMAP4430_DSS_STATDEP_SHIFT,
619 .wkdep_srcs = l3_dss_wkup_sleep_deps,
620 .sleepdep_srcs = l3_dss_wkup_sleep_deps,
246 .flags = CLKDM_CAN_HWSUP_SWSUP, 621 .flags = CLKDM_CAN_HWSUP_SWSUP,
247 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 622 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
248}; 623};
@@ -253,6 +628,7 @@ static struct clockdomain l4_wkup_44xx_clkdm = {
253 .prcm_partition = OMAP4430_PRM_PARTITION, 628 .prcm_partition = OMAP4430_PRM_PARTITION,
254 .cm_inst = OMAP4430_PRM_WKUP_CM_INST, 629 .cm_inst = OMAP4430_PRM_WKUP_CM_INST,
255 .clkdm_offs = OMAP4430_PRM_WKUP_CM_WKUP_CDOFFS, 630 .clkdm_offs = OMAP4430_PRM_WKUP_CM_WKUP_CDOFFS,
631 .dep_bit = OMAP4430_L4WKUP_STATDEP_SHIFT,
256 .flags = CLKDM_CAN_HWSUP, 632 .flags = CLKDM_CAN_HWSUP,
257 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 633 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
258}; 634};
@@ -273,6 +649,8 @@ static struct clockdomain l3_dma_44xx_clkdm = {
273 .prcm_partition = OMAP4430_CM2_PARTITION, 649 .prcm_partition = OMAP4430_CM2_PARTITION,
274 .cm_inst = OMAP4430_CM2_CORE_INST, 650 .cm_inst = OMAP4430_CM2_CORE_INST,
275 .clkdm_offs = OMAP4430_CM2_CORE_SDMA_CDOFFS, 651 .clkdm_offs = OMAP4430_CM2_CORE_SDMA_CDOFFS,
652 .wkdep_srcs = l3_dma_wkup_sleep_deps,
653 .sleepdep_srcs = l3_dma_wkup_sleep_deps,
276 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 654 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
277 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 655 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
278}; 656};
@@ -307,5 +685,5 @@ static struct clockdomain *clockdomains_omap44xx[] __initdata = {
307 685
308void __init omap44xx_clockdomains_init(void) 686void __init omap44xx_clockdomains_init(void)
309{ 687{
310 clkdm_init(clockdomains_omap44xx, NULL); 688 clkdm_init(clockdomains_omap44xx, NULL, &omap4_clkdm_operations);
311} 689}
diff --git a/arch/arm/mach-omap2/cm-regbits-24xx.h b/arch/arm/mach-omap2/cm-regbits-24xx.h
index d70660e82fe6..686290437568 100644
--- a/arch/arm/mach-omap2/cm-regbits-24xx.h
+++ b/arch/arm/mach-omap2/cm-regbits-24xx.h
@@ -210,8 +210,11 @@
210#define OMAP24XX_AUTO_USB_MASK (1 << 0) 210#define OMAP24XX_AUTO_USB_MASK (1 << 0)
211 211
212/* CM_AUTOIDLE3_CORE */ 212/* CM_AUTOIDLE3_CORE */
213#define OMAP24XX_AUTO_SDRC_SHIFT 2
213#define OMAP24XX_AUTO_SDRC_MASK (1 << 2) 214#define OMAP24XX_AUTO_SDRC_MASK (1 << 2)
215#define OMAP24XX_AUTO_GPMC_SHIFT 1
214#define OMAP24XX_AUTO_GPMC_MASK (1 << 1) 216#define OMAP24XX_AUTO_GPMC_MASK (1 << 1)
217#define OMAP24XX_AUTO_SDMA_SHIFT 0
215#define OMAP24XX_AUTO_SDMA_MASK (1 << 0) 218#define OMAP24XX_AUTO_SDMA_MASK (1 << 0)
216 219
217/* CM_AUTOIDLE4_CORE */ 220/* CM_AUTOIDLE4_CORE */
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.c b/arch/arm/mach-omap2/cm2xxx_3xxx.c
index 96954aa48671..9d0dec806e92 100644
--- a/arch/arm/mach-omap2/cm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/cm2xxx_3xxx.c
@@ -25,6 +25,14 @@
25#include "cm-regbits-24xx.h" 25#include "cm-regbits-24xx.h"
26#include "cm-regbits-34xx.h" 26#include "cm-regbits-34xx.h"
27 27
28/* CM_AUTOIDLE_PLL.AUTO_* bit values for DPLLs */
29#define DPLL_AUTOIDLE_DISABLE 0x0
30#define OMAP2XXX_DPLL_AUTOIDLE_LOW_POWER_STOP 0x3
31
32/* CM_AUTOIDLE_PLL.AUTO_* bit values for APLLs (OMAP2xxx only) */
33#define OMAP2XXX_APLL_AUTOIDLE_DISABLE 0x0
34#define OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP 0x3
35
28static const u8 cm_idlest_offs[] = { 36static const u8 cm_idlest_offs[] = {
29 CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3 37 CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3
30}; 38};
@@ -125,6 +133,67 @@ void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask)
125 _write_clktrctrl(OMAP34XX_CLKSTCTRL_FORCE_WAKEUP, module, mask); 133 _write_clktrctrl(OMAP34XX_CLKSTCTRL_FORCE_WAKEUP, module, mask);
126} 134}
127 135
136/*
137 * DPLL autoidle control
138 */
139
140static void _omap2xxx_set_dpll_autoidle(u8 m)
141{
142 u32 v;
143
144 v = omap2_cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE);
145 v &= ~OMAP24XX_AUTO_DPLL_MASK;
146 v |= m << OMAP24XX_AUTO_DPLL_SHIFT;
147 omap2_cm_write_mod_reg(v, PLL_MOD, CM_AUTOIDLE);
148}
149
150void omap2xxx_cm_set_dpll_disable_autoidle(void)
151{
152 _omap2xxx_set_dpll_autoidle(OMAP2XXX_DPLL_AUTOIDLE_LOW_POWER_STOP);
153}
154
155void omap2xxx_cm_set_dpll_auto_low_power_stop(void)
156{
157 _omap2xxx_set_dpll_autoidle(DPLL_AUTOIDLE_DISABLE);
158}
159
160/*
161 * APLL autoidle control
162 */
163
164static void _omap2xxx_set_apll_autoidle(u8 m, u32 mask)
165{
166 u32 v;
167
168 v = omap2_cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE);
169 v &= ~mask;
170 v |= m << __ffs(mask);
171 omap2_cm_write_mod_reg(v, PLL_MOD, CM_AUTOIDLE);
172}
173
174void omap2xxx_cm_set_apll54_disable_autoidle(void)
175{
176 _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP,
177 OMAP24XX_AUTO_54M_MASK);
178}
179
180void omap2xxx_cm_set_apll54_auto_low_power_stop(void)
181{
182 _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_DISABLE,
183 OMAP24XX_AUTO_54M_MASK);
184}
185
186void omap2xxx_cm_set_apll96_disable_autoidle(void)
187{
188 _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP,
189 OMAP24XX_AUTO_96M_MASK);
190}
191
192void omap2xxx_cm_set_apll96_auto_low_power_stop(void)
193{
194 _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_DISABLE,
195 OMAP24XX_AUTO_96M_MASK);
196}
128 197
129/* 198/*
130 * 199 *
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.h b/arch/arm/mach-omap2/cm2xxx_3xxx.h
index 5e9ea5bd60b9..088bbad73db5 100644
--- a/arch/arm/mach-omap2/cm2xxx_3xxx.h
+++ b/arch/arm/mach-omap2/cm2xxx_3xxx.h
@@ -122,6 +122,14 @@ extern void omap3xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask);
122extern void omap3xxx_cm_clkdm_force_sleep(s16 module, u32 mask); 122extern void omap3xxx_cm_clkdm_force_sleep(s16 module, u32 mask);
123extern void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask); 123extern void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask);
124 124
125extern void omap2xxx_cm_set_dpll_disable_autoidle(void);
126extern void omap2xxx_cm_set_dpll_auto_low_power_stop(void);
127
128extern void omap2xxx_cm_set_apll54_disable_autoidle(void);
129extern void omap2xxx_cm_set_apll54_auto_low_power_stop(void);
130extern void omap2xxx_cm_set_apll96_disable_autoidle(void);
131extern void omap2xxx_cm_set_apll96_auto_low_power_stop(void);
132
125#endif 133#endif
126 134
127/* CM register bits shared between 24XX and 3430 */ 135/* CM register bits shared between 24XX and 3430 */
diff --git a/arch/arm/mach-omap2/cm44xx.h b/arch/arm/mach-omap2/cm44xx.h
index 48fc3f426fbd..0b87ec82b41c 100644
--- a/arch/arm/mach-omap2/cm44xx.h
+++ b/arch/arm/mach-omap2/cm44xx.h
@@ -21,6 +21,7 @@
21#include "cm.h" 21#include "cm.h"
22 22
23#define OMAP4_CM_CLKSTCTRL 0x0000 23#define OMAP4_CM_CLKSTCTRL 0x0000
24#define OMAP4_CM_STATICDEP 0x0004
24 25
25/* Function prototypes */ 26/* Function prototypes */
26# ifndef __ASSEMBLER__ 27# ifndef __ASSEMBLER__
diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c
index c04bbbea17a5..a482bfa0a954 100644
--- a/arch/arm/mach-omap2/cminst44xx.c
+++ b/arch/arm/mach-omap2/cminst44xx.c
@@ -73,6 +73,27 @@ u32 omap4_cminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part, s16 inst,
73 return v; 73 return v;
74} 74}
75 75
76u32 omap4_cminst_set_inst_reg_bits(u32 bits, u8 part, s16 inst, s16 idx)
77{
78 return omap4_cminst_rmw_inst_reg_bits(bits, bits, part, inst, idx);
79}
80
81u32 omap4_cminst_clear_inst_reg_bits(u32 bits, u8 part, s16 inst, s16 idx)
82{
83 return omap4_cminst_rmw_inst_reg_bits(bits, 0x0, part, inst, idx);
84}
85
86u32 omap4_cminst_read_inst_reg_bits(u8 part, u16 inst, s16 idx, u32 mask)
87{
88 u32 v;
89
90 v = omap4_cminst_read_inst_reg(part, inst, idx);
91 v &= mask;
92 v >>= __ffs(mask);
93
94 return v;
95}
96
76/* 97/*
77 * 98 *
78 */ 99 */
diff --git a/arch/arm/mach-omap2/cminst44xx.h b/arch/arm/mach-omap2/cminst44xx.h
index a6abd0a8cb82..2b32c181a2ee 100644
--- a/arch/arm/mach-omap2/cminst44xx.h
+++ b/arch/arm/mach-omap2/cminst44xx.h
@@ -25,6 +25,12 @@ extern u32 omap4_cminst_read_inst_reg(u8 part, s16 inst, u16 idx);
25extern void omap4_cminst_write_inst_reg(u32 val, u8 part, s16 inst, u16 idx); 25extern void omap4_cminst_write_inst_reg(u32 val, u8 part, s16 inst, u16 idx);
26extern u32 omap4_cminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part, 26extern u32 omap4_cminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part,
27 s16 inst, s16 idx); 27 s16 inst, s16 idx);
28extern u32 omap4_cminst_set_inst_reg_bits(u32 bits, u8 part, s16 inst,
29 s16 idx);
30extern u32 omap4_cminst_clear_inst_reg_bits(u32 bits, u8 part, s16 inst,
31 s16 idx);
32extern u32 omap4_cminst_read_inst_reg_bits(u8 part, u16 inst, s16 idx,
33 u32 mask);
28 34
29extern int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg); 35extern int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg);
30 36
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index 778929f7e92d..3f20cbb9967b 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -40,7 +40,7 @@ static void __init __omap2_set_globals(struct omap_globals *omap2_globals)
40 40
41#endif 41#endif
42 42
43#if defined(CONFIG_ARCH_OMAP2420) 43#if defined(CONFIG_SOC_OMAP2420)
44 44
45static struct omap_globals omap242x_globals = { 45static struct omap_globals omap242x_globals = {
46 .class = OMAP242X_CLASS, 46 .class = OMAP242X_CLASS,
@@ -50,9 +50,6 @@ static struct omap_globals omap242x_globals = {
50 .ctrl = OMAP242X_CTRL_BASE, 50 .ctrl = OMAP242X_CTRL_BASE,
51 .prm = OMAP2420_PRM_BASE, 51 .prm = OMAP2420_PRM_BASE,
52 .cm = OMAP2420_CM_BASE, 52 .cm = OMAP2420_CM_BASE,
53 .uart1_phys = OMAP2_UART1_BASE,
54 .uart2_phys = OMAP2_UART2_BASE,
55 .uart3_phys = OMAP2_UART3_BASE,
56}; 53};
57 54
58void __init omap2_set_globals_242x(void) 55void __init omap2_set_globals_242x(void)
@@ -61,7 +58,7 @@ void __init omap2_set_globals_242x(void)
61} 58}
62#endif 59#endif
63 60
64#if defined(CONFIG_ARCH_OMAP2430) 61#if defined(CONFIG_SOC_OMAP2430)
65 62
66static struct omap_globals omap243x_globals = { 63static struct omap_globals omap243x_globals = {
67 .class = OMAP243X_CLASS, 64 .class = OMAP243X_CLASS,
@@ -71,9 +68,6 @@ static struct omap_globals omap243x_globals = {
71 .ctrl = OMAP243X_CTRL_BASE, 68 .ctrl = OMAP243X_CTRL_BASE,
72 .prm = OMAP2430_PRM_BASE, 69 .prm = OMAP2430_PRM_BASE,
73 .cm = OMAP2430_CM_BASE, 70 .cm = OMAP2430_CM_BASE,
74 .uart1_phys = OMAP2_UART1_BASE,
75 .uart2_phys = OMAP2_UART2_BASE,
76 .uart3_phys = OMAP2_UART3_BASE,
77}; 71};
78 72
79void __init omap2_set_globals_243x(void) 73void __init omap2_set_globals_243x(void)
@@ -92,10 +86,6 @@ static struct omap_globals omap3_globals = {
92 .ctrl = OMAP343X_CTRL_BASE, 86 .ctrl = OMAP343X_CTRL_BASE,
93 .prm = OMAP3430_PRM_BASE, 87 .prm = OMAP3430_PRM_BASE,
94 .cm = OMAP3430_CM_BASE, 88 .cm = OMAP3430_CM_BASE,
95 .uart1_phys = OMAP3_UART1_BASE,
96 .uart2_phys = OMAP3_UART2_BASE,
97 .uart3_phys = OMAP3_UART3_BASE,
98 .uart4_phys = OMAP3_UART4_BASE, /* Only on 3630 */
99}; 89};
100 90
101void __init omap2_set_globals_3xxx(void) 91void __init omap2_set_globals_3xxx(void)
@@ -108,6 +98,27 @@ void __init omap3_map_io(void)
108 omap2_set_globals_3xxx(); 98 omap2_set_globals_3xxx();
109 omap34xx_map_common_io(); 99 omap34xx_map_common_io();
110} 100}
101
102/*
103 * Adjust TAP register base such that omap3_check_revision accesses the correct
104 * TI816X register for checking device ID (it adds 0x204 to tap base while
105 * TI816X DEVICE ID register is at offset 0x600 from control base).
106 */
107#define TI816X_TAP_BASE (TI816X_CTRL_BASE + \
108 TI816X_CONTROL_DEVICE_ID - 0x204)
109
110static struct omap_globals ti816x_globals = {
111 .class = OMAP343X_CLASS,
112 .tap = OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE),
113 .ctrl = TI816X_CTRL_BASE,
114 .prm = TI816X_PRCM_BASE,
115 .cm = TI816X_PRCM_BASE,
116};
117
118void __init omap2_set_globals_ti816x(void)
119{
120 __omap2_set_globals(&ti816x_globals);
121}
111#endif 122#endif
112 123
113#if defined(CONFIG_ARCH_OMAP4) 124#if defined(CONFIG_ARCH_OMAP4)
@@ -119,10 +130,6 @@ static struct omap_globals omap4_globals = {
119 .prm = OMAP4430_PRM_BASE, 130 .prm = OMAP4430_PRM_BASE,
120 .cm = OMAP4430_CM_BASE, 131 .cm = OMAP4430_CM_BASE,
121 .cm2 = OMAP4430_CM2_BASE, 132 .cm2 = OMAP4430_CM2_BASE,
122 .uart1_phys = OMAP4_UART1_BASE,
123 .uart2_phys = OMAP4_UART2_BASE,
124 .uart3_phys = OMAP4_UART3_BASE,
125 .uart4_phys = OMAP4_UART4_BASE,
126}; 133};
127 134
128void __init omap2_set_globals_443x(void) 135void __init omap2_set_globals_443x(void)
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index f0629ae04102..c2804c1c4efd 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -52,6 +52,9 @@
52#define OMAP343X_CONTROL_PADCONFS_WKUP 0xa00 52#define OMAP343X_CONTROL_PADCONFS_WKUP 0xa00
53#define OMAP343X_CONTROL_GENERAL_WKUP 0xa60 53#define OMAP343X_CONTROL_GENERAL_WKUP 0xa60
54 54
55/* TI816X spefic control submodules */
56#define TI816X_CONTROL_DEVCONF 0x600
57
55/* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */ 58/* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */
56 59
57#define OMAP2_CONTROL_SYSCONFIG (OMAP2_CONTROL_INTERFACE + 0x10) 60#define OMAP2_CONTROL_SYSCONFIG (OMAP2_CONTROL_INTERFACE + 0x10)
@@ -241,6 +244,9 @@
241#define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250 244#define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250
242#define OMAP3_PADCONF_SAD2D_IDLEACK 0x254 245#define OMAP3_PADCONF_SAD2D_IDLEACK 0x254
243 246
247/* TI816X CONTROL_DEVCONF register offsets */
248#define TI816X_CONTROL_DEVICE_ID (TI816X_CONTROL_DEVCONF + 0x000)
249
244/* 250/*
245 * REVISIT: This list of registers is not comprehensive - there are more 251 * REVISIT: This list of registers is not comprehensive - there are more
246 * that should be added. 252 * that should be added.
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index f7b22a16f385..a44c52303405 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -58,6 +58,7 @@ struct omap3_processor_cx {
58 u32 core_state; 58 u32 core_state;
59 u32 threshold; 59 u32 threshold;
60 u32 flags; 60 u32 flags;
61 const char *desc;
61}; 62};
62 63
63struct omap3_processor_cx omap3_power_states[OMAP3_MAX_STATES]; 64struct omap3_processor_cx omap3_power_states[OMAP3_MAX_STATES];
@@ -99,14 +100,14 @@ static int omap3_idle_bm_check(void)
99static int _cpuidle_allow_idle(struct powerdomain *pwrdm, 100static int _cpuidle_allow_idle(struct powerdomain *pwrdm,
100 struct clockdomain *clkdm) 101 struct clockdomain *clkdm)
101{ 102{
102 omap2_clkdm_allow_idle(clkdm); 103 clkdm_allow_idle(clkdm);
103 return 0; 104 return 0;
104} 105}
105 106
106static int _cpuidle_deny_idle(struct powerdomain *pwrdm, 107static int _cpuidle_deny_idle(struct powerdomain *pwrdm,
107 struct clockdomain *clkdm) 108 struct clockdomain *clkdm)
108{ 109{
109 omap2_clkdm_deny_idle(clkdm); 110 clkdm_deny_idle(clkdm);
110 return 0; 111 return 0;
111} 112}
112 113
@@ -365,6 +366,7 @@ void omap_init_power_states(void)
365 omap3_power_states[OMAP3_STATE_C1].mpu_state = PWRDM_POWER_ON; 366 omap3_power_states[OMAP3_STATE_C1].mpu_state = PWRDM_POWER_ON;
366 omap3_power_states[OMAP3_STATE_C1].core_state = PWRDM_POWER_ON; 367 omap3_power_states[OMAP3_STATE_C1].core_state = PWRDM_POWER_ON;
367 omap3_power_states[OMAP3_STATE_C1].flags = CPUIDLE_FLAG_TIME_VALID; 368 omap3_power_states[OMAP3_STATE_C1].flags = CPUIDLE_FLAG_TIME_VALID;
369 omap3_power_states[OMAP3_STATE_C1].desc = "MPU ON + CORE ON";
368 370
369 /* C2 . MPU WFI + Core inactive */ 371 /* C2 . MPU WFI + Core inactive */
370 omap3_power_states[OMAP3_STATE_C2].valid = 372 omap3_power_states[OMAP3_STATE_C2].valid =
@@ -380,6 +382,7 @@ void omap_init_power_states(void)
380 omap3_power_states[OMAP3_STATE_C2].core_state = PWRDM_POWER_ON; 382 omap3_power_states[OMAP3_STATE_C2].core_state = PWRDM_POWER_ON;
381 omap3_power_states[OMAP3_STATE_C2].flags = CPUIDLE_FLAG_TIME_VALID | 383 omap3_power_states[OMAP3_STATE_C2].flags = CPUIDLE_FLAG_TIME_VALID |
382 CPUIDLE_FLAG_CHECK_BM; 384 CPUIDLE_FLAG_CHECK_BM;
385 omap3_power_states[OMAP3_STATE_C2].desc = "MPU ON + CORE ON";
383 386
384 /* C3 . MPU CSWR + Core inactive */ 387 /* C3 . MPU CSWR + Core inactive */
385 omap3_power_states[OMAP3_STATE_C3].valid = 388 omap3_power_states[OMAP3_STATE_C3].valid =
@@ -395,6 +398,7 @@ void omap_init_power_states(void)
395 omap3_power_states[OMAP3_STATE_C3].core_state = PWRDM_POWER_ON; 398 omap3_power_states[OMAP3_STATE_C3].core_state = PWRDM_POWER_ON;
396 omap3_power_states[OMAP3_STATE_C3].flags = CPUIDLE_FLAG_TIME_VALID | 399 omap3_power_states[OMAP3_STATE_C3].flags = CPUIDLE_FLAG_TIME_VALID |
397 CPUIDLE_FLAG_CHECK_BM; 400 CPUIDLE_FLAG_CHECK_BM;
401 omap3_power_states[OMAP3_STATE_C3].desc = "MPU RET + CORE ON";
398 402
399 /* C4 . MPU OFF + Core inactive */ 403 /* C4 . MPU OFF + Core inactive */
400 omap3_power_states[OMAP3_STATE_C4].valid = 404 omap3_power_states[OMAP3_STATE_C4].valid =
@@ -410,6 +414,7 @@ void omap_init_power_states(void)
410 omap3_power_states[OMAP3_STATE_C4].core_state = PWRDM_POWER_ON; 414 omap3_power_states[OMAP3_STATE_C4].core_state = PWRDM_POWER_ON;
411 omap3_power_states[OMAP3_STATE_C4].flags = CPUIDLE_FLAG_TIME_VALID | 415 omap3_power_states[OMAP3_STATE_C4].flags = CPUIDLE_FLAG_TIME_VALID |
412 CPUIDLE_FLAG_CHECK_BM; 416 CPUIDLE_FLAG_CHECK_BM;
417 omap3_power_states[OMAP3_STATE_C4].desc = "MPU OFF + CORE ON";
413 418
414 /* C5 . MPU CSWR + Core CSWR*/ 419 /* C5 . MPU CSWR + Core CSWR*/
415 omap3_power_states[OMAP3_STATE_C5].valid = 420 omap3_power_states[OMAP3_STATE_C5].valid =
@@ -425,6 +430,7 @@ void omap_init_power_states(void)
425 omap3_power_states[OMAP3_STATE_C5].core_state = PWRDM_POWER_RET; 430 omap3_power_states[OMAP3_STATE_C5].core_state = PWRDM_POWER_RET;
426 omap3_power_states[OMAP3_STATE_C5].flags = CPUIDLE_FLAG_TIME_VALID | 431 omap3_power_states[OMAP3_STATE_C5].flags = CPUIDLE_FLAG_TIME_VALID |
427 CPUIDLE_FLAG_CHECK_BM; 432 CPUIDLE_FLAG_CHECK_BM;
433 omap3_power_states[OMAP3_STATE_C5].desc = "MPU RET + CORE RET";
428 434
429 /* C6 . MPU OFF + Core CSWR */ 435 /* C6 . MPU OFF + Core CSWR */
430 omap3_power_states[OMAP3_STATE_C6].valid = 436 omap3_power_states[OMAP3_STATE_C6].valid =
@@ -440,6 +446,7 @@ void omap_init_power_states(void)
440 omap3_power_states[OMAP3_STATE_C6].core_state = PWRDM_POWER_RET; 446 omap3_power_states[OMAP3_STATE_C6].core_state = PWRDM_POWER_RET;
441 omap3_power_states[OMAP3_STATE_C6].flags = CPUIDLE_FLAG_TIME_VALID | 447 omap3_power_states[OMAP3_STATE_C6].flags = CPUIDLE_FLAG_TIME_VALID |
442 CPUIDLE_FLAG_CHECK_BM; 448 CPUIDLE_FLAG_CHECK_BM;
449 omap3_power_states[OMAP3_STATE_C6].desc = "MPU OFF + CORE RET";
443 450
444 /* C7 . MPU OFF + Core OFF */ 451 /* C7 . MPU OFF + Core OFF */
445 omap3_power_states[OMAP3_STATE_C7].valid = 452 omap3_power_states[OMAP3_STATE_C7].valid =
@@ -455,6 +462,7 @@ void omap_init_power_states(void)
455 omap3_power_states[OMAP3_STATE_C7].core_state = PWRDM_POWER_OFF; 462 omap3_power_states[OMAP3_STATE_C7].core_state = PWRDM_POWER_OFF;
456 omap3_power_states[OMAP3_STATE_C7].flags = CPUIDLE_FLAG_TIME_VALID | 463 omap3_power_states[OMAP3_STATE_C7].flags = CPUIDLE_FLAG_TIME_VALID |
457 CPUIDLE_FLAG_CHECK_BM; 464 CPUIDLE_FLAG_CHECK_BM;
465 omap3_power_states[OMAP3_STATE_C7].desc = "MPU OFF + CORE OFF";
458 466
459 /* 467 /*
460 * Erratum i583: implementation for ES rev < Es1.2 on 3630. We cannot 468 * Erratum i583: implementation for ES rev < Es1.2 on 3630. We cannot
@@ -464,7 +472,7 @@ void omap_init_power_states(void)
464 if (IS_PM34XX_ERRATUM(PM_SDRC_WAKEUP_ERRATUM_i583)) { 472 if (IS_PM34XX_ERRATUM(PM_SDRC_WAKEUP_ERRATUM_i583)) {
465 omap3_power_states[OMAP3_STATE_C7].valid = 0; 473 omap3_power_states[OMAP3_STATE_C7].valid = 0;
466 cpuidle_params_table[OMAP3_STATE_C7].valid = 0; 474 cpuidle_params_table[OMAP3_STATE_C7].valid = 0;
467 WARN_ONCE(1, "%s: core off state C7 disabled due to i583\n", 475 pr_warn("%s: core off state C7 disabled due to i583\n",
468 __func__); 476 __func__);
469 } 477 }
470} 478}
@@ -512,6 +520,7 @@ int __init omap3_idle_init(void)
512 if (cx->type == OMAP3_STATE_C1) 520 if (cx->type == OMAP3_STATE_C1)
513 dev->safe_state = state; 521 dev->safe_state = state;
514 sprintf(state->name, "C%d", count+1); 522 sprintf(state->name, "C%d", count+1);
523 strncpy(state->desc, cx->desc, CPUIDLE_DESC_LEN);
515 count++; 524 count++;
516 } 525 }
517 526
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 2c9c912f2c42..e97851492847 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -15,6 +15,7 @@
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/clk.h> 16#include <linux/clk.h>
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/slab.h>
18 19
19#include <mach/hardware.h> 20#include <mach/hardware.h>
20#include <mach/irqs.h> 21#include <mach/irqs.h>
@@ -30,13 +31,79 @@
30#include <plat/dma.h> 31#include <plat/dma.h>
31#include <plat/omap_hwmod.h> 32#include <plat/omap_hwmod.h>
32#include <plat/omap_device.h> 33#include <plat/omap_device.h>
34#include <plat/omap4-keypad.h>
33 35
34#include "mux.h" 36#include "mux.h"
35#include "control.h" 37#include "control.h"
38#include "devices.h"
39
40#define L3_MODULES_MAX_LEN 12
41#define L3_MODULES 3
42
43static int __init omap3_l3_init(void)
44{
45 int l;
46 struct omap_hwmod *oh;
47 struct omap_device *od;
48 char oh_name[L3_MODULES_MAX_LEN];
49
50 /*
51 * To avoid code running on other OMAPs in
52 * multi-omap builds
53 */
54 if (!(cpu_is_omap34xx()))
55 return -ENODEV;
56
57 l = snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main");
58
59 oh = omap_hwmod_lookup(oh_name);
60
61 if (!oh)
62 pr_err("could not look up %s\n", oh_name);
63
64 od = omap_device_build("omap_l3_smx", 0, oh, NULL, 0,
65 NULL, 0, 0);
66
67 WARN(IS_ERR(od), "could not build omap_device for %s\n", oh_name);
68
69 return PTR_ERR(od);
70}
71postcore_initcall(omap3_l3_init);
72
73static int __init omap4_l3_init(void)
74{
75 int l, i;
76 struct omap_hwmod *oh[3];
77 struct omap_device *od;
78 char oh_name[L3_MODULES_MAX_LEN];
79
80 /*
81 * To avoid code running on other OMAPs in
82 * multi-omap builds
83 */
84 if (!(cpu_is_omap44xx()))
85 return -ENODEV;
86
87 for (i = 0; i < L3_MODULES; i++) {
88 l = snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main_%d", i+1);
89
90 oh[i] = omap_hwmod_lookup(oh_name);
91 if (!(oh[i]))
92 pr_err("could not look up %s\n", oh_name);
93 }
94
95 od = omap_device_build_ss("omap_l3_noc", 0, oh, 3, NULL,
96 0, NULL, 0, 0);
97
98 WARN(IS_ERR(od), "could not build omap_device for %s\n", oh_name);
99
100 return PTR_ERR(od);
101}
102postcore_initcall(omap4_l3_init);
36 103
37#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) 104#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
38 105
39static struct resource cam_resources[] = { 106static struct resource omap2cam_resources[] = {
40 { 107 {
41 .start = OMAP24XX_CAMERA_BASE, 108 .start = OMAP24XX_CAMERA_BASE,
42 .end = OMAP24XX_CAMERA_BASE + 0xfff, 109 .end = OMAP24XX_CAMERA_BASE + 0xfff,
@@ -48,19 +115,13 @@ static struct resource cam_resources[] = {
48 } 115 }
49}; 116};
50 117
51static struct platform_device omap_cam_device = { 118static struct platform_device omap2cam_device = {
52 .name = "omap24xxcam", 119 .name = "omap24xxcam",
53 .id = -1, 120 .id = -1,
54 .num_resources = ARRAY_SIZE(cam_resources), 121 .num_resources = ARRAY_SIZE(omap2cam_resources),
55 .resource = cam_resources, 122 .resource = omap2cam_resources,
56}; 123};
57 124#endif
58static inline void omap_init_camera(void)
59{
60 platform_device_register(&omap_cam_device);
61}
62
63#elif defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE)
64 125
65static struct resource omap3isp_resources[] = { 126static struct resource omap3isp_resources[] = {
66 { 127 {
@@ -69,11 +130,6 @@ static struct resource omap3isp_resources[] = {
69 .flags = IORESOURCE_MEM, 130 .flags = IORESOURCE_MEM,
70 }, 131 },
71 { 132 {
72 .start = OMAP3430_ISP_CBUFF_BASE,
73 .end = OMAP3430_ISP_CBUFF_END,
74 .flags = IORESOURCE_MEM,
75 },
76 {
77 .start = OMAP3430_ISP_CCP2_BASE, 133 .start = OMAP3430_ISP_CCP2_BASE,
78 .end = OMAP3430_ISP_CCP2_END, 134 .end = OMAP3430_ISP_CCP2_END,
79 .flags = IORESOURCE_MEM, 135 .flags = IORESOURCE_MEM,
@@ -109,13 +165,33 @@ static struct resource omap3isp_resources[] = {
109 .flags = IORESOURCE_MEM, 165 .flags = IORESOURCE_MEM,
110 }, 166 },
111 { 167 {
112 .start = OMAP3430_ISP_CSI2A_BASE, 168 .start = OMAP3430_ISP_CSI2A_REGS1_BASE,
113 .end = OMAP3430_ISP_CSI2A_END, 169 .end = OMAP3430_ISP_CSI2A_REGS1_END,
114 .flags = IORESOURCE_MEM, 170 .flags = IORESOURCE_MEM,
115 }, 171 },
116 { 172 {
117 .start = OMAP3430_ISP_CSI2PHY_BASE, 173 .start = OMAP3430_ISP_CSIPHY2_BASE,
118 .end = OMAP3430_ISP_CSI2PHY_END, 174 .end = OMAP3430_ISP_CSIPHY2_END,
175 .flags = IORESOURCE_MEM,
176 },
177 {
178 .start = OMAP3630_ISP_CSI2A_REGS2_BASE,
179 .end = OMAP3630_ISP_CSI2A_REGS2_END,
180 .flags = IORESOURCE_MEM,
181 },
182 {
183 .start = OMAP3630_ISP_CSI2C_REGS1_BASE,
184 .end = OMAP3630_ISP_CSI2C_REGS1_END,
185 .flags = IORESOURCE_MEM,
186 },
187 {
188 .start = OMAP3630_ISP_CSIPHY1_BASE,
189 .end = OMAP3630_ISP_CSIPHY1_END,
190 .flags = IORESOURCE_MEM,
191 },
192 {
193 .start = OMAP3630_ISP_CSI2C_REGS2_BASE,
194 .end = OMAP3630_ISP_CSI2C_REGS2_END,
119 .flags = IORESOURCE_MEM, 195 .flags = IORESOURCE_MEM,
120 }, 196 },
121 { 197 {
@@ -131,106 +207,84 @@ static struct platform_device omap3isp_device = {
131 .resource = omap3isp_resources, 207 .resource = omap3isp_resources,
132}; 208};
133 209
134static inline void omap_init_camera(void) 210int omap3_init_camera(struct isp_platform_data *pdata)
135{ 211{
136 platform_device_register(&omap3isp_device); 212 omap3isp_device.dev.platform_data = pdata;
213 return platform_device_register(&omap3isp_device);
137} 214}
138#else 215
139static inline void omap_init_camera(void) 216static inline void omap_init_camera(void)
140{ 217{
141} 218#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
219 if (cpu_is_omap24xx())
220 platform_device_register(&omap2cam_device);
142#endif 221#endif
222}
143 223
144#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) 224struct omap_device_pm_latency omap_keyboard_latency[] = {
145
146#define MBOX_REG_SIZE 0x120
147
148#ifdef CONFIG_ARCH_OMAP2
149static struct resource omap2_mbox_resources[] = {
150 {
151 .start = OMAP24XX_MAILBOX_BASE,
152 .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
153 .flags = IORESOURCE_MEM,
154 },
155 {
156 .start = INT_24XX_MAIL_U0_MPU,
157 .flags = IORESOURCE_IRQ,
158 .name = "dsp",
159 },
160 { 225 {
161 .start = INT_24XX_MAIL_U3_MPU, 226 .deactivate_func = omap_device_idle_hwmods,
162 .flags = IORESOURCE_IRQ, 227 .activate_func = omap_device_enable_hwmods,
163 .name = "iva", 228 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
164 }, 229 },
165}; 230};
166static int omap2_mbox_resources_sz = ARRAY_SIZE(omap2_mbox_resources);
167#else
168#define omap2_mbox_resources NULL
169#define omap2_mbox_resources_sz 0
170#endif
171 231
172#ifdef CONFIG_ARCH_OMAP3 232int __init omap4_keyboard_init(struct omap4_keypad_platform_data
173static struct resource omap3_mbox_resources[] = { 233 *sdp4430_keypad_data)
174 { 234{
175 .start = OMAP34XX_MAILBOX_BASE, 235 struct omap_device *od;
176 .end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, 236 struct omap_hwmod *oh;
177 .flags = IORESOURCE_MEM, 237 struct omap4_keypad_platform_data *keypad_data;
178 }, 238 unsigned int id = -1;
179 { 239 char *oh_name = "kbd";
180 .start = INT_24XX_MAIL_U0_MPU, 240 char *name = "omap4-keypad";
181 .flags = IORESOURCE_IRQ, 241
182 .name = "dsp", 242 oh = omap_hwmod_lookup(oh_name);
183 }, 243 if (!oh) {
184}; 244 pr_err("Could not look up %s\n", oh_name);
185static int omap3_mbox_resources_sz = ARRAY_SIZE(omap3_mbox_resources); 245 return -ENODEV;
186#else 246 }
187#define omap3_mbox_resources NULL
188#define omap3_mbox_resources_sz 0
189#endif
190 247
191#ifdef CONFIG_ARCH_OMAP4 248 keypad_data = sdp4430_keypad_data;
192 249
193#define OMAP4_MBOX_REG_SIZE 0x130 250 od = omap_device_build(name, id, oh, keypad_data,
194static struct resource omap4_mbox_resources[] = { 251 sizeof(struct omap4_keypad_platform_data),
195 { 252 omap_keyboard_latency,
196 .start = OMAP44XX_MAILBOX_BASE, 253 ARRAY_SIZE(omap_keyboard_latency), 0);
197 .end = OMAP44XX_MAILBOX_BASE +
198 OMAP4_MBOX_REG_SIZE - 1,
199 .flags = IORESOURCE_MEM,
200 },
201 {
202 .start = OMAP44XX_IRQ_MAIL_U0,
203 .flags = IORESOURCE_IRQ,
204 .name = "mbox",
205 },
206};
207static int omap4_mbox_resources_sz = ARRAY_SIZE(omap4_mbox_resources);
208#else
209#define omap4_mbox_resources NULL
210#define omap4_mbox_resources_sz 0
211#endif
212 254
213static struct platform_device mbox_device = { 255 if (IS_ERR(od)) {
214 .name = "omap-mailbox", 256 WARN(1, "Cant build omap_device for %s:%s.\n",
215 .id = -1, 257 name, oh->name);
258 return PTR_ERR(od);
259 }
260
261 return 0;
262}
263
264#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
265static struct omap_device_pm_latency mbox_latencies[] = {
266 [0] = {
267 .activate_func = omap_device_enable_hwmods,
268 .deactivate_func = omap_device_idle_hwmods,
269 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
270 },
216}; 271};
217 272
218static inline void omap_init_mbox(void) 273static inline void omap_init_mbox(void)
219{ 274{
220 if (cpu_is_omap24xx()) { 275 struct omap_hwmod *oh;
221 mbox_device.resource = omap2_mbox_resources; 276 struct omap_device *od;
222 mbox_device.num_resources = omap2_mbox_resources_sz; 277
223 } else if (cpu_is_omap34xx()) { 278 oh = omap_hwmod_lookup("mailbox");
224 mbox_device.resource = omap3_mbox_resources; 279 if (!oh) {
225 mbox_device.num_resources = omap3_mbox_resources_sz; 280 pr_err("%s: unable to find hwmod\n", __func__);
226 } else if (cpu_is_omap44xx()) {
227 mbox_device.resource = omap4_mbox_resources;
228 mbox_device.num_resources = omap4_mbox_resources_sz;
229 } else {
230 pr_err("%s: platform not supported\n", __func__);
231 return; 281 return;
232 } 282 }
233 platform_device_register(&mbox_device); 283
284 od = omap_device_build("omap-mailbox", -1, oh, NULL, 0,
285 mbox_latencies, ARRAY_SIZE(mbox_latencies), 0);
286 WARN(IS_ERR(od), "%s: could not build device, err %ld\n",
287 __func__, PTR_ERR(od));
234} 288}
235#else 289#else
236static inline void omap_init_mbox(void) { } 290static inline void omap_init_mbox(void) { }
@@ -279,163 +333,55 @@ static inline void omap_init_audio(void) {}
279 333
280#include <plat/mcspi.h> 334#include <plat/mcspi.h>
281 335
282#define OMAP2_MCSPI1_BASE 0x48098000 336struct omap_device_pm_latency omap_mcspi_latency[] = {
283#define OMAP2_MCSPI2_BASE 0x4809a000 337 [0] = {
284#define OMAP2_MCSPI3_BASE 0x480b8000 338 .deactivate_func = omap_device_idle_hwmods,
285#define OMAP2_MCSPI4_BASE 0x480ba000 339 .activate_func = omap_device_enable_hwmods,
286 340 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
287#define OMAP4_MCSPI1_BASE 0x48098100
288#define OMAP4_MCSPI2_BASE 0x4809a100
289#define OMAP4_MCSPI3_BASE 0x480b8100
290#define OMAP4_MCSPI4_BASE 0x480ba100
291
292static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
293 .num_cs = 4,
294};
295
296static struct resource omap2_mcspi1_resources[] = {
297 {
298 .start = OMAP2_MCSPI1_BASE,
299 .end = OMAP2_MCSPI1_BASE + 0xff,
300 .flags = IORESOURCE_MEM,
301 },
302};
303
304static struct platform_device omap2_mcspi1 = {
305 .name = "omap2_mcspi",
306 .id = 1,
307 .num_resources = ARRAY_SIZE(omap2_mcspi1_resources),
308 .resource = omap2_mcspi1_resources,
309 .dev = {
310 .platform_data = &omap2_mcspi1_config,
311 },
312};
313
314static struct omap2_mcspi_platform_config omap2_mcspi2_config = {
315 .num_cs = 2,
316};
317
318static struct resource omap2_mcspi2_resources[] = {
319 {
320 .start = OMAP2_MCSPI2_BASE,
321 .end = OMAP2_MCSPI2_BASE + 0xff,
322 .flags = IORESOURCE_MEM,
323 },
324};
325
326static struct platform_device omap2_mcspi2 = {
327 .name = "omap2_mcspi",
328 .id = 2,
329 .num_resources = ARRAY_SIZE(omap2_mcspi2_resources),
330 .resource = omap2_mcspi2_resources,
331 .dev = {
332 .platform_data = &omap2_mcspi2_config,
333 },
334};
335
336#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \
337 defined(CONFIG_ARCH_OMAP4)
338static struct omap2_mcspi_platform_config omap2_mcspi3_config = {
339 .num_cs = 2,
340};
341
342static struct resource omap2_mcspi3_resources[] = {
343 {
344 .start = OMAP2_MCSPI3_BASE,
345 .end = OMAP2_MCSPI3_BASE + 0xff,
346 .flags = IORESOURCE_MEM,
347 },
348};
349
350static struct platform_device omap2_mcspi3 = {
351 .name = "omap2_mcspi",
352 .id = 3,
353 .num_resources = ARRAY_SIZE(omap2_mcspi3_resources),
354 .resource = omap2_mcspi3_resources,
355 .dev = {
356 .platform_data = &omap2_mcspi3_config,
357 },
358};
359#endif
360
361#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
362static struct omap2_mcspi_platform_config omap2_mcspi4_config = {
363 .num_cs = 1,
364};
365
366static struct resource omap2_mcspi4_resources[] = {
367 {
368 .start = OMAP2_MCSPI4_BASE,
369 .end = OMAP2_MCSPI4_BASE + 0xff,
370 .flags = IORESOURCE_MEM,
371 },
372};
373
374static struct platform_device omap2_mcspi4 = {
375 .name = "omap2_mcspi",
376 .id = 4,
377 .num_resources = ARRAY_SIZE(omap2_mcspi4_resources),
378 .resource = omap2_mcspi4_resources,
379 .dev = {
380 .platform_data = &omap2_mcspi4_config,
381 }, 341 },
382}; 342};
383#endif
384 343
385#ifdef CONFIG_ARCH_OMAP4 344static int omap_mcspi_init(struct omap_hwmod *oh, void *unused)
386static inline void omap4_mcspi_fixup(void)
387{
388 omap2_mcspi1_resources[0].start = OMAP4_MCSPI1_BASE;
389 omap2_mcspi1_resources[0].end = OMAP4_MCSPI1_BASE + 0xff;
390 omap2_mcspi2_resources[0].start = OMAP4_MCSPI2_BASE;
391 omap2_mcspi2_resources[0].end = OMAP4_MCSPI2_BASE + 0xff;
392 omap2_mcspi3_resources[0].start = OMAP4_MCSPI3_BASE;
393 omap2_mcspi3_resources[0].end = OMAP4_MCSPI3_BASE + 0xff;
394 omap2_mcspi4_resources[0].start = OMAP4_MCSPI4_BASE;
395 omap2_mcspi4_resources[0].end = OMAP4_MCSPI4_BASE + 0xff;
396}
397#else
398static inline void omap4_mcspi_fixup(void)
399{ 345{
400} 346 struct omap_device *od;
401#endif 347 char *name = "omap2_mcspi";
348 struct omap2_mcspi_platform_config *pdata;
349 static int spi_num;
350 struct omap2_mcspi_dev_attr *mcspi_attrib = oh->dev_attr;
351
352 pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
353 if (!pdata) {
354 pr_err("Memory allocation for McSPI device failed\n");
355 return -ENOMEM;
356 }
402 357
403#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \ 358 pdata->num_cs = mcspi_attrib->num_chipselect;
404 defined(CONFIG_ARCH_OMAP4) 359 switch (oh->class->rev) {
405static inline void omap2_mcspi3_init(void) 360 case OMAP2_MCSPI_REV:
406{ 361 case OMAP3_MCSPI_REV:
407 platform_device_register(&omap2_mcspi3); 362 pdata->regs_offset = 0;
408} 363 break;
409#else 364 case OMAP4_MCSPI_REV:
410static inline void omap2_mcspi3_init(void) 365 pdata->regs_offset = OMAP4_MCSPI_REG_OFFSET;
411{ 366 break;
412} 367 default:
413#endif 368 pr_err("Invalid McSPI Revision value\n");
369 return -EINVAL;
370 }
414 371
415#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) 372 spi_num++;
416static inline void omap2_mcspi4_init(void) 373 od = omap_device_build(name, spi_num, oh, pdata,
417{ 374 sizeof(*pdata), omap_mcspi_latency,
418 platform_device_register(&omap2_mcspi4); 375 ARRAY_SIZE(omap_mcspi_latency), 0);
419} 376 WARN(IS_ERR(od), "Cant build omap_device for %s:%s\n",
420#else 377 name, oh->name);
421static inline void omap2_mcspi4_init(void) 378 kfree(pdata);
422{ 379 return 0;
423} 380}
424#endif
425 381
426static void omap_init_mcspi(void) 382static void omap_init_mcspi(void)
427{ 383{
428 if (cpu_is_omap44xx()) 384 omap_hwmod_for_each_by_class("mcspi", omap_mcspi_init, NULL);
429 omap4_mcspi_fixup();
430
431 platform_device_register(&omap2_mcspi1);
432 platform_device_register(&omap2_mcspi2);
433
434 if (cpu_is_omap2430() || cpu_is_omap343x() || cpu_is_omap44xx())
435 omap2_mcspi3_init();
436
437 if (cpu_is_omap343x() || cpu_is_omap44xx())
438 omap2_mcspi4_init();
439} 385}
440 386
441#else 387#else
@@ -610,117 +556,10 @@ static inline void omap_init_aes(void) { }
610 556
611/*-------------------------------------------------------------------------*/ 557/*-------------------------------------------------------------------------*/
612 558
613#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) 559#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
614
615#define MMCHS_SYSCONFIG 0x0010
616#define MMCHS_SYSCONFIG_SWRESET (1 << 1)
617#define MMCHS_SYSSTATUS 0x0014
618#define MMCHS_SYSSTATUS_RESETDONE (1 << 0)
619
620static struct platform_device dummy_pdev = {
621 .dev = {
622 .bus = &platform_bus_type,
623 },
624};
625
626/**
627 * omap_hsmmc_reset() - Full reset of each HS-MMC controller
628 *
629 * Ensure that each MMC controller is fully reset. Controllers
630 * left in an unknown state (by bootloader) may prevent retention
631 * or OFF-mode. This is especially important in cases where the
632 * MMC driver is not enabled, _or_ built as a module.
633 *
634 * In order for reset to work, interface, functional and debounce
635 * clocks must be enabled. The debounce clock comes from func_32k_clk
636 * and is not under SW control, so we only enable i- and f-clocks.
637 **/
638static void __init omap_hsmmc_reset(void)
639{
640 u32 i, nr_controllers;
641 struct clk *iclk, *fclk;
642
643 if (cpu_is_omap242x())
644 return;
645
646 nr_controllers = cpu_is_omap44xx() ? OMAP44XX_NR_MMC :
647 (cpu_is_omap34xx() ? OMAP34XX_NR_MMC : OMAP24XX_NR_MMC);
648
649 for (i = 0; i < nr_controllers; i++) {
650 u32 v, base = 0;
651 struct device *dev = &dummy_pdev.dev;
652
653 switch (i) {
654 case 0:
655 base = OMAP2_MMC1_BASE;
656 break;
657 case 1:
658 base = OMAP2_MMC2_BASE;
659 break;
660 case 2:
661 base = OMAP3_MMC3_BASE;
662 break;
663 case 3:
664 if (!cpu_is_omap44xx())
665 return;
666 base = OMAP4_MMC4_BASE;
667 break;
668 case 4:
669 if (!cpu_is_omap44xx())
670 return;
671 base = OMAP4_MMC5_BASE;
672 break;
673 }
674
675 if (cpu_is_omap44xx())
676 base += OMAP4_MMC_REG_OFFSET;
677
678 dummy_pdev.id = i;
679 dev_set_name(&dummy_pdev.dev, "mmci-omap-hs.%d", i);
680 iclk = clk_get(dev, "ick");
681 if (IS_ERR(iclk))
682 goto err1;
683 if (clk_enable(iclk))
684 goto err2;
685
686 fclk = clk_get(dev, "fck");
687 if (IS_ERR(fclk))
688 goto err3;
689 if (clk_enable(fclk))
690 goto err4;
691
692 omap_writel(MMCHS_SYSCONFIG_SWRESET, base + MMCHS_SYSCONFIG);
693 v = omap_readl(base + MMCHS_SYSSTATUS);
694 while (!(omap_readl(base + MMCHS_SYSSTATUS) &
695 MMCHS_SYSSTATUS_RESETDONE))
696 cpu_relax();
697
698 clk_disable(fclk);
699 clk_put(fclk);
700 clk_disable(iclk);
701 clk_put(iclk);
702 }
703 return;
704
705err4:
706 clk_put(fclk);
707err3:
708 clk_disable(iclk);
709err2:
710 clk_put(iclk);
711err1:
712 printk(KERN_WARNING "%s: Unable to enable clocks for MMC%d, "
713 "cannot reset.\n", __func__, i);
714}
715#else
716static inline void omap_hsmmc_reset(void) {}
717#endif
718
719#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \
720 defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
721 560
722static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller, 561static inline void omap242x_mmc_mux(struct omap_mmc_platform_data
723 int controller_nr) 562 *mmc_controller)
724{ 563{
725 if ((mmc_controller->slots[0].switch_pin > 0) && \ 564 if ((mmc_controller->slots[0].switch_pin > 0) && \
726 (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES)) 565 (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES))
@@ -731,163 +570,44 @@ static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
731 omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp, 570 omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp,
732 OMAP_PIN_INPUT_PULLUP); 571 OMAP_PIN_INPUT_PULLUP);
733 572
734 if (cpu_is_omap2420() && controller_nr == 0) { 573 omap_mux_init_signal("sdmmc_cmd", 0);
735 omap_mux_init_signal("sdmmc_cmd", 0); 574 omap_mux_init_signal("sdmmc_clki", 0);
736 omap_mux_init_signal("sdmmc_clki", 0); 575 omap_mux_init_signal("sdmmc_clko", 0);
737 omap_mux_init_signal("sdmmc_clko", 0); 576 omap_mux_init_signal("sdmmc_dat0", 0);
738 omap_mux_init_signal("sdmmc_dat0", 0); 577 omap_mux_init_signal("sdmmc_dat_dir0", 0);
739 omap_mux_init_signal("sdmmc_dat_dir0", 0); 578 omap_mux_init_signal("sdmmc_cmd_dir", 0);
740 omap_mux_init_signal("sdmmc_cmd_dir", 0); 579 if (mmc_controller->slots[0].caps & MMC_CAP_4_BIT_DATA) {
741 if (mmc_controller->slots[0].caps & MMC_CAP_4_BIT_DATA) { 580 omap_mux_init_signal("sdmmc_dat1", 0);
742 omap_mux_init_signal("sdmmc_dat1", 0); 581 omap_mux_init_signal("sdmmc_dat2", 0);
743 omap_mux_init_signal("sdmmc_dat2", 0); 582 omap_mux_init_signal("sdmmc_dat3", 0);
744 omap_mux_init_signal("sdmmc_dat3", 0); 583 omap_mux_init_signal("sdmmc_dat_dir1", 0);
745 omap_mux_init_signal("sdmmc_dat_dir1", 0); 584 omap_mux_init_signal("sdmmc_dat_dir2", 0);
746 omap_mux_init_signal("sdmmc_dat_dir2", 0); 585 omap_mux_init_signal("sdmmc_dat_dir3", 0);
747 omap_mux_init_signal("sdmmc_dat_dir3", 0);
748 }
749
750 /*
751 * Use internal loop-back in MMC/SDIO Module Input Clock
752 * selection
753 */
754 if (mmc_controller->slots[0].internal_clock) {
755 u32 v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
756 v |= (1 << 24);
757 omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0);
758 }
759 } 586 }
760 587
761 if (cpu_is_omap34xx()) { 588 /*
762 if (controller_nr == 0) { 589 * Use internal loop-back in MMC/SDIO Module Input Clock
763 omap_mux_init_signal("sdmmc1_clk", 590 * selection
764 OMAP_PIN_INPUT_PULLUP); 591 */
765 omap_mux_init_signal("sdmmc1_cmd", 592 if (mmc_controller->slots[0].internal_clock) {
766 OMAP_PIN_INPUT_PULLUP); 593 u32 v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
767 omap_mux_init_signal("sdmmc1_dat0", 594 v |= (1 << 24);
768 OMAP_PIN_INPUT_PULLUP); 595 omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0);
769 if (mmc_controller->slots[0].caps &
770 (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) {
771 omap_mux_init_signal("sdmmc1_dat1",
772 OMAP_PIN_INPUT_PULLUP);
773 omap_mux_init_signal("sdmmc1_dat2",
774 OMAP_PIN_INPUT_PULLUP);
775 omap_mux_init_signal("sdmmc1_dat3",
776 OMAP_PIN_INPUT_PULLUP);
777 }
778 if (mmc_controller->slots[0].caps &
779 MMC_CAP_8_BIT_DATA) {
780 omap_mux_init_signal("sdmmc1_dat4",
781 OMAP_PIN_INPUT_PULLUP);
782 omap_mux_init_signal("sdmmc1_dat5",
783 OMAP_PIN_INPUT_PULLUP);
784 omap_mux_init_signal("sdmmc1_dat6",
785 OMAP_PIN_INPUT_PULLUP);
786 omap_mux_init_signal("sdmmc1_dat7",
787 OMAP_PIN_INPUT_PULLUP);
788 }
789 }
790 if (controller_nr == 1) {
791 /* MMC2 */
792 omap_mux_init_signal("sdmmc2_clk",
793 OMAP_PIN_INPUT_PULLUP);
794 omap_mux_init_signal("sdmmc2_cmd",
795 OMAP_PIN_INPUT_PULLUP);
796 omap_mux_init_signal("sdmmc2_dat0",
797 OMAP_PIN_INPUT_PULLUP);
798
799 /*
800 * For 8 wire configurations, Lines DAT4, 5, 6 and 7 need to be muxed
801 * in the board-*.c files
802 */
803 if (mmc_controller->slots[0].caps &
804 (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) {
805 omap_mux_init_signal("sdmmc2_dat1",
806 OMAP_PIN_INPUT_PULLUP);
807 omap_mux_init_signal("sdmmc2_dat2",
808 OMAP_PIN_INPUT_PULLUP);
809 omap_mux_init_signal("sdmmc2_dat3",
810 OMAP_PIN_INPUT_PULLUP);
811 }
812 if (mmc_controller->slots[0].caps &
813 MMC_CAP_8_BIT_DATA) {
814 omap_mux_init_signal("sdmmc2_dat4.sdmmc2_dat4",
815 OMAP_PIN_INPUT_PULLUP);
816 omap_mux_init_signal("sdmmc2_dat5.sdmmc2_dat5",
817 OMAP_PIN_INPUT_PULLUP);
818 omap_mux_init_signal("sdmmc2_dat6.sdmmc2_dat6",
819 OMAP_PIN_INPUT_PULLUP);
820 omap_mux_init_signal("sdmmc2_dat7.sdmmc2_dat7",
821 OMAP_PIN_INPUT_PULLUP);
822 }
823 }
824
825 /*
826 * For MMC3 the pins need to be muxed in the board-*.c files
827 */
828 } 596 }
829} 597}
830 598
831void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, 599void __init omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data)
832 int nr_controllers)
833{ 600{
834 int i; 601 char *name = "mmci-omap";
835 char *name;
836
837 for (i = 0; i < nr_controllers; i++) {
838 unsigned long base, size;
839 unsigned int irq = 0;
840
841 if (!mmc_data[i])
842 continue;
843 602
844 omap2_mmc_mux(mmc_data[i], i); 603 if (!mmc_data[0]) {
604 pr_err("%s fails: Incomplete platform data\n", __func__);
605 return;
606 }
845 607
846 switch (i) { 608 omap242x_mmc_mux(mmc_data[0]);
847 case 0: 609 omap_mmc_add(name, 0, OMAP2_MMC1_BASE, OMAP2420_MMC_SIZE,
848 base = OMAP2_MMC1_BASE; 610 INT_24XX_MMC_IRQ, mmc_data[0]);
849 irq = INT_24XX_MMC_IRQ;
850 break;
851 case 1:
852 base = OMAP2_MMC2_BASE;
853 irq = INT_24XX_MMC2_IRQ;
854 break;
855 case 2:
856 if (!cpu_is_omap44xx() && !cpu_is_omap34xx())
857 return;
858 base = OMAP3_MMC3_BASE;
859 irq = INT_34XX_MMC3_IRQ;
860 break;
861 case 3:
862 if (!cpu_is_omap44xx())
863 return;
864 base = OMAP4_MMC4_BASE;
865 irq = OMAP44XX_IRQ_MMC4;
866 break;
867 case 4:
868 if (!cpu_is_omap44xx())
869 return;
870 base = OMAP4_MMC5_BASE;
871 irq = OMAP44XX_IRQ_MMC5;
872 break;
873 default:
874 continue;
875 }
876
877 if (cpu_is_omap2420()) {
878 size = OMAP2420_MMC_SIZE;
879 name = "mmci-omap";
880 } else if (cpu_is_omap44xx()) {
881 if (i < 3)
882 irq += OMAP44XX_IRQ_GIC_START;
883 size = OMAP4_HSMMC_SIZE;
884 name = "mmci-omap-hs";
885 } else {
886 size = OMAP3_HSMMC_SIZE;
887 name = "mmci-omap-hs";
888 }
889 omap_mmc_add(name, i, base, size, irq, mmc_data[i]);
890 };
891} 611}
892 612
893#endif 613#endif
@@ -895,7 +615,7 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data,
895/*-------------------------------------------------------------------------*/ 615/*-------------------------------------------------------------------------*/
896 616
897#if defined(CONFIG_HDQ_MASTER_OMAP) || defined(CONFIG_HDQ_MASTER_OMAP_MODULE) 617#if defined(CONFIG_HDQ_MASTER_OMAP) || defined(CONFIG_HDQ_MASTER_OMAP_MODULE)
898#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430) 618#if defined(CONFIG_SOC_OMAP2430) || defined(CONFIG_SOC_OMAP3430)
899#define OMAP_HDQ_BASE 0x480B2000 619#define OMAP_HDQ_BASE 0x480B2000
900#endif 620#endif
901static struct resource omap_hdq_resources[] = { 621static struct resource omap_hdq_resources[] = {
@@ -961,7 +681,6 @@ static int __init omap2_init_devices(void)
961 * please keep these calls, and their implementations above, 681 * please keep these calls, and their implementations above,
962 * in alphabetical order so they're easier to sort through. 682 * in alphabetical order so they're easier to sort through.
963 */ 683 */
964 omap_hsmmc_reset();
965 omap_init_audio(); 684 omap_init_audio();
966 omap_init_camera(); 685 omap_init_camera();
967 omap_init_mbox(); 686 omap_init_mbox();
diff --git a/arch/arm/mach-omap2/devices.h b/arch/arm/mach-omap2/devices.h
new file mode 100644
index 000000000000..f61eb6e5d136
--- /dev/null
+++ b/arch/arm/mach-omap2/devices.h
@@ -0,0 +1,19 @@
1/*
2 * arch/arm/mach-omap2/devices.h
3 *
4 * OMAP2 platform device setup/initialization
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef __ARCH_ARM_MACH_OMAP_DEVICES_H
13#define __ARCH_ARM_MACH_OMAP_DEVICES_H
14
15struct isp_platform_data;
16
17int omap3_init_camera(struct isp_platform_data *pdata);
18
19#endif
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
new file mode 100644
index 000000000000..256d23fb79ab
--- /dev/null
+++ b/arch/arm/mach-omap2/display.c
@@ -0,0 +1,125 @@
1/*
2 * OMAP2plus display device setup / initialization.
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 * Senthilvadivu Guruswamy
6 * Sumit Semwal
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
13 * kind, whether express or implied; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/platform_device.h>
21#include <linux/io.h>
22#include <linux/clk.h>
23#include <linux/err.h>
24
25#include <plat/display.h>
26#include <plat/omap_hwmod.h>
27#include <plat/omap_device.h>
28
29static struct platform_device omap_display_device = {
30 .name = "omapdss",
31 .id = -1,
32 .dev = {
33 .platform_data = NULL,
34 },
35};
36
37static struct omap_device_pm_latency omap_dss_latency[] = {
38 [0] = {
39 .deactivate_func = omap_device_idle_hwmods,
40 .activate_func = omap_device_enable_hwmods,
41 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
42 },
43};
44
45/* oh_core is used for getting opt-clocks */
46static struct omap_hwmod *oh_core;
47
48static bool opt_clock_available(const char *clk_role)
49{
50 int i;
51
52 for (i = 0; i < oh_core->opt_clks_cnt; i++) {
53 if (!strcmp(oh_core->opt_clks[i].role, clk_role))
54 return true;
55 }
56 return false;
57}
58
59int __init omap_display_init(struct omap_dss_board_info *board_data)
60{
61 int r = 0;
62 struct omap_hwmod *oh;
63 struct omap_device *od;
64 int i;
65 struct omap_display_platform_data pdata;
66
67 /*
68 * omap: valid DSS hwmod names
69 * omap2,3,4: dss_core, dss_dispc, dss_rfbi, dss_venc
70 * omap3,4: dss_dsi1
71 * omap4: dss_dsi2, dss_hdmi
72 */
73 char *oh_name[] = { "dss_core", "dss_dispc", "dss_rfbi", "dss_venc",
74 "dss_dsi1", "dss_dsi2", "dss_hdmi" };
75 char *dev_name[] = { "omapdss_dss", "omapdss_dispc", "omapdss_rfbi",
76 "omapdss_venc", "omapdss_dsi1", "omapdss_dsi2",
77 "omapdss_hdmi" };
78 int oh_count;
79
80 memset(&pdata, 0, sizeof(pdata));
81
82 if (cpu_is_omap24xx())
83 oh_count = ARRAY_SIZE(oh_name) - 3;
84 /* last 3 hwmod dev in oh_name are not available for omap2 */
85 else if (cpu_is_omap44xx())
86 oh_count = ARRAY_SIZE(oh_name);
87 else
88 oh_count = ARRAY_SIZE(oh_name) - 2;
89 /* last 2 hwmod dev in oh_name are not available for omap3 */
90
91 /* opt_clks are always associated with dss hwmod */
92 oh_core = omap_hwmod_lookup("dss_core");
93 if (!oh_core) {
94 pr_err("Could not look up dss_core.\n");
95 return -ENODEV;
96 }
97
98 pdata.board_data = board_data;
99 pdata.board_data->get_last_off_on_transaction_id = NULL;
100 pdata.opt_clock_available = opt_clock_available;
101
102 for (i = 0; i < oh_count; i++) {
103 oh = omap_hwmod_lookup(oh_name[i]);
104 if (!oh) {
105 pr_err("Could not look up %s\n", oh_name[i]);
106 return -ENODEV;
107 }
108
109 od = omap_device_build(dev_name[i], -1, oh, &pdata,
110 sizeof(struct omap_display_platform_data),
111 omap_dss_latency,
112 ARRAY_SIZE(omap_dss_latency), 0);
113
114 if (WARN((IS_ERR(od)), "Could not build omap_device for %s\n",
115 oh_name[i]))
116 return -ENODEV;
117 }
118 omap_display_device.dev.platform_data = board_data;
119
120 r = platform_device_register(&omap_display_device);
121 if (r < 0)
122 printk(KERN_ERR "Unable to register OMAP-Display device\n");
123
124 return r;
125}
diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
index d2f15f5cfd36..34922b2d2e3f 100644
--- a/arch/arm/mach-omap2/dma.c
+++ b/arch/arm/mach-omap2/dma.c
@@ -264,7 +264,7 @@ static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)
264 if (IS_ERR(od)) { 264 if (IS_ERR(od)) {
265 pr_err("%s: Cant build omap_device for %s:%s.\n", 265 pr_err("%s: Cant build omap_device for %s:%s.\n",
266 __func__, name, oh->name); 266 __func__, name, oh->name);
267 return IS_ERR(od); 267 return PTR_ERR(od);
268 } 268 }
269 269
270 mem = platform_get_resource(&od->pdev, IORESOURCE_MEM, 0); 270 mem = platform_get_resource(&od->pdev, IORESOURCE_MEM, 0);
diff --git a/arch/arm/mach-omap2/dpll44xx.c b/arch/arm/mach-omap2/dpll44xx.c
new file mode 100644
index 000000000000..4e4da6160d05
--- /dev/null
+++ b/arch/arm/mach-omap2/dpll44xx.c
@@ -0,0 +1,84 @@
1/*
2 * OMAP4-specific DPLL control functions
3 *
4 * Copyright (C) 2011 Texas Instruments, Inc.
5 * Rajendra Nayak
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/errno.h>
14#include <linux/clk.h>
15#include <linux/io.h>
16#include <linux/bitops.h>
17
18#include <plat/cpu.h>
19#include <plat/clock.h>
20
21#include "clock.h"
22#include "cm-regbits-44xx.h"
23
24/* Supported only on OMAP4 */
25int omap4_dpllmx_gatectrl_read(struct clk *clk)
26{
27 u32 v;
28 u32 mask;
29
30 if (!clk || !clk->clksel_reg || !cpu_is_omap44xx())
31 return -EINVAL;
32
33 mask = clk->flags & CLOCK_CLKOUTX2 ?
34 OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK :
35 OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK;
36
37 v = __raw_readl(clk->clksel_reg);
38 v &= mask;
39 v >>= __ffs(mask);
40
41 return v;
42}
43
44void omap4_dpllmx_allow_gatectrl(struct clk *clk)
45{
46 u32 v;
47 u32 mask;
48
49 if (!clk || !clk->clksel_reg || !cpu_is_omap44xx())
50 return;
51
52 mask = clk->flags & CLOCK_CLKOUTX2 ?
53 OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK :
54 OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK;
55
56 v = __raw_readl(clk->clksel_reg);
57 /* Clear the bit to allow gatectrl */
58 v &= ~mask;
59 __raw_writel(v, clk->clksel_reg);
60}
61
62void omap4_dpllmx_deny_gatectrl(struct clk *clk)
63{
64 u32 v;
65 u32 mask;
66
67 if (!clk || !clk->clksel_reg || !cpu_is_omap44xx())
68 return;
69
70 mask = clk->flags & CLOCK_CLKOUTX2 ?
71 OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK :
72 OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK;
73
74 v = __raw_readl(clk->clksel_reg);
75 /* Set the bit to deny gatectrl */
76 v |= mask;
77 __raw_writel(v, clk->clksel_reg);
78}
79
80const struct clkops clkops_omap4_dpllmx_ops = {
81 .allow_idle = omap4_dpllmx_allow_gatectrl,
82 .deny_idle = omap4_dpllmx_deny_gatectrl,
83};
84
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index 2bb29c160702..c1791d08ae56 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -12,6 +12,7 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/mtd/nand.h>
15 16
16#include <asm/mach/flash.h> 17#include <asm/mach/flash.h>
17 18
@@ -69,8 +70,10 @@ static int omap2_nand_gpmc_retime(void)
69 t.wr_cycle = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->wr_cycle); 70 t.wr_cycle = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->wr_cycle);
70 71
71 /* Configure GPMC */ 72 /* Configure GPMC */
72 gpmc_cs_configure(gpmc_nand_data->cs, 73 if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16)
73 GPMC_CONFIG_DEV_SIZE, gpmc_nand_data->devsize); 74 gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 1);
75 else
76 gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 0);
74 gpmc_cs_configure(gpmc_nand_data->cs, 77 gpmc_cs_configure(gpmc_nand_data->cs,
75 GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND); 78 GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND);
76 err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t); 79 err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t);
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c
index 3a7d25fb00ef..d776ded9830d 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -94,7 +94,7 @@ static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base)
94} 94}
95 95
96static void set_onenand_cfg(void __iomem *onenand_base, int latency, 96static void set_onenand_cfg(void __iomem *onenand_base, int latency,
97 int sync_read, int sync_write, int hf) 97 int sync_read, int sync_write, int hf, int vhf)
98{ 98{
99 u32 reg; 99 u32 reg;
100 100
@@ -114,12 +114,57 @@ static void set_onenand_cfg(void __iomem *onenand_base, int latency,
114 reg |= ONENAND_SYS_CFG1_HF; 114 reg |= ONENAND_SYS_CFG1_HF;
115 else 115 else
116 reg &= ~ONENAND_SYS_CFG1_HF; 116 reg &= ~ONENAND_SYS_CFG1_HF;
117 if (vhf)
118 reg |= ONENAND_SYS_CFG1_VHF;
119 else
120 reg &= ~ONENAND_SYS_CFG1_VHF;
117 writew(reg, onenand_base + ONENAND_REG_SYS_CFG1); 121 writew(reg, onenand_base + ONENAND_REG_SYS_CFG1);
118} 122}
119 123
124static int omap2_onenand_get_freq(struct omap_onenand_platform_data *cfg,
125 void __iomem *onenand_base, bool *clk_dep)
126{
127 u16 ver = readw(onenand_base + ONENAND_REG_VERSION_ID);
128 int freq = 0;
129
130 if (cfg->get_freq) {
131 struct onenand_freq_info fi;
132
133 fi.maf_id = readw(onenand_base + ONENAND_REG_MANUFACTURER_ID);
134 fi.dev_id = readw(onenand_base + ONENAND_REG_DEVICE_ID);
135 fi.ver_id = ver;
136 freq = cfg->get_freq(&fi, clk_dep);
137 if (freq)
138 return freq;
139 }
140
141 switch ((ver >> 4) & 0xf) {
142 case 0:
143 freq = 40;
144 break;
145 case 1:
146 freq = 54;
147 break;
148 case 2:
149 freq = 66;
150 break;
151 case 3:
152 freq = 83;
153 break;
154 case 4:
155 freq = 104;
156 break;
157 default:
158 freq = 54;
159 break;
160 }
161
162 return freq;
163}
164
120static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, 165static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
121 void __iomem *onenand_base, 166 void __iomem *onenand_base,
122 int freq) 167 int *freq_ptr)
123{ 168{
124 struct gpmc_timings t; 169 struct gpmc_timings t;
125 const int t_cer = 15; 170 const int t_cer = 15;
@@ -130,10 +175,11 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
130 const int t_wph = 30; 175 const int t_wph = 30;
131 int min_gpmc_clk_period, t_ces, t_avds, t_avdh, t_ach, t_aavdh, t_rdyo; 176 int min_gpmc_clk_period, t_ces, t_avds, t_avdh, t_ach, t_aavdh, t_rdyo;
132 int tick_ns, div, fclk_offset_ns, fclk_offset, gpmc_clk_ns, latency; 177 int tick_ns, div, fclk_offset_ns, fclk_offset, gpmc_clk_ns, latency;
133 int first_time = 0, hf = 0, sync_read = 0, sync_write = 0; 178 int first_time = 0, hf = 0, vhf = 0, sync_read = 0, sync_write = 0;
134 int err, ticks_cez; 179 int err, ticks_cez;
135 int cs = cfg->cs; 180 int cs = cfg->cs, freq = *freq_ptr;
136 u32 reg; 181 u32 reg;
182 bool clk_dep = false;
137 183
138 if (cfg->flags & ONENAND_SYNC_READ) { 184 if (cfg->flags & ONENAND_SYNC_READ) {
139 sync_read = 1; 185 sync_read = 1;
@@ -148,27 +194,7 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
148 err = omap2_onenand_set_async_mode(cs, onenand_base); 194 err = omap2_onenand_set_async_mode(cs, onenand_base);
149 if (err) 195 if (err)
150 return err; 196 return err;
151 reg = readw(onenand_base + ONENAND_REG_VERSION_ID); 197 freq = omap2_onenand_get_freq(cfg, onenand_base, &clk_dep);
152 switch ((reg >> 4) & 0xf) {
153 case 0:
154 freq = 40;
155 break;
156 case 1:
157 freq = 54;
158 break;
159 case 2:
160 freq = 66;
161 break;
162 case 3:
163 freq = 83;
164 break;
165 case 4:
166 freq = 104;
167 break;
168 default:
169 freq = 54;
170 break;
171 }
172 first_time = 1; 198 first_time = 1;
173 } 199 }
174 200
@@ -180,7 +206,7 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
180 t_avdh = 2; 206 t_avdh = 2;
181 t_ach = 3; 207 t_ach = 3;
182 t_aavdh = 6; 208 t_aavdh = 6;
183 t_rdyo = 9; 209 t_rdyo = 6;
184 break; 210 break;
185 case 83: 211 case 83:
186 min_gpmc_clk_period = 12000; /* 83 MHz */ 212 min_gpmc_clk_period = 12000; /* 83 MHz */
@@ -217,16 +243,36 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
217 gpmc_clk_ns = gpmc_ticks_to_ns(div); 243 gpmc_clk_ns = gpmc_ticks_to_ns(div);
218 if (gpmc_clk_ns < 15) /* >66Mhz */ 244 if (gpmc_clk_ns < 15) /* >66Mhz */
219 hf = 1; 245 hf = 1;
220 if (hf) 246 if (gpmc_clk_ns < 12) /* >83Mhz */
247 vhf = 1;
248 if (vhf)
249 latency = 8;
250 else if (hf)
221 latency = 6; 251 latency = 6;
222 else if (gpmc_clk_ns >= 25) /* 40 MHz*/ 252 else if (gpmc_clk_ns >= 25) /* 40 MHz*/
223 latency = 3; 253 latency = 3;
224 else 254 else
225 latency = 4; 255 latency = 4;
226 256
257 if (clk_dep) {
258 if (gpmc_clk_ns < 12) { /* >83Mhz */
259 t_ces = 3;
260 t_avds = 4;
261 } else if (gpmc_clk_ns < 15) { /* >66Mhz */
262 t_ces = 5;
263 t_avds = 4;
264 } else if (gpmc_clk_ns < 25) { /* >40Mhz */
265 t_ces = 6;
266 t_avds = 5;
267 } else {
268 t_ces = 7;
269 t_avds = 7;
270 }
271 }
272
227 if (first_time) 273 if (first_time)
228 set_onenand_cfg(onenand_base, latency, 274 set_onenand_cfg(onenand_base, latency,
229 sync_read, sync_write, hf); 275 sync_read, sync_write, hf, vhf);
230 276
231 if (div == 1) { 277 if (div == 1) {
232 reg = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG2); 278 reg = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG2);
@@ -264,6 +310,9 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
264 /* Read */ 310 /* Read */
265 t.adv_rd_off = gpmc_ticks_to_ns(fclk_offset + gpmc_ns_to_ticks(t_avdh)); 311 t.adv_rd_off = gpmc_ticks_to_ns(fclk_offset + gpmc_ns_to_ticks(t_avdh));
266 t.oe_on = gpmc_ticks_to_ns(fclk_offset + gpmc_ns_to_ticks(t_ach)); 312 t.oe_on = gpmc_ticks_to_ns(fclk_offset + gpmc_ns_to_ticks(t_ach));
313 /* Force at least 1 clk between AVD High to OE Low */
314 if (t.oe_on <= t.adv_rd_off)
315 t.oe_on = t.adv_rd_off + gpmc_round_ns_to_ticks(1);
267 t.access = gpmc_ticks_to_ns(fclk_offset + (latency + 1) * div); 316 t.access = gpmc_ticks_to_ns(fclk_offset + (latency + 1) * div);
268 t.oe_off = t.access + gpmc_round_ns_to_ticks(1); 317 t.oe_off = t.access + gpmc_round_ns_to_ticks(1);
269 t.cs_rd_off = t.oe_off; 318 t.cs_rd_off = t.oe_off;
@@ -317,18 +366,20 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
317 if (err) 366 if (err)
318 return err; 367 return err;
319 368
320 set_onenand_cfg(onenand_base, latency, sync_read, sync_write, hf); 369 set_onenand_cfg(onenand_base, latency, sync_read, sync_write, hf, vhf);
370
371 *freq_ptr = freq;
321 372
322 return 0; 373 return 0;
323} 374}
324 375
325static int gpmc_onenand_setup(void __iomem *onenand_base, int freq) 376static int gpmc_onenand_setup(void __iomem *onenand_base, int *freq_ptr)
326{ 377{
327 struct device *dev = &gpmc_onenand_device.dev; 378 struct device *dev = &gpmc_onenand_device.dev;
328 379
329 /* Set sync timings in GPMC */ 380 /* Set sync timings in GPMC */
330 if (omap2_onenand_set_sync_mode(gpmc_onenand_data, onenand_base, 381 if (omap2_onenand_set_sync_mode(gpmc_onenand_data, onenand_base,
331 freq) < 0) { 382 freq_ptr) < 0) {
332 dev_err(dev, "Unable to set synchronous mode\n"); 383 dev_err(dev, "Unable to set synchronous mode\n");
333 return -EINVAL; 384 return -EINVAL;
334 } 385 }
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 1b7b3e7d02f7..674174365f78 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -14,6 +14,7 @@
14 */ 14 */
15#undef DEBUG 15#undef DEBUG
16 16
17#include <linux/irq.h>
17#include <linux/kernel.h> 18#include <linux/kernel.h>
18#include <linux/init.h> 19#include <linux/init.h>
19#include <linux/err.h> 20#include <linux/err.h>
@@ -22,6 +23,7 @@
22#include <linux/spinlock.h> 23#include <linux/spinlock.h>
23#include <linux/io.h> 24#include <linux/io.h>
24#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/interrupt.h>
25 27
26#include <asm/mach-types.h> 28#include <asm/mach-types.h>
27#include <plat/gpmc.h> 29#include <plat/gpmc.h>
@@ -58,7 +60,6 @@
58#define GPMC_CHUNK_SHIFT 24 /* 16 MB */ 60#define GPMC_CHUNK_SHIFT 24 /* 16 MB */
59#define GPMC_SECTION_SHIFT 28 /* 128 MB */ 61#define GPMC_SECTION_SHIFT 28 /* 128 MB */
60 62
61#define PREFETCH_FIFOTHRESHOLD (0x40 << 8)
62#define CS_NUM_SHIFT 24 63#define CS_NUM_SHIFT 24
63#define ENABLE_PREFETCH (0x1 << 7) 64#define ENABLE_PREFETCH (0x1 << 7)
64#define DMA_MPU_MODE 2 65#define DMA_MPU_MODE 2
@@ -100,6 +101,8 @@ static void __iomem *gpmc_base;
100 101
101static struct clk *gpmc_l3_clk; 102static struct clk *gpmc_l3_clk;
102 103
104static irqreturn_t gpmc_handle_irq(int irq, void *dev);
105
103static void gpmc_write_reg(int idx, u32 val) 106static void gpmc_write_reg(int idx, u32 val)
104{ 107{
105 __raw_writel(val, gpmc_base + idx); 108 __raw_writel(val, gpmc_base + idx);
@@ -497,6 +500,10 @@ int gpmc_cs_configure(int cs, int cmd, int wval)
497 u32 regval = 0; 500 u32 regval = 0;
498 501
499 switch (cmd) { 502 switch (cmd) {
503 case GPMC_ENABLE_IRQ:
504 gpmc_write_reg(GPMC_IRQENABLE, wval);
505 break;
506
500 case GPMC_SET_IRQ_STATUS: 507 case GPMC_SET_IRQ_STATUS:
501 gpmc_write_reg(GPMC_IRQSTATUS, wval); 508 gpmc_write_reg(GPMC_IRQSTATUS, wval);
502 break; 509 break;
@@ -598,15 +605,19 @@ EXPORT_SYMBOL(gpmc_nand_write);
598/** 605/**
599 * gpmc_prefetch_enable - configures and starts prefetch transfer 606 * gpmc_prefetch_enable - configures and starts prefetch transfer
600 * @cs: cs (chip select) number 607 * @cs: cs (chip select) number
608 * @fifo_th: fifo threshold to be used for read/ write
601 * @dma_mode: dma mode enable (1) or disable (0) 609 * @dma_mode: dma mode enable (1) or disable (0)
602 * @u32_count: number of bytes to be transferred 610 * @u32_count: number of bytes to be transferred
603 * @is_write: prefetch read(0) or write post(1) mode 611 * @is_write: prefetch read(0) or write post(1) mode
604 */ 612 */
605int gpmc_prefetch_enable(int cs, int dma_mode, 613int gpmc_prefetch_enable(int cs, int fifo_th, int dma_mode,
606 unsigned int u32_count, int is_write) 614 unsigned int u32_count, int is_write)
607{ 615{
608 616
609 if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) { 617 if (fifo_th > PREFETCH_FIFOTHRESHOLD_MAX) {
618 pr_err("gpmc: fifo threshold is not supported\n");
619 return -1;
620 } else if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) {
610 /* Set the amount of bytes to be prefetched */ 621 /* Set the amount of bytes to be prefetched */
611 gpmc_write_reg(GPMC_PREFETCH_CONFIG2, u32_count); 622 gpmc_write_reg(GPMC_PREFETCH_CONFIG2, u32_count);
612 623
@@ -614,7 +625,7 @@ int gpmc_prefetch_enable(int cs, int dma_mode,
614 * enable the engine. Set which cs is has requested for. 625 * enable the engine. Set which cs is has requested for.
615 */ 626 */
616 gpmc_write_reg(GPMC_PREFETCH_CONFIG1, ((cs << CS_NUM_SHIFT) | 627 gpmc_write_reg(GPMC_PREFETCH_CONFIG1, ((cs << CS_NUM_SHIFT) |
617 PREFETCH_FIFOTHRESHOLD | 628 PREFETCH_FIFOTHRESHOLD(fifo_th) |
618 ENABLE_PREFETCH | 629 ENABLE_PREFETCH |
619 (dma_mode << DMA_MPU_MODE) | 630 (dma_mode << DMA_MPU_MODE) |
620 (0x1 & is_write))); 631 (0x1 & is_write)));
@@ -678,9 +689,10 @@ static void __init gpmc_mem_init(void)
678 } 689 }
679} 690}
680 691
681void __init gpmc_init(void) 692static int __init gpmc_init(void)
682{ 693{
683 u32 l; 694 u32 l, irq;
695 int cs, ret = -EINVAL;
684 char *ck = NULL; 696 char *ck = NULL;
685 697
686 if (cpu_is_omap24xx()) { 698 if (cpu_is_omap24xx()) {
@@ -698,7 +710,7 @@ void __init gpmc_init(void)
698 } 710 }
699 711
700 if (WARN_ON(!ck)) 712 if (WARN_ON(!ck))
701 return; 713 return ret;
702 714
703 gpmc_l3_clk = clk_get(NULL, ck); 715 gpmc_l3_clk = clk_get(NULL, ck);
704 if (IS_ERR(gpmc_l3_clk)) { 716 if (IS_ERR(gpmc_l3_clk)) {
@@ -723,6 +735,36 @@ void __init gpmc_init(void)
723 l |= (0x02 << 3) | (1 << 0); 735 l |= (0x02 << 3) | (1 << 0);
724 gpmc_write_reg(GPMC_SYSCONFIG, l); 736 gpmc_write_reg(GPMC_SYSCONFIG, l);
725 gpmc_mem_init(); 737 gpmc_mem_init();
738
739 /* initalize the irq_chained */
740 irq = OMAP_GPMC_IRQ_BASE;
741 for (cs = 0; cs < GPMC_CS_NUM; cs++) {
742 set_irq_handler(irq, handle_simple_irq);
743 set_irq_flags(irq, IRQF_VALID);
744 irq++;
745 }
746
747 ret = request_irq(INT_34XX_GPMC_IRQ,
748 gpmc_handle_irq, IRQF_SHARED, "gpmc", gpmc_base);
749 if (ret)
750 pr_err("gpmc: irq-%d could not claim: err %d\n",
751 INT_34XX_GPMC_IRQ, ret);
752 return ret;
753}
754postcore_initcall(gpmc_init);
755
756static irqreturn_t gpmc_handle_irq(int irq, void *dev)
757{
758 u8 cs;
759
760 if (irq != INT_34XX_GPMC_IRQ)
761 return IRQ_HANDLED;
762 /* check cs to invoke the irq */
763 cs = ((gpmc_read_reg(GPMC_PREFETCH_CONFIG1)) >> CS_NUM_SHIFT) & 0x7;
764 if (OMAP_GPMC_IRQ_BASE+cs <= OMAP_GPMC_IRQ_END)
765 generic_handle_irq(OMAP_GPMC_IRQ_BASE+cs);
766
767 return IRQ_HANDLED;
726} 768}
727 769
728#ifdef CONFIG_ARCH_OMAP3 770#ifdef CONFIG_ARCH_OMAP3
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 34272e4863fd..137e1a5f3d85 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -16,7 +16,10 @@
16#include <mach/hardware.h> 16#include <mach/hardware.h>
17#include <plat/mmc.h> 17#include <plat/mmc.h>
18#include <plat/omap-pm.h> 18#include <plat/omap-pm.h>
19#include <plat/mux.h>
20#include <plat/omap_device.h>
19 21
22#include "mux.h"
20#include "hsmmc.h" 23#include "hsmmc.h"
21#include "control.h" 24#include "control.h"
22 25
@@ -28,10 +31,6 @@ static u16 control_mmc1;
28 31
29#define HSMMC_NAME_LEN 9 32#define HSMMC_NAME_LEN 9
30 33
31static struct hsmmc_controller {
32 char name[HSMMC_NAME_LEN + 1];
33} hsmmc[OMAP34XX_NR_MMC];
34
35#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) 34#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
36 35
37static int hsmmc_get_context_loss(struct device *dev) 36static int hsmmc_get_context_loss(struct device *dev)
@@ -204,174 +203,312 @@ static int nop_mmc_set_power(struct device *dev, int slot, int power_on,
204 return 0; 203 return 0;
205} 204}
206 205
207static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata; 206static inline void omap_hsmmc_mux(struct omap_mmc_platform_data *mmc_controller,
208 207 int controller_nr)
209void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
210{ 208{
211 struct omap2_hsmmc_info *c; 209 if ((mmc_controller->slots[0].switch_pin > 0) && \
212 int nr_hsmmc = ARRAY_SIZE(hsmmc_data); 210 (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES))
213 int i; 211 omap_mux_init_gpio(mmc_controller->slots[0].switch_pin,
214 u32 reg; 212 OMAP_PIN_INPUT_PULLUP);
215 213 if ((mmc_controller->slots[0].gpio_wp > 0) && \
216 if (!cpu_is_omap44xx()) { 214 (mmc_controller->slots[0].gpio_wp < OMAP_MAX_GPIO_LINES))
217 if (cpu_is_omap2430()) { 215 omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp,
218 control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE; 216 OMAP_PIN_INPUT_PULLUP);
219 control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1; 217 if (cpu_is_omap34xx()) {
220 } else { 218 if (controller_nr == 0) {
221 control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE; 219 omap_mux_init_signal("sdmmc1_clk",
222 control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1; 220 OMAP_PIN_INPUT_PULLUP);
223 } 221 omap_mux_init_signal("sdmmc1_cmd",
224 } else { 222 OMAP_PIN_INPUT_PULLUP);
225 control_pbias_offset = 223 omap_mux_init_signal("sdmmc1_dat0",
226 OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_PBIASLITE; 224 OMAP_PIN_INPUT_PULLUP);
227 control_mmc1 = OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_MMC1; 225 if (mmc_controller->slots[0].caps &
228 reg = omap4_ctrl_pad_readl(control_mmc1); 226 (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) {
229 reg |= (OMAP4_SDMMC1_PUSTRENGTH_GRP0_MASK | 227 omap_mux_init_signal("sdmmc1_dat1",
230 OMAP4_SDMMC1_PUSTRENGTH_GRP1_MASK); 228 OMAP_PIN_INPUT_PULLUP);
231 reg &= ~(OMAP4_SDMMC1_PUSTRENGTH_GRP2_MASK | 229 omap_mux_init_signal("sdmmc1_dat2",
232 OMAP4_SDMMC1_PUSTRENGTH_GRP3_MASK); 230 OMAP_PIN_INPUT_PULLUP);
233 reg |= (OMAP4_USBC1_DR0_SPEEDCTRL_MASK| 231 omap_mux_init_signal("sdmmc1_dat3",
234 OMAP4_SDMMC1_DR1_SPEEDCTRL_MASK | 232 OMAP_PIN_INPUT_PULLUP);
235 OMAP4_SDMMC1_DR2_SPEEDCTRL_MASK); 233 }
236 omap4_ctrl_pad_writel(reg, control_mmc1); 234 if (mmc_controller->slots[0].caps &
237 } 235 MMC_CAP_8_BIT_DATA) {
238 236 omap_mux_init_signal("sdmmc1_dat4",
239 for (c = controllers; c->mmc; c++) { 237 OMAP_PIN_INPUT_PULLUP);
240 struct hsmmc_controller *hc = hsmmc + c->mmc - 1; 238 omap_mux_init_signal("sdmmc1_dat5",
241 struct omap_mmc_platform_data *mmc = hsmmc_data[c->mmc - 1]; 239 OMAP_PIN_INPUT_PULLUP);
242 240 omap_mux_init_signal("sdmmc1_dat6",
243 if (!c->mmc || c->mmc > nr_hsmmc) { 241 OMAP_PIN_INPUT_PULLUP);
244 pr_debug("MMC%d: no such controller\n", c->mmc); 242 omap_mux_init_signal("sdmmc1_dat7",
245 continue; 243 OMAP_PIN_INPUT_PULLUP);
246 } 244 }
247 if (mmc) {
248 pr_debug("MMC%d: already configured\n", c->mmc);
249 continue;
250 } 245 }
251 246 if (controller_nr == 1) {
252 mmc = kzalloc(sizeof(struct omap_mmc_platform_data), 247 /* MMC2 */
253 GFP_KERNEL); 248 omap_mux_init_signal("sdmmc2_clk",
254 if (!mmc) { 249 OMAP_PIN_INPUT_PULLUP);
255 pr_err("Cannot allocate memory for mmc device!\n"); 250 omap_mux_init_signal("sdmmc2_cmd",
256 goto done; 251 OMAP_PIN_INPUT_PULLUP);
252 omap_mux_init_signal("sdmmc2_dat0",
253 OMAP_PIN_INPUT_PULLUP);
254
255 /*
256 * For 8 wire configurations, Lines DAT4, 5, 6 and 7
257 * need to be muxed in the board-*.c files
258 */
259 if (mmc_controller->slots[0].caps &
260 (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) {
261 omap_mux_init_signal("sdmmc2_dat1",
262 OMAP_PIN_INPUT_PULLUP);
263 omap_mux_init_signal("sdmmc2_dat2",
264 OMAP_PIN_INPUT_PULLUP);
265 omap_mux_init_signal("sdmmc2_dat3",
266 OMAP_PIN_INPUT_PULLUP);
267 }
268 if (mmc_controller->slots[0].caps &
269 MMC_CAP_8_BIT_DATA) {
270 omap_mux_init_signal("sdmmc2_dat4.sdmmc2_dat4",
271 OMAP_PIN_INPUT_PULLUP);
272 omap_mux_init_signal("sdmmc2_dat5.sdmmc2_dat5",
273 OMAP_PIN_INPUT_PULLUP);
274 omap_mux_init_signal("sdmmc2_dat6.sdmmc2_dat6",
275 OMAP_PIN_INPUT_PULLUP);
276 omap_mux_init_signal("sdmmc2_dat7.sdmmc2_dat7",
277 OMAP_PIN_INPUT_PULLUP);
278 }
257 } 279 }
258 280
259 if (c->name) 281 /*
260 strncpy(hc->name, c->name, HSMMC_NAME_LEN); 282 * For MMC3 the pins need to be muxed in the board-*.c files
261 else 283 */
262 snprintf(hc->name, ARRAY_SIZE(hc->name), 284 }
263 "mmc%islot%i", c->mmc, 1); 285}
264 mmc->slots[0].name = hc->name;
265 mmc->nr_slots = 1;
266 mmc->slots[0].caps = c->caps;
267 mmc->slots[0].internal_clock = !c->ext_clock;
268 mmc->dma_mask = 0xffffffff;
269 if (cpu_is_omap44xx())
270 mmc->reg_offset = OMAP4_MMC_REG_OFFSET;
271 else
272 mmc->reg_offset = 0;
273 286
274 mmc->get_context_loss_count = hsmmc_get_context_loss; 287static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
288 struct omap_mmc_platform_data *mmc)
289{
290 char *hc_name;
275 291
276 mmc->slots[0].switch_pin = c->gpio_cd; 292 hc_name = kzalloc(sizeof(char) * (HSMMC_NAME_LEN + 1), GFP_KERNEL);
277 mmc->slots[0].gpio_wp = c->gpio_wp; 293 if (!hc_name) {
294 pr_err("Cannot allocate memory for controller slot name\n");
295 kfree(hc_name);
296 return -ENOMEM;
297 }
278 298
279 mmc->slots[0].remux = c->remux; 299 if (c->name)
280 mmc->slots[0].init_card = c->init_card; 300 strncpy(hc_name, c->name, HSMMC_NAME_LEN);
301 else
302 snprintf(hc_name, (HSMMC_NAME_LEN + 1), "mmc%islot%i",
303 c->mmc, 1);
304 mmc->slots[0].name = hc_name;
305 mmc->nr_slots = 1;
306 mmc->slots[0].caps = c->caps;
307 mmc->slots[0].internal_clock = !c->ext_clock;
308 mmc->dma_mask = 0xffffffff;
309 if (cpu_is_omap44xx())
310 mmc->reg_offset = OMAP4_MMC_REG_OFFSET;
311 else
312 mmc->reg_offset = 0;
281 313
282 if (c->cover_only) 314 mmc->get_context_loss_count = hsmmc_get_context_loss;
283 mmc->slots[0].cover = 1;
284 315
285 if (c->nonremovable) 316 mmc->slots[0].switch_pin = c->gpio_cd;
286 mmc->slots[0].nonremovable = 1; 317 mmc->slots[0].gpio_wp = c->gpio_wp;
287 318
288 if (c->power_saving) 319 mmc->slots[0].remux = c->remux;
289 mmc->slots[0].power_saving = 1; 320 mmc->slots[0].init_card = c->init_card;
290 321
291 if (c->no_off) 322 if (c->cover_only)
292 mmc->slots[0].no_off = 1; 323 mmc->slots[0].cover = 1;
293 324
294 if (c->vcc_aux_disable_is_sleep) 325 if (c->nonremovable)
295 mmc->slots[0].vcc_aux_disable_is_sleep = 1; 326 mmc->slots[0].nonremovable = 1;
296 327
297 /* NOTE: MMC slots should have a Vcc regulator set up. 328 if (c->power_saving)
298 * This may be from a TWL4030-family chip, another 329 mmc->slots[0].power_saving = 1;
299 * controllable regulator, or a fixed supply.
300 *
301 * temporary HACK: ocr_mask instead of fixed supply
302 */
303 mmc->slots[0].ocr_mask = c->ocr_mask;
304 330
305 if (cpu_is_omap3517() || cpu_is_omap3505()) 331 if (c->no_off)
306 mmc->slots[0].set_power = nop_mmc_set_power; 332 mmc->slots[0].no_off = 1;
307 else
308 mmc->slots[0].features |= HSMMC_HAS_PBIAS;
309 333
310 if (cpu_is_omap44xx() && (omap_rev() > OMAP4430_REV_ES1_0)) 334 if (c->vcc_aux_disable_is_sleep)
311 mmc->slots[0].features |= HSMMC_HAS_UPDATED_RESET; 335 mmc->slots[0].vcc_aux_disable_is_sleep = 1;
312 336
313 switch (c->mmc) { 337 /*
314 case 1: 338 * NOTE: MMC slots should have a Vcc regulator set up.
315 if (mmc->slots[0].features & HSMMC_HAS_PBIAS) { 339 * This may be from a TWL4030-family chip, another
316 /* on-chip level shifting via PBIAS0/PBIAS1 */ 340 * controllable regulator, or a fixed supply.
317 if (cpu_is_omap44xx()) { 341 *
318 mmc->slots[0].before_set_reg = 342 * temporary HACK: ocr_mask instead of fixed supply
343 */
344 mmc->slots[0].ocr_mask = c->ocr_mask;
345
346 if (cpu_is_omap3517() || cpu_is_omap3505())
347 mmc->slots[0].set_power = nop_mmc_set_power;
348 else
349 mmc->slots[0].features |= HSMMC_HAS_PBIAS;
350
351 if (cpu_is_omap44xx() && (omap_rev() > OMAP4430_REV_ES1_0))
352 mmc->slots[0].features |= HSMMC_HAS_UPDATED_RESET;
353
354 switch (c->mmc) {
355 case 1:
356 if (mmc->slots[0].features & HSMMC_HAS_PBIAS) {
357 /* on-chip level shifting via PBIAS0/PBIAS1 */
358 if (cpu_is_omap44xx()) {
359 mmc->slots[0].before_set_reg =
319 omap4_hsmmc1_before_set_reg; 360 omap4_hsmmc1_before_set_reg;
320 mmc->slots[0].after_set_reg = 361 mmc->slots[0].after_set_reg =
321 omap4_hsmmc1_after_set_reg; 362 omap4_hsmmc1_after_set_reg;
322 } else { 363 } else {
323 mmc->slots[0].before_set_reg = 364 mmc->slots[0].before_set_reg =
324 omap_hsmmc1_before_set_reg; 365 omap_hsmmc1_before_set_reg;
325 mmc->slots[0].after_set_reg = 366 mmc->slots[0].after_set_reg =
326 omap_hsmmc1_after_set_reg; 367 omap_hsmmc1_after_set_reg;
327 }
328 } 368 }
369 }
329 370
330 /* Omap3630 HSMMC1 supports only 4-bit */ 371 /* OMAP3630 HSMMC1 supports only 4-bit */
331 if (cpu_is_omap3630() && 372 if (cpu_is_omap3630() &&
332 (c->caps & MMC_CAP_8_BIT_DATA)) { 373 (c->caps & MMC_CAP_8_BIT_DATA)) {
333 c->caps &= ~MMC_CAP_8_BIT_DATA; 374 c->caps &= ~MMC_CAP_8_BIT_DATA;
334 c->caps |= MMC_CAP_4_BIT_DATA; 375 c->caps |= MMC_CAP_4_BIT_DATA;
335 mmc->slots[0].caps = c->caps; 376 mmc->slots[0].caps = c->caps;
336 } 377 }
337 break; 378 break;
338 case 2: 379 case 2:
339 if (c->ext_clock) 380 if (c->ext_clock)
340 c->transceiver = 1; 381 c->transceiver = 1;
341 if (c->transceiver && (c->caps & MMC_CAP_8_BIT_DATA)) { 382 if (c->transceiver && (c->caps & MMC_CAP_8_BIT_DATA)) {
342 c->caps &= ~MMC_CAP_8_BIT_DATA; 383 c->caps &= ~MMC_CAP_8_BIT_DATA;
343 c->caps |= MMC_CAP_4_BIT_DATA; 384 c->caps |= MMC_CAP_4_BIT_DATA;
344 }
345 /* FALLTHROUGH */
346 case 3:
347 if (mmc->slots[0].features & HSMMC_HAS_PBIAS) {
348 /* off-chip level shifting, or none */
349 mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
350 mmc->slots[0].after_set_reg = NULL;
351 }
352 break;
353 default:
354 pr_err("MMC%d configuration not supported!\n", c->mmc);
355 kfree(mmc);
356 continue;
357 } 385 }
358 hsmmc_data[c->mmc - 1] = mmc; 386 /* FALLTHROUGH */
387 case 3:
388 if (mmc->slots[0].features & HSMMC_HAS_PBIAS) {
389 /* off-chip level shifting, or none */
390 mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
391 mmc->slots[0].after_set_reg = NULL;
392 }
393 break;
394 case 4:
395 case 5:
396 mmc->slots[0].before_set_reg = NULL;
397 mmc->slots[0].after_set_reg = NULL;
398 break;
399 default:
400 pr_err("MMC%d configuration not supported!\n", c->mmc);
401 kfree(hc_name);
402 return -ENODEV;
403 }
404 return 0;
405}
406
407static struct omap_device_pm_latency omap_hsmmc_latency[] = {
408 [0] = {
409 .deactivate_func = omap_device_idle_hwmods,
410 .activate_func = omap_device_enable_hwmods,
411 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
412 },
413 /*
414 * XXX There should also be an entry here to power off/on the
415 * MMC regulators/PBIAS cells, etc.
416 */
417};
418
419#define MAX_OMAP_MMC_HWMOD_NAME_LEN 16
420
421void __init omap_init_hsmmc(struct omap2_hsmmc_info *hsmmcinfo, int ctrl_nr)
422{
423 struct omap_hwmod *oh;
424 struct omap_device *od;
425 struct omap_device_pm_latency *ohl;
426 char oh_name[MAX_OMAP_MMC_HWMOD_NAME_LEN];
427 struct omap_mmc_platform_data *mmc_data;
428 struct omap_mmc_dev_attr *mmc_dev_attr;
429 char *name;
430 int l;
431 int ohl_cnt = 0;
432
433 mmc_data = kzalloc(sizeof(struct omap_mmc_platform_data), GFP_KERNEL);
434 if (!mmc_data) {
435 pr_err("Cannot allocate memory for mmc device!\n");
436 goto done;
359 } 437 }
360 438
361 omap2_init_mmc(hsmmc_data, OMAP34XX_NR_MMC); 439 if (omap_hsmmc_pdata_init(hsmmcinfo, mmc_data) < 0) {
440 pr_err("%s fails!\n", __func__);
441 goto done;
442 }
443 omap_hsmmc_mux(mmc_data, (ctrl_nr - 1));
444
445 name = "omap_hsmmc";
446 ohl = omap_hsmmc_latency;
447 ohl_cnt = ARRAY_SIZE(omap_hsmmc_latency);
448
449 l = snprintf(oh_name, MAX_OMAP_MMC_HWMOD_NAME_LEN,
450 "mmc%d", ctrl_nr);
451 WARN(l >= MAX_OMAP_MMC_HWMOD_NAME_LEN,
452 "String buffer overflow in MMC%d device setup\n", ctrl_nr);
453 oh = omap_hwmod_lookup(oh_name);
454 if (!oh) {
455 pr_err("Could not look up %s\n", oh_name);
456 kfree(mmc_data->slots[0].name);
457 goto done;
458 }
362 459
363 /* pass the device nodes back to board setup code */ 460 if (oh->dev_attr != NULL) {
364 for (c = controllers; c->mmc; c++) { 461 mmc_dev_attr = oh->dev_attr;
365 struct omap_mmc_platform_data *mmc = hsmmc_data[c->mmc - 1]; 462 mmc_data->controller_flags = mmc_dev_attr->flags;
463 }
366 464
367 if (!c->mmc || c->mmc > nr_hsmmc) 465 od = omap_device_build(name, ctrl_nr - 1, oh, mmc_data,
368 continue; 466 sizeof(struct omap_mmc_platform_data), ohl, ohl_cnt, false);
369 c->dev = mmc->dev; 467 if (IS_ERR(od)) {
468 WARN(1, "Cant build omap_device for %s:%s.\n", name, oh->name);
469 kfree(mmc_data->slots[0].name);
470 goto done;
370 } 471 }
472 /*
473 * return device handle to board setup code
474 * required to populate for regulator framework structure
475 */
476 hsmmcinfo->dev = &od->pdev.dev;
371 477
372done: 478done:
373 for (i = 0; i < nr_hsmmc; i++) 479 kfree(mmc_data);
374 kfree(hsmmc_data[i]); 480}
481
482void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
483{
484 u32 reg;
485
486 if (!cpu_is_omap44xx()) {
487 if (cpu_is_omap2430()) {
488 control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE;
489 control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1;
490 } else {
491 control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE;
492 control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1;
493 }
494 } else {
495 control_pbias_offset =
496 OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_PBIASLITE;
497 control_mmc1 = OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_MMC1;
498 reg = omap4_ctrl_pad_readl(control_mmc1);
499 reg |= (OMAP4_SDMMC1_PUSTRENGTH_GRP0_MASK |
500 OMAP4_SDMMC1_PUSTRENGTH_GRP1_MASK);
501 reg &= ~(OMAP4_SDMMC1_PUSTRENGTH_GRP2_MASK |
502 OMAP4_SDMMC1_PUSTRENGTH_GRP3_MASK);
503 reg |= (OMAP4_USBC1_DR0_SPEEDCTRL_MASK|
504 OMAP4_SDMMC1_DR1_SPEEDCTRL_MASK |
505 OMAP4_SDMMC1_DR2_SPEEDCTRL_MASK);
506 omap4_ctrl_pad_writel(reg, control_mmc1);
507 }
508
509 for (; controllers->mmc; controllers++)
510 omap_init_hsmmc(controllers, controllers->mmc);
511
375} 512}
376 513
377#endif 514#endif
diff --git a/arch/arm/mach-omap2/hwspinlock.c b/arch/arm/mach-omap2/hwspinlock.c
new file mode 100644
index 000000000000..06d4a80660a5
--- /dev/null
+++ b/arch/arm/mach-omap2/hwspinlock.c
@@ -0,0 +1,63 @@
1/*
2 * OMAP hardware spinlock device initialization
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com
5 *
6 * Contact: Simon Que <sque@ti.com>
7 * Hari Kanigeri <h-kanigeri2@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 */
18
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/err.h>
22
23#include <plat/omap_hwmod.h>
24#include <plat/omap_device.h>
25
26struct omap_device_pm_latency omap_spinlock_latency[] = {
27 {
28 .deactivate_func = omap_device_idle_hwmods,
29 .activate_func = omap_device_enable_hwmods,
30 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
31 }
32};
33
34int __init hwspinlocks_init(void)
35{
36 int retval = 0;
37 struct omap_hwmod *oh;
38 struct omap_device *od;
39 const char *oh_name = "spinlock";
40 const char *dev_name = "omap_hwspinlock";
41
42 /*
43 * Hwmod lookup will fail in case our platform doesn't support the
44 * hardware spinlock module, so it is safe to run this initcall
45 * on all omaps
46 */
47 oh = omap_hwmod_lookup(oh_name);
48 if (oh == NULL)
49 return -EINVAL;
50
51 od = omap_device_build(dev_name, 0, oh, NULL, 0,
52 omap_spinlock_latency,
53 ARRAY_SIZE(omap_spinlock_latency), false);
54 if (IS_ERR(od)) {
55 pr_err("Can't build omap_device for %s:%s\n", dev_name,
56 oh_name);
57 retval = PTR_ERR(od);
58 }
59
60 return retval;
61}
62/* early board code might need to reserve specific hwspinlock instances */
63postcore_initcall(hwspinlocks_init);
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 5f9086c65e48..2537090aa33a 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -6,7 +6,7 @@
6 * Copyright (C) 2005 Nokia Corporation 6 * Copyright (C) 2005 Nokia Corporation
7 * Written by Tony Lindgren <tony@atomide.com> 7 * Written by Tony Lindgren <tony@atomide.com>
8 * 8 *
9 * Copyright (C) 2009 Texas Instruments 9 * Copyright (C) 2009-11 Texas Instruments
10 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com> 10 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
11 * 11 *
12 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
@@ -84,6 +84,11 @@ EXPORT_SYMBOL(omap_type);
84#define OMAP_TAP_DIE_ID_2 0x0220 84#define OMAP_TAP_DIE_ID_2 0x0220
85#define OMAP_TAP_DIE_ID_3 0x0224 85#define OMAP_TAP_DIE_ID_3 0x0224
86 86
87#define OMAP_TAP_DIE_ID_44XX_0 0x0200
88#define OMAP_TAP_DIE_ID_44XX_1 0x0208
89#define OMAP_TAP_DIE_ID_44XX_2 0x020c
90#define OMAP_TAP_DIE_ID_44XX_3 0x0210
91
87#define read_tap_reg(reg) __raw_readl(tap_base + (reg)) 92#define read_tap_reg(reg) __raw_readl(tap_base + (reg))
88 93
89struct omap_id { 94struct omap_id {
@@ -107,6 +112,14 @@ static u16 tap_prod_id;
107 112
108void omap_get_die_id(struct omap_die_id *odi) 113void omap_get_die_id(struct omap_die_id *odi)
109{ 114{
115 if (cpu_is_omap44xx()) {
116 odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_0);
117 odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_1);
118 odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_2);
119 odi->id_3 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_3);
120
121 return;
122 }
110 odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_0); 123 odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_0);
111 odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_1); 124 odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_1);
112 odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_2); 125 odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_2);
@@ -191,12 +204,19 @@ static void __init omap3_check_features(void)
191 if (!cpu_is_omap3505() && !cpu_is_omap3517()) 204 if (!cpu_is_omap3505() && !cpu_is_omap3517())
192 omap3_features |= OMAP3_HAS_IO_WAKEUP; 205 omap3_features |= OMAP3_HAS_IO_WAKEUP;
193 206
207 omap3_features |= OMAP3_HAS_SDRC;
208
194 /* 209 /*
195 * TODO: Get additional info (where applicable) 210 * TODO: Get additional info (where applicable)
196 * e.g. Size of L2 cache. 211 * e.g. Size of L2 cache.
197 */ 212 */
198} 213}
199 214
215static void __init ti816x_check_features(void)
216{
217 omap3_features = OMAP3_HAS_NEON;
218}
219
200static void __init omap3_check_revision(void) 220static void __init omap3_check_revision(void)
201{ 221{
202 u32 cpuid, idcode; 222 u32 cpuid, idcode;
@@ -287,6 +307,20 @@ static void __init omap3_check_revision(void)
287 omap_chip.oc |= CHIP_IS_OMAP3630ES1_2; 307 omap_chip.oc |= CHIP_IS_OMAP3630ES1_2;
288 } 308 }
289 break; 309 break;
310 case 0xb81e:
311 omap_chip.oc = CHIP_IS_TI816X;
312
313 switch (rev) {
314 case 0:
315 omap_revision = TI8168_REV_ES1_0;
316 break;
317 case 1:
318 omap_revision = TI8168_REV_ES1_1;
319 break;
320 default:
321 omap_revision = TI8168_REV_ES1_1;
322 }
323 break;
290 default: 324 default:
291 /* Unknown default to latest silicon rev as default*/ 325 /* Unknown default to latest silicon rev as default*/
292 omap_revision = OMAP3630_REV_ES1_2; 326 omap_revision = OMAP3630_REV_ES1_2;
@@ -307,7 +341,7 @@ static void __init omap4_check_revision(void)
307 */ 341 */
308 idcode = read_tap_reg(OMAP_TAP_IDCODE); 342 idcode = read_tap_reg(OMAP_TAP_IDCODE);
309 hawkeye = (idcode >> 12) & 0xffff; 343 hawkeye = (idcode >> 12) & 0xffff;
310 rev = (idcode >> 28) & 0xff; 344 rev = (idcode >> 28) & 0xf;
311 345
312 /* 346 /*
313 * Few initial ES2.0 samples IDCODE is same as ES1.0 347 * Few initial ES2.0 samples IDCODE is same as ES1.0
@@ -326,22 +360,31 @@ static void __init omap4_check_revision(void)
326 omap_chip.oc |= CHIP_IS_OMAP4430ES1; 360 omap_chip.oc |= CHIP_IS_OMAP4430ES1;
327 break; 361 break;
328 case 1: 362 case 1:
363 default:
329 omap_revision = OMAP4430_REV_ES2_0; 364 omap_revision = OMAP4430_REV_ES2_0;
330 omap_chip.oc |= CHIP_IS_OMAP4430ES2; 365 omap_chip.oc |= CHIP_IS_OMAP4430ES2;
366 }
367 break;
368 case 0xb95c:
369 switch (rev) {
370 case 3:
371 omap_revision = OMAP4430_REV_ES2_1;
372 omap_chip.oc |= CHIP_IS_OMAP4430ES2_1;
331 break; 373 break;
374 case 4:
332 default: 375 default:
333 omap_revision = OMAP4430_REV_ES2_0; 376 omap_revision = OMAP4430_REV_ES2_2;
334 omap_chip.oc |= CHIP_IS_OMAP4430ES2; 377 omap_chip.oc |= CHIP_IS_OMAP4430ES2_2;
335 } 378 }
336 break; 379 break;
337 default: 380 default:
338 /* Unknown default to latest silicon rev as default*/ 381 /* Unknown default to latest silicon rev as default */
339 omap_revision = OMAP4430_REV_ES2_0; 382 omap_revision = OMAP4430_REV_ES2_2;
340 omap_chip.oc |= CHIP_IS_OMAP4430ES2; 383 omap_chip.oc |= CHIP_IS_OMAP4430ES2_2;
341 } 384 }
342 385
343 pr_info("OMAP%04x ES%d.0\n", 386 pr_info("OMAP%04x ES%d.%d\n", omap_rev() >> 16,
344 omap_rev() >> 16, ((omap_rev() >> 12) & 0xf) + 1); 387 ((omap_rev() >> 12) & 0xf), ((omap_rev() >> 8) & 0xf));
345} 388}
346 389
347#define OMAP3_SHOW_FEATURE(feat) \ 390#define OMAP3_SHOW_FEATURE(feat) \
@@ -372,6 +415,8 @@ static void __init omap3_cpuinfo(void)
372 /* Already set in omap3_check_revision() */ 415 /* Already set in omap3_check_revision() */
373 strcpy(cpu_name, "AM3505"); 416 strcpy(cpu_name, "AM3505");
374 } 417 }
418 } else if (cpu_is_ti816x()) {
419 strcpy(cpu_name, "TI816X");
375 } else if (omap3_has_iva() && omap3_has_sgx()) { 420 } else if (omap3_has_iva() && omap3_has_sgx()) {
376 /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */ 421 /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */
377 strcpy(cpu_name, "OMAP3430/3530"); 422 strcpy(cpu_name, "OMAP3430/3530");
@@ -386,7 +431,7 @@ static void __init omap3_cpuinfo(void)
386 strcpy(cpu_name, "OMAP3503"); 431 strcpy(cpu_name, "OMAP3503");
387 } 432 }
388 433
389 if (cpu_is_omap3630()) { 434 if (cpu_is_omap3630() || cpu_is_ti816x()) {
390 switch (rev) { 435 switch (rev) {
391 case OMAP_REVBITS_00: 436 case OMAP_REVBITS_00:
392 strcpy(cpu_rev, "1.0"); 437 strcpy(cpu_rev, "1.0");
@@ -462,7 +507,13 @@ void __init omap2_check_revision(void)
462 omap24xx_check_revision(); 507 omap24xx_check_revision();
463 } else if (cpu_is_omap34xx()) { 508 } else if (cpu_is_omap34xx()) {
464 omap3_check_revision(); 509 omap3_check_revision();
465 omap3_check_features(); 510
511 /* TI816X doesn't have feature register */
512 if (!cpu_is_ti816x())
513 omap3_check_features();
514 else
515 ti816x_check_features();
516
466 omap3_cpuinfo(); 517 omap3_cpuinfo();
467 return; 518 return;
468 } else if (cpu_is_omap44xx()) { 519 } else if (cpu_is_omap44xx()) {
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 6a4d4136002e..48adfe9fe4f3 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -19,6 +19,9 @@
19 19
20#define UART_OFFSET(addr) ((addr) & 0x00ffffff) 20#define UART_OFFSET(addr) ((addr) & 0x00ffffff)
21 21
22#define omap_uart_v2p(x) ((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET)
23#define omap_uart_p2v(x) ((x) - PLAT_PHYS_OFFSET + PAGE_OFFSET)
24
22 .pushsection .data 25 .pushsection .data
23omap_uart_phys: .word 0 26omap_uart_phys: .word 0
24omap_uart_virt: .word 0 27omap_uart_virt: .word 0
@@ -36,7 +39,7 @@ omap_uart_lsr: .word 0
36 /* Use omap_uart_phys/virt if already configured */ 39 /* Use omap_uart_phys/virt if already configured */
3710: mrc p15, 0, \rp, c1, c0 4010: mrc p15, 0, \rp, c1, c0
38 tst \rp, #1 @ MMU enabled? 41 tst \rp, #1 @ MMU enabled?
39 ldreq \rp, =__virt_to_phys(omap_uart_phys) @ MMU not enabled 42 ldreq \rp, =omap_uart_v2p(omap_uart_phys) @ MMU disabled
40 ldrne \rp, =omap_uart_phys @ MMU enabled 43 ldrne \rp, =omap_uart_phys @ MMU enabled
41 add \rv, \rp, #4 @ omap_uart_virt 44 add \rv, \rp, #4 @ omap_uart_virt
42 ldr \rp, [\rp, #0] 45 ldr \rp, [\rp, #0]
@@ -49,7 +52,7 @@ omap_uart_lsr: .word 0
49 mrc p15, 0, \rp, c1, c0 52 mrc p15, 0, \rp, c1, c0
50 tst \rp, #1 @ MMU enabled? 53 tst \rp, #1 @ MMU enabled?
51 ldreq \rp, =OMAP_UART_INFO @ MMU not enabled 54 ldreq \rp, =OMAP_UART_INFO @ MMU not enabled
52 ldrne \rp, =__phys_to_virt(OMAP_UART_INFO) @ MMU enabled 55 ldrne \rp, =omap_uart_p2v(OMAP_UART_INFO) @ MMU enabled
53 ldr \rp, [\rp, #0] 56 ldr \rp, [\rp, #0]
54 57
55 /* Select the UART to use based on the UART1 scratchpad value */ 58 /* Select the UART to use based on the UART1 scratchpad value */
@@ -69,6 +72,12 @@ omap_uart_lsr: .word 0
69 beq 34f @ configure OMAP3UART4 72 beq 34f @ configure OMAP3UART4
70 cmp \rp, #OMAP4UART4 @ only on 44xx 73 cmp \rp, #OMAP4UART4 @ only on 44xx
71 beq 44f @ configure OMAP4UART4 74 beq 44f @ configure OMAP4UART4
75 cmp \rp, #TI816XUART1 @ ti816x UART offsets different
76 beq 81f @ configure UART1
77 cmp \rp, #TI816XUART2 @ ti816x UART offsets different
78 beq 82f @ configure UART2
79 cmp \rp, #TI816XUART3 @ ti816x UART offsets different
80 beq 83f @ configure UART3
72 cmp \rp, #ZOOM_UART @ only on zoom2/3 81 cmp \rp, #ZOOM_UART @ only on zoom2/3
73 beq 95f @ configure ZOOM_UART 82 beq 95f @ configure ZOOM_UART
74 83
@@ -91,10 +100,16 @@ omap_uart_lsr: .word 0
91 b 98f 100 b 98f
9244: mov \rp, #UART_OFFSET(OMAP4_UART4_BASE) 10144: mov \rp, #UART_OFFSET(OMAP4_UART4_BASE)
93 b 98f 102 b 98f
10381: mov \rp, #UART_OFFSET(TI816X_UART1_BASE)
104 b 98f
10582: mov \rp, #UART_OFFSET(TI816X_UART2_BASE)
106 b 98f
10783: mov \rp, #UART_OFFSET(TI816X_UART3_BASE)
108 b 98f
9495: ldr \rp, =ZOOM_UART_BASE 10995: ldr \rp, =ZOOM_UART_BASE
95 mrc p15, 0, \rv, c1, c0 110 mrc p15, 0, \rv, c1, c0
96 tst \rv, #1 @ MMU enabled? 111 tst \rv, #1 @ MMU enabled?
97 ldreq \rv, =__virt_to_phys(omap_uart_phys) @ MMU not enabled 112 ldreq \rv, =omap_uart_v2p(omap_uart_phys) @ MMU disabled
98 ldrne \rv, =omap_uart_phys @ MMU enabled 113 ldrne \rv, =omap_uart_phys @ MMU enabled
99 str \rp, [\rv, #0] 114 str \rp, [\rv, #0]
100 ldr \rp, =ZOOM_UART_VIRT 115 ldr \rp, =ZOOM_UART_VIRT
@@ -109,7 +124,7 @@ omap_uart_lsr: .word 0
10998: add \rp, \rp, #0x48000000 @ phys base 12498: add \rp, \rp, #0x48000000 @ phys base
110 mrc p15, 0, \rv, c1, c0 125 mrc p15, 0, \rv, c1, c0
111 tst \rv, #1 @ MMU enabled? 126 tst \rv, #1 @ MMU enabled?
112 ldreq \rv, =__virt_to_phys(omap_uart_phys) @ MMU not enabled 127 ldreq \rv, =omap_uart_v2p(omap_uart_phys) @ MMU disabled
113 ldrne \rv, =omap_uart_phys @ MMU enabled 128 ldrne \rv, =omap_uart_phys @ MMU enabled
114 str \rp, [\rv, #0] 129 str \rp, [\rv, #0]
115 sub \rp, \rp, #0x48000000 @ phys base 130 sub \rp, \rp, #0x48000000 @ phys base
@@ -131,7 +146,7 @@ omap_uart_lsr: .word 0
131 .macro busyuart,rd,rx 146 .macro busyuart,rd,rx
1321001: mrc p15, 0, \rd, c1, c0 1471001: mrc p15, 0, \rd, c1, c0
133 tst \rd, #1 @ MMU enabled? 148 tst \rd, #1 @ MMU enabled?
134 ldreq \rd, =__virt_to_phys(omap_uart_lsr) @ MMU not enabled 149 ldreq \rd, =omap_uart_v2p(omap_uart_lsr) @ MMU disabled
135 ldrne \rd, =omap_uart_lsr @ MMU enabled 150 ldrne \rd, =omap_uart_lsr @ MMU enabled
136 ldr \rd, [\rd, #0] 151 ldr \rd, [\rd, #0]
137 ldrb \rd, [\rx, \rd] 152 ldrb \rd, [\rx, \rd]
diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S b/arch/arm/mach-omap2/include/mach/entry-macro.S
index befa321c4c13..a48690b90990 100644
--- a/arch/arm/mach-omap2/include/mach/entry-macro.S
+++ b/arch/arm/mach-omap2/include/mach/entry-macro.S
@@ -38,20 +38,6 @@
38 */ 38 */
39 39
40#ifdef MULTI_OMAP2 40#ifdef MULTI_OMAP2
41
42/*
43 * We use __glue to avoid errors with multiple definitions of
44 * .globl omap_irq_base as it's included from entry-armv.S but not
45 * from entry-common.S.
46 */
47#ifdef __glue
48 .pushsection .data
49 .globl omap_irq_base
50omap_irq_base:
51 .word 0
52 .popsection
53#endif
54
55 /* 41 /*
56 * Configure the interrupt base on the first interrupt. 42 * Configure the interrupt base on the first interrupt.
57 * See also omap_irq_base_init for setting omap_irq_base. 43 * See also omap_irq_base_init for setting omap_irq_base.
@@ -75,6 +61,14 @@ omap_irq_base:
75 bne 9998f 61 bne 9998f
76 ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */ 62 ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
77 cmp \irqnr, #0x0 63 cmp \irqnr, #0x0
64 bne 9998f
65
66 /*
67 * ti816x has additional IRQ pending register. Checking this
68 * register on omap2 & omap3 has no effect (read as 0).
69 */
70 ldr \irqnr, [\base, #0xf8] /* IRQ pending reg 4 */
71 cmp \irqnr, #0x0
789998: 729998:
79 ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET] 73 ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
80 and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */ 74 and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */
@@ -147,6 +141,11 @@ omap_irq_base:
147 bne 9999f 141 bne 9999f
148 ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */ 142 ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
149 cmp \irqnr, #0x0 143 cmp \irqnr, #0x0
144#ifdef CONFIG_SOC_OMAPTI816X
145 bne 9999f
146 ldr \irqnr, [\base, #0xf8] /* IRQ pending reg 4 */
147 cmp \irqnr, #0x0
148#endif
1509999: 1499999:
151 ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET] 150 ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
152 and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */ 151 and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */
diff --git a/arch/arm/mach-omap2/include/mach/omap4-common.h b/arch/arm/mach-omap2/include/mach/omap4-common.h
index 5b0270b28934..de441c05a6a6 100644
--- a/arch/arm/mach-omap2/include/mach/omap4-common.h
+++ b/arch/arm/mach-omap2/include/mach/omap4-common.h
@@ -17,8 +17,12 @@
17 * wfi used in low power code. Directly opcode is used instead 17 * wfi used in low power code. Directly opcode is used instead
18 * of instruction to avoid mulit-omap build break 18 * of instruction to avoid mulit-omap build break
19 */ 19 */
20#ifdef CONFIG_THUMB2_KERNEL
21#define do_wfi() __asm__ __volatile__ ("wfi" : : : "memory")
22#else
20#define do_wfi() \ 23#define do_wfi() \
21 __asm__ __volatile__ (".word 0xe320f003" : : : "memory") 24 __asm__ __volatile__ (".word 0xe320f003" : : : "memory")
25#endif
22 26
23#ifdef CONFIG_CACHE_L2X0 27#ifdef CONFIG_CACHE_L2X0
24extern void __iomem *l2cache_base; 28extern void __iomem *l2cache_base;
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index e66687b0b9de..441e79d043a7 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -30,7 +30,6 @@
30 30
31#include <plat/sram.h> 31#include <plat/sram.h>
32#include <plat/sdrc.h> 32#include <plat/sdrc.h>
33#include <plat/gpmc.h>
34#include <plat/serial.h> 33#include <plat/serial.h>
35 34
36#include "clock2xxx.h" 35#include "clock2xxx.h"
@@ -66,7 +65,7 @@ static struct map_desc omap24xx_io_desc[] __initdata = {
66 }, 65 },
67}; 66};
68 67
69#ifdef CONFIG_ARCH_OMAP2420 68#ifdef CONFIG_SOC_OMAP2420
70static struct map_desc omap242x_io_desc[] __initdata = { 69static struct map_desc omap242x_io_desc[] __initdata = {
71 { 70 {
72 .virtual = DSP_MEM_2420_VIRT, 71 .virtual = DSP_MEM_2420_VIRT,
@@ -90,7 +89,7 @@ static struct map_desc omap242x_io_desc[] __initdata = {
90 89
91#endif 90#endif
92 91
93#ifdef CONFIG_ARCH_OMAP2430 92#ifdef CONFIG_SOC_OMAP2430
94static struct map_desc omap243x_io_desc[] __initdata = { 93static struct map_desc omap243x_io_desc[] __initdata = {
95 { 94 {
96 .virtual = L4_WK_243X_VIRT, 95 .virtual = L4_WK_243X_VIRT,
@@ -175,6 +174,18 @@ static struct map_desc omap34xx_io_desc[] __initdata = {
175#endif 174#endif
176}; 175};
177#endif 176#endif
177
178#ifdef CONFIG_SOC_OMAPTI816X
179static struct map_desc omapti816x_io_desc[] __initdata = {
180 {
181 .virtual = L4_34XX_VIRT,
182 .pfn = __phys_to_pfn(L4_34XX_PHYS),
183 .length = L4_34XX_SIZE,
184 .type = MT_DEVICE
185 },
186};
187#endif
188
178#ifdef CONFIG_ARCH_OMAP4 189#ifdef CONFIG_ARCH_OMAP4
179static struct map_desc omap44xx_io_desc[] __initdata = { 190static struct map_desc omap44xx_io_desc[] __initdata = {
180 { 191 {
@@ -241,7 +252,7 @@ static void __init _omap2_map_common_io(void)
241 omap_sram_init(); 252 omap_sram_init();
242} 253}
243 254
244#ifdef CONFIG_ARCH_OMAP2420 255#ifdef CONFIG_SOC_OMAP2420
245void __init omap242x_map_common_io(void) 256void __init omap242x_map_common_io(void)
246{ 257{
247 iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); 258 iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
@@ -250,7 +261,7 @@ void __init omap242x_map_common_io(void)
250} 261}
251#endif 262#endif
252 263
253#ifdef CONFIG_ARCH_OMAP2430 264#ifdef CONFIG_SOC_OMAP2430
254void __init omap243x_map_common_io(void) 265void __init omap243x_map_common_io(void)
255{ 266{
256 iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); 267 iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
@@ -267,6 +278,14 @@ void __init omap34xx_map_common_io(void)
267} 278}
268#endif 279#endif
269 280
281#ifdef CONFIG_SOC_OMAPTI816X
282void __init omapti816x_map_common_io(void)
283{
284 iotable_init(omapti816x_io_desc, ARRAY_SIZE(omapti816x_io_desc));
285 _omap2_map_common_io();
286}
287#endif
288
270#ifdef CONFIG_ARCH_OMAP4 289#ifdef CONFIG_ARCH_OMAP4
271void __init omap44xx_map_common_io(void) 290void __init omap44xx_map_common_io(void)
272{ 291{
@@ -314,14 +333,13 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
314 return omap_hwmod_set_postsetup_state(oh, *(u8 *)data); 333 return omap_hwmod_set_postsetup_state(oh, *(u8 *)data);
315} 334}
316 335
336void __iomem *omap_irq_base;
337
317/* 338/*
318 * Initialize asm_irq_base for entry-macro.S 339 * Initialize asm_irq_base for entry-macro.S
319 */ 340 */
320static inline void omap_irq_base_init(void) 341static inline void omap_irq_base_init(void)
321{ 342{
322 extern void __iomem *omap_irq_base;
323
324#ifdef MULTI_OMAP2
325 if (cpu_is_omap24xx()) 343 if (cpu_is_omap24xx())
326 omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE); 344 omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE);
327 else if (cpu_is_omap34xx()) 345 else if (cpu_is_omap34xx())
@@ -330,7 +348,6 @@ static inline void omap_irq_base_init(void)
330 omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE); 348 omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE);
331 else 349 else
332 pr_err("Could not initialize omap_irq_base\n"); 350 pr_err("Could not initialize omap_irq_base\n");
333#endif
334} 351}
335 352
336void __init omap2_init_common_infrastructure(void) 353void __init omap2_init_common_infrastructure(void)
@@ -339,15 +356,15 @@ void __init omap2_init_common_infrastructure(void)
339 356
340 if (cpu_is_omap242x()) { 357 if (cpu_is_omap242x()) {
341 omap2xxx_powerdomains_init(); 358 omap2xxx_powerdomains_init();
342 omap2_clockdomains_init(); 359 omap2xxx_clockdomains_init();
343 omap2420_hwmod_init(); 360 omap2420_hwmod_init();
344 } else if (cpu_is_omap243x()) { 361 } else if (cpu_is_omap243x()) {
345 omap2xxx_powerdomains_init(); 362 omap2xxx_powerdomains_init();
346 omap2_clockdomains_init(); 363 omap2xxx_clockdomains_init();
347 omap2430_hwmod_init(); 364 omap2430_hwmod_init();
348 } else if (cpu_is_omap34xx()) { 365 } else if (cpu_is_omap34xx()) {
349 omap3xxx_powerdomains_init(); 366 omap3xxx_powerdomains_init();
350 omap2_clockdomains_init(); 367 omap3xxx_clockdomains_init();
351 omap3xxx_hwmod_init(); 368 omap3xxx_hwmod_init();
352 } else if (cpu_is_omap44xx()) { 369 } else if (cpu_is_omap44xx()) {
353 omap44xx_powerdomains_init(); 370 omap44xx_powerdomains_init();
@@ -400,15 +417,10 @@ void __init omap2_init_common_infrastructure(void)
400void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0, 417void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0,
401 struct omap_sdrc_params *sdrc_cs1) 418 struct omap_sdrc_params *sdrc_cs1)
402{ 419{
403 omap_serial_early_init(); 420 if (cpu_is_omap24xx() || omap3_has_sdrc()) {
404
405 omap_hwmod_late_init();
406
407 if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
408 omap2_sdrc_init(sdrc_cs0, sdrc_cs1); 421 omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
409 _omap2_init_reprogram_sdrc(); 422 _omap2_init_reprogram_sdrc();
410 } 423 }
411 gpmc_init();
412 424
413 omap_irq_base_init(); 425 omap_irq_base_init();
414} 426}
diff --git a/arch/arm/mach-omap2/iommu2.c b/arch/arm/mach-omap2/iommu2.c
index 14ee686b6492..adb083e41acd 100644
--- a/arch/arm/mach-omap2/iommu2.c
+++ b/arch/arm/mach-omap2/iommu2.c
@@ -145,35 +145,32 @@ static void omap2_iommu_set_twl(struct iommu *obj, bool on)
145 145
146static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra) 146static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra)
147{ 147{
148 int i;
149 u32 stat, da; 148 u32 stat, da;
150 const char *err_msg[] = { 149 u32 errs = 0;
151 "tlb miss",
152 "translation fault",
153 "emulation miss",
154 "table walk fault",
155 "multi hit fault",
156 };
157 150
158 stat = iommu_read_reg(obj, MMU_IRQSTATUS); 151 stat = iommu_read_reg(obj, MMU_IRQSTATUS);
159 stat &= MMU_IRQ_MASK; 152 stat &= MMU_IRQ_MASK;
160 if (!stat) 153 if (!stat) {
154 *ra = 0;
161 return 0; 155 return 0;
156 }
162 157
163 da = iommu_read_reg(obj, MMU_FAULT_AD); 158 da = iommu_read_reg(obj, MMU_FAULT_AD);
164 *ra = da; 159 *ra = da;
165 160
166 dev_err(obj->dev, "%s:\tda:%08x ", __func__, da); 161 if (stat & MMU_IRQ_TLBMISS)
167 162 errs |= OMAP_IOMMU_ERR_TLB_MISS;
168 for (i = 0; i < ARRAY_SIZE(err_msg); i++) { 163 if (stat & MMU_IRQ_TRANSLATIONFAULT)
169 if (stat & (1 << i)) 164 errs |= OMAP_IOMMU_ERR_TRANS_FAULT;
170 printk("%s ", err_msg[i]); 165 if (stat & MMU_IRQ_EMUMISS)
171 } 166 errs |= OMAP_IOMMU_ERR_EMU_MISS;
172 printk("\n"); 167 if (stat & MMU_IRQ_TABLEWALKFAULT)
173 168 errs |= OMAP_IOMMU_ERR_TBLWALK_FAULT;
169 if (stat & MMU_IRQ_MULTIHITFAULT)
170 errs |= OMAP_IOMMU_ERR_MULTIHIT_FAULT;
174 iommu_write_reg(obj, stat, MMU_IRQSTATUS); 171 iommu_write_reg(obj, stat, MMU_IRQSTATUS);
175 172
176 return stat; 173 return errs;
177} 174}
178 175
179static void omap2_tlb_read_cr(struct iommu *obj, struct cr_regs *cr) 176static void omap2_tlb_read_cr(struct iommu *obj, struct cr_regs *cr)
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index 23049c487c47..bc524b94fd59 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -61,8 +61,6 @@ struct omap3_intc_regs {
61 u32 mir[INTCPS_NR_MIR_REGS]; 61 u32 mir[INTCPS_NR_MIR_REGS];
62}; 62};
63 63
64static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)];
65
66/* INTC bank register get/set */ 64/* INTC bank register get/set */
67 65
68static void intc_bank_write_reg(u32 val, struct omap_irq_bank *bank, u16 reg) 66static void intc_bank_write_reg(u32 val, struct omap_irq_bank *bank, u16 reg)
@@ -110,7 +108,7 @@ static void omap_mask_irq(struct irq_data *d)
110 unsigned int irq = d->irq; 108 unsigned int irq = d->irq;
111 int offset = irq & (~(IRQ_BITS_PER_REG - 1)); 109 int offset = irq & (~(IRQ_BITS_PER_REG - 1));
112 110
113 if (cpu_is_omap34xx()) { 111 if (cpu_is_omap34xx() && !cpu_is_ti816x()) {
114 int spurious = 0; 112 int spurious = 0;
115 113
116 /* 114 /*
@@ -205,6 +203,9 @@ void __init omap_init_irq(void)
205 203
206 BUG_ON(!base); 204 BUG_ON(!base);
207 205
206 if (cpu_is_ti816x())
207 bank->nr_irqs = 128;
208
208 /* Static mapping, never released */ 209 /* Static mapping, never released */
209 bank->base_reg = ioremap(base, SZ_4K); 210 bank->base_reg = ioremap(base, SZ_4K);
210 if (!bank->base_reg) { 211 if (!bank->base_reg) {
@@ -229,6 +230,8 @@ void __init omap_init_irq(void)
229} 230}
230 231
231#ifdef CONFIG_ARCH_OMAP3 232#ifdef CONFIG_ARCH_OMAP3
233static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)];
234
232void omap_intc_save_context(void) 235void omap_intc_save_context(void)
233{ 236{
234 int ind = 0, i = 0; 237 int ind = 0, i = 0;
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 394413dc7deb..86d564a640bb 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -14,12 +14,11 @@
14#include <linux/err.h> 14#include <linux/err.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/pm_runtime.h>
17#include <plat/mailbox.h> 18#include <plat/mailbox.h>
18#include <mach/irqs.h> 19#include <mach/irqs.h>
19 20
20#define MAILBOX_REVISION 0x000 21#define MAILBOX_REVISION 0x000
21#define MAILBOX_SYSCONFIG 0x010
22#define MAILBOX_SYSSTATUS 0x014
23#define MAILBOX_MESSAGE(m) (0x040 + 4 * (m)) 22#define MAILBOX_MESSAGE(m) (0x040 + 4 * (m))
24#define MAILBOX_FIFOSTATUS(m) (0x080 + 4 * (m)) 23#define MAILBOX_FIFOSTATUS(m) (0x080 + 4 * (m))
25#define MAILBOX_MSGSTATUS(m) (0x0c0 + 4 * (m)) 24#define MAILBOX_MSGSTATUS(m) (0x0c0 + 4 * (m))
@@ -33,17 +32,6 @@
33#define MAILBOX_IRQ_NEWMSG(m) (1 << (2 * (m))) 32#define MAILBOX_IRQ_NEWMSG(m) (1 << (2 * (m)))
34#define MAILBOX_IRQ_NOTFULL(m) (1 << (2 * (m) + 1)) 33#define MAILBOX_IRQ_NOTFULL(m) (1 << (2 * (m) + 1))
35 34
36/* SYSCONFIG: register bit definition */
37#define AUTOIDLE (1 << 0)
38#define SOFTRESET (1 << 1)
39#define SMARTIDLE (2 << 3)
40#define OMAP4_SOFTRESET (1 << 0)
41#define OMAP4_NOIDLE (1 << 2)
42#define OMAP4_SMARTIDLE (2 << 2)
43
44/* SYSSTATUS: register bit definition */
45#define RESETDONE (1 << 0)
46
47#define MBOX_REG_SIZE 0x120 35#define MBOX_REG_SIZE 0x120
48 36
49#define OMAP4_MBOX_REG_SIZE 0x130 37#define OMAP4_MBOX_REG_SIZE 0x130
@@ -70,8 +58,6 @@ struct omap_mbox2_priv {
70 unsigned long irqdisable; 58 unsigned long irqdisable;
71}; 59};
72 60
73static struct clk *mbox_ick_handle;
74
75static void omap2_mbox_enable_irq(struct omap_mbox *mbox, 61static void omap2_mbox_enable_irq(struct omap_mbox *mbox,
76 omap_mbox_type_t irq); 62 omap_mbox_type_t irq);
77 63
@@ -89,53 +75,13 @@ static inline void mbox_write_reg(u32 val, size_t ofs)
89static int omap2_mbox_startup(struct omap_mbox *mbox) 75static int omap2_mbox_startup(struct omap_mbox *mbox)
90{ 76{
91 u32 l; 77 u32 l;
92 unsigned long timeout;
93 78
94 mbox_ick_handle = clk_get(NULL, "mailboxes_ick"); 79 pm_runtime_enable(mbox->dev->parent);
95 if (IS_ERR(mbox_ick_handle)) { 80 pm_runtime_get_sync(mbox->dev->parent);
96 printk(KERN_ERR "Could not get mailboxes_ick: %ld\n",
97 PTR_ERR(mbox_ick_handle));
98 return PTR_ERR(mbox_ick_handle);
99 }
100 clk_enable(mbox_ick_handle);
101
102 if (cpu_is_omap44xx()) {
103 mbox_write_reg(OMAP4_SOFTRESET, MAILBOX_SYSCONFIG);
104 timeout = jiffies + msecs_to_jiffies(20);
105 do {
106 l = mbox_read_reg(MAILBOX_SYSCONFIG);
107 if (!(l & OMAP4_SOFTRESET))
108 break;
109 } while (!time_after(jiffies, timeout));
110
111 if (l & OMAP4_SOFTRESET) {
112 pr_err("Can't take mailbox out of reset\n");
113 return -ENODEV;
114 }
115 } else {
116 mbox_write_reg(SOFTRESET, MAILBOX_SYSCONFIG);
117 timeout = jiffies + msecs_to_jiffies(20);
118 do {
119 l = mbox_read_reg(MAILBOX_SYSSTATUS);
120 if (l & RESETDONE)
121 break;
122 } while (!time_after(jiffies, timeout));
123
124 if (!(l & RESETDONE)) {
125 pr_err("Can't take mailbox out of reset\n");
126 return -ENODEV;
127 }
128 }
129 81
130 l = mbox_read_reg(MAILBOX_REVISION); 82 l = mbox_read_reg(MAILBOX_REVISION);
131 pr_debug("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f)); 83 pr_debug("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f));
132 84
133 if (cpu_is_omap44xx())
134 l = OMAP4_SMARTIDLE;
135 else
136 l = SMARTIDLE | AUTOIDLE;
137 mbox_write_reg(l, MAILBOX_SYSCONFIG);
138
139 omap2_mbox_enable_irq(mbox, IRQ_RX); 85 omap2_mbox_enable_irq(mbox, IRQ_RX);
140 86
141 return 0; 87 return 0;
@@ -143,9 +89,8 @@ static int omap2_mbox_startup(struct omap_mbox *mbox)
143 89
144static void omap2_mbox_shutdown(struct omap_mbox *mbox) 90static void omap2_mbox_shutdown(struct omap_mbox *mbox)
145{ 91{
146 clk_disable(mbox_ick_handle); 92 pm_runtime_put_sync(mbox->dev->parent);
147 clk_put(mbox_ick_handle); 93 pm_runtime_disable(mbox->dev->parent);
148 mbox_ick_handle = NULL;
149} 94}
150 95
151/* Mailbox FIFO handle functions */ 96/* Mailbox FIFO handle functions */
@@ -193,10 +138,12 @@ static void omap2_mbox_disable_irq(struct omap_mbox *mbox,
193 omap_mbox_type_t irq) 138 omap_mbox_type_t irq)
194{ 139{
195 struct omap_mbox2_priv *p = mbox->priv; 140 struct omap_mbox2_priv *p = mbox->priv;
196 u32 l, bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit; 141 u32 bit = (irq == IRQ_TX) ? p->notfull_bit : p->newmsg_bit;
197 l = mbox_read_reg(p->irqdisable); 142
198 l &= ~bit; 143 if (!cpu_is_omap44xx())
199 mbox_write_reg(l, p->irqdisable); 144 bit = mbox_read_reg(p->irqdisable) & ~bit;
145
146 mbox_write_reg(bit, p->irqdisable);
200} 147}
201 148
202static void omap2_mbox_ack_irq(struct omap_mbox *mbox, 149static void omap2_mbox_ack_irq(struct omap_mbox *mbox,
@@ -310,7 +257,7 @@ struct omap_mbox mbox_dsp_info = {
310struct omap_mbox *omap3_mboxes[] = { &mbox_dsp_info, NULL }; 257struct omap_mbox *omap3_mboxes[] = { &mbox_dsp_info, NULL };
311#endif 258#endif
312 259
313#if defined(CONFIG_ARCH_OMAP2420) 260#if defined(CONFIG_SOC_OMAP2420)
314/* IVA */ 261/* IVA */
315static struct omap_mbox2_priv omap2_mbox_iva_priv = { 262static struct omap_mbox2_priv omap2_mbox_iva_priv = {
316 .tx_fifo = { 263 .tx_fifo = {
@@ -334,7 +281,7 @@ static struct omap_mbox mbox_iva_info = {
334 .priv = &omap2_mbox_iva_priv, 281 .priv = &omap2_mbox_iva_priv,
335}; 282};
336 283
337struct omap_mbox *omap2_mboxes[] = { &mbox_iva_info, &mbox_dsp_info, NULL }; 284struct omap_mbox *omap2_mboxes[] = { &mbox_dsp_info, &mbox_iva_info, NULL };
338#endif 285#endif
339 286
340#if defined(CONFIG_ARCH_OMAP4) 287#if defined(CONFIG_ARCH_OMAP4)
@@ -398,14 +345,14 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
398 else if (cpu_is_omap34xx()) { 345 else if (cpu_is_omap34xx()) {
399 list = omap3_mboxes; 346 list = omap3_mboxes;
400 347
401 list[0]->irq = platform_get_irq_byname(pdev, "dsp"); 348 list[0]->irq = platform_get_irq(pdev, 0);
402 } 349 }
403#endif 350#endif
404#if defined(CONFIG_ARCH_OMAP2) 351#if defined(CONFIG_ARCH_OMAP2)
405 else if (cpu_is_omap2430()) { 352 else if (cpu_is_omap2430()) {
406 list = omap2_mboxes; 353 list = omap2_mboxes;
407 354
408 list[0]->irq = platform_get_irq_byname(pdev, "dsp"); 355 list[0]->irq = platform_get_irq(pdev, 0);
409 } else if (cpu_is_omap2420()) { 356 } else if (cpu_is_omap2420()) {
410 list = omap2_mboxes; 357 list = omap2_mboxes;
411 358
@@ -417,8 +364,7 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
417 else if (cpu_is_omap44xx()) { 364 else if (cpu_is_omap44xx()) {
418 list = omap4_mboxes; 365 list = omap4_mboxes;
419 366
420 list[0]->irq = list[1]->irq = 367 list[0]->irq = list[1]->irq = platform_get_irq(pdev, 0);
421 platform_get_irq_byname(pdev, "mbox");
422 } 368 }
423#endif 369#endif
424 else { 370 else {
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index f9c9df5b5ff1..565b9064a328 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -22,10 +22,11 @@
22#include <plat/dma.h> 22#include <plat/dma.h>
23#include <plat/cpu.h> 23#include <plat/cpu.h>
24#include <plat/mcbsp.h> 24#include <plat/mcbsp.h>
25#include <plat/omap_device.h>
26#include <linux/pm_runtime.h>
25 27
26#include "control.h" 28#include "control.h"
27 29
28
29/* McBSP internal signal muxing functions */ 30/* McBSP internal signal muxing functions */
30 31
31void omap2_mcbsp1_mux_clkr_src(u8 mux) 32void omap2_mcbsp1_mux_clkr_src(u8 mux)
@@ -83,7 +84,7 @@ int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id)
83 return -EINVAL; 84 return -EINVAL;
84 } 85 }
85 86
86 clk_disable(mcbsp->fclk); 87 pm_runtime_put_sync(mcbsp->dev);
87 88
88 r = clk_set_parent(mcbsp->fclk, fck_src); 89 r = clk_set_parent(mcbsp->fclk, fck_src);
89 if (IS_ERR_VALUE(r)) { 90 if (IS_ERR_VALUE(r)) {
@@ -93,7 +94,7 @@ int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id)
93 return -EINVAL; 94 return -EINVAL;
94 } 95 }
95 96
96 clk_enable(mcbsp->fclk); 97 pm_runtime_get_sync(mcbsp->dev);
97 98
98 clk_put(fck_src); 99 clk_put(fck_src);
99 100
@@ -101,196 +102,70 @@ int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id)
101} 102}
102EXPORT_SYMBOL(omap2_mcbsp_set_clks_src); 103EXPORT_SYMBOL(omap2_mcbsp_set_clks_src);
103 104
104 105struct omap_device_pm_latency omap2_mcbsp_latency[] = {
105/* Platform data */
106
107#ifdef CONFIG_ARCH_OMAP2420
108static struct omap_mcbsp_platform_data omap2420_mcbsp_pdata[] = {
109 { 106 {
110 .phys_base = OMAP24XX_MCBSP1_BASE, 107 .deactivate_func = omap_device_idle_hwmods,
111 .dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX, 108 .activate_func = omap_device_enable_hwmods,
112 .dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX, 109 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
113 .rx_irq = INT_24XX_MCBSP1_IRQ_RX,
114 .tx_irq = INT_24XX_MCBSP1_IRQ_TX,
115 },
116 {
117 .phys_base = OMAP24XX_MCBSP2_BASE,
118 .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX,
119 .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX,
120 .rx_irq = INT_24XX_MCBSP2_IRQ_RX,
121 .tx_irq = INT_24XX_MCBSP2_IRQ_TX,
122 }, 110 },
123}; 111};
124#define OMAP2420_MCBSP_PDATA_SZ ARRAY_SIZE(omap2420_mcbsp_pdata)
125#define OMAP2420_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1)
126#else
127#define omap2420_mcbsp_pdata NULL
128#define OMAP2420_MCBSP_PDATA_SZ 0
129#define OMAP2420_MCBSP_REG_NUM 0
130#endif
131 112
132#ifdef CONFIG_ARCH_OMAP2430 113static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
133static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = { 114{
134 { 115 int id, count = 1;
135 .phys_base = OMAP24XX_MCBSP1_BASE, 116 char *name = "omap-mcbsp";
136 .dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX, 117 struct omap_hwmod *oh_device[2];
137 .dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX, 118 struct omap_mcbsp_platform_data *pdata = NULL;
138 .rx_irq = INT_24XX_MCBSP1_IRQ_RX, 119 struct omap_device *od;
139 .tx_irq = INT_24XX_MCBSP1_IRQ_TX,
140 },
141 {
142 .phys_base = OMAP24XX_MCBSP2_BASE,
143 .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX,
144 .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX,
145 .rx_irq = INT_24XX_MCBSP2_IRQ_RX,
146 .tx_irq = INT_24XX_MCBSP2_IRQ_TX,
147 },
148 {
149 .phys_base = OMAP2430_MCBSP3_BASE,
150 .dma_rx_sync = OMAP24XX_DMA_MCBSP3_RX,
151 .dma_tx_sync = OMAP24XX_DMA_MCBSP3_TX,
152 .rx_irq = INT_24XX_MCBSP3_IRQ_RX,
153 .tx_irq = INT_24XX_MCBSP3_IRQ_TX,
154 },
155 {
156 .phys_base = OMAP2430_MCBSP4_BASE,
157 .dma_rx_sync = OMAP24XX_DMA_MCBSP4_RX,
158 .dma_tx_sync = OMAP24XX_DMA_MCBSP4_TX,
159 .rx_irq = INT_24XX_MCBSP4_IRQ_RX,
160 .tx_irq = INT_24XX_MCBSP4_IRQ_TX,
161 },
162 {
163 .phys_base = OMAP2430_MCBSP5_BASE,
164 .dma_rx_sync = OMAP24XX_DMA_MCBSP5_RX,
165 .dma_tx_sync = OMAP24XX_DMA_MCBSP5_TX,
166 .rx_irq = INT_24XX_MCBSP5_IRQ_RX,
167 .tx_irq = INT_24XX_MCBSP5_IRQ_TX,
168 },
169};
170#define OMAP2430_MCBSP_PDATA_SZ ARRAY_SIZE(omap2430_mcbsp_pdata)
171#define OMAP2430_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1)
172#else
173#define omap2430_mcbsp_pdata NULL
174#define OMAP2430_MCBSP_PDATA_SZ 0
175#define OMAP2430_MCBSP_REG_NUM 0
176#endif
177 120
178#ifdef CONFIG_ARCH_OMAP3 121 sscanf(oh->name, "mcbsp%d", &id);
179static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
180 {
181 .phys_base = OMAP34XX_MCBSP1_BASE,
182 .dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX,
183 .dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX,
184 .rx_irq = INT_24XX_MCBSP1_IRQ_RX,
185 .tx_irq = INT_24XX_MCBSP1_IRQ_TX,
186 .buffer_size = 0x80, /* The FIFO has 128 locations */
187 },
188 {
189 .phys_base = OMAP34XX_MCBSP2_BASE,
190 .phys_base_st = OMAP34XX_MCBSP2_ST_BASE,
191 .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX,
192 .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX,
193 .rx_irq = INT_24XX_MCBSP2_IRQ_RX,
194 .tx_irq = INT_24XX_MCBSP2_IRQ_TX,
195 .buffer_size = 0x500, /* The FIFO has 1024 + 256 locations */
196 },
197 {
198 .phys_base = OMAP34XX_MCBSP3_BASE,
199 .phys_base_st = OMAP34XX_MCBSP3_ST_BASE,
200 .dma_rx_sync = OMAP24XX_DMA_MCBSP3_RX,
201 .dma_tx_sync = OMAP24XX_DMA_MCBSP3_TX,
202 .rx_irq = INT_24XX_MCBSP3_IRQ_RX,
203 .tx_irq = INT_24XX_MCBSP3_IRQ_TX,
204 .buffer_size = 0x80, /* The FIFO has 128 locations */
205 },
206 {
207 .phys_base = OMAP34XX_MCBSP4_BASE,
208 .dma_rx_sync = OMAP24XX_DMA_MCBSP4_RX,
209 .dma_tx_sync = OMAP24XX_DMA_MCBSP4_TX,
210 .rx_irq = INT_24XX_MCBSP4_IRQ_RX,
211 .tx_irq = INT_24XX_MCBSP4_IRQ_TX,
212 .buffer_size = 0x80, /* The FIFO has 128 locations */
213 },
214 {
215 .phys_base = OMAP34XX_MCBSP5_BASE,
216 .dma_rx_sync = OMAP24XX_DMA_MCBSP5_RX,
217 .dma_tx_sync = OMAP24XX_DMA_MCBSP5_TX,
218 .rx_irq = INT_24XX_MCBSP5_IRQ_RX,
219 .tx_irq = INT_24XX_MCBSP5_IRQ_TX,
220 .buffer_size = 0x80, /* The FIFO has 128 locations */
221 },
222};
223#define OMAP34XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap34xx_mcbsp_pdata)
224#define OMAP34XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1)
225#else
226#define omap34xx_mcbsp_pdata NULL
227#define OMAP34XX_MCBSP_PDATA_SZ 0
228#define OMAP34XX_MCBSP_REG_NUM 0
229#endif
230 122
231static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = { 123 pdata = kzalloc(sizeof(struct omap_mcbsp_platform_data), GFP_KERNEL);
232 { 124 if (!pdata) {
233 .phys_base = OMAP44XX_MCBSP1_BASE, 125 pr_err("%s: No memory for mcbsp\n", __func__);
234 .dma_rx_sync = OMAP44XX_DMA_MCBSP1_RX, 126 return -ENOMEM;
235 .dma_tx_sync = OMAP44XX_DMA_MCBSP1_TX, 127 }
236 .tx_irq = OMAP44XX_IRQ_MCBSP1, 128
237 }, 129 pdata->mcbsp_config_type = oh->class->rev;
238 { 130
239 .phys_base = OMAP44XX_MCBSP2_BASE, 131 if (oh->class->rev == MCBSP_CONFIG_TYPE3) {
240 .dma_rx_sync = OMAP44XX_DMA_MCBSP2_RX, 132 if (id == 2)
241 .dma_tx_sync = OMAP44XX_DMA_MCBSP2_TX, 133 /* The FIFO has 1024 + 256 locations */
242 .tx_irq = OMAP44XX_IRQ_MCBSP2, 134 pdata->buffer_size = 0x500;
243 }, 135 else
244 { 136 /* The FIFO has 128 locations */
245 .phys_base = OMAP44XX_MCBSP3_BASE, 137 pdata->buffer_size = 0x80;
246 .dma_rx_sync = OMAP44XX_DMA_MCBSP3_RX, 138 }
247 .dma_tx_sync = OMAP44XX_DMA_MCBSP3_TX, 139
248 .tx_irq = OMAP44XX_IRQ_MCBSP3, 140 oh_device[0] = oh;
249 }, 141
250 { 142 if (oh->dev_attr) {
251 .phys_base = OMAP44XX_MCBSP4_BASE, 143 oh_device[1] = omap_hwmod_lookup((
252 .dma_rx_sync = OMAP44XX_DMA_MCBSP4_RX, 144 (struct omap_mcbsp_dev_attr *)(oh->dev_attr))->sidetone);
253 .dma_tx_sync = OMAP44XX_DMA_MCBSP4_TX, 145 count++;
254 .tx_irq = OMAP44XX_IRQ_MCBSP4, 146 }
255 }, 147 od = omap_device_build_ss(name, id, oh_device, count, pdata,
256}; 148 sizeof(*pdata), omap2_mcbsp_latency,
257#define OMAP44XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap44xx_mcbsp_pdata) 149 ARRAY_SIZE(omap2_mcbsp_latency), false);
258#define OMAP44XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) 150 kfree(pdata);
151 if (IS_ERR(od)) {
152 pr_err("%s: Cant build omap_device for %s:%s.\n", __func__,
153 name, oh->name);
154 return PTR_ERR(od);
155 }
156 omap_mcbsp_count++;
157 return 0;
158}
259 159
260static int __init omap2_mcbsp_init(void) 160static int __init omap2_mcbsp_init(void)
261{ 161{
262 if (cpu_is_omap2420()) { 162 omap_hwmod_for_each_by_class("mcbsp", omap_init_mcbsp, NULL);
263 omap_mcbsp_count = OMAP2420_MCBSP_PDATA_SZ;
264 omap_mcbsp_cache_size = OMAP2420_MCBSP_REG_NUM * sizeof(u16);
265 } else if (cpu_is_omap2430()) {
266 omap_mcbsp_count = OMAP2430_MCBSP_PDATA_SZ;
267 omap_mcbsp_cache_size = OMAP2430_MCBSP_REG_NUM * sizeof(u32);
268 } else if (cpu_is_omap34xx()) {
269 omap_mcbsp_count = OMAP34XX_MCBSP_PDATA_SZ;
270 omap_mcbsp_cache_size = OMAP34XX_MCBSP_REG_NUM * sizeof(u32);
271 } else if (cpu_is_omap44xx()) {
272 omap_mcbsp_count = OMAP44XX_MCBSP_PDATA_SZ;
273 omap_mcbsp_cache_size = OMAP44XX_MCBSP_REG_NUM * sizeof(u32);
274 }
275 163
276 mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), 164 mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *),
277 GFP_KERNEL); 165 GFP_KERNEL);
278 if (!mcbsp_ptr) 166 if (!mcbsp_ptr)
279 return -ENOMEM; 167 return -ENOMEM;
280 168
281 if (cpu_is_omap2420())
282 omap_mcbsp_register_board_cfg(omap2420_mcbsp_pdata,
283 OMAP2420_MCBSP_PDATA_SZ);
284 if (cpu_is_omap2430())
285 omap_mcbsp_register_board_cfg(omap2430_mcbsp_pdata,
286 OMAP2430_MCBSP_PDATA_SZ);
287 if (cpu_is_omap34xx())
288 omap_mcbsp_register_board_cfg(omap34xx_mcbsp_pdata,
289 OMAP34XX_MCBSP_PDATA_SZ);
290 if (cpu_is_omap44xx())
291 omap_mcbsp_register_board_cfg(omap44xx_mcbsp_pdata,
292 OMAP44XX_MCBSP_PDATA_SZ);
293
294 return omap_mcbsp_init(); 169 return omap_mcbsp_init();
295} 170}
296arch_initcall(omap2_mcbsp_init); 171arch_initcall(omap2_mcbsp_init);
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index df8d2f2872c6..bb043cbb3886 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -160,7 +160,7 @@ static int __init _omap_mux_get_by_name(struct omap_mux_partition *partition,
160 struct omap_mux *mux = NULL; 160 struct omap_mux *mux = NULL;
161 struct omap_mux_entry *e; 161 struct omap_mux_entry *e;
162 const char *mode_name; 162 const char *mode_name;
163 int found = 0, found_mode, mode0_len = 0; 163 int found = 0, found_mode = 0, mode0_len = 0;
164 struct list_head *muxmodes = &partition->muxmodes; 164 struct list_head *muxmodes = &partition->muxmodes;
165 165
166 mode_name = strchr(muxname, '.'); 166 mode_name = strchr(muxname, '.');
@@ -258,7 +258,7 @@ struct omap_hwmod_mux_info * __init
258omap_hwmod_mux_init(struct omap_device_pad *bpads, int nr_pads) 258omap_hwmod_mux_init(struct omap_device_pad *bpads, int nr_pads)
259{ 259{
260 struct omap_hwmod_mux_info *hmux; 260 struct omap_hwmod_mux_info *hmux;
261 int i; 261 int i, nr_pads_dynamic = 0;
262 262
263 if (!bpads || nr_pads < 1) 263 if (!bpads || nr_pads < 1)
264 return NULL; 264 return NULL;
@@ -302,9 +302,40 @@ omap_hwmod_mux_init(struct omap_device_pad *bpads, int nr_pads)
302 pad->enable = bpad->enable; 302 pad->enable = bpad->enable;
303 pad->idle = bpad->idle; 303 pad->idle = bpad->idle;
304 pad->off = bpad->off; 304 pad->off = bpad->off;
305
306 if (pad->flags & OMAP_DEVICE_PAD_REMUX)
307 nr_pads_dynamic++;
308
305 pr_debug("%s: Initialized %s\n", __func__, pad->name); 309 pr_debug("%s: Initialized %s\n", __func__, pad->name);
306 } 310 }
307 311
312 if (!nr_pads_dynamic)
313 return hmux;
314
315 /*
316 * Add pads that need dynamic muxing into a separate list
317 */
318
319 hmux->nr_pads_dynamic = nr_pads_dynamic;
320 hmux->pads_dynamic = kzalloc(sizeof(struct omap_device_pad *) *
321 nr_pads_dynamic, GFP_KERNEL);
322 if (!hmux->pads_dynamic) {
323 pr_err("%s: Could not allocate dynamic pads\n", __func__);
324 return hmux;
325 }
326
327 nr_pads_dynamic = 0;
328 for (i = 0; i < hmux->nr_pads; i++) {
329 struct omap_device_pad *pad = &hmux->pads[i];
330
331 if (pad->flags & OMAP_DEVICE_PAD_REMUX) {
332 pr_debug("%s: pad %s tagged dynamic\n",
333 __func__, pad->name);
334 hmux->pads_dynamic[nr_pads_dynamic] = pad;
335 nr_pads_dynamic++;
336 }
337 }
338
308 return hmux; 339 return hmux;
309 340
310err3: 341err3:
@@ -322,6 +353,36 @@ void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state)
322{ 353{
323 int i; 354 int i;
324 355
356 /* Runtime idling of dynamic pads */
357 if (state == _HWMOD_STATE_IDLE && hmux->enabled) {
358 for (i = 0; i < hmux->nr_pads_dynamic; i++) {
359 struct omap_device_pad *pad = hmux->pads_dynamic[i];
360 int val = -EINVAL;
361
362 val = pad->idle;
363 omap_mux_write(pad->partition, val,
364 pad->mux->reg_offset);
365 }
366
367 return;
368 }
369
370 /* Runtime enabling of dynamic pads */
371 if ((state == _HWMOD_STATE_ENABLED) && hmux->pads_dynamic
372 && hmux->enabled) {
373 for (i = 0; i < hmux->nr_pads_dynamic; i++) {
374 struct omap_device_pad *pad = hmux->pads_dynamic[i];
375 int val = -EINVAL;
376
377 val = pad->enable;
378 omap_mux_write(pad->partition, val,
379 pad->mux->reg_offset);
380 }
381
382 return;
383 }
384
385 /* Enabling or disabling of all pads */
325 for (i = 0; i < hmux->nr_pads; i++) { 386 for (i = 0; i < hmux->nr_pads; i++) {
326 struct omap_device_pad *pad = &hmux->pads[i]; 387 struct omap_device_pad *pad = &hmux->pads[i];
327 int flags, val = -EINVAL; 388 int flags, val = -EINVAL;
@@ -330,31 +391,22 @@ void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state)
330 391
331 switch (state) { 392 switch (state) {
332 case _HWMOD_STATE_ENABLED: 393 case _HWMOD_STATE_ENABLED:
333 if (flags & OMAP_DEVICE_PAD_ENABLED)
334 break;
335 flags |= OMAP_DEVICE_PAD_ENABLED;
336 val = pad->enable; 394 val = pad->enable;
337 pr_debug("%s: Enabling %s %x\n", __func__, 395 pr_debug("%s: Enabling %s %x\n", __func__,
338 pad->name, val); 396 pad->name, val);
339 break; 397 break;
340 case _HWMOD_STATE_IDLE:
341 if (!(flags & OMAP_DEVICE_PAD_REMUX))
342 break;
343 flags &= ~OMAP_DEVICE_PAD_ENABLED;
344 val = pad->idle;
345 pr_debug("%s: Idling %s %x\n", __func__,
346 pad->name, val);
347 break;
348 case _HWMOD_STATE_DISABLED: 398 case _HWMOD_STATE_DISABLED:
349 default:
350 /* Use safe mode unless OMAP_DEVICE_PAD_REMUX */ 399 /* Use safe mode unless OMAP_DEVICE_PAD_REMUX */
351 if (flags & OMAP_DEVICE_PAD_REMUX) 400 if (flags & OMAP_DEVICE_PAD_REMUX)
352 val = pad->off; 401 val = pad->off;
353 else 402 else
354 val = OMAP_MUX_MODE7; 403 val = OMAP_MUX_MODE7;
355 flags &= ~OMAP_DEVICE_PAD_ENABLED;
356 pr_debug("%s: Disabling %s %x\n", __func__, 404 pr_debug("%s: Disabling %s %x\n", __func__,
357 pad->name, val); 405 pad->name, val);
406 break;
407 default:
408 /* Nothing to be done */
409 break;
358 }; 410 };
359 411
360 if (val >= 0) { 412 if (val >= 0) {
@@ -363,6 +415,11 @@ void omap_hwmod_mux(struct omap_hwmod_mux_info *hmux, u8 state)
363 pad->flags = flags; 415 pad->flags = flags;
364 } 416 }
365 } 417 }
418
419 if (state == _HWMOD_STATE_ENABLED)
420 hmux->enabled = true;
421 else
422 hmux->enabled = false;
366} 423}
367 424
368#ifdef CONFIG_DEBUG_FS 425#ifdef CONFIG_DEBUG_FS
@@ -605,7 +662,7 @@ static void __init omap_mux_dbg_create_entry(
605 list_for_each_entry(e, &partition->muxmodes, node) { 662 list_for_each_entry(e, &partition->muxmodes, node) {
606 struct omap_mux *m = &e->mux; 663 struct omap_mux *m = &e->mux;
607 664
608 (void)debugfs_create_file(m->muxnames[0], S_IWUGO, mux_dbg_dir, 665 (void)debugfs_create_file(m->muxnames[0], S_IWUSR, mux_dbg_dir,
609 m, &omap_mux_dbg_signal_fops); 666 m, &omap_mux_dbg_signal_fops);
610 } 667 }
611} 668}
@@ -1000,6 +1057,7 @@ int __init omap_mux_init(const char *name, u32 flags,
1000 if (!partition->base) { 1057 if (!partition->base) {
1001 pr_err("%s: Could not ioremap mux partition at 0x%08x\n", 1058 pr_err("%s: Could not ioremap mux partition at 0x%08x\n",
1002 __func__, partition->phys); 1059 __func__, partition->phys);
1060 kfree(partition);
1003 return -ENODEV; 1061 return -ENODEV;
1004 } 1062 }
1005 1063
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
index a4ab17a737a6..137f321c029f 100644
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -159,7 +159,6 @@ struct omap_board_mux {
159 u16 value; 159 u16 value;
160}; 160};
161 161
162#define OMAP_DEVICE_PAD_ENABLED BIT(7) /* Not needed for board-*.c */
163#define OMAP_DEVICE_PAD_REMUX BIT(1) /* Dynamically remux a pad, 162#define OMAP_DEVICE_PAD_REMUX BIT(1) /* Dynamically remux a pad,
164 needs enable, idle and off 163 needs enable, idle and off
165 values */ 164 values */
@@ -187,6 +186,12 @@ struct omap_device_pad {
187 186
188struct omap_hwmod_mux_info; 187struct omap_hwmod_mux_info;
189 188
189#define OMAP_MUX_STATIC(signal, mode) \
190{ \
191 .name = (signal), \
192 .enable = (mode), \
193}
194
190#if defined(CONFIG_OMAP_MUX) 195#if defined(CONFIG_OMAP_MUX)
191 196
192/** 197/**
diff --git a/arch/arm/mach-omap2/mux44xx.c b/arch/arm/mach-omap2/mux44xx.c
index c322e7bdaa17..9a66445112ae 100644
--- a/arch/arm/mach-omap2/mux44xx.c
+++ b/arch/arm/mach-omap2/mux44xx.c
@@ -755,25 +755,9 @@ static struct omap_ball __initdata omap4_core_cbl_ball[] = {
755#endif 755#endif
756 756
757/* 757/*
758 * Superset of all mux modes for omap4 ES2.0 758 * Signals different on ES2.0 compared to superset
759 */ 759 */
760static struct omap_mux __initdata omap4_es2_core_muxmodes[] = { 760static struct omap_mux __initdata omap4_es2_core_subset[] = {
761 _OMAP4_MUXENTRY(GPMC_AD0, 0, "gpmc_ad0", "sdmmc2_dat0", NULL, NULL,
762 NULL, NULL, NULL, NULL),
763 _OMAP4_MUXENTRY(GPMC_AD1, 0, "gpmc_ad1", "sdmmc2_dat1", NULL, NULL,
764 NULL, NULL, NULL, NULL),
765 _OMAP4_MUXENTRY(GPMC_AD2, 0, "gpmc_ad2", "sdmmc2_dat2", NULL, NULL,
766 NULL, NULL, NULL, NULL),
767 _OMAP4_MUXENTRY(GPMC_AD3, 0, "gpmc_ad3", "sdmmc2_dat3", NULL, NULL,
768 NULL, NULL, NULL, NULL),
769 _OMAP4_MUXENTRY(GPMC_AD4, 0, "gpmc_ad4", "sdmmc2_dat4",
770 "sdmmc2_dir_dat0", NULL, NULL, NULL, NULL, NULL),
771 _OMAP4_MUXENTRY(GPMC_AD5, 0, "gpmc_ad5", "sdmmc2_dat5",
772 "sdmmc2_dir_dat1", NULL, NULL, NULL, NULL, NULL),
773 _OMAP4_MUXENTRY(GPMC_AD6, 0, "gpmc_ad6", "sdmmc2_dat6",
774 "sdmmc2_dir_cmd", NULL, NULL, NULL, NULL, NULL),
775 _OMAP4_MUXENTRY(GPMC_AD7, 0, "gpmc_ad7", "sdmmc2_dat7",
776 "sdmmc2_clk_fdbk", NULL, NULL, NULL, NULL, NULL),
777 _OMAP4_MUXENTRY(GPMC_AD8, 32, "gpmc_ad8", "kpd_row0", "c2c_data15", 761 _OMAP4_MUXENTRY(GPMC_AD8, 32, "gpmc_ad8", "kpd_row0", "c2c_data15",
778 "gpio_32", NULL, "sdmmc1_dat0", NULL, NULL), 762 "gpio_32", NULL, "sdmmc1_dat0", NULL, NULL),
779 _OMAP4_MUXENTRY(GPMC_AD9, 33, "gpmc_ad9", "kpd_row1", "c2c_data14", 763 _OMAP4_MUXENTRY(GPMC_AD9, 33, "gpmc_ad9", "kpd_row1", "c2c_data14",
@@ -792,52 +776,15 @@ static struct omap_mux __initdata omap4_es2_core_muxmodes[] = {
792 "gpio_39", NULL, "sdmmc1_dat7", NULL, NULL), 776 "gpio_39", NULL, "sdmmc1_dat7", NULL, NULL),
793 _OMAP4_MUXENTRY(GPMC_A16, 40, "gpmc_a16", "kpd_row4", "c2c_datain0", 777 _OMAP4_MUXENTRY(GPMC_A16, 40, "gpmc_a16", "kpd_row4", "c2c_datain0",
794 "gpio_40", "venc_656_data0", NULL, NULL, "safe_mode"), 778 "gpio_40", "venc_656_data0", NULL, NULL, "safe_mode"),
795 _OMAP4_MUXENTRY(GPMC_A17, 41, "gpmc_a17", "kpd_row5", "c2c_datain1",
796 "gpio_41", "venc_656_data1", NULL, NULL, "safe_mode"),
797 _OMAP4_MUXENTRY(GPMC_A18, 42, "gpmc_a18", "kpd_row6", "c2c_datain2",
798 "gpio_42", "venc_656_data2", NULL, NULL, "safe_mode"),
799 _OMAP4_MUXENTRY(GPMC_A19, 43, "gpmc_a19", "kpd_row7", "c2c_datain3",
800 "gpio_43", "venc_656_data3", NULL, NULL, "safe_mode"),
801 _OMAP4_MUXENTRY(GPMC_A20, 44, "gpmc_a20", "kpd_col4", "c2c_datain4",
802 "gpio_44", "venc_656_data4", NULL, NULL, "safe_mode"),
803 _OMAP4_MUXENTRY(GPMC_A21, 45, "gpmc_a21", "kpd_col5", "c2c_datain5",
804 "gpio_45", "venc_656_data5", NULL, NULL, "safe_mode"),
805 _OMAP4_MUXENTRY(GPMC_A22, 46, "gpmc_a22", "kpd_col6", "c2c_datain6",
806 "gpio_46", "venc_656_data6", NULL, NULL, "safe_mode"),
807 _OMAP4_MUXENTRY(GPMC_A23, 47, "gpmc_a23", "kpd_col7", "c2c_datain7",
808 "gpio_47", "venc_656_data7", NULL, NULL, "safe_mode"),
809 _OMAP4_MUXENTRY(GPMC_A24, 48, "gpmc_a24", "kpd_col8", "c2c_clkout0", 779 _OMAP4_MUXENTRY(GPMC_A24, 48, "gpmc_a24", "kpd_col8", "c2c_clkout0",
810 "gpio_48", NULL, NULL, NULL, "safe_mode"), 780 "gpio_48", NULL, NULL, NULL, "safe_mode"),
811 _OMAP4_MUXENTRY(GPMC_A25, 49, "gpmc_a25", NULL, "c2c_clkout1",
812 "gpio_49", NULL, NULL, NULL, "safe_mode"),
813 _OMAP4_MUXENTRY(GPMC_NCS0, 50, "gpmc_ncs0", NULL, NULL, "gpio_50",
814 "sys_ndmareq0", NULL, NULL, NULL),
815 _OMAP4_MUXENTRY(GPMC_NCS1, 51, "gpmc_ncs1", NULL, "c2c_dataout6",
816 "gpio_51", NULL, NULL, NULL, "safe_mode"),
817 _OMAP4_MUXENTRY(GPMC_NCS2, 52, "gpmc_ncs2", "kpd_row8", 781 _OMAP4_MUXENTRY(GPMC_NCS2, 52, "gpmc_ncs2", "kpd_row8",
818 "c2c_dataout7", "gpio_52", NULL, NULL, NULL, 782 "c2c_dataout7", "gpio_52", NULL, NULL, NULL,
819 "safe_mode"), 783 "safe_mode"),
820 _OMAP4_MUXENTRY(GPMC_NCS3, 53, "gpmc_ncs3", "gpmc_dir",
821 "c2c_dataout4", "gpio_53", NULL, NULL, NULL,
822 "safe_mode"),
823 _OMAP4_MUXENTRY(GPMC_NWP, 54, "gpmc_nwp", "dsi1_te0", NULL, "gpio_54",
824 "sys_ndmareq1", NULL, NULL, NULL),
825 _OMAP4_MUXENTRY(GPMC_CLK, 55, "gpmc_clk", NULL, NULL, "gpio_55", 784 _OMAP4_MUXENTRY(GPMC_CLK, 55, "gpmc_clk", NULL, NULL, "gpio_55",
826 "sys_ndmareq2", "sdmmc1_cmd", NULL, NULL), 785 "sys_ndmareq2", "sdmmc1_cmd", NULL, NULL),
827 _OMAP4_MUXENTRY(GPMC_NADV_ALE, 56, "gpmc_nadv_ale", "dsi1_te1", NULL, 786 _OMAP4_MUXENTRY(GPMC_NADV_ALE, 56, "gpmc_nadv_ale", "dsi1_te1", NULL,
828 "gpio_56", "sys_ndmareq3", "sdmmc1_clk", NULL, NULL), 787 "gpio_56", "sys_ndmareq3", "sdmmc1_clk", NULL, NULL),
829 _OMAP4_MUXENTRY(GPMC_NOE, 0, "gpmc_noe", "sdmmc2_clk", NULL, NULL,
830 NULL, NULL, NULL, NULL),
831 _OMAP4_MUXENTRY(GPMC_NWE, 0, "gpmc_nwe", "sdmmc2_cmd", NULL, NULL,
832 NULL, NULL, NULL, NULL),
833 _OMAP4_MUXENTRY(GPMC_NBE0_CLE, 59, "gpmc_nbe0_cle", "dsi2_te0", NULL,
834 "gpio_59", NULL, NULL, NULL, NULL),
835 _OMAP4_MUXENTRY(GPMC_NBE1, 60, "gpmc_nbe1", NULL, "c2c_dataout5",
836 "gpio_60", NULL, NULL, NULL, "safe_mode"),
837 _OMAP4_MUXENTRY(GPMC_WAIT0, 61, "gpmc_wait0", "dsi2_te1", NULL,
838 "gpio_61", NULL, NULL, NULL, NULL),
839 _OMAP4_MUXENTRY(GPMC_WAIT1, 62, "gpmc_wait1", NULL, "c2c_dataout2",
840 "gpio_62", NULL, NULL, NULL, "safe_mode"),
841 _OMAP4_MUXENTRY(GPMC_WAIT2, 100, "gpmc_wait2", "usbc1_icusb_txen", 788 _OMAP4_MUXENTRY(GPMC_WAIT2, 100, "gpmc_wait2", "usbc1_icusb_txen",
842 "c2c_dataout3", "gpio_100", "sys_ndmareq0", NULL, 789 "c2c_dataout3", "gpio_100", "sys_ndmareq0", NULL,
843 NULL, "safe_mode"), 790 NULL, "safe_mode"),
@@ -851,62 +798,6 @@ static struct omap_mux __initdata omap4_es2_core_muxmodes[] = {
851 _OMAP4_MUXENTRY(GPMC_NCS7, 104, "gpmc_ncs7", "dsi2_te1", 798 _OMAP4_MUXENTRY(GPMC_NCS7, 104, "gpmc_ncs7", "dsi2_te1",
852 "c2c_dataout1", "gpio_104", NULL, NULL, NULL, 799 "c2c_dataout1", "gpio_104", NULL, NULL, NULL,
853 "safe_mode"), 800 "safe_mode"),
854 _OMAP4_MUXENTRY(HDMI_HPD, 63, "hdmi_hpd", NULL, NULL, "gpio_63", NULL,
855 NULL, NULL, "safe_mode"),
856 _OMAP4_MUXENTRY(HDMI_CEC, 64, "hdmi_cec", NULL, NULL, "gpio_64", NULL,
857 NULL, NULL, "safe_mode"),
858 _OMAP4_MUXENTRY(HDMI_DDC_SCL, 65, "hdmi_ddc_scl", NULL, NULL,
859 "gpio_65", NULL, NULL, NULL, "safe_mode"),
860 _OMAP4_MUXENTRY(HDMI_DDC_SDA, 66, "hdmi_ddc_sda", NULL, NULL,
861 "gpio_66", NULL, NULL, NULL, "safe_mode"),
862 _OMAP4_MUXENTRY(CSI21_DX0, 0, "csi21_dx0", NULL, NULL, "gpi_67", NULL,
863 NULL, NULL, "safe_mode"),
864 _OMAP4_MUXENTRY(CSI21_DY0, 0, "csi21_dy0", NULL, NULL, "gpi_68", NULL,
865 NULL, NULL, "safe_mode"),
866 _OMAP4_MUXENTRY(CSI21_DX1, 0, "csi21_dx1", NULL, NULL, "gpi_69", NULL,
867 NULL, NULL, "safe_mode"),
868 _OMAP4_MUXENTRY(CSI21_DY1, 0, "csi21_dy1", NULL, NULL, "gpi_70", NULL,
869 NULL, NULL, "safe_mode"),
870 _OMAP4_MUXENTRY(CSI21_DX2, 0, "csi21_dx2", NULL, NULL, "gpi_71", NULL,
871 NULL, NULL, "safe_mode"),
872 _OMAP4_MUXENTRY(CSI21_DY2, 0, "csi21_dy2", NULL, NULL, "gpi_72", NULL,
873 NULL, NULL, "safe_mode"),
874 _OMAP4_MUXENTRY(CSI21_DX3, 0, "csi21_dx3", NULL, NULL, "gpi_73", NULL,
875 NULL, NULL, "safe_mode"),
876 _OMAP4_MUXENTRY(CSI21_DY3, 0, "csi21_dy3", NULL, NULL, "gpi_74", NULL,
877 NULL, NULL, "safe_mode"),
878 _OMAP4_MUXENTRY(CSI21_DX4, 0, "csi21_dx4", NULL, NULL, "gpi_75", NULL,
879 NULL, NULL, "safe_mode"),
880 _OMAP4_MUXENTRY(CSI21_DY4, 0, "csi21_dy4", NULL, NULL, "gpi_76", NULL,
881 NULL, NULL, "safe_mode"),
882 _OMAP4_MUXENTRY(CSI22_DX0, 0, "csi22_dx0", NULL, NULL, "gpi_77", NULL,
883 NULL, NULL, "safe_mode"),
884 _OMAP4_MUXENTRY(CSI22_DY0, 0, "csi22_dy0", NULL, NULL, "gpi_78", NULL,
885 NULL, NULL, "safe_mode"),
886 _OMAP4_MUXENTRY(CSI22_DX1, 0, "csi22_dx1", NULL, NULL, "gpi_79", NULL,
887 NULL, NULL, "safe_mode"),
888 _OMAP4_MUXENTRY(CSI22_DY1, 0, "csi22_dy1", NULL, NULL, "gpi_80", NULL,
889 NULL, NULL, "safe_mode"),
890 _OMAP4_MUXENTRY(CAM_SHUTTER, 81, "cam_shutter", NULL, NULL, "gpio_81",
891 NULL, NULL, NULL, "safe_mode"),
892 _OMAP4_MUXENTRY(CAM_STROBE, 82, "cam_strobe", NULL, NULL, "gpio_82",
893 NULL, NULL, NULL, "safe_mode"),
894 _OMAP4_MUXENTRY(CAM_GLOBALRESET, 83, "cam_globalreset", NULL, NULL,
895 "gpio_83", NULL, NULL, NULL, "safe_mode"),
896 _OMAP4_MUXENTRY(USBB1_ULPITLL_CLK, 84, "usbb1_ulpitll_clk",
897 "hsi1_cawake", NULL, "gpio_84", "usbb1_ulpiphy_clk",
898 NULL, "hw_dbg20", "safe_mode"),
899 _OMAP4_MUXENTRY(USBB1_ULPITLL_STP, 85, "usbb1_ulpitll_stp",
900 "hsi1_cadata", "mcbsp4_clkr", "gpio_85",
901 "usbb1_ulpiphy_stp", "usbb1_mm_rxdp", "hw_dbg21",
902 "safe_mode"),
903 _OMAP4_MUXENTRY(USBB1_ULPITLL_DIR, 86, "usbb1_ulpitll_dir",
904 "hsi1_caflag", "mcbsp4_fsr", "gpio_86",
905 "usbb1_ulpiphy_dir", NULL, "hw_dbg22", "safe_mode"),
906 _OMAP4_MUXENTRY(USBB1_ULPITLL_NXT, 87, "usbb1_ulpitll_nxt",
907 "hsi1_acready", "mcbsp4_fsx", "gpio_87",
908 "usbb1_ulpiphy_nxt", "usbb1_mm_rxdm", "hw_dbg23",
909 "safe_mode"),
910 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT0, 88, "usbb1_ulpitll_dat0", 801 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT0, 88, "usbb1_ulpitll_dat0",
911 "hsi1_acwake", "mcbsp4_clkx", "gpio_88", 802 "hsi1_acwake", "mcbsp4_clkx", "gpio_88",
912 "usbb1_ulpiphy_dat0", "usbb1_mm_txen", "hw_dbg24", 803 "usbb1_ulpiphy_dat0", "usbb1_mm_txen", "hw_dbg24",
@@ -922,84 +813,6 @@ static struct omap_mux __initdata omap4_es2_core_muxmodes[] = {
922 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT3, 91, "usbb1_ulpitll_dat3", 813 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT3, 91, "usbb1_ulpitll_dat3",
923 "hsi1_caready", NULL, "gpio_91", "usbb1_ulpiphy_dat3", 814 "hsi1_caready", NULL, "gpio_91", "usbb1_ulpiphy_dat3",
924 "usbb1_mm_rxrcv", "hw_dbg27", "safe_mode"), 815 "usbb1_mm_rxrcv", "hw_dbg27", "safe_mode"),
925 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT4, 92, "usbb1_ulpitll_dat4",
926 "dmtimer8_pwm_evt", "abe_mcbsp3_dr", "gpio_92",
927 "usbb1_ulpiphy_dat4", NULL, "hw_dbg28", "safe_mode"),
928 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT5, 93, "usbb1_ulpitll_dat5",
929 "dmtimer9_pwm_evt", "abe_mcbsp3_dx", "gpio_93",
930 "usbb1_ulpiphy_dat5", NULL, "hw_dbg29", "safe_mode"),
931 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT6, 94, "usbb1_ulpitll_dat6",
932 "dmtimer10_pwm_evt", "abe_mcbsp3_clkx", "gpio_94",
933 "usbb1_ulpiphy_dat6", "abe_dmic_din3", "hw_dbg30",
934 "safe_mode"),
935 _OMAP4_MUXENTRY(USBB1_ULPITLL_DAT7, 95, "usbb1_ulpitll_dat7",
936 "dmtimer11_pwm_evt", "abe_mcbsp3_fsx", "gpio_95",
937 "usbb1_ulpiphy_dat7", "abe_dmic_clk3", "hw_dbg31",
938 "safe_mode"),
939 _OMAP4_MUXENTRY(USBB1_HSIC_DATA, 96, "usbb1_hsic_data", NULL, NULL,
940 "gpio_96", NULL, NULL, NULL, "safe_mode"),
941 _OMAP4_MUXENTRY(USBB1_HSIC_STROBE, 97, "usbb1_hsic_strobe", NULL,
942 NULL, "gpio_97", NULL, NULL, NULL, "safe_mode"),
943 _OMAP4_MUXENTRY(USBC1_ICUSB_DP, 98, "usbc1_icusb_dp", NULL, NULL,
944 "gpio_98", NULL, NULL, NULL, "safe_mode"),
945 _OMAP4_MUXENTRY(USBC1_ICUSB_DM, 99, "usbc1_icusb_dm", NULL, NULL,
946 "gpio_99", NULL, NULL, NULL, "safe_mode"),
947 _OMAP4_MUXENTRY(SDMMC1_CLK, 100, "sdmmc1_clk", NULL, "dpm_emu19",
948 "gpio_100", NULL, NULL, NULL, "safe_mode"),
949 _OMAP4_MUXENTRY(SDMMC1_CMD, 101, "sdmmc1_cmd", NULL, "uart1_rx",
950 "gpio_101", NULL, NULL, NULL, "safe_mode"),
951 _OMAP4_MUXENTRY(SDMMC1_DAT0, 102, "sdmmc1_dat0", NULL, "dpm_emu18",
952 "gpio_102", NULL, NULL, NULL, "safe_mode"),
953 _OMAP4_MUXENTRY(SDMMC1_DAT1, 103, "sdmmc1_dat1", NULL, "dpm_emu17",
954 "gpio_103", NULL, NULL, NULL, "safe_mode"),
955 _OMAP4_MUXENTRY(SDMMC1_DAT2, 104, "sdmmc1_dat2", NULL, "dpm_emu16",
956 "gpio_104", "jtag_tms_tmsc", NULL, NULL, "safe_mode"),
957 _OMAP4_MUXENTRY(SDMMC1_DAT3, 105, "sdmmc1_dat3", NULL, "dpm_emu15",
958 "gpio_105", "jtag_tck", NULL, NULL, "safe_mode"),
959 _OMAP4_MUXENTRY(SDMMC1_DAT4, 106, "sdmmc1_dat4", NULL, NULL,
960 "gpio_106", NULL, NULL, NULL, "safe_mode"),
961 _OMAP4_MUXENTRY(SDMMC1_DAT5, 107, "sdmmc1_dat5", NULL, NULL,
962 "gpio_107", NULL, NULL, NULL, "safe_mode"),
963 _OMAP4_MUXENTRY(SDMMC1_DAT6, 108, "sdmmc1_dat6", NULL, NULL,
964 "gpio_108", NULL, NULL, NULL, "safe_mode"),
965 _OMAP4_MUXENTRY(SDMMC1_DAT7, 109, "sdmmc1_dat7", NULL, NULL,
966 "gpio_109", NULL, NULL, NULL, "safe_mode"),
967 _OMAP4_MUXENTRY(ABE_MCBSP2_CLKX, 110, "abe_mcbsp2_clkx", "mcspi2_clk",
968 "abe_mcasp_ahclkx", "gpio_110", "usbb2_mm_rxdm",
969 NULL, NULL, "safe_mode"),
970 _OMAP4_MUXENTRY(ABE_MCBSP2_DR, 111, "abe_mcbsp2_dr", "mcspi2_somi",
971 "abe_mcasp_axr", "gpio_111", "usbb2_mm_rxdp", NULL,
972 NULL, "safe_mode"),
973 _OMAP4_MUXENTRY(ABE_MCBSP2_DX, 112, "abe_mcbsp2_dx", "mcspi2_simo",
974 "abe_mcasp_amute", "gpio_112", "usbb2_mm_rxrcv", NULL,
975 NULL, "safe_mode"),
976 _OMAP4_MUXENTRY(ABE_MCBSP2_FSX, 113, "abe_mcbsp2_fsx", "mcspi2_cs0",
977 "abe_mcasp_afsx", "gpio_113", "usbb2_mm_txen", NULL,
978 NULL, "safe_mode"),
979 _OMAP4_MUXENTRY(ABE_MCBSP1_CLKX, 114, "abe_mcbsp1_clkx",
980 "abe_slimbus1_clock", NULL, "gpio_114", NULL, NULL,
981 NULL, "safe_mode"),
982 _OMAP4_MUXENTRY(ABE_MCBSP1_DR, 115, "abe_mcbsp1_dr",
983 "abe_slimbus1_data", NULL, "gpio_115", NULL, NULL,
984 NULL, "safe_mode"),
985 _OMAP4_MUXENTRY(ABE_MCBSP1_DX, 116, "abe_mcbsp1_dx", "sdmmc3_dat2",
986 "abe_mcasp_aclkx", "gpio_116", NULL, NULL, NULL,
987 "safe_mode"),
988 _OMAP4_MUXENTRY(ABE_MCBSP1_FSX, 117, "abe_mcbsp1_fsx", "sdmmc3_dat3",
989 "abe_mcasp_amutein", "gpio_117", NULL, NULL, NULL,
990 "safe_mode"),
991 _OMAP4_MUXENTRY(ABE_PDM_UL_DATA, 0, "abe_pdm_ul_data",
992 "abe_mcbsp3_dr", NULL, NULL, NULL, NULL, NULL,
993 "safe_mode"),
994 _OMAP4_MUXENTRY(ABE_PDM_DL_DATA, 0, "abe_pdm_dl_data",
995 "abe_mcbsp3_dx", NULL, NULL, NULL, NULL, NULL,
996 "safe_mode"),
997 _OMAP4_MUXENTRY(ABE_PDM_FRAME, 0, "abe_pdm_frame", "abe_mcbsp3_clkx",
998 NULL, NULL, NULL, NULL, NULL, "safe_mode"),
999 _OMAP4_MUXENTRY(ABE_PDM_LB_CLK, 0, "abe_pdm_lb_clk", "abe_mcbsp3_fsx",
1000 NULL, NULL, NULL, NULL, NULL, "safe_mode"),
1001 _OMAP4_MUXENTRY(ABE_CLKS, 118, "abe_clks", NULL, NULL, "gpio_118",
1002 NULL, NULL, NULL, "safe_mode"),
1003 _OMAP4_MUXENTRY(ABE_DMIC_CLK1, 119, "abe_dmic_clk1", NULL, NULL, 816 _OMAP4_MUXENTRY(ABE_DMIC_CLK1, 119, "abe_dmic_clk1", NULL, NULL,
1004 "gpio_119", "usbb2_mm_txse0", "uart4_cts", NULL, 817 "gpio_119", "usbb2_mm_txse0", "uart4_cts", NULL,
1005 "safe_mode"), 818 "safe_mode"),
@@ -1012,58 +825,6 @@ static struct omap_mux __initdata omap4_es2_core_muxmodes[] = {
1012 _OMAP4_MUXENTRY(ABE_DMIC_DIN3, 122, "abe_dmic_din3", "slimbus2_data", 825 _OMAP4_MUXENTRY(ABE_DMIC_DIN3, 122, "abe_dmic_din3", "slimbus2_data",
1013 "abe_dmic_clk2", "gpio_122", NULL, "dmtimer9_pwm_evt", 826 "abe_dmic_clk2", "gpio_122", NULL, "dmtimer9_pwm_evt",
1014 NULL, "safe_mode"), 827 NULL, "safe_mode"),
1015 _OMAP4_MUXENTRY(UART2_CTS, 123, "uart2_cts", "sdmmc3_clk", NULL,
1016 "gpio_123", NULL, NULL, NULL, "safe_mode"),
1017 _OMAP4_MUXENTRY(UART2_RTS, 124, "uart2_rts", "sdmmc3_cmd", NULL,
1018 "gpio_124", NULL, NULL, NULL, "safe_mode"),
1019 _OMAP4_MUXENTRY(UART2_RX, 125, "uart2_rx", "sdmmc3_dat0", NULL,
1020 "gpio_125", NULL, NULL, NULL, "safe_mode"),
1021 _OMAP4_MUXENTRY(UART2_TX, 126, "uart2_tx", "sdmmc3_dat1", NULL,
1022 "gpio_126", NULL, NULL, NULL, "safe_mode"),
1023 _OMAP4_MUXENTRY(HDQ_SIO, 127, "hdq_sio", "i2c3_sccb", "i2c2_sccb",
1024 "gpio_127", NULL, NULL, NULL, "safe_mode"),
1025 _OMAP4_MUXENTRY(I2C1_SCL, 0, "i2c1_scl", NULL, NULL, NULL, NULL, NULL,
1026 NULL, NULL),
1027 _OMAP4_MUXENTRY(I2C1_SDA, 0, "i2c1_sda", NULL, NULL, NULL, NULL, NULL,
1028 NULL, NULL),
1029 _OMAP4_MUXENTRY(I2C2_SCL, 128, "i2c2_scl", "uart1_rx", NULL,
1030 "gpio_128", NULL, NULL, NULL, "safe_mode"),
1031 _OMAP4_MUXENTRY(I2C2_SDA, 129, "i2c2_sda", "uart1_tx", NULL,
1032 "gpio_129", NULL, NULL, NULL, "safe_mode"),
1033 _OMAP4_MUXENTRY(I2C3_SCL, 130, "i2c3_scl", NULL, NULL, "gpio_130",
1034 NULL, NULL, NULL, "safe_mode"),
1035 _OMAP4_MUXENTRY(I2C3_SDA, 131, "i2c3_sda", NULL, NULL, "gpio_131",
1036 NULL, NULL, NULL, "safe_mode"),
1037 _OMAP4_MUXENTRY(I2C4_SCL, 132, "i2c4_scl", NULL, NULL, "gpio_132",
1038 NULL, NULL, NULL, "safe_mode"),
1039 _OMAP4_MUXENTRY(I2C4_SDA, 133, "i2c4_sda", NULL, NULL, "gpio_133",
1040 NULL, NULL, NULL, "safe_mode"),
1041 _OMAP4_MUXENTRY(MCSPI1_CLK, 134, "mcspi1_clk", NULL, NULL, "gpio_134",
1042 NULL, NULL, NULL, "safe_mode"),
1043 _OMAP4_MUXENTRY(MCSPI1_SOMI, 135, "mcspi1_somi", NULL, NULL,
1044 "gpio_135", NULL, NULL, NULL, "safe_mode"),
1045 _OMAP4_MUXENTRY(MCSPI1_SIMO, 136, "mcspi1_simo", NULL, NULL,
1046 "gpio_136", NULL, NULL, NULL, "safe_mode"),
1047 _OMAP4_MUXENTRY(MCSPI1_CS0, 137, "mcspi1_cs0", NULL, NULL, "gpio_137",
1048 NULL, NULL, NULL, "safe_mode"),
1049 _OMAP4_MUXENTRY(MCSPI1_CS1, 138, "mcspi1_cs1", "uart1_rx", NULL,
1050 "gpio_138", NULL, NULL, NULL, "safe_mode"),
1051 _OMAP4_MUXENTRY(MCSPI1_CS2, 139, "mcspi1_cs2", "uart1_cts",
1052 "slimbus2_clock", "gpio_139", NULL, NULL, NULL,
1053 "safe_mode"),
1054 _OMAP4_MUXENTRY(MCSPI1_CS3, 140, "mcspi1_cs3", "uart1_rts",
1055 "slimbus2_data", "gpio_140", NULL, NULL, NULL,
1056 "safe_mode"),
1057 _OMAP4_MUXENTRY(UART3_CTS_RCTX, 141, "uart3_cts_rctx", "uart1_tx",
1058 NULL, "gpio_141", NULL, NULL, NULL, "safe_mode"),
1059 _OMAP4_MUXENTRY(UART3_RTS_SD, 142, "uart3_rts_sd", NULL, NULL,
1060 "gpio_142", NULL, NULL, NULL, "safe_mode"),
1061 _OMAP4_MUXENTRY(UART3_RX_IRRX, 143, "uart3_rx_irrx",
1062 "dmtimer8_pwm_evt", NULL, "gpio_143", NULL, NULL,
1063 NULL, "safe_mode"),
1064 _OMAP4_MUXENTRY(UART3_TX_IRTX, 144, "uart3_tx_irtx",
1065 "dmtimer9_pwm_evt", NULL, "gpio_144", NULL, NULL,
1066 NULL, "safe_mode"),
1067 _OMAP4_MUXENTRY(SDMMC5_CLK, 145, "sdmmc5_clk", "mcspi2_clk", 828 _OMAP4_MUXENTRY(SDMMC5_CLK, 145, "sdmmc5_clk", "mcspi2_clk",
1068 "usbc1_icusb_dp", "gpio_145", NULL, "sdmmc2_clk", 829 "usbc1_icusb_dp", "gpio_145", NULL, "sdmmc2_clk",
1069 NULL, "safe_mode"), 830 NULL, "safe_mode"),
@@ -1096,9 +857,6 @@ static struct omap_mux __initdata omap4_es2_core_muxmodes[] = {
1096 "gpio_155", NULL, NULL, NULL, "safe_mode"), 857 "gpio_155", NULL, NULL, NULL, "safe_mode"),
1097 _OMAP4_MUXENTRY(UART4_TX, 156, "uart4_tx", "sdmmc4_dat1", "kpd_col8", 858 _OMAP4_MUXENTRY(UART4_TX, 156, "uart4_tx", "sdmmc4_dat1", "kpd_col8",
1098 "gpio_156", NULL, NULL, NULL, "safe_mode"), 859 "gpio_156", NULL, NULL, NULL, "safe_mode"),
1099 _OMAP4_MUXENTRY(USBB2_ULPITLL_CLK, 157, "usbb2_ulpitll_clk",
1100 "usbb2_ulpiphy_clk", "sdmmc4_cmd", "gpio_157",
1101 "hsi2_cawake", NULL, NULL, "safe_mode"),
1102 _OMAP4_MUXENTRY(USBB2_ULPITLL_STP, 158, "usbb2_ulpitll_stp", 860 _OMAP4_MUXENTRY(USBB2_ULPITLL_STP, 158, "usbb2_ulpitll_stp",
1103 "usbb2_ulpiphy_stp", "sdmmc4_clk", "gpio_158", 861 "usbb2_ulpiphy_stp", "sdmmc4_clk", "gpio_158",
1104 "hsi2_cadata", "dispc2_data23", NULL, "safe_mode"), 862 "hsi2_cadata", "dispc2_data23", NULL, "safe_mode"),
@@ -1140,10 +898,6 @@ static struct omap_mux __initdata omap4_es2_core_muxmodes[] = {
1140 "usbb2_ulpiphy_dat7", "sdmmc3_clk", "gpio_168", 898 "usbb2_ulpiphy_dat7", "sdmmc3_clk", "gpio_168",
1141 "mcspi3_clk", "dispc2_data11", "rfbi_data11", 899 "mcspi3_clk", "dispc2_data11", "rfbi_data11",
1142 "safe_mode"), 900 "safe_mode"),
1143 _OMAP4_MUXENTRY(USBB2_HSIC_DATA, 169, "usbb2_hsic_data", NULL, NULL,
1144 "gpio_169", NULL, NULL, NULL, "safe_mode"),
1145 _OMAP4_MUXENTRY(USBB2_HSIC_STROBE, 170, "usbb2_hsic_strobe", NULL,
1146 NULL, "gpio_170", NULL, NULL, NULL, "safe_mode"),
1147 _OMAP4_MUXENTRY(KPD_COL3, 171, "kpd_col3", "kpd_col0", NULL, 901 _OMAP4_MUXENTRY(KPD_COL3, 171, "kpd_col3", "kpd_col0", NULL,
1148 "gpio_171", NULL, NULL, NULL, "safe_mode"), 902 "gpio_171", NULL, NULL, NULL, "safe_mode"),
1149 _OMAP4_MUXENTRY(KPD_COL4, 172, "kpd_col4", "kpd_col1", NULL, 903 _OMAP4_MUXENTRY(KPD_COL4, 172, "kpd_col4", "kpd_col1", NULL,
@@ -1168,36 +922,10 @@ static struct omap_mux __initdata omap4_es2_core_muxmodes[] = {
1168 NULL, NULL, NULL, "safe_mode"), 922 NULL, NULL, NULL, "safe_mode"),
1169 _OMAP4_MUXENTRY(KPD_ROW2, 3, "kpd_row2", "kpd_row5", NULL, "gpio_3", 923 _OMAP4_MUXENTRY(KPD_ROW2, 3, "kpd_row2", "kpd_row5", NULL, "gpio_3",
1170 NULL, NULL, NULL, "safe_mode"), 924 NULL, NULL, NULL, "safe_mode"),
1171 _OMAP4_MUXENTRY(USBA0_OTG_CE, 0, "usba0_otg_ce", NULL, NULL, NULL,
1172 NULL, NULL, NULL, NULL),
1173 _OMAP4_MUXENTRY(USBA0_OTG_DP, 0, "usba0_otg_dp", "uart3_rx_irrx", 925 _OMAP4_MUXENTRY(USBA0_OTG_DP, 0, "usba0_otg_dp", "uart3_rx_irrx",
1174 "uart2_rx", NULL, NULL, NULL, NULL, "safe_mode"), 926 "uart2_rx", NULL, NULL, NULL, NULL, "safe_mode"),
1175 _OMAP4_MUXENTRY(USBA0_OTG_DM, 0, "usba0_otg_dm", "uart3_tx_irtx", 927 _OMAP4_MUXENTRY(USBA0_OTG_DM, 0, "usba0_otg_dm", "uart3_tx_irtx",
1176 "uart2_tx", NULL, NULL, NULL, NULL, "safe_mode"), 928 "uart2_tx", NULL, NULL, NULL, NULL, "safe_mode"),
1177 _OMAP4_MUXENTRY(FREF_CLK1_OUT, 181, "fref_clk1_out", NULL, NULL,
1178 "gpio_181", NULL, NULL, NULL, "safe_mode"),
1179 _OMAP4_MUXENTRY(FREF_CLK2_OUT, 182, "fref_clk2_out", NULL, NULL,
1180 "gpio_182", NULL, NULL, NULL, "safe_mode"),
1181 _OMAP4_MUXENTRY(SYS_NIRQ1, 0, "sys_nirq1", NULL, NULL, NULL, NULL,
1182 NULL, NULL, "safe_mode"),
1183 _OMAP4_MUXENTRY(SYS_NIRQ2, 183, "sys_nirq2", NULL, NULL, "gpio_183",
1184 NULL, NULL, NULL, "safe_mode"),
1185 _OMAP4_MUXENTRY(SYS_BOOT0, 184, "sys_boot0", NULL, NULL, "gpio_184",
1186 NULL, NULL, NULL, "safe_mode"),
1187 _OMAP4_MUXENTRY(SYS_BOOT1, 185, "sys_boot1", NULL, NULL, "gpio_185",
1188 NULL, NULL, NULL, "safe_mode"),
1189 _OMAP4_MUXENTRY(SYS_BOOT2, 186, "sys_boot2", NULL, NULL, "gpio_186",
1190 NULL, NULL, NULL, "safe_mode"),
1191 _OMAP4_MUXENTRY(SYS_BOOT3, 187, "sys_boot3", NULL, NULL, "gpio_187",
1192 NULL, NULL, NULL, "safe_mode"),
1193 _OMAP4_MUXENTRY(SYS_BOOT4, 188, "sys_boot4", NULL, NULL, "gpio_188",
1194 NULL, NULL, NULL, "safe_mode"),
1195 _OMAP4_MUXENTRY(SYS_BOOT5, 189, "sys_boot5", NULL, NULL, "gpio_189",
1196 NULL, NULL, NULL, "safe_mode"),
1197 _OMAP4_MUXENTRY(DPM_EMU0, 11, "dpm_emu0", NULL, NULL, "gpio_11", NULL,
1198 NULL, "hw_dbg0", "safe_mode"),
1199 _OMAP4_MUXENTRY(DPM_EMU1, 12, "dpm_emu1", NULL, NULL, "gpio_12", NULL,
1200 NULL, "hw_dbg1", "safe_mode"),
1201 _OMAP4_MUXENTRY(DPM_EMU2, 13, "dpm_emu2", "usba0_ulpiphy_clk", NULL, 929 _OMAP4_MUXENTRY(DPM_EMU2, 13, "dpm_emu2", "usba0_ulpiphy_clk", NULL,
1202 "gpio_13", NULL, "dispc2_fid", "hw_dbg2", 930 "gpio_13", NULL, "dispc2_fid", "hw_dbg2",
1203 "safe_mode"), 931 "safe_mode"),
@@ -1586,6 +1314,7 @@ int __init omap4_mux_init(struct omap_board_mux *board_subset, int flags)
1586 struct omap_ball *package_balls_core; 1314 struct omap_ball *package_balls_core;
1587 struct omap_ball *package_balls_wkup = omap4_wkup_cbl_cbs_ball; 1315 struct omap_ball *package_balls_wkup = omap4_wkup_cbl_cbs_ball;
1588 struct omap_mux *core_muxmodes; 1316 struct omap_mux *core_muxmodes;
1317 struct omap_mux *core_subset = NULL;
1589 int ret; 1318 int ret;
1590 1319
1591 switch (flags & OMAP_PACKAGE_MASK) { 1320 switch (flags & OMAP_PACKAGE_MASK) {
@@ -1597,7 +1326,8 @@ int __init omap4_mux_init(struct omap_board_mux *board_subset, int flags)
1597 case OMAP_PACKAGE_CBS: 1326 case OMAP_PACKAGE_CBS:
1598 pr_debug("%s: OMAP4430 ES2.X -> OMAP_PACKAGE_CBS\n", __func__); 1327 pr_debug("%s: OMAP4430 ES2.X -> OMAP_PACKAGE_CBS\n", __func__);
1599 package_balls_core = omap4_core_cbs_ball; 1328 package_balls_core = omap4_core_cbs_ball;
1600 core_muxmodes = omap4_es2_core_muxmodes; 1329 core_muxmodes = omap4_core_muxmodes;
1330 core_subset = omap4_es2_core_subset;
1601 break; 1331 break;
1602 default: 1332 default:
1603 pr_err("%s: Unknown omap package, mux disabled\n", __func__); 1333 pr_err("%s: Unknown omap package, mux disabled\n", __func__);
@@ -1608,7 +1338,7 @@ int __init omap4_mux_init(struct omap_board_mux *board_subset, int flags)
1608 OMAP_MUX_GPIO_IN_MODE3, 1338 OMAP_MUX_GPIO_IN_MODE3,
1609 OMAP4_CTRL_MODULE_PAD_CORE_MUX_PBASE, 1339 OMAP4_CTRL_MODULE_PAD_CORE_MUX_PBASE,
1610 OMAP4_CTRL_MODULE_PAD_CORE_MUX_SIZE, 1340 OMAP4_CTRL_MODULE_PAD_CORE_MUX_SIZE,
1611 core_muxmodes, NULL, board_subset, 1341 core_muxmodes, core_subset, board_subset,
1612 package_balls_core); 1342 package_balls_core);
1613 if (ret) 1343 if (ret)
1614 return ret; 1344 return ret;
diff --git a/arch/arm/mach-omap2/omap-headsmp.S b/arch/arm/mach-omap2/omap-headsmp.S
index 6ae937a06cc1..4ee6aeca885a 100644
--- a/arch/arm/mach-omap2/omap-headsmp.S
+++ b/arch/arm/mach-omap2/omap-headsmp.S
@@ -45,5 +45,5 @@ hold: ldr r12,=0x103
45 * should now contain the SVC stack for this core 45 * should now contain the SVC stack for this core
46 */ 46 */
47 b secondary_startup 47 b secondary_startup
48END(omap_secondary_startup) 48ENDPROC(omap_secondary_startup)
49 49
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index 19268647ce36..9ef8c29dd817 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -52,6 +52,12 @@ static void omap4_l2x0_disable(void)
52 omap_smc1(0x102, 0x0); 52 omap_smc1(0x102, 0x0);
53} 53}
54 54
55static void omap4_l2x0_set_debug(unsigned long val)
56{
57 /* Program PL310 L2 Cache controller debug register */
58 omap_smc1(0x100, val);
59}
60
55static int __init omap_l2_cache_init(void) 61static int __init omap_l2_cache_init(void)
56{ 62{
57 u32 aux_ctrl = 0; 63 u32 aux_ctrl = 0;
@@ -99,6 +105,7 @@ static int __init omap_l2_cache_init(void)
99 * specific one 105 * specific one
100 */ 106 */
101 outer_cache.disable = omap4_l2x0_disable; 107 outer_cache.disable = omap4_l2x0_disable;
108 outer_cache.set_debug = omap4_l2x0_set_debug;
102 109
103 return 0; 110 return 0;
104} 111}
diff --git a/arch/arm/mach-omap2/omap44xx-smc.S b/arch/arm/mach-omap2/omap44xx-smc.S
index 1980dc31a1a2..e69d37d95204 100644
--- a/arch/arm/mach-omap2/omap44xx-smc.S
+++ b/arch/arm/mach-omap2/omap44xx-smc.S
@@ -29,7 +29,7 @@ ENTRY(omap_smc1)
29 dsb 29 dsb
30 smc #0 30 smc #0
31 ldmfd sp!, {r2-r12, pc} 31 ldmfd sp!, {r2-r12, pc}
32END(omap_smc1) 32ENDPROC(omap_smc1)
33 33
34ENTRY(omap_modify_auxcoreboot0) 34ENTRY(omap_modify_auxcoreboot0)
35 stmfd sp!, {r1-r12, lr} 35 stmfd sp!, {r1-r12, lr}
@@ -37,7 +37,7 @@ ENTRY(omap_modify_auxcoreboot0)
37 dsb 37 dsb
38 smc #0 38 smc #0
39 ldmfd sp!, {r1-r12, pc} 39 ldmfd sp!, {r1-r12, pc}
40END(omap_modify_auxcoreboot0) 40ENDPROC(omap_modify_auxcoreboot0)
41 41
42ENTRY(omap_auxcoreboot_addr) 42ENTRY(omap_auxcoreboot_addr)
43 stmfd sp!, {r2-r12, lr} 43 stmfd sp!, {r2-r12, lr}
@@ -45,7 +45,7 @@ ENTRY(omap_auxcoreboot_addr)
45 dsb 45 dsb
46 smc #0 46 smc #0
47 ldmfd sp!, {r2-r12, pc} 47 ldmfd sp!, {r2-r12, pc}
48END(omap_auxcoreboot_addr) 48ENDPROC(omap_auxcoreboot_addr)
49 49
50ENTRY(omap_read_auxcoreboot0) 50ENTRY(omap_read_auxcoreboot0)
51 stmfd sp!, {r2-r12, lr} 51 stmfd sp!, {r2-r12, lr}
@@ -54,4 +54,4 @@ ENTRY(omap_read_auxcoreboot0)
54 smc #0 54 smc #0
55 mov r0, r0, lsr #9 55 mov r0, r0, lsr #9
56 ldmfd sp!, {r2-r12, pc} 56 ldmfd sp!, {r2-r12, pc}
57END(omap_read_auxcoreboot0) 57ENDPROC(omap_read_auxcoreboot0)
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index e282e35769fd..e03429453ce7 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * omap_hwmod implementation for OMAP2/3/4 2 * omap_hwmod implementation for OMAP2/3/4
3 * 3 *
4 * Copyright (C) 2009-2010 Nokia Corporation 4 * Copyright (C) 2009-2011 Nokia Corporation
5 * 5 *
6 * Paul Walmsley, Benoît Cousson, Kevin Hilman 6 * Paul Walmsley, Benoît Cousson, Kevin Hilman
7 * 7 *
@@ -162,9 +162,6 @@ static LIST_HEAD(omap_hwmod_list);
162/* mpu_oh: used to add/remove MPU initiator from sleepdep list */ 162/* mpu_oh: used to add/remove MPU initiator from sleepdep list */
163static struct omap_hwmod *mpu_oh; 163static struct omap_hwmod *mpu_oh;
164 164
165/* inited: 0 if omap_hwmod_init() has not yet been called; 1 otherwise */
166static u8 inited;
167
168 165
169/* Private functions */ 166/* Private functions */
170 167
@@ -373,7 +370,7 @@ static int _set_module_autoidle(struct omap_hwmod *oh, u8 autoidle,
373 } 370 }
374 371
375 autoidle_shift = oh->class->sysc->sysc_fields->autoidle_shift; 372 autoidle_shift = oh->class->sysc->sysc_fields->autoidle_shift;
376 autoidle_mask = (0x3 << autoidle_shift); 373 autoidle_mask = (0x1 << autoidle_shift);
377 374
378 *v &= ~autoidle_mask; 375 *v &= ~autoidle_mask;
379 *v |= autoidle << autoidle_shift; 376 *v |= autoidle << autoidle_shift;
@@ -460,14 +457,18 @@ static int _disable_wakeup(struct omap_hwmod *oh, u32 *v)
460 * will be accessed by a particular initiator (e.g., if a module will 457 * will be accessed by a particular initiator (e.g., if a module will
461 * be accessed by the IVA, there should be a sleepdep between the IVA 458 * be accessed by the IVA, there should be a sleepdep between the IVA
462 * initiator and the module). Only applies to modules in smart-idle 459 * initiator and the module). Only applies to modules in smart-idle
463 * mode. Returns -EINVAL upon error or passes along 460 * mode. If the clockdomain is marked as not needing autodeps, return
464 * clkdm_add_sleepdep() value upon success. 461 * 0 without doing anything. Otherwise, returns -EINVAL upon error or
462 * passes along clkdm_add_sleepdep() value upon success.
465 */ 463 */
466static int _add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) 464static int _add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh)
467{ 465{
468 if (!oh->_clk) 466 if (!oh->_clk)
469 return -EINVAL; 467 return -EINVAL;
470 468
469 if (oh->_clk->clkdm && oh->_clk->clkdm->flags & CLKDM_NO_AUTODEPS)
470 return 0;
471
471 return clkdm_add_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm); 472 return clkdm_add_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm);
472} 473}
473 474
@@ -480,14 +481,18 @@ static int _add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh)
480 * be accessed by a particular initiator (e.g., if a module will not 481 * be accessed by a particular initiator (e.g., if a module will not
481 * be accessed by the IVA, there should be no sleepdep between the IVA 482 * be accessed by the IVA, there should be no sleepdep between the IVA
482 * initiator and the module). Only applies to modules in smart-idle 483 * initiator and the module). Only applies to modules in smart-idle
483 * mode. Returns -EINVAL upon error or passes along 484 * mode. If the clockdomain is marked as not needing autodeps, return
484 * clkdm_del_sleepdep() value upon success. 485 * 0 without doing anything. Returns -EINVAL upon error or passes
486 * along clkdm_del_sleepdep() value upon success.
485 */ 487 */
486static int _del_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) 488static int _del_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh)
487{ 489{
488 if (!oh->_clk) 490 if (!oh->_clk)
489 return -EINVAL; 491 return -EINVAL;
490 492
493 if (oh->_clk->clkdm && oh->_clk->clkdm->flags & CLKDM_NO_AUTODEPS)
494 return 0;
495
491 return clkdm_del_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm); 496 return clkdm_del_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm);
492} 497}
493 498
@@ -904,18 +909,16 @@ static struct omap_hwmod *_lookup(const char *name)
904 * @oh: struct omap_hwmod * 909 * @oh: struct omap_hwmod *
905 * @data: not used; pass NULL 910 * @data: not used; pass NULL
906 * 911 *
907 * Called by omap_hwmod_late_init() (after omap2_clk_init()). 912 * Called by omap_hwmod_setup_*() (after omap2_clk_init()).
908 * Resolves all clock names embedded in the hwmod. Returns -EINVAL if 913 * Resolves all clock names embedded in the hwmod. Returns 0 on
909 * the omap_hwmod has not yet been registered or if the clocks have 914 * success, or a negative error code on failure.
910 * already been initialized, 0 on success, or a non-zero error on
911 * failure.
912 */ 915 */
913static int _init_clocks(struct omap_hwmod *oh, void *data) 916static int _init_clocks(struct omap_hwmod *oh, void *data)
914{ 917{
915 int ret = 0; 918 int ret = 0;
916 919
917 if (!oh || (oh->_state != _HWMOD_STATE_REGISTERED)) 920 if (oh->_state != _HWMOD_STATE_REGISTERED)
918 return -EINVAL; 921 return 0;
919 922
920 pr_debug("omap_hwmod: %s: looking up clocks\n", oh->name); 923 pr_debug("omap_hwmod: %s: looking up clocks\n", oh->name);
921 924
@@ -926,7 +929,7 @@ static int _init_clocks(struct omap_hwmod *oh, void *data)
926 if (!ret) 929 if (!ret)
927 oh->_state = _HWMOD_STATE_CLKS_INITED; 930 oh->_state = _HWMOD_STATE_CLKS_INITED;
928 931
929 return 0; 932 return ret;
930} 933}
931 934
932/** 935/**
@@ -972,25 +975,29 @@ static int _wait_target_ready(struct omap_hwmod *oh)
972} 975}
973 976
974/** 977/**
975 * _lookup_hardreset - return the register bit shift for this hwmod/reset line 978 * _lookup_hardreset - fill register bit info for this hwmod/reset line
976 * @oh: struct omap_hwmod * 979 * @oh: struct omap_hwmod *
977 * @name: name of the reset line in the context of this hwmod 980 * @name: name of the reset line in the context of this hwmod
981 * @ohri: struct omap_hwmod_rst_info * that this function will fill in
978 * 982 *
979 * Return the bit position of the reset line that match the 983 * Return the bit position of the reset line that match the
980 * input name. Return -ENOENT if not found. 984 * input name. Return -ENOENT if not found.
981 */ 985 */
982static u8 _lookup_hardreset(struct omap_hwmod *oh, const char *name) 986static u8 _lookup_hardreset(struct omap_hwmod *oh, const char *name,
987 struct omap_hwmod_rst_info *ohri)
983{ 988{
984 int i; 989 int i;
985 990
986 for (i = 0; i < oh->rst_lines_cnt; i++) { 991 for (i = 0; i < oh->rst_lines_cnt; i++) {
987 const char *rst_line = oh->rst_lines[i].name; 992 const char *rst_line = oh->rst_lines[i].name;
988 if (!strcmp(rst_line, name)) { 993 if (!strcmp(rst_line, name)) {
989 u8 shift = oh->rst_lines[i].rst_shift; 994 ohri->rst_shift = oh->rst_lines[i].rst_shift;
990 pr_debug("omap_hwmod: %s: _lookup_hardreset: %s: %d\n", 995 ohri->st_shift = oh->rst_lines[i].st_shift;
991 oh->name, rst_line, shift); 996 pr_debug("omap_hwmod: %s: %s: %s: rst %d st %d\n",
997 oh->name, __func__, rst_line, ohri->rst_shift,
998 ohri->st_shift);
992 999
993 return shift; 1000 return 0;
994 } 1001 }
995 } 1002 }
996 1003
@@ -1009,21 +1016,22 @@ static u8 _lookup_hardreset(struct omap_hwmod *oh, const char *name)
1009 */ 1016 */
1010static int _assert_hardreset(struct omap_hwmod *oh, const char *name) 1017static int _assert_hardreset(struct omap_hwmod *oh, const char *name)
1011{ 1018{
1012 u8 shift; 1019 struct omap_hwmod_rst_info ohri;
1020 u8 ret;
1013 1021
1014 if (!oh) 1022 if (!oh)
1015 return -EINVAL; 1023 return -EINVAL;
1016 1024
1017 shift = _lookup_hardreset(oh, name); 1025 ret = _lookup_hardreset(oh, name, &ohri);
1018 if (IS_ERR_VALUE(shift)) 1026 if (IS_ERR_VALUE(ret))
1019 return shift; 1027 return ret;
1020 1028
1021 if (cpu_is_omap24xx() || cpu_is_omap34xx()) 1029 if (cpu_is_omap24xx() || cpu_is_omap34xx())
1022 return omap2_prm_assert_hardreset(oh->prcm.omap2.module_offs, 1030 return omap2_prm_assert_hardreset(oh->prcm.omap2.module_offs,
1023 shift); 1031 ohri.rst_shift);
1024 else if (cpu_is_omap44xx()) 1032 else if (cpu_is_omap44xx())
1025 return omap4_prm_assert_hardreset(oh->prcm.omap4.rstctrl_reg, 1033 return omap4_prm_assert_hardreset(oh->prcm.omap4.rstctrl_reg,
1026 shift); 1034 ohri.rst_shift);
1027 else 1035 else
1028 return -EINVAL; 1036 return -EINVAL;
1029} 1037}
@@ -1040,29 +1048,34 @@ static int _assert_hardreset(struct omap_hwmod *oh, const char *name)
1040 */ 1048 */
1041static int _deassert_hardreset(struct omap_hwmod *oh, const char *name) 1049static int _deassert_hardreset(struct omap_hwmod *oh, const char *name)
1042{ 1050{
1043 u8 shift; 1051 struct omap_hwmod_rst_info ohri;
1044 int r; 1052 int ret;
1045 1053
1046 if (!oh) 1054 if (!oh)
1047 return -EINVAL; 1055 return -EINVAL;
1048 1056
1049 shift = _lookup_hardreset(oh, name); 1057 ret = _lookup_hardreset(oh, name, &ohri);
1050 if (IS_ERR_VALUE(shift)) 1058 if (IS_ERR_VALUE(ret))
1051 return shift; 1059 return ret;
1052 1060
1053 if (cpu_is_omap24xx() || cpu_is_omap34xx()) 1061 if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
1054 r = omap2_prm_deassert_hardreset(oh->prcm.omap2.module_offs, 1062 ret = omap2_prm_deassert_hardreset(oh->prcm.omap2.module_offs,
1055 shift); 1063 ohri.rst_shift,
1056 else if (cpu_is_omap44xx()) 1064 ohri.st_shift);
1057 r = omap4_prm_deassert_hardreset(oh->prcm.omap4.rstctrl_reg, 1065 } else if (cpu_is_omap44xx()) {
1058 shift); 1066 if (ohri.st_shift)
1059 else 1067 pr_err("omap_hwmod: %s: %s: hwmod data error: OMAP4 does not support st_shift\n",
1068 oh->name, name);
1069 ret = omap4_prm_deassert_hardreset(oh->prcm.omap4.rstctrl_reg,
1070 ohri.rst_shift);
1071 } else {
1060 return -EINVAL; 1072 return -EINVAL;
1073 }
1061 1074
1062 if (r == -EBUSY) 1075 if (ret == -EBUSY)
1063 pr_warning("omap_hwmod: %s: failed to hardreset\n", oh->name); 1076 pr_warning("omap_hwmod: %s: failed to hardreset\n", oh->name);
1064 1077
1065 return r; 1078 return ret;
1066} 1079}
1067 1080
1068/** 1081/**
@@ -1075,21 +1088,22 @@ static int _deassert_hardreset(struct omap_hwmod *oh, const char *name)
1075 */ 1088 */
1076static int _read_hardreset(struct omap_hwmod *oh, const char *name) 1089static int _read_hardreset(struct omap_hwmod *oh, const char *name)
1077{ 1090{
1078 u8 shift; 1091 struct omap_hwmod_rst_info ohri;
1092 u8 ret;
1079 1093
1080 if (!oh) 1094 if (!oh)
1081 return -EINVAL; 1095 return -EINVAL;
1082 1096
1083 shift = _lookup_hardreset(oh, name); 1097 ret = _lookup_hardreset(oh, name, &ohri);
1084 if (IS_ERR_VALUE(shift)) 1098 if (IS_ERR_VALUE(ret))
1085 return shift; 1099 return ret;
1086 1100
1087 if (cpu_is_omap24xx() || cpu_is_omap34xx()) { 1101 if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
1088 return omap2_prm_is_hardreset_asserted(oh->prcm.omap2.module_offs, 1102 return omap2_prm_is_hardreset_asserted(oh->prcm.omap2.module_offs,
1089 shift); 1103 ohri.st_shift);
1090 } else if (cpu_is_omap44xx()) { 1104 } else if (cpu_is_omap44xx()) {
1091 return omap4_prm_is_hardreset_asserted(oh->prcm.omap4.rstctrl_reg, 1105 return omap4_prm_is_hardreset_asserted(oh->prcm.omap4.rstctrl_reg,
1092 shift); 1106 ohri.rst_shift);
1093 } else { 1107 } else {
1094 return -EINVAL; 1108 return -EINVAL;
1095 } 1109 }
@@ -1230,7 +1244,9 @@ static int _enable(struct omap_hwmod *oh)
1230 _deassert_hardreset(oh, oh->rst_lines[0].name); 1244 _deassert_hardreset(oh, oh->rst_lines[0].name);
1231 1245
1232 /* Mux pins for device runtime if populated */ 1246 /* Mux pins for device runtime if populated */
1233 if (oh->mux) 1247 if (oh->mux && (!oh->mux->enabled ||
1248 ((oh->_state == _HWMOD_STATE_IDLE) &&
1249 oh->mux->pads_dynamic)))
1234 omap_hwmod_mux(oh->mux, _HWMOD_STATE_ENABLED); 1250 omap_hwmod_mux(oh->mux, _HWMOD_STATE_ENABLED);
1235 1251
1236 _add_initiator_dep(oh, mpu_oh); 1252 _add_initiator_dep(oh, mpu_oh);
@@ -1279,7 +1295,7 @@ static int _idle(struct omap_hwmod *oh)
1279 _disable_clocks(oh); 1295 _disable_clocks(oh);
1280 1296
1281 /* Mux pins for device idle if populated */ 1297 /* Mux pins for device idle if populated */
1282 if (oh->mux) 1298 if (oh->mux && oh->mux->pads_dynamic)
1283 omap_hwmod_mux(oh->mux, _HWMOD_STATE_IDLE); 1299 omap_hwmod_mux(oh->mux, _HWMOD_STATE_IDLE);
1284 1300
1285 oh->_state = _HWMOD_STATE_IDLE; 1301 oh->_state = _HWMOD_STATE_IDLE;
@@ -1288,6 +1304,42 @@ static int _idle(struct omap_hwmod *oh)
1288} 1304}
1289 1305
1290/** 1306/**
1307 * omap_hwmod_set_ocp_autoidle - set the hwmod's OCP autoidle bit
1308 * @oh: struct omap_hwmod *
1309 * @autoidle: desired AUTOIDLE bitfield value (0 or 1)
1310 *
1311 * Sets the IP block's OCP autoidle bit in hardware, and updates our
1312 * local copy. Intended to be used by drivers that require
1313 * direct manipulation of the AUTOIDLE bits.
1314 * Returns -EINVAL if @oh is null or is not in the ENABLED state, or passes
1315 * along the return value from _set_module_autoidle().
1316 *
1317 * Any users of this function should be scrutinized carefully.
1318 */
1319int omap_hwmod_set_ocp_autoidle(struct omap_hwmod *oh, u8 autoidle)
1320{
1321 u32 v;
1322 int retval = 0;
1323 unsigned long flags;
1324
1325 if (!oh || oh->_state != _HWMOD_STATE_ENABLED)
1326 return -EINVAL;
1327
1328 spin_lock_irqsave(&oh->_lock, flags);
1329
1330 v = oh->_sysc_cache;
1331
1332 retval = _set_module_autoidle(oh, autoidle, &v);
1333
1334 if (!retval)
1335 _write_sysconfig(v, oh);
1336
1337 spin_unlock_irqrestore(&oh->_lock, flags);
1338
1339 return retval;
1340}
1341
1342/**
1291 * _shutdown - shutdown an omap_hwmod 1343 * _shutdown - shutdown an omap_hwmod
1292 * @oh: struct omap_hwmod * 1344 * @oh: struct omap_hwmod *
1293 * 1345 *
@@ -1354,14 +1406,16 @@ static int _shutdown(struct omap_hwmod *oh)
1354 * @oh: struct omap_hwmod * 1406 * @oh: struct omap_hwmod *
1355 * 1407 *
1356 * Writes the CLOCKACTIVITY bits @clockact to the hwmod @oh 1408 * Writes the CLOCKACTIVITY bits @clockact to the hwmod @oh
1357 * OCP_SYSCONFIG register. Returns -EINVAL if the hwmod is in the 1409 * OCP_SYSCONFIG register. Returns 0.
1358 * wrong state or returns 0.
1359 */ 1410 */
1360static int _setup(struct omap_hwmod *oh, void *data) 1411static int _setup(struct omap_hwmod *oh, void *data)
1361{ 1412{
1362 int i, r; 1413 int i, r;
1363 u8 postsetup_state; 1414 u8 postsetup_state;
1364 1415
1416 if (oh->_state != _HWMOD_STATE_CLKS_INITED)
1417 return 0;
1418
1365 /* Set iclk autoidle mode */ 1419 /* Set iclk autoidle mode */
1366 if (oh->slaves_cnt > 0) { 1420 if (oh->slaves_cnt > 0) {
1367 for (i = 0; i < oh->slaves_cnt; i++) { 1421 for (i = 0; i < oh->slaves_cnt; i++) {
@@ -1455,7 +1509,7 @@ static int _setup(struct omap_hwmod *oh, void *data)
1455 */ 1509 */
1456static int __init _register(struct omap_hwmod *oh) 1510static int __init _register(struct omap_hwmod *oh)
1457{ 1511{
1458 int ret, ms_id; 1512 int ms_id;
1459 1513
1460 if (!oh || !oh->name || !oh->class || !oh->class->name || 1514 if (!oh || !oh->name || !oh->class || !oh->class->name ||
1461 (oh->_state != _HWMOD_STATE_UNKNOWN)) 1515 (oh->_state != _HWMOD_STATE_UNKNOWN))
@@ -1467,12 +1521,10 @@ static int __init _register(struct omap_hwmod *oh)
1467 return -EEXIST; 1521 return -EEXIST;
1468 1522
1469 ms_id = _find_mpu_port_index(oh); 1523 ms_id = _find_mpu_port_index(oh);
1470 if (!IS_ERR_VALUE(ms_id)) { 1524 if (!IS_ERR_VALUE(ms_id))
1471 oh->_mpu_port_index = ms_id; 1525 oh->_mpu_port_index = ms_id;
1472 oh->_mpu_rt_va = _find_mpu_rt_base(oh, oh->_mpu_port_index); 1526 else
1473 } else {
1474 oh->_int_flags |= _HWMOD_NO_MPU_PORT; 1527 oh->_int_flags |= _HWMOD_NO_MPU_PORT;
1475 }
1476 1528
1477 list_add_tail(&oh->node, &omap_hwmod_list); 1529 list_add_tail(&oh->node, &omap_hwmod_list);
1478 1530
@@ -1480,9 +1532,14 @@ static int __init _register(struct omap_hwmod *oh)
1480 1532
1481 oh->_state = _HWMOD_STATE_REGISTERED; 1533 oh->_state = _HWMOD_STATE_REGISTERED;
1482 1534
1483 ret = 0; 1535 /*
1536 * XXX Rather than doing a strcmp(), this should test a flag
1537 * set in the hwmod data, inserted by the autogenerator code.
1538 */
1539 if (!strcmp(oh->name, MPU_INITIATOR_NAME))
1540 mpu_oh = oh;
1484 1541
1485 return ret; 1542 return 0;
1486} 1543}
1487 1544
1488 1545
@@ -1585,65 +1642,132 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
1585 return ret; 1642 return ret;
1586} 1643}
1587 1644
1588
1589/** 1645/**
1590 * omap_hwmod_init - init omap_hwmod code and register hwmods 1646 * omap_hwmod_register - register an array of hwmods
1591 * @ohs: pointer to an array of omap_hwmods to register 1647 * @ohs: pointer to an array of omap_hwmods to register
1592 * 1648 *
1593 * Intended to be called early in boot before the clock framework is 1649 * Intended to be called early in boot before the clock framework is
1594 * initialized. If @ohs is not null, will register all omap_hwmods 1650 * initialized. If @ohs is not null, will register all omap_hwmods
1595 * listed in @ohs that are valid for this chip. Returns -EINVAL if 1651 * listed in @ohs that are valid for this chip. Returns 0.
1596 * omap_hwmod_init() has already been called or 0 otherwise.
1597 */ 1652 */
1598int __init omap_hwmod_init(struct omap_hwmod **ohs) 1653int __init omap_hwmod_register(struct omap_hwmod **ohs)
1654{
1655 int r, i;
1656
1657 if (!ohs)
1658 return 0;
1659
1660 i = 0;
1661 do {
1662 if (!omap_chip_is(ohs[i]->omap_chip))
1663 continue;
1664
1665 r = _register(ohs[i]);
1666 WARN(r, "omap_hwmod: %s: _register returned %d\n", ohs[i]->name,
1667 r);
1668 } while (ohs[++i]);
1669
1670 return 0;
1671}
1672
1673/*
1674 * _populate_mpu_rt_base - populate the virtual address for a hwmod
1675 *
1676 * Must be called only from omap_hwmod_setup_*() so ioremap works properly.
1677 * Assumes the caller takes care of locking if needed.
1678 */
1679static int __init _populate_mpu_rt_base(struct omap_hwmod *oh, void *data)
1680{
1681 if (oh->_state != _HWMOD_STATE_REGISTERED)
1682 return 0;
1683
1684 if (oh->_int_flags & _HWMOD_NO_MPU_PORT)
1685 return 0;
1686
1687 oh->_mpu_rt_va = _find_mpu_rt_base(oh, oh->_mpu_port_index);
1688 if (!oh->_mpu_rt_va)
1689 pr_warning("omap_hwmod: %s found no _mpu_rt_va for %s\n",
1690 __func__, oh->name);
1691
1692 return 0;
1693}
1694
1695/**
1696 * omap_hwmod_setup_one - set up a single hwmod
1697 * @oh_name: const char * name of the already-registered hwmod to set up
1698 *
1699 * Must be called after omap2_clk_init(). Resolves the struct clk
1700 * names to struct clk pointers for each registered omap_hwmod. Also
1701 * calls _setup() on each hwmod. Returns -EINVAL upon error or 0 upon
1702 * success.
1703 */
1704int __init omap_hwmod_setup_one(const char *oh_name)
1599{ 1705{
1600 struct omap_hwmod *oh; 1706 struct omap_hwmod *oh;
1601 int r; 1707 int r;
1602 1708
1603 if (inited) 1709 pr_debug("omap_hwmod: %s: %s\n", oh_name, __func__);
1710
1711 if (!mpu_oh) {
1712 pr_err("omap_hwmod: %s: cannot setup_one: MPU initiator hwmod %s not yet registered\n",
1713 oh_name, MPU_INITIATOR_NAME);
1604 return -EINVAL; 1714 return -EINVAL;
1715 }
1605 1716
1606 inited = 1; 1717 oh = _lookup(oh_name);
1718 if (!oh) {
1719 WARN(1, "omap_hwmod: %s: hwmod not yet registered\n", oh_name);
1720 return -EINVAL;
1721 }
1607 1722
1608 if (!ohs) 1723 if (mpu_oh->_state == _HWMOD_STATE_REGISTERED && oh != mpu_oh)
1609 return 0; 1724 omap_hwmod_setup_one(MPU_INITIATOR_NAME);
1610 1725
1611 oh = *ohs; 1726 r = _populate_mpu_rt_base(oh, NULL);
1612 while (oh) { 1727 if (IS_ERR_VALUE(r)) {
1613 if (omap_chip_is(oh->omap_chip)) { 1728 WARN(1, "omap_hwmod: %s: couldn't set mpu_rt_base\n", oh_name);
1614 r = _register(oh); 1729 return -EINVAL;
1615 WARN(r, "omap_hwmod: %s: _register returned "
1616 "%d\n", oh->name, r);
1617 }
1618 oh = *++ohs;
1619 } 1730 }
1620 1731
1732 r = _init_clocks(oh, NULL);
1733 if (IS_ERR_VALUE(r)) {
1734 WARN(1, "omap_hwmod: %s: couldn't init clocks\n", oh_name);
1735 return -EINVAL;
1736 }
1737
1738 _setup(oh, NULL);
1739
1621 return 0; 1740 return 0;
1622} 1741}
1623 1742
1624/** 1743/**
1625 * omap_hwmod_late_init - do some post-clock framework initialization 1744 * omap_hwmod_setup - do some post-clock framework initialization
1626 * 1745 *
1627 * Must be called after omap2_clk_init(). Resolves the struct clk names 1746 * Must be called after omap2_clk_init(). Resolves the struct clk names
1628 * to struct clk pointers for each registered omap_hwmod. Also calls 1747 * to struct clk pointers for each registered omap_hwmod. Also calls
1629 * _setup() on each hwmod. Returns 0. 1748 * _setup() on each hwmod. Returns 0 upon success.
1630 */ 1749 */
1631int omap_hwmod_late_init(void) 1750static int __init omap_hwmod_setup_all(void)
1632{ 1751{
1633 int r; 1752 int r;
1634 1753
1635 /* XXX check return value */ 1754 if (!mpu_oh) {
1636 r = omap_hwmod_for_each(_init_clocks, NULL); 1755 pr_err("omap_hwmod: %s: MPU initiator hwmod %s not yet registered\n",
1637 WARN(r, "omap_hwmod: omap_hwmod_late_init(): _init_clocks failed\n"); 1756 __func__, MPU_INITIATOR_NAME);
1757 return -EINVAL;
1758 }
1638 1759
1639 mpu_oh = omap_hwmod_lookup(MPU_INITIATOR_NAME); 1760 r = omap_hwmod_for_each(_populate_mpu_rt_base, NULL);
1640 WARN(!mpu_oh, "omap_hwmod: could not find MPU initiator hwmod %s\n", 1761
1641 MPU_INITIATOR_NAME); 1762 r = omap_hwmod_for_each(_init_clocks, NULL);
1763 WARN(IS_ERR_VALUE(r),
1764 "omap_hwmod: %s: _init_clocks failed\n", __func__);
1642 1765
1643 omap_hwmod_for_each(_setup, NULL); 1766 omap_hwmod_for_each(_setup, NULL);
1644 1767
1645 return 0; 1768 return 0;
1646} 1769}
1770core_initcall(omap_hwmod_setup_all);
1647 1771
1648/** 1772/**
1649 * omap_hwmod_enable - enable an omap_hwmod 1773 * omap_hwmod_enable - enable an omap_hwmod
@@ -1862,6 +1986,7 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res)
1862 os = oh->slaves[i]; 1986 os = oh->slaves[i];
1863 1987
1864 for (j = 0; j < os->addr_cnt; j++) { 1988 for (j = 0; j < os->addr_cnt; j++) {
1989 (res + r)->name = (os->addr + j)->name;
1865 (res + r)->start = (os->addr + j)->pa_start; 1990 (res + r)->start = (os->addr + j)->pa_start;
1866 (res + r)->end = (os->addr + j)->pa_end; 1991 (res + r)->end = (os->addr + j)->pa_end;
1867 (res + r)->flags = IORESOURCE_MEM; 1992 (res + r)->flags = IORESOURCE_MEM;
@@ -2162,11 +2287,11 @@ int omap_hwmod_for_each_by_class(const char *classname,
2162 * @oh: struct omap_hwmod * 2287 * @oh: struct omap_hwmod *
2163 * @state: state that _setup() should leave the hwmod in 2288 * @state: state that _setup() should leave the hwmod in
2164 * 2289 *
2165 * Sets the hwmod state that @oh will enter at the end of _setup() (called by 2290 * Sets the hwmod state that @oh will enter at the end of _setup()
2166 * omap_hwmod_late_init()). Only valid to call between calls to 2291 * (called by omap_hwmod_setup_*()). Only valid to call between
2167 * omap_hwmod_init() and omap_hwmod_late_init(). Returns 0 upon success or 2292 * calling omap_hwmod_register() and omap_hwmod_setup_*(). Returns
2168 * -EINVAL if there is a problem with the arguments or if the hwmod is 2293 * 0 upon success or -EINVAL if there is a problem with the arguments
2169 * in the wrong state. 2294 * or if the hwmod is in the wrong state.
2170 */ 2295 */
2171int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state) 2296int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state)
2172{ 2297{
@@ -2218,3 +2343,29 @@ u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh)
2218 2343
2219 return ret; 2344 return ret;
2220} 2345}
2346
2347/**
2348 * omap_hwmod_no_setup_reset - prevent a hwmod from being reset upon setup
2349 * @oh: struct omap_hwmod *
2350 *
2351 * Prevent the hwmod @oh from being reset during the setup process.
2352 * Intended for use by board-*.c files on boards with devices that
2353 * cannot tolerate being reset. Must be called before the hwmod has
2354 * been set up. Returns 0 upon success or negative error code upon
2355 * failure.
2356 */
2357int omap_hwmod_no_setup_reset(struct omap_hwmod *oh)
2358{
2359 if (!oh)
2360 return -EINVAL;
2361
2362 if (oh->_state != _HWMOD_STATE_REGISTERED) {
2363 pr_err("omap_hwmod: %s: cannot prevent setup reset; in wrong state\n",
2364 oh->name);
2365 return -EINVAL;
2366 }
2367
2368 oh->flags |= HWMOD_INIT_NO_RESET;
2369
2370 return 0;
2371}
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index b85c630b64d6..8eb3ce1bbfbe 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -18,6 +18,10 @@
18#include <plat/serial.h> 18#include <plat/serial.h>
19#include <plat/i2c.h> 19#include <plat/i2c.h>
20#include <plat/gpio.h> 20#include <plat/gpio.h>
21#include <plat/mcspi.h>
22#include <plat/dmtimer.h>
23#include <plat/l3_2xxx.h>
24#include <plat/l4_2xxx.h>
21 25
22#include "omap_hwmod_common_data.h" 26#include "omap_hwmod_common_data.h"
23 27
@@ -38,12 +42,18 @@ static struct omap_hwmod omap2420_mpu_hwmod;
38static struct omap_hwmod omap2420_iva_hwmod; 42static struct omap_hwmod omap2420_iva_hwmod;
39static struct omap_hwmod omap2420_l3_main_hwmod; 43static struct omap_hwmod omap2420_l3_main_hwmod;
40static struct omap_hwmod omap2420_l4_core_hwmod; 44static struct omap_hwmod omap2420_l4_core_hwmod;
45static struct omap_hwmod omap2420_dss_core_hwmod;
46static struct omap_hwmod omap2420_dss_dispc_hwmod;
47static struct omap_hwmod omap2420_dss_rfbi_hwmod;
48static struct omap_hwmod omap2420_dss_venc_hwmod;
41static struct omap_hwmod omap2420_wd_timer2_hwmod; 49static struct omap_hwmod omap2420_wd_timer2_hwmod;
42static struct omap_hwmod omap2420_gpio1_hwmod; 50static struct omap_hwmod omap2420_gpio1_hwmod;
43static struct omap_hwmod omap2420_gpio2_hwmod; 51static struct omap_hwmod omap2420_gpio2_hwmod;
44static struct omap_hwmod omap2420_gpio3_hwmod; 52static struct omap_hwmod omap2420_gpio3_hwmod;
45static struct omap_hwmod omap2420_gpio4_hwmod; 53static struct omap_hwmod omap2420_gpio4_hwmod;
46static struct omap_hwmod omap2420_dma_system_hwmod; 54static struct omap_hwmod omap2420_dma_system_hwmod;
55static struct omap_hwmod omap2420_mcspi1_hwmod;
56static struct omap_hwmod omap2420_mcspi2_hwmod;
47 57
48/* L3 -> L4_CORE interface */ 58/* L3 -> L4_CORE interface */
49static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = { 59static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = {
@@ -64,6 +74,19 @@ static struct omap_hwmod_ocp_if *omap2420_l3_main_slaves[] = {
64 &omap2420_mpu__l3_main, 74 &omap2420_mpu__l3_main,
65}; 75};
66 76
77/* DSS -> l3 */
78static struct omap_hwmod_ocp_if omap2420_dss__l3 = {
79 .master = &omap2420_dss_core_hwmod,
80 .slave = &omap2420_l3_main_hwmod,
81 .fw = {
82 .omap2 = {
83 .l3_perm_bit = OMAP2_L3_CORE_FW_CONNID_DSS,
84 .flags = OMAP_FIREWALL_L3,
85 }
86 },
87 .user = OCP_USER_MPU | OCP_USER_SDMA,
88};
89
67/* Master interfaces on the L3 interconnect */ 90/* Master interfaces on the L3 interconnect */
68static struct omap_hwmod_ocp_if *omap2420_l3_main_masters[] = { 91static struct omap_hwmod_ocp_if *omap2420_l3_main_masters[] = {
69 &omap2420_l3_main__l4_core, 92 &omap2420_l3_main__l4_core,
@@ -87,6 +110,44 @@ static struct omap_hwmod omap2420_uart2_hwmod;
87static struct omap_hwmod omap2420_uart3_hwmod; 110static struct omap_hwmod omap2420_uart3_hwmod;
88static struct omap_hwmod omap2420_i2c1_hwmod; 111static struct omap_hwmod omap2420_i2c1_hwmod;
89static struct omap_hwmod omap2420_i2c2_hwmod; 112static struct omap_hwmod omap2420_i2c2_hwmod;
113static struct omap_hwmod omap2420_mcbsp1_hwmod;
114static struct omap_hwmod omap2420_mcbsp2_hwmod;
115
116/* l4 core -> mcspi1 interface */
117static struct omap_hwmod_addr_space omap2420_mcspi1_addr_space[] = {
118 {
119 .pa_start = 0x48098000,
120 .pa_end = 0x480980ff,
121 .flags = ADDR_TYPE_RT,
122 },
123};
124
125static struct omap_hwmod_ocp_if omap2420_l4_core__mcspi1 = {
126 .master = &omap2420_l4_core_hwmod,
127 .slave = &omap2420_mcspi1_hwmod,
128 .clk = "mcspi1_ick",
129 .addr = omap2420_mcspi1_addr_space,
130 .addr_cnt = ARRAY_SIZE(omap2420_mcspi1_addr_space),
131 .user = OCP_USER_MPU | OCP_USER_SDMA,
132};
133
134/* l4 core -> mcspi2 interface */
135static struct omap_hwmod_addr_space omap2420_mcspi2_addr_space[] = {
136 {
137 .pa_start = 0x4809a000,
138 .pa_end = 0x4809a0ff,
139 .flags = ADDR_TYPE_RT,
140 },
141};
142
143static struct omap_hwmod_ocp_if omap2420_l4_core__mcspi2 = {
144 .master = &omap2420_l4_core_hwmod,
145 .slave = &omap2420_mcspi2_hwmod,
146 .clk = "mcspi2_ick",
147 .addr = omap2420_mcspi2_addr_space,
148 .addr_cnt = ARRAY_SIZE(omap2420_mcspi2_addr_space),
149 .user = OCP_USER_MPU | OCP_USER_SDMA,
150};
90 151
91/* L4_CORE -> L4_WKUP interface */ 152/* L4_CORE -> L4_WKUP interface */
92static struct omap_hwmod_ocp_if omap2420_l4_core__l4_wkup = { 153static struct omap_hwmod_ocp_if omap2420_l4_core__l4_wkup = {
@@ -279,6 +340,625 @@ static struct omap_hwmod omap2420_iva_hwmod = {
279 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) 340 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
280}; 341};
281 342
343/* Timer Common */
344static struct omap_hwmod_class_sysconfig omap2420_timer_sysc = {
345 .rev_offs = 0x0000,
346 .sysc_offs = 0x0010,
347 .syss_offs = 0x0014,
348 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
349 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
350 SYSC_HAS_AUTOIDLE),
351 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
352 .sysc_fields = &omap_hwmod_sysc_type1,
353};
354
355static struct omap_hwmod_class omap2420_timer_hwmod_class = {
356 .name = "timer",
357 .sysc = &omap2420_timer_sysc,
358 .rev = OMAP_TIMER_IP_VERSION_1,
359};
360
361/* timer1 */
362static struct omap_hwmod omap2420_timer1_hwmod;
363static struct omap_hwmod_irq_info omap2420_timer1_mpu_irqs[] = {
364 { .irq = 37, },
365};
366
367static struct omap_hwmod_addr_space omap2420_timer1_addrs[] = {
368 {
369 .pa_start = 0x48028000,
370 .pa_end = 0x48028000 + SZ_1K - 1,
371 .flags = ADDR_TYPE_RT
372 },
373};
374
375/* l4_wkup -> timer1 */
376static struct omap_hwmod_ocp_if omap2420_l4_wkup__timer1 = {
377 .master = &omap2420_l4_wkup_hwmod,
378 .slave = &omap2420_timer1_hwmod,
379 .clk = "gpt1_ick",
380 .addr = omap2420_timer1_addrs,
381 .addr_cnt = ARRAY_SIZE(omap2420_timer1_addrs),
382 .user = OCP_USER_MPU | OCP_USER_SDMA,
383};
384
385/* timer1 slave port */
386static struct omap_hwmod_ocp_if *omap2420_timer1_slaves[] = {
387 &omap2420_l4_wkup__timer1,
388};
389
390/* timer1 hwmod */
391static struct omap_hwmod omap2420_timer1_hwmod = {
392 .name = "timer1",
393 .mpu_irqs = omap2420_timer1_mpu_irqs,
394 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer1_mpu_irqs),
395 .main_clk = "gpt1_fck",
396 .prcm = {
397 .omap2 = {
398 .prcm_reg_id = 1,
399 .module_bit = OMAP24XX_EN_GPT1_SHIFT,
400 .module_offs = WKUP_MOD,
401 .idlest_reg_id = 1,
402 .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT,
403 },
404 },
405 .slaves = omap2420_timer1_slaves,
406 .slaves_cnt = ARRAY_SIZE(omap2420_timer1_slaves),
407 .class = &omap2420_timer_hwmod_class,
408 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
409};
410
411/* timer2 */
412static struct omap_hwmod omap2420_timer2_hwmod;
413static struct omap_hwmod_irq_info omap2420_timer2_mpu_irqs[] = {
414 { .irq = 38, },
415};
416
417static struct omap_hwmod_addr_space omap2420_timer2_addrs[] = {
418 {
419 .pa_start = 0x4802a000,
420 .pa_end = 0x4802a000 + SZ_1K - 1,
421 .flags = ADDR_TYPE_RT
422 },
423};
424
425/* l4_core -> timer2 */
426static struct omap_hwmod_ocp_if omap2420_l4_core__timer2 = {
427 .master = &omap2420_l4_core_hwmod,
428 .slave = &omap2420_timer2_hwmod,
429 .clk = "gpt2_ick",
430 .addr = omap2420_timer2_addrs,
431 .addr_cnt = ARRAY_SIZE(omap2420_timer2_addrs),
432 .user = OCP_USER_MPU | OCP_USER_SDMA,
433};
434
435/* timer2 slave port */
436static struct omap_hwmod_ocp_if *omap2420_timer2_slaves[] = {
437 &omap2420_l4_core__timer2,
438};
439
440/* timer2 hwmod */
441static struct omap_hwmod omap2420_timer2_hwmod = {
442 .name = "timer2",
443 .mpu_irqs = omap2420_timer2_mpu_irqs,
444 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer2_mpu_irqs),
445 .main_clk = "gpt2_fck",
446 .prcm = {
447 .omap2 = {
448 .prcm_reg_id = 1,
449 .module_bit = OMAP24XX_EN_GPT2_SHIFT,
450 .module_offs = CORE_MOD,
451 .idlest_reg_id = 1,
452 .idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT,
453 },
454 },
455 .slaves = omap2420_timer2_slaves,
456 .slaves_cnt = ARRAY_SIZE(omap2420_timer2_slaves),
457 .class = &omap2420_timer_hwmod_class,
458 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
459};
460
461/* timer3 */
462static struct omap_hwmod omap2420_timer3_hwmod;
463static struct omap_hwmod_irq_info omap2420_timer3_mpu_irqs[] = {
464 { .irq = 39, },
465};
466
467static struct omap_hwmod_addr_space omap2420_timer3_addrs[] = {
468 {
469 .pa_start = 0x48078000,
470 .pa_end = 0x48078000 + SZ_1K - 1,
471 .flags = ADDR_TYPE_RT
472 },
473};
474
475/* l4_core -> timer3 */
476static struct omap_hwmod_ocp_if omap2420_l4_core__timer3 = {
477 .master = &omap2420_l4_core_hwmod,
478 .slave = &omap2420_timer3_hwmod,
479 .clk = "gpt3_ick",
480 .addr = omap2420_timer3_addrs,
481 .addr_cnt = ARRAY_SIZE(omap2420_timer3_addrs),
482 .user = OCP_USER_MPU | OCP_USER_SDMA,
483};
484
485/* timer3 slave port */
486static struct omap_hwmod_ocp_if *omap2420_timer3_slaves[] = {
487 &omap2420_l4_core__timer3,
488};
489
490/* timer3 hwmod */
491static struct omap_hwmod omap2420_timer3_hwmod = {
492 .name = "timer3",
493 .mpu_irqs = omap2420_timer3_mpu_irqs,
494 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer3_mpu_irqs),
495 .main_clk = "gpt3_fck",
496 .prcm = {
497 .omap2 = {
498 .prcm_reg_id = 1,
499 .module_bit = OMAP24XX_EN_GPT3_SHIFT,
500 .module_offs = CORE_MOD,
501 .idlest_reg_id = 1,
502 .idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT,
503 },
504 },
505 .slaves = omap2420_timer3_slaves,
506 .slaves_cnt = ARRAY_SIZE(omap2420_timer3_slaves),
507 .class = &omap2420_timer_hwmod_class,
508 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
509};
510
511/* timer4 */
512static struct omap_hwmod omap2420_timer4_hwmod;
513static struct omap_hwmod_irq_info omap2420_timer4_mpu_irqs[] = {
514 { .irq = 40, },
515};
516
517static struct omap_hwmod_addr_space omap2420_timer4_addrs[] = {
518 {
519 .pa_start = 0x4807a000,
520 .pa_end = 0x4807a000 + SZ_1K - 1,
521 .flags = ADDR_TYPE_RT
522 },
523};
524
525/* l4_core -> timer4 */
526static struct omap_hwmod_ocp_if omap2420_l4_core__timer4 = {
527 .master = &omap2420_l4_core_hwmod,
528 .slave = &omap2420_timer4_hwmod,
529 .clk = "gpt4_ick",
530 .addr = omap2420_timer4_addrs,
531 .addr_cnt = ARRAY_SIZE(omap2420_timer4_addrs),
532 .user = OCP_USER_MPU | OCP_USER_SDMA,
533};
534
535/* timer4 slave port */
536static struct omap_hwmod_ocp_if *omap2420_timer4_slaves[] = {
537 &omap2420_l4_core__timer4,
538};
539
540/* timer4 hwmod */
541static struct omap_hwmod omap2420_timer4_hwmod = {
542 .name = "timer4",
543 .mpu_irqs = omap2420_timer4_mpu_irqs,
544 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer4_mpu_irqs),
545 .main_clk = "gpt4_fck",
546 .prcm = {
547 .omap2 = {
548 .prcm_reg_id = 1,
549 .module_bit = OMAP24XX_EN_GPT4_SHIFT,
550 .module_offs = CORE_MOD,
551 .idlest_reg_id = 1,
552 .idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT,
553 },
554 },
555 .slaves = omap2420_timer4_slaves,
556 .slaves_cnt = ARRAY_SIZE(omap2420_timer4_slaves),
557 .class = &omap2420_timer_hwmod_class,
558 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
559};
560
561/* timer5 */
562static struct omap_hwmod omap2420_timer5_hwmod;
563static struct omap_hwmod_irq_info omap2420_timer5_mpu_irqs[] = {
564 { .irq = 41, },
565};
566
567static struct omap_hwmod_addr_space omap2420_timer5_addrs[] = {
568 {
569 .pa_start = 0x4807c000,
570 .pa_end = 0x4807c000 + SZ_1K - 1,
571 .flags = ADDR_TYPE_RT
572 },
573};
574
575/* l4_core -> timer5 */
576static struct omap_hwmod_ocp_if omap2420_l4_core__timer5 = {
577 .master = &omap2420_l4_core_hwmod,
578 .slave = &omap2420_timer5_hwmod,
579 .clk = "gpt5_ick",
580 .addr = omap2420_timer5_addrs,
581 .addr_cnt = ARRAY_SIZE(omap2420_timer5_addrs),
582 .user = OCP_USER_MPU | OCP_USER_SDMA,
583};
584
585/* timer5 slave port */
586static struct omap_hwmod_ocp_if *omap2420_timer5_slaves[] = {
587 &omap2420_l4_core__timer5,
588};
589
590/* timer5 hwmod */
591static struct omap_hwmod omap2420_timer5_hwmod = {
592 .name = "timer5",
593 .mpu_irqs = omap2420_timer5_mpu_irqs,
594 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer5_mpu_irqs),
595 .main_clk = "gpt5_fck",
596 .prcm = {
597 .omap2 = {
598 .prcm_reg_id = 1,
599 .module_bit = OMAP24XX_EN_GPT5_SHIFT,
600 .module_offs = CORE_MOD,
601 .idlest_reg_id = 1,
602 .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT,
603 },
604 },
605 .slaves = omap2420_timer5_slaves,
606 .slaves_cnt = ARRAY_SIZE(omap2420_timer5_slaves),
607 .class = &omap2420_timer_hwmod_class,
608 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
609};
610
611
612/* timer6 */
613static struct omap_hwmod omap2420_timer6_hwmod;
614static struct omap_hwmod_irq_info omap2420_timer6_mpu_irqs[] = {
615 { .irq = 42, },
616};
617
618static struct omap_hwmod_addr_space omap2420_timer6_addrs[] = {
619 {
620 .pa_start = 0x4807e000,
621 .pa_end = 0x4807e000 + SZ_1K - 1,
622 .flags = ADDR_TYPE_RT
623 },
624};
625
626/* l4_core -> timer6 */
627static struct omap_hwmod_ocp_if omap2420_l4_core__timer6 = {
628 .master = &omap2420_l4_core_hwmod,
629 .slave = &omap2420_timer6_hwmod,
630 .clk = "gpt6_ick",
631 .addr = omap2420_timer6_addrs,
632 .addr_cnt = ARRAY_SIZE(omap2420_timer6_addrs),
633 .user = OCP_USER_MPU | OCP_USER_SDMA,
634};
635
636/* timer6 slave port */
637static struct omap_hwmod_ocp_if *omap2420_timer6_slaves[] = {
638 &omap2420_l4_core__timer6,
639};
640
641/* timer6 hwmod */
642static struct omap_hwmod omap2420_timer6_hwmod = {
643 .name = "timer6",
644 .mpu_irqs = omap2420_timer6_mpu_irqs,
645 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer6_mpu_irqs),
646 .main_clk = "gpt6_fck",
647 .prcm = {
648 .omap2 = {
649 .prcm_reg_id = 1,
650 .module_bit = OMAP24XX_EN_GPT6_SHIFT,
651 .module_offs = CORE_MOD,
652 .idlest_reg_id = 1,
653 .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT,
654 },
655 },
656 .slaves = omap2420_timer6_slaves,
657 .slaves_cnt = ARRAY_SIZE(omap2420_timer6_slaves),
658 .class = &omap2420_timer_hwmod_class,
659 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
660};
661
662/* timer7 */
663static struct omap_hwmod omap2420_timer7_hwmod;
664static struct omap_hwmod_irq_info omap2420_timer7_mpu_irqs[] = {
665 { .irq = 43, },
666};
667
668static struct omap_hwmod_addr_space omap2420_timer7_addrs[] = {
669 {
670 .pa_start = 0x48080000,
671 .pa_end = 0x48080000 + SZ_1K - 1,
672 .flags = ADDR_TYPE_RT
673 },
674};
675
676/* l4_core -> timer7 */
677static struct omap_hwmod_ocp_if omap2420_l4_core__timer7 = {
678 .master = &omap2420_l4_core_hwmod,
679 .slave = &omap2420_timer7_hwmod,
680 .clk = "gpt7_ick",
681 .addr = omap2420_timer7_addrs,
682 .addr_cnt = ARRAY_SIZE(omap2420_timer7_addrs),
683 .user = OCP_USER_MPU | OCP_USER_SDMA,
684};
685
686/* timer7 slave port */
687static struct omap_hwmod_ocp_if *omap2420_timer7_slaves[] = {
688 &omap2420_l4_core__timer7,
689};
690
691/* timer7 hwmod */
692static struct omap_hwmod omap2420_timer7_hwmod = {
693 .name = "timer7",
694 .mpu_irqs = omap2420_timer7_mpu_irqs,
695 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer7_mpu_irqs),
696 .main_clk = "gpt7_fck",
697 .prcm = {
698 .omap2 = {
699 .prcm_reg_id = 1,
700 .module_bit = OMAP24XX_EN_GPT7_SHIFT,
701 .module_offs = CORE_MOD,
702 .idlest_reg_id = 1,
703 .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT,
704 },
705 },
706 .slaves = omap2420_timer7_slaves,
707 .slaves_cnt = ARRAY_SIZE(omap2420_timer7_slaves),
708 .class = &omap2420_timer_hwmod_class,
709 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
710};
711
712/* timer8 */
713static struct omap_hwmod omap2420_timer8_hwmod;
714static struct omap_hwmod_irq_info omap2420_timer8_mpu_irqs[] = {
715 { .irq = 44, },
716};
717
718static struct omap_hwmod_addr_space omap2420_timer8_addrs[] = {
719 {
720 .pa_start = 0x48082000,
721 .pa_end = 0x48082000 + SZ_1K - 1,
722 .flags = ADDR_TYPE_RT
723 },
724};
725
726/* l4_core -> timer8 */
727static struct omap_hwmod_ocp_if omap2420_l4_core__timer8 = {
728 .master = &omap2420_l4_core_hwmod,
729 .slave = &omap2420_timer8_hwmod,
730 .clk = "gpt8_ick",
731 .addr = omap2420_timer8_addrs,
732 .addr_cnt = ARRAY_SIZE(omap2420_timer8_addrs),
733 .user = OCP_USER_MPU | OCP_USER_SDMA,
734};
735
736/* timer8 slave port */
737static struct omap_hwmod_ocp_if *omap2420_timer8_slaves[] = {
738 &omap2420_l4_core__timer8,
739};
740
741/* timer8 hwmod */
742static struct omap_hwmod omap2420_timer8_hwmod = {
743 .name = "timer8",
744 .mpu_irqs = omap2420_timer8_mpu_irqs,
745 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer8_mpu_irqs),
746 .main_clk = "gpt8_fck",
747 .prcm = {
748 .omap2 = {
749 .prcm_reg_id = 1,
750 .module_bit = OMAP24XX_EN_GPT8_SHIFT,
751 .module_offs = CORE_MOD,
752 .idlest_reg_id = 1,
753 .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT,
754 },
755 },
756 .slaves = omap2420_timer8_slaves,
757 .slaves_cnt = ARRAY_SIZE(omap2420_timer8_slaves),
758 .class = &omap2420_timer_hwmod_class,
759 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
760};
761
762/* timer9 */
763static struct omap_hwmod omap2420_timer9_hwmod;
764static struct omap_hwmod_irq_info omap2420_timer9_mpu_irqs[] = {
765 { .irq = 45, },
766};
767
768static struct omap_hwmod_addr_space omap2420_timer9_addrs[] = {
769 {
770 .pa_start = 0x48084000,
771 .pa_end = 0x48084000 + SZ_1K - 1,
772 .flags = ADDR_TYPE_RT
773 },
774};
775
776/* l4_core -> timer9 */
777static struct omap_hwmod_ocp_if omap2420_l4_core__timer9 = {
778 .master = &omap2420_l4_core_hwmod,
779 .slave = &omap2420_timer9_hwmod,
780 .clk = "gpt9_ick",
781 .addr = omap2420_timer9_addrs,
782 .addr_cnt = ARRAY_SIZE(omap2420_timer9_addrs),
783 .user = OCP_USER_MPU | OCP_USER_SDMA,
784};
785
786/* timer9 slave port */
787static struct omap_hwmod_ocp_if *omap2420_timer9_slaves[] = {
788 &omap2420_l4_core__timer9,
789};
790
791/* timer9 hwmod */
792static struct omap_hwmod omap2420_timer9_hwmod = {
793 .name = "timer9",
794 .mpu_irqs = omap2420_timer9_mpu_irqs,
795 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer9_mpu_irqs),
796 .main_clk = "gpt9_fck",
797 .prcm = {
798 .omap2 = {
799 .prcm_reg_id = 1,
800 .module_bit = OMAP24XX_EN_GPT9_SHIFT,
801 .module_offs = CORE_MOD,
802 .idlest_reg_id = 1,
803 .idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT,
804 },
805 },
806 .slaves = omap2420_timer9_slaves,
807 .slaves_cnt = ARRAY_SIZE(omap2420_timer9_slaves),
808 .class = &omap2420_timer_hwmod_class,
809 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
810};
811
812/* timer10 */
813static struct omap_hwmod omap2420_timer10_hwmod;
814static struct omap_hwmod_irq_info omap2420_timer10_mpu_irqs[] = {
815 { .irq = 46, },
816};
817
818static struct omap_hwmod_addr_space omap2420_timer10_addrs[] = {
819 {
820 .pa_start = 0x48086000,
821 .pa_end = 0x48086000 + SZ_1K - 1,
822 .flags = ADDR_TYPE_RT
823 },
824};
825
826/* l4_core -> timer10 */
827static struct omap_hwmod_ocp_if omap2420_l4_core__timer10 = {
828 .master = &omap2420_l4_core_hwmod,
829 .slave = &omap2420_timer10_hwmod,
830 .clk = "gpt10_ick",
831 .addr = omap2420_timer10_addrs,
832 .addr_cnt = ARRAY_SIZE(omap2420_timer10_addrs),
833 .user = OCP_USER_MPU | OCP_USER_SDMA,
834};
835
836/* timer10 slave port */
837static struct omap_hwmod_ocp_if *omap2420_timer10_slaves[] = {
838 &omap2420_l4_core__timer10,
839};
840
841/* timer10 hwmod */
842static struct omap_hwmod omap2420_timer10_hwmod = {
843 .name = "timer10",
844 .mpu_irqs = omap2420_timer10_mpu_irqs,
845 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer10_mpu_irqs),
846 .main_clk = "gpt10_fck",
847 .prcm = {
848 .omap2 = {
849 .prcm_reg_id = 1,
850 .module_bit = OMAP24XX_EN_GPT10_SHIFT,
851 .module_offs = CORE_MOD,
852 .idlest_reg_id = 1,
853 .idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT,
854 },
855 },
856 .slaves = omap2420_timer10_slaves,
857 .slaves_cnt = ARRAY_SIZE(omap2420_timer10_slaves),
858 .class = &omap2420_timer_hwmod_class,
859 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
860};
861
862/* timer11 */
863static struct omap_hwmod omap2420_timer11_hwmod;
864static struct omap_hwmod_irq_info omap2420_timer11_mpu_irqs[] = {
865 { .irq = 47, },
866};
867
868static struct omap_hwmod_addr_space omap2420_timer11_addrs[] = {
869 {
870 .pa_start = 0x48088000,
871 .pa_end = 0x48088000 + SZ_1K - 1,
872 .flags = ADDR_TYPE_RT
873 },
874};
875
876/* l4_core -> timer11 */
877static struct omap_hwmod_ocp_if omap2420_l4_core__timer11 = {
878 .master = &omap2420_l4_core_hwmod,
879 .slave = &omap2420_timer11_hwmod,
880 .clk = "gpt11_ick",
881 .addr = omap2420_timer11_addrs,
882 .addr_cnt = ARRAY_SIZE(omap2420_timer11_addrs),
883 .user = OCP_USER_MPU | OCP_USER_SDMA,
884};
885
886/* timer11 slave port */
887static struct omap_hwmod_ocp_if *omap2420_timer11_slaves[] = {
888 &omap2420_l4_core__timer11,
889};
890
891/* timer11 hwmod */
892static struct omap_hwmod omap2420_timer11_hwmod = {
893 .name = "timer11",
894 .mpu_irqs = omap2420_timer11_mpu_irqs,
895 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer11_mpu_irqs),
896 .main_clk = "gpt11_fck",
897 .prcm = {
898 .omap2 = {
899 .prcm_reg_id = 1,
900 .module_bit = OMAP24XX_EN_GPT11_SHIFT,
901 .module_offs = CORE_MOD,
902 .idlest_reg_id = 1,
903 .idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT,
904 },
905 },
906 .slaves = omap2420_timer11_slaves,
907 .slaves_cnt = ARRAY_SIZE(omap2420_timer11_slaves),
908 .class = &omap2420_timer_hwmod_class,
909 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
910};
911
912/* timer12 */
913static struct omap_hwmod omap2420_timer12_hwmod;
914static struct omap_hwmod_irq_info omap2420_timer12_mpu_irqs[] = {
915 { .irq = 48, },
916};
917
918static struct omap_hwmod_addr_space omap2420_timer12_addrs[] = {
919 {
920 .pa_start = 0x4808a000,
921 .pa_end = 0x4808a000 + SZ_1K - 1,
922 .flags = ADDR_TYPE_RT
923 },
924};
925
926/* l4_core -> timer12 */
927static struct omap_hwmod_ocp_if omap2420_l4_core__timer12 = {
928 .master = &omap2420_l4_core_hwmod,
929 .slave = &omap2420_timer12_hwmod,
930 .clk = "gpt12_ick",
931 .addr = omap2420_timer12_addrs,
932 .addr_cnt = ARRAY_SIZE(omap2420_timer12_addrs),
933 .user = OCP_USER_MPU | OCP_USER_SDMA,
934};
935
936/* timer12 slave port */
937static struct omap_hwmod_ocp_if *omap2420_timer12_slaves[] = {
938 &omap2420_l4_core__timer12,
939};
940
941/* timer12 hwmod */
942static struct omap_hwmod omap2420_timer12_hwmod = {
943 .name = "timer12",
944 .mpu_irqs = omap2420_timer12_mpu_irqs,
945 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer12_mpu_irqs),
946 .main_clk = "gpt12_fck",
947 .prcm = {
948 .omap2 = {
949 .prcm_reg_id = 1,
950 .module_bit = OMAP24XX_EN_GPT12_SHIFT,
951 .module_offs = CORE_MOD,
952 .idlest_reg_id = 1,
953 .idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT,
954 },
955 },
956 .slaves = omap2420_timer12_slaves,
957 .slaves_cnt = ARRAY_SIZE(omap2420_timer12_slaves),
958 .class = &omap2420_timer_hwmod_class,
959 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
960};
961
282/* l4_wkup -> wd_timer2 */ 962/* l4_wkup -> wd_timer2 */
283static struct omap_hwmod_addr_space omap2420_wd_timer2_addrs[] = { 963static struct omap_hwmod_addr_space omap2420_wd_timer2_addrs[] = {
284 { 964 {
@@ -308,7 +988,7 @@ static struct omap_hwmod_class_sysconfig omap2420_wd_timer_sysc = {
308 .sysc_offs = 0x0010, 988 .sysc_offs = 0x0010,
309 .syss_offs = 0x0014, 989 .syss_offs = 0x0014,
310 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET | 990 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET |
311 SYSC_HAS_AUTOIDLE), 991 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
312 .sysc_fields = &omap_hwmod_sysc_type1, 992 .sysc_fields = &omap_hwmod_sysc_type1,
313}; 993};
314 994
@@ -349,7 +1029,7 @@ static struct omap_hwmod_class_sysconfig uart_sysc = {
349 .syss_offs = 0x58, 1029 .syss_offs = 0x58,
350 .sysc_flags = (SYSC_HAS_SIDLEMODE | 1030 .sysc_flags = (SYSC_HAS_SIDLEMODE |
351 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | 1031 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
352 SYSC_HAS_AUTOIDLE), 1032 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
353 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), 1033 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
354 .sysc_fields = &omap_hwmod_sysc_type1, 1034 .sysc_fields = &omap_hwmod_sysc_type1,
355}; 1035};
@@ -470,12 +1150,297 @@ static struct omap_hwmod omap2420_uart3_hwmod = {
470 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 1150 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
471}; 1151};
472 1152
1153/*
1154 * 'dss' class
1155 * display sub-system
1156 */
1157
1158static struct omap_hwmod_class_sysconfig omap2420_dss_sysc = {
1159 .rev_offs = 0x0000,
1160 .sysc_offs = 0x0010,
1161 .syss_offs = 0x0014,
1162 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
1163 .sysc_fields = &omap_hwmod_sysc_type1,
1164};
1165
1166static struct omap_hwmod_class omap2420_dss_hwmod_class = {
1167 .name = "dss",
1168 .sysc = &omap2420_dss_sysc,
1169};
1170
1171static struct omap_hwmod_dma_info omap2420_dss_sdma_chs[] = {
1172 { .name = "dispc", .dma_req = 5 },
1173};
1174
1175/* dss */
1176/* dss master ports */
1177static struct omap_hwmod_ocp_if *omap2420_dss_masters[] = {
1178 &omap2420_dss__l3,
1179};
1180
1181static struct omap_hwmod_addr_space omap2420_dss_addrs[] = {
1182 {
1183 .pa_start = 0x48050000,
1184 .pa_end = 0x480503FF,
1185 .flags = ADDR_TYPE_RT
1186 },
1187};
1188
1189/* l4_core -> dss */
1190static struct omap_hwmod_ocp_if omap2420_l4_core__dss = {
1191 .master = &omap2420_l4_core_hwmod,
1192 .slave = &omap2420_dss_core_hwmod,
1193 .clk = "dss_ick",
1194 .addr = omap2420_dss_addrs,
1195 .addr_cnt = ARRAY_SIZE(omap2420_dss_addrs),
1196 .fw = {
1197 .omap2 = {
1198 .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_CORE_REGION,
1199 .flags = OMAP_FIREWALL_L4,
1200 }
1201 },
1202 .user = OCP_USER_MPU | OCP_USER_SDMA,
1203};
1204
1205/* dss slave ports */
1206static struct omap_hwmod_ocp_if *omap2420_dss_slaves[] = {
1207 &omap2420_l4_core__dss,
1208};
1209
1210static struct omap_hwmod_opt_clk dss_opt_clks[] = {
1211 { .role = "tv_clk", .clk = "dss_54m_fck" },
1212 { .role = "sys_clk", .clk = "dss2_fck" },
1213};
1214
1215static struct omap_hwmod omap2420_dss_core_hwmod = {
1216 .name = "dss_core",
1217 .class = &omap2420_dss_hwmod_class,
1218 .main_clk = "dss1_fck", /* instead of dss_fck */
1219 .sdma_reqs = omap2420_dss_sdma_chs,
1220 .sdma_reqs_cnt = ARRAY_SIZE(omap2420_dss_sdma_chs),
1221 .prcm = {
1222 .omap2 = {
1223 .prcm_reg_id = 1,
1224 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
1225 .module_offs = CORE_MOD,
1226 .idlest_reg_id = 1,
1227 .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
1228 },
1229 },
1230 .opt_clks = dss_opt_clks,
1231 .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
1232 .slaves = omap2420_dss_slaves,
1233 .slaves_cnt = ARRAY_SIZE(omap2420_dss_slaves),
1234 .masters = omap2420_dss_masters,
1235 .masters_cnt = ARRAY_SIZE(omap2420_dss_masters),
1236 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1237 .flags = HWMOD_NO_IDLEST,
1238};
1239
1240/*
1241 * 'dispc' class
1242 * display controller
1243 */
1244
1245static struct omap_hwmod_class_sysconfig omap2420_dispc_sysc = {
1246 .rev_offs = 0x0000,
1247 .sysc_offs = 0x0010,
1248 .syss_offs = 0x0014,
1249 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |
1250 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
1251 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1252 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
1253 .sysc_fields = &omap_hwmod_sysc_type1,
1254};
1255
1256static struct omap_hwmod_class omap2420_dispc_hwmod_class = {
1257 .name = "dispc",
1258 .sysc = &omap2420_dispc_sysc,
1259};
1260
1261static struct omap_hwmod_irq_info omap2420_dispc_irqs[] = {
1262 { .irq = 25 },
1263};
1264
1265static struct omap_hwmod_addr_space omap2420_dss_dispc_addrs[] = {
1266 {
1267 .pa_start = 0x48050400,
1268 .pa_end = 0x480507FF,
1269 .flags = ADDR_TYPE_RT
1270 },
1271};
1272
1273/* l4_core -> dss_dispc */
1274static struct omap_hwmod_ocp_if omap2420_l4_core__dss_dispc = {
1275 .master = &omap2420_l4_core_hwmod,
1276 .slave = &omap2420_dss_dispc_hwmod,
1277 .clk = "dss_ick",
1278 .addr = omap2420_dss_dispc_addrs,
1279 .addr_cnt = ARRAY_SIZE(omap2420_dss_dispc_addrs),
1280 .fw = {
1281 .omap2 = {
1282 .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_DISPC_REGION,
1283 .flags = OMAP_FIREWALL_L4,
1284 }
1285 },
1286 .user = OCP_USER_MPU | OCP_USER_SDMA,
1287};
1288
1289/* dss_dispc slave ports */
1290static struct omap_hwmod_ocp_if *omap2420_dss_dispc_slaves[] = {
1291 &omap2420_l4_core__dss_dispc,
1292};
1293
1294static struct omap_hwmod omap2420_dss_dispc_hwmod = {
1295 .name = "dss_dispc",
1296 .class = &omap2420_dispc_hwmod_class,
1297 .mpu_irqs = omap2420_dispc_irqs,
1298 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_dispc_irqs),
1299 .main_clk = "dss1_fck",
1300 .prcm = {
1301 .omap2 = {
1302 .prcm_reg_id = 1,
1303 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
1304 .module_offs = CORE_MOD,
1305 .idlest_reg_id = 1,
1306 .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
1307 },
1308 },
1309 .slaves = omap2420_dss_dispc_slaves,
1310 .slaves_cnt = ARRAY_SIZE(omap2420_dss_dispc_slaves),
1311 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1312 .flags = HWMOD_NO_IDLEST,
1313};
1314
1315/*
1316 * 'rfbi' class
1317 * remote frame buffer interface
1318 */
1319
1320static struct omap_hwmod_class_sysconfig omap2420_rfbi_sysc = {
1321 .rev_offs = 0x0000,
1322 .sysc_offs = 0x0010,
1323 .syss_offs = 0x0014,
1324 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
1325 SYSC_HAS_AUTOIDLE),
1326 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1327 .sysc_fields = &omap_hwmod_sysc_type1,
1328};
1329
1330static struct omap_hwmod_class omap2420_rfbi_hwmod_class = {
1331 .name = "rfbi",
1332 .sysc = &omap2420_rfbi_sysc,
1333};
1334
1335static struct omap_hwmod_addr_space omap2420_dss_rfbi_addrs[] = {
1336 {
1337 .pa_start = 0x48050800,
1338 .pa_end = 0x48050BFF,
1339 .flags = ADDR_TYPE_RT
1340 },
1341};
1342
1343/* l4_core -> dss_rfbi */
1344static struct omap_hwmod_ocp_if omap2420_l4_core__dss_rfbi = {
1345 .master = &omap2420_l4_core_hwmod,
1346 .slave = &omap2420_dss_rfbi_hwmod,
1347 .clk = "dss_ick",
1348 .addr = omap2420_dss_rfbi_addrs,
1349 .addr_cnt = ARRAY_SIZE(omap2420_dss_rfbi_addrs),
1350 .fw = {
1351 .omap2 = {
1352 .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_CORE_REGION,
1353 .flags = OMAP_FIREWALL_L4,
1354 }
1355 },
1356 .user = OCP_USER_MPU | OCP_USER_SDMA,
1357};
1358
1359/* dss_rfbi slave ports */
1360static struct omap_hwmod_ocp_if *omap2420_dss_rfbi_slaves[] = {
1361 &omap2420_l4_core__dss_rfbi,
1362};
1363
1364static struct omap_hwmod omap2420_dss_rfbi_hwmod = {
1365 .name = "dss_rfbi",
1366 .class = &omap2420_rfbi_hwmod_class,
1367 .main_clk = "dss1_fck",
1368 .prcm = {
1369 .omap2 = {
1370 .prcm_reg_id = 1,
1371 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
1372 .module_offs = CORE_MOD,
1373 },
1374 },
1375 .slaves = omap2420_dss_rfbi_slaves,
1376 .slaves_cnt = ARRAY_SIZE(omap2420_dss_rfbi_slaves),
1377 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1378 .flags = HWMOD_NO_IDLEST,
1379};
1380
1381/*
1382 * 'venc' class
1383 * video encoder
1384 */
1385
1386static struct omap_hwmod_class omap2420_venc_hwmod_class = {
1387 .name = "venc",
1388};
1389
1390/* dss_venc */
1391static struct omap_hwmod_addr_space omap2420_dss_venc_addrs[] = {
1392 {
1393 .pa_start = 0x48050C00,
1394 .pa_end = 0x48050FFF,
1395 .flags = ADDR_TYPE_RT
1396 },
1397};
1398
1399/* l4_core -> dss_venc */
1400static struct omap_hwmod_ocp_if omap2420_l4_core__dss_venc = {
1401 .master = &omap2420_l4_core_hwmod,
1402 .slave = &omap2420_dss_venc_hwmod,
1403 .clk = "dss_54m_fck",
1404 .addr = omap2420_dss_venc_addrs,
1405 .addr_cnt = ARRAY_SIZE(omap2420_dss_venc_addrs),
1406 .fw = {
1407 .omap2 = {
1408 .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_VENC_REGION,
1409 .flags = OMAP_FIREWALL_L4,
1410 }
1411 },
1412 .flags = OCPIF_SWSUP_IDLE,
1413 .user = OCP_USER_MPU | OCP_USER_SDMA,
1414};
1415
1416/* dss_venc slave ports */
1417static struct omap_hwmod_ocp_if *omap2420_dss_venc_slaves[] = {
1418 &omap2420_l4_core__dss_venc,
1419};
1420
1421static struct omap_hwmod omap2420_dss_venc_hwmod = {
1422 .name = "dss_venc",
1423 .class = &omap2420_venc_hwmod_class,
1424 .main_clk = "dss1_fck",
1425 .prcm = {
1426 .omap2 = {
1427 .prcm_reg_id = 1,
1428 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
1429 .module_offs = CORE_MOD,
1430 },
1431 },
1432 .slaves = omap2420_dss_venc_slaves,
1433 .slaves_cnt = ARRAY_SIZE(omap2420_dss_venc_slaves),
1434 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1435 .flags = HWMOD_NO_IDLEST,
1436};
1437
473/* I2C common */ 1438/* I2C common */
474static struct omap_hwmod_class_sysconfig i2c_sysc = { 1439static struct omap_hwmod_class_sysconfig i2c_sysc = {
475 .rev_offs = 0x00, 1440 .rev_offs = 0x00,
476 .sysc_offs = 0x20, 1441 .sysc_offs = 0x20,
477 .syss_offs = 0x10, 1442 .syss_offs = 0x10,
478 .sysc_flags = SYSC_HAS_SOFTRESET, 1443 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
479 .sysc_fields = &omap_hwmod_sysc_type1, 1444 .sysc_fields = &omap_hwmod_sysc_type1,
480}; 1445};
481 1446
@@ -647,7 +1612,8 @@ static struct omap_hwmod_class_sysconfig omap242x_gpio_sysc = {
647 .sysc_offs = 0x0010, 1612 .sysc_offs = 0x0010,
648 .syss_offs = 0x0014, 1613 .syss_offs = 0x0014,
649 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | 1614 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
650 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), 1615 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
1616 SYSS_HAS_RESET_STATUS),
651 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), 1617 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
652 .sysc_fields = &omap_hwmod_sysc_type1, 1618 .sysc_fields = &omap_hwmod_sysc_type1,
653}; 1619};
@@ -789,7 +1755,7 @@ static struct omap_hwmod_class_sysconfig omap2420_dma_sysc = {
789 .syss_offs = 0x0028, 1755 .syss_offs = 0x0028,
790 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE | 1756 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE |
791 SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE | 1757 SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE |
792 SYSC_HAS_AUTOIDLE), 1758 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
793 .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), 1759 .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
794 .sysc_fields = &omap_hwmod_sysc_type1, 1760 .sysc_fields = &omap_hwmod_sysc_type1,
795}; 1761};
@@ -864,16 +1830,342 @@ static struct omap_hwmod omap2420_dma_system_hwmod = {
864 .flags = HWMOD_NO_IDLEST, 1830 .flags = HWMOD_NO_IDLEST,
865}; 1831};
866 1832
1833/*
1834 * 'mailbox' class
1835 * mailbox module allowing communication between the on-chip processors
1836 * using a queued mailbox-interrupt mechanism.
1837 */
1838
1839static struct omap_hwmod_class_sysconfig omap2420_mailbox_sysc = {
1840 .rev_offs = 0x000,
1841 .sysc_offs = 0x010,
1842 .syss_offs = 0x014,
1843 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
1844 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
1845 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1846 .sysc_fields = &omap_hwmod_sysc_type1,
1847};
1848
1849static struct omap_hwmod_class omap2420_mailbox_hwmod_class = {
1850 .name = "mailbox",
1851 .sysc = &omap2420_mailbox_sysc,
1852};
1853
1854/* mailbox */
1855static struct omap_hwmod omap2420_mailbox_hwmod;
1856static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = {
1857 { .name = "dsp", .irq = 26 },
1858 { .name = "iva", .irq = 34 },
1859};
1860
1861static struct omap_hwmod_addr_space omap2420_mailbox_addrs[] = {
1862 {
1863 .pa_start = 0x48094000,
1864 .pa_end = 0x480941ff,
1865 .flags = ADDR_TYPE_RT,
1866 },
1867};
1868
1869/* l4_core -> mailbox */
1870static struct omap_hwmod_ocp_if omap2420_l4_core__mailbox = {
1871 .master = &omap2420_l4_core_hwmod,
1872 .slave = &omap2420_mailbox_hwmod,
1873 .addr = omap2420_mailbox_addrs,
1874 .addr_cnt = ARRAY_SIZE(omap2420_mailbox_addrs),
1875 .user = OCP_USER_MPU | OCP_USER_SDMA,
1876};
1877
1878/* mailbox slave ports */
1879static struct omap_hwmod_ocp_if *omap2420_mailbox_slaves[] = {
1880 &omap2420_l4_core__mailbox,
1881};
1882
1883static struct omap_hwmod omap2420_mailbox_hwmod = {
1884 .name = "mailbox",
1885 .class = &omap2420_mailbox_hwmod_class,
1886 .mpu_irqs = omap2420_mailbox_irqs,
1887 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mailbox_irqs),
1888 .main_clk = "mailboxes_ick",
1889 .prcm = {
1890 .omap2 = {
1891 .prcm_reg_id = 1,
1892 .module_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
1893 .module_offs = CORE_MOD,
1894 .idlest_reg_id = 1,
1895 .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT,
1896 },
1897 },
1898 .slaves = omap2420_mailbox_slaves,
1899 .slaves_cnt = ARRAY_SIZE(omap2420_mailbox_slaves),
1900 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1901};
1902
1903/*
1904 * 'mcspi' class
1905 * multichannel serial port interface (mcspi) / master/slave synchronous serial
1906 * bus
1907 */
1908
1909static struct omap_hwmod_class_sysconfig omap2420_mcspi_sysc = {
1910 .rev_offs = 0x0000,
1911 .sysc_offs = 0x0010,
1912 .syss_offs = 0x0014,
1913 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
1914 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
1915 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
1916 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1917 .sysc_fields = &omap_hwmod_sysc_type1,
1918};
1919
1920static struct omap_hwmod_class omap2420_mcspi_class = {
1921 .name = "mcspi",
1922 .sysc = &omap2420_mcspi_sysc,
1923 .rev = OMAP2_MCSPI_REV,
1924};
1925
1926/* mcspi1 */
1927static struct omap_hwmod_irq_info omap2420_mcspi1_mpu_irqs[] = {
1928 { .irq = 65 },
1929};
1930
1931static struct omap_hwmod_dma_info omap2420_mcspi1_sdma_reqs[] = {
1932 { .name = "tx0", .dma_req = 35 }, /* DMA_SPI1_TX0 */
1933 { .name = "rx0", .dma_req = 36 }, /* DMA_SPI1_RX0 */
1934 { .name = "tx1", .dma_req = 37 }, /* DMA_SPI1_TX1 */
1935 { .name = "rx1", .dma_req = 38 }, /* DMA_SPI1_RX1 */
1936 { .name = "tx2", .dma_req = 39 }, /* DMA_SPI1_TX2 */
1937 { .name = "rx2", .dma_req = 40 }, /* DMA_SPI1_RX2 */
1938 { .name = "tx3", .dma_req = 41 }, /* DMA_SPI1_TX3 */
1939 { .name = "rx3", .dma_req = 42 }, /* DMA_SPI1_RX3 */
1940};
1941
1942static struct omap_hwmod_ocp_if *omap2420_mcspi1_slaves[] = {
1943 &omap2420_l4_core__mcspi1,
1944};
1945
1946static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = {
1947 .num_chipselect = 4,
1948};
1949
1950static struct omap_hwmod omap2420_mcspi1_hwmod = {
1951 .name = "mcspi1_hwmod",
1952 .mpu_irqs = omap2420_mcspi1_mpu_irqs,
1953 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mcspi1_mpu_irqs),
1954 .sdma_reqs = omap2420_mcspi1_sdma_reqs,
1955 .sdma_reqs_cnt = ARRAY_SIZE(omap2420_mcspi1_sdma_reqs),
1956 .main_clk = "mcspi1_fck",
1957 .prcm = {
1958 .omap2 = {
1959 .module_offs = CORE_MOD,
1960 .prcm_reg_id = 1,
1961 .module_bit = OMAP24XX_EN_MCSPI1_SHIFT,
1962 .idlest_reg_id = 1,
1963 .idlest_idle_bit = OMAP24XX_ST_MCSPI1_SHIFT,
1964 },
1965 },
1966 .slaves = omap2420_mcspi1_slaves,
1967 .slaves_cnt = ARRAY_SIZE(omap2420_mcspi1_slaves),
1968 .class = &omap2420_mcspi_class,
1969 .dev_attr = &omap_mcspi1_dev_attr,
1970 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1971};
1972
1973/* mcspi2 */
1974static struct omap_hwmod_irq_info omap2420_mcspi2_mpu_irqs[] = {
1975 { .irq = 66 },
1976};
1977
1978static struct omap_hwmod_dma_info omap2420_mcspi2_sdma_reqs[] = {
1979 { .name = "tx0", .dma_req = 43 }, /* DMA_SPI2_TX0 */
1980 { .name = "rx0", .dma_req = 44 }, /* DMA_SPI2_RX0 */
1981 { .name = "tx1", .dma_req = 45 }, /* DMA_SPI2_TX1 */
1982 { .name = "rx1", .dma_req = 46 }, /* DMA_SPI2_RX1 */
1983};
1984
1985static struct omap_hwmod_ocp_if *omap2420_mcspi2_slaves[] = {
1986 &omap2420_l4_core__mcspi2,
1987};
1988
1989static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = {
1990 .num_chipselect = 2,
1991};
1992
1993static struct omap_hwmod omap2420_mcspi2_hwmod = {
1994 .name = "mcspi2_hwmod",
1995 .mpu_irqs = omap2420_mcspi2_mpu_irqs,
1996 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mcspi2_mpu_irqs),
1997 .sdma_reqs = omap2420_mcspi2_sdma_reqs,
1998 .sdma_reqs_cnt = ARRAY_SIZE(omap2420_mcspi2_sdma_reqs),
1999 .main_clk = "mcspi2_fck",
2000 .prcm = {
2001 .omap2 = {
2002 .module_offs = CORE_MOD,
2003 .prcm_reg_id = 1,
2004 .module_bit = OMAP24XX_EN_MCSPI2_SHIFT,
2005 .idlest_reg_id = 1,
2006 .idlest_idle_bit = OMAP24XX_ST_MCSPI2_SHIFT,
2007 },
2008 },
2009 .slaves = omap2420_mcspi2_slaves,
2010 .slaves_cnt = ARRAY_SIZE(omap2420_mcspi2_slaves),
2011 .class = &omap2420_mcspi_class,
2012 .dev_attr = &omap_mcspi2_dev_attr,
2013 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
2014};
2015
2016/*
2017 * 'mcbsp' class
2018 * multi channel buffered serial port controller
2019 */
2020
2021static struct omap_hwmod_class omap2420_mcbsp_hwmod_class = {
2022 .name = "mcbsp",
2023};
2024
2025/* mcbsp1 */
2026static struct omap_hwmod_irq_info omap2420_mcbsp1_irqs[] = {
2027 { .name = "tx", .irq = 59 },
2028 { .name = "rx", .irq = 60 },
2029};
2030
2031static struct omap_hwmod_dma_info omap2420_mcbsp1_sdma_chs[] = {
2032 { .name = "rx", .dma_req = 32 },
2033 { .name = "tx", .dma_req = 31 },
2034};
2035
2036static struct omap_hwmod_addr_space omap2420_mcbsp1_addrs[] = {
2037 {
2038 .name = "mpu",
2039 .pa_start = 0x48074000,
2040 .pa_end = 0x480740ff,
2041 .flags = ADDR_TYPE_RT
2042 },
2043};
2044
2045/* l4_core -> mcbsp1 */
2046static struct omap_hwmod_ocp_if omap2420_l4_core__mcbsp1 = {
2047 .master = &omap2420_l4_core_hwmod,
2048 .slave = &omap2420_mcbsp1_hwmod,
2049 .clk = "mcbsp1_ick",
2050 .addr = omap2420_mcbsp1_addrs,
2051 .addr_cnt = ARRAY_SIZE(omap2420_mcbsp1_addrs),
2052 .user = OCP_USER_MPU | OCP_USER_SDMA,
2053};
2054
2055/* mcbsp1 slave ports */
2056static struct omap_hwmod_ocp_if *omap2420_mcbsp1_slaves[] = {
2057 &omap2420_l4_core__mcbsp1,
2058};
2059
2060static struct omap_hwmod omap2420_mcbsp1_hwmod = {
2061 .name = "mcbsp1",
2062 .class = &omap2420_mcbsp_hwmod_class,
2063 .mpu_irqs = omap2420_mcbsp1_irqs,
2064 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mcbsp1_irqs),
2065 .sdma_reqs = omap2420_mcbsp1_sdma_chs,
2066 .sdma_reqs_cnt = ARRAY_SIZE(omap2420_mcbsp1_sdma_chs),
2067 .main_clk = "mcbsp1_fck",
2068 .prcm = {
2069 .omap2 = {
2070 .prcm_reg_id = 1,
2071 .module_bit = OMAP24XX_EN_MCBSP1_SHIFT,
2072 .module_offs = CORE_MOD,
2073 .idlest_reg_id = 1,
2074 .idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT,
2075 },
2076 },
2077 .slaves = omap2420_mcbsp1_slaves,
2078 .slaves_cnt = ARRAY_SIZE(omap2420_mcbsp1_slaves),
2079 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
2080};
2081
2082/* mcbsp2 */
2083static struct omap_hwmod_irq_info omap2420_mcbsp2_irqs[] = {
2084 { .name = "tx", .irq = 62 },
2085 { .name = "rx", .irq = 63 },
2086};
2087
2088static struct omap_hwmod_dma_info omap2420_mcbsp2_sdma_chs[] = {
2089 { .name = "rx", .dma_req = 34 },
2090 { .name = "tx", .dma_req = 33 },
2091};
2092
2093static struct omap_hwmod_addr_space omap2420_mcbsp2_addrs[] = {
2094 {
2095 .name = "mpu",
2096 .pa_start = 0x48076000,
2097 .pa_end = 0x480760ff,
2098 .flags = ADDR_TYPE_RT
2099 },
2100};
2101
2102/* l4_core -> mcbsp2 */
2103static struct omap_hwmod_ocp_if omap2420_l4_core__mcbsp2 = {
2104 .master = &omap2420_l4_core_hwmod,
2105 .slave = &omap2420_mcbsp2_hwmod,
2106 .clk = "mcbsp2_ick",
2107 .addr = omap2420_mcbsp2_addrs,
2108 .addr_cnt = ARRAY_SIZE(omap2420_mcbsp2_addrs),
2109 .user = OCP_USER_MPU | OCP_USER_SDMA,
2110};
2111
2112/* mcbsp2 slave ports */
2113static struct omap_hwmod_ocp_if *omap2420_mcbsp2_slaves[] = {
2114 &omap2420_l4_core__mcbsp2,
2115};
2116
2117static struct omap_hwmod omap2420_mcbsp2_hwmod = {
2118 .name = "mcbsp2",
2119 .class = &omap2420_mcbsp_hwmod_class,
2120 .mpu_irqs = omap2420_mcbsp2_irqs,
2121 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mcbsp2_irqs),
2122 .sdma_reqs = omap2420_mcbsp2_sdma_chs,
2123 .sdma_reqs_cnt = ARRAY_SIZE(omap2420_mcbsp2_sdma_chs),
2124 .main_clk = "mcbsp2_fck",
2125 .prcm = {
2126 .omap2 = {
2127 .prcm_reg_id = 1,
2128 .module_bit = OMAP24XX_EN_MCBSP2_SHIFT,
2129 .module_offs = CORE_MOD,
2130 .idlest_reg_id = 1,
2131 .idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT,
2132 },
2133 },
2134 .slaves = omap2420_mcbsp2_slaves,
2135 .slaves_cnt = ARRAY_SIZE(omap2420_mcbsp2_slaves),
2136 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
2137};
2138
867static __initdata struct omap_hwmod *omap2420_hwmods[] = { 2139static __initdata struct omap_hwmod *omap2420_hwmods[] = {
868 &omap2420_l3_main_hwmod, 2140 &omap2420_l3_main_hwmod,
869 &omap2420_l4_core_hwmod, 2141 &omap2420_l4_core_hwmod,
870 &omap2420_l4_wkup_hwmod, 2142 &omap2420_l4_wkup_hwmod,
871 &omap2420_mpu_hwmod, 2143 &omap2420_mpu_hwmod,
872 &omap2420_iva_hwmod, 2144 &omap2420_iva_hwmod,
2145
2146 &omap2420_timer1_hwmod,
2147 &omap2420_timer2_hwmod,
2148 &omap2420_timer3_hwmod,
2149 &omap2420_timer4_hwmod,
2150 &omap2420_timer5_hwmod,
2151 &omap2420_timer6_hwmod,
2152 &omap2420_timer7_hwmod,
2153 &omap2420_timer8_hwmod,
2154 &omap2420_timer9_hwmod,
2155 &omap2420_timer10_hwmod,
2156 &omap2420_timer11_hwmod,
2157 &omap2420_timer12_hwmod,
2158
873 &omap2420_wd_timer2_hwmod, 2159 &omap2420_wd_timer2_hwmod,
874 &omap2420_uart1_hwmod, 2160 &omap2420_uart1_hwmod,
875 &omap2420_uart2_hwmod, 2161 &omap2420_uart2_hwmod,
876 &omap2420_uart3_hwmod, 2162 &omap2420_uart3_hwmod,
2163 /* dss class */
2164 &omap2420_dss_core_hwmod,
2165 &omap2420_dss_dispc_hwmod,
2166 &omap2420_dss_rfbi_hwmod,
2167 &omap2420_dss_venc_hwmod,
2168 /* i2c class */
877 &omap2420_i2c1_hwmod, 2169 &omap2420_i2c1_hwmod,
878 &omap2420_i2c2_hwmod, 2170 &omap2420_i2c2_hwmod,
879 2171
@@ -885,10 +2177,21 @@ static __initdata struct omap_hwmod *omap2420_hwmods[] = {
885 2177
886 /* dma_system class*/ 2178 /* dma_system class*/
887 &omap2420_dma_system_hwmod, 2179 &omap2420_dma_system_hwmod,
2180
2181 /* mailbox class */
2182 &omap2420_mailbox_hwmod,
2183
2184 /* mcbsp class */
2185 &omap2420_mcbsp1_hwmod,
2186 &omap2420_mcbsp2_hwmod,
2187
2188 /* mcspi class */
2189 &omap2420_mcspi1_hwmod,
2190 &omap2420_mcspi2_hwmod,
888 NULL, 2191 NULL,
889}; 2192};
890 2193
891int __init omap2420_hwmod_init(void) 2194int __init omap2420_hwmod_init(void)
892{ 2195{
893 return omap_hwmod_init(omap2420_hwmods); 2196 return omap_hwmod_register(omap2420_hwmods);
894} 2197}
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 8ecfbcde13ba..a860fb5024c2 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -18,6 +18,11 @@
18#include <plat/serial.h> 18#include <plat/serial.h>
19#include <plat/i2c.h> 19#include <plat/i2c.h>
20#include <plat/gpio.h> 20#include <plat/gpio.h>
21#include <plat/mcbsp.h>
22#include <plat/mcspi.h>
23#include <plat/dmtimer.h>
24#include <plat/mmc.h>
25#include <plat/l3_2xxx.h>
21 26
22#include "omap_hwmod_common_data.h" 27#include "omap_hwmod_common_data.h"
23 28
@@ -38,6 +43,10 @@ static struct omap_hwmod omap2430_mpu_hwmod;
38static struct omap_hwmod omap2430_iva_hwmod; 43static struct omap_hwmod omap2430_iva_hwmod;
39static struct omap_hwmod omap2430_l3_main_hwmod; 44static struct omap_hwmod omap2430_l3_main_hwmod;
40static struct omap_hwmod omap2430_l4_core_hwmod; 45static struct omap_hwmod omap2430_l4_core_hwmod;
46static struct omap_hwmod omap2430_dss_core_hwmod;
47static struct omap_hwmod omap2430_dss_dispc_hwmod;
48static struct omap_hwmod omap2430_dss_rfbi_hwmod;
49static struct omap_hwmod omap2430_dss_venc_hwmod;
41static struct omap_hwmod omap2430_wd_timer2_hwmod; 50static struct omap_hwmod omap2430_wd_timer2_hwmod;
42static struct omap_hwmod omap2430_gpio1_hwmod; 51static struct omap_hwmod omap2430_gpio1_hwmod;
43static struct omap_hwmod omap2430_gpio2_hwmod; 52static struct omap_hwmod omap2430_gpio2_hwmod;
@@ -45,6 +54,16 @@ static struct omap_hwmod omap2430_gpio3_hwmod;
45static struct omap_hwmod omap2430_gpio4_hwmod; 54static struct omap_hwmod omap2430_gpio4_hwmod;
46static struct omap_hwmod omap2430_gpio5_hwmod; 55static struct omap_hwmod omap2430_gpio5_hwmod;
47static struct omap_hwmod omap2430_dma_system_hwmod; 56static struct omap_hwmod omap2430_dma_system_hwmod;
57static struct omap_hwmod omap2430_mcbsp1_hwmod;
58static struct omap_hwmod omap2430_mcbsp2_hwmod;
59static struct omap_hwmod omap2430_mcbsp3_hwmod;
60static struct omap_hwmod omap2430_mcbsp4_hwmod;
61static struct omap_hwmod omap2430_mcbsp5_hwmod;
62static struct omap_hwmod omap2430_mcspi1_hwmod;
63static struct omap_hwmod omap2430_mcspi2_hwmod;
64static struct omap_hwmod omap2430_mcspi3_hwmod;
65static struct omap_hwmod omap2430_mmc1_hwmod;
66static struct omap_hwmod omap2430_mmc2_hwmod;
48 67
49/* L3 -> L4_CORE interface */ 68/* L3 -> L4_CORE interface */
50static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = { 69static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = {
@@ -65,6 +84,19 @@ static struct omap_hwmod_ocp_if *omap2430_l3_main_slaves[] = {
65 &omap2430_mpu__l3_main, 84 &omap2430_mpu__l3_main,
66}; 85};
67 86
87/* DSS -> l3 */
88static struct omap_hwmod_ocp_if omap2430_dss__l3 = {
89 .master = &omap2430_dss_core_hwmod,
90 .slave = &omap2430_l3_main_hwmod,
91 .fw = {
92 .omap2 = {
93 .l3_perm_bit = OMAP2_L3_CORE_FW_CONNID_DSS,
94 .flags = OMAP_FIREWALL_L3,
95 }
96 },
97 .user = OCP_USER_MPU | OCP_USER_SDMA,
98};
99
68/* Master interfaces on the L3 interconnect */ 100/* Master interfaces on the L3 interconnect */
69static struct omap_hwmod_ocp_if *omap2430_l3_main_masters[] = { 101static struct omap_hwmod_ocp_if *omap2430_l3_main_masters[] = {
70 &omap2430_l3_main__l4_core, 102 &omap2430_l3_main__l4_core,
@@ -89,6 +121,16 @@ static struct omap_hwmod omap2430_uart3_hwmod;
89static struct omap_hwmod omap2430_i2c1_hwmod; 121static struct omap_hwmod omap2430_i2c1_hwmod;
90static struct omap_hwmod omap2430_i2c2_hwmod; 122static struct omap_hwmod omap2430_i2c2_hwmod;
91 123
124static struct omap_hwmod omap2430_usbhsotg_hwmod;
125
126/* l3_core -> usbhsotg interface */
127static struct omap_hwmod_ocp_if omap2430_usbhsotg__l3 = {
128 .master = &omap2430_usbhsotg_hwmod,
129 .slave = &omap2430_l3_main_hwmod,
130 .clk = "core_l3_ck",
131 .user = OCP_USER_MPU,
132};
133
92/* I2C IP block address space length (in bytes) */ 134/* I2C IP block address space length (in bytes) */
93#define OMAP2_I2C_AS_LEN 128 135#define OMAP2_I2C_AS_LEN 128
94 136
@@ -189,6 +231,71 @@ static struct omap_hwmod_ocp_if omap2_l4_core__uart3 = {
189 .user = OCP_USER_MPU | OCP_USER_SDMA, 231 .user = OCP_USER_MPU | OCP_USER_SDMA,
190}; 232};
191 233
234/*
235* usbhsotg interface data
236*/
237static struct omap_hwmod_addr_space omap2430_usbhsotg_addrs[] = {
238 {
239 .pa_start = OMAP243X_HS_BASE,
240 .pa_end = OMAP243X_HS_BASE + SZ_4K - 1,
241 .flags = ADDR_TYPE_RT
242 },
243};
244
245/* l4_core ->usbhsotg interface */
246static struct omap_hwmod_ocp_if omap2430_l4_core__usbhsotg = {
247 .master = &omap2430_l4_core_hwmod,
248 .slave = &omap2430_usbhsotg_hwmod,
249 .clk = "usb_l4_ick",
250 .addr = omap2430_usbhsotg_addrs,
251 .addr_cnt = ARRAY_SIZE(omap2430_usbhsotg_addrs),
252 .user = OCP_USER_MPU,
253};
254
255static struct omap_hwmod_ocp_if *omap2430_usbhsotg_masters[] = {
256 &omap2430_usbhsotg__l3,
257};
258
259static struct omap_hwmod_ocp_if *omap2430_usbhsotg_slaves[] = {
260 &omap2430_l4_core__usbhsotg,
261};
262
263/* L4 CORE -> MMC1 interface */
264static struct omap_hwmod_addr_space omap2430_mmc1_addr_space[] = {
265 {
266 .pa_start = 0x4809c000,
267 .pa_end = 0x4809c1ff,
268 .flags = ADDR_TYPE_RT,
269 },
270};
271
272static struct omap_hwmod_ocp_if omap2430_l4_core__mmc1 = {
273 .master = &omap2430_l4_core_hwmod,
274 .slave = &omap2430_mmc1_hwmod,
275 .clk = "mmchs1_ick",
276 .addr = omap2430_mmc1_addr_space,
277 .addr_cnt = ARRAY_SIZE(omap2430_mmc1_addr_space),
278 .user = OCP_USER_MPU | OCP_USER_SDMA,
279};
280
281/* L4 CORE -> MMC2 interface */
282static struct omap_hwmod_addr_space omap2430_mmc2_addr_space[] = {
283 {
284 .pa_start = 0x480b4000,
285 .pa_end = 0x480b41ff,
286 .flags = ADDR_TYPE_RT,
287 },
288};
289
290static struct omap_hwmod_ocp_if omap2430_l4_core__mmc2 = {
291 .master = &omap2430_l4_core_hwmod,
292 .slave = &omap2430_mmc2_hwmod,
293 .addr = omap2430_mmc2_addr_space,
294 .clk = "mmchs2_ick",
295 .addr_cnt = ARRAY_SIZE(omap2430_mmc2_addr_space),
296 .user = OCP_USER_MPU | OCP_USER_SDMA,
297};
298
192/* Slave interfaces on the L4_CORE interconnect */ 299/* Slave interfaces on the L4_CORE interconnect */
193static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = { 300static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = {
194 &omap2430_l3_main__l4_core, 301 &omap2430_l3_main__l4_core,
@@ -197,6 +304,8 @@ static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = {
197/* Master interfaces on the L4_CORE interconnect */ 304/* Master interfaces on the L4_CORE interconnect */
198static struct omap_hwmod_ocp_if *omap2430_l4_core_masters[] = { 305static struct omap_hwmod_ocp_if *omap2430_l4_core_masters[] = {
199 &omap2430_l4_core__l4_wkup, 306 &omap2430_l4_core__l4_wkup,
307 &omap2430_l4_core__mmc1,
308 &omap2430_l4_core__mmc2,
200}; 309};
201 310
202/* L4 CORE */ 311/* L4 CORE */
@@ -223,6 +332,60 @@ static struct omap_hwmod_ocp_if *omap2430_l4_wkup_slaves[] = {
223static struct omap_hwmod_ocp_if *omap2430_l4_wkup_masters[] = { 332static struct omap_hwmod_ocp_if *omap2430_l4_wkup_masters[] = {
224}; 333};
225 334
335/* l4 core -> mcspi1 interface */
336static struct omap_hwmod_addr_space omap2430_mcspi1_addr_space[] = {
337 {
338 .pa_start = 0x48098000,
339 .pa_end = 0x480980ff,
340 .flags = ADDR_TYPE_RT,
341 },
342};
343
344static struct omap_hwmod_ocp_if omap2430_l4_core__mcspi1 = {
345 .master = &omap2430_l4_core_hwmod,
346 .slave = &omap2430_mcspi1_hwmod,
347 .clk = "mcspi1_ick",
348 .addr = omap2430_mcspi1_addr_space,
349 .addr_cnt = ARRAY_SIZE(omap2430_mcspi1_addr_space),
350 .user = OCP_USER_MPU | OCP_USER_SDMA,
351};
352
353/* l4 core -> mcspi2 interface */
354static struct omap_hwmod_addr_space omap2430_mcspi2_addr_space[] = {
355 {
356 .pa_start = 0x4809a000,
357 .pa_end = 0x4809a0ff,
358 .flags = ADDR_TYPE_RT,
359 },
360};
361
362static struct omap_hwmod_ocp_if omap2430_l4_core__mcspi2 = {
363 .master = &omap2430_l4_core_hwmod,
364 .slave = &omap2430_mcspi2_hwmod,
365 .clk = "mcspi2_ick",
366 .addr = omap2430_mcspi2_addr_space,
367 .addr_cnt = ARRAY_SIZE(omap2430_mcspi2_addr_space),
368 .user = OCP_USER_MPU | OCP_USER_SDMA,
369};
370
371/* l4 core -> mcspi3 interface */
372static struct omap_hwmod_addr_space omap2430_mcspi3_addr_space[] = {
373 {
374 .pa_start = 0x480b8000,
375 .pa_end = 0x480b80ff,
376 .flags = ADDR_TYPE_RT,
377 },
378};
379
380static struct omap_hwmod_ocp_if omap2430_l4_core__mcspi3 = {
381 .master = &omap2430_l4_core_hwmod,
382 .slave = &omap2430_mcspi3_hwmod,
383 .clk = "mcspi3_ick",
384 .addr = omap2430_mcspi3_addr_space,
385 .addr_cnt = ARRAY_SIZE(omap2430_mcspi3_addr_space),
386 .user = OCP_USER_MPU | OCP_USER_SDMA,
387};
388
226/* L4 WKUP */ 389/* L4 WKUP */
227static struct omap_hwmod omap2430_l4_wkup_hwmod = { 390static struct omap_hwmod omap2430_l4_wkup_hwmod = {
228 .name = "l4_wkup", 391 .name = "l4_wkup",
@@ -278,6 +441,624 @@ static struct omap_hwmod omap2430_iva_hwmod = {
278 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) 441 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
279}; 442};
280 443
444/* Timer Common */
445static struct omap_hwmod_class_sysconfig omap2430_timer_sysc = {
446 .rev_offs = 0x0000,
447 .sysc_offs = 0x0010,
448 .syss_offs = 0x0014,
449 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
450 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
451 SYSC_HAS_AUTOIDLE),
452 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
453 .sysc_fields = &omap_hwmod_sysc_type1,
454};
455
456static struct omap_hwmod_class omap2430_timer_hwmod_class = {
457 .name = "timer",
458 .sysc = &omap2430_timer_sysc,
459 .rev = OMAP_TIMER_IP_VERSION_1,
460};
461
462/* timer1 */
463static struct omap_hwmod omap2430_timer1_hwmod;
464static struct omap_hwmod_irq_info omap2430_timer1_mpu_irqs[] = {
465 { .irq = 37, },
466};
467
468static struct omap_hwmod_addr_space omap2430_timer1_addrs[] = {
469 {
470 .pa_start = 0x49018000,
471 .pa_end = 0x49018000 + SZ_1K - 1,
472 .flags = ADDR_TYPE_RT
473 },
474};
475
476/* l4_wkup -> timer1 */
477static struct omap_hwmod_ocp_if omap2430_l4_wkup__timer1 = {
478 .master = &omap2430_l4_wkup_hwmod,
479 .slave = &omap2430_timer1_hwmod,
480 .clk = "gpt1_ick",
481 .addr = omap2430_timer1_addrs,
482 .addr_cnt = ARRAY_SIZE(omap2430_timer1_addrs),
483 .user = OCP_USER_MPU | OCP_USER_SDMA,
484};
485
486/* timer1 slave port */
487static struct omap_hwmod_ocp_if *omap2430_timer1_slaves[] = {
488 &omap2430_l4_wkup__timer1,
489};
490
491/* timer1 hwmod */
492static struct omap_hwmod omap2430_timer1_hwmod = {
493 .name = "timer1",
494 .mpu_irqs = omap2430_timer1_mpu_irqs,
495 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer1_mpu_irqs),
496 .main_clk = "gpt1_fck",
497 .prcm = {
498 .omap2 = {
499 .prcm_reg_id = 1,
500 .module_bit = OMAP24XX_EN_GPT1_SHIFT,
501 .module_offs = WKUP_MOD,
502 .idlest_reg_id = 1,
503 .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT,
504 },
505 },
506 .slaves = omap2430_timer1_slaves,
507 .slaves_cnt = ARRAY_SIZE(omap2430_timer1_slaves),
508 .class = &omap2430_timer_hwmod_class,
509 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
510};
511
512/* timer2 */
513static struct omap_hwmod omap2430_timer2_hwmod;
514static struct omap_hwmod_irq_info omap2430_timer2_mpu_irqs[] = {
515 { .irq = 38, },
516};
517
518static struct omap_hwmod_addr_space omap2430_timer2_addrs[] = {
519 {
520 .pa_start = 0x4802a000,
521 .pa_end = 0x4802a000 + SZ_1K - 1,
522 .flags = ADDR_TYPE_RT
523 },
524};
525
526/* l4_core -> timer2 */
527static struct omap_hwmod_ocp_if omap2430_l4_core__timer2 = {
528 .master = &omap2430_l4_core_hwmod,
529 .slave = &omap2430_timer2_hwmod,
530 .clk = "gpt2_ick",
531 .addr = omap2430_timer2_addrs,
532 .addr_cnt = ARRAY_SIZE(omap2430_timer2_addrs),
533 .user = OCP_USER_MPU | OCP_USER_SDMA,
534};
535
536/* timer2 slave port */
537static struct omap_hwmod_ocp_if *omap2430_timer2_slaves[] = {
538 &omap2430_l4_core__timer2,
539};
540
541/* timer2 hwmod */
542static struct omap_hwmod omap2430_timer2_hwmod = {
543 .name = "timer2",
544 .mpu_irqs = omap2430_timer2_mpu_irqs,
545 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer2_mpu_irqs),
546 .main_clk = "gpt2_fck",
547 .prcm = {
548 .omap2 = {
549 .prcm_reg_id = 1,
550 .module_bit = OMAP24XX_EN_GPT2_SHIFT,
551 .module_offs = CORE_MOD,
552 .idlest_reg_id = 1,
553 .idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT,
554 },
555 },
556 .slaves = omap2430_timer2_slaves,
557 .slaves_cnt = ARRAY_SIZE(omap2430_timer2_slaves),
558 .class = &omap2430_timer_hwmod_class,
559 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
560};
561
562/* timer3 */
563static struct omap_hwmod omap2430_timer3_hwmod;
564static struct omap_hwmod_irq_info omap2430_timer3_mpu_irqs[] = {
565 { .irq = 39, },
566};
567
568static struct omap_hwmod_addr_space omap2430_timer3_addrs[] = {
569 {
570 .pa_start = 0x48078000,
571 .pa_end = 0x48078000 + SZ_1K - 1,
572 .flags = ADDR_TYPE_RT
573 },
574};
575
576/* l4_core -> timer3 */
577static struct omap_hwmod_ocp_if omap2430_l4_core__timer3 = {
578 .master = &omap2430_l4_core_hwmod,
579 .slave = &omap2430_timer3_hwmod,
580 .clk = "gpt3_ick",
581 .addr = omap2430_timer3_addrs,
582 .addr_cnt = ARRAY_SIZE(omap2430_timer3_addrs),
583 .user = OCP_USER_MPU | OCP_USER_SDMA,
584};
585
586/* timer3 slave port */
587static struct omap_hwmod_ocp_if *omap2430_timer3_slaves[] = {
588 &omap2430_l4_core__timer3,
589};
590
591/* timer3 hwmod */
592static struct omap_hwmod omap2430_timer3_hwmod = {
593 .name = "timer3",
594 .mpu_irqs = omap2430_timer3_mpu_irqs,
595 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer3_mpu_irqs),
596 .main_clk = "gpt3_fck",
597 .prcm = {
598 .omap2 = {
599 .prcm_reg_id = 1,
600 .module_bit = OMAP24XX_EN_GPT3_SHIFT,
601 .module_offs = CORE_MOD,
602 .idlest_reg_id = 1,
603 .idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT,
604 },
605 },
606 .slaves = omap2430_timer3_slaves,
607 .slaves_cnt = ARRAY_SIZE(omap2430_timer3_slaves),
608 .class = &omap2430_timer_hwmod_class,
609 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
610};
611
612/* timer4 */
613static struct omap_hwmod omap2430_timer4_hwmod;
614static struct omap_hwmod_irq_info omap2430_timer4_mpu_irqs[] = {
615 { .irq = 40, },
616};
617
618static struct omap_hwmod_addr_space omap2430_timer4_addrs[] = {
619 {
620 .pa_start = 0x4807a000,
621 .pa_end = 0x4807a000 + SZ_1K - 1,
622 .flags = ADDR_TYPE_RT
623 },
624};
625
626/* l4_core -> timer4 */
627static struct omap_hwmod_ocp_if omap2430_l4_core__timer4 = {
628 .master = &omap2430_l4_core_hwmod,
629 .slave = &omap2430_timer4_hwmod,
630 .clk = "gpt4_ick",
631 .addr = omap2430_timer4_addrs,
632 .addr_cnt = ARRAY_SIZE(omap2430_timer4_addrs),
633 .user = OCP_USER_MPU | OCP_USER_SDMA,
634};
635
636/* timer4 slave port */
637static struct omap_hwmod_ocp_if *omap2430_timer4_slaves[] = {
638 &omap2430_l4_core__timer4,
639};
640
641/* timer4 hwmod */
642static struct omap_hwmod omap2430_timer4_hwmod = {
643 .name = "timer4",
644 .mpu_irqs = omap2430_timer4_mpu_irqs,
645 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer4_mpu_irqs),
646 .main_clk = "gpt4_fck",
647 .prcm = {
648 .omap2 = {
649 .prcm_reg_id = 1,
650 .module_bit = OMAP24XX_EN_GPT4_SHIFT,
651 .module_offs = CORE_MOD,
652 .idlest_reg_id = 1,
653 .idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT,
654 },
655 },
656 .slaves = omap2430_timer4_slaves,
657 .slaves_cnt = ARRAY_SIZE(omap2430_timer4_slaves),
658 .class = &omap2430_timer_hwmod_class,
659 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
660};
661
662/* timer5 */
663static struct omap_hwmod omap2430_timer5_hwmod;
664static struct omap_hwmod_irq_info omap2430_timer5_mpu_irqs[] = {
665 { .irq = 41, },
666};
667
668static struct omap_hwmod_addr_space omap2430_timer5_addrs[] = {
669 {
670 .pa_start = 0x4807c000,
671 .pa_end = 0x4807c000 + SZ_1K - 1,
672 .flags = ADDR_TYPE_RT
673 },
674};
675
676/* l4_core -> timer5 */
677static struct omap_hwmod_ocp_if omap2430_l4_core__timer5 = {
678 .master = &omap2430_l4_core_hwmod,
679 .slave = &omap2430_timer5_hwmod,
680 .clk = "gpt5_ick",
681 .addr = omap2430_timer5_addrs,
682 .addr_cnt = ARRAY_SIZE(omap2430_timer5_addrs),
683 .user = OCP_USER_MPU | OCP_USER_SDMA,
684};
685
686/* timer5 slave port */
687static struct omap_hwmod_ocp_if *omap2430_timer5_slaves[] = {
688 &omap2430_l4_core__timer5,
689};
690
691/* timer5 hwmod */
692static struct omap_hwmod omap2430_timer5_hwmod = {
693 .name = "timer5",
694 .mpu_irqs = omap2430_timer5_mpu_irqs,
695 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer5_mpu_irqs),
696 .main_clk = "gpt5_fck",
697 .prcm = {
698 .omap2 = {
699 .prcm_reg_id = 1,
700 .module_bit = OMAP24XX_EN_GPT5_SHIFT,
701 .module_offs = CORE_MOD,
702 .idlest_reg_id = 1,
703 .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT,
704 },
705 },
706 .slaves = omap2430_timer5_slaves,
707 .slaves_cnt = ARRAY_SIZE(omap2430_timer5_slaves),
708 .class = &omap2430_timer_hwmod_class,
709 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
710};
711
712/* timer6 */
713static struct omap_hwmod omap2430_timer6_hwmod;
714static struct omap_hwmod_irq_info omap2430_timer6_mpu_irqs[] = {
715 { .irq = 42, },
716};
717
718static struct omap_hwmod_addr_space omap2430_timer6_addrs[] = {
719 {
720 .pa_start = 0x4807e000,
721 .pa_end = 0x4807e000 + SZ_1K - 1,
722 .flags = ADDR_TYPE_RT
723 },
724};
725
726/* l4_core -> timer6 */
727static struct omap_hwmod_ocp_if omap2430_l4_core__timer6 = {
728 .master = &omap2430_l4_core_hwmod,
729 .slave = &omap2430_timer6_hwmod,
730 .clk = "gpt6_ick",
731 .addr = omap2430_timer6_addrs,
732 .addr_cnt = ARRAY_SIZE(omap2430_timer6_addrs),
733 .user = OCP_USER_MPU | OCP_USER_SDMA,
734};
735
736/* timer6 slave port */
737static struct omap_hwmod_ocp_if *omap2430_timer6_slaves[] = {
738 &omap2430_l4_core__timer6,
739};
740
741/* timer6 hwmod */
742static struct omap_hwmod omap2430_timer6_hwmod = {
743 .name = "timer6",
744 .mpu_irqs = omap2430_timer6_mpu_irqs,
745 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer6_mpu_irqs),
746 .main_clk = "gpt6_fck",
747 .prcm = {
748 .omap2 = {
749 .prcm_reg_id = 1,
750 .module_bit = OMAP24XX_EN_GPT6_SHIFT,
751 .module_offs = CORE_MOD,
752 .idlest_reg_id = 1,
753 .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT,
754 },
755 },
756 .slaves = omap2430_timer6_slaves,
757 .slaves_cnt = ARRAY_SIZE(omap2430_timer6_slaves),
758 .class = &omap2430_timer_hwmod_class,
759 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
760};
761
762/* timer7 */
763static struct omap_hwmod omap2430_timer7_hwmod;
764static struct omap_hwmod_irq_info omap2430_timer7_mpu_irqs[] = {
765 { .irq = 43, },
766};
767
768static struct omap_hwmod_addr_space omap2430_timer7_addrs[] = {
769 {
770 .pa_start = 0x48080000,
771 .pa_end = 0x48080000 + SZ_1K - 1,
772 .flags = ADDR_TYPE_RT
773 },
774};
775
776/* l4_core -> timer7 */
777static struct omap_hwmod_ocp_if omap2430_l4_core__timer7 = {
778 .master = &omap2430_l4_core_hwmod,
779 .slave = &omap2430_timer7_hwmod,
780 .clk = "gpt7_ick",
781 .addr = omap2430_timer7_addrs,
782 .addr_cnt = ARRAY_SIZE(omap2430_timer7_addrs),
783 .user = OCP_USER_MPU | OCP_USER_SDMA,
784};
785
786/* timer7 slave port */
787static struct omap_hwmod_ocp_if *omap2430_timer7_slaves[] = {
788 &omap2430_l4_core__timer7,
789};
790
791/* timer7 hwmod */
792static struct omap_hwmod omap2430_timer7_hwmod = {
793 .name = "timer7",
794 .mpu_irqs = omap2430_timer7_mpu_irqs,
795 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer7_mpu_irqs),
796 .main_clk = "gpt7_fck",
797 .prcm = {
798 .omap2 = {
799 .prcm_reg_id = 1,
800 .module_bit = OMAP24XX_EN_GPT7_SHIFT,
801 .module_offs = CORE_MOD,
802 .idlest_reg_id = 1,
803 .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT,
804 },
805 },
806 .slaves = omap2430_timer7_slaves,
807 .slaves_cnt = ARRAY_SIZE(omap2430_timer7_slaves),
808 .class = &omap2430_timer_hwmod_class,
809 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
810};
811
812/* timer8 */
813static struct omap_hwmod omap2430_timer8_hwmod;
814static struct omap_hwmod_irq_info omap2430_timer8_mpu_irqs[] = {
815 { .irq = 44, },
816};
817
818static struct omap_hwmod_addr_space omap2430_timer8_addrs[] = {
819 {
820 .pa_start = 0x48082000,
821 .pa_end = 0x48082000 + SZ_1K - 1,
822 .flags = ADDR_TYPE_RT
823 },
824};
825
826/* l4_core -> timer8 */
827static struct omap_hwmod_ocp_if omap2430_l4_core__timer8 = {
828 .master = &omap2430_l4_core_hwmod,
829 .slave = &omap2430_timer8_hwmod,
830 .clk = "gpt8_ick",
831 .addr = omap2430_timer8_addrs,
832 .addr_cnt = ARRAY_SIZE(omap2430_timer8_addrs),
833 .user = OCP_USER_MPU | OCP_USER_SDMA,
834};
835
836/* timer8 slave port */
837static struct omap_hwmod_ocp_if *omap2430_timer8_slaves[] = {
838 &omap2430_l4_core__timer8,
839};
840
841/* timer8 hwmod */
842static struct omap_hwmod omap2430_timer8_hwmod = {
843 .name = "timer8",
844 .mpu_irqs = omap2430_timer8_mpu_irqs,
845 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer8_mpu_irqs),
846 .main_clk = "gpt8_fck",
847 .prcm = {
848 .omap2 = {
849 .prcm_reg_id = 1,
850 .module_bit = OMAP24XX_EN_GPT8_SHIFT,
851 .module_offs = CORE_MOD,
852 .idlest_reg_id = 1,
853 .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT,
854 },
855 },
856 .slaves = omap2430_timer8_slaves,
857 .slaves_cnt = ARRAY_SIZE(omap2430_timer8_slaves),
858 .class = &omap2430_timer_hwmod_class,
859 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
860};
861
862/* timer9 */
863static struct omap_hwmod omap2430_timer9_hwmod;
864static struct omap_hwmod_irq_info omap2430_timer9_mpu_irqs[] = {
865 { .irq = 45, },
866};
867
868static struct omap_hwmod_addr_space omap2430_timer9_addrs[] = {
869 {
870 .pa_start = 0x48084000,
871 .pa_end = 0x48084000 + SZ_1K - 1,
872 .flags = ADDR_TYPE_RT
873 },
874};
875
876/* l4_core -> timer9 */
877static struct omap_hwmod_ocp_if omap2430_l4_core__timer9 = {
878 .master = &omap2430_l4_core_hwmod,
879 .slave = &omap2430_timer9_hwmod,
880 .clk = "gpt9_ick",
881 .addr = omap2430_timer9_addrs,
882 .addr_cnt = ARRAY_SIZE(omap2430_timer9_addrs),
883 .user = OCP_USER_MPU | OCP_USER_SDMA,
884};
885
886/* timer9 slave port */
887static struct omap_hwmod_ocp_if *omap2430_timer9_slaves[] = {
888 &omap2430_l4_core__timer9,
889};
890
891/* timer9 hwmod */
892static struct omap_hwmod omap2430_timer9_hwmod = {
893 .name = "timer9",
894 .mpu_irqs = omap2430_timer9_mpu_irqs,
895 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer9_mpu_irqs),
896 .main_clk = "gpt9_fck",
897 .prcm = {
898 .omap2 = {
899 .prcm_reg_id = 1,
900 .module_bit = OMAP24XX_EN_GPT9_SHIFT,
901 .module_offs = CORE_MOD,
902 .idlest_reg_id = 1,
903 .idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT,
904 },
905 },
906 .slaves = omap2430_timer9_slaves,
907 .slaves_cnt = ARRAY_SIZE(omap2430_timer9_slaves),
908 .class = &omap2430_timer_hwmod_class,
909 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
910};
911
912/* timer10 */
913static struct omap_hwmod omap2430_timer10_hwmod;
914static struct omap_hwmod_irq_info omap2430_timer10_mpu_irqs[] = {
915 { .irq = 46, },
916};
917
918static struct omap_hwmod_addr_space omap2430_timer10_addrs[] = {
919 {
920 .pa_start = 0x48086000,
921 .pa_end = 0x48086000 + SZ_1K - 1,
922 .flags = ADDR_TYPE_RT
923 },
924};
925
926/* l4_core -> timer10 */
927static struct omap_hwmod_ocp_if omap2430_l4_core__timer10 = {
928 .master = &omap2430_l4_core_hwmod,
929 .slave = &omap2430_timer10_hwmod,
930 .clk = "gpt10_ick",
931 .addr = omap2430_timer10_addrs,
932 .addr_cnt = ARRAY_SIZE(omap2430_timer10_addrs),
933 .user = OCP_USER_MPU | OCP_USER_SDMA,
934};
935
936/* timer10 slave port */
937static struct omap_hwmod_ocp_if *omap2430_timer10_slaves[] = {
938 &omap2430_l4_core__timer10,
939};
940
941/* timer10 hwmod */
942static struct omap_hwmod omap2430_timer10_hwmod = {
943 .name = "timer10",
944 .mpu_irqs = omap2430_timer10_mpu_irqs,
945 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer10_mpu_irqs),
946 .main_clk = "gpt10_fck",
947 .prcm = {
948 .omap2 = {
949 .prcm_reg_id = 1,
950 .module_bit = OMAP24XX_EN_GPT10_SHIFT,
951 .module_offs = CORE_MOD,
952 .idlest_reg_id = 1,
953 .idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT,
954 },
955 },
956 .slaves = omap2430_timer10_slaves,
957 .slaves_cnt = ARRAY_SIZE(omap2430_timer10_slaves),
958 .class = &omap2430_timer_hwmod_class,
959 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
960};
961
962/* timer11 */
963static struct omap_hwmod omap2430_timer11_hwmod;
964static struct omap_hwmod_irq_info omap2430_timer11_mpu_irqs[] = {
965 { .irq = 47, },
966};
967
968static struct omap_hwmod_addr_space omap2430_timer11_addrs[] = {
969 {
970 .pa_start = 0x48088000,
971 .pa_end = 0x48088000 + SZ_1K - 1,
972 .flags = ADDR_TYPE_RT
973 },
974};
975
976/* l4_core -> timer11 */
977static struct omap_hwmod_ocp_if omap2430_l4_core__timer11 = {
978 .master = &omap2430_l4_core_hwmod,
979 .slave = &omap2430_timer11_hwmod,
980 .clk = "gpt11_ick",
981 .addr = omap2430_timer11_addrs,
982 .addr_cnt = ARRAY_SIZE(omap2430_timer11_addrs),
983 .user = OCP_USER_MPU | OCP_USER_SDMA,
984};
985
986/* timer11 slave port */
987static struct omap_hwmod_ocp_if *omap2430_timer11_slaves[] = {
988 &omap2430_l4_core__timer11,
989};
990
991/* timer11 hwmod */
992static struct omap_hwmod omap2430_timer11_hwmod = {
993 .name = "timer11",
994 .mpu_irqs = omap2430_timer11_mpu_irqs,
995 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer11_mpu_irqs),
996 .main_clk = "gpt11_fck",
997 .prcm = {
998 .omap2 = {
999 .prcm_reg_id = 1,
1000 .module_bit = OMAP24XX_EN_GPT11_SHIFT,
1001 .module_offs = CORE_MOD,
1002 .idlest_reg_id = 1,
1003 .idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT,
1004 },
1005 },
1006 .slaves = omap2430_timer11_slaves,
1007 .slaves_cnt = ARRAY_SIZE(omap2430_timer11_slaves),
1008 .class = &omap2430_timer_hwmod_class,
1009 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
1010};
1011
1012/* timer12 */
1013static struct omap_hwmod omap2430_timer12_hwmod;
1014static struct omap_hwmod_irq_info omap2430_timer12_mpu_irqs[] = {
1015 { .irq = 48, },
1016};
1017
1018static struct omap_hwmod_addr_space omap2430_timer12_addrs[] = {
1019 {
1020 .pa_start = 0x4808a000,
1021 .pa_end = 0x4808a000 + SZ_1K - 1,
1022 .flags = ADDR_TYPE_RT
1023 },
1024};
1025
1026/* l4_core -> timer12 */
1027static struct omap_hwmod_ocp_if omap2430_l4_core__timer12 = {
1028 .master = &omap2430_l4_core_hwmod,
1029 .slave = &omap2430_timer12_hwmod,
1030 .clk = "gpt12_ick",
1031 .addr = omap2430_timer12_addrs,
1032 .addr_cnt = ARRAY_SIZE(omap2430_timer12_addrs),
1033 .user = OCP_USER_MPU | OCP_USER_SDMA,
1034};
1035
1036/* timer12 slave port */
1037static struct omap_hwmod_ocp_if *omap2430_timer12_slaves[] = {
1038 &omap2430_l4_core__timer12,
1039};
1040
1041/* timer12 hwmod */
1042static struct omap_hwmod omap2430_timer12_hwmod = {
1043 .name = "timer12",
1044 .mpu_irqs = omap2430_timer12_mpu_irqs,
1045 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer12_mpu_irqs),
1046 .main_clk = "gpt12_fck",
1047 .prcm = {
1048 .omap2 = {
1049 .prcm_reg_id = 1,
1050 .module_bit = OMAP24XX_EN_GPT12_SHIFT,
1051 .module_offs = CORE_MOD,
1052 .idlest_reg_id = 1,
1053 .idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT,
1054 },
1055 },
1056 .slaves = omap2430_timer12_slaves,
1057 .slaves_cnt = ARRAY_SIZE(omap2430_timer12_slaves),
1058 .class = &omap2430_timer_hwmod_class,
1059 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
1060};
1061
281/* l4_wkup -> wd_timer2 */ 1062/* l4_wkup -> wd_timer2 */
282static struct omap_hwmod_addr_space omap2430_wd_timer2_addrs[] = { 1063static struct omap_hwmod_addr_space omap2430_wd_timer2_addrs[] = {
283 { 1064 {
@@ -307,7 +1088,7 @@ static struct omap_hwmod_class_sysconfig omap2430_wd_timer_sysc = {
307 .sysc_offs = 0x0010, 1088 .sysc_offs = 0x0010,
308 .syss_offs = 0x0014, 1089 .syss_offs = 0x0014,
309 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET | 1090 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET |
310 SYSC_HAS_AUTOIDLE), 1091 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
311 .sysc_fields = &omap_hwmod_sysc_type1, 1092 .sysc_fields = &omap_hwmod_sysc_type1,
312}; 1093};
313 1094
@@ -348,7 +1129,7 @@ static struct omap_hwmod_class_sysconfig uart_sysc = {
348 .syss_offs = 0x58, 1129 .syss_offs = 0x58,
349 .sysc_flags = (SYSC_HAS_SIDLEMODE | 1130 .sysc_flags = (SYSC_HAS_SIDLEMODE |
350 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | 1131 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
351 SYSC_HAS_AUTOIDLE), 1132 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
352 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), 1133 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
353 .sysc_fields = &omap_hwmod_sysc_type1, 1134 .sysc_fields = &omap_hwmod_sysc_type1,
354}; 1135};
@@ -469,12 +1250,274 @@ static struct omap_hwmod omap2430_uart3_hwmod = {
469 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 1250 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
470}; 1251};
471 1252
1253/*
1254 * 'dss' class
1255 * display sub-system
1256 */
1257
1258static struct omap_hwmod_class_sysconfig omap2430_dss_sysc = {
1259 .rev_offs = 0x0000,
1260 .sysc_offs = 0x0010,
1261 .syss_offs = 0x0014,
1262 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
1263 .sysc_fields = &omap_hwmod_sysc_type1,
1264};
1265
1266static struct omap_hwmod_class omap2430_dss_hwmod_class = {
1267 .name = "dss",
1268 .sysc = &omap2430_dss_sysc,
1269};
1270
1271static struct omap_hwmod_dma_info omap2430_dss_sdma_chs[] = {
1272 { .name = "dispc", .dma_req = 5 },
1273};
1274
1275/* dss */
1276/* dss master ports */
1277static struct omap_hwmod_ocp_if *omap2430_dss_masters[] = {
1278 &omap2430_dss__l3,
1279};
1280
1281static struct omap_hwmod_addr_space omap2430_dss_addrs[] = {
1282 {
1283 .pa_start = 0x48050000,
1284 .pa_end = 0x480503FF,
1285 .flags = ADDR_TYPE_RT
1286 },
1287};
1288
1289/* l4_core -> dss */
1290static struct omap_hwmod_ocp_if omap2430_l4_core__dss = {
1291 .master = &omap2430_l4_core_hwmod,
1292 .slave = &omap2430_dss_core_hwmod,
1293 .clk = "dss_ick",
1294 .addr = omap2430_dss_addrs,
1295 .addr_cnt = ARRAY_SIZE(omap2430_dss_addrs),
1296 .user = OCP_USER_MPU | OCP_USER_SDMA,
1297};
1298
1299/* dss slave ports */
1300static struct omap_hwmod_ocp_if *omap2430_dss_slaves[] = {
1301 &omap2430_l4_core__dss,
1302};
1303
1304static struct omap_hwmod_opt_clk dss_opt_clks[] = {
1305 { .role = "tv_clk", .clk = "dss_54m_fck" },
1306 { .role = "sys_clk", .clk = "dss2_fck" },
1307};
1308
1309static struct omap_hwmod omap2430_dss_core_hwmod = {
1310 .name = "dss_core",
1311 .class = &omap2430_dss_hwmod_class,
1312 .main_clk = "dss1_fck", /* instead of dss_fck */
1313 .sdma_reqs = omap2430_dss_sdma_chs,
1314 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_dss_sdma_chs),
1315 .prcm = {
1316 .omap2 = {
1317 .prcm_reg_id = 1,
1318 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
1319 .module_offs = CORE_MOD,
1320 .idlest_reg_id = 1,
1321 .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
1322 },
1323 },
1324 .opt_clks = dss_opt_clks,
1325 .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
1326 .slaves = omap2430_dss_slaves,
1327 .slaves_cnt = ARRAY_SIZE(omap2430_dss_slaves),
1328 .masters = omap2430_dss_masters,
1329 .masters_cnt = ARRAY_SIZE(omap2430_dss_masters),
1330 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1331 .flags = HWMOD_NO_IDLEST,
1332};
1333
1334/*
1335 * 'dispc' class
1336 * display controller
1337 */
1338
1339static struct omap_hwmod_class_sysconfig omap2430_dispc_sysc = {
1340 .rev_offs = 0x0000,
1341 .sysc_offs = 0x0010,
1342 .syss_offs = 0x0014,
1343 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |
1344 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
1345 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1346 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
1347 .sysc_fields = &omap_hwmod_sysc_type1,
1348};
1349
1350static struct omap_hwmod_class omap2430_dispc_hwmod_class = {
1351 .name = "dispc",
1352 .sysc = &omap2430_dispc_sysc,
1353};
1354
1355static struct omap_hwmod_irq_info omap2430_dispc_irqs[] = {
1356 { .irq = 25 },
1357};
1358
1359static struct omap_hwmod_addr_space omap2430_dss_dispc_addrs[] = {
1360 {
1361 .pa_start = 0x48050400,
1362 .pa_end = 0x480507FF,
1363 .flags = ADDR_TYPE_RT
1364 },
1365};
1366
1367/* l4_core -> dss_dispc */
1368static struct omap_hwmod_ocp_if omap2430_l4_core__dss_dispc = {
1369 .master = &omap2430_l4_core_hwmod,
1370 .slave = &omap2430_dss_dispc_hwmod,
1371 .clk = "dss_ick",
1372 .addr = omap2430_dss_dispc_addrs,
1373 .addr_cnt = ARRAY_SIZE(omap2430_dss_dispc_addrs),
1374 .user = OCP_USER_MPU | OCP_USER_SDMA,
1375};
1376
1377/* dss_dispc slave ports */
1378static struct omap_hwmod_ocp_if *omap2430_dss_dispc_slaves[] = {
1379 &omap2430_l4_core__dss_dispc,
1380};
1381
1382static struct omap_hwmod omap2430_dss_dispc_hwmod = {
1383 .name = "dss_dispc",
1384 .class = &omap2430_dispc_hwmod_class,
1385 .mpu_irqs = omap2430_dispc_irqs,
1386 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_dispc_irqs),
1387 .main_clk = "dss1_fck",
1388 .prcm = {
1389 .omap2 = {
1390 .prcm_reg_id = 1,
1391 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
1392 .module_offs = CORE_MOD,
1393 .idlest_reg_id = 1,
1394 .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
1395 },
1396 },
1397 .slaves = omap2430_dss_dispc_slaves,
1398 .slaves_cnt = ARRAY_SIZE(omap2430_dss_dispc_slaves),
1399 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1400 .flags = HWMOD_NO_IDLEST,
1401};
1402
1403/*
1404 * 'rfbi' class
1405 * remote frame buffer interface
1406 */
1407
1408static struct omap_hwmod_class_sysconfig omap2430_rfbi_sysc = {
1409 .rev_offs = 0x0000,
1410 .sysc_offs = 0x0010,
1411 .syss_offs = 0x0014,
1412 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
1413 SYSC_HAS_AUTOIDLE),
1414 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1415 .sysc_fields = &omap_hwmod_sysc_type1,
1416};
1417
1418static struct omap_hwmod_class omap2430_rfbi_hwmod_class = {
1419 .name = "rfbi",
1420 .sysc = &omap2430_rfbi_sysc,
1421};
1422
1423static struct omap_hwmod_addr_space omap2430_dss_rfbi_addrs[] = {
1424 {
1425 .pa_start = 0x48050800,
1426 .pa_end = 0x48050BFF,
1427 .flags = ADDR_TYPE_RT
1428 },
1429};
1430
1431/* l4_core -> dss_rfbi */
1432static struct omap_hwmod_ocp_if omap2430_l4_core__dss_rfbi = {
1433 .master = &omap2430_l4_core_hwmod,
1434 .slave = &omap2430_dss_rfbi_hwmod,
1435 .clk = "dss_ick",
1436 .addr = omap2430_dss_rfbi_addrs,
1437 .addr_cnt = ARRAY_SIZE(omap2430_dss_rfbi_addrs),
1438 .user = OCP_USER_MPU | OCP_USER_SDMA,
1439};
1440
1441/* dss_rfbi slave ports */
1442static struct omap_hwmod_ocp_if *omap2430_dss_rfbi_slaves[] = {
1443 &omap2430_l4_core__dss_rfbi,
1444};
1445
1446static struct omap_hwmod omap2430_dss_rfbi_hwmod = {
1447 .name = "dss_rfbi",
1448 .class = &omap2430_rfbi_hwmod_class,
1449 .main_clk = "dss1_fck",
1450 .prcm = {
1451 .omap2 = {
1452 .prcm_reg_id = 1,
1453 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
1454 .module_offs = CORE_MOD,
1455 },
1456 },
1457 .slaves = omap2430_dss_rfbi_slaves,
1458 .slaves_cnt = ARRAY_SIZE(omap2430_dss_rfbi_slaves),
1459 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1460 .flags = HWMOD_NO_IDLEST,
1461};
1462
1463/*
1464 * 'venc' class
1465 * video encoder
1466 */
1467
1468static struct omap_hwmod_class omap2430_venc_hwmod_class = {
1469 .name = "venc",
1470};
1471
1472/* dss_venc */
1473static struct omap_hwmod_addr_space omap2430_dss_venc_addrs[] = {
1474 {
1475 .pa_start = 0x48050C00,
1476 .pa_end = 0x48050FFF,
1477 .flags = ADDR_TYPE_RT
1478 },
1479};
1480
1481/* l4_core -> dss_venc */
1482static struct omap_hwmod_ocp_if omap2430_l4_core__dss_venc = {
1483 .master = &omap2430_l4_core_hwmod,
1484 .slave = &omap2430_dss_venc_hwmod,
1485 .clk = "dss_54m_fck",
1486 .addr = omap2430_dss_venc_addrs,
1487 .addr_cnt = ARRAY_SIZE(omap2430_dss_venc_addrs),
1488 .flags = OCPIF_SWSUP_IDLE,
1489 .user = OCP_USER_MPU | OCP_USER_SDMA,
1490};
1491
1492/* dss_venc slave ports */
1493static struct omap_hwmod_ocp_if *omap2430_dss_venc_slaves[] = {
1494 &omap2430_l4_core__dss_venc,
1495};
1496
1497static struct omap_hwmod omap2430_dss_venc_hwmod = {
1498 .name = "dss_venc",
1499 .class = &omap2430_venc_hwmod_class,
1500 .main_clk = "dss1_fck",
1501 .prcm = {
1502 .omap2 = {
1503 .prcm_reg_id = 1,
1504 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
1505 .module_offs = CORE_MOD,
1506 },
1507 },
1508 .slaves = omap2430_dss_venc_slaves,
1509 .slaves_cnt = ARRAY_SIZE(omap2430_dss_venc_slaves),
1510 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1511 .flags = HWMOD_NO_IDLEST,
1512};
1513
472/* I2C common */ 1514/* I2C common */
473static struct omap_hwmod_class_sysconfig i2c_sysc = { 1515static struct omap_hwmod_class_sysconfig i2c_sysc = {
474 .rev_offs = 0x00, 1516 .rev_offs = 0x00,
475 .sysc_offs = 0x20, 1517 .sysc_offs = 0x20,
476 .syss_offs = 0x10, 1518 .syss_offs = 0x10,
477 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), 1519 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
1520 SYSS_HAS_RESET_STATUS),
478 .sysc_fields = &omap_hwmod_sysc_type1, 1521 .sysc_fields = &omap_hwmod_sysc_type1,
479}; 1522};
480 1523
@@ -672,7 +1715,8 @@ static struct omap_hwmod_class_sysconfig omap243x_gpio_sysc = {
672 .sysc_offs = 0x0010, 1715 .sysc_offs = 0x0010,
673 .syss_offs = 0x0014, 1716 .syss_offs = 0x0014,
674 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | 1717 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
675 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), 1718 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
1719 SYSS_HAS_RESET_STATUS),
676 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), 1720 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
677 .sysc_fields = &omap_hwmod_sysc_type1, 1721 .sysc_fields = &omap_hwmod_sysc_type1,
678}; 1722};
@@ -844,7 +1888,7 @@ static struct omap_hwmod_class_sysconfig omap2430_dma_sysc = {
844 .syss_offs = 0x0028, 1888 .syss_offs = 0x0028,
845 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE | 1889 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE |
846 SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE | 1890 SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE |
847 SYSC_HAS_AUTOIDLE), 1891 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
848 .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), 1892 .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
849 .sysc_fields = &omap_hwmod_sysc_type1, 1893 .sysc_fields = &omap_hwmod_sysc_type1,
850}; 1894};
@@ -919,18 +1963,741 @@ static struct omap_hwmod omap2430_dma_system_hwmod = {
919 .flags = HWMOD_NO_IDLEST, 1963 .flags = HWMOD_NO_IDLEST,
920}; 1964};
921 1965
1966/*
1967 * 'mailbox' class
1968 * mailbox module allowing communication between the on-chip processors
1969 * using a queued mailbox-interrupt mechanism.
1970 */
1971
1972static struct omap_hwmod_class_sysconfig omap2430_mailbox_sysc = {
1973 .rev_offs = 0x000,
1974 .sysc_offs = 0x010,
1975 .syss_offs = 0x014,
1976 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
1977 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
1978 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1979 .sysc_fields = &omap_hwmod_sysc_type1,
1980};
1981
1982static struct omap_hwmod_class omap2430_mailbox_hwmod_class = {
1983 .name = "mailbox",
1984 .sysc = &omap2430_mailbox_sysc,
1985};
1986
1987/* mailbox */
1988static struct omap_hwmod omap2430_mailbox_hwmod;
1989static struct omap_hwmod_irq_info omap2430_mailbox_irqs[] = {
1990 { .irq = 26 },
1991};
1992
1993static struct omap_hwmod_addr_space omap2430_mailbox_addrs[] = {
1994 {
1995 .pa_start = 0x48094000,
1996 .pa_end = 0x480941ff,
1997 .flags = ADDR_TYPE_RT,
1998 },
1999};
2000
2001/* l4_core -> mailbox */
2002static struct omap_hwmod_ocp_if omap2430_l4_core__mailbox = {
2003 .master = &omap2430_l4_core_hwmod,
2004 .slave = &omap2430_mailbox_hwmod,
2005 .addr = omap2430_mailbox_addrs,
2006 .addr_cnt = ARRAY_SIZE(omap2430_mailbox_addrs),
2007 .user = OCP_USER_MPU | OCP_USER_SDMA,
2008};
2009
2010/* mailbox slave ports */
2011static struct omap_hwmod_ocp_if *omap2430_mailbox_slaves[] = {
2012 &omap2430_l4_core__mailbox,
2013};
2014
2015static struct omap_hwmod omap2430_mailbox_hwmod = {
2016 .name = "mailbox",
2017 .class = &omap2430_mailbox_hwmod_class,
2018 .mpu_irqs = omap2430_mailbox_irqs,
2019 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mailbox_irqs),
2020 .main_clk = "mailboxes_ick",
2021 .prcm = {
2022 .omap2 = {
2023 .prcm_reg_id = 1,
2024 .module_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
2025 .module_offs = CORE_MOD,
2026 .idlest_reg_id = 1,
2027 .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT,
2028 },
2029 },
2030 .slaves = omap2430_mailbox_slaves,
2031 .slaves_cnt = ARRAY_SIZE(omap2430_mailbox_slaves),
2032 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2033};
2034
2035/*
2036 * 'mcspi' class
2037 * multichannel serial port interface (mcspi) / master/slave synchronous serial
2038 * bus
2039 */
2040
2041static struct omap_hwmod_class_sysconfig omap2430_mcspi_sysc = {
2042 .rev_offs = 0x0000,
2043 .sysc_offs = 0x0010,
2044 .syss_offs = 0x0014,
2045 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
2046 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
2047 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
2048 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
2049 .sysc_fields = &omap_hwmod_sysc_type1,
2050};
2051
2052static struct omap_hwmod_class omap2430_mcspi_class = {
2053 .name = "mcspi",
2054 .sysc = &omap2430_mcspi_sysc,
2055 .rev = OMAP2_MCSPI_REV,
2056};
2057
2058/* mcspi1 */
2059static struct omap_hwmod_irq_info omap2430_mcspi1_mpu_irqs[] = {
2060 { .irq = 65 },
2061};
2062
2063static struct omap_hwmod_dma_info omap2430_mcspi1_sdma_reqs[] = {
2064 { .name = "tx0", .dma_req = 35 }, /* DMA_SPI1_TX0 */
2065 { .name = "rx0", .dma_req = 36 }, /* DMA_SPI1_RX0 */
2066 { .name = "tx1", .dma_req = 37 }, /* DMA_SPI1_TX1 */
2067 { .name = "rx1", .dma_req = 38 }, /* DMA_SPI1_RX1 */
2068 { .name = "tx2", .dma_req = 39 }, /* DMA_SPI1_TX2 */
2069 { .name = "rx2", .dma_req = 40 }, /* DMA_SPI1_RX2 */
2070 { .name = "tx3", .dma_req = 41 }, /* DMA_SPI1_TX3 */
2071 { .name = "rx3", .dma_req = 42 }, /* DMA_SPI1_RX3 */
2072};
2073
2074static struct omap_hwmod_ocp_if *omap2430_mcspi1_slaves[] = {
2075 &omap2430_l4_core__mcspi1,
2076};
2077
2078static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = {
2079 .num_chipselect = 4,
2080};
2081
2082static struct omap_hwmod omap2430_mcspi1_hwmod = {
2083 .name = "mcspi1_hwmod",
2084 .mpu_irqs = omap2430_mcspi1_mpu_irqs,
2085 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcspi1_mpu_irqs),
2086 .sdma_reqs = omap2430_mcspi1_sdma_reqs,
2087 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcspi1_sdma_reqs),
2088 .main_clk = "mcspi1_fck",
2089 .prcm = {
2090 .omap2 = {
2091 .module_offs = CORE_MOD,
2092 .prcm_reg_id = 1,
2093 .module_bit = OMAP24XX_EN_MCSPI1_SHIFT,
2094 .idlest_reg_id = 1,
2095 .idlest_idle_bit = OMAP24XX_ST_MCSPI1_SHIFT,
2096 },
2097 },
2098 .slaves = omap2430_mcspi1_slaves,
2099 .slaves_cnt = ARRAY_SIZE(omap2430_mcspi1_slaves),
2100 .class = &omap2430_mcspi_class,
2101 .dev_attr = &omap_mcspi1_dev_attr,
2102 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2103};
2104
2105/* mcspi2 */
2106static struct omap_hwmod_irq_info omap2430_mcspi2_mpu_irqs[] = {
2107 { .irq = 66 },
2108};
2109
2110static struct omap_hwmod_dma_info omap2430_mcspi2_sdma_reqs[] = {
2111 { .name = "tx0", .dma_req = 43 }, /* DMA_SPI2_TX0 */
2112 { .name = "rx0", .dma_req = 44 }, /* DMA_SPI2_RX0 */
2113 { .name = "tx1", .dma_req = 45 }, /* DMA_SPI2_TX1 */
2114 { .name = "rx1", .dma_req = 46 }, /* DMA_SPI2_RX1 */
2115};
2116
2117static struct omap_hwmod_ocp_if *omap2430_mcspi2_slaves[] = {
2118 &omap2430_l4_core__mcspi2,
2119};
2120
2121static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = {
2122 .num_chipselect = 2,
2123};
2124
2125static struct omap_hwmod omap2430_mcspi2_hwmod = {
2126 .name = "mcspi2_hwmod",
2127 .mpu_irqs = omap2430_mcspi2_mpu_irqs,
2128 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcspi2_mpu_irqs),
2129 .sdma_reqs = omap2430_mcspi2_sdma_reqs,
2130 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcspi2_sdma_reqs),
2131 .main_clk = "mcspi2_fck",
2132 .prcm = {
2133 .omap2 = {
2134 .module_offs = CORE_MOD,
2135 .prcm_reg_id = 1,
2136 .module_bit = OMAP24XX_EN_MCSPI2_SHIFT,
2137 .idlest_reg_id = 1,
2138 .idlest_idle_bit = OMAP24XX_ST_MCSPI2_SHIFT,
2139 },
2140 },
2141 .slaves = omap2430_mcspi2_slaves,
2142 .slaves_cnt = ARRAY_SIZE(omap2430_mcspi2_slaves),
2143 .class = &omap2430_mcspi_class,
2144 .dev_attr = &omap_mcspi2_dev_attr,
2145 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2146};
2147
2148/* mcspi3 */
2149static struct omap_hwmod_irq_info omap2430_mcspi3_mpu_irqs[] = {
2150 { .irq = 91 },
2151};
2152
2153static struct omap_hwmod_dma_info omap2430_mcspi3_sdma_reqs[] = {
2154 { .name = "tx0", .dma_req = 15 }, /* DMA_SPI3_TX0 */
2155 { .name = "rx0", .dma_req = 16 }, /* DMA_SPI3_RX0 */
2156 { .name = "tx1", .dma_req = 23 }, /* DMA_SPI3_TX1 */
2157 { .name = "rx1", .dma_req = 24 }, /* DMA_SPI3_RX1 */
2158};
2159
2160static struct omap_hwmod_ocp_if *omap2430_mcspi3_slaves[] = {
2161 &omap2430_l4_core__mcspi3,
2162};
2163
2164static struct omap2_mcspi_dev_attr omap_mcspi3_dev_attr = {
2165 .num_chipselect = 2,
2166};
2167
2168static struct omap_hwmod omap2430_mcspi3_hwmod = {
2169 .name = "mcspi3_hwmod",
2170 .mpu_irqs = omap2430_mcspi3_mpu_irqs,
2171 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcspi3_mpu_irqs),
2172 .sdma_reqs = omap2430_mcspi3_sdma_reqs,
2173 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcspi3_sdma_reqs),
2174 .main_clk = "mcspi3_fck",
2175 .prcm = {
2176 .omap2 = {
2177 .module_offs = CORE_MOD,
2178 .prcm_reg_id = 2,
2179 .module_bit = OMAP2430_EN_MCSPI3_SHIFT,
2180 .idlest_reg_id = 2,
2181 .idlest_idle_bit = OMAP2430_ST_MCSPI3_SHIFT,
2182 },
2183 },
2184 .slaves = omap2430_mcspi3_slaves,
2185 .slaves_cnt = ARRAY_SIZE(omap2430_mcspi3_slaves),
2186 .class = &omap2430_mcspi_class,
2187 .dev_attr = &omap_mcspi3_dev_attr,
2188 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2189};
2190
2191/*
2192 * usbhsotg
2193 */
2194static struct omap_hwmod_class_sysconfig omap2430_usbhsotg_sysc = {
2195 .rev_offs = 0x0400,
2196 .sysc_offs = 0x0404,
2197 .syss_offs = 0x0408,
2198 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE|
2199 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
2200 SYSC_HAS_AUTOIDLE),
2201 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
2202 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
2203 .sysc_fields = &omap_hwmod_sysc_type1,
2204};
2205
2206static struct omap_hwmod_class usbotg_class = {
2207 .name = "usbotg",
2208 .sysc = &omap2430_usbhsotg_sysc,
2209};
2210
2211/* usb_otg_hs */
2212static struct omap_hwmod_irq_info omap2430_usbhsotg_mpu_irqs[] = {
2213
2214 { .name = "mc", .irq = 92 },
2215 { .name = "dma", .irq = 93 },
2216};
2217
2218static struct omap_hwmod omap2430_usbhsotg_hwmod = {
2219 .name = "usb_otg_hs",
2220 .mpu_irqs = omap2430_usbhsotg_mpu_irqs,
2221 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_usbhsotg_mpu_irqs),
2222 .main_clk = "usbhs_ick",
2223 .prcm = {
2224 .omap2 = {
2225 .prcm_reg_id = 1,
2226 .module_bit = OMAP2430_EN_USBHS_MASK,
2227 .module_offs = CORE_MOD,
2228 .idlest_reg_id = 1,
2229 .idlest_idle_bit = OMAP2430_ST_USBHS_SHIFT,
2230 },
2231 },
2232 .masters = omap2430_usbhsotg_masters,
2233 .masters_cnt = ARRAY_SIZE(omap2430_usbhsotg_masters),
2234 .slaves = omap2430_usbhsotg_slaves,
2235 .slaves_cnt = ARRAY_SIZE(omap2430_usbhsotg_slaves),
2236 .class = &usbotg_class,
2237 /*
2238 * Erratum ID: i479 idle_req / idle_ack mechanism potentially
2239 * broken when autoidle is enabled
2240 * workaround is to disable the autoidle bit at module level.
2241 */
2242 .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE
2243 | HWMOD_SWSUP_MSTANDBY,
2244 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
2245};
2246
2247/*
2248 * 'mcbsp' class
2249 * multi channel buffered serial port controller
2250 */
2251
2252static struct omap_hwmod_class_sysconfig omap2430_mcbsp_sysc = {
2253 .rev_offs = 0x007C,
2254 .sysc_offs = 0x008C,
2255 .sysc_flags = (SYSC_HAS_SOFTRESET),
2256 .sysc_fields = &omap_hwmod_sysc_type1,
2257};
2258
2259static struct omap_hwmod_class omap2430_mcbsp_hwmod_class = {
2260 .name = "mcbsp",
2261 .sysc = &omap2430_mcbsp_sysc,
2262 .rev = MCBSP_CONFIG_TYPE2,
2263};
2264
2265/* mcbsp1 */
2266static struct omap_hwmod_irq_info omap2430_mcbsp1_irqs[] = {
2267 { .name = "tx", .irq = 59 },
2268 { .name = "rx", .irq = 60 },
2269 { .name = "ovr", .irq = 61 },
2270 { .name = "common", .irq = 64 },
2271};
2272
2273static struct omap_hwmod_dma_info omap2430_mcbsp1_sdma_chs[] = {
2274 { .name = "rx", .dma_req = 32 },
2275 { .name = "tx", .dma_req = 31 },
2276};
2277
2278static struct omap_hwmod_addr_space omap2430_mcbsp1_addrs[] = {
2279 {
2280 .name = "mpu",
2281 .pa_start = 0x48074000,
2282 .pa_end = 0x480740ff,
2283 .flags = ADDR_TYPE_RT
2284 },
2285};
2286
2287/* l4_core -> mcbsp1 */
2288static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp1 = {
2289 .master = &omap2430_l4_core_hwmod,
2290 .slave = &omap2430_mcbsp1_hwmod,
2291 .clk = "mcbsp1_ick",
2292 .addr = omap2430_mcbsp1_addrs,
2293 .addr_cnt = ARRAY_SIZE(omap2430_mcbsp1_addrs),
2294 .user = OCP_USER_MPU | OCP_USER_SDMA,
2295};
2296
2297/* mcbsp1 slave ports */
2298static struct omap_hwmod_ocp_if *omap2430_mcbsp1_slaves[] = {
2299 &omap2430_l4_core__mcbsp1,
2300};
2301
2302static struct omap_hwmod omap2430_mcbsp1_hwmod = {
2303 .name = "mcbsp1",
2304 .class = &omap2430_mcbsp_hwmod_class,
2305 .mpu_irqs = omap2430_mcbsp1_irqs,
2306 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcbsp1_irqs),
2307 .sdma_reqs = omap2430_mcbsp1_sdma_chs,
2308 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcbsp1_sdma_chs),
2309 .main_clk = "mcbsp1_fck",
2310 .prcm = {
2311 .omap2 = {
2312 .prcm_reg_id = 1,
2313 .module_bit = OMAP24XX_EN_MCBSP1_SHIFT,
2314 .module_offs = CORE_MOD,
2315 .idlest_reg_id = 1,
2316 .idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT,
2317 },
2318 },
2319 .slaves = omap2430_mcbsp1_slaves,
2320 .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp1_slaves),
2321 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2322};
2323
2324/* mcbsp2 */
2325static struct omap_hwmod_irq_info omap2430_mcbsp2_irqs[] = {
2326 { .name = "tx", .irq = 62 },
2327 { .name = "rx", .irq = 63 },
2328 { .name = "common", .irq = 16 },
2329};
2330
2331static struct omap_hwmod_dma_info omap2430_mcbsp2_sdma_chs[] = {
2332 { .name = "rx", .dma_req = 34 },
2333 { .name = "tx", .dma_req = 33 },
2334};
2335
2336static struct omap_hwmod_addr_space omap2430_mcbsp2_addrs[] = {
2337 {
2338 .name = "mpu",
2339 .pa_start = 0x48076000,
2340 .pa_end = 0x480760ff,
2341 .flags = ADDR_TYPE_RT
2342 },
2343};
2344
2345/* l4_core -> mcbsp2 */
2346static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp2 = {
2347 .master = &omap2430_l4_core_hwmod,
2348 .slave = &omap2430_mcbsp2_hwmod,
2349 .clk = "mcbsp2_ick",
2350 .addr = omap2430_mcbsp2_addrs,
2351 .addr_cnt = ARRAY_SIZE(omap2430_mcbsp2_addrs),
2352 .user = OCP_USER_MPU | OCP_USER_SDMA,
2353};
2354
2355/* mcbsp2 slave ports */
2356static struct omap_hwmod_ocp_if *omap2430_mcbsp2_slaves[] = {
2357 &omap2430_l4_core__mcbsp2,
2358};
2359
2360static struct omap_hwmod omap2430_mcbsp2_hwmod = {
2361 .name = "mcbsp2",
2362 .class = &omap2430_mcbsp_hwmod_class,
2363 .mpu_irqs = omap2430_mcbsp2_irqs,
2364 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcbsp2_irqs),
2365 .sdma_reqs = omap2430_mcbsp2_sdma_chs,
2366 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcbsp2_sdma_chs),
2367 .main_clk = "mcbsp2_fck",
2368 .prcm = {
2369 .omap2 = {
2370 .prcm_reg_id = 1,
2371 .module_bit = OMAP24XX_EN_MCBSP2_SHIFT,
2372 .module_offs = CORE_MOD,
2373 .idlest_reg_id = 1,
2374 .idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT,
2375 },
2376 },
2377 .slaves = omap2430_mcbsp2_slaves,
2378 .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp2_slaves),
2379 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2380};
2381
2382/* mcbsp3 */
2383static struct omap_hwmod_irq_info omap2430_mcbsp3_irqs[] = {
2384 { .name = "tx", .irq = 89 },
2385 { .name = "rx", .irq = 90 },
2386 { .name = "common", .irq = 17 },
2387};
2388
2389static struct omap_hwmod_dma_info omap2430_mcbsp3_sdma_chs[] = {
2390 { .name = "rx", .dma_req = 18 },
2391 { .name = "tx", .dma_req = 17 },
2392};
2393
2394static struct omap_hwmod_addr_space omap2430_mcbsp3_addrs[] = {
2395 {
2396 .name = "mpu",
2397 .pa_start = 0x4808C000,
2398 .pa_end = 0x4808C0ff,
2399 .flags = ADDR_TYPE_RT
2400 },
2401};
2402
2403/* l4_core -> mcbsp3 */
2404static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp3 = {
2405 .master = &omap2430_l4_core_hwmod,
2406 .slave = &omap2430_mcbsp3_hwmod,
2407 .clk = "mcbsp3_ick",
2408 .addr = omap2430_mcbsp3_addrs,
2409 .addr_cnt = ARRAY_SIZE(omap2430_mcbsp3_addrs),
2410 .user = OCP_USER_MPU | OCP_USER_SDMA,
2411};
2412
2413/* mcbsp3 slave ports */
2414static struct omap_hwmod_ocp_if *omap2430_mcbsp3_slaves[] = {
2415 &omap2430_l4_core__mcbsp3,
2416};
2417
2418static struct omap_hwmod omap2430_mcbsp3_hwmod = {
2419 .name = "mcbsp3",
2420 .class = &omap2430_mcbsp_hwmod_class,
2421 .mpu_irqs = omap2430_mcbsp3_irqs,
2422 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcbsp3_irqs),
2423 .sdma_reqs = omap2430_mcbsp3_sdma_chs,
2424 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcbsp3_sdma_chs),
2425 .main_clk = "mcbsp3_fck",
2426 .prcm = {
2427 .omap2 = {
2428 .prcm_reg_id = 1,
2429 .module_bit = OMAP2430_EN_MCBSP3_SHIFT,
2430 .module_offs = CORE_MOD,
2431 .idlest_reg_id = 2,
2432 .idlest_idle_bit = OMAP2430_ST_MCBSP3_SHIFT,
2433 },
2434 },
2435 .slaves = omap2430_mcbsp3_slaves,
2436 .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp3_slaves),
2437 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2438};
2439
2440/* mcbsp4 */
2441static struct omap_hwmod_irq_info omap2430_mcbsp4_irqs[] = {
2442 { .name = "tx", .irq = 54 },
2443 { .name = "rx", .irq = 55 },
2444 { .name = "common", .irq = 18 },
2445};
2446
2447static struct omap_hwmod_dma_info omap2430_mcbsp4_sdma_chs[] = {
2448 { .name = "rx", .dma_req = 20 },
2449 { .name = "tx", .dma_req = 19 },
2450};
2451
2452static struct omap_hwmod_addr_space omap2430_mcbsp4_addrs[] = {
2453 {
2454 .name = "mpu",
2455 .pa_start = 0x4808E000,
2456 .pa_end = 0x4808E0ff,
2457 .flags = ADDR_TYPE_RT
2458 },
2459};
2460
2461/* l4_core -> mcbsp4 */
2462static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp4 = {
2463 .master = &omap2430_l4_core_hwmod,
2464 .slave = &omap2430_mcbsp4_hwmod,
2465 .clk = "mcbsp4_ick",
2466 .addr = omap2430_mcbsp4_addrs,
2467 .addr_cnt = ARRAY_SIZE(omap2430_mcbsp4_addrs),
2468 .user = OCP_USER_MPU | OCP_USER_SDMA,
2469};
2470
2471/* mcbsp4 slave ports */
2472static struct omap_hwmod_ocp_if *omap2430_mcbsp4_slaves[] = {
2473 &omap2430_l4_core__mcbsp4,
2474};
2475
2476static struct omap_hwmod omap2430_mcbsp4_hwmod = {
2477 .name = "mcbsp4",
2478 .class = &omap2430_mcbsp_hwmod_class,
2479 .mpu_irqs = omap2430_mcbsp4_irqs,
2480 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcbsp4_irqs),
2481 .sdma_reqs = omap2430_mcbsp4_sdma_chs,
2482 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcbsp4_sdma_chs),
2483 .main_clk = "mcbsp4_fck",
2484 .prcm = {
2485 .omap2 = {
2486 .prcm_reg_id = 1,
2487 .module_bit = OMAP2430_EN_MCBSP4_SHIFT,
2488 .module_offs = CORE_MOD,
2489 .idlest_reg_id = 2,
2490 .idlest_idle_bit = OMAP2430_ST_MCBSP4_SHIFT,
2491 },
2492 },
2493 .slaves = omap2430_mcbsp4_slaves,
2494 .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp4_slaves),
2495 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2496};
2497
2498/* mcbsp5 */
2499static struct omap_hwmod_irq_info omap2430_mcbsp5_irqs[] = {
2500 { .name = "tx", .irq = 81 },
2501 { .name = "rx", .irq = 82 },
2502 { .name = "common", .irq = 19 },
2503};
2504
2505static struct omap_hwmod_dma_info omap2430_mcbsp5_sdma_chs[] = {
2506 { .name = "rx", .dma_req = 22 },
2507 { .name = "tx", .dma_req = 21 },
2508};
2509
2510static struct omap_hwmod_addr_space omap2430_mcbsp5_addrs[] = {
2511 {
2512 .name = "mpu",
2513 .pa_start = 0x48096000,
2514 .pa_end = 0x480960ff,
2515 .flags = ADDR_TYPE_RT
2516 },
2517};
2518
2519/* l4_core -> mcbsp5 */
2520static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp5 = {
2521 .master = &omap2430_l4_core_hwmod,
2522 .slave = &omap2430_mcbsp5_hwmod,
2523 .clk = "mcbsp5_ick",
2524 .addr = omap2430_mcbsp5_addrs,
2525 .addr_cnt = ARRAY_SIZE(omap2430_mcbsp5_addrs),
2526 .user = OCP_USER_MPU | OCP_USER_SDMA,
2527};
2528
2529/* mcbsp5 slave ports */
2530static struct omap_hwmod_ocp_if *omap2430_mcbsp5_slaves[] = {
2531 &omap2430_l4_core__mcbsp5,
2532};
2533
2534static struct omap_hwmod omap2430_mcbsp5_hwmod = {
2535 .name = "mcbsp5",
2536 .class = &omap2430_mcbsp_hwmod_class,
2537 .mpu_irqs = omap2430_mcbsp5_irqs,
2538 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcbsp5_irqs),
2539 .sdma_reqs = omap2430_mcbsp5_sdma_chs,
2540 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcbsp5_sdma_chs),
2541 .main_clk = "mcbsp5_fck",
2542 .prcm = {
2543 .omap2 = {
2544 .prcm_reg_id = 1,
2545 .module_bit = OMAP2430_EN_MCBSP5_SHIFT,
2546 .module_offs = CORE_MOD,
2547 .idlest_reg_id = 2,
2548 .idlest_idle_bit = OMAP2430_ST_MCBSP5_SHIFT,
2549 },
2550 },
2551 .slaves = omap2430_mcbsp5_slaves,
2552 .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp5_slaves),
2553 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2554};
2555
2556/* MMC/SD/SDIO common */
2557
2558static struct omap_hwmod_class_sysconfig omap2430_mmc_sysc = {
2559 .rev_offs = 0x1fc,
2560 .sysc_offs = 0x10,
2561 .syss_offs = 0x14,
2562 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
2563 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
2564 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
2565 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
2566 .sysc_fields = &omap_hwmod_sysc_type1,
2567};
2568
2569static struct omap_hwmod_class omap2430_mmc_class = {
2570 .name = "mmc",
2571 .sysc = &omap2430_mmc_sysc,
2572};
2573
2574/* MMC/SD/SDIO1 */
2575
2576static struct omap_hwmod_irq_info omap2430_mmc1_mpu_irqs[] = {
2577 { .irq = 83 },
2578};
2579
2580static struct omap_hwmod_dma_info omap2430_mmc1_sdma_reqs[] = {
2581 { .name = "tx", .dma_req = 61 }, /* DMA_MMC1_TX */
2582 { .name = "rx", .dma_req = 62 }, /* DMA_MMC1_RX */
2583};
2584
2585static struct omap_hwmod_opt_clk omap2430_mmc1_opt_clks[] = {
2586 { .role = "dbck", .clk = "mmchsdb1_fck" },
2587};
2588
2589static struct omap_hwmod_ocp_if *omap2430_mmc1_slaves[] = {
2590 &omap2430_l4_core__mmc1,
2591};
2592
2593static struct omap_mmc_dev_attr mmc1_dev_attr = {
2594 .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
2595};
2596
2597static struct omap_hwmod omap2430_mmc1_hwmod = {
2598 .name = "mmc1",
2599 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
2600 .mpu_irqs = omap2430_mmc1_mpu_irqs,
2601 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mmc1_mpu_irqs),
2602 .sdma_reqs = omap2430_mmc1_sdma_reqs,
2603 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mmc1_sdma_reqs),
2604 .opt_clks = omap2430_mmc1_opt_clks,
2605 .opt_clks_cnt = ARRAY_SIZE(omap2430_mmc1_opt_clks),
2606 .main_clk = "mmchs1_fck",
2607 .prcm = {
2608 .omap2 = {
2609 .module_offs = CORE_MOD,
2610 .prcm_reg_id = 2,
2611 .module_bit = OMAP2430_EN_MMCHS1_SHIFT,
2612 .idlest_reg_id = 2,
2613 .idlest_idle_bit = OMAP2430_ST_MMCHS1_SHIFT,
2614 },
2615 },
2616 .dev_attr = &mmc1_dev_attr,
2617 .slaves = omap2430_mmc1_slaves,
2618 .slaves_cnt = ARRAY_SIZE(omap2430_mmc1_slaves),
2619 .class = &omap2430_mmc_class,
2620 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2621};
2622
2623/* MMC/SD/SDIO2 */
2624
2625static struct omap_hwmod_irq_info omap2430_mmc2_mpu_irqs[] = {
2626 { .irq = 86 },
2627};
2628
2629static struct omap_hwmod_dma_info omap2430_mmc2_sdma_reqs[] = {
2630 { .name = "tx", .dma_req = 47 }, /* DMA_MMC2_TX */
2631 { .name = "rx", .dma_req = 48 }, /* DMA_MMC2_RX */
2632};
2633
2634static struct omap_hwmod_opt_clk omap2430_mmc2_opt_clks[] = {
2635 { .role = "dbck", .clk = "mmchsdb2_fck" },
2636};
2637
2638static struct omap_hwmod_ocp_if *omap2430_mmc2_slaves[] = {
2639 &omap2430_l4_core__mmc2,
2640};
2641
2642static struct omap_hwmod omap2430_mmc2_hwmod = {
2643 .name = "mmc2",
2644 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
2645 .mpu_irqs = omap2430_mmc2_mpu_irqs,
2646 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mmc2_mpu_irqs),
2647 .sdma_reqs = omap2430_mmc2_sdma_reqs,
2648 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mmc2_sdma_reqs),
2649 .opt_clks = omap2430_mmc2_opt_clks,
2650 .opt_clks_cnt = ARRAY_SIZE(omap2430_mmc2_opt_clks),
2651 .main_clk = "mmchs2_fck",
2652 .prcm = {
2653 .omap2 = {
2654 .module_offs = CORE_MOD,
2655 .prcm_reg_id = 2,
2656 .module_bit = OMAP2430_EN_MMCHS2_SHIFT,
2657 .idlest_reg_id = 2,
2658 .idlest_idle_bit = OMAP2430_ST_MMCHS2_SHIFT,
2659 },
2660 },
2661 .slaves = omap2430_mmc2_slaves,
2662 .slaves_cnt = ARRAY_SIZE(omap2430_mmc2_slaves),
2663 .class = &omap2430_mmc_class,
2664 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2665};
2666
922static __initdata struct omap_hwmod *omap2430_hwmods[] = { 2667static __initdata struct omap_hwmod *omap2430_hwmods[] = {
923 &omap2430_l3_main_hwmod, 2668 &omap2430_l3_main_hwmod,
924 &omap2430_l4_core_hwmod, 2669 &omap2430_l4_core_hwmod,
925 &omap2430_l4_wkup_hwmod, 2670 &omap2430_l4_wkup_hwmod,
926 &omap2430_mpu_hwmod, 2671 &omap2430_mpu_hwmod,
927 &omap2430_iva_hwmod, 2672 &omap2430_iva_hwmod,
2673
2674 &omap2430_timer1_hwmod,
2675 &omap2430_timer2_hwmod,
2676 &omap2430_timer3_hwmod,
2677 &omap2430_timer4_hwmod,
2678 &omap2430_timer5_hwmod,
2679 &omap2430_timer6_hwmod,
2680 &omap2430_timer7_hwmod,
2681 &omap2430_timer8_hwmod,
2682 &omap2430_timer9_hwmod,
2683 &omap2430_timer10_hwmod,
2684 &omap2430_timer11_hwmod,
2685 &omap2430_timer12_hwmod,
2686
928 &omap2430_wd_timer2_hwmod, 2687 &omap2430_wd_timer2_hwmod,
929 &omap2430_uart1_hwmod, 2688 &omap2430_uart1_hwmod,
930 &omap2430_uart2_hwmod, 2689 &omap2430_uart2_hwmod,
931 &omap2430_uart3_hwmod, 2690 &omap2430_uart3_hwmod,
2691 /* dss class */
2692 &omap2430_dss_core_hwmod,
2693 &omap2430_dss_dispc_hwmod,
2694 &omap2430_dss_rfbi_hwmod,
2695 &omap2430_dss_venc_hwmod,
2696 /* i2c class */
932 &omap2430_i2c1_hwmod, 2697 &omap2430_i2c1_hwmod,
933 &omap2430_i2c2_hwmod, 2698 &omap2430_i2c2_hwmod,
2699 &omap2430_mmc1_hwmod,
2700 &omap2430_mmc2_hwmod,
934 2701
935 /* gpio class */ 2702 /* gpio class */
936 &omap2430_gpio1_hwmod, 2703 &omap2430_gpio1_hwmod,
@@ -941,10 +2708,29 @@ static __initdata struct omap_hwmod *omap2430_hwmods[] = {
941 2708
942 /* dma_system class*/ 2709 /* dma_system class*/
943 &omap2430_dma_system_hwmod, 2710 &omap2430_dma_system_hwmod,
2711
2712 /* mcbsp class */
2713 &omap2430_mcbsp1_hwmod,
2714 &omap2430_mcbsp2_hwmod,
2715 &omap2430_mcbsp3_hwmod,
2716 &omap2430_mcbsp4_hwmod,
2717 &omap2430_mcbsp5_hwmod,
2718
2719 /* mailbox class */
2720 &omap2430_mailbox_hwmod,
2721
2722 /* mcspi class */
2723 &omap2430_mcspi1_hwmod,
2724 &omap2430_mcspi2_hwmod,
2725 &omap2430_mcspi3_hwmod,
2726
2727 /* usbotg class*/
2728 &omap2430_usbhsotg_hwmod,
2729
944 NULL, 2730 NULL,
945}; 2731};
946 2732
947int __init omap2430_hwmod_init(void) 2733int __init omap2430_hwmod_init(void)
948{ 2734{
949 return omap_hwmod_init(omap2430_hwmods); 2735 return omap_hwmod_register(omap2430_hwmods);
950} 2736}
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 8d8181334f86..b98e2dfcba28 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -18,16 +18,21 @@
18#include <plat/cpu.h> 18#include <plat/cpu.h>
19#include <plat/dma.h> 19#include <plat/dma.h>
20#include <plat/serial.h> 20#include <plat/serial.h>
21#include <plat/l3_3xxx.h>
21#include <plat/l4_3xxx.h> 22#include <plat/l4_3xxx.h>
22#include <plat/i2c.h> 23#include <plat/i2c.h>
23#include <plat/gpio.h> 24#include <plat/gpio.h>
24#include <plat/smartreflex.h> 25#include <plat/mmc.h>
26#include <plat/mcbsp.h>
27#include <plat/mcspi.h>
28#include <plat/dmtimer.h>
25 29
26#include "omap_hwmod_common_data.h" 30#include "omap_hwmod_common_data.h"
27 31
28#include "prm-regbits-34xx.h" 32#include "prm-regbits-34xx.h"
29#include "cm-regbits-34xx.h" 33#include "cm-regbits-34xx.h"
30#include "wd_timer.h" 34#include "wd_timer.h"
35#include <mach/am35xx.h>
31 36
32/* 37/*
33 * OMAP3xxx hardware module integration data 38 * OMAP3xxx hardware module integration data
@@ -44,6 +49,12 @@ static struct omap_hwmod omap3xxx_l3_main_hwmod;
44static struct omap_hwmod omap3xxx_l4_core_hwmod; 49static struct omap_hwmod omap3xxx_l4_core_hwmod;
45static struct omap_hwmod omap3xxx_l4_per_hwmod; 50static struct omap_hwmod omap3xxx_l4_per_hwmod;
46static struct omap_hwmod omap3xxx_wd_timer2_hwmod; 51static struct omap_hwmod omap3xxx_wd_timer2_hwmod;
52static struct omap_hwmod omap3430es1_dss_core_hwmod;
53static struct omap_hwmod omap3xxx_dss_core_hwmod;
54static struct omap_hwmod omap3xxx_dss_dispc_hwmod;
55static struct omap_hwmod omap3xxx_dss_dsi1_hwmod;
56static struct omap_hwmod omap3xxx_dss_rfbi_hwmod;
57static struct omap_hwmod omap3xxx_dss_venc_hwmod;
47static struct omap_hwmod omap3xxx_i2c1_hwmod; 58static struct omap_hwmod omap3xxx_i2c1_hwmod;
48static struct omap_hwmod omap3xxx_i2c2_hwmod; 59static struct omap_hwmod omap3xxx_i2c2_hwmod;
49static struct omap_hwmod omap3xxx_i2c3_hwmod; 60static struct omap_hwmod omap3xxx_i2c3_hwmod;
@@ -55,9 +66,25 @@ static struct omap_hwmod omap3xxx_gpio5_hwmod;
55static struct omap_hwmod omap3xxx_gpio6_hwmod; 66static struct omap_hwmod omap3xxx_gpio6_hwmod;
56static struct omap_hwmod omap34xx_sr1_hwmod; 67static struct omap_hwmod omap34xx_sr1_hwmod;
57static struct omap_hwmod omap34xx_sr2_hwmod; 68static struct omap_hwmod omap34xx_sr2_hwmod;
69static struct omap_hwmod omap34xx_mcspi1;
70static struct omap_hwmod omap34xx_mcspi2;
71static struct omap_hwmod omap34xx_mcspi3;
72static struct omap_hwmod omap34xx_mcspi4;
73static struct omap_hwmod omap3xxx_mmc1_hwmod;
74static struct omap_hwmod omap3xxx_mmc2_hwmod;
75static struct omap_hwmod omap3xxx_mmc3_hwmod;
76static struct omap_hwmod am35xx_usbhsotg_hwmod;
58 77
59static struct omap_hwmod omap3xxx_dma_system_hwmod; 78static struct omap_hwmod omap3xxx_dma_system_hwmod;
60 79
80static struct omap_hwmod omap3xxx_mcbsp1_hwmod;
81static struct omap_hwmod omap3xxx_mcbsp2_hwmod;
82static struct omap_hwmod omap3xxx_mcbsp3_hwmod;
83static struct omap_hwmod omap3xxx_mcbsp4_hwmod;
84static struct omap_hwmod omap3xxx_mcbsp5_hwmod;
85static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod;
86static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod;
87
61/* L3 -> L4_CORE interface */ 88/* L3 -> L4_CORE interface */
62static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = { 89static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = {
63 .master = &omap3xxx_l3_main_hwmod, 90 .master = &omap3xxx_l3_main_hwmod,
@@ -72,10 +99,26 @@ static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_per = {
72 .user = OCP_USER_MPU | OCP_USER_SDMA, 99 .user = OCP_USER_MPU | OCP_USER_SDMA,
73}; 100};
74 101
102/* L3 taret configuration and error log registers */
103static struct omap_hwmod_irq_info omap3xxx_l3_main_irqs[] = {
104 { .irq = INT_34XX_L3_DBG_IRQ },
105 { .irq = INT_34XX_L3_APP_IRQ },
106};
107
108static struct omap_hwmod_addr_space omap3xxx_l3_main_addrs[] = {
109 {
110 .pa_start = 0x68000000,
111 .pa_end = 0x6800ffff,
112 .flags = ADDR_TYPE_RT,
113 },
114};
115
75/* MPU -> L3 interface */ 116/* MPU -> L3 interface */
76static struct omap_hwmod_ocp_if omap3xxx_mpu__l3_main = { 117static struct omap_hwmod_ocp_if omap3xxx_mpu__l3_main = {
77 .master = &omap3xxx_mpu_hwmod, 118 .master = &omap3xxx_mpu_hwmod,
78 .slave = &omap3xxx_l3_main_hwmod, 119 .slave = &omap3xxx_l3_main_hwmod,
120 .addr = omap3xxx_l3_main_addrs,
121 .addr_cnt = ARRAY_SIZE(omap3xxx_l3_main_addrs),
79 .user = OCP_USER_MPU, 122 .user = OCP_USER_MPU,
80}; 123};
81 124
@@ -84,6 +127,19 @@ static struct omap_hwmod_ocp_if *omap3xxx_l3_main_slaves[] = {
84 &omap3xxx_mpu__l3_main, 127 &omap3xxx_mpu__l3_main,
85}; 128};
86 129
130/* DSS -> l3 */
131static struct omap_hwmod_ocp_if omap3xxx_dss__l3 = {
132 .master = &omap3xxx_dss_core_hwmod,
133 .slave = &omap3xxx_l3_main_hwmod,
134 .fw = {
135 .omap2 = {
136 .l3_perm_bit = OMAP3_L3_CORE_FW_INIT_ID_DSS,
137 .flags = OMAP_FIREWALL_L3,
138 }
139 },
140 .user = OCP_USER_MPU | OCP_USER_SDMA,
141};
142
87/* Master interfaces on the L3 interconnect */ 143/* Master interfaces on the L3 interconnect */
88static struct omap_hwmod_ocp_if *omap3xxx_l3_main_masters[] = { 144static struct omap_hwmod_ocp_if *omap3xxx_l3_main_masters[] = {
89 &omap3xxx_l3_main__l4_core, 145 &omap3xxx_l3_main__l4_core,
@@ -94,6 +150,8 @@ static struct omap_hwmod_ocp_if *omap3xxx_l3_main_masters[] = {
94static struct omap_hwmod omap3xxx_l3_main_hwmod = { 150static struct omap_hwmod omap3xxx_l3_main_hwmod = {
95 .name = "l3_main", 151 .name = "l3_main",
96 .class = &l3_hwmod_class, 152 .class = &l3_hwmod_class,
153 .mpu_irqs = omap3xxx_l3_main_irqs,
154 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_l3_main_irqs),
97 .masters = omap3xxx_l3_main_masters, 155 .masters = omap3xxx_l3_main_masters,
98 .masters_cnt = ARRAY_SIZE(omap3xxx_l3_main_masters), 156 .masters_cnt = ARRAY_SIZE(omap3xxx_l3_main_masters),
99 .slaves = omap3xxx_l3_main_slaves, 157 .slaves = omap3xxx_l3_main_slaves,
@@ -107,7 +165,23 @@ static struct omap_hwmod omap3xxx_uart1_hwmod;
107static struct omap_hwmod omap3xxx_uart2_hwmod; 165static struct omap_hwmod omap3xxx_uart2_hwmod;
108static struct omap_hwmod omap3xxx_uart3_hwmod; 166static struct omap_hwmod omap3xxx_uart3_hwmod;
109static struct omap_hwmod omap3xxx_uart4_hwmod; 167static struct omap_hwmod omap3xxx_uart4_hwmod;
168static struct omap_hwmod omap3xxx_usbhsotg_hwmod;
110 169
170/* l3_core -> usbhsotg interface */
171static struct omap_hwmod_ocp_if omap3xxx_usbhsotg__l3 = {
172 .master = &omap3xxx_usbhsotg_hwmod,
173 .slave = &omap3xxx_l3_main_hwmod,
174 .clk = "core_l3_ick",
175 .user = OCP_USER_MPU,
176};
177
178/* l3_core -> am35xx_usbhsotg interface */
179static struct omap_hwmod_ocp_if am35xx_usbhsotg__l3 = {
180 .master = &am35xx_usbhsotg_hwmod,
181 .slave = &omap3xxx_l3_main_hwmod,
182 .clk = "core_l3_ick",
183 .user = OCP_USER_MPU,
184};
111/* L4_CORE -> L4_WKUP interface */ 185/* L4_CORE -> L4_WKUP interface */
112static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = { 186static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = {
113 .master = &omap3xxx_l4_core_hwmod, 187 .master = &omap3xxx_l4_core_hwmod,
@@ -115,6 +189,63 @@ static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = {
115 .user = OCP_USER_MPU | OCP_USER_SDMA, 189 .user = OCP_USER_MPU | OCP_USER_SDMA,
116}; 190};
117 191
192/* L4 CORE -> MMC1 interface */
193static struct omap_hwmod_addr_space omap3xxx_mmc1_addr_space[] = {
194 {
195 .pa_start = 0x4809c000,
196 .pa_end = 0x4809c1ff,
197 .flags = ADDR_TYPE_RT,
198 },
199};
200
201static struct omap_hwmod_ocp_if omap3xxx_l4_core__mmc1 = {
202 .master = &omap3xxx_l4_core_hwmod,
203 .slave = &omap3xxx_mmc1_hwmod,
204 .clk = "mmchs1_ick",
205 .addr = omap3xxx_mmc1_addr_space,
206 .addr_cnt = ARRAY_SIZE(omap3xxx_mmc1_addr_space),
207 .user = OCP_USER_MPU | OCP_USER_SDMA,
208 .flags = OMAP_FIREWALL_L4
209};
210
211/* L4 CORE -> MMC2 interface */
212static struct omap_hwmod_addr_space omap3xxx_mmc2_addr_space[] = {
213 {
214 .pa_start = 0x480b4000,
215 .pa_end = 0x480b41ff,
216 .flags = ADDR_TYPE_RT,
217 },
218};
219
220static struct omap_hwmod_ocp_if omap3xxx_l4_core__mmc2 = {
221 .master = &omap3xxx_l4_core_hwmod,
222 .slave = &omap3xxx_mmc2_hwmod,
223 .clk = "mmchs2_ick",
224 .addr = omap3xxx_mmc2_addr_space,
225 .addr_cnt = ARRAY_SIZE(omap3xxx_mmc2_addr_space),
226 .user = OCP_USER_MPU | OCP_USER_SDMA,
227 .flags = OMAP_FIREWALL_L4
228};
229
230/* L4 CORE -> MMC3 interface */
231static struct omap_hwmod_addr_space omap3xxx_mmc3_addr_space[] = {
232 {
233 .pa_start = 0x480ad000,
234 .pa_end = 0x480ad1ff,
235 .flags = ADDR_TYPE_RT,
236 },
237};
238
239static struct omap_hwmod_ocp_if omap3xxx_l4_core__mmc3 = {
240 .master = &omap3xxx_l4_core_hwmod,
241 .slave = &omap3xxx_mmc3_hwmod,
242 .clk = "mmchs3_ick",
243 .addr = omap3xxx_mmc3_addr_space,
244 .addr_cnt = ARRAY_SIZE(omap3xxx_mmc3_addr_space),
245 .user = OCP_USER_MPU | OCP_USER_SDMA,
246 .flags = OMAP_FIREWALL_L4
247};
248
118/* L4 CORE -> UART1 interface */ 249/* L4 CORE -> UART1 interface */
119static struct omap_hwmod_addr_space omap3xxx_uart1_addr_space[] = { 250static struct omap_hwmod_addr_space omap3xxx_uart1_addr_space[] = {
120 { 251 {
@@ -301,29 +432,70 @@ static struct omap_hwmod_ocp_if omap3_l4_core__sr2 = {
301 .user = OCP_USER_MPU, 432 .user = OCP_USER_MPU,
302}; 433};
303 434
435/*
436* usbhsotg interface data
437*/
438
439static struct omap_hwmod_addr_space omap3xxx_usbhsotg_addrs[] = {
440 {
441 .pa_start = OMAP34XX_HSUSB_OTG_BASE,
442 .pa_end = OMAP34XX_HSUSB_OTG_BASE + SZ_4K - 1,
443 .flags = ADDR_TYPE_RT
444 },
445};
446
447/* l4_core -> usbhsotg */
448static struct omap_hwmod_ocp_if omap3xxx_l4_core__usbhsotg = {
449 .master = &omap3xxx_l4_core_hwmod,
450 .slave = &omap3xxx_usbhsotg_hwmod,
451 .clk = "l4_ick",
452 .addr = omap3xxx_usbhsotg_addrs,
453 .addr_cnt = ARRAY_SIZE(omap3xxx_usbhsotg_addrs),
454 .user = OCP_USER_MPU,
455};
456
457static struct omap_hwmod_ocp_if *omap3xxx_usbhsotg_masters[] = {
458 &omap3xxx_usbhsotg__l3,
459};
460
461static struct omap_hwmod_ocp_if *omap3xxx_usbhsotg_slaves[] = {
462 &omap3xxx_l4_core__usbhsotg,
463};
464
465static struct omap_hwmod_addr_space am35xx_usbhsotg_addrs[] = {
466 {
467 .pa_start = AM35XX_IPSS_USBOTGSS_BASE,
468 .pa_end = AM35XX_IPSS_USBOTGSS_BASE + SZ_4K - 1,
469 .flags = ADDR_TYPE_RT
470 },
471};
472
473/* l4_core -> usbhsotg */
474static struct omap_hwmod_ocp_if am35xx_l4_core__usbhsotg = {
475 .master = &omap3xxx_l4_core_hwmod,
476 .slave = &am35xx_usbhsotg_hwmod,
477 .clk = "l4_ick",
478 .addr = am35xx_usbhsotg_addrs,
479 .addr_cnt = ARRAY_SIZE(am35xx_usbhsotg_addrs),
480 .user = OCP_USER_MPU,
481};
482
483static struct omap_hwmod_ocp_if *am35xx_usbhsotg_masters[] = {
484 &am35xx_usbhsotg__l3,
485};
486
487static struct omap_hwmod_ocp_if *am35xx_usbhsotg_slaves[] = {
488 &am35xx_l4_core__usbhsotg,
489};
304/* Slave interfaces on the L4_CORE interconnect */ 490/* Slave interfaces on the L4_CORE interconnect */
305static struct omap_hwmod_ocp_if *omap3xxx_l4_core_slaves[] = { 491static struct omap_hwmod_ocp_if *omap3xxx_l4_core_slaves[] = {
306 &omap3xxx_l3_main__l4_core, 492 &omap3xxx_l3_main__l4_core,
307 &omap3_l4_core__sr1,
308 &omap3_l4_core__sr2,
309};
310
311/* Master interfaces on the L4_CORE interconnect */
312static struct omap_hwmod_ocp_if *omap3xxx_l4_core_masters[] = {
313 &omap3xxx_l4_core__l4_wkup,
314 &omap3_l4_core__uart1,
315 &omap3_l4_core__uart2,
316 &omap3_l4_core__i2c1,
317 &omap3_l4_core__i2c2,
318 &omap3_l4_core__i2c3,
319}; 493};
320 494
321/* L4 CORE */ 495/* L4 CORE */
322static struct omap_hwmod omap3xxx_l4_core_hwmod = { 496static struct omap_hwmod omap3xxx_l4_core_hwmod = {
323 .name = "l4_core", 497 .name = "l4_core",
324 .class = &l4_hwmod_class, 498 .class = &l4_hwmod_class,
325 .masters = omap3xxx_l4_core_masters,
326 .masters_cnt = ARRAY_SIZE(omap3xxx_l4_core_masters),
327 .slaves = omap3xxx_l4_core_slaves, 499 .slaves = omap3xxx_l4_core_slaves,
328 .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_core_slaves), 500 .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_core_slaves),
329 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 501 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
@@ -335,18 +507,10 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_per_slaves[] = {
335 &omap3xxx_l3_main__l4_per, 507 &omap3xxx_l3_main__l4_per,
336}; 508};
337 509
338/* Master interfaces on the L4_PER interconnect */
339static struct omap_hwmod_ocp_if *omap3xxx_l4_per_masters[] = {
340 &omap3_l4_per__uart3,
341 &omap3_l4_per__uart4,
342};
343
344/* L4 PER */ 510/* L4 PER */
345static struct omap_hwmod omap3xxx_l4_per_hwmod = { 511static struct omap_hwmod omap3xxx_l4_per_hwmod = {
346 .name = "l4_per", 512 .name = "l4_per",
347 .class = &l4_hwmod_class, 513 .class = &l4_hwmod_class,
348 .masters = omap3xxx_l4_per_masters,
349 .masters_cnt = ARRAY_SIZE(omap3xxx_l4_per_masters),
350 .slaves = omap3xxx_l4_per_slaves, 514 .slaves = omap3xxx_l4_per_slaves,
351 .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_per_slaves), 515 .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_per_slaves),
352 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 516 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
@@ -358,16 +522,10 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_wkup_slaves[] = {
358 &omap3xxx_l4_core__l4_wkup, 522 &omap3xxx_l4_core__l4_wkup,
359}; 523};
360 524
361/* Master interfaces on the L4_WKUP interconnect */
362static struct omap_hwmod_ocp_if *omap3xxx_l4_wkup_masters[] = {
363};
364
365/* L4 WKUP */ 525/* L4 WKUP */
366static struct omap_hwmod omap3xxx_l4_wkup_hwmod = { 526static struct omap_hwmod omap3xxx_l4_wkup_hwmod = {
367 .name = "l4_wkup", 527 .name = "l4_wkup",
368 .class = &l4_hwmod_class, 528 .class = &l4_hwmod_class,
369 .masters = omap3xxx_l4_wkup_masters,
370 .masters_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_masters),
371 .slaves = omap3xxx_l4_wkup_slaves, 529 .slaves = omap3xxx_l4_wkup_slaves,
372 .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_slaves), 530 .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_slaves),
373 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 531 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
@@ -417,6 +575,640 @@ static struct omap_hwmod omap3xxx_iva_hwmod = {
417 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) 575 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
418}; 576};
419 577
578/* timer class */
579static struct omap_hwmod_class_sysconfig omap3xxx_timer_1ms_sysc = {
580 .rev_offs = 0x0000,
581 .sysc_offs = 0x0010,
582 .syss_offs = 0x0014,
583 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
584 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
585 SYSC_HAS_EMUFREE | SYSC_HAS_AUTOIDLE),
586 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
587 .sysc_fields = &omap_hwmod_sysc_type1,
588};
589
590static struct omap_hwmod_class omap3xxx_timer_1ms_hwmod_class = {
591 .name = "timer",
592 .sysc = &omap3xxx_timer_1ms_sysc,
593 .rev = OMAP_TIMER_IP_VERSION_1,
594};
595
596static struct omap_hwmod_class_sysconfig omap3xxx_timer_sysc = {
597 .rev_offs = 0x0000,
598 .sysc_offs = 0x0010,
599 .syss_offs = 0x0014,
600 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_ENAWAKEUP |
601 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
602 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
603 .sysc_fields = &omap_hwmod_sysc_type1,
604};
605
606static struct omap_hwmod_class omap3xxx_timer_hwmod_class = {
607 .name = "timer",
608 .sysc = &omap3xxx_timer_sysc,
609 .rev = OMAP_TIMER_IP_VERSION_1,
610};
611
612/* timer1 */
613static struct omap_hwmod omap3xxx_timer1_hwmod;
614static struct omap_hwmod_irq_info omap3xxx_timer1_mpu_irqs[] = {
615 { .irq = 37, },
616};
617
618static struct omap_hwmod_addr_space omap3xxx_timer1_addrs[] = {
619 {
620 .pa_start = 0x48318000,
621 .pa_end = 0x48318000 + SZ_1K - 1,
622 .flags = ADDR_TYPE_RT
623 },
624};
625
626/* l4_wkup -> timer1 */
627static struct omap_hwmod_ocp_if omap3xxx_l4_wkup__timer1 = {
628 .master = &omap3xxx_l4_wkup_hwmod,
629 .slave = &omap3xxx_timer1_hwmod,
630 .clk = "gpt1_ick",
631 .addr = omap3xxx_timer1_addrs,
632 .addr_cnt = ARRAY_SIZE(omap3xxx_timer1_addrs),
633 .user = OCP_USER_MPU | OCP_USER_SDMA,
634};
635
636/* timer1 slave port */
637static struct omap_hwmod_ocp_if *omap3xxx_timer1_slaves[] = {
638 &omap3xxx_l4_wkup__timer1,
639};
640
641/* timer1 hwmod */
642static struct omap_hwmod omap3xxx_timer1_hwmod = {
643 .name = "timer1",
644 .mpu_irqs = omap3xxx_timer1_mpu_irqs,
645 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer1_mpu_irqs),
646 .main_clk = "gpt1_fck",
647 .prcm = {
648 .omap2 = {
649 .prcm_reg_id = 1,
650 .module_bit = OMAP3430_EN_GPT1_SHIFT,
651 .module_offs = WKUP_MOD,
652 .idlest_reg_id = 1,
653 .idlest_idle_bit = OMAP3430_ST_GPT1_SHIFT,
654 },
655 },
656 .slaves = omap3xxx_timer1_slaves,
657 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer1_slaves),
658 .class = &omap3xxx_timer_1ms_hwmod_class,
659 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
660};
661
662/* timer2 */
663static struct omap_hwmod omap3xxx_timer2_hwmod;
664static struct omap_hwmod_irq_info omap3xxx_timer2_mpu_irqs[] = {
665 { .irq = 38, },
666};
667
668static struct omap_hwmod_addr_space omap3xxx_timer2_addrs[] = {
669 {
670 .pa_start = 0x49032000,
671 .pa_end = 0x49032000 + SZ_1K - 1,
672 .flags = ADDR_TYPE_RT
673 },
674};
675
676/* l4_per -> timer2 */
677static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer2 = {
678 .master = &omap3xxx_l4_per_hwmod,
679 .slave = &omap3xxx_timer2_hwmod,
680 .clk = "gpt2_ick",
681 .addr = omap3xxx_timer2_addrs,
682 .addr_cnt = ARRAY_SIZE(omap3xxx_timer2_addrs),
683 .user = OCP_USER_MPU | OCP_USER_SDMA,
684};
685
686/* timer2 slave port */
687static struct omap_hwmod_ocp_if *omap3xxx_timer2_slaves[] = {
688 &omap3xxx_l4_per__timer2,
689};
690
691/* timer2 hwmod */
692static struct omap_hwmod omap3xxx_timer2_hwmod = {
693 .name = "timer2",
694 .mpu_irqs = omap3xxx_timer2_mpu_irqs,
695 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer2_mpu_irqs),
696 .main_clk = "gpt2_fck",
697 .prcm = {
698 .omap2 = {
699 .prcm_reg_id = 1,
700 .module_bit = OMAP3430_EN_GPT2_SHIFT,
701 .module_offs = OMAP3430_PER_MOD,
702 .idlest_reg_id = 1,
703 .idlest_idle_bit = OMAP3430_ST_GPT2_SHIFT,
704 },
705 },
706 .slaves = omap3xxx_timer2_slaves,
707 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer2_slaves),
708 .class = &omap3xxx_timer_1ms_hwmod_class,
709 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
710};
711
712/* timer3 */
713static struct omap_hwmod omap3xxx_timer3_hwmod;
714static struct omap_hwmod_irq_info omap3xxx_timer3_mpu_irqs[] = {
715 { .irq = 39, },
716};
717
718static struct omap_hwmod_addr_space omap3xxx_timer3_addrs[] = {
719 {
720 .pa_start = 0x49034000,
721 .pa_end = 0x49034000 + SZ_1K - 1,
722 .flags = ADDR_TYPE_RT
723 },
724};
725
726/* l4_per -> timer3 */
727static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer3 = {
728 .master = &omap3xxx_l4_per_hwmod,
729 .slave = &omap3xxx_timer3_hwmod,
730 .clk = "gpt3_ick",
731 .addr = omap3xxx_timer3_addrs,
732 .addr_cnt = ARRAY_SIZE(omap3xxx_timer3_addrs),
733 .user = OCP_USER_MPU | OCP_USER_SDMA,
734};
735
736/* timer3 slave port */
737static struct omap_hwmod_ocp_if *omap3xxx_timer3_slaves[] = {
738 &omap3xxx_l4_per__timer3,
739};
740
741/* timer3 hwmod */
742static struct omap_hwmod omap3xxx_timer3_hwmod = {
743 .name = "timer3",
744 .mpu_irqs = omap3xxx_timer3_mpu_irqs,
745 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer3_mpu_irqs),
746 .main_clk = "gpt3_fck",
747 .prcm = {
748 .omap2 = {
749 .prcm_reg_id = 1,
750 .module_bit = OMAP3430_EN_GPT3_SHIFT,
751 .module_offs = OMAP3430_PER_MOD,
752 .idlest_reg_id = 1,
753 .idlest_idle_bit = OMAP3430_ST_GPT3_SHIFT,
754 },
755 },
756 .slaves = omap3xxx_timer3_slaves,
757 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer3_slaves),
758 .class = &omap3xxx_timer_hwmod_class,
759 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
760};
761
762/* timer4 */
763static struct omap_hwmod omap3xxx_timer4_hwmod;
764static struct omap_hwmod_irq_info omap3xxx_timer4_mpu_irqs[] = {
765 { .irq = 40, },
766};
767
768static struct omap_hwmod_addr_space omap3xxx_timer4_addrs[] = {
769 {
770 .pa_start = 0x49036000,
771 .pa_end = 0x49036000 + SZ_1K - 1,
772 .flags = ADDR_TYPE_RT
773 },
774};
775
776/* l4_per -> timer4 */
777static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer4 = {
778 .master = &omap3xxx_l4_per_hwmod,
779 .slave = &omap3xxx_timer4_hwmod,
780 .clk = "gpt4_ick",
781 .addr = omap3xxx_timer4_addrs,
782 .addr_cnt = ARRAY_SIZE(omap3xxx_timer4_addrs),
783 .user = OCP_USER_MPU | OCP_USER_SDMA,
784};
785
786/* timer4 slave port */
787static struct omap_hwmod_ocp_if *omap3xxx_timer4_slaves[] = {
788 &omap3xxx_l4_per__timer4,
789};
790
791/* timer4 hwmod */
792static struct omap_hwmod omap3xxx_timer4_hwmod = {
793 .name = "timer4",
794 .mpu_irqs = omap3xxx_timer4_mpu_irqs,
795 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer4_mpu_irqs),
796 .main_clk = "gpt4_fck",
797 .prcm = {
798 .omap2 = {
799 .prcm_reg_id = 1,
800 .module_bit = OMAP3430_EN_GPT4_SHIFT,
801 .module_offs = OMAP3430_PER_MOD,
802 .idlest_reg_id = 1,
803 .idlest_idle_bit = OMAP3430_ST_GPT4_SHIFT,
804 },
805 },
806 .slaves = omap3xxx_timer4_slaves,
807 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer4_slaves),
808 .class = &omap3xxx_timer_hwmod_class,
809 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
810};
811
812/* timer5 */
813static struct omap_hwmod omap3xxx_timer5_hwmod;
814static struct omap_hwmod_irq_info omap3xxx_timer5_mpu_irqs[] = {
815 { .irq = 41, },
816};
817
818static struct omap_hwmod_addr_space omap3xxx_timer5_addrs[] = {
819 {
820 .pa_start = 0x49038000,
821 .pa_end = 0x49038000 + SZ_1K - 1,
822 .flags = ADDR_TYPE_RT
823 },
824};
825
826/* l4_per -> timer5 */
827static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer5 = {
828 .master = &omap3xxx_l4_per_hwmod,
829 .slave = &omap3xxx_timer5_hwmod,
830 .clk = "gpt5_ick",
831 .addr = omap3xxx_timer5_addrs,
832 .addr_cnt = ARRAY_SIZE(omap3xxx_timer5_addrs),
833 .user = OCP_USER_MPU | OCP_USER_SDMA,
834};
835
836/* timer5 slave port */
837static struct omap_hwmod_ocp_if *omap3xxx_timer5_slaves[] = {
838 &omap3xxx_l4_per__timer5,
839};
840
841/* timer5 hwmod */
842static struct omap_hwmod omap3xxx_timer5_hwmod = {
843 .name = "timer5",
844 .mpu_irqs = omap3xxx_timer5_mpu_irqs,
845 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer5_mpu_irqs),
846 .main_clk = "gpt5_fck",
847 .prcm = {
848 .omap2 = {
849 .prcm_reg_id = 1,
850 .module_bit = OMAP3430_EN_GPT5_SHIFT,
851 .module_offs = OMAP3430_PER_MOD,
852 .idlest_reg_id = 1,
853 .idlest_idle_bit = OMAP3430_ST_GPT5_SHIFT,
854 },
855 },
856 .slaves = omap3xxx_timer5_slaves,
857 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer5_slaves),
858 .class = &omap3xxx_timer_hwmod_class,
859 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
860};
861
862/* timer6 */
863static struct omap_hwmod omap3xxx_timer6_hwmod;
864static struct omap_hwmod_irq_info omap3xxx_timer6_mpu_irqs[] = {
865 { .irq = 42, },
866};
867
868static struct omap_hwmod_addr_space omap3xxx_timer6_addrs[] = {
869 {
870 .pa_start = 0x4903A000,
871 .pa_end = 0x4903A000 + SZ_1K - 1,
872 .flags = ADDR_TYPE_RT
873 },
874};
875
876/* l4_per -> timer6 */
877static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer6 = {
878 .master = &omap3xxx_l4_per_hwmod,
879 .slave = &omap3xxx_timer6_hwmod,
880 .clk = "gpt6_ick",
881 .addr = omap3xxx_timer6_addrs,
882 .addr_cnt = ARRAY_SIZE(omap3xxx_timer6_addrs),
883 .user = OCP_USER_MPU | OCP_USER_SDMA,
884};
885
886/* timer6 slave port */
887static struct omap_hwmod_ocp_if *omap3xxx_timer6_slaves[] = {
888 &omap3xxx_l4_per__timer6,
889};
890
891/* timer6 hwmod */
892static struct omap_hwmod omap3xxx_timer6_hwmod = {
893 .name = "timer6",
894 .mpu_irqs = omap3xxx_timer6_mpu_irqs,
895 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer6_mpu_irqs),
896 .main_clk = "gpt6_fck",
897 .prcm = {
898 .omap2 = {
899 .prcm_reg_id = 1,
900 .module_bit = OMAP3430_EN_GPT6_SHIFT,
901 .module_offs = OMAP3430_PER_MOD,
902 .idlest_reg_id = 1,
903 .idlest_idle_bit = OMAP3430_ST_GPT6_SHIFT,
904 },
905 },
906 .slaves = omap3xxx_timer6_slaves,
907 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer6_slaves),
908 .class = &omap3xxx_timer_hwmod_class,
909 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
910};
911
912/* timer7 */
913static struct omap_hwmod omap3xxx_timer7_hwmod;
914static struct omap_hwmod_irq_info omap3xxx_timer7_mpu_irqs[] = {
915 { .irq = 43, },
916};
917
918static struct omap_hwmod_addr_space omap3xxx_timer7_addrs[] = {
919 {
920 .pa_start = 0x4903C000,
921 .pa_end = 0x4903C000 + SZ_1K - 1,
922 .flags = ADDR_TYPE_RT
923 },
924};
925
926/* l4_per -> timer7 */
927static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer7 = {
928 .master = &omap3xxx_l4_per_hwmod,
929 .slave = &omap3xxx_timer7_hwmod,
930 .clk = "gpt7_ick",
931 .addr = omap3xxx_timer7_addrs,
932 .addr_cnt = ARRAY_SIZE(omap3xxx_timer7_addrs),
933 .user = OCP_USER_MPU | OCP_USER_SDMA,
934};
935
936/* timer7 slave port */
937static struct omap_hwmod_ocp_if *omap3xxx_timer7_slaves[] = {
938 &omap3xxx_l4_per__timer7,
939};
940
941/* timer7 hwmod */
942static struct omap_hwmod omap3xxx_timer7_hwmod = {
943 .name = "timer7",
944 .mpu_irqs = omap3xxx_timer7_mpu_irqs,
945 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer7_mpu_irqs),
946 .main_clk = "gpt7_fck",
947 .prcm = {
948 .omap2 = {
949 .prcm_reg_id = 1,
950 .module_bit = OMAP3430_EN_GPT7_SHIFT,
951 .module_offs = OMAP3430_PER_MOD,
952 .idlest_reg_id = 1,
953 .idlest_idle_bit = OMAP3430_ST_GPT7_SHIFT,
954 },
955 },
956 .slaves = omap3xxx_timer7_slaves,
957 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer7_slaves),
958 .class = &omap3xxx_timer_hwmod_class,
959 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
960};
961
962/* timer8 */
963static struct omap_hwmod omap3xxx_timer8_hwmod;
964static struct omap_hwmod_irq_info omap3xxx_timer8_mpu_irqs[] = {
965 { .irq = 44, },
966};
967
968static struct omap_hwmod_addr_space omap3xxx_timer8_addrs[] = {
969 {
970 .pa_start = 0x4903E000,
971 .pa_end = 0x4903E000 + SZ_1K - 1,
972 .flags = ADDR_TYPE_RT
973 },
974};
975
976/* l4_per -> timer8 */
977static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer8 = {
978 .master = &omap3xxx_l4_per_hwmod,
979 .slave = &omap3xxx_timer8_hwmod,
980 .clk = "gpt8_ick",
981 .addr = omap3xxx_timer8_addrs,
982 .addr_cnt = ARRAY_SIZE(omap3xxx_timer8_addrs),
983 .user = OCP_USER_MPU | OCP_USER_SDMA,
984};
985
986/* timer8 slave port */
987static struct omap_hwmod_ocp_if *omap3xxx_timer8_slaves[] = {
988 &omap3xxx_l4_per__timer8,
989};
990
991/* timer8 hwmod */
992static struct omap_hwmod omap3xxx_timer8_hwmod = {
993 .name = "timer8",
994 .mpu_irqs = omap3xxx_timer8_mpu_irqs,
995 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer8_mpu_irqs),
996 .main_clk = "gpt8_fck",
997 .prcm = {
998 .omap2 = {
999 .prcm_reg_id = 1,
1000 .module_bit = OMAP3430_EN_GPT8_SHIFT,
1001 .module_offs = OMAP3430_PER_MOD,
1002 .idlest_reg_id = 1,
1003 .idlest_idle_bit = OMAP3430_ST_GPT8_SHIFT,
1004 },
1005 },
1006 .slaves = omap3xxx_timer8_slaves,
1007 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer8_slaves),
1008 .class = &omap3xxx_timer_hwmod_class,
1009 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
1010};
1011
1012/* timer9 */
1013static struct omap_hwmod omap3xxx_timer9_hwmod;
1014static struct omap_hwmod_irq_info omap3xxx_timer9_mpu_irqs[] = {
1015 { .irq = 45, },
1016};
1017
1018static struct omap_hwmod_addr_space omap3xxx_timer9_addrs[] = {
1019 {
1020 .pa_start = 0x49040000,
1021 .pa_end = 0x49040000 + SZ_1K - 1,
1022 .flags = ADDR_TYPE_RT
1023 },
1024};
1025
1026/* l4_per -> timer9 */
1027static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer9 = {
1028 .master = &omap3xxx_l4_per_hwmod,
1029 .slave = &omap3xxx_timer9_hwmod,
1030 .clk = "gpt9_ick",
1031 .addr = omap3xxx_timer9_addrs,
1032 .addr_cnt = ARRAY_SIZE(omap3xxx_timer9_addrs),
1033 .user = OCP_USER_MPU | OCP_USER_SDMA,
1034};
1035
1036/* timer9 slave port */
1037static struct omap_hwmod_ocp_if *omap3xxx_timer9_slaves[] = {
1038 &omap3xxx_l4_per__timer9,
1039};
1040
1041/* timer9 hwmod */
1042static struct omap_hwmod omap3xxx_timer9_hwmod = {
1043 .name = "timer9",
1044 .mpu_irqs = omap3xxx_timer9_mpu_irqs,
1045 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer9_mpu_irqs),
1046 .main_clk = "gpt9_fck",
1047 .prcm = {
1048 .omap2 = {
1049 .prcm_reg_id = 1,
1050 .module_bit = OMAP3430_EN_GPT9_SHIFT,
1051 .module_offs = OMAP3430_PER_MOD,
1052 .idlest_reg_id = 1,
1053 .idlest_idle_bit = OMAP3430_ST_GPT9_SHIFT,
1054 },
1055 },
1056 .slaves = omap3xxx_timer9_slaves,
1057 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer9_slaves),
1058 .class = &omap3xxx_timer_hwmod_class,
1059 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
1060};
1061
1062/* timer10 */
1063static struct omap_hwmod omap3xxx_timer10_hwmod;
1064static struct omap_hwmod_irq_info omap3xxx_timer10_mpu_irqs[] = {
1065 { .irq = 46, },
1066};
1067
1068static struct omap_hwmod_addr_space omap3xxx_timer10_addrs[] = {
1069 {
1070 .pa_start = 0x48086000,
1071 .pa_end = 0x48086000 + SZ_1K - 1,
1072 .flags = ADDR_TYPE_RT
1073 },
1074};
1075
1076/* l4_core -> timer10 */
1077static struct omap_hwmod_ocp_if omap3xxx_l4_core__timer10 = {
1078 .master = &omap3xxx_l4_core_hwmod,
1079 .slave = &omap3xxx_timer10_hwmod,
1080 .clk = "gpt10_ick",
1081 .addr = omap3xxx_timer10_addrs,
1082 .addr_cnt = ARRAY_SIZE(omap3xxx_timer10_addrs),
1083 .user = OCP_USER_MPU | OCP_USER_SDMA,
1084};
1085
1086/* timer10 slave port */
1087static struct omap_hwmod_ocp_if *omap3xxx_timer10_slaves[] = {
1088 &omap3xxx_l4_core__timer10,
1089};
1090
1091/* timer10 hwmod */
1092static struct omap_hwmod omap3xxx_timer10_hwmod = {
1093 .name = "timer10",
1094 .mpu_irqs = omap3xxx_timer10_mpu_irqs,
1095 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer10_mpu_irqs),
1096 .main_clk = "gpt10_fck",
1097 .prcm = {
1098 .omap2 = {
1099 .prcm_reg_id = 1,
1100 .module_bit = OMAP3430_EN_GPT10_SHIFT,
1101 .module_offs = CORE_MOD,
1102 .idlest_reg_id = 1,
1103 .idlest_idle_bit = OMAP3430_ST_GPT10_SHIFT,
1104 },
1105 },
1106 .slaves = omap3xxx_timer10_slaves,
1107 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer10_slaves),
1108 .class = &omap3xxx_timer_1ms_hwmod_class,
1109 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
1110};
1111
1112/* timer11 */
1113static struct omap_hwmod omap3xxx_timer11_hwmod;
1114static struct omap_hwmod_irq_info omap3xxx_timer11_mpu_irqs[] = {
1115 { .irq = 47, },
1116};
1117
1118static struct omap_hwmod_addr_space omap3xxx_timer11_addrs[] = {
1119 {
1120 .pa_start = 0x48088000,
1121 .pa_end = 0x48088000 + SZ_1K - 1,
1122 .flags = ADDR_TYPE_RT
1123 },
1124};
1125
1126/* l4_core -> timer11 */
1127static struct omap_hwmod_ocp_if omap3xxx_l4_core__timer11 = {
1128 .master = &omap3xxx_l4_core_hwmod,
1129 .slave = &omap3xxx_timer11_hwmod,
1130 .clk = "gpt11_ick",
1131 .addr = omap3xxx_timer11_addrs,
1132 .addr_cnt = ARRAY_SIZE(omap3xxx_timer11_addrs),
1133 .user = OCP_USER_MPU | OCP_USER_SDMA,
1134};
1135
1136/* timer11 slave port */
1137static struct omap_hwmod_ocp_if *omap3xxx_timer11_slaves[] = {
1138 &omap3xxx_l4_core__timer11,
1139};
1140
1141/* timer11 hwmod */
1142static struct omap_hwmod omap3xxx_timer11_hwmod = {
1143 .name = "timer11",
1144 .mpu_irqs = omap3xxx_timer11_mpu_irqs,
1145 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer11_mpu_irqs),
1146 .main_clk = "gpt11_fck",
1147 .prcm = {
1148 .omap2 = {
1149 .prcm_reg_id = 1,
1150 .module_bit = OMAP3430_EN_GPT11_SHIFT,
1151 .module_offs = CORE_MOD,
1152 .idlest_reg_id = 1,
1153 .idlest_idle_bit = OMAP3430_ST_GPT11_SHIFT,
1154 },
1155 },
1156 .slaves = omap3xxx_timer11_slaves,
1157 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer11_slaves),
1158 .class = &omap3xxx_timer_hwmod_class,
1159 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
1160};
1161
1162/* timer12*/
1163static struct omap_hwmod omap3xxx_timer12_hwmod;
1164static struct omap_hwmod_irq_info omap3xxx_timer12_mpu_irqs[] = {
1165 { .irq = 95, },
1166};
1167
1168static struct omap_hwmod_addr_space omap3xxx_timer12_addrs[] = {
1169 {
1170 .pa_start = 0x48304000,
1171 .pa_end = 0x48304000 + SZ_1K - 1,
1172 .flags = ADDR_TYPE_RT
1173 },
1174};
1175
1176/* l4_core -> timer12 */
1177static struct omap_hwmod_ocp_if omap3xxx_l4_core__timer12 = {
1178 .master = &omap3xxx_l4_core_hwmod,
1179 .slave = &omap3xxx_timer12_hwmod,
1180 .clk = "gpt12_ick",
1181 .addr = omap3xxx_timer12_addrs,
1182 .addr_cnt = ARRAY_SIZE(omap3xxx_timer12_addrs),
1183 .user = OCP_USER_MPU | OCP_USER_SDMA,
1184};
1185
1186/* timer12 slave port */
1187static struct omap_hwmod_ocp_if *omap3xxx_timer12_slaves[] = {
1188 &omap3xxx_l4_core__timer12,
1189};
1190
1191/* timer12 hwmod */
1192static struct omap_hwmod omap3xxx_timer12_hwmod = {
1193 .name = "timer12",
1194 .mpu_irqs = omap3xxx_timer12_mpu_irqs,
1195 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer12_mpu_irqs),
1196 .main_clk = "gpt12_fck",
1197 .prcm = {
1198 .omap2 = {
1199 .prcm_reg_id = 1,
1200 .module_bit = OMAP3430_EN_GPT12_SHIFT,
1201 .module_offs = WKUP_MOD,
1202 .idlest_reg_id = 1,
1203 .idlest_idle_bit = OMAP3430_ST_GPT12_SHIFT,
1204 },
1205 },
1206 .slaves = omap3xxx_timer12_slaves,
1207 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer12_slaves),
1208 .class = &omap3xxx_timer_hwmod_class,
1209 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
1210};
1211
420/* l4_wkup -> wd_timer2 */ 1212/* l4_wkup -> wd_timer2 */
421static struct omap_hwmod_addr_space omap3xxx_wd_timer2_addrs[] = { 1213static struct omap_hwmod_addr_space omap3xxx_wd_timer2_addrs[] = {
422 { 1214 {
@@ -447,7 +1239,8 @@ static struct omap_hwmod_class_sysconfig omap3xxx_wd_timer_sysc = {
447 .syss_offs = 0x0014, 1239 .syss_offs = 0x0014,
448 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_EMUFREE | 1240 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_EMUFREE |
449 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | 1241 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
450 SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY), 1242 SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
1243 SYSS_HAS_RESET_STATUS),
451 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), 1244 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
452 .sysc_fields = &omap_hwmod_sysc_type1, 1245 .sysc_fields = &omap_hwmod_sysc_type1,
453}; 1246};
@@ -459,7 +1252,7 @@ static struct omap_hwmod_class_sysconfig i2c_sysc = {
459 .syss_offs = 0x10, 1252 .syss_offs = 0x10,
460 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE | 1253 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
461 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | 1254 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
462 SYSC_HAS_AUTOIDLE), 1255 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
463 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), 1256 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
464 .sysc_fields = &omap_hwmod_sysc_type1, 1257 .sysc_fields = &omap_hwmod_sysc_type1,
465}; 1258};
@@ -491,6 +1284,11 @@ static struct omap_hwmod omap3xxx_wd_timer2_hwmod = {
491 .slaves = omap3xxx_wd_timer2_slaves, 1284 .slaves = omap3xxx_wd_timer2_slaves,
492 .slaves_cnt = ARRAY_SIZE(omap3xxx_wd_timer2_slaves), 1285 .slaves_cnt = ARRAY_SIZE(omap3xxx_wd_timer2_slaves),
493 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 1286 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1287 /*
1288 * XXX: Use software supervised mode, HW supervised smartidle seems to
1289 * block CORE power domain idle transitions. Maybe a HW bug in wdt2?
1290 */
1291 .flags = HWMOD_SWSUP_SIDLE,
494}; 1292};
495 1293
496/* UART common */ 1294/* UART common */
@@ -501,7 +1299,7 @@ static struct omap_hwmod_class_sysconfig uart_sysc = {
501 .syss_offs = 0x58, 1299 .syss_offs = 0x58,
502 .sysc_flags = (SYSC_HAS_SIDLEMODE | 1300 .sysc_flags = (SYSC_HAS_SIDLEMODE |
503 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | 1301 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
504 SYSC_HAS_AUTOIDLE), 1302 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
505 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), 1303 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
506 .sysc_fields = &omap_hwmod_sysc_type1, 1304 .sysc_fields = &omap_hwmod_sysc_type1,
507}; 1305};
@@ -664,6 +1462,414 @@ static struct omap_hwmod_class i2c_class = {
664 .sysc = &i2c_sysc, 1462 .sysc = &i2c_sysc,
665}; 1463};
666 1464
1465/*
1466 * 'dss' class
1467 * display sub-system
1468 */
1469
1470static struct omap_hwmod_class_sysconfig omap3xxx_dss_sysc = {
1471 .rev_offs = 0x0000,
1472 .sysc_offs = 0x0010,
1473 .syss_offs = 0x0014,
1474 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
1475 .sysc_fields = &omap_hwmod_sysc_type1,
1476};
1477
1478static struct omap_hwmod_class omap3xxx_dss_hwmod_class = {
1479 .name = "dss",
1480 .sysc = &omap3xxx_dss_sysc,
1481};
1482
1483static struct omap_hwmod_dma_info omap3xxx_dss_sdma_chs[] = {
1484 { .name = "dispc", .dma_req = 5 },
1485 { .name = "dsi1", .dma_req = 74 },
1486};
1487
1488/* dss */
1489/* dss master ports */
1490static struct omap_hwmod_ocp_if *omap3xxx_dss_masters[] = {
1491 &omap3xxx_dss__l3,
1492};
1493
1494static struct omap_hwmod_addr_space omap3xxx_dss_addrs[] = {
1495 {
1496 .pa_start = 0x48050000,
1497 .pa_end = 0x480503FF,
1498 .flags = ADDR_TYPE_RT
1499 },
1500};
1501
1502/* l4_core -> dss */
1503static struct omap_hwmod_ocp_if omap3430es1_l4_core__dss = {
1504 .master = &omap3xxx_l4_core_hwmod,
1505 .slave = &omap3430es1_dss_core_hwmod,
1506 .clk = "dss_ick",
1507 .addr = omap3xxx_dss_addrs,
1508 .addr_cnt = ARRAY_SIZE(omap3xxx_dss_addrs),
1509 .fw = {
1510 .omap2 = {
1511 .l4_fw_region = OMAP3ES1_L4_CORE_FW_DSS_CORE_REGION,
1512 .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP,
1513 .flags = OMAP_FIREWALL_L4,
1514 }
1515 },
1516 .user = OCP_USER_MPU | OCP_USER_SDMA,
1517};
1518
1519static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss = {
1520 .master = &omap3xxx_l4_core_hwmod,
1521 .slave = &omap3xxx_dss_core_hwmod,
1522 .clk = "dss_ick",
1523 .addr = omap3xxx_dss_addrs,
1524 .addr_cnt = ARRAY_SIZE(omap3xxx_dss_addrs),
1525 .fw = {
1526 .omap2 = {
1527 .l4_fw_region = OMAP3_L4_CORE_FW_DSS_CORE_REGION,
1528 .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP,
1529 .flags = OMAP_FIREWALL_L4,
1530 }
1531 },
1532 .user = OCP_USER_MPU | OCP_USER_SDMA,
1533};
1534
1535/* dss slave ports */
1536static struct omap_hwmod_ocp_if *omap3430es1_dss_slaves[] = {
1537 &omap3430es1_l4_core__dss,
1538};
1539
1540static struct omap_hwmod_ocp_if *omap3xxx_dss_slaves[] = {
1541 &omap3xxx_l4_core__dss,
1542};
1543
1544static struct omap_hwmod_opt_clk dss_opt_clks[] = {
1545 { .role = "tv_clk", .clk = "dss_tv_fck" },
1546 { .role = "video_clk", .clk = "dss_96m_fck" },
1547 { .role = "sys_clk", .clk = "dss2_alwon_fck" },
1548};
1549
1550static struct omap_hwmod omap3430es1_dss_core_hwmod = {
1551 .name = "dss_core",
1552 .class = &omap3xxx_dss_hwmod_class,
1553 .main_clk = "dss1_alwon_fck", /* instead of dss_fck */
1554 .sdma_reqs = omap3xxx_dss_sdma_chs,
1555 .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_dss_sdma_chs),
1556
1557 .prcm = {
1558 .omap2 = {
1559 .prcm_reg_id = 1,
1560 .module_bit = OMAP3430_EN_DSS1_SHIFT,
1561 .module_offs = OMAP3430_DSS_MOD,
1562 .idlest_reg_id = 1,
1563 .idlest_stdby_bit = OMAP3430ES1_ST_DSS_SHIFT,
1564 },
1565 },
1566 .opt_clks = dss_opt_clks,
1567 .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
1568 .slaves = omap3430es1_dss_slaves,
1569 .slaves_cnt = ARRAY_SIZE(omap3430es1_dss_slaves),
1570 .masters = omap3xxx_dss_masters,
1571 .masters_cnt = ARRAY_SIZE(omap3xxx_dss_masters),
1572 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1),
1573 .flags = HWMOD_NO_IDLEST,
1574};
1575
1576static struct omap_hwmod omap3xxx_dss_core_hwmod = {
1577 .name = "dss_core",
1578 .class = &omap3xxx_dss_hwmod_class,
1579 .main_clk = "dss1_alwon_fck", /* instead of dss_fck */
1580 .sdma_reqs = omap3xxx_dss_sdma_chs,
1581 .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_dss_sdma_chs),
1582
1583 .prcm = {
1584 .omap2 = {
1585 .prcm_reg_id = 1,
1586 .module_bit = OMAP3430_EN_DSS1_SHIFT,
1587 .module_offs = OMAP3430_DSS_MOD,
1588 .idlest_reg_id = 1,
1589 .idlest_idle_bit = OMAP3430ES2_ST_DSS_IDLE_SHIFT,
1590 .idlest_stdby_bit = OMAP3430ES2_ST_DSS_STDBY_SHIFT,
1591 },
1592 },
1593 .opt_clks = dss_opt_clks,
1594 .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
1595 .slaves = omap3xxx_dss_slaves,
1596 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_slaves),
1597 .masters = omap3xxx_dss_masters,
1598 .masters_cnt = ARRAY_SIZE(omap3xxx_dss_masters),
1599 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2 |
1600 CHIP_IS_OMAP3630ES1 | CHIP_GE_OMAP3630ES1_1),
1601};
1602
1603/*
1604 * 'dispc' class
1605 * display controller
1606 */
1607
1608static struct omap_hwmod_class_sysconfig omap3xxx_dispc_sysc = {
1609 .rev_offs = 0x0000,
1610 .sysc_offs = 0x0010,
1611 .syss_offs = 0x0014,
1612 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
1613 SYSC_HAS_MIDLEMODE | SYSC_HAS_ENAWAKEUP |
1614 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
1615 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1616 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
1617 .sysc_fields = &omap_hwmod_sysc_type1,
1618};
1619
1620static struct omap_hwmod_class omap3xxx_dispc_hwmod_class = {
1621 .name = "dispc",
1622 .sysc = &omap3xxx_dispc_sysc,
1623};
1624
1625static struct omap_hwmod_irq_info omap3xxx_dispc_irqs[] = {
1626 { .irq = 25 },
1627};
1628
1629static struct omap_hwmod_addr_space omap3xxx_dss_dispc_addrs[] = {
1630 {
1631 .pa_start = 0x48050400,
1632 .pa_end = 0x480507FF,
1633 .flags = ADDR_TYPE_RT
1634 },
1635};
1636
1637/* l4_core -> dss_dispc */
1638static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_dispc = {
1639 .master = &omap3xxx_l4_core_hwmod,
1640 .slave = &omap3xxx_dss_dispc_hwmod,
1641 .clk = "dss_ick",
1642 .addr = omap3xxx_dss_dispc_addrs,
1643 .addr_cnt = ARRAY_SIZE(omap3xxx_dss_dispc_addrs),
1644 .fw = {
1645 .omap2 = {
1646 .l4_fw_region = OMAP3_L4_CORE_FW_DSS_DISPC_REGION,
1647 .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP,
1648 .flags = OMAP_FIREWALL_L4,
1649 }
1650 },
1651 .user = OCP_USER_MPU | OCP_USER_SDMA,
1652};
1653
1654/* dss_dispc slave ports */
1655static struct omap_hwmod_ocp_if *omap3xxx_dss_dispc_slaves[] = {
1656 &omap3xxx_l4_core__dss_dispc,
1657};
1658
1659static struct omap_hwmod omap3xxx_dss_dispc_hwmod = {
1660 .name = "dss_dispc",
1661 .class = &omap3xxx_dispc_hwmod_class,
1662 .mpu_irqs = omap3xxx_dispc_irqs,
1663 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_dispc_irqs),
1664 .main_clk = "dss1_alwon_fck",
1665 .prcm = {
1666 .omap2 = {
1667 .prcm_reg_id = 1,
1668 .module_bit = OMAP3430_EN_DSS1_SHIFT,
1669 .module_offs = OMAP3430_DSS_MOD,
1670 },
1671 },
1672 .slaves = omap3xxx_dss_dispc_slaves,
1673 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_dispc_slaves),
1674 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 |
1675 CHIP_GE_OMAP3430ES2 | CHIP_IS_OMAP3630ES1 |
1676 CHIP_GE_OMAP3630ES1_1),
1677 .flags = HWMOD_NO_IDLEST,
1678};
1679
1680/*
1681 * 'dsi' class
1682 * display serial interface controller
1683 */
1684
1685static struct omap_hwmod_class omap3xxx_dsi_hwmod_class = {
1686 .name = "dsi",
1687};
1688
1689static struct omap_hwmod_irq_info omap3xxx_dsi1_irqs[] = {
1690 { .irq = 25 },
1691};
1692
1693/* dss_dsi1 */
1694static struct omap_hwmod_addr_space omap3xxx_dss_dsi1_addrs[] = {
1695 {
1696 .pa_start = 0x4804FC00,
1697 .pa_end = 0x4804FFFF,
1698 .flags = ADDR_TYPE_RT
1699 },
1700};
1701
1702/* l4_core -> dss_dsi1 */
1703static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_dsi1 = {
1704 .master = &omap3xxx_l4_core_hwmod,
1705 .slave = &omap3xxx_dss_dsi1_hwmod,
1706 .addr = omap3xxx_dss_dsi1_addrs,
1707 .addr_cnt = ARRAY_SIZE(omap3xxx_dss_dsi1_addrs),
1708 .fw = {
1709 .omap2 = {
1710 .l4_fw_region = OMAP3_L4_CORE_FW_DSS_DSI_REGION,
1711 .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP,
1712 .flags = OMAP_FIREWALL_L4,
1713 }
1714 },
1715 .user = OCP_USER_MPU | OCP_USER_SDMA,
1716};
1717
1718/* dss_dsi1 slave ports */
1719static struct omap_hwmod_ocp_if *omap3xxx_dss_dsi1_slaves[] = {
1720 &omap3xxx_l4_core__dss_dsi1,
1721};
1722
1723static struct omap_hwmod omap3xxx_dss_dsi1_hwmod = {
1724 .name = "dss_dsi1",
1725 .class = &omap3xxx_dsi_hwmod_class,
1726 .mpu_irqs = omap3xxx_dsi1_irqs,
1727 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_dsi1_irqs),
1728 .main_clk = "dss1_alwon_fck",
1729 .prcm = {
1730 .omap2 = {
1731 .prcm_reg_id = 1,
1732 .module_bit = OMAP3430_EN_DSS1_SHIFT,
1733 .module_offs = OMAP3430_DSS_MOD,
1734 },
1735 },
1736 .slaves = omap3xxx_dss_dsi1_slaves,
1737 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_dsi1_slaves),
1738 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 |
1739 CHIP_GE_OMAP3430ES2 | CHIP_IS_OMAP3630ES1 |
1740 CHIP_GE_OMAP3630ES1_1),
1741 .flags = HWMOD_NO_IDLEST,
1742};
1743
1744/*
1745 * 'rfbi' class
1746 * remote frame buffer interface
1747 */
1748
1749static struct omap_hwmod_class_sysconfig omap3xxx_rfbi_sysc = {
1750 .rev_offs = 0x0000,
1751 .sysc_offs = 0x0010,
1752 .syss_offs = 0x0014,
1753 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
1754 SYSC_HAS_AUTOIDLE),
1755 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1756 .sysc_fields = &omap_hwmod_sysc_type1,
1757};
1758
1759static struct omap_hwmod_class omap3xxx_rfbi_hwmod_class = {
1760 .name = "rfbi",
1761 .sysc = &omap3xxx_rfbi_sysc,
1762};
1763
1764static struct omap_hwmod_addr_space omap3xxx_dss_rfbi_addrs[] = {
1765 {
1766 .pa_start = 0x48050800,
1767 .pa_end = 0x48050BFF,
1768 .flags = ADDR_TYPE_RT
1769 },
1770};
1771
1772/* l4_core -> dss_rfbi */
1773static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_rfbi = {
1774 .master = &omap3xxx_l4_core_hwmod,
1775 .slave = &omap3xxx_dss_rfbi_hwmod,
1776 .clk = "dss_ick",
1777 .addr = omap3xxx_dss_rfbi_addrs,
1778 .addr_cnt = ARRAY_SIZE(omap3xxx_dss_rfbi_addrs),
1779 .fw = {
1780 .omap2 = {
1781 .l4_fw_region = OMAP3_L4_CORE_FW_DSS_RFBI_REGION,
1782 .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP ,
1783 .flags = OMAP_FIREWALL_L4,
1784 }
1785 },
1786 .user = OCP_USER_MPU | OCP_USER_SDMA,
1787};
1788
1789/* dss_rfbi slave ports */
1790static struct omap_hwmod_ocp_if *omap3xxx_dss_rfbi_slaves[] = {
1791 &omap3xxx_l4_core__dss_rfbi,
1792};
1793
1794static struct omap_hwmod omap3xxx_dss_rfbi_hwmod = {
1795 .name = "dss_rfbi",
1796 .class = &omap3xxx_rfbi_hwmod_class,
1797 .main_clk = "dss1_alwon_fck",
1798 .prcm = {
1799 .omap2 = {
1800 .prcm_reg_id = 1,
1801 .module_bit = OMAP3430_EN_DSS1_SHIFT,
1802 .module_offs = OMAP3430_DSS_MOD,
1803 },
1804 },
1805 .slaves = omap3xxx_dss_rfbi_slaves,
1806 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_rfbi_slaves),
1807 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 |
1808 CHIP_GE_OMAP3430ES2 | CHIP_IS_OMAP3630ES1 |
1809 CHIP_GE_OMAP3630ES1_1),
1810 .flags = HWMOD_NO_IDLEST,
1811};
1812
1813/*
1814 * 'venc' class
1815 * video encoder
1816 */
1817
1818static struct omap_hwmod_class omap3xxx_venc_hwmod_class = {
1819 .name = "venc",
1820};
1821
1822/* dss_venc */
1823static struct omap_hwmod_addr_space omap3xxx_dss_venc_addrs[] = {
1824 {
1825 .pa_start = 0x48050C00,
1826 .pa_end = 0x48050FFF,
1827 .flags = ADDR_TYPE_RT
1828 },
1829};
1830
1831/* l4_core -> dss_venc */
1832static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_venc = {
1833 .master = &omap3xxx_l4_core_hwmod,
1834 .slave = &omap3xxx_dss_venc_hwmod,
1835 .clk = "dss_tv_fck",
1836 .addr = omap3xxx_dss_venc_addrs,
1837 .addr_cnt = ARRAY_SIZE(omap3xxx_dss_venc_addrs),
1838 .fw = {
1839 .omap2 = {
1840 .l4_fw_region = OMAP3_L4_CORE_FW_DSS_VENC_REGION,
1841 .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP,
1842 .flags = OMAP_FIREWALL_L4,
1843 }
1844 },
1845 .flags = OCPIF_SWSUP_IDLE,
1846 .user = OCP_USER_MPU | OCP_USER_SDMA,
1847};
1848
1849/* dss_venc slave ports */
1850static struct omap_hwmod_ocp_if *omap3xxx_dss_venc_slaves[] = {
1851 &omap3xxx_l4_core__dss_venc,
1852};
1853
1854static struct omap_hwmod omap3xxx_dss_venc_hwmod = {
1855 .name = "dss_venc",
1856 .class = &omap3xxx_venc_hwmod_class,
1857 .main_clk = "dss1_alwon_fck",
1858 .prcm = {
1859 .omap2 = {
1860 .prcm_reg_id = 1,
1861 .module_bit = OMAP3430_EN_DSS1_SHIFT,
1862 .module_offs = OMAP3430_DSS_MOD,
1863 },
1864 },
1865 .slaves = omap3xxx_dss_venc_slaves,
1866 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_venc_slaves),
1867 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 |
1868 CHIP_GE_OMAP3430ES2 | CHIP_IS_OMAP3630ES1 |
1869 CHIP_GE_OMAP3630ES1_1),
1870 .flags = HWMOD_NO_IDLEST,
1871};
1872
667/* I2C1 */ 1873/* I2C1 */
668 1874
669static struct omap_i2c_dev_attr i2c1_dev_attr = { 1875static struct omap_i2c_dev_attr i2c1_dev_attr = {
@@ -902,7 +2108,8 @@ static struct omap_hwmod_class_sysconfig omap3xxx_gpio_sysc = {
902 .sysc_offs = 0x0010, 2108 .sysc_offs = 0x0010,
903 .syss_offs = 0x0014, 2109 .syss_offs = 0x0014,
904 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | 2110 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
905 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), 2111 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
2112 SYSS_HAS_RESET_STATUS),
906 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), 2113 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
907 .sysc_fields = &omap_hwmod_sysc_type1, 2114 .sysc_fields = &omap_hwmod_sysc_type1,
908}; 2115};
@@ -1156,7 +2363,8 @@ static struct omap_hwmod_class_sysconfig omap3xxx_dma_sysc = {
1156 .syss_offs = 0x0028, 2363 .syss_offs = 0x0028,
1157 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET | 2364 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
1158 SYSC_HAS_MIDLEMODE | SYSC_HAS_CLOCKACTIVITY | 2365 SYSC_HAS_MIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
1159 SYSC_HAS_EMUFREE | SYSC_HAS_AUTOIDLE), 2366 SYSC_HAS_EMUFREE | SYSC_HAS_AUTOIDLE |
2367 SYSS_HAS_RESET_STATUS),
1160 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 2368 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1161 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), 2369 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
1162 .sysc_fields = &omap_hwmod_sysc_type1, 2370 .sysc_fields = &omap_hwmod_sysc_type1,
@@ -1227,6 +2435,437 @@ static struct omap_hwmod omap3xxx_dma_system_hwmod = {
1227 .flags = HWMOD_NO_IDLEST, 2435 .flags = HWMOD_NO_IDLEST,
1228}; 2436};
1229 2437
2438/*
2439 * 'mcbsp' class
2440 * multi channel buffered serial port controller
2441 */
2442
2443static struct omap_hwmod_class_sysconfig omap3xxx_mcbsp_sysc = {
2444 .sysc_offs = 0x008c,
2445 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_ENAWAKEUP |
2446 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
2447 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
2448 .sysc_fields = &omap_hwmod_sysc_type1,
2449 .clockact = 0x2,
2450};
2451
2452static struct omap_hwmod_class omap3xxx_mcbsp_hwmod_class = {
2453 .name = "mcbsp",
2454 .sysc = &omap3xxx_mcbsp_sysc,
2455 .rev = MCBSP_CONFIG_TYPE3,
2456};
2457
2458/* mcbsp1 */
2459static struct omap_hwmod_irq_info omap3xxx_mcbsp1_irqs[] = {
2460 { .name = "irq", .irq = 16 },
2461 { .name = "tx", .irq = 59 },
2462 { .name = "rx", .irq = 60 },
2463};
2464
2465static struct omap_hwmod_dma_info omap3xxx_mcbsp1_sdma_chs[] = {
2466 { .name = "rx", .dma_req = 32 },
2467 { .name = "tx", .dma_req = 31 },
2468};
2469
2470static struct omap_hwmod_addr_space omap3xxx_mcbsp1_addrs[] = {
2471 {
2472 .name = "mpu",
2473 .pa_start = 0x48074000,
2474 .pa_end = 0x480740ff,
2475 .flags = ADDR_TYPE_RT
2476 },
2477};
2478
2479/* l4_core -> mcbsp1 */
2480static struct omap_hwmod_ocp_if omap3xxx_l4_core__mcbsp1 = {
2481 .master = &omap3xxx_l4_core_hwmod,
2482 .slave = &omap3xxx_mcbsp1_hwmod,
2483 .clk = "mcbsp1_ick",
2484 .addr = omap3xxx_mcbsp1_addrs,
2485 .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp1_addrs),
2486 .user = OCP_USER_MPU | OCP_USER_SDMA,
2487};
2488
2489/* mcbsp1 slave ports */
2490static struct omap_hwmod_ocp_if *omap3xxx_mcbsp1_slaves[] = {
2491 &omap3xxx_l4_core__mcbsp1,
2492};
2493
2494static struct omap_hwmod omap3xxx_mcbsp1_hwmod = {
2495 .name = "mcbsp1",
2496 .class = &omap3xxx_mcbsp_hwmod_class,
2497 .mpu_irqs = omap3xxx_mcbsp1_irqs,
2498 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp1_irqs),
2499 .sdma_reqs = omap3xxx_mcbsp1_sdma_chs,
2500 .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp1_sdma_chs),
2501 .main_clk = "mcbsp1_fck",
2502 .prcm = {
2503 .omap2 = {
2504 .prcm_reg_id = 1,
2505 .module_bit = OMAP3430_EN_MCBSP1_SHIFT,
2506 .module_offs = CORE_MOD,
2507 .idlest_reg_id = 1,
2508 .idlest_idle_bit = OMAP3430_ST_MCBSP1_SHIFT,
2509 },
2510 },
2511 .slaves = omap3xxx_mcbsp1_slaves,
2512 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp1_slaves),
2513 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2514};
2515
2516/* mcbsp2 */
2517static struct omap_hwmod_irq_info omap3xxx_mcbsp2_irqs[] = {
2518 { .name = "irq", .irq = 17 },
2519 { .name = "tx", .irq = 62 },
2520 { .name = "rx", .irq = 63 },
2521};
2522
2523static struct omap_hwmod_dma_info omap3xxx_mcbsp2_sdma_chs[] = {
2524 { .name = "rx", .dma_req = 34 },
2525 { .name = "tx", .dma_req = 33 },
2526};
2527
2528static struct omap_hwmod_addr_space omap3xxx_mcbsp2_addrs[] = {
2529 {
2530 .name = "mpu",
2531 .pa_start = 0x49022000,
2532 .pa_end = 0x490220ff,
2533 .flags = ADDR_TYPE_RT
2534 },
2535};
2536
2537/* l4_per -> mcbsp2 */
2538static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp2 = {
2539 .master = &omap3xxx_l4_per_hwmod,
2540 .slave = &omap3xxx_mcbsp2_hwmod,
2541 .clk = "mcbsp2_ick",
2542 .addr = omap3xxx_mcbsp2_addrs,
2543 .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_addrs),
2544 .user = OCP_USER_MPU | OCP_USER_SDMA,
2545};
2546
2547/* mcbsp2 slave ports */
2548static struct omap_hwmod_ocp_if *omap3xxx_mcbsp2_slaves[] = {
2549 &omap3xxx_l4_per__mcbsp2,
2550};
2551
2552static struct omap_mcbsp_dev_attr omap34xx_mcbsp2_dev_attr = {
2553 .sidetone = "mcbsp2_sidetone",
2554};
2555
2556static struct omap_hwmod omap3xxx_mcbsp2_hwmod = {
2557 .name = "mcbsp2",
2558 .class = &omap3xxx_mcbsp_hwmod_class,
2559 .mpu_irqs = omap3xxx_mcbsp2_irqs,
2560 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_irqs),
2561 .sdma_reqs = omap3xxx_mcbsp2_sdma_chs,
2562 .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_sdma_chs),
2563 .main_clk = "mcbsp2_fck",
2564 .prcm = {
2565 .omap2 = {
2566 .prcm_reg_id = 1,
2567 .module_bit = OMAP3430_EN_MCBSP2_SHIFT,
2568 .module_offs = OMAP3430_PER_MOD,
2569 .idlest_reg_id = 1,
2570 .idlest_idle_bit = OMAP3430_ST_MCBSP2_SHIFT,
2571 },
2572 },
2573 .slaves = omap3xxx_mcbsp2_slaves,
2574 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_slaves),
2575 .dev_attr = &omap34xx_mcbsp2_dev_attr,
2576 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2577};
2578
2579/* mcbsp3 */
2580static struct omap_hwmod_irq_info omap3xxx_mcbsp3_irqs[] = {
2581 { .name = "irq", .irq = 22 },
2582 { .name = "tx", .irq = 89 },
2583 { .name = "rx", .irq = 90 },
2584};
2585
2586static struct omap_hwmod_dma_info omap3xxx_mcbsp3_sdma_chs[] = {
2587 { .name = "rx", .dma_req = 18 },
2588 { .name = "tx", .dma_req = 17 },
2589};
2590
2591static struct omap_hwmod_addr_space omap3xxx_mcbsp3_addrs[] = {
2592 {
2593 .name = "mpu",
2594 .pa_start = 0x49024000,
2595 .pa_end = 0x490240ff,
2596 .flags = ADDR_TYPE_RT
2597 },
2598};
2599
2600/* l4_per -> mcbsp3 */
2601static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp3 = {
2602 .master = &omap3xxx_l4_per_hwmod,
2603 .slave = &omap3xxx_mcbsp3_hwmod,
2604 .clk = "mcbsp3_ick",
2605 .addr = omap3xxx_mcbsp3_addrs,
2606 .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_addrs),
2607 .user = OCP_USER_MPU | OCP_USER_SDMA,
2608};
2609
2610/* mcbsp3 slave ports */
2611static struct omap_hwmod_ocp_if *omap3xxx_mcbsp3_slaves[] = {
2612 &omap3xxx_l4_per__mcbsp3,
2613};
2614
2615static struct omap_mcbsp_dev_attr omap34xx_mcbsp3_dev_attr = {
2616 .sidetone = "mcbsp3_sidetone",
2617};
2618
2619static struct omap_hwmod omap3xxx_mcbsp3_hwmod = {
2620 .name = "mcbsp3",
2621 .class = &omap3xxx_mcbsp_hwmod_class,
2622 .mpu_irqs = omap3xxx_mcbsp3_irqs,
2623 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_irqs),
2624 .sdma_reqs = omap3xxx_mcbsp3_sdma_chs,
2625 .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_sdma_chs),
2626 .main_clk = "mcbsp3_fck",
2627 .prcm = {
2628 .omap2 = {
2629 .prcm_reg_id = 1,
2630 .module_bit = OMAP3430_EN_MCBSP3_SHIFT,
2631 .module_offs = OMAP3430_PER_MOD,
2632 .idlest_reg_id = 1,
2633 .idlest_idle_bit = OMAP3430_ST_MCBSP3_SHIFT,
2634 },
2635 },
2636 .slaves = omap3xxx_mcbsp3_slaves,
2637 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_slaves),
2638 .dev_attr = &omap34xx_mcbsp3_dev_attr,
2639 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2640};
2641
2642/* mcbsp4 */
2643static struct omap_hwmod_irq_info omap3xxx_mcbsp4_irqs[] = {
2644 { .name = "irq", .irq = 23 },
2645 { .name = "tx", .irq = 54 },
2646 { .name = "rx", .irq = 55 },
2647};
2648
2649static struct omap_hwmod_dma_info omap3xxx_mcbsp4_sdma_chs[] = {
2650 { .name = "rx", .dma_req = 20 },
2651 { .name = "tx", .dma_req = 19 },
2652};
2653
2654static struct omap_hwmod_addr_space omap3xxx_mcbsp4_addrs[] = {
2655 {
2656 .name = "mpu",
2657 .pa_start = 0x49026000,
2658 .pa_end = 0x490260ff,
2659 .flags = ADDR_TYPE_RT
2660 },
2661};
2662
2663/* l4_per -> mcbsp4 */
2664static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp4 = {
2665 .master = &omap3xxx_l4_per_hwmod,
2666 .slave = &omap3xxx_mcbsp4_hwmod,
2667 .clk = "mcbsp4_ick",
2668 .addr = omap3xxx_mcbsp4_addrs,
2669 .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp4_addrs),
2670 .user = OCP_USER_MPU | OCP_USER_SDMA,
2671};
2672
2673/* mcbsp4 slave ports */
2674static struct omap_hwmod_ocp_if *omap3xxx_mcbsp4_slaves[] = {
2675 &omap3xxx_l4_per__mcbsp4,
2676};
2677
2678static struct omap_hwmod omap3xxx_mcbsp4_hwmod = {
2679 .name = "mcbsp4",
2680 .class = &omap3xxx_mcbsp_hwmod_class,
2681 .mpu_irqs = omap3xxx_mcbsp4_irqs,
2682 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp4_irqs),
2683 .sdma_reqs = omap3xxx_mcbsp4_sdma_chs,
2684 .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp4_sdma_chs),
2685 .main_clk = "mcbsp4_fck",
2686 .prcm = {
2687 .omap2 = {
2688 .prcm_reg_id = 1,
2689 .module_bit = OMAP3430_EN_MCBSP4_SHIFT,
2690 .module_offs = OMAP3430_PER_MOD,
2691 .idlest_reg_id = 1,
2692 .idlest_idle_bit = OMAP3430_ST_MCBSP4_SHIFT,
2693 },
2694 },
2695 .slaves = omap3xxx_mcbsp4_slaves,
2696 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp4_slaves),
2697 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2698};
2699
2700/* mcbsp5 */
2701static struct omap_hwmod_irq_info omap3xxx_mcbsp5_irqs[] = {
2702 { .name = "irq", .irq = 27 },
2703 { .name = "tx", .irq = 81 },
2704 { .name = "rx", .irq = 82 },
2705};
2706
2707static struct omap_hwmod_dma_info omap3xxx_mcbsp5_sdma_chs[] = {
2708 { .name = "rx", .dma_req = 22 },
2709 { .name = "tx", .dma_req = 21 },
2710};
2711
2712static struct omap_hwmod_addr_space omap3xxx_mcbsp5_addrs[] = {
2713 {
2714 .name = "mpu",
2715 .pa_start = 0x48096000,
2716 .pa_end = 0x480960ff,
2717 .flags = ADDR_TYPE_RT
2718 },
2719};
2720
2721/* l4_core -> mcbsp5 */
2722static struct omap_hwmod_ocp_if omap3xxx_l4_core__mcbsp5 = {
2723 .master = &omap3xxx_l4_core_hwmod,
2724 .slave = &omap3xxx_mcbsp5_hwmod,
2725 .clk = "mcbsp5_ick",
2726 .addr = omap3xxx_mcbsp5_addrs,
2727 .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp5_addrs),
2728 .user = OCP_USER_MPU | OCP_USER_SDMA,
2729};
2730
2731/* mcbsp5 slave ports */
2732static struct omap_hwmod_ocp_if *omap3xxx_mcbsp5_slaves[] = {
2733 &omap3xxx_l4_core__mcbsp5,
2734};
2735
2736static struct omap_hwmod omap3xxx_mcbsp5_hwmod = {
2737 .name = "mcbsp5",
2738 .class = &omap3xxx_mcbsp_hwmod_class,
2739 .mpu_irqs = omap3xxx_mcbsp5_irqs,
2740 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp5_irqs),
2741 .sdma_reqs = omap3xxx_mcbsp5_sdma_chs,
2742 .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp5_sdma_chs),
2743 .main_clk = "mcbsp5_fck",
2744 .prcm = {
2745 .omap2 = {
2746 .prcm_reg_id = 1,
2747 .module_bit = OMAP3430_EN_MCBSP5_SHIFT,
2748 .module_offs = CORE_MOD,
2749 .idlest_reg_id = 1,
2750 .idlest_idle_bit = OMAP3430_ST_MCBSP5_SHIFT,
2751 },
2752 },
2753 .slaves = omap3xxx_mcbsp5_slaves,
2754 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp5_slaves),
2755 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2756};
2757/* 'mcbsp sidetone' class */
2758
2759static struct omap_hwmod_class_sysconfig omap3xxx_mcbsp_sidetone_sysc = {
2760 .sysc_offs = 0x0010,
2761 .sysc_flags = SYSC_HAS_AUTOIDLE,
2762 .sysc_fields = &omap_hwmod_sysc_type1,
2763};
2764
2765static struct omap_hwmod_class omap3xxx_mcbsp_sidetone_hwmod_class = {
2766 .name = "mcbsp_sidetone",
2767 .sysc = &omap3xxx_mcbsp_sidetone_sysc,
2768};
2769
2770/* mcbsp2_sidetone */
2771static struct omap_hwmod_irq_info omap3xxx_mcbsp2_sidetone_irqs[] = {
2772 { .name = "irq", .irq = 4 },
2773};
2774
2775static struct omap_hwmod_addr_space omap3xxx_mcbsp2_sidetone_addrs[] = {
2776 {
2777 .name = "sidetone",
2778 .pa_start = 0x49028000,
2779 .pa_end = 0x490280ff,
2780 .flags = ADDR_TYPE_RT
2781 },
2782};
2783
2784/* l4_per -> mcbsp2_sidetone */
2785static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp2_sidetone = {
2786 .master = &omap3xxx_l4_per_hwmod,
2787 .slave = &omap3xxx_mcbsp2_sidetone_hwmod,
2788 .clk = "mcbsp2_ick",
2789 .addr = omap3xxx_mcbsp2_sidetone_addrs,
2790 .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_sidetone_addrs),
2791 .user = OCP_USER_MPU,
2792};
2793
2794/* mcbsp2_sidetone slave ports */
2795static struct omap_hwmod_ocp_if *omap3xxx_mcbsp2_sidetone_slaves[] = {
2796 &omap3xxx_l4_per__mcbsp2_sidetone,
2797};
2798
2799static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod = {
2800 .name = "mcbsp2_sidetone",
2801 .class = &omap3xxx_mcbsp_sidetone_hwmod_class,
2802 .mpu_irqs = omap3xxx_mcbsp2_sidetone_irqs,
2803 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_sidetone_irqs),
2804 .main_clk = "mcbsp2_fck",
2805 .prcm = {
2806 .omap2 = {
2807 .prcm_reg_id = 1,
2808 .module_bit = OMAP3430_EN_MCBSP2_SHIFT,
2809 .module_offs = OMAP3430_PER_MOD,
2810 .idlest_reg_id = 1,
2811 .idlest_idle_bit = OMAP3430_ST_MCBSP2_SHIFT,
2812 },
2813 },
2814 .slaves = omap3xxx_mcbsp2_sidetone_slaves,
2815 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_sidetone_slaves),
2816 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2817};
2818
2819/* mcbsp3_sidetone */
2820static struct omap_hwmod_irq_info omap3xxx_mcbsp3_sidetone_irqs[] = {
2821 { .name = "irq", .irq = 5 },
2822};
2823
2824static struct omap_hwmod_addr_space omap3xxx_mcbsp3_sidetone_addrs[] = {
2825 {
2826 .name = "sidetone",
2827 .pa_start = 0x4902A000,
2828 .pa_end = 0x4902A0ff,
2829 .flags = ADDR_TYPE_RT
2830 },
2831};
2832
2833/* l4_per -> mcbsp3_sidetone */
2834static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp3_sidetone = {
2835 .master = &omap3xxx_l4_per_hwmod,
2836 .slave = &omap3xxx_mcbsp3_sidetone_hwmod,
2837 .clk = "mcbsp3_ick",
2838 .addr = omap3xxx_mcbsp3_sidetone_addrs,
2839 .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_sidetone_addrs),
2840 .user = OCP_USER_MPU,
2841};
2842
2843/* mcbsp3_sidetone slave ports */
2844static struct omap_hwmod_ocp_if *omap3xxx_mcbsp3_sidetone_slaves[] = {
2845 &omap3xxx_l4_per__mcbsp3_sidetone,
2846};
2847
2848static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod = {
2849 .name = "mcbsp3_sidetone",
2850 .class = &omap3xxx_mcbsp_sidetone_hwmod_class,
2851 .mpu_irqs = omap3xxx_mcbsp3_sidetone_irqs,
2852 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_sidetone_irqs),
2853 .main_clk = "mcbsp3_fck",
2854 .prcm = {
2855 .omap2 = {
2856 .prcm_reg_id = 1,
2857 .module_bit = OMAP3430_EN_MCBSP3_SHIFT,
2858 .module_offs = OMAP3430_PER_MOD,
2859 .idlest_reg_id = 1,
2860 .idlest_idle_bit = OMAP3430_ST_MCBSP3_SHIFT,
2861 },
2862 },
2863 .slaves = omap3xxx_mcbsp3_sidetone_slaves,
2864 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_sidetone_slaves),
2865 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2866};
2867
2868
1230/* SR common */ 2869/* SR common */
1231static struct omap_hwmod_sysc_fields omap34xx_sr_sysc_fields = { 2870static struct omap_hwmod_sysc_fields omap34xx_sr_sysc_fields = {
1232 .clkact_shift = 20, 2871 .clkact_shift = 20,
@@ -1356,18 +2995,617 @@ static struct omap_hwmod omap36xx_sr2_hwmod = {
1356 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1), 2995 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
1357}; 2996};
1358 2997
2998/*
2999 * 'mailbox' class
3000 * mailbox module allowing communication between the on-chip processors
3001 * using a queued mailbox-interrupt mechanism.
3002 */
3003
3004static struct omap_hwmod_class_sysconfig omap3xxx_mailbox_sysc = {
3005 .rev_offs = 0x000,
3006 .sysc_offs = 0x010,
3007 .syss_offs = 0x014,
3008 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
3009 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
3010 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
3011 .sysc_fields = &omap_hwmod_sysc_type1,
3012};
3013
3014static struct omap_hwmod_class omap3xxx_mailbox_hwmod_class = {
3015 .name = "mailbox",
3016 .sysc = &omap3xxx_mailbox_sysc,
3017};
3018
3019static struct omap_hwmod omap3xxx_mailbox_hwmod;
3020static struct omap_hwmod_irq_info omap3xxx_mailbox_irqs[] = {
3021 { .irq = 26 },
3022};
3023
3024static struct omap_hwmod_addr_space omap3xxx_mailbox_addrs[] = {
3025 {
3026 .pa_start = 0x48094000,
3027 .pa_end = 0x480941ff,
3028 .flags = ADDR_TYPE_RT,
3029 },
3030};
3031
3032/* l4_core -> mailbox */
3033static struct omap_hwmod_ocp_if omap3xxx_l4_core__mailbox = {
3034 .master = &omap3xxx_l4_core_hwmod,
3035 .slave = &omap3xxx_mailbox_hwmod,
3036 .addr = omap3xxx_mailbox_addrs,
3037 .addr_cnt = ARRAY_SIZE(omap3xxx_mailbox_addrs),
3038 .user = OCP_USER_MPU | OCP_USER_SDMA,
3039};
3040
3041/* mailbox slave ports */
3042static struct omap_hwmod_ocp_if *omap3xxx_mailbox_slaves[] = {
3043 &omap3xxx_l4_core__mailbox,
3044};
3045
3046static struct omap_hwmod omap3xxx_mailbox_hwmod = {
3047 .name = "mailbox",
3048 .class = &omap3xxx_mailbox_hwmod_class,
3049 .mpu_irqs = omap3xxx_mailbox_irqs,
3050 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mailbox_irqs),
3051 .main_clk = "mailboxes_ick",
3052 .prcm = {
3053 .omap2 = {
3054 .prcm_reg_id = 1,
3055 .module_bit = OMAP3430_EN_MAILBOXES_SHIFT,
3056 .module_offs = CORE_MOD,
3057 .idlest_reg_id = 1,
3058 .idlest_idle_bit = OMAP3430_ST_MAILBOXES_SHIFT,
3059 },
3060 },
3061 .slaves = omap3xxx_mailbox_slaves,
3062 .slaves_cnt = ARRAY_SIZE(omap3xxx_mailbox_slaves),
3063 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
3064};
3065
3066/* l4 core -> mcspi1 interface */
3067static struct omap_hwmod_addr_space omap34xx_mcspi1_addr_space[] = {
3068 {
3069 .pa_start = 0x48098000,
3070 .pa_end = 0x480980ff,
3071 .flags = ADDR_TYPE_RT,
3072 },
3073};
3074
3075static struct omap_hwmod_ocp_if omap34xx_l4_core__mcspi1 = {
3076 .master = &omap3xxx_l4_core_hwmod,
3077 .slave = &omap34xx_mcspi1,
3078 .clk = "mcspi1_ick",
3079 .addr = omap34xx_mcspi1_addr_space,
3080 .addr_cnt = ARRAY_SIZE(omap34xx_mcspi1_addr_space),
3081 .user = OCP_USER_MPU | OCP_USER_SDMA,
3082};
3083
3084/* l4 core -> mcspi2 interface */
3085static struct omap_hwmod_addr_space omap34xx_mcspi2_addr_space[] = {
3086 {
3087 .pa_start = 0x4809a000,
3088 .pa_end = 0x4809a0ff,
3089 .flags = ADDR_TYPE_RT,
3090 },
3091};
3092
3093static struct omap_hwmod_ocp_if omap34xx_l4_core__mcspi2 = {
3094 .master = &omap3xxx_l4_core_hwmod,
3095 .slave = &omap34xx_mcspi2,
3096 .clk = "mcspi2_ick",
3097 .addr = omap34xx_mcspi2_addr_space,
3098 .addr_cnt = ARRAY_SIZE(omap34xx_mcspi2_addr_space),
3099 .user = OCP_USER_MPU | OCP_USER_SDMA,
3100};
3101
3102/* l4 core -> mcspi3 interface */
3103static struct omap_hwmod_addr_space omap34xx_mcspi3_addr_space[] = {
3104 {
3105 .pa_start = 0x480b8000,
3106 .pa_end = 0x480b80ff,
3107 .flags = ADDR_TYPE_RT,
3108 },
3109};
3110
3111static struct omap_hwmod_ocp_if omap34xx_l4_core__mcspi3 = {
3112 .master = &omap3xxx_l4_core_hwmod,
3113 .slave = &omap34xx_mcspi3,
3114 .clk = "mcspi3_ick",
3115 .addr = omap34xx_mcspi3_addr_space,
3116 .addr_cnt = ARRAY_SIZE(omap34xx_mcspi3_addr_space),
3117 .user = OCP_USER_MPU | OCP_USER_SDMA,
3118};
3119
3120/* l4 core -> mcspi4 interface */
3121static struct omap_hwmod_addr_space omap34xx_mcspi4_addr_space[] = {
3122 {
3123 .pa_start = 0x480ba000,
3124 .pa_end = 0x480ba0ff,
3125 .flags = ADDR_TYPE_RT,
3126 },
3127};
3128
3129static struct omap_hwmod_ocp_if omap34xx_l4_core__mcspi4 = {
3130 .master = &omap3xxx_l4_core_hwmod,
3131 .slave = &omap34xx_mcspi4,
3132 .clk = "mcspi4_ick",
3133 .addr = omap34xx_mcspi4_addr_space,
3134 .addr_cnt = ARRAY_SIZE(omap34xx_mcspi4_addr_space),
3135 .user = OCP_USER_MPU | OCP_USER_SDMA,
3136};
3137
3138/*
3139 * 'mcspi' class
3140 * multichannel serial port interface (mcspi) / master/slave synchronous serial
3141 * bus
3142 */
3143
3144static struct omap_hwmod_class_sysconfig omap34xx_mcspi_sysc = {
3145 .rev_offs = 0x0000,
3146 .sysc_offs = 0x0010,
3147 .syss_offs = 0x0014,
3148 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
3149 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
3150 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
3151 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
3152 .sysc_fields = &omap_hwmod_sysc_type1,
3153};
3154
3155static struct omap_hwmod_class omap34xx_mcspi_class = {
3156 .name = "mcspi",
3157 .sysc = &omap34xx_mcspi_sysc,
3158 .rev = OMAP3_MCSPI_REV,
3159};
3160
3161/* mcspi1 */
3162static struct omap_hwmod_irq_info omap34xx_mcspi1_mpu_irqs[] = {
3163 { .name = "irq", .irq = 65 },
3164};
3165
3166static struct omap_hwmod_dma_info omap34xx_mcspi1_sdma_reqs[] = {
3167 { .name = "tx0", .dma_req = 35 },
3168 { .name = "rx0", .dma_req = 36 },
3169 { .name = "tx1", .dma_req = 37 },
3170 { .name = "rx1", .dma_req = 38 },
3171 { .name = "tx2", .dma_req = 39 },
3172 { .name = "rx2", .dma_req = 40 },
3173 { .name = "tx3", .dma_req = 41 },
3174 { .name = "rx3", .dma_req = 42 },
3175};
3176
3177static struct omap_hwmod_ocp_if *omap34xx_mcspi1_slaves[] = {
3178 &omap34xx_l4_core__mcspi1,
3179};
3180
3181static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = {
3182 .num_chipselect = 4,
3183};
3184
3185static struct omap_hwmod omap34xx_mcspi1 = {
3186 .name = "mcspi1",
3187 .mpu_irqs = omap34xx_mcspi1_mpu_irqs,
3188 .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mcspi1_mpu_irqs),
3189 .sdma_reqs = omap34xx_mcspi1_sdma_reqs,
3190 .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mcspi1_sdma_reqs),
3191 .main_clk = "mcspi1_fck",
3192 .prcm = {
3193 .omap2 = {
3194 .module_offs = CORE_MOD,
3195 .prcm_reg_id = 1,
3196 .module_bit = OMAP3430_EN_MCSPI1_SHIFT,
3197 .idlest_reg_id = 1,
3198 .idlest_idle_bit = OMAP3430_ST_MCSPI1_SHIFT,
3199 },
3200 },
3201 .slaves = omap34xx_mcspi1_slaves,
3202 .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi1_slaves),
3203 .class = &omap34xx_mcspi_class,
3204 .dev_attr = &omap_mcspi1_dev_attr,
3205 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
3206};
3207
3208/* mcspi2 */
3209static struct omap_hwmod_irq_info omap34xx_mcspi2_mpu_irqs[] = {
3210 { .name = "irq", .irq = 66 },
3211};
3212
3213static struct omap_hwmod_dma_info omap34xx_mcspi2_sdma_reqs[] = {
3214 { .name = "tx0", .dma_req = 43 },
3215 { .name = "rx0", .dma_req = 44 },
3216 { .name = "tx1", .dma_req = 45 },
3217 { .name = "rx1", .dma_req = 46 },
3218};
3219
3220static struct omap_hwmod_ocp_if *omap34xx_mcspi2_slaves[] = {
3221 &omap34xx_l4_core__mcspi2,
3222};
3223
3224static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = {
3225 .num_chipselect = 2,
3226};
3227
3228static struct omap_hwmod omap34xx_mcspi2 = {
3229 .name = "mcspi2",
3230 .mpu_irqs = omap34xx_mcspi2_mpu_irqs,
3231 .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mcspi2_mpu_irqs),
3232 .sdma_reqs = omap34xx_mcspi2_sdma_reqs,
3233 .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mcspi2_sdma_reqs),
3234 .main_clk = "mcspi2_fck",
3235 .prcm = {
3236 .omap2 = {
3237 .module_offs = CORE_MOD,
3238 .prcm_reg_id = 1,
3239 .module_bit = OMAP3430_EN_MCSPI2_SHIFT,
3240 .idlest_reg_id = 1,
3241 .idlest_idle_bit = OMAP3430_ST_MCSPI2_SHIFT,
3242 },
3243 },
3244 .slaves = omap34xx_mcspi2_slaves,
3245 .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi2_slaves),
3246 .class = &omap34xx_mcspi_class,
3247 .dev_attr = &omap_mcspi2_dev_attr,
3248 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
3249};
3250
3251/* mcspi3 */
3252static struct omap_hwmod_irq_info omap34xx_mcspi3_mpu_irqs[] = {
3253 { .name = "irq", .irq = 91 }, /* 91 */
3254};
3255
3256static struct omap_hwmod_dma_info omap34xx_mcspi3_sdma_reqs[] = {
3257 { .name = "tx0", .dma_req = 15 },
3258 { .name = "rx0", .dma_req = 16 },
3259 { .name = "tx1", .dma_req = 23 },
3260 { .name = "rx1", .dma_req = 24 },
3261};
3262
3263static struct omap_hwmod_ocp_if *omap34xx_mcspi3_slaves[] = {
3264 &omap34xx_l4_core__mcspi3,
3265};
3266
3267static struct omap2_mcspi_dev_attr omap_mcspi3_dev_attr = {
3268 .num_chipselect = 2,
3269};
3270
3271static struct omap_hwmod omap34xx_mcspi3 = {
3272 .name = "mcspi3",
3273 .mpu_irqs = omap34xx_mcspi3_mpu_irqs,
3274 .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mcspi3_mpu_irqs),
3275 .sdma_reqs = omap34xx_mcspi3_sdma_reqs,
3276 .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mcspi3_sdma_reqs),
3277 .main_clk = "mcspi3_fck",
3278 .prcm = {
3279 .omap2 = {
3280 .module_offs = CORE_MOD,
3281 .prcm_reg_id = 1,
3282 .module_bit = OMAP3430_EN_MCSPI3_SHIFT,
3283 .idlest_reg_id = 1,
3284 .idlest_idle_bit = OMAP3430_ST_MCSPI3_SHIFT,
3285 },
3286 },
3287 .slaves = omap34xx_mcspi3_slaves,
3288 .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi3_slaves),
3289 .class = &omap34xx_mcspi_class,
3290 .dev_attr = &omap_mcspi3_dev_attr,
3291 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
3292};
3293
3294/* SPI4 */
3295static struct omap_hwmod_irq_info omap34xx_mcspi4_mpu_irqs[] = {
3296 { .name = "irq", .irq = INT_34XX_SPI4_IRQ }, /* 48 */
3297};
3298
3299static struct omap_hwmod_dma_info omap34xx_mcspi4_sdma_reqs[] = {
3300 { .name = "tx0", .dma_req = 70 }, /* DMA_SPI4_TX0 */
3301 { .name = "rx0", .dma_req = 71 }, /* DMA_SPI4_RX0 */
3302};
3303
3304static struct omap_hwmod_ocp_if *omap34xx_mcspi4_slaves[] = {
3305 &omap34xx_l4_core__mcspi4,
3306};
3307
3308static struct omap2_mcspi_dev_attr omap_mcspi4_dev_attr = {
3309 .num_chipselect = 1,
3310};
3311
3312static struct omap_hwmod omap34xx_mcspi4 = {
3313 .name = "mcspi4",
3314 .mpu_irqs = omap34xx_mcspi4_mpu_irqs,
3315 .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mcspi4_mpu_irqs),
3316 .sdma_reqs = omap34xx_mcspi4_sdma_reqs,
3317 .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mcspi4_sdma_reqs),
3318 .main_clk = "mcspi4_fck",
3319 .prcm = {
3320 .omap2 = {
3321 .module_offs = CORE_MOD,
3322 .prcm_reg_id = 1,
3323 .module_bit = OMAP3430_EN_MCSPI4_SHIFT,
3324 .idlest_reg_id = 1,
3325 .idlest_idle_bit = OMAP3430_ST_MCSPI4_SHIFT,
3326 },
3327 },
3328 .slaves = omap34xx_mcspi4_slaves,
3329 .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi4_slaves),
3330 .class = &omap34xx_mcspi_class,
3331 .dev_attr = &omap_mcspi4_dev_attr,
3332 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
3333};
3334
3335/*
3336 * usbhsotg
3337 */
3338static struct omap_hwmod_class_sysconfig omap3xxx_usbhsotg_sysc = {
3339 .rev_offs = 0x0400,
3340 .sysc_offs = 0x0404,
3341 .syss_offs = 0x0408,
3342 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE|
3343 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
3344 SYSC_HAS_AUTOIDLE),
3345 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
3346 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
3347 .sysc_fields = &omap_hwmod_sysc_type1,
3348};
3349
3350static struct omap_hwmod_class usbotg_class = {
3351 .name = "usbotg",
3352 .sysc = &omap3xxx_usbhsotg_sysc,
3353};
3354/* usb_otg_hs */
3355static struct omap_hwmod_irq_info omap3xxx_usbhsotg_mpu_irqs[] = {
3356
3357 { .name = "mc", .irq = 92 },
3358 { .name = "dma", .irq = 93 },
3359};
3360
3361static struct omap_hwmod omap3xxx_usbhsotg_hwmod = {
3362 .name = "usb_otg_hs",
3363 .mpu_irqs = omap3xxx_usbhsotg_mpu_irqs,
3364 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_usbhsotg_mpu_irqs),
3365 .main_clk = "hsotgusb_ick",
3366 .prcm = {
3367 .omap2 = {
3368 .prcm_reg_id = 1,
3369 .module_bit = OMAP3430_EN_HSOTGUSB_SHIFT,
3370 .module_offs = CORE_MOD,
3371 .idlest_reg_id = 1,
3372 .idlest_idle_bit = OMAP3430ES2_ST_HSOTGUSB_IDLE_SHIFT,
3373 .idlest_stdby_bit = OMAP3430ES2_ST_HSOTGUSB_STDBY_SHIFT
3374 },
3375 },
3376 .masters = omap3xxx_usbhsotg_masters,
3377 .masters_cnt = ARRAY_SIZE(omap3xxx_usbhsotg_masters),
3378 .slaves = omap3xxx_usbhsotg_slaves,
3379 .slaves_cnt = ARRAY_SIZE(omap3xxx_usbhsotg_slaves),
3380 .class = &usbotg_class,
3381
3382 /*
3383 * Erratum ID: i479 idle_req / idle_ack mechanism potentially
3384 * broken when autoidle is enabled
3385 * workaround is to disable the autoidle bit at module level.
3386 */
3387 .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE
3388 | HWMOD_SWSUP_MSTANDBY,
3389 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
3390};
3391
3392/* usb_otg_hs */
3393static struct omap_hwmod_irq_info am35xx_usbhsotg_mpu_irqs[] = {
3394
3395 { .name = "mc", .irq = 71 },
3396};
3397
3398static struct omap_hwmod_class am35xx_usbotg_class = {
3399 .name = "am35xx_usbotg",
3400 .sysc = NULL,
3401};
3402
3403static struct omap_hwmod am35xx_usbhsotg_hwmod = {
3404 .name = "am35x_otg_hs",
3405 .mpu_irqs = am35xx_usbhsotg_mpu_irqs,
3406 .mpu_irqs_cnt = ARRAY_SIZE(am35xx_usbhsotg_mpu_irqs),
3407 .main_clk = NULL,
3408 .prcm = {
3409 .omap2 = {
3410 },
3411 },
3412 .masters = am35xx_usbhsotg_masters,
3413 .masters_cnt = ARRAY_SIZE(am35xx_usbhsotg_masters),
3414 .slaves = am35xx_usbhsotg_slaves,
3415 .slaves_cnt = ARRAY_SIZE(am35xx_usbhsotg_slaves),
3416 .class = &am35xx_usbotg_class,
3417 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES3_1)
3418};
3419
3420/* MMC/SD/SDIO common */
3421
3422static struct omap_hwmod_class_sysconfig omap34xx_mmc_sysc = {
3423 .rev_offs = 0x1fc,
3424 .sysc_offs = 0x10,
3425 .syss_offs = 0x14,
3426 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
3427 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
3428 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
3429 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
3430 .sysc_fields = &omap_hwmod_sysc_type1,
3431};
3432
3433static struct omap_hwmod_class omap34xx_mmc_class = {
3434 .name = "mmc",
3435 .sysc = &omap34xx_mmc_sysc,
3436};
3437
3438/* MMC/SD/SDIO1 */
3439
3440static struct omap_hwmod_irq_info omap34xx_mmc1_mpu_irqs[] = {
3441 { .irq = 83, },
3442};
3443
3444static struct omap_hwmod_dma_info omap34xx_mmc1_sdma_reqs[] = {
3445 { .name = "tx", .dma_req = 61, },
3446 { .name = "rx", .dma_req = 62, },
3447};
3448
3449static struct omap_hwmod_opt_clk omap34xx_mmc1_opt_clks[] = {
3450 { .role = "dbck", .clk = "omap_32k_fck", },
3451};
3452
3453static struct omap_hwmod_ocp_if *omap3xxx_mmc1_slaves[] = {
3454 &omap3xxx_l4_core__mmc1,
3455};
3456
3457static struct omap_mmc_dev_attr mmc1_dev_attr = {
3458 .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
3459};
3460
3461static struct omap_hwmod omap3xxx_mmc1_hwmod = {
3462 .name = "mmc1",
3463 .mpu_irqs = omap34xx_mmc1_mpu_irqs,
3464 .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mmc1_mpu_irqs),
3465 .sdma_reqs = omap34xx_mmc1_sdma_reqs,
3466 .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mmc1_sdma_reqs),
3467 .opt_clks = omap34xx_mmc1_opt_clks,
3468 .opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc1_opt_clks),
3469 .main_clk = "mmchs1_fck",
3470 .prcm = {
3471 .omap2 = {
3472 .module_offs = CORE_MOD,
3473 .prcm_reg_id = 1,
3474 .module_bit = OMAP3430_EN_MMC1_SHIFT,
3475 .idlest_reg_id = 1,
3476 .idlest_idle_bit = OMAP3430_ST_MMC1_SHIFT,
3477 },
3478 },
3479 .dev_attr = &mmc1_dev_attr,
3480 .slaves = omap3xxx_mmc1_slaves,
3481 .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc1_slaves),
3482 .class = &omap34xx_mmc_class,
3483 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
3484};
3485
3486/* MMC/SD/SDIO2 */
3487
3488static struct omap_hwmod_irq_info omap34xx_mmc2_mpu_irqs[] = {
3489 { .irq = INT_24XX_MMC2_IRQ, },
3490};
3491
3492static struct omap_hwmod_dma_info omap34xx_mmc2_sdma_reqs[] = {
3493 { .name = "tx", .dma_req = 47, },
3494 { .name = "rx", .dma_req = 48, },
3495};
3496
3497static struct omap_hwmod_opt_clk omap34xx_mmc2_opt_clks[] = {
3498 { .role = "dbck", .clk = "omap_32k_fck", },
3499};
3500
3501static struct omap_hwmod_ocp_if *omap3xxx_mmc2_slaves[] = {
3502 &omap3xxx_l4_core__mmc2,
3503};
3504
3505static struct omap_hwmod omap3xxx_mmc2_hwmod = {
3506 .name = "mmc2",
3507 .mpu_irqs = omap34xx_mmc2_mpu_irqs,
3508 .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mmc2_mpu_irqs),
3509 .sdma_reqs = omap34xx_mmc2_sdma_reqs,
3510 .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mmc2_sdma_reqs),
3511 .opt_clks = omap34xx_mmc2_opt_clks,
3512 .opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc2_opt_clks),
3513 .main_clk = "mmchs2_fck",
3514 .prcm = {
3515 .omap2 = {
3516 .module_offs = CORE_MOD,
3517 .prcm_reg_id = 1,
3518 .module_bit = OMAP3430_EN_MMC2_SHIFT,
3519 .idlest_reg_id = 1,
3520 .idlest_idle_bit = OMAP3430_ST_MMC2_SHIFT,
3521 },
3522 },
3523 .slaves = omap3xxx_mmc2_slaves,
3524 .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc2_slaves),
3525 .class = &omap34xx_mmc_class,
3526 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
3527};
3528
3529/* MMC/SD/SDIO3 */
3530
3531static struct omap_hwmod_irq_info omap34xx_mmc3_mpu_irqs[] = {
3532 { .irq = 94, },
3533};
3534
3535static struct omap_hwmod_dma_info omap34xx_mmc3_sdma_reqs[] = {
3536 { .name = "tx", .dma_req = 77, },
3537 { .name = "rx", .dma_req = 78, },
3538};
3539
3540static struct omap_hwmod_opt_clk omap34xx_mmc3_opt_clks[] = {
3541 { .role = "dbck", .clk = "omap_32k_fck", },
3542};
3543
3544static struct omap_hwmod_ocp_if *omap3xxx_mmc3_slaves[] = {
3545 &omap3xxx_l4_core__mmc3,
3546};
3547
3548static struct omap_hwmod omap3xxx_mmc3_hwmod = {
3549 .name = "mmc3",
3550 .mpu_irqs = omap34xx_mmc3_mpu_irqs,
3551 .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mmc3_mpu_irqs),
3552 .sdma_reqs = omap34xx_mmc3_sdma_reqs,
3553 .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mmc3_sdma_reqs),
3554 .opt_clks = omap34xx_mmc3_opt_clks,
3555 .opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc3_opt_clks),
3556 .main_clk = "mmchs3_fck",
3557 .prcm = {
3558 .omap2 = {
3559 .prcm_reg_id = 1,
3560 .module_bit = OMAP3430_EN_MMC3_SHIFT,
3561 .idlest_reg_id = 1,
3562 .idlest_idle_bit = OMAP3430_ST_MMC3_SHIFT,
3563 },
3564 },
3565 .slaves = omap3xxx_mmc3_slaves,
3566 .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc3_slaves),
3567 .class = &omap34xx_mmc_class,
3568 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
3569};
3570
1359static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { 3571static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
1360 &omap3xxx_l3_main_hwmod, 3572 &omap3xxx_l3_main_hwmod,
1361 &omap3xxx_l4_core_hwmod, 3573 &omap3xxx_l4_core_hwmod,
1362 &omap3xxx_l4_per_hwmod, 3574 &omap3xxx_l4_per_hwmod,
1363 &omap3xxx_l4_wkup_hwmod, 3575 &omap3xxx_l4_wkup_hwmod,
3576 &omap3xxx_mmc1_hwmod,
3577 &omap3xxx_mmc2_hwmod,
3578 &omap3xxx_mmc3_hwmod,
1364 &omap3xxx_mpu_hwmod, 3579 &omap3xxx_mpu_hwmod,
1365 &omap3xxx_iva_hwmod, 3580 &omap3xxx_iva_hwmod,
3581
3582 &omap3xxx_timer1_hwmod,
3583 &omap3xxx_timer2_hwmod,
3584 &omap3xxx_timer3_hwmod,
3585 &omap3xxx_timer4_hwmod,
3586 &omap3xxx_timer5_hwmod,
3587 &omap3xxx_timer6_hwmod,
3588 &omap3xxx_timer7_hwmod,
3589 &omap3xxx_timer8_hwmod,
3590 &omap3xxx_timer9_hwmod,
3591 &omap3xxx_timer10_hwmod,
3592 &omap3xxx_timer11_hwmod,
3593 &omap3xxx_timer12_hwmod,
3594
1366 &omap3xxx_wd_timer2_hwmod, 3595 &omap3xxx_wd_timer2_hwmod,
1367 &omap3xxx_uart1_hwmod, 3596 &omap3xxx_uart1_hwmod,
1368 &omap3xxx_uart2_hwmod, 3597 &omap3xxx_uart2_hwmod,
1369 &omap3xxx_uart3_hwmod, 3598 &omap3xxx_uart3_hwmod,
1370 &omap3xxx_uart4_hwmod, 3599 &omap3xxx_uart4_hwmod,
3600 /* dss class */
3601 &omap3430es1_dss_core_hwmod,
3602 &omap3xxx_dss_core_hwmod,
3603 &omap3xxx_dss_dispc_hwmod,
3604 &omap3xxx_dss_dsi1_hwmod,
3605 &omap3xxx_dss_rfbi_hwmod,
3606 &omap3xxx_dss_venc_hwmod,
3607
3608 /* i2c class */
1371 &omap3xxx_i2c1_hwmod, 3609 &omap3xxx_i2c1_hwmod,
1372 &omap3xxx_i2c2_hwmod, 3610 &omap3xxx_i2c2_hwmod,
1373 &omap3xxx_i2c3_hwmod, 3611 &omap3xxx_i2c3_hwmod,
@@ -1387,10 +3625,35 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
1387 3625
1388 /* dma_system class*/ 3626 /* dma_system class*/
1389 &omap3xxx_dma_system_hwmod, 3627 &omap3xxx_dma_system_hwmod,
3628
3629 /* mcbsp class */
3630 &omap3xxx_mcbsp1_hwmod,
3631 &omap3xxx_mcbsp2_hwmod,
3632 &omap3xxx_mcbsp3_hwmod,
3633 &omap3xxx_mcbsp4_hwmod,
3634 &omap3xxx_mcbsp5_hwmod,
3635 &omap3xxx_mcbsp2_sidetone_hwmod,
3636 &omap3xxx_mcbsp3_sidetone_hwmod,
3637
3638 /* mailbox class */
3639 &omap3xxx_mailbox_hwmod,
3640
3641 /* mcspi class */
3642 &omap34xx_mcspi1,
3643 &omap34xx_mcspi2,
3644 &omap34xx_mcspi3,
3645 &omap34xx_mcspi4,
3646
3647 /* usbotg class */
3648 &omap3xxx_usbhsotg_hwmod,
3649
3650 /* usbotg for am35x */
3651 &am35xx_usbhsotg_hwmod,
3652
1390 NULL, 3653 NULL,
1391}; 3654};
1392 3655
1393int __init omap3xxx_hwmod_init(void) 3656int __init omap3xxx_hwmod_init(void)
1394{ 3657{
1395 return omap_hwmod_init(omap3xxx_hwmods); 3658 return omap_hwmod_register(omap3xxx_hwmods);
1396} 3659}
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index c2806bd11fbf..3e88dd3f8ef3 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Hardware modules present on the OMAP44xx chips 2 * Hardware modules present on the OMAP44xx chips
3 * 3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc. 4 * Copyright (C) 2009-2011 Texas Instruments, Inc.
5 * Copyright (C) 2009-2010 Nokia Corporation 5 * Copyright (C) 2009-2010 Nokia Corporation
6 * 6 *
7 * Paul Walmsley 7 * Paul Walmsley
@@ -24,6 +24,9 @@
24#include <plat/cpu.h> 24#include <plat/cpu.h>
25#include <plat/gpio.h> 25#include <plat/gpio.h>
26#include <plat/dma.h> 26#include <plat/dma.h>
27#include <plat/mcspi.h>
28#include <plat/mcbsp.h>
29#include <plat/mmc.h>
27 30
28#include "omap_hwmod_common_data.h" 31#include "omap_hwmod_common_data.h"
29 32
@@ -40,10 +43,15 @@
40#define OMAP44XX_DMA_REQ_START 1 43#define OMAP44XX_DMA_REQ_START 1
41 44
42/* Backward references (IPs with Bus Master capability) */ 45/* Backward references (IPs with Bus Master capability) */
46static struct omap_hwmod omap44xx_aess_hwmod;
43static struct omap_hwmod omap44xx_dma_system_hwmod; 47static struct omap_hwmod omap44xx_dma_system_hwmod;
44static struct omap_hwmod omap44xx_dmm_hwmod; 48static struct omap_hwmod omap44xx_dmm_hwmod;
45static struct omap_hwmod omap44xx_dsp_hwmod; 49static struct omap_hwmod omap44xx_dsp_hwmod;
50static struct omap_hwmod omap44xx_dss_hwmod;
46static struct omap_hwmod omap44xx_emif_fw_hwmod; 51static struct omap_hwmod omap44xx_emif_fw_hwmod;
52static struct omap_hwmod omap44xx_hsi_hwmod;
53static struct omap_hwmod omap44xx_ipu_hwmod;
54static struct omap_hwmod omap44xx_iss_hwmod;
47static struct omap_hwmod omap44xx_iva_hwmod; 55static struct omap_hwmod omap44xx_iva_hwmod;
48static struct omap_hwmod omap44xx_l3_instr_hwmod; 56static struct omap_hwmod omap44xx_l3_instr_hwmod;
49static struct omap_hwmod omap44xx_l3_main_1_hwmod; 57static struct omap_hwmod omap44xx_l3_main_1_hwmod;
@@ -53,8 +61,11 @@ static struct omap_hwmod omap44xx_l4_abe_hwmod;
53static struct omap_hwmod omap44xx_l4_cfg_hwmod; 61static struct omap_hwmod omap44xx_l4_cfg_hwmod;
54static struct omap_hwmod omap44xx_l4_per_hwmod; 62static struct omap_hwmod omap44xx_l4_per_hwmod;
55static struct omap_hwmod omap44xx_l4_wkup_hwmod; 63static struct omap_hwmod omap44xx_l4_wkup_hwmod;
64static struct omap_hwmod omap44xx_mmc1_hwmod;
65static struct omap_hwmod omap44xx_mmc2_hwmod;
56static struct omap_hwmod omap44xx_mpu_hwmod; 66static struct omap_hwmod omap44xx_mpu_hwmod;
57static struct omap_hwmod omap44xx_mpu_private_hwmod; 67static struct omap_hwmod omap44xx_mpu_private_hwmod;
68static struct omap_hwmod omap44xx_usb_otg_hs_hwmod;
58 69
59/* 70/*
60 * Interconnects omap_hwmod structures 71 * Interconnects omap_hwmod structures
@@ -213,6 +224,14 @@ static struct omap_hwmod_ocp_if omap44xx_dsp__l3_main_1 = {
213 .user = OCP_USER_MPU | OCP_USER_SDMA, 224 .user = OCP_USER_MPU | OCP_USER_SDMA,
214}; 225};
215 226
227/* dss -> l3_main_1 */
228static struct omap_hwmod_ocp_if omap44xx_dss__l3_main_1 = {
229 .master = &omap44xx_dss_hwmod,
230 .slave = &omap44xx_l3_main_1_hwmod,
231 .clk = "l3_div_ck",
232 .user = OCP_USER_MPU | OCP_USER_SDMA,
233};
234
216/* l3_main_2 -> l3_main_1 */ 235/* l3_main_2 -> l3_main_1 */
217static struct omap_hwmod_ocp_if omap44xx_l3_main_2__l3_main_1 = { 236static struct omap_hwmod_ocp_if omap44xx_l3_main_2__l3_main_1 = {
218 .master = &omap44xx_l3_main_2_hwmod, 237 .master = &omap44xx_l3_main_2_hwmod,
@@ -229,25 +248,62 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__l3_main_1 = {
229 .user = OCP_USER_MPU | OCP_USER_SDMA, 248 .user = OCP_USER_MPU | OCP_USER_SDMA,
230}; 249};
231 250
251/* mmc1 -> l3_main_1 */
252static struct omap_hwmod_ocp_if omap44xx_mmc1__l3_main_1 = {
253 .master = &omap44xx_mmc1_hwmod,
254 .slave = &omap44xx_l3_main_1_hwmod,
255 .clk = "l3_div_ck",
256 .user = OCP_USER_MPU | OCP_USER_SDMA,
257};
258
259/* mmc2 -> l3_main_1 */
260static struct omap_hwmod_ocp_if omap44xx_mmc2__l3_main_1 = {
261 .master = &omap44xx_mmc2_hwmod,
262 .slave = &omap44xx_l3_main_1_hwmod,
263 .clk = "l3_div_ck",
264 .user = OCP_USER_MPU | OCP_USER_SDMA,
265};
266
267/* L3 target configuration and error log registers */
268static struct omap_hwmod_irq_info omap44xx_l3_targ_irqs[] = {
269 { .irq = 9 + OMAP44XX_IRQ_GIC_START },
270 { .irq = 10 + OMAP44XX_IRQ_GIC_START },
271};
272
273static struct omap_hwmod_addr_space omap44xx_l3_main_1_addrs[] = {
274 {
275 .pa_start = 0x44000000,
276 .pa_end = 0x44000fff,
277 .flags = ADDR_TYPE_RT,
278 },
279};
280
232/* mpu -> l3_main_1 */ 281/* mpu -> l3_main_1 */
233static struct omap_hwmod_ocp_if omap44xx_mpu__l3_main_1 = { 282static struct omap_hwmod_ocp_if omap44xx_mpu__l3_main_1 = {
234 .master = &omap44xx_mpu_hwmod, 283 .master = &omap44xx_mpu_hwmod,
235 .slave = &omap44xx_l3_main_1_hwmod, 284 .slave = &omap44xx_l3_main_1_hwmod,
236 .clk = "l3_div_ck", 285 .clk = "l3_div_ck",
286 .addr = omap44xx_l3_main_1_addrs,
287 .addr_cnt = ARRAY_SIZE(omap44xx_l3_main_1_addrs),
237 .user = OCP_USER_MPU | OCP_USER_SDMA, 288 .user = OCP_USER_MPU | OCP_USER_SDMA,
238}; 289};
239 290
240/* l3_main_1 slave ports */ 291/* l3_main_1 slave ports */
241static struct omap_hwmod_ocp_if *omap44xx_l3_main_1_slaves[] = { 292static struct omap_hwmod_ocp_if *omap44xx_l3_main_1_slaves[] = {
242 &omap44xx_dsp__l3_main_1, 293 &omap44xx_dsp__l3_main_1,
294 &omap44xx_dss__l3_main_1,
243 &omap44xx_l3_main_2__l3_main_1, 295 &omap44xx_l3_main_2__l3_main_1,
244 &omap44xx_l4_cfg__l3_main_1, 296 &omap44xx_l4_cfg__l3_main_1,
297 &omap44xx_mmc1__l3_main_1,
298 &omap44xx_mmc2__l3_main_1,
245 &omap44xx_mpu__l3_main_1, 299 &omap44xx_mpu__l3_main_1,
246}; 300};
247 301
248static struct omap_hwmod omap44xx_l3_main_1_hwmod = { 302static struct omap_hwmod omap44xx_l3_main_1_hwmod = {
249 .name = "l3_main_1", 303 .name = "l3_main_1",
250 .class = &omap44xx_l3_hwmod_class, 304 .class = &omap44xx_l3_hwmod_class,
305 .mpu_irqs = omap44xx_l3_targ_irqs,
306 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_l3_targ_irqs),
251 .slaves = omap44xx_l3_main_1_slaves, 307 .slaves = omap44xx_l3_main_1_slaves,
252 .slaves_cnt = ARRAY_SIZE(omap44xx_l3_main_1_slaves), 308 .slaves_cnt = ARRAY_SIZE(omap44xx_l3_main_1_slaves),
253 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 309 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
@@ -262,6 +318,30 @@ static struct omap_hwmod_ocp_if omap44xx_dma_system__l3_main_2 = {
262 .user = OCP_USER_MPU | OCP_USER_SDMA, 318 .user = OCP_USER_MPU | OCP_USER_SDMA,
263}; 319};
264 320
321/* hsi -> l3_main_2 */
322static struct omap_hwmod_ocp_if omap44xx_hsi__l3_main_2 = {
323 .master = &omap44xx_hsi_hwmod,
324 .slave = &omap44xx_l3_main_2_hwmod,
325 .clk = "l3_div_ck",
326 .user = OCP_USER_MPU | OCP_USER_SDMA,
327};
328
329/* ipu -> l3_main_2 */
330static struct omap_hwmod_ocp_if omap44xx_ipu__l3_main_2 = {
331 .master = &omap44xx_ipu_hwmod,
332 .slave = &omap44xx_l3_main_2_hwmod,
333 .clk = "l3_div_ck",
334 .user = OCP_USER_MPU | OCP_USER_SDMA,
335};
336
337/* iss -> l3_main_2 */
338static struct omap_hwmod_ocp_if omap44xx_iss__l3_main_2 = {
339 .master = &omap44xx_iss_hwmod,
340 .slave = &omap44xx_l3_main_2_hwmod,
341 .clk = "l3_div_ck",
342 .user = OCP_USER_MPU | OCP_USER_SDMA,
343};
344
265/* iva -> l3_main_2 */ 345/* iva -> l3_main_2 */
266static struct omap_hwmod_ocp_if omap44xx_iva__l3_main_2 = { 346static struct omap_hwmod_ocp_if omap44xx_iva__l3_main_2 = {
267 .master = &omap44xx_iva_hwmod, 347 .master = &omap44xx_iva_hwmod,
@@ -270,11 +350,21 @@ static struct omap_hwmod_ocp_if omap44xx_iva__l3_main_2 = {
270 .user = OCP_USER_MPU | OCP_USER_SDMA, 350 .user = OCP_USER_MPU | OCP_USER_SDMA,
271}; 351};
272 352
353static struct omap_hwmod_addr_space omap44xx_l3_main_2_addrs[] = {
354 {
355 .pa_start = 0x44800000,
356 .pa_end = 0x44801fff,
357 .flags = ADDR_TYPE_RT,
358 },
359};
360
273/* l3_main_1 -> l3_main_2 */ 361/* l3_main_1 -> l3_main_2 */
274static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_2 = { 362static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_2 = {
275 .master = &omap44xx_l3_main_1_hwmod, 363 .master = &omap44xx_l3_main_1_hwmod,
276 .slave = &omap44xx_l3_main_2_hwmod, 364 .slave = &omap44xx_l3_main_2_hwmod,
277 .clk = "l3_div_ck", 365 .clk = "l3_div_ck",
366 .addr = omap44xx_l3_main_2_addrs,
367 .addr_cnt = ARRAY_SIZE(omap44xx_l3_main_2_addrs),
278 .user = OCP_USER_MPU | OCP_USER_SDMA, 368 .user = OCP_USER_MPU | OCP_USER_SDMA,
279}; 369};
280 370
@@ -286,12 +376,24 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__l3_main_2 = {
286 .user = OCP_USER_MPU | OCP_USER_SDMA, 376 .user = OCP_USER_MPU | OCP_USER_SDMA,
287}; 377};
288 378
379/* usb_otg_hs -> l3_main_2 */
380static struct omap_hwmod_ocp_if omap44xx_usb_otg_hs__l3_main_2 = {
381 .master = &omap44xx_usb_otg_hs_hwmod,
382 .slave = &omap44xx_l3_main_2_hwmod,
383 .clk = "l3_div_ck",
384 .user = OCP_USER_MPU | OCP_USER_SDMA,
385};
386
289/* l3_main_2 slave ports */ 387/* l3_main_2 slave ports */
290static struct omap_hwmod_ocp_if *omap44xx_l3_main_2_slaves[] = { 388static struct omap_hwmod_ocp_if *omap44xx_l3_main_2_slaves[] = {
291 &omap44xx_dma_system__l3_main_2, 389 &omap44xx_dma_system__l3_main_2,
390 &omap44xx_hsi__l3_main_2,
391 &omap44xx_ipu__l3_main_2,
392 &omap44xx_iss__l3_main_2,
292 &omap44xx_iva__l3_main_2, 393 &omap44xx_iva__l3_main_2,
293 &omap44xx_l3_main_1__l3_main_2, 394 &omap44xx_l3_main_1__l3_main_2,
294 &omap44xx_l4_cfg__l3_main_2, 395 &omap44xx_l4_cfg__l3_main_2,
396 &omap44xx_usb_otg_hs__l3_main_2,
295}; 397};
296 398
297static struct omap_hwmod omap44xx_l3_main_2_hwmod = { 399static struct omap_hwmod omap44xx_l3_main_2_hwmod = {
@@ -303,11 +405,21 @@ static struct omap_hwmod omap44xx_l3_main_2_hwmod = {
303}; 405};
304 406
305/* l3_main_3 interface data */ 407/* l3_main_3 interface data */
408static struct omap_hwmod_addr_space omap44xx_l3_main_3_addrs[] = {
409 {
410 .pa_start = 0x45000000,
411 .pa_end = 0x45000fff,
412 .flags = ADDR_TYPE_RT,
413 },
414};
415
306/* l3_main_1 -> l3_main_3 */ 416/* l3_main_1 -> l3_main_3 */
307static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_3 = { 417static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_3 = {
308 .master = &omap44xx_l3_main_1_hwmod, 418 .master = &omap44xx_l3_main_1_hwmod,
309 .slave = &omap44xx_l3_main_3_hwmod, 419 .slave = &omap44xx_l3_main_3_hwmod,
310 .clk = "l3_div_ck", 420 .clk = "l3_div_ck",
421 .addr = omap44xx_l3_main_3_addrs,
422 .addr_cnt = ARRAY_SIZE(omap44xx_l3_main_3_addrs),
311 .user = OCP_USER_MPU | OCP_USER_SDMA, 423 .user = OCP_USER_MPU | OCP_USER_SDMA,
312}; 424};
313 425
@@ -351,6 +463,14 @@ static struct omap_hwmod_class omap44xx_l4_hwmod_class = {
351}; 463};
352 464
353/* l4_abe interface data */ 465/* l4_abe interface data */
466/* aess -> l4_abe */
467static struct omap_hwmod_ocp_if omap44xx_aess__l4_abe = {
468 .master = &omap44xx_aess_hwmod,
469 .slave = &omap44xx_l4_abe_hwmod,
470 .clk = "ocp_abe_iclk",
471 .user = OCP_USER_MPU | OCP_USER_SDMA,
472};
473
354/* dsp -> l4_abe */ 474/* dsp -> l4_abe */
355static struct omap_hwmod_ocp_if omap44xx_dsp__l4_abe = { 475static struct omap_hwmod_ocp_if omap44xx_dsp__l4_abe = {
356 .master = &omap44xx_dsp_hwmod, 476 .master = &omap44xx_dsp_hwmod,
@@ -377,6 +497,7 @@ static struct omap_hwmod_ocp_if omap44xx_mpu__l4_abe = {
377 497
378/* l4_abe slave ports */ 498/* l4_abe slave ports */
379static struct omap_hwmod_ocp_if *omap44xx_l4_abe_slaves[] = { 499static struct omap_hwmod_ocp_if *omap44xx_l4_abe_slaves[] = {
500 &omap44xx_aess__l4_abe,
380 &omap44xx_dsp__l4_abe, 501 &omap44xx_dsp__l4_abe,
381 &omap44xx_l3_main_1__l4_abe, 502 &omap44xx_l3_main_1__l4_abe,
382 &omap44xx_mpu__l4_abe, 503 &omap44xx_mpu__l4_abe,
@@ -494,26 +615,15 @@ static struct omap_hwmod omap44xx_mpu_private_hwmod = {
494 * - They still need to be validated with the driver 615 * - They still need to be validated with the driver
495 * properly adapted to omap_hwmod / omap_device 616 * properly adapted to omap_hwmod / omap_device
496 * 617 *
497 * aess
498 * bandgap
499 * c2c 618 * c2c
500 * c2c_target_fw 619 * c2c_target_fw
501 * cm_core 620 * cm_core
502 * cm_core_aon 621 * cm_core_aon
503 * counter_32k
504 * ctrl_module_core 622 * ctrl_module_core
505 * ctrl_module_pad_core 623 * ctrl_module_pad_core
506 * ctrl_module_pad_wkup 624 * ctrl_module_pad_wkup
507 * ctrl_module_wkup 625 * ctrl_module_wkup
508 * debugss 626 * debugss
509 * dmic
510 * dss
511 * dss_dispc
512 * dss_dsi1
513 * dss_dsi2
514 * dss_hdmi
515 * dss_rfbi
516 * dss_venc
517 * efuse_ctrl_cust 627 * efuse_ctrl_cust
518 * efuse_ctrl_std 628 * efuse_ctrl_std
519 * elm 629 * elm
@@ -524,58 +634,211 @@ static struct omap_hwmod omap44xx_mpu_private_hwmod = {
524 * gpu 634 * gpu
525 * hdq1w 635 * hdq1w
526 * hsi 636 * hsi
527 * ipu
528 * iss
529 * kbd
530 * mailbox
531 * mcasp
532 * mcbsp1
533 * mcbsp2
534 * mcbsp3
535 * mcbsp4
536 * mcpdm
537 * mcspi1
538 * mcspi2
539 * mcspi3
540 * mcspi4
541 * mmc1
542 * mmc2
543 * mmc3
544 * mmc4
545 * mmc5
546 * mpu_c0
547 * mpu_c1
548 * ocmc_ram 637 * ocmc_ram
549 * ocp2scp_usb_phy 638 * ocp2scp_usb_phy
550 * ocp_wp_noc 639 * ocp_wp_noc
551 * prcm
552 * prcm_mpu 640 * prcm_mpu
553 * prm 641 * prm
554 * scrm 642 * scrm
555 * sl2if 643 * sl2if
556 * slimbus1 644 * slimbus1
557 * slimbus2 645 * slimbus2
558 * spinlock
559 * timer1
560 * timer10
561 * timer11
562 * timer2
563 * timer3
564 * timer4
565 * timer5
566 * timer6
567 * timer7
568 * timer8
569 * timer9
570 * usb_host_fs 646 * usb_host_fs
571 * usb_host_hs 647 * usb_host_hs
572 * usb_otg_hs
573 * usb_phy_cm 648 * usb_phy_cm
574 * usb_tll_hs 649 * usb_tll_hs
575 * usim 650 * usim
576 */ 651 */
577 652
578/* 653/*
654 * 'aess' class
655 * audio engine sub system
656 */
657
658static struct omap_hwmod_class_sysconfig omap44xx_aess_sysc = {
659 .rev_offs = 0x0000,
660 .sysc_offs = 0x0010,
661 .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE),
662 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
663 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
664 .sysc_fields = &omap_hwmod_sysc_type2,
665};
666
667static struct omap_hwmod_class omap44xx_aess_hwmod_class = {
668 .name = "aess",
669 .sysc = &omap44xx_aess_sysc,
670};
671
672/* aess */
673static struct omap_hwmod_irq_info omap44xx_aess_irqs[] = {
674 { .irq = 99 + OMAP44XX_IRQ_GIC_START },
675};
676
677static struct omap_hwmod_dma_info omap44xx_aess_sdma_reqs[] = {
678 { .name = "fifo0", .dma_req = 100 + OMAP44XX_DMA_REQ_START },
679 { .name = "fifo1", .dma_req = 101 + OMAP44XX_DMA_REQ_START },
680 { .name = "fifo2", .dma_req = 102 + OMAP44XX_DMA_REQ_START },
681 { .name = "fifo3", .dma_req = 103 + OMAP44XX_DMA_REQ_START },
682 { .name = "fifo4", .dma_req = 104 + OMAP44XX_DMA_REQ_START },
683 { .name = "fifo5", .dma_req = 105 + OMAP44XX_DMA_REQ_START },
684 { .name = "fifo6", .dma_req = 106 + OMAP44XX_DMA_REQ_START },
685 { .name = "fifo7", .dma_req = 107 + OMAP44XX_DMA_REQ_START },
686};
687
688/* aess master ports */
689static struct omap_hwmod_ocp_if *omap44xx_aess_masters[] = {
690 &omap44xx_aess__l4_abe,
691};
692
693static struct omap_hwmod_addr_space omap44xx_aess_addrs[] = {
694 {
695 .pa_start = 0x401f1000,
696 .pa_end = 0x401f13ff,
697 .flags = ADDR_TYPE_RT
698 },
699};
700
701/* l4_abe -> aess */
702static struct omap_hwmod_ocp_if omap44xx_l4_abe__aess = {
703 .master = &omap44xx_l4_abe_hwmod,
704 .slave = &omap44xx_aess_hwmod,
705 .clk = "ocp_abe_iclk",
706 .addr = omap44xx_aess_addrs,
707 .addr_cnt = ARRAY_SIZE(omap44xx_aess_addrs),
708 .user = OCP_USER_MPU,
709};
710
711static struct omap_hwmod_addr_space omap44xx_aess_dma_addrs[] = {
712 {
713 .pa_start = 0x490f1000,
714 .pa_end = 0x490f13ff,
715 .flags = ADDR_TYPE_RT
716 },
717};
718
719/* l4_abe -> aess (dma) */
720static struct omap_hwmod_ocp_if omap44xx_l4_abe__aess_dma = {
721 .master = &omap44xx_l4_abe_hwmod,
722 .slave = &omap44xx_aess_hwmod,
723 .clk = "ocp_abe_iclk",
724 .addr = omap44xx_aess_dma_addrs,
725 .addr_cnt = ARRAY_SIZE(omap44xx_aess_dma_addrs),
726 .user = OCP_USER_SDMA,
727};
728
729/* aess slave ports */
730static struct omap_hwmod_ocp_if *omap44xx_aess_slaves[] = {
731 &omap44xx_l4_abe__aess,
732 &omap44xx_l4_abe__aess_dma,
733};
734
735static struct omap_hwmod omap44xx_aess_hwmod = {
736 .name = "aess",
737 .class = &omap44xx_aess_hwmod_class,
738 .mpu_irqs = omap44xx_aess_irqs,
739 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_aess_irqs),
740 .sdma_reqs = omap44xx_aess_sdma_reqs,
741 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_aess_sdma_reqs),
742 .main_clk = "aess_fck",
743 .prcm = {
744 .omap4 = {
745 .clkctrl_reg = OMAP4430_CM1_ABE_AESS_CLKCTRL,
746 },
747 },
748 .slaves = omap44xx_aess_slaves,
749 .slaves_cnt = ARRAY_SIZE(omap44xx_aess_slaves),
750 .masters = omap44xx_aess_masters,
751 .masters_cnt = ARRAY_SIZE(omap44xx_aess_masters),
752 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
753};
754
755/*
756 * 'bandgap' class
757 * bangap reference for ldo regulators
758 */
759
760static struct omap_hwmod_class omap44xx_bandgap_hwmod_class = {
761 .name = "bandgap",
762};
763
764/* bandgap */
765static struct omap_hwmod_opt_clk bandgap_opt_clks[] = {
766 { .role = "fclk", .clk = "bandgap_fclk" },
767};
768
769static struct omap_hwmod omap44xx_bandgap_hwmod = {
770 .name = "bandgap",
771 .class = &omap44xx_bandgap_hwmod_class,
772 .prcm = {
773 .omap4 = {
774 .clkctrl_reg = OMAP4430_CM_WKUP_BANDGAP_CLKCTRL,
775 },
776 },
777 .opt_clks = bandgap_opt_clks,
778 .opt_clks_cnt = ARRAY_SIZE(bandgap_opt_clks),
779 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
780};
781
782/*
783 * 'counter' class
784 * 32-bit ordinary counter, clocked by the falling edge of the 32 khz clock
785 */
786
787static struct omap_hwmod_class_sysconfig omap44xx_counter_sysc = {
788 .rev_offs = 0x0000,
789 .sysc_offs = 0x0004,
790 .sysc_flags = SYSC_HAS_SIDLEMODE,
791 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
792 SIDLE_SMART_WKUP),
793 .sysc_fields = &omap_hwmod_sysc_type1,
794};
795
796static struct omap_hwmod_class omap44xx_counter_hwmod_class = {
797 .name = "counter",
798 .sysc = &omap44xx_counter_sysc,
799};
800
801/* counter_32k */
802static struct omap_hwmod omap44xx_counter_32k_hwmod;
803static struct omap_hwmod_addr_space omap44xx_counter_32k_addrs[] = {
804 {
805 .pa_start = 0x4a304000,
806 .pa_end = 0x4a30401f,
807 .flags = ADDR_TYPE_RT
808 },
809};
810
811/* l4_wkup -> counter_32k */
812static struct omap_hwmod_ocp_if omap44xx_l4_wkup__counter_32k = {
813 .master = &omap44xx_l4_wkup_hwmod,
814 .slave = &omap44xx_counter_32k_hwmod,
815 .clk = "l4_wkup_clk_mux_ck",
816 .addr = omap44xx_counter_32k_addrs,
817 .addr_cnt = ARRAY_SIZE(omap44xx_counter_32k_addrs),
818 .user = OCP_USER_MPU | OCP_USER_SDMA,
819};
820
821/* counter_32k slave ports */
822static struct omap_hwmod_ocp_if *omap44xx_counter_32k_slaves[] = {
823 &omap44xx_l4_wkup__counter_32k,
824};
825
826static struct omap_hwmod omap44xx_counter_32k_hwmod = {
827 .name = "counter_32k",
828 .class = &omap44xx_counter_hwmod_class,
829 .flags = HWMOD_SWSUP_SIDLE,
830 .main_clk = "sys_32k_ck",
831 .prcm = {
832 .omap4 = {
833 .clkctrl_reg = OMAP4430_CM_WKUP_SYNCTIMER_CLKCTRL,
834 },
835 },
836 .slaves = omap44xx_counter_32k_slaves,
837 .slaves_cnt = ARRAY_SIZE(omap44xx_counter_32k_slaves),
838 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
839};
840
841/*
579 * 'dma' class 842 * 'dma' class
580 * dma controller for data exchange between memory to memory (i.e. internal or 843 * dma controller for data exchange between memory to memory (i.e. internal or
581 * external memory) and gp peripherals to memory or memory to gp peripherals 844 * external memory) and gp peripherals to memory or memory to gp peripherals
@@ -662,6 +925,96 @@ static struct omap_hwmod omap44xx_dma_system_hwmod = {
662}; 925};
663 926
664/* 927/*
928 * 'dmic' class
929 * digital microphone controller
930 */
931
932static struct omap_hwmod_class_sysconfig omap44xx_dmic_sysc = {
933 .rev_offs = 0x0000,
934 .sysc_offs = 0x0010,
935 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_RESET_STATUS |
936 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
937 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
938 SIDLE_SMART_WKUP),
939 .sysc_fields = &omap_hwmod_sysc_type2,
940};
941
942static struct omap_hwmod_class omap44xx_dmic_hwmod_class = {
943 .name = "dmic",
944 .sysc = &omap44xx_dmic_sysc,
945};
946
947/* dmic */
948static struct omap_hwmod omap44xx_dmic_hwmod;
949static struct omap_hwmod_irq_info omap44xx_dmic_irqs[] = {
950 { .irq = 114 + OMAP44XX_IRQ_GIC_START },
951};
952
953static struct omap_hwmod_dma_info omap44xx_dmic_sdma_reqs[] = {
954 { .dma_req = 66 + OMAP44XX_DMA_REQ_START },
955};
956
957static struct omap_hwmod_addr_space omap44xx_dmic_addrs[] = {
958 {
959 .pa_start = 0x4012e000,
960 .pa_end = 0x4012e07f,
961 .flags = ADDR_TYPE_RT
962 },
963};
964
965/* l4_abe -> dmic */
966static struct omap_hwmod_ocp_if omap44xx_l4_abe__dmic = {
967 .master = &omap44xx_l4_abe_hwmod,
968 .slave = &omap44xx_dmic_hwmod,
969 .clk = "ocp_abe_iclk",
970 .addr = omap44xx_dmic_addrs,
971 .addr_cnt = ARRAY_SIZE(omap44xx_dmic_addrs),
972 .user = OCP_USER_MPU,
973};
974
975static struct omap_hwmod_addr_space omap44xx_dmic_dma_addrs[] = {
976 {
977 .pa_start = 0x4902e000,
978 .pa_end = 0x4902e07f,
979 .flags = ADDR_TYPE_RT
980 },
981};
982
983/* l4_abe -> dmic (dma) */
984static struct omap_hwmod_ocp_if omap44xx_l4_abe__dmic_dma = {
985 .master = &omap44xx_l4_abe_hwmod,
986 .slave = &omap44xx_dmic_hwmod,
987 .clk = "ocp_abe_iclk",
988 .addr = omap44xx_dmic_dma_addrs,
989 .addr_cnt = ARRAY_SIZE(omap44xx_dmic_dma_addrs),
990 .user = OCP_USER_SDMA,
991};
992
993/* dmic slave ports */
994static struct omap_hwmod_ocp_if *omap44xx_dmic_slaves[] = {
995 &omap44xx_l4_abe__dmic,
996 &omap44xx_l4_abe__dmic_dma,
997};
998
999static struct omap_hwmod omap44xx_dmic_hwmod = {
1000 .name = "dmic",
1001 .class = &omap44xx_dmic_hwmod_class,
1002 .mpu_irqs = omap44xx_dmic_irqs,
1003 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_dmic_irqs),
1004 .sdma_reqs = omap44xx_dmic_sdma_reqs,
1005 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_dmic_sdma_reqs),
1006 .main_clk = "dmic_fck",
1007 .prcm = {
1008 .omap4 = {
1009 .clkctrl_reg = OMAP4430_CM1_ABE_DMIC_CLKCTRL,
1010 },
1011 },
1012 .slaves = omap44xx_dmic_slaves,
1013 .slaves_cnt = ARRAY_SIZE(omap44xx_dmic_slaves),
1014 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1015};
1016
1017/*
665 * 'dsp' class 1018 * 'dsp' class
666 * dsp sub-system 1019 * dsp sub-system
667 */ 1020 */
@@ -747,6 +1100,590 @@ static struct omap_hwmod omap44xx_dsp_hwmod = {
747}; 1100};
748 1101
749/* 1102/*
1103 * 'dss' class
1104 * display sub-system
1105 */
1106
1107static struct omap_hwmod_class_sysconfig omap44xx_dss_sysc = {
1108 .rev_offs = 0x0000,
1109 .syss_offs = 0x0014,
1110 .sysc_flags = SYSS_HAS_RESET_STATUS,
1111};
1112
1113static struct omap_hwmod_class omap44xx_dss_hwmod_class = {
1114 .name = "dss",
1115 .sysc = &omap44xx_dss_sysc,
1116};
1117
1118/* dss */
1119/* dss master ports */
1120static struct omap_hwmod_ocp_if *omap44xx_dss_masters[] = {
1121 &omap44xx_dss__l3_main_1,
1122};
1123
1124static struct omap_hwmod_addr_space omap44xx_dss_dma_addrs[] = {
1125 {
1126 .pa_start = 0x58000000,
1127 .pa_end = 0x5800007f,
1128 .flags = ADDR_TYPE_RT
1129 },
1130};
1131
1132/* l3_main_2 -> dss */
1133static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss = {
1134 .master = &omap44xx_l3_main_2_hwmod,
1135 .slave = &omap44xx_dss_hwmod,
1136 .clk = "l3_div_ck",
1137 .addr = omap44xx_dss_dma_addrs,
1138 .addr_cnt = ARRAY_SIZE(omap44xx_dss_dma_addrs),
1139 .user = OCP_USER_SDMA,
1140};
1141
1142static struct omap_hwmod_addr_space omap44xx_dss_addrs[] = {
1143 {
1144 .pa_start = 0x48040000,
1145 .pa_end = 0x4804007f,
1146 .flags = ADDR_TYPE_RT
1147 },
1148};
1149
1150/* l4_per -> dss */
1151static struct omap_hwmod_ocp_if omap44xx_l4_per__dss = {
1152 .master = &omap44xx_l4_per_hwmod,
1153 .slave = &omap44xx_dss_hwmod,
1154 .clk = "l4_div_ck",
1155 .addr = omap44xx_dss_addrs,
1156 .addr_cnt = ARRAY_SIZE(omap44xx_dss_addrs),
1157 .user = OCP_USER_MPU,
1158};
1159
1160/* dss slave ports */
1161static struct omap_hwmod_ocp_if *omap44xx_dss_slaves[] = {
1162 &omap44xx_l3_main_2__dss,
1163 &omap44xx_l4_per__dss,
1164};
1165
1166static struct omap_hwmod_opt_clk dss_opt_clks[] = {
1167 { .role = "sys_clk", .clk = "dss_sys_clk" },
1168 { .role = "tv_clk", .clk = "dss_tv_clk" },
1169 { .role = "dss_clk", .clk = "dss_dss_clk" },
1170 { .role = "video_clk", .clk = "dss_48mhz_clk" },
1171};
1172
1173static struct omap_hwmod omap44xx_dss_hwmod = {
1174 .name = "dss_core",
1175 .class = &omap44xx_dss_hwmod_class,
1176 .main_clk = "dss_fck",
1177 .prcm = {
1178 .omap4 = {
1179 .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL,
1180 },
1181 },
1182 .opt_clks = dss_opt_clks,
1183 .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
1184 .slaves = omap44xx_dss_slaves,
1185 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_slaves),
1186 .masters = omap44xx_dss_masters,
1187 .masters_cnt = ARRAY_SIZE(omap44xx_dss_masters),
1188 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1189};
1190
1191/*
1192 * 'dispc' class
1193 * display controller
1194 */
1195
1196static struct omap_hwmod_class_sysconfig omap44xx_dispc_sysc = {
1197 .rev_offs = 0x0000,
1198 .sysc_offs = 0x0010,
1199 .syss_offs = 0x0014,
1200 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
1201 SYSC_HAS_ENAWAKEUP | SYSC_HAS_MIDLEMODE |
1202 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
1203 SYSS_HAS_RESET_STATUS),
1204 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1205 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
1206 .sysc_fields = &omap_hwmod_sysc_type1,
1207};
1208
1209static struct omap_hwmod_class omap44xx_dispc_hwmod_class = {
1210 .name = "dispc",
1211 .sysc = &omap44xx_dispc_sysc,
1212};
1213
1214/* dss_dispc */
1215static struct omap_hwmod omap44xx_dss_dispc_hwmod;
1216static struct omap_hwmod_irq_info omap44xx_dss_dispc_irqs[] = {
1217 { .irq = 25 + OMAP44XX_IRQ_GIC_START },
1218};
1219
1220static struct omap_hwmod_dma_info omap44xx_dss_dispc_sdma_reqs[] = {
1221 { .dma_req = 5 + OMAP44XX_DMA_REQ_START },
1222};
1223
1224static struct omap_hwmod_addr_space omap44xx_dss_dispc_dma_addrs[] = {
1225 {
1226 .pa_start = 0x58001000,
1227 .pa_end = 0x58001fff,
1228 .flags = ADDR_TYPE_RT
1229 },
1230};
1231
1232/* l3_main_2 -> dss_dispc */
1233static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_dispc = {
1234 .master = &omap44xx_l3_main_2_hwmod,
1235 .slave = &omap44xx_dss_dispc_hwmod,
1236 .clk = "l3_div_ck",
1237 .addr = omap44xx_dss_dispc_dma_addrs,
1238 .addr_cnt = ARRAY_SIZE(omap44xx_dss_dispc_dma_addrs),
1239 .user = OCP_USER_SDMA,
1240};
1241
1242static struct omap_hwmod_addr_space omap44xx_dss_dispc_addrs[] = {
1243 {
1244 .pa_start = 0x48041000,
1245 .pa_end = 0x48041fff,
1246 .flags = ADDR_TYPE_RT
1247 },
1248};
1249
1250/* l4_per -> dss_dispc */
1251static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_dispc = {
1252 .master = &omap44xx_l4_per_hwmod,
1253 .slave = &omap44xx_dss_dispc_hwmod,
1254 .clk = "l4_div_ck",
1255 .addr = omap44xx_dss_dispc_addrs,
1256 .addr_cnt = ARRAY_SIZE(omap44xx_dss_dispc_addrs),
1257 .user = OCP_USER_MPU,
1258};
1259
1260/* dss_dispc slave ports */
1261static struct omap_hwmod_ocp_if *omap44xx_dss_dispc_slaves[] = {
1262 &omap44xx_l3_main_2__dss_dispc,
1263 &omap44xx_l4_per__dss_dispc,
1264};
1265
1266static struct omap_hwmod omap44xx_dss_dispc_hwmod = {
1267 .name = "dss_dispc",
1268 .class = &omap44xx_dispc_hwmod_class,
1269 .mpu_irqs = omap44xx_dss_dispc_irqs,
1270 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_dss_dispc_irqs),
1271 .sdma_reqs = omap44xx_dss_dispc_sdma_reqs,
1272 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_dss_dispc_sdma_reqs),
1273 .main_clk = "dss_fck",
1274 .prcm = {
1275 .omap4 = {
1276 .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL,
1277 },
1278 },
1279 .slaves = omap44xx_dss_dispc_slaves,
1280 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dispc_slaves),
1281 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1282};
1283
1284/*
1285 * 'dsi' class
1286 * display serial interface controller
1287 */
1288
1289static struct omap_hwmod_class_sysconfig omap44xx_dsi_sysc = {
1290 .rev_offs = 0x0000,
1291 .sysc_offs = 0x0010,
1292 .syss_offs = 0x0014,
1293 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
1294 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
1295 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
1296 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1297 .sysc_fields = &omap_hwmod_sysc_type1,
1298};
1299
1300static struct omap_hwmod_class omap44xx_dsi_hwmod_class = {
1301 .name = "dsi",
1302 .sysc = &omap44xx_dsi_sysc,
1303};
1304
1305/* dss_dsi1 */
1306static struct omap_hwmod omap44xx_dss_dsi1_hwmod;
1307static struct omap_hwmod_irq_info omap44xx_dss_dsi1_irqs[] = {
1308 { .irq = 53 + OMAP44XX_IRQ_GIC_START },
1309};
1310
1311static struct omap_hwmod_dma_info omap44xx_dss_dsi1_sdma_reqs[] = {
1312 { .dma_req = 74 + OMAP44XX_DMA_REQ_START },
1313};
1314
1315static struct omap_hwmod_addr_space omap44xx_dss_dsi1_dma_addrs[] = {
1316 {
1317 .pa_start = 0x58004000,
1318 .pa_end = 0x580041ff,
1319 .flags = ADDR_TYPE_RT
1320 },
1321};
1322
1323/* l3_main_2 -> dss_dsi1 */
1324static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_dsi1 = {
1325 .master = &omap44xx_l3_main_2_hwmod,
1326 .slave = &omap44xx_dss_dsi1_hwmod,
1327 .clk = "l3_div_ck",
1328 .addr = omap44xx_dss_dsi1_dma_addrs,
1329 .addr_cnt = ARRAY_SIZE(omap44xx_dss_dsi1_dma_addrs),
1330 .user = OCP_USER_SDMA,
1331};
1332
1333static struct omap_hwmod_addr_space omap44xx_dss_dsi1_addrs[] = {
1334 {
1335 .pa_start = 0x48044000,
1336 .pa_end = 0x480441ff,
1337 .flags = ADDR_TYPE_RT
1338 },
1339};
1340
1341/* l4_per -> dss_dsi1 */
1342static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_dsi1 = {
1343 .master = &omap44xx_l4_per_hwmod,
1344 .slave = &omap44xx_dss_dsi1_hwmod,
1345 .clk = "l4_div_ck",
1346 .addr = omap44xx_dss_dsi1_addrs,
1347 .addr_cnt = ARRAY_SIZE(omap44xx_dss_dsi1_addrs),
1348 .user = OCP_USER_MPU,
1349};
1350
1351/* dss_dsi1 slave ports */
1352static struct omap_hwmod_ocp_if *omap44xx_dss_dsi1_slaves[] = {
1353 &omap44xx_l3_main_2__dss_dsi1,
1354 &omap44xx_l4_per__dss_dsi1,
1355};
1356
1357static struct omap_hwmod omap44xx_dss_dsi1_hwmod = {
1358 .name = "dss_dsi1",
1359 .class = &omap44xx_dsi_hwmod_class,
1360 .mpu_irqs = omap44xx_dss_dsi1_irqs,
1361 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_dss_dsi1_irqs),
1362 .sdma_reqs = omap44xx_dss_dsi1_sdma_reqs,
1363 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_dss_dsi1_sdma_reqs),
1364 .main_clk = "dss_fck",
1365 .prcm = {
1366 .omap4 = {
1367 .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL,
1368 },
1369 },
1370 .slaves = omap44xx_dss_dsi1_slaves,
1371 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dsi1_slaves),
1372 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1373};
1374
1375/* dss_dsi2 */
1376static struct omap_hwmod omap44xx_dss_dsi2_hwmod;
1377static struct omap_hwmod_irq_info omap44xx_dss_dsi2_irqs[] = {
1378 { .irq = 84 + OMAP44XX_IRQ_GIC_START },
1379};
1380
1381static struct omap_hwmod_dma_info omap44xx_dss_dsi2_sdma_reqs[] = {
1382 { .dma_req = 83 + OMAP44XX_DMA_REQ_START },
1383};
1384
1385static struct omap_hwmod_addr_space omap44xx_dss_dsi2_dma_addrs[] = {
1386 {
1387 .pa_start = 0x58005000,
1388 .pa_end = 0x580051ff,
1389 .flags = ADDR_TYPE_RT
1390 },
1391};
1392
1393/* l3_main_2 -> dss_dsi2 */
1394static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_dsi2 = {
1395 .master = &omap44xx_l3_main_2_hwmod,
1396 .slave = &omap44xx_dss_dsi2_hwmod,
1397 .clk = "l3_div_ck",
1398 .addr = omap44xx_dss_dsi2_dma_addrs,
1399 .addr_cnt = ARRAY_SIZE(omap44xx_dss_dsi2_dma_addrs),
1400 .user = OCP_USER_SDMA,
1401};
1402
1403static struct omap_hwmod_addr_space omap44xx_dss_dsi2_addrs[] = {
1404 {
1405 .pa_start = 0x48045000,
1406 .pa_end = 0x480451ff,
1407 .flags = ADDR_TYPE_RT
1408 },
1409};
1410
1411/* l4_per -> dss_dsi2 */
1412static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_dsi2 = {
1413 .master = &omap44xx_l4_per_hwmod,
1414 .slave = &omap44xx_dss_dsi2_hwmod,
1415 .clk = "l4_div_ck",
1416 .addr = omap44xx_dss_dsi2_addrs,
1417 .addr_cnt = ARRAY_SIZE(omap44xx_dss_dsi2_addrs),
1418 .user = OCP_USER_MPU,
1419};
1420
1421/* dss_dsi2 slave ports */
1422static struct omap_hwmod_ocp_if *omap44xx_dss_dsi2_slaves[] = {
1423 &omap44xx_l3_main_2__dss_dsi2,
1424 &omap44xx_l4_per__dss_dsi2,
1425};
1426
1427static struct omap_hwmod omap44xx_dss_dsi2_hwmod = {
1428 .name = "dss_dsi2",
1429 .class = &omap44xx_dsi_hwmod_class,
1430 .mpu_irqs = omap44xx_dss_dsi2_irqs,
1431 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_dss_dsi2_irqs),
1432 .sdma_reqs = omap44xx_dss_dsi2_sdma_reqs,
1433 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_dss_dsi2_sdma_reqs),
1434 .main_clk = "dss_fck",
1435 .prcm = {
1436 .omap4 = {
1437 .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL,
1438 },
1439 },
1440 .slaves = omap44xx_dss_dsi2_slaves,
1441 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dsi2_slaves),
1442 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1443};
1444
1445/*
1446 * 'hdmi' class
1447 * hdmi controller
1448 */
1449
1450static struct omap_hwmod_class_sysconfig omap44xx_hdmi_sysc = {
1451 .rev_offs = 0x0000,
1452 .sysc_offs = 0x0010,
1453 .sysc_flags = (SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE |
1454 SYSC_HAS_SOFTRESET),
1455 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1456 SIDLE_SMART_WKUP),
1457 .sysc_fields = &omap_hwmod_sysc_type2,
1458};
1459
1460static struct omap_hwmod_class omap44xx_hdmi_hwmod_class = {
1461 .name = "hdmi",
1462 .sysc = &omap44xx_hdmi_sysc,
1463};
1464
1465/* dss_hdmi */
1466static struct omap_hwmod omap44xx_dss_hdmi_hwmod;
1467static struct omap_hwmod_irq_info omap44xx_dss_hdmi_irqs[] = {
1468 { .irq = 101 + OMAP44XX_IRQ_GIC_START },
1469};
1470
1471static struct omap_hwmod_dma_info omap44xx_dss_hdmi_sdma_reqs[] = {
1472 { .dma_req = 75 + OMAP44XX_DMA_REQ_START },
1473};
1474
1475static struct omap_hwmod_addr_space omap44xx_dss_hdmi_dma_addrs[] = {
1476 {
1477 .pa_start = 0x58006000,
1478 .pa_end = 0x58006fff,
1479 .flags = ADDR_TYPE_RT
1480 },
1481};
1482
1483/* l3_main_2 -> dss_hdmi */
1484static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_hdmi = {
1485 .master = &omap44xx_l3_main_2_hwmod,
1486 .slave = &omap44xx_dss_hdmi_hwmod,
1487 .clk = "l3_div_ck",
1488 .addr = omap44xx_dss_hdmi_dma_addrs,
1489 .addr_cnt = ARRAY_SIZE(omap44xx_dss_hdmi_dma_addrs),
1490 .user = OCP_USER_SDMA,
1491};
1492
1493static struct omap_hwmod_addr_space omap44xx_dss_hdmi_addrs[] = {
1494 {
1495 .pa_start = 0x48046000,
1496 .pa_end = 0x48046fff,
1497 .flags = ADDR_TYPE_RT
1498 },
1499};
1500
1501/* l4_per -> dss_hdmi */
1502static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_hdmi = {
1503 .master = &omap44xx_l4_per_hwmod,
1504 .slave = &omap44xx_dss_hdmi_hwmod,
1505 .clk = "l4_div_ck",
1506 .addr = omap44xx_dss_hdmi_addrs,
1507 .addr_cnt = ARRAY_SIZE(omap44xx_dss_hdmi_addrs),
1508 .user = OCP_USER_MPU,
1509};
1510
1511/* dss_hdmi slave ports */
1512static struct omap_hwmod_ocp_if *omap44xx_dss_hdmi_slaves[] = {
1513 &omap44xx_l3_main_2__dss_hdmi,
1514 &omap44xx_l4_per__dss_hdmi,
1515};
1516
1517static struct omap_hwmod omap44xx_dss_hdmi_hwmod = {
1518 .name = "dss_hdmi",
1519 .class = &omap44xx_hdmi_hwmod_class,
1520 .mpu_irqs = omap44xx_dss_hdmi_irqs,
1521 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_dss_hdmi_irqs),
1522 .sdma_reqs = omap44xx_dss_hdmi_sdma_reqs,
1523 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_dss_hdmi_sdma_reqs),
1524 .main_clk = "dss_fck",
1525 .prcm = {
1526 .omap4 = {
1527 .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL,
1528 },
1529 },
1530 .slaves = omap44xx_dss_hdmi_slaves,
1531 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_hdmi_slaves),
1532 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1533};
1534
1535/*
1536 * 'rfbi' class
1537 * remote frame buffer interface
1538 */
1539
1540static struct omap_hwmod_class_sysconfig omap44xx_rfbi_sysc = {
1541 .rev_offs = 0x0000,
1542 .sysc_offs = 0x0010,
1543 .syss_offs = 0x0014,
1544 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE |
1545 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
1546 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1547 .sysc_fields = &omap_hwmod_sysc_type1,
1548};
1549
1550static struct omap_hwmod_class omap44xx_rfbi_hwmod_class = {
1551 .name = "rfbi",
1552 .sysc = &omap44xx_rfbi_sysc,
1553};
1554
1555/* dss_rfbi */
1556static struct omap_hwmod omap44xx_dss_rfbi_hwmod;
1557static struct omap_hwmod_dma_info omap44xx_dss_rfbi_sdma_reqs[] = {
1558 { .dma_req = 13 + OMAP44XX_DMA_REQ_START },
1559};
1560
1561static struct omap_hwmod_addr_space omap44xx_dss_rfbi_dma_addrs[] = {
1562 {
1563 .pa_start = 0x58002000,
1564 .pa_end = 0x580020ff,
1565 .flags = ADDR_TYPE_RT
1566 },
1567};
1568
1569/* l3_main_2 -> dss_rfbi */
1570static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_rfbi = {
1571 .master = &omap44xx_l3_main_2_hwmod,
1572 .slave = &omap44xx_dss_rfbi_hwmod,
1573 .clk = "l3_div_ck",
1574 .addr = omap44xx_dss_rfbi_dma_addrs,
1575 .addr_cnt = ARRAY_SIZE(omap44xx_dss_rfbi_dma_addrs),
1576 .user = OCP_USER_SDMA,
1577};
1578
1579static struct omap_hwmod_addr_space omap44xx_dss_rfbi_addrs[] = {
1580 {
1581 .pa_start = 0x48042000,
1582 .pa_end = 0x480420ff,
1583 .flags = ADDR_TYPE_RT
1584 },
1585};
1586
1587/* l4_per -> dss_rfbi */
1588static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_rfbi = {
1589 .master = &omap44xx_l4_per_hwmod,
1590 .slave = &omap44xx_dss_rfbi_hwmod,
1591 .clk = "l4_div_ck",
1592 .addr = omap44xx_dss_rfbi_addrs,
1593 .addr_cnt = ARRAY_SIZE(omap44xx_dss_rfbi_addrs),
1594 .user = OCP_USER_MPU,
1595};
1596
1597/* dss_rfbi slave ports */
1598static struct omap_hwmod_ocp_if *omap44xx_dss_rfbi_slaves[] = {
1599 &omap44xx_l3_main_2__dss_rfbi,
1600 &omap44xx_l4_per__dss_rfbi,
1601};
1602
1603static struct omap_hwmod omap44xx_dss_rfbi_hwmod = {
1604 .name = "dss_rfbi",
1605 .class = &omap44xx_rfbi_hwmod_class,
1606 .sdma_reqs = omap44xx_dss_rfbi_sdma_reqs,
1607 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_dss_rfbi_sdma_reqs),
1608 .main_clk = "dss_fck",
1609 .prcm = {
1610 .omap4 = {
1611 .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL,
1612 },
1613 },
1614 .slaves = omap44xx_dss_rfbi_slaves,
1615 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_rfbi_slaves),
1616 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1617};
1618
1619/*
1620 * 'venc' class
1621 * video encoder
1622 */
1623
1624static struct omap_hwmod_class omap44xx_venc_hwmod_class = {
1625 .name = "venc",
1626};
1627
1628/* dss_venc */
1629static struct omap_hwmod omap44xx_dss_venc_hwmod;
1630static struct omap_hwmod_addr_space omap44xx_dss_venc_dma_addrs[] = {
1631 {
1632 .pa_start = 0x58003000,
1633 .pa_end = 0x580030ff,
1634 .flags = ADDR_TYPE_RT
1635 },
1636};
1637
1638/* l3_main_2 -> dss_venc */
1639static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_venc = {
1640 .master = &omap44xx_l3_main_2_hwmod,
1641 .slave = &omap44xx_dss_venc_hwmod,
1642 .clk = "l3_div_ck",
1643 .addr = omap44xx_dss_venc_dma_addrs,
1644 .addr_cnt = ARRAY_SIZE(omap44xx_dss_venc_dma_addrs),
1645 .user = OCP_USER_SDMA,
1646};
1647
1648static struct omap_hwmod_addr_space omap44xx_dss_venc_addrs[] = {
1649 {
1650 .pa_start = 0x48043000,
1651 .pa_end = 0x480430ff,
1652 .flags = ADDR_TYPE_RT
1653 },
1654};
1655
1656/* l4_per -> dss_venc */
1657static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_venc = {
1658 .master = &omap44xx_l4_per_hwmod,
1659 .slave = &omap44xx_dss_venc_hwmod,
1660 .clk = "l4_div_ck",
1661 .addr = omap44xx_dss_venc_addrs,
1662 .addr_cnt = ARRAY_SIZE(omap44xx_dss_venc_addrs),
1663 .user = OCP_USER_MPU,
1664};
1665
1666/* dss_venc slave ports */
1667static struct omap_hwmod_ocp_if *omap44xx_dss_venc_slaves[] = {
1668 &omap44xx_l3_main_2__dss_venc,
1669 &omap44xx_l4_per__dss_venc,
1670};
1671
1672static struct omap_hwmod omap44xx_dss_venc_hwmod = {
1673 .name = "dss_venc",
1674 .class = &omap44xx_venc_hwmod_class,
1675 .main_clk = "dss_fck",
1676 .prcm = {
1677 .omap4 = {
1678 .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL,
1679 },
1680 },
1681 .slaves = omap44xx_dss_venc_slaves,
1682 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_venc_slaves),
1683 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1684};
1685
1686/*
750 * 'gpio' class 1687 * 'gpio' class
751 * general purpose io module 1688 * general purpose io module
752 */ 1689 */
@@ -1093,6 +2030,83 @@ static struct omap_hwmod omap44xx_gpio6_hwmod = {
1093}; 2030};
1094 2031
1095/* 2032/*
2033 * 'hsi' class
2034 * mipi high-speed synchronous serial interface (multichannel and full-duplex
2035 * serial if)
2036 */
2037
2038static struct omap_hwmod_class_sysconfig omap44xx_hsi_sysc = {
2039 .rev_offs = 0x0000,
2040 .sysc_offs = 0x0010,
2041 .syss_offs = 0x0014,
2042 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_EMUFREE |
2043 SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE |
2044 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
2045 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
2046 SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
2047 MSTANDBY_SMART),
2048 .sysc_fields = &omap_hwmod_sysc_type1,
2049};
2050
2051static struct omap_hwmod_class omap44xx_hsi_hwmod_class = {
2052 .name = "hsi",
2053 .sysc = &omap44xx_hsi_sysc,
2054};
2055
2056/* hsi */
2057static struct omap_hwmod_irq_info omap44xx_hsi_irqs[] = {
2058 { .name = "mpu_p1", .irq = 67 + OMAP44XX_IRQ_GIC_START },
2059 { .name = "mpu_p2", .irq = 68 + OMAP44XX_IRQ_GIC_START },
2060 { .name = "mpu_dma", .irq = 71 + OMAP44XX_IRQ_GIC_START },
2061};
2062
2063/* hsi master ports */
2064static struct omap_hwmod_ocp_if *omap44xx_hsi_masters[] = {
2065 &omap44xx_hsi__l3_main_2,
2066};
2067
2068static struct omap_hwmod_addr_space omap44xx_hsi_addrs[] = {
2069 {
2070 .pa_start = 0x4a058000,
2071 .pa_end = 0x4a05bfff,
2072 .flags = ADDR_TYPE_RT
2073 },
2074};
2075
2076/* l4_cfg -> hsi */
2077static struct omap_hwmod_ocp_if omap44xx_l4_cfg__hsi = {
2078 .master = &omap44xx_l4_cfg_hwmod,
2079 .slave = &omap44xx_hsi_hwmod,
2080 .clk = "l4_div_ck",
2081 .addr = omap44xx_hsi_addrs,
2082 .addr_cnt = ARRAY_SIZE(omap44xx_hsi_addrs),
2083 .user = OCP_USER_MPU | OCP_USER_SDMA,
2084};
2085
2086/* hsi slave ports */
2087static struct omap_hwmod_ocp_if *omap44xx_hsi_slaves[] = {
2088 &omap44xx_l4_cfg__hsi,
2089};
2090
2091static struct omap_hwmod omap44xx_hsi_hwmod = {
2092 .name = "hsi",
2093 .class = &omap44xx_hsi_hwmod_class,
2094 .mpu_irqs = omap44xx_hsi_irqs,
2095 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_hsi_irqs),
2096 .main_clk = "hsi_fck",
2097 .prcm = {
2098 .omap4 = {
2099 .clkctrl_reg = OMAP4430_CM_L3INIT_HSI_CLKCTRL,
2100 },
2101 },
2102 .slaves = omap44xx_hsi_slaves,
2103 .slaves_cnt = ARRAY_SIZE(omap44xx_hsi_slaves),
2104 .masters = omap44xx_hsi_masters,
2105 .masters_cnt = ARRAY_SIZE(omap44xx_hsi_masters),
2106 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2107};
2108
2109/*
1096 * 'i2c' class 2110 * 'i2c' class
1097 * multimaster high-speed i2c controller 2111 * multimaster high-speed i2c controller
1098 */ 2112 */
@@ -1326,6 +2340,188 @@ static struct omap_hwmod omap44xx_i2c4_hwmod = {
1326}; 2340};
1327 2341
1328/* 2342/*
2343 * 'ipu' class
2344 * imaging processor unit
2345 */
2346
2347static struct omap_hwmod_class omap44xx_ipu_hwmod_class = {
2348 .name = "ipu",
2349};
2350
2351/* ipu */
2352static struct omap_hwmod_irq_info omap44xx_ipu_irqs[] = {
2353 { .irq = 100 + OMAP44XX_IRQ_GIC_START },
2354};
2355
2356static struct omap_hwmod_rst_info omap44xx_ipu_c0_resets[] = {
2357 { .name = "cpu0", .rst_shift = 0 },
2358};
2359
2360static struct omap_hwmod_rst_info omap44xx_ipu_c1_resets[] = {
2361 { .name = "cpu1", .rst_shift = 1 },
2362};
2363
2364static struct omap_hwmod_rst_info omap44xx_ipu_resets[] = {
2365 { .name = "mmu_cache", .rst_shift = 2 },
2366};
2367
2368/* ipu master ports */
2369static struct omap_hwmod_ocp_if *omap44xx_ipu_masters[] = {
2370 &omap44xx_ipu__l3_main_2,
2371};
2372
2373/* l3_main_2 -> ipu */
2374static struct omap_hwmod_ocp_if omap44xx_l3_main_2__ipu = {
2375 .master = &omap44xx_l3_main_2_hwmod,
2376 .slave = &omap44xx_ipu_hwmod,
2377 .clk = "l3_div_ck",
2378 .user = OCP_USER_MPU | OCP_USER_SDMA,
2379};
2380
2381/* ipu slave ports */
2382static struct omap_hwmod_ocp_if *omap44xx_ipu_slaves[] = {
2383 &omap44xx_l3_main_2__ipu,
2384};
2385
2386/* Pseudo hwmod for reset control purpose only */
2387static struct omap_hwmod omap44xx_ipu_c0_hwmod = {
2388 .name = "ipu_c0",
2389 .class = &omap44xx_ipu_hwmod_class,
2390 .flags = HWMOD_INIT_NO_RESET,
2391 .rst_lines = omap44xx_ipu_c0_resets,
2392 .rst_lines_cnt = ARRAY_SIZE(omap44xx_ipu_c0_resets),
2393 .prcm = {
2394 .omap4 = {
2395 .rstctrl_reg = OMAP4430_RM_DUCATI_RSTCTRL,
2396 },
2397 },
2398 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2399};
2400
2401/* Pseudo hwmod for reset control purpose only */
2402static struct omap_hwmod omap44xx_ipu_c1_hwmod = {
2403 .name = "ipu_c1",
2404 .class = &omap44xx_ipu_hwmod_class,
2405 .flags = HWMOD_INIT_NO_RESET,
2406 .rst_lines = omap44xx_ipu_c1_resets,
2407 .rst_lines_cnt = ARRAY_SIZE(omap44xx_ipu_c1_resets),
2408 .prcm = {
2409 .omap4 = {
2410 .rstctrl_reg = OMAP4430_RM_DUCATI_RSTCTRL,
2411 },
2412 },
2413 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2414};
2415
2416static struct omap_hwmod omap44xx_ipu_hwmod = {
2417 .name = "ipu",
2418 .class = &omap44xx_ipu_hwmod_class,
2419 .mpu_irqs = omap44xx_ipu_irqs,
2420 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_ipu_irqs),
2421 .rst_lines = omap44xx_ipu_resets,
2422 .rst_lines_cnt = ARRAY_SIZE(omap44xx_ipu_resets),
2423 .main_clk = "ipu_fck",
2424 .prcm = {
2425 .omap4 = {
2426 .clkctrl_reg = OMAP4430_CM_DUCATI_DUCATI_CLKCTRL,
2427 .rstctrl_reg = OMAP4430_RM_DUCATI_RSTCTRL,
2428 },
2429 },
2430 .slaves = omap44xx_ipu_slaves,
2431 .slaves_cnt = ARRAY_SIZE(omap44xx_ipu_slaves),
2432 .masters = omap44xx_ipu_masters,
2433 .masters_cnt = ARRAY_SIZE(omap44xx_ipu_masters),
2434 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2435};
2436
2437/*
2438 * 'iss' class
2439 * external images sensor pixel data processor
2440 */
2441
2442static struct omap_hwmod_class_sysconfig omap44xx_iss_sysc = {
2443 .rev_offs = 0x0000,
2444 .sysc_offs = 0x0010,
2445 .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_RESET_STATUS |
2446 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
2447 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
2448 SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
2449 MSTANDBY_SMART),
2450 .sysc_fields = &omap_hwmod_sysc_type2,
2451};
2452
2453static struct omap_hwmod_class omap44xx_iss_hwmod_class = {
2454 .name = "iss",
2455 .sysc = &omap44xx_iss_sysc,
2456};
2457
2458/* iss */
2459static struct omap_hwmod_irq_info omap44xx_iss_irqs[] = {
2460 { .irq = 24 + OMAP44XX_IRQ_GIC_START },
2461};
2462
2463static struct omap_hwmod_dma_info omap44xx_iss_sdma_reqs[] = {
2464 { .name = "1", .dma_req = 8 + OMAP44XX_DMA_REQ_START },
2465 { .name = "2", .dma_req = 9 + OMAP44XX_DMA_REQ_START },
2466 { .name = "3", .dma_req = 11 + OMAP44XX_DMA_REQ_START },
2467 { .name = "4", .dma_req = 12 + OMAP44XX_DMA_REQ_START },
2468};
2469
2470/* iss master ports */
2471static struct omap_hwmod_ocp_if *omap44xx_iss_masters[] = {
2472 &omap44xx_iss__l3_main_2,
2473};
2474
2475static struct omap_hwmod_addr_space omap44xx_iss_addrs[] = {
2476 {
2477 .pa_start = 0x52000000,
2478 .pa_end = 0x520000ff,
2479 .flags = ADDR_TYPE_RT
2480 },
2481};
2482
2483/* l3_main_2 -> iss */
2484static struct omap_hwmod_ocp_if omap44xx_l3_main_2__iss = {
2485 .master = &omap44xx_l3_main_2_hwmod,
2486 .slave = &omap44xx_iss_hwmod,
2487 .clk = "l3_div_ck",
2488 .addr = omap44xx_iss_addrs,
2489 .addr_cnt = ARRAY_SIZE(omap44xx_iss_addrs),
2490 .user = OCP_USER_MPU | OCP_USER_SDMA,
2491};
2492
2493/* iss slave ports */
2494static struct omap_hwmod_ocp_if *omap44xx_iss_slaves[] = {
2495 &omap44xx_l3_main_2__iss,
2496};
2497
2498static struct omap_hwmod_opt_clk iss_opt_clks[] = {
2499 { .role = "ctrlclk", .clk = "iss_ctrlclk" },
2500};
2501
2502static struct omap_hwmod omap44xx_iss_hwmod = {
2503 .name = "iss",
2504 .class = &omap44xx_iss_hwmod_class,
2505 .mpu_irqs = omap44xx_iss_irqs,
2506 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_iss_irqs),
2507 .sdma_reqs = omap44xx_iss_sdma_reqs,
2508 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_iss_sdma_reqs),
2509 .main_clk = "iss_fck",
2510 .prcm = {
2511 .omap4 = {
2512 .clkctrl_reg = OMAP4430_CM_CAM_ISS_CLKCTRL,
2513 },
2514 },
2515 .opt_clks = iss_opt_clks,
2516 .opt_clks_cnt = ARRAY_SIZE(iss_opt_clks),
2517 .slaves = omap44xx_iss_slaves,
2518 .slaves_cnt = ARRAY_SIZE(omap44xx_iss_slaves),
2519 .masters = omap44xx_iss_masters,
2520 .masters_cnt = ARRAY_SIZE(omap44xx_iss_masters),
2521 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2522};
2523
2524/*
1329 * 'iva' class 2525 * 'iva' class
1330 * multi-standard video encoder/decoder hardware accelerator 2526 * multi-standard video encoder/decoder hardware accelerator
1331 */ 2527 */
@@ -1435,6 +2631,1084 @@ static struct omap_hwmod omap44xx_iva_hwmod = {
1435}; 2631};
1436 2632
1437/* 2633/*
2634 * 'kbd' class
2635 * keyboard controller
2636 */
2637
2638static struct omap_hwmod_class_sysconfig omap44xx_kbd_sysc = {
2639 .rev_offs = 0x0000,
2640 .sysc_offs = 0x0010,
2641 .syss_offs = 0x0014,
2642 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
2643 SYSC_HAS_EMUFREE | SYSC_HAS_ENAWAKEUP |
2644 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
2645 SYSS_HAS_RESET_STATUS),
2646 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
2647 .sysc_fields = &omap_hwmod_sysc_type1,
2648};
2649
2650static struct omap_hwmod_class omap44xx_kbd_hwmod_class = {
2651 .name = "kbd",
2652 .sysc = &omap44xx_kbd_sysc,
2653};
2654
2655/* kbd */
2656static struct omap_hwmod omap44xx_kbd_hwmod;
2657static struct omap_hwmod_irq_info omap44xx_kbd_irqs[] = {
2658 { .irq = 120 + OMAP44XX_IRQ_GIC_START },
2659};
2660
2661static struct omap_hwmod_addr_space omap44xx_kbd_addrs[] = {
2662 {
2663 .pa_start = 0x4a31c000,
2664 .pa_end = 0x4a31c07f,
2665 .flags = ADDR_TYPE_RT
2666 },
2667};
2668
2669/* l4_wkup -> kbd */
2670static struct omap_hwmod_ocp_if omap44xx_l4_wkup__kbd = {
2671 .master = &omap44xx_l4_wkup_hwmod,
2672 .slave = &omap44xx_kbd_hwmod,
2673 .clk = "l4_wkup_clk_mux_ck",
2674 .addr = omap44xx_kbd_addrs,
2675 .addr_cnt = ARRAY_SIZE(omap44xx_kbd_addrs),
2676 .user = OCP_USER_MPU | OCP_USER_SDMA,
2677};
2678
2679/* kbd slave ports */
2680static struct omap_hwmod_ocp_if *omap44xx_kbd_slaves[] = {
2681 &omap44xx_l4_wkup__kbd,
2682};
2683
2684static struct omap_hwmod omap44xx_kbd_hwmod = {
2685 .name = "kbd",
2686 .class = &omap44xx_kbd_hwmod_class,
2687 .mpu_irqs = omap44xx_kbd_irqs,
2688 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_kbd_irqs),
2689 .main_clk = "kbd_fck",
2690 .prcm = {
2691 .omap4 = {
2692 .clkctrl_reg = OMAP4430_CM_WKUP_KEYBOARD_CLKCTRL,
2693 },
2694 },
2695 .slaves = omap44xx_kbd_slaves,
2696 .slaves_cnt = ARRAY_SIZE(omap44xx_kbd_slaves),
2697 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2698};
2699
2700/*
2701 * 'mailbox' class
2702 * mailbox module allowing communication between the on-chip processors using a
2703 * queued mailbox-interrupt mechanism.
2704 */
2705
2706static struct omap_hwmod_class_sysconfig omap44xx_mailbox_sysc = {
2707 .rev_offs = 0x0000,
2708 .sysc_offs = 0x0010,
2709 .sysc_flags = (SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE |
2710 SYSC_HAS_SOFTRESET),
2711 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
2712 .sysc_fields = &omap_hwmod_sysc_type2,
2713};
2714
2715static struct omap_hwmod_class omap44xx_mailbox_hwmod_class = {
2716 .name = "mailbox",
2717 .sysc = &omap44xx_mailbox_sysc,
2718};
2719
2720/* mailbox */
2721static struct omap_hwmod omap44xx_mailbox_hwmod;
2722static struct omap_hwmod_irq_info omap44xx_mailbox_irqs[] = {
2723 { .irq = 26 + OMAP44XX_IRQ_GIC_START },
2724};
2725
2726static struct omap_hwmod_addr_space omap44xx_mailbox_addrs[] = {
2727 {
2728 .pa_start = 0x4a0f4000,
2729 .pa_end = 0x4a0f41ff,
2730 .flags = ADDR_TYPE_RT
2731 },
2732};
2733
2734/* l4_cfg -> mailbox */
2735static struct omap_hwmod_ocp_if omap44xx_l4_cfg__mailbox = {
2736 .master = &omap44xx_l4_cfg_hwmod,
2737 .slave = &omap44xx_mailbox_hwmod,
2738 .clk = "l4_div_ck",
2739 .addr = omap44xx_mailbox_addrs,
2740 .addr_cnt = ARRAY_SIZE(omap44xx_mailbox_addrs),
2741 .user = OCP_USER_MPU | OCP_USER_SDMA,
2742};
2743
2744/* mailbox slave ports */
2745static struct omap_hwmod_ocp_if *omap44xx_mailbox_slaves[] = {
2746 &omap44xx_l4_cfg__mailbox,
2747};
2748
2749static struct omap_hwmod omap44xx_mailbox_hwmod = {
2750 .name = "mailbox",
2751 .class = &omap44xx_mailbox_hwmod_class,
2752 .mpu_irqs = omap44xx_mailbox_irqs,
2753 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mailbox_irqs),
2754 .prcm = {
2755 .omap4 = {
2756 .clkctrl_reg = OMAP4430_CM_L4CFG_MAILBOX_CLKCTRL,
2757 },
2758 },
2759 .slaves = omap44xx_mailbox_slaves,
2760 .slaves_cnt = ARRAY_SIZE(omap44xx_mailbox_slaves),
2761 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2762};
2763
2764/*
2765 * 'mcbsp' class
2766 * multi channel buffered serial port controller
2767 */
2768
2769static struct omap_hwmod_class_sysconfig omap44xx_mcbsp_sysc = {
2770 .sysc_offs = 0x008c,
2771 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_ENAWAKEUP |
2772 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
2773 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
2774 .sysc_fields = &omap_hwmod_sysc_type1,
2775};
2776
2777static struct omap_hwmod_class omap44xx_mcbsp_hwmod_class = {
2778 .name = "mcbsp",
2779 .sysc = &omap44xx_mcbsp_sysc,
2780 .rev = MCBSP_CONFIG_TYPE4,
2781};
2782
2783/* mcbsp1 */
2784static struct omap_hwmod omap44xx_mcbsp1_hwmod;
2785static struct omap_hwmod_irq_info omap44xx_mcbsp1_irqs[] = {
2786 { .irq = 17 + OMAP44XX_IRQ_GIC_START },
2787};
2788
2789static struct omap_hwmod_dma_info omap44xx_mcbsp1_sdma_reqs[] = {
2790 { .name = "tx", .dma_req = 32 + OMAP44XX_DMA_REQ_START },
2791 { .name = "rx", .dma_req = 33 + OMAP44XX_DMA_REQ_START },
2792};
2793
2794static struct omap_hwmod_addr_space omap44xx_mcbsp1_addrs[] = {
2795 {
2796 .name = "mpu",
2797 .pa_start = 0x40122000,
2798 .pa_end = 0x401220ff,
2799 .flags = ADDR_TYPE_RT
2800 },
2801};
2802
2803/* l4_abe -> mcbsp1 */
2804static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp1 = {
2805 .master = &omap44xx_l4_abe_hwmod,
2806 .slave = &omap44xx_mcbsp1_hwmod,
2807 .clk = "ocp_abe_iclk",
2808 .addr = omap44xx_mcbsp1_addrs,
2809 .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp1_addrs),
2810 .user = OCP_USER_MPU,
2811};
2812
2813static struct omap_hwmod_addr_space omap44xx_mcbsp1_dma_addrs[] = {
2814 {
2815 .name = "dma",
2816 .pa_start = 0x49022000,
2817 .pa_end = 0x490220ff,
2818 .flags = ADDR_TYPE_RT
2819 },
2820};
2821
2822/* l4_abe -> mcbsp1 (dma) */
2823static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp1_dma = {
2824 .master = &omap44xx_l4_abe_hwmod,
2825 .slave = &omap44xx_mcbsp1_hwmod,
2826 .clk = "ocp_abe_iclk",
2827 .addr = omap44xx_mcbsp1_dma_addrs,
2828 .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp1_dma_addrs),
2829 .user = OCP_USER_SDMA,
2830};
2831
2832/* mcbsp1 slave ports */
2833static struct omap_hwmod_ocp_if *omap44xx_mcbsp1_slaves[] = {
2834 &omap44xx_l4_abe__mcbsp1,
2835 &omap44xx_l4_abe__mcbsp1_dma,
2836};
2837
2838static struct omap_hwmod omap44xx_mcbsp1_hwmod = {
2839 .name = "mcbsp1",
2840 .class = &omap44xx_mcbsp_hwmod_class,
2841 .mpu_irqs = omap44xx_mcbsp1_irqs,
2842 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcbsp1_irqs),
2843 .sdma_reqs = omap44xx_mcbsp1_sdma_reqs,
2844 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcbsp1_sdma_reqs),
2845 .main_clk = "mcbsp1_fck",
2846 .prcm = {
2847 .omap4 = {
2848 .clkctrl_reg = OMAP4430_CM1_ABE_MCBSP1_CLKCTRL,
2849 },
2850 },
2851 .slaves = omap44xx_mcbsp1_slaves,
2852 .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp1_slaves),
2853 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2854};
2855
2856/* mcbsp2 */
2857static struct omap_hwmod omap44xx_mcbsp2_hwmod;
2858static struct omap_hwmod_irq_info omap44xx_mcbsp2_irqs[] = {
2859 { .irq = 22 + OMAP44XX_IRQ_GIC_START },
2860};
2861
2862static struct omap_hwmod_dma_info omap44xx_mcbsp2_sdma_reqs[] = {
2863 { .name = "tx", .dma_req = 16 + OMAP44XX_DMA_REQ_START },
2864 { .name = "rx", .dma_req = 17 + OMAP44XX_DMA_REQ_START },
2865};
2866
2867static struct omap_hwmod_addr_space omap44xx_mcbsp2_addrs[] = {
2868 {
2869 .name = "mpu",
2870 .pa_start = 0x40124000,
2871 .pa_end = 0x401240ff,
2872 .flags = ADDR_TYPE_RT
2873 },
2874};
2875
2876/* l4_abe -> mcbsp2 */
2877static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp2 = {
2878 .master = &omap44xx_l4_abe_hwmod,
2879 .slave = &omap44xx_mcbsp2_hwmod,
2880 .clk = "ocp_abe_iclk",
2881 .addr = omap44xx_mcbsp2_addrs,
2882 .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp2_addrs),
2883 .user = OCP_USER_MPU,
2884};
2885
2886static struct omap_hwmod_addr_space omap44xx_mcbsp2_dma_addrs[] = {
2887 {
2888 .name = "dma",
2889 .pa_start = 0x49024000,
2890 .pa_end = 0x490240ff,
2891 .flags = ADDR_TYPE_RT
2892 },
2893};
2894
2895/* l4_abe -> mcbsp2 (dma) */
2896static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp2_dma = {
2897 .master = &omap44xx_l4_abe_hwmod,
2898 .slave = &omap44xx_mcbsp2_hwmod,
2899 .clk = "ocp_abe_iclk",
2900 .addr = omap44xx_mcbsp2_dma_addrs,
2901 .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp2_dma_addrs),
2902 .user = OCP_USER_SDMA,
2903};
2904
2905/* mcbsp2 slave ports */
2906static struct omap_hwmod_ocp_if *omap44xx_mcbsp2_slaves[] = {
2907 &omap44xx_l4_abe__mcbsp2,
2908 &omap44xx_l4_abe__mcbsp2_dma,
2909};
2910
2911static struct omap_hwmod omap44xx_mcbsp2_hwmod = {
2912 .name = "mcbsp2",
2913 .class = &omap44xx_mcbsp_hwmod_class,
2914 .mpu_irqs = omap44xx_mcbsp2_irqs,
2915 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcbsp2_irqs),
2916 .sdma_reqs = omap44xx_mcbsp2_sdma_reqs,
2917 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcbsp2_sdma_reqs),
2918 .main_clk = "mcbsp2_fck",
2919 .prcm = {
2920 .omap4 = {
2921 .clkctrl_reg = OMAP4430_CM1_ABE_MCBSP2_CLKCTRL,
2922 },
2923 },
2924 .slaves = omap44xx_mcbsp2_slaves,
2925 .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp2_slaves),
2926 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2927};
2928
2929/* mcbsp3 */
2930static struct omap_hwmod omap44xx_mcbsp3_hwmod;
2931static struct omap_hwmod_irq_info omap44xx_mcbsp3_irqs[] = {
2932 { .irq = 23 + OMAP44XX_IRQ_GIC_START },
2933};
2934
2935static struct omap_hwmod_dma_info omap44xx_mcbsp3_sdma_reqs[] = {
2936 { .name = "tx", .dma_req = 18 + OMAP44XX_DMA_REQ_START },
2937 { .name = "rx", .dma_req = 19 + OMAP44XX_DMA_REQ_START },
2938};
2939
2940static struct omap_hwmod_addr_space omap44xx_mcbsp3_addrs[] = {
2941 {
2942 .name = "mpu",
2943 .pa_start = 0x40126000,
2944 .pa_end = 0x401260ff,
2945 .flags = ADDR_TYPE_RT
2946 },
2947};
2948
2949/* l4_abe -> mcbsp3 */
2950static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp3 = {
2951 .master = &omap44xx_l4_abe_hwmod,
2952 .slave = &omap44xx_mcbsp3_hwmod,
2953 .clk = "ocp_abe_iclk",
2954 .addr = omap44xx_mcbsp3_addrs,
2955 .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp3_addrs),
2956 .user = OCP_USER_MPU,
2957};
2958
2959static struct omap_hwmod_addr_space omap44xx_mcbsp3_dma_addrs[] = {
2960 {
2961 .name = "dma",
2962 .pa_start = 0x49026000,
2963 .pa_end = 0x490260ff,
2964 .flags = ADDR_TYPE_RT
2965 },
2966};
2967
2968/* l4_abe -> mcbsp3 (dma) */
2969static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp3_dma = {
2970 .master = &omap44xx_l4_abe_hwmod,
2971 .slave = &omap44xx_mcbsp3_hwmod,
2972 .clk = "ocp_abe_iclk",
2973 .addr = omap44xx_mcbsp3_dma_addrs,
2974 .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp3_dma_addrs),
2975 .user = OCP_USER_SDMA,
2976};
2977
2978/* mcbsp3 slave ports */
2979static struct omap_hwmod_ocp_if *omap44xx_mcbsp3_slaves[] = {
2980 &omap44xx_l4_abe__mcbsp3,
2981 &omap44xx_l4_abe__mcbsp3_dma,
2982};
2983
2984static struct omap_hwmod omap44xx_mcbsp3_hwmod = {
2985 .name = "mcbsp3",
2986 .class = &omap44xx_mcbsp_hwmod_class,
2987 .mpu_irqs = omap44xx_mcbsp3_irqs,
2988 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcbsp3_irqs),
2989 .sdma_reqs = omap44xx_mcbsp3_sdma_reqs,
2990 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcbsp3_sdma_reqs),
2991 .main_clk = "mcbsp3_fck",
2992 .prcm = {
2993 .omap4 = {
2994 .clkctrl_reg = OMAP4430_CM1_ABE_MCBSP3_CLKCTRL,
2995 },
2996 },
2997 .slaves = omap44xx_mcbsp3_slaves,
2998 .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp3_slaves),
2999 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3000};
3001
3002/* mcbsp4 */
3003static struct omap_hwmod omap44xx_mcbsp4_hwmod;
3004static struct omap_hwmod_irq_info omap44xx_mcbsp4_irqs[] = {
3005 { .irq = 16 + OMAP44XX_IRQ_GIC_START },
3006};
3007
3008static struct omap_hwmod_dma_info omap44xx_mcbsp4_sdma_reqs[] = {
3009 { .name = "tx", .dma_req = 30 + OMAP44XX_DMA_REQ_START },
3010 { .name = "rx", .dma_req = 31 + OMAP44XX_DMA_REQ_START },
3011};
3012
3013static struct omap_hwmod_addr_space omap44xx_mcbsp4_addrs[] = {
3014 {
3015 .pa_start = 0x48096000,
3016 .pa_end = 0x480960ff,
3017 .flags = ADDR_TYPE_RT
3018 },
3019};
3020
3021/* l4_per -> mcbsp4 */
3022static struct omap_hwmod_ocp_if omap44xx_l4_per__mcbsp4 = {
3023 .master = &omap44xx_l4_per_hwmod,
3024 .slave = &omap44xx_mcbsp4_hwmod,
3025 .clk = "l4_div_ck",
3026 .addr = omap44xx_mcbsp4_addrs,
3027 .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp4_addrs),
3028 .user = OCP_USER_MPU | OCP_USER_SDMA,
3029};
3030
3031/* mcbsp4 slave ports */
3032static struct omap_hwmod_ocp_if *omap44xx_mcbsp4_slaves[] = {
3033 &omap44xx_l4_per__mcbsp4,
3034};
3035
3036static struct omap_hwmod omap44xx_mcbsp4_hwmod = {
3037 .name = "mcbsp4",
3038 .class = &omap44xx_mcbsp_hwmod_class,
3039 .mpu_irqs = omap44xx_mcbsp4_irqs,
3040 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcbsp4_irqs),
3041 .sdma_reqs = omap44xx_mcbsp4_sdma_reqs,
3042 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcbsp4_sdma_reqs),
3043 .main_clk = "mcbsp4_fck",
3044 .prcm = {
3045 .omap4 = {
3046 .clkctrl_reg = OMAP4430_CM_L4PER_MCBSP4_CLKCTRL,
3047 },
3048 },
3049 .slaves = omap44xx_mcbsp4_slaves,
3050 .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp4_slaves),
3051 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3052};
3053
3054/*
3055 * 'mcpdm' class
3056 * multi channel pdm controller (proprietary interface with phoenix power
3057 * ic)
3058 */
3059
3060static struct omap_hwmod_class_sysconfig omap44xx_mcpdm_sysc = {
3061 .rev_offs = 0x0000,
3062 .sysc_offs = 0x0010,
3063 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_RESET_STATUS |
3064 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
3065 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
3066 SIDLE_SMART_WKUP),
3067 .sysc_fields = &omap_hwmod_sysc_type2,
3068};
3069
3070static struct omap_hwmod_class omap44xx_mcpdm_hwmod_class = {
3071 .name = "mcpdm",
3072 .sysc = &omap44xx_mcpdm_sysc,
3073};
3074
3075/* mcpdm */
3076static struct omap_hwmod omap44xx_mcpdm_hwmod;
3077static struct omap_hwmod_irq_info omap44xx_mcpdm_irqs[] = {
3078 { .irq = 112 + OMAP44XX_IRQ_GIC_START },
3079};
3080
3081static struct omap_hwmod_dma_info omap44xx_mcpdm_sdma_reqs[] = {
3082 { .name = "up_link", .dma_req = 64 + OMAP44XX_DMA_REQ_START },
3083 { .name = "dn_link", .dma_req = 65 + OMAP44XX_DMA_REQ_START },
3084};
3085
3086static struct omap_hwmod_addr_space omap44xx_mcpdm_addrs[] = {
3087 {
3088 .pa_start = 0x40132000,
3089 .pa_end = 0x4013207f,
3090 .flags = ADDR_TYPE_RT
3091 },
3092};
3093
3094/* l4_abe -> mcpdm */
3095static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcpdm = {
3096 .master = &omap44xx_l4_abe_hwmod,
3097 .slave = &omap44xx_mcpdm_hwmod,
3098 .clk = "ocp_abe_iclk",
3099 .addr = omap44xx_mcpdm_addrs,
3100 .addr_cnt = ARRAY_SIZE(omap44xx_mcpdm_addrs),
3101 .user = OCP_USER_MPU,
3102};
3103
3104static struct omap_hwmod_addr_space omap44xx_mcpdm_dma_addrs[] = {
3105 {
3106 .pa_start = 0x49032000,
3107 .pa_end = 0x4903207f,
3108 .flags = ADDR_TYPE_RT
3109 },
3110};
3111
3112/* l4_abe -> mcpdm (dma) */
3113static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcpdm_dma = {
3114 .master = &omap44xx_l4_abe_hwmod,
3115 .slave = &omap44xx_mcpdm_hwmod,
3116 .clk = "ocp_abe_iclk",
3117 .addr = omap44xx_mcpdm_dma_addrs,
3118 .addr_cnt = ARRAY_SIZE(omap44xx_mcpdm_dma_addrs),
3119 .user = OCP_USER_SDMA,
3120};
3121
3122/* mcpdm slave ports */
3123static struct omap_hwmod_ocp_if *omap44xx_mcpdm_slaves[] = {
3124 &omap44xx_l4_abe__mcpdm,
3125 &omap44xx_l4_abe__mcpdm_dma,
3126};
3127
3128static struct omap_hwmod omap44xx_mcpdm_hwmod = {
3129 .name = "mcpdm",
3130 .class = &omap44xx_mcpdm_hwmod_class,
3131 .mpu_irqs = omap44xx_mcpdm_irqs,
3132 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcpdm_irqs),
3133 .sdma_reqs = omap44xx_mcpdm_sdma_reqs,
3134 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcpdm_sdma_reqs),
3135 .main_clk = "mcpdm_fck",
3136 .prcm = {
3137 .omap4 = {
3138 .clkctrl_reg = OMAP4430_CM1_ABE_PDM_CLKCTRL,
3139 },
3140 },
3141 .slaves = omap44xx_mcpdm_slaves,
3142 .slaves_cnt = ARRAY_SIZE(omap44xx_mcpdm_slaves),
3143 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3144};
3145
3146/*
3147 * 'mcspi' class
3148 * multichannel serial port interface (mcspi) / master/slave synchronous serial
3149 * bus
3150 */
3151
3152static struct omap_hwmod_class_sysconfig omap44xx_mcspi_sysc = {
3153 .rev_offs = 0x0000,
3154 .sysc_offs = 0x0010,
3155 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_RESET_STATUS |
3156 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
3157 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
3158 SIDLE_SMART_WKUP),
3159 .sysc_fields = &omap_hwmod_sysc_type2,
3160};
3161
3162static struct omap_hwmod_class omap44xx_mcspi_hwmod_class = {
3163 .name = "mcspi",
3164 .sysc = &omap44xx_mcspi_sysc,
3165 .rev = OMAP4_MCSPI_REV,
3166};
3167
3168/* mcspi1 */
3169static struct omap_hwmod omap44xx_mcspi1_hwmod;
3170static struct omap_hwmod_irq_info omap44xx_mcspi1_irqs[] = {
3171 { .irq = 65 + OMAP44XX_IRQ_GIC_START },
3172};
3173
3174static struct omap_hwmod_dma_info omap44xx_mcspi1_sdma_reqs[] = {
3175 { .name = "tx0", .dma_req = 34 + OMAP44XX_DMA_REQ_START },
3176 { .name = "rx0", .dma_req = 35 + OMAP44XX_DMA_REQ_START },
3177 { .name = "tx1", .dma_req = 36 + OMAP44XX_DMA_REQ_START },
3178 { .name = "rx1", .dma_req = 37 + OMAP44XX_DMA_REQ_START },
3179 { .name = "tx2", .dma_req = 38 + OMAP44XX_DMA_REQ_START },
3180 { .name = "rx2", .dma_req = 39 + OMAP44XX_DMA_REQ_START },
3181 { .name = "tx3", .dma_req = 40 + OMAP44XX_DMA_REQ_START },
3182 { .name = "rx3", .dma_req = 41 + OMAP44XX_DMA_REQ_START },
3183};
3184
3185static struct omap_hwmod_addr_space omap44xx_mcspi1_addrs[] = {
3186 {
3187 .pa_start = 0x48098000,
3188 .pa_end = 0x480981ff,
3189 .flags = ADDR_TYPE_RT
3190 },
3191};
3192
3193/* l4_per -> mcspi1 */
3194static struct omap_hwmod_ocp_if omap44xx_l4_per__mcspi1 = {
3195 .master = &omap44xx_l4_per_hwmod,
3196 .slave = &omap44xx_mcspi1_hwmod,
3197 .clk = "l4_div_ck",
3198 .addr = omap44xx_mcspi1_addrs,
3199 .addr_cnt = ARRAY_SIZE(omap44xx_mcspi1_addrs),
3200 .user = OCP_USER_MPU | OCP_USER_SDMA,
3201};
3202
3203/* mcspi1 slave ports */
3204static struct omap_hwmod_ocp_if *omap44xx_mcspi1_slaves[] = {
3205 &omap44xx_l4_per__mcspi1,
3206};
3207
3208/* mcspi1 dev_attr */
3209static struct omap2_mcspi_dev_attr mcspi1_dev_attr = {
3210 .num_chipselect = 4,
3211};
3212
3213static struct omap_hwmod omap44xx_mcspi1_hwmod = {
3214 .name = "mcspi1",
3215 .class = &omap44xx_mcspi_hwmod_class,
3216 .mpu_irqs = omap44xx_mcspi1_irqs,
3217 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcspi1_irqs),
3218 .sdma_reqs = omap44xx_mcspi1_sdma_reqs,
3219 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcspi1_sdma_reqs),
3220 .main_clk = "mcspi1_fck",
3221 .prcm = {
3222 .omap4 = {
3223 .clkctrl_reg = OMAP4430_CM_L4PER_MCSPI1_CLKCTRL,
3224 },
3225 },
3226 .dev_attr = &mcspi1_dev_attr,
3227 .slaves = omap44xx_mcspi1_slaves,
3228 .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi1_slaves),
3229 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3230};
3231
3232/* mcspi2 */
3233static struct omap_hwmod omap44xx_mcspi2_hwmod;
3234static struct omap_hwmod_irq_info omap44xx_mcspi2_irqs[] = {
3235 { .irq = 66 + OMAP44XX_IRQ_GIC_START },
3236};
3237
3238static struct omap_hwmod_dma_info omap44xx_mcspi2_sdma_reqs[] = {
3239 { .name = "tx0", .dma_req = 42 + OMAP44XX_DMA_REQ_START },
3240 { .name = "rx0", .dma_req = 43 + OMAP44XX_DMA_REQ_START },
3241 { .name = "tx1", .dma_req = 44 + OMAP44XX_DMA_REQ_START },
3242 { .name = "rx1", .dma_req = 45 + OMAP44XX_DMA_REQ_START },
3243};
3244
3245static struct omap_hwmod_addr_space omap44xx_mcspi2_addrs[] = {
3246 {
3247 .pa_start = 0x4809a000,
3248 .pa_end = 0x4809a1ff,
3249 .flags = ADDR_TYPE_RT
3250 },
3251};
3252
3253/* l4_per -> mcspi2 */
3254static struct omap_hwmod_ocp_if omap44xx_l4_per__mcspi2 = {
3255 .master = &omap44xx_l4_per_hwmod,
3256 .slave = &omap44xx_mcspi2_hwmod,
3257 .clk = "l4_div_ck",
3258 .addr = omap44xx_mcspi2_addrs,
3259 .addr_cnt = ARRAY_SIZE(omap44xx_mcspi2_addrs),
3260 .user = OCP_USER_MPU | OCP_USER_SDMA,
3261};
3262
3263/* mcspi2 slave ports */
3264static struct omap_hwmod_ocp_if *omap44xx_mcspi2_slaves[] = {
3265 &omap44xx_l4_per__mcspi2,
3266};
3267
3268/* mcspi2 dev_attr */
3269static struct omap2_mcspi_dev_attr mcspi2_dev_attr = {
3270 .num_chipselect = 2,
3271};
3272
3273static struct omap_hwmod omap44xx_mcspi2_hwmod = {
3274 .name = "mcspi2",
3275 .class = &omap44xx_mcspi_hwmod_class,
3276 .mpu_irqs = omap44xx_mcspi2_irqs,
3277 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcspi2_irqs),
3278 .sdma_reqs = omap44xx_mcspi2_sdma_reqs,
3279 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcspi2_sdma_reqs),
3280 .main_clk = "mcspi2_fck",
3281 .prcm = {
3282 .omap4 = {
3283 .clkctrl_reg = OMAP4430_CM_L4PER_MCSPI2_CLKCTRL,
3284 },
3285 },
3286 .dev_attr = &mcspi2_dev_attr,
3287 .slaves = omap44xx_mcspi2_slaves,
3288 .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi2_slaves),
3289 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3290};
3291
3292/* mcspi3 */
3293static struct omap_hwmod omap44xx_mcspi3_hwmod;
3294static struct omap_hwmod_irq_info omap44xx_mcspi3_irqs[] = {
3295 { .irq = 91 + OMAP44XX_IRQ_GIC_START },
3296};
3297
3298static struct omap_hwmod_dma_info omap44xx_mcspi3_sdma_reqs[] = {
3299 { .name = "tx0", .dma_req = 14 + OMAP44XX_DMA_REQ_START },
3300 { .name = "rx0", .dma_req = 15 + OMAP44XX_DMA_REQ_START },
3301 { .name = "tx1", .dma_req = 22 + OMAP44XX_DMA_REQ_START },
3302 { .name = "rx1", .dma_req = 23 + OMAP44XX_DMA_REQ_START },
3303};
3304
3305static struct omap_hwmod_addr_space omap44xx_mcspi3_addrs[] = {
3306 {
3307 .pa_start = 0x480b8000,
3308 .pa_end = 0x480b81ff,
3309 .flags = ADDR_TYPE_RT
3310 },
3311};
3312
3313/* l4_per -> mcspi3 */
3314static struct omap_hwmod_ocp_if omap44xx_l4_per__mcspi3 = {
3315 .master = &omap44xx_l4_per_hwmod,
3316 .slave = &omap44xx_mcspi3_hwmod,
3317 .clk = "l4_div_ck",
3318 .addr = omap44xx_mcspi3_addrs,
3319 .addr_cnt = ARRAY_SIZE(omap44xx_mcspi3_addrs),
3320 .user = OCP_USER_MPU | OCP_USER_SDMA,
3321};
3322
3323/* mcspi3 slave ports */
3324static struct omap_hwmod_ocp_if *omap44xx_mcspi3_slaves[] = {
3325 &omap44xx_l4_per__mcspi3,
3326};
3327
3328/* mcspi3 dev_attr */
3329static struct omap2_mcspi_dev_attr mcspi3_dev_attr = {
3330 .num_chipselect = 2,
3331};
3332
3333static struct omap_hwmod omap44xx_mcspi3_hwmod = {
3334 .name = "mcspi3",
3335 .class = &omap44xx_mcspi_hwmod_class,
3336 .mpu_irqs = omap44xx_mcspi3_irqs,
3337 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcspi3_irqs),
3338 .sdma_reqs = omap44xx_mcspi3_sdma_reqs,
3339 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcspi3_sdma_reqs),
3340 .main_clk = "mcspi3_fck",
3341 .prcm = {
3342 .omap4 = {
3343 .clkctrl_reg = OMAP4430_CM_L4PER_MCSPI3_CLKCTRL,
3344 },
3345 },
3346 .dev_attr = &mcspi3_dev_attr,
3347 .slaves = omap44xx_mcspi3_slaves,
3348 .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi3_slaves),
3349 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3350};
3351
3352/* mcspi4 */
3353static struct omap_hwmod omap44xx_mcspi4_hwmod;
3354static struct omap_hwmod_irq_info omap44xx_mcspi4_irqs[] = {
3355 { .irq = 48 + OMAP44XX_IRQ_GIC_START },
3356};
3357
3358static struct omap_hwmod_dma_info omap44xx_mcspi4_sdma_reqs[] = {
3359 { .name = "tx0", .dma_req = 69 + OMAP44XX_DMA_REQ_START },
3360 { .name = "rx0", .dma_req = 70 + OMAP44XX_DMA_REQ_START },
3361};
3362
3363static struct omap_hwmod_addr_space omap44xx_mcspi4_addrs[] = {
3364 {
3365 .pa_start = 0x480ba000,
3366 .pa_end = 0x480ba1ff,
3367 .flags = ADDR_TYPE_RT
3368 },
3369};
3370
3371/* l4_per -> mcspi4 */
3372static struct omap_hwmod_ocp_if omap44xx_l4_per__mcspi4 = {
3373 .master = &omap44xx_l4_per_hwmod,
3374 .slave = &omap44xx_mcspi4_hwmod,
3375 .clk = "l4_div_ck",
3376 .addr = omap44xx_mcspi4_addrs,
3377 .addr_cnt = ARRAY_SIZE(omap44xx_mcspi4_addrs),
3378 .user = OCP_USER_MPU | OCP_USER_SDMA,
3379};
3380
3381/* mcspi4 slave ports */
3382static struct omap_hwmod_ocp_if *omap44xx_mcspi4_slaves[] = {
3383 &omap44xx_l4_per__mcspi4,
3384};
3385
3386/* mcspi4 dev_attr */
3387static struct omap2_mcspi_dev_attr mcspi4_dev_attr = {
3388 .num_chipselect = 1,
3389};
3390
3391static struct omap_hwmod omap44xx_mcspi4_hwmod = {
3392 .name = "mcspi4",
3393 .class = &omap44xx_mcspi_hwmod_class,
3394 .mpu_irqs = omap44xx_mcspi4_irqs,
3395 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcspi4_irqs),
3396 .sdma_reqs = omap44xx_mcspi4_sdma_reqs,
3397 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcspi4_sdma_reqs),
3398 .main_clk = "mcspi4_fck",
3399 .prcm = {
3400 .omap4 = {
3401 .clkctrl_reg = OMAP4430_CM_L4PER_MCSPI4_CLKCTRL,
3402 },
3403 },
3404 .dev_attr = &mcspi4_dev_attr,
3405 .slaves = omap44xx_mcspi4_slaves,
3406 .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi4_slaves),
3407 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3408};
3409
3410/*
3411 * 'mmc' class
3412 * multimedia card high-speed/sd/sdio (mmc/sd/sdio) host controller
3413 */
3414
3415static struct omap_hwmod_class_sysconfig omap44xx_mmc_sysc = {
3416 .rev_offs = 0x0000,
3417 .sysc_offs = 0x0010,
3418 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_MIDLEMODE |
3419 SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE |
3420 SYSC_HAS_SOFTRESET),
3421 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
3422 SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
3423 MSTANDBY_SMART),
3424 .sysc_fields = &omap_hwmod_sysc_type2,
3425};
3426
3427static struct omap_hwmod_class omap44xx_mmc_hwmod_class = {
3428 .name = "mmc",
3429 .sysc = &omap44xx_mmc_sysc,
3430};
3431
3432/* mmc1 */
3433
3434static struct omap_hwmod_irq_info omap44xx_mmc1_irqs[] = {
3435 { .irq = 83 + OMAP44XX_IRQ_GIC_START },
3436};
3437
3438static struct omap_hwmod_dma_info omap44xx_mmc1_sdma_reqs[] = {
3439 { .name = "tx", .dma_req = 60 + OMAP44XX_DMA_REQ_START },
3440 { .name = "rx", .dma_req = 61 + OMAP44XX_DMA_REQ_START },
3441};
3442
3443/* mmc1 master ports */
3444static struct omap_hwmod_ocp_if *omap44xx_mmc1_masters[] = {
3445 &omap44xx_mmc1__l3_main_1,
3446};
3447
3448static struct omap_hwmod_addr_space omap44xx_mmc1_addrs[] = {
3449 {
3450 .pa_start = 0x4809c000,
3451 .pa_end = 0x4809c3ff,
3452 .flags = ADDR_TYPE_RT
3453 },
3454};
3455
3456/* l4_per -> mmc1 */
3457static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc1 = {
3458 .master = &omap44xx_l4_per_hwmod,
3459 .slave = &omap44xx_mmc1_hwmod,
3460 .clk = "l4_div_ck",
3461 .addr = omap44xx_mmc1_addrs,
3462 .addr_cnt = ARRAY_SIZE(omap44xx_mmc1_addrs),
3463 .user = OCP_USER_MPU | OCP_USER_SDMA,
3464};
3465
3466/* mmc1 slave ports */
3467static struct omap_hwmod_ocp_if *omap44xx_mmc1_slaves[] = {
3468 &omap44xx_l4_per__mmc1,
3469};
3470
3471/* mmc1 dev_attr */
3472static struct omap_mmc_dev_attr mmc1_dev_attr = {
3473 .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
3474};
3475
3476static struct omap_hwmod omap44xx_mmc1_hwmod = {
3477 .name = "mmc1",
3478 .class = &omap44xx_mmc_hwmod_class,
3479 .mpu_irqs = omap44xx_mmc1_irqs,
3480 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mmc1_irqs),
3481 .sdma_reqs = omap44xx_mmc1_sdma_reqs,
3482 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mmc1_sdma_reqs),
3483 .main_clk = "mmc1_fck",
3484 .prcm = {
3485 .omap4 = {
3486 .clkctrl_reg = OMAP4430_CM_L3INIT_MMC1_CLKCTRL,
3487 },
3488 },
3489 .dev_attr = &mmc1_dev_attr,
3490 .slaves = omap44xx_mmc1_slaves,
3491 .slaves_cnt = ARRAY_SIZE(omap44xx_mmc1_slaves),
3492 .masters = omap44xx_mmc1_masters,
3493 .masters_cnt = ARRAY_SIZE(omap44xx_mmc1_masters),
3494 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3495};
3496
3497/* mmc2 */
3498static struct omap_hwmod_irq_info omap44xx_mmc2_irqs[] = {
3499 { .irq = 86 + OMAP44XX_IRQ_GIC_START },
3500};
3501
3502static struct omap_hwmod_dma_info omap44xx_mmc2_sdma_reqs[] = {
3503 { .name = "tx", .dma_req = 46 + OMAP44XX_DMA_REQ_START },
3504 { .name = "rx", .dma_req = 47 + OMAP44XX_DMA_REQ_START },
3505};
3506
3507/* mmc2 master ports */
3508static struct omap_hwmod_ocp_if *omap44xx_mmc2_masters[] = {
3509 &omap44xx_mmc2__l3_main_1,
3510};
3511
3512static struct omap_hwmod_addr_space omap44xx_mmc2_addrs[] = {
3513 {
3514 .pa_start = 0x480b4000,
3515 .pa_end = 0x480b43ff,
3516 .flags = ADDR_TYPE_RT
3517 },
3518};
3519
3520/* l4_per -> mmc2 */
3521static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc2 = {
3522 .master = &omap44xx_l4_per_hwmod,
3523 .slave = &omap44xx_mmc2_hwmod,
3524 .clk = "l4_div_ck",
3525 .addr = omap44xx_mmc2_addrs,
3526 .addr_cnt = ARRAY_SIZE(omap44xx_mmc2_addrs),
3527 .user = OCP_USER_MPU | OCP_USER_SDMA,
3528};
3529
3530/* mmc2 slave ports */
3531static struct omap_hwmod_ocp_if *omap44xx_mmc2_slaves[] = {
3532 &omap44xx_l4_per__mmc2,
3533};
3534
3535static struct omap_hwmod omap44xx_mmc2_hwmod = {
3536 .name = "mmc2",
3537 .class = &omap44xx_mmc_hwmod_class,
3538 .mpu_irqs = omap44xx_mmc2_irqs,
3539 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mmc2_irqs),
3540 .sdma_reqs = omap44xx_mmc2_sdma_reqs,
3541 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mmc2_sdma_reqs),
3542 .main_clk = "mmc2_fck",
3543 .prcm = {
3544 .omap4 = {
3545 .clkctrl_reg = OMAP4430_CM_L3INIT_MMC2_CLKCTRL,
3546 },
3547 },
3548 .slaves = omap44xx_mmc2_slaves,
3549 .slaves_cnt = ARRAY_SIZE(omap44xx_mmc2_slaves),
3550 .masters = omap44xx_mmc2_masters,
3551 .masters_cnt = ARRAY_SIZE(omap44xx_mmc2_masters),
3552 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3553};
3554
3555/* mmc3 */
3556static struct omap_hwmod omap44xx_mmc3_hwmod;
3557static struct omap_hwmod_irq_info omap44xx_mmc3_irqs[] = {
3558 { .irq = 94 + OMAP44XX_IRQ_GIC_START },
3559};
3560
3561static struct omap_hwmod_dma_info omap44xx_mmc3_sdma_reqs[] = {
3562 { .name = "tx", .dma_req = 76 + OMAP44XX_DMA_REQ_START },
3563 { .name = "rx", .dma_req = 77 + OMAP44XX_DMA_REQ_START },
3564};
3565
3566static struct omap_hwmod_addr_space omap44xx_mmc3_addrs[] = {
3567 {
3568 .pa_start = 0x480ad000,
3569 .pa_end = 0x480ad3ff,
3570 .flags = ADDR_TYPE_RT
3571 },
3572};
3573
3574/* l4_per -> mmc3 */
3575static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc3 = {
3576 .master = &omap44xx_l4_per_hwmod,
3577 .slave = &omap44xx_mmc3_hwmod,
3578 .clk = "l4_div_ck",
3579 .addr = omap44xx_mmc3_addrs,
3580 .addr_cnt = ARRAY_SIZE(omap44xx_mmc3_addrs),
3581 .user = OCP_USER_MPU | OCP_USER_SDMA,
3582};
3583
3584/* mmc3 slave ports */
3585static struct omap_hwmod_ocp_if *omap44xx_mmc3_slaves[] = {
3586 &omap44xx_l4_per__mmc3,
3587};
3588
3589static struct omap_hwmod omap44xx_mmc3_hwmod = {
3590 .name = "mmc3",
3591 .class = &omap44xx_mmc_hwmod_class,
3592 .mpu_irqs = omap44xx_mmc3_irqs,
3593 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mmc3_irqs),
3594 .sdma_reqs = omap44xx_mmc3_sdma_reqs,
3595 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mmc3_sdma_reqs),
3596 .main_clk = "mmc3_fck",
3597 .prcm = {
3598 .omap4 = {
3599 .clkctrl_reg = OMAP4430_CM_L4PER_MMCSD3_CLKCTRL,
3600 },
3601 },
3602 .slaves = omap44xx_mmc3_slaves,
3603 .slaves_cnt = ARRAY_SIZE(omap44xx_mmc3_slaves),
3604 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3605};
3606
3607/* mmc4 */
3608static struct omap_hwmod omap44xx_mmc4_hwmod;
3609static struct omap_hwmod_irq_info omap44xx_mmc4_irqs[] = {
3610 { .irq = 96 + OMAP44XX_IRQ_GIC_START },
3611};
3612
3613static struct omap_hwmod_dma_info omap44xx_mmc4_sdma_reqs[] = {
3614 { .name = "tx", .dma_req = 56 + OMAP44XX_DMA_REQ_START },
3615 { .name = "rx", .dma_req = 57 + OMAP44XX_DMA_REQ_START },
3616};
3617
3618static struct omap_hwmod_addr_space omap44xx_mmc4_addrs[] = {
3619 {
3620 .pa_start = 0x480d1000,
3621 .pa_end = 0x480d13ff,
3622 .flags = ADDR_TYPE_RT
3623 },
3624};
3625
3626/* l4_per -> mmc4 */
3627static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc4 = {
3628 .master = &omap44xx_l4_per_hwmod,
3629 .slave = &omap44xx_mmc4_hwmod,
3630 .clk = "l4_div_ck",
3631 .addr = omap44xx_mmc4_addrs,
3632 .addr_cnt = ARRAY_SIZE(omap44xx_mmc4_addrs),
3633 .user = OCP_USER_MPU | OCP_USER_SDMA,
3634};
3635
3636/* mmc4 slave ports */
3637static struct omap_hwmod_ocp_if *omap44xx_mmc4_slaves[] = {
3638 &omap44xx_l4_per__mmc4,
3639};
3640
3641static struct omap_hwmod omap44xx_mmc4_hwmod = {
3642 .name = "mmc4",
3643 .class = &omap44xx_mmc_hwmod_class,
3644 .mpu_irqs = omap44xx_mmc4_irqs,
3645 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mmc4_irqs),
3646 .sdma_reqs = omap44xx_mmc4_sdma_reqs,
3647 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mmc4_sdma_reqs),
3648 .main_clk = "mmc4_fck",
3649 .prcm = {
3650 .omap4 = {
3651 .clkctrl_reg = OMAP4430_CM_L4PER_MMCSD4_CLKCTRL,
3652 },
3653 },
3654 .slaves = omap44xx_mmc4_slaves,
3655 .slaves_cnt = ARRAY_SIZE(omap44xx_mmc4_slaves),
3656 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3657};
3658
3659/* mmc5 */
3660static struct omap_hwmod omap44xx_mmc5_hwmod;
3661static struct omap_hwmod_irq_info omap44xx_mmc5_irqs[] = {
3662 { .irq = 59 + OMAP44XX_IRQ_GIC_START },
3663};
3664
3665static struct omap_hwmod_dma_info omap44xx_mmc5_sdma_reqs[] = {
3666 { .name = "tx", .dma_req = 58 + OMAP44XX_DMA_REQ_START },
3667 { .name = "rx", .dma_req = 59 + OMAP44XX_DMA_REQ_START },
3668};
3669
3670static struct omap_hwmod_addr_space omap44xx_mmc5_addrs[] = {
3671 {
3672 .pa_start = 0x480d5000,
3673 .pa_end = 0x480d53ff,
3674 .flags = ADDR_TYPE_RT
3675 },
3676};
3677
3678/* l4_per -> mmc5 */
3679static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc5 = {
3680 .master = &omap44xx_l4_per_hwmod,
3681 .slave = &omap44xx_mmc5_hwmod,
3682 .clk = "l4_div_ck",
3683 .addr = omap44xx_mmc5_addrs,
3684 .addr_cnt = ARRAY_SIZE(omap44xx_mmc5_addrs),
3685 .user = OCP_USER_MPU | OCP_USER_SDMA,
3686};
3687
3688/* mmc5 slave ports */
3689static struct omap_hwmod_ocp_if *omap44xx_mmc5_slaves[] = {
3690 &omap44xx_l4_per__mmc5,
3691};
3692
3693static struct omap_hwmod omap44xx_mmc5_hwmod = {
3694 .name = "mmc5",
3695 .class = &omap44xx_mmc_hwmod_class,
3696 .mpu_irqs = omap44xx_mmc5_irqs,
3697 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mmc5_irqs),
3698 .sdma_reqs = omap44xx_mmc5_sdma_reqs,
3699 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mmc5_sdma_reqs),
3700 .main_clk = "mmc5_fck",
3701 .prcm = {
3702 .omap4 = {
3703 .clkctrl_reg = OMAP4430_CM_L4PER_MMCSD5_CLKCTRL,
3704 },
3705 },
3706 .slaves = omap44xx_mmc5_slaves,
3707 .slaves_cnt = ARRAY_SIZE(omap44xx_mmc5_slaves),
3708 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3709};
3710
3711/*
1438 * 'mpu' class 3712 * 'mpu' class
1439 * mpu sub-system 3713 * mpu sub-system
1440 */ 3714 */
@@ -1639,6 +3913,676 @@ static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = {
1639}; 3913};
1640 3914
1641/* 3915/*
3916 * 'spinlock' class
3917 * spinlock provides hardware assistance for synchronizing the processes
3918 * running on multiple processors
3919 */
3920
3921static struct omap_hwmod_class_sysconfig omap44xx_spinlock_sysc = {
3922 .rev_offs = 0x0000,
3923 .sysc_offs = 0x0010,
3924 .syss_offs = 0x0014,
3925 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
3926 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
3927 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
3928 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
3929 SIDLE_SMART_WKUP),
3930 .sysc_fields = &omap_hwmod_sysc_type1,
3931};
3932
3933static struct omap_hwmod_class omap44xx_spinlock_hwmod_class = {
3934 .name = "spinlock",
3935 .sysc = &omap44xx_spinlock_sysc,
3936};
3937
3938/* spinlock */
3939static struct omap_hwmod omap44xx_spinlock_hwmod;
3940static struct omap_hwmod_addr_space omap44xx_spinlock_addrs[] = {
3941 {
3942 .pa_start = 0x4a0f6000,
3943 .pa_end = 0x4a0f6fff,
3944 .flags = ADDR_TYPE_RT
3945 },
3946};
3947
3948/* l4_cfg -> spinlock */
3949static struct omap_hwmod_ocp_if omap44xx_l4_cfg__spinlock = {
3950 .master = &omap44xx_l4_cfg_hwmod,
3951 .slave = &omap44xx_spinlock_hwmod,
3952 .clk = "l4_div_ck",
3953 .addr = omap44xx_spinlock_addrs,
3954 .addr_cnt = ARRAY_SIZE(omap44xx_spinlock_addrs),
3955 .user = OCP_USER_MPU | OCP_USER_SDMA,
3956};
3957
3958/* spinlock slave ports */
3959static struct omap_hwmod_ocp_if *omap44xx_spinlock_slaves[] = {
3960 &omap44xx_l4_cfg__spinlock,
3961};
3962
3963static struct omap_hwmod omap44xx_spinlock_hwmod = {
3964 .name = "spinlock",
3965 .class = &omap44xx_spinlock_hwmod_class,
3966 .prcm = {
3967 .omap4 = {
3968 .clkctrl_reg = OMAP4430_CM_L4CFG_HW_SEM_CLKCTRL,
3969 },
3970 },
3971 .slaves = omap44xx_spinlock_slaves,
3972 .slaves_cnt = ARRAY_SIZE(omap44xx_spinlock_slaves),
3973 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3974};
3975
3976/*
3977 * 'timer' class
3978 * general purpose timer module with accurate 1ms tick
3979 * This class contains several variants: ['timer_1ms', 'timer']
3980 */
3981
3982static struct omap_hwmod_class_sysconfig omap44xx_timer_1ms_sysc = {
3983 .rev_offs = 0x0000,
3984 .sysc_offs = 0x0010,
3985 .syss_offs = 0x0014,
3986 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
3987 SYSC_HAS_EMUFREE | SYSC_HAS_ENAWAKEUP |
3988 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
3989 SYSS_HAS_RESET_STATUS),
3990 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
3991 .sysc_fields = &omap_hwmod_sysc_type1,
3992};
3993
3994static struct omap_hwmod_class omap44xx_timer_1ms_hwmod_class = {
3995 .name = "timer",
3996 .sysc = &omap44xx_timer_1ms_sysc,
3997};
3998
3999static struct omap_hwmod_class_sysconfig omap44xx_timer_sysc = {
4000 .rev_offs = 0x0000,
4001 .sysc_offs = 0x0010,
4002 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_RESET_STATUS |
4003 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
4004 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
4005 SIDLE_SMART_WKUP),
4006 .sysc_fields = &omap_hwmod_sysc_type2,
4007};
4008
4009static struct omap_hwmod_class omap44xx_timer_hwmod_class = {
4010 .name = "timer",
4011 .sysc = &omap44xx_timer_sysc,
4012};
4013
4014/* timer1 */
4015static struct omap_hwmod omap44xx_timer1_hwmod;
4016static struct omap_hwmod_irq_info omap44xx_timer1_irqs[] = {
4017 { .irq = 37 + OMAP44XX_IRQ_GIC_START },
4018};
4019
4020static struct omap_hwmod_addr_space omap44xx_timer1_addrs[] = {
4021 {
4022 .pa_start = 0x4a318000,
4023 .pa_end = 0x4a31807f,
4024 .flags = ADDR_TYPE_RT
4025 },
4026};
4027
4028/* l4_wkup -> timer1 */
4029static struct omap_hwmod_ocp_if omap44xx_l4_wkup__timer1 = {
4030 .master = &omap44xx_l4_wkup_hwmod,
4031 .slave = &omap44xx_timer1_hwmod,
4032 .clk = "l4_wkup_clk_mux_ck",
4033 .addr = omap44xx_timer1_addrs,
4034 .addr_cnt = ARRAY_SIZE(omap44xx_timer1_addrs),
4035 .user = OCP_USER_MPU | OCP_USER_SDMA,
4036};
4037
4038/* timer1 slave ports */
4039static struct omap_hwmod_ocp_if *omap44xx_timer1_slaves[] = {
4040 &omap44xx_l4_wkup__timer1,
4041};
4042
4043static struct omap_hwmod omap44xx_timer1_hwmod = {
4044 .name = "timer1",
4045 .class = &omap44xx_timer_1ms_hwmod_class,
4046 .mpu_irqs = omap44xx_timer1_irqs,
4047 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer1_irqs),
4048 .main_clk = "timer1_fck",
4049 .prcm = {
4050 .omap4 = {
4051 .clkctrl_reg = OMAP4430_CM_WKUP_TIMER1_CLKCTRL,
4052 },
4053 },
4054 .slaves = omap44xx_timer1_slaves,
4055 .slaves_cnt = ARRAY_SIZE(omap44xx_timer1_slaves),
4056 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4057};
4058
4059/* timer2 */
4060static struct omap_hwmod omap44xx_timer2_hwmod;
4061static struct omap_hwmod_irq_info omap44xx_timer2_irqs[] = {
4062 { .irq = 38 + OMAP44XX_IRQ_GIC_START },
4063};
4064
4065static struct omap_hwmod_addr_space omap44xx_timer2_addrs[] = {
4066 {
4067 .pa_start = 0x48032000,
4068 .pa_end = 0x4803207f,
4069 .flags = ADDR_TYPE_RT
4070 },
4071};
4072
4073/* l4_per -> timer2 */
4074static struct omap_hwmod_ocp_if omap44xx_l4_per__timer2 = {
4075 .master = &omap44xx_l4_per_hwmod,
4076 .slave = &omap44xx_timer2_hwmod,
4077 .clk = "l4_div_ck",
4078 .addr = omap44xx_timer2_addrs,
4079 .addr_cnt = ARRAY_SIZE(omap44xx_timer2_addrs),
4080 .user = OCP_USER_MPU | OCP_USER_SDMA,
4081};
4082
4083/* timer2 slave ports */
4084static struct omap_hwmod_ocp_if *omap44xx_timer2_slaves[] = {
4085 &omap44xx_l4_per__timer2,
4086};
4087
4088static struct omap_hwmod omap44xx_timer2_hwmod = {
4089 .name = "timer2",
4090 .class = &omap44xx_timer_1ms_hwmod_class,
4091 .mpu_irqs = omap44xx_timer2_irqs,
4092 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer2_irqs),
4093 .main_clk = "timer2_fck",
4094 .prcm = {
4095 .omap4 = {
4096 .clkctrl_reg = OMAP4430_CM_L4PER_DMTIMER2_CLKCTRL,
4097 },
4098 },
4099 .slaves = omap44xx_timer2_slaves,
4100 .slaves_cnt = ARRAY_SIZE(omap44xx_timer2_slaves),
4101 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4102};
4103
4104/* timer3 */
4105static struct omap_hwmod omap44xx_timer3_hwmod;
4106static struct omap_hwmod_irq_info omap44xx_timer3_irqs[] = {
4107 { .irq = 39 + OMAP44XX_IRQ_GIC_START },
4108};
4109
4110static struct omap_hwmod_addr_space omap44xx_timer3_addrs[] = {
4111 {
4112 .pa_start = 0x48034000,
4113 .pa_end = 0x4803407f,
4114 .flags = ADDR_TYPE_RT
4115 },
4116};
4117
4118/* l4_per -> timer3 */
4119static struct omap_hwmod_ocp_if omap44xx_l4_per__timer3 = {
4120 .master = &omap44xx_l4_per_hwmod,
4121 .slave = &omap44xx_timer3_hwmod,
4122 .clk = "l4_div_ck",
4123 .addr = omap44xx_timer3_addrs,
4124 .addr_cnt = ARRAY_SIZE(omap44xx_timer3_addrs),
4125 .user = OCP_USER_MPU | OCP_USER_SDMA,
4126};
4127
4128/* timer3 slave ports */
4129static struct omap_hwmod_ocp_if *omap44xx_timer3_slaves[] = {
4130 &omap44xx_l4_per__timer3,
4131};
4132
4133static struct omap_hwmod omap44xx_timer3_hwmod = {
4134 .name = "timer3",
4135 .class = &omap44xx_timer_hwmod_class,
4136 .mpu_irqs = omap44xx_timer3_irqs,
4137 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer3_irqs),
4138 .main_clk = "timer3_fck",
4139 .prcm = {
4140 .omap4 = {
4141 .clkctrl_reg = OMAP4430_CM_L4PER_DMTIMER3_CLKCTRL,
4142 },
4143 },
4144 .slaves = omap44xx_timer3_slaves,
4145 .slaves_cnt = ARRAY_SIZE(omap44xx_timer3_slaves),
4146 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4147};
4148
4149/* timer4 */
4150static struct omap_hwmod omap44xx_timer4_hwmod;
4151static struct omap_hwmod_irq_info omap44xx_timer4_irqs[] = {
4152 { .irq = 40 + OMAP44XX_IRQ_GIC_START },
4153};
4154
4155static struct omap_hwmod_addr_space omap44xx_timer4_addrs[] = {
4156 {
4157 .pa_start = 0x48036000,
4158 .pa_end = 0x4803607f,
4159 .flags = ADDR_TYPE_RT
4160 },
4161};
4162
4163/* l4_per -> timer4 */
4164static struct omap_hwmod_ocp_if omap44xx_l4_per__timer4 = {
4165 .master = &omap44xx_l4_per_hwmod,
4166 .slave = &omap44xx_timer4_hwmod,
4167 .clk = "l4_div_ck",
4168 .addr = omap44xx_timer4_addrs,
4169 .addr_cnt = ARRAY_SIZE(omap44xx_timer4_addrs),
4170 .user = OCP_USER_MPU | OCP_USER_SDMA,
4171};
4172
4173/* timer4 slave ports */
4174static struct omap_hwmod_ocp_if *omap44xx_timer4_slaves[] = {
4175 &omap44xx_l4_per__timer4,
4176};
4177
4178static struct omap_hwmod omap44xx_timer4_hwmod = {
4179 .name = "timer4",
4180 .class = &omap44xx_timer_hwmod_class,
4181 .mpu_irqs = omap44xx_timer4_irqs,
4182 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer4_irqs),
4183 .main_clk = "timer4_fck",
4184 .prcm = {
4185 .omap4 = {
4186 .clkctrl_reg = OMAP4430_CM_L4PER_DMTIMER4_CLKCTRL,
4187 },
4188 },
4189 .slaves = omap44xx_timer4_slaves,
4190 .slaves_cnt = ARRAY_SIZE(omap44xx_timer4_slaves),
4191 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4192};
4193
4194/* timer5 */
4195static struct omap_hwmod omap44xx_timer5_hwmod;
4196static struct omap_hwmod_irq_info omap44xx_timer5_irqs[] = {
4197 { .irq = 41 + OMAP44XX_IRQ_GIC_START },
4198};
4199
4200static struct omap_hwmod_addr_space omap44xx_timer5_addrs[] = {
4201 {
4202 .pa_start = 0x40138000,
4203 .pa_end = 0x4013807f,
4204 .flags = ADDR_TYPE_RT
4205 },
4206};
4207
4208/* l4_abe -> timer5 */
4209static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer5 = {
4210 .master = &omap44xx_l4_abe_hwmod,
4211 .slave = &omap44xx_timer5_hwmod,
4212 .clk = "ocp_abe_iclk",
4213 .addr = omap44xx_timer5_addrs,
4214 .addr_cnt = ARRAY_SIZE(omap44xx_timer5_addrs),
4215 .user = OCP_USER_MPU,
4216};
4217
4218static struct omap_hwmod_addr_space omap44xx_timer5_dma_addrs[] = {
4219 {
4220 .pa_start = 0x49038000,
4221 .pa_end = 0x4903807f,
4222 .flags = ADDR_TYPE_RT
4223 },
4224};
4225
4226/* l4_abe -> timer5 (dma) */
4227static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer5_dma = {
4228 .master = &omap44xx_l4_abe_hwmod,
4229 .slave = &omap44xx_timer5_hwmod,
4230 .clk = "ocp_abe_iclk",
4231 .addr = omap44xx_timer5_dma_addrs,
4232 .addr_cnt = ARRAY_SIZE(omap44xx_timer5_dma_addrs),
4233 .user = OCP_USER_SDMA,
4234};
4235
4236/* timer5 slave ports */
4237static struct omap_hwmod_ocp_if *omap44xx_timer5_slaves[] = {
4238 &omap44xx_l4_abe__timer5,
4239 &omap44xx_l4_abe__timer5_dma,
4240};
4241
4242static struct omap_hwmod omap44xx_timer5_hwmod = {
4243 .name = "timer5",
4244 .class = &omap44xx_timer_hwmod_class,
4245 .mpu_irqs = omap44xx_timer5_irqs,
4246 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer5_irqs),
4247 .main_clk = "timer5_fck",
4248 .prcm = {
4249 .omap4 = {
4250 .clkctrl_reg = OMAP4430_CM1_ABE_TIMER5_CLKCTRL,
4251 },
4252 },
4253 .slaves = omap44xx_timer5_slaves,
4254 .slaves_cnt = ARRAY_SIZE(omap44xx_timer5_slaves),
4255 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4256};
4257
4258/* timer6 */
4259static struct omap_hwmod omap44xx_timer6_hwmod;
4260static struct omap_hwmod_irq_info omap44xx_timer6_irqs[] = {
4261 { .irq = 42 + OMAP44XX_IRQ_GIC_START },
4262};
4263
4264static struct omap_hwmod_addr_space omap44xx_timer6_addrs[] = {
4265 {
4266 .pa_start = 0x4013a000,
4267 .pa_end = 0x4013a07f,
4268 .flags = ADDR_TYPE_RT
4269 },
4270};
4271
4272/* l4_abe -> timer6 */
4273static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer6 = {
4274 .master = &omap44xx_l4_abe_hwmod,
4275 .slave = &omap44xx_timer6_hwmod,
4276 .clk = "ocp_abe_iclk",
4277 .addr = omap44xx_timer6_addrs,
4278 .addr_cnt = ARRAY_SIZE(omap44xx_timer6_addrs),
4279 .user = OCP_USER_MPU,
4280};
4281
4282static struct omap_hwmod_addr_space omap44xx_timer6_dma_addrs[] = {
4283 {
4284 .pa_start = 0x4903a000,
4285 .pa_end = 0x4903a07f,
4286 .flags = ADDR_TYPE_RT
4287 },
4288};
4289
4290/* l4_abe -> timer6 (dma) */
4291static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer6_dma = {
4292 .master = &omap44xx_l4_abe_hwmod,
4293 .slave = &omap44xx_timer6_hwmod,
4294 .clk = "ocp_abe_iclk",
4295 .addr = omap44xx_timer6_dma_addrs,
4296 .addr_cnt = ARRAY_SIZE(omap44xx_timer6_dma_addrs),
4297 .user = OCP_USER_SDMA,
4298};
4299
4300/* timer6 slave ports */
4301static struct omap_hwmod_ocp_if *omap44xx_timer6_slaves[] = {
4302 &omap44xx_l4_abe__timer6,
4303 &omap44xx_l4_abe__timer6_dma,
4304};
4305
4306static struct omap_hwmod omap44xx_timer6_hwmod = {
4307 .name = "timer6",
4308 .class = &omap44xx_timer_hwmod_class,
4309 .mpu_irqs = omap44xx_timer6_irqs,
4310 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer6_irqs),
4311 .main_clk = "timer6_fck",
4312 .prcm = {
4313 .omap4 = {
4314 .clkctrl_reg = OMAP4430_CM1_ABE_TIMER6_CLKCTRL,
4315 },
4316 },
4317 .slaves = omap44xx_timer6_slaves,
4318 .slaves_cnt = ARRAY_SIZE(omap44xx_timer6_slaves),
4319 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4320};
4321
4322/* timer7 */
4323static struct omap_hwmod omap44xx_timer7_hwmod;
4324static struct omap_hwmod_irq_info omap44xx_timer7_irqs[] = {
4325 { .irq = 43 + OMAP44XX_IRQ_GIC_START },
4326};
4327
4328static struct omap_hwmod_addr_space omap44xx_timer7_addrs[] = {
4329 {
4330 .pa_start = 0x4013c000,
4331 .pa_end = 0x4013c07f,
4332 .flags = ADDR_TYPE_RT
4333 },
4334};
4335
4336/* l4_abe -> timer7 */
4337static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer7 = {
4338 .master = &omap44xx_l4_abe_hwmod,
4339 .slave = &omap44xx_timer7_hwmod,
4340 .clk = "ocp_abe_iclk",
4341 .addr = omap44xx_timer7_addrs,
4342 .addr_cnt = ARRAY_SIZE(omap44xx_timer7_addrs),
4343 .user = OCP_USER_MPU,
4344};
4345
4346static struct omap_hwmod_addr_space omap44xx_timer7_dma_addrs[] = {
4347 {
4348 .pa_start = 0x4903c000,
4349 .pa_end = 0x4903c07f,
4350 .flags = ADDR_TYPE_RT
4351 },
4352};
4353
4354/* l4_abe -> timer7 (dma) */
4355static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer7_dma = {
4356 .master = &omap44xx_l4_abe_hwmod,
4357 .slave = &omap44xx_timer7_hwmod,
4358 .clk = "ocp_abe_iclk",
4359 .addr = omap44xx_timer7_dma_addrs,
4360 .addr_cnt = ARRAY_SIZE(omap44xx_timer7_dma_addrs),
4361 .user = OCP_USER_SDMA,
4362};
4363
4364/* timer7 slave ports */
4365static struct omap_hwmod_ocp_if *omap44xx_timer7_slaves[] = {
4366 &omap44xx_l4_abe__timer7,
4367 &omap44xx_l4_abe__timer7_dma,
4368};
4369
4370static struct omap_hwmod omap44xx_timer7_hwmod = {
4371 .name = "timer7",
4372 .class = &omap44xx_timer_hwmod_class,
4373 .mpu_irqs = omap44xx_timer7_irqs,
4374 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer7_irqs),
4375 .main_clk = "timer7_fck",
4376 .prcm = {
4377 .omap4 = {
4378 .clkctrl_reg = OMAP4430_CM1_ABE_TIMER7_CLKCTRL,
4379 },
4380 },
4381 .slaves = omap44xx_timer7_slaves,
4382 .slaves_cnt = ARRAY_SIZE(omap44xx_timer7_slaves),
4383 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4384};
4385
4386/* timer8 */
4387static struct omap_hwmod omap44xx_timer8_hwmod;
4388static struct omap_hwmod_irq_info omap44xx_timer8_irqs[] = {
4389 { .irq = 44 + OMAP44XX_IRQ_GIC_START },
4390};
4391
4392static struct omap_hwmod_addr_space omap44xx_timer8_addrs[] = {
4393 {
4394 .pa_start = 0x4013e000,
4395 .pa_end = 0x4013e07f,
4396 .flags = ADDR_TYPE_RT
4397 },
4398};
4399
4400/* l4_abe -> timer8 */
4401static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer8 = {
4402 .master = &omap44xx_l4_abe_hwmod,
4403 .slave = &omap44xx_timer8_hwmod,
4404 .clk = "ocp_abe_iclk",
4405 .addr = omap44xx_timer8_addrs,
4406 .addr_cnt = ARRAY_SIZE(omap44xx_timer8_addrs),
4407 .user = OCP_USER_MPU,
4408};
4409
4410static struct omap_hwmod_addr_space omap44xx_timer8_dma_addrs[] = {
4411 {
4412 .pa_start = 0x4903e000,
4413 .pa_end = 0x4903e07f,
4414 .flags = ADDR_TYPE_RT
4415 },
4416};
4417
4418/* l4_abe -> timer8 (dma) */
4419static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer8_dma = {
4420 .master = &omap44xx_l4_abe_hwmod,
4421 .slave = &omap44xx_timer8_hwmod,
4422 .clk = "ocp_abe_iclk",
4423 .addr = omap44xx_timer8_dma_addrs,
4424 .addr_cnt = ARRAY_SIZE(omap44xx_timer8_dma_addrs),
4425 .user = OCP_USER_SDMA,
4426};
4427
4428/* timer8 slave ports */
4429static struct omap_hwmod_ocp_if *omap44xx_timer8_slaves[] = {
4430 &omap44xx_l4_abe__timer8,
4431 &omap44xx_l4_abe__timer8_dma,
4432};
4433
4434static struct omap_hwmod omap44xx_timer8_hwmod = {
4435 .name = "timer8",
4436 .class = &omap44xx_timer_hwmod_class,
4437 .mpu_irqs = omap44xx_timer8_irqs,
4438 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer8_irqs),
4439 .main_clk = "timer8_fck",
4440 .prcm = {
4441 .omap4 = {
4442 .clkctrl_reg = OMAP4430_CM1_ABE_TIMER8_CLKCTRL,
4443 },
4444 },
4445 .slaves = omap44xx_timer8_slaves,
4446 .slaves_cnt = ARRAY_SIZE(omap44xx_timer8_slaves),
4447 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4448};
4449
4450/* timer9 */
4451static struct omap_hwmod omap44xx_timer9_hwmod;
4452static struct omap_hwmod_irq_info omap44xx_timer9_irqs[] = {
4453 { .irq = 45 + OMAP44XX_IRQ_GIC_START },
4454};
4455
4456static struct omap_hwmod_addr_space omap44xx_timer9_addrs[] = {
4457 {
4458 .pa_start = 0x4803e000,
4459 .pa_end = 0x4803e07f,
4460 .flags = ADDR_TYPE_RT
4461 },
4462};
4463
4464/* l4_per -> timer9 */
4465static struct omap_hwmod_ocp_if omap44xx_l4_per__timer9 = {
4466 .master = &omap44xx_l4_per_hwmod,
4467 .slave = &omap44xx_timer9_hwmod,
4468 .clk = "l4_div_ck",
4469 .addr = omap44xx_timer9_addrs,
4470 .addr_cnt = ARRAY_SIZE(omap44xx_timer9_addrs),
4471 .user = OCP_USER_MPU | OCP_USER_SDMA,
4472};
4473
4474/* timer9 slave ports */
4475static struct omap_hwmod_ocp_if *omap44xx_timer9_slaves[] = {
4476 &omap44xx_l4_per__timer9,
4477};
4478
4479static struct omap_hwmod omap44xx_timer9_hwmod = {
4480 .name = "timer9",
4481 .class = &omap44xx_timer_hwmod_class,
4482 .mpu_irqs = omap44xx_timer9_irqs,
4483 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer9_irqs),
4484 .main_clk = "timer9_fck",
4485 .prcm = {
4486 .omap4 = {
4487 .clkctrl_reg = OMAP4430_CM_L4PER_DMTIMER9_CLKCTRL,
4488 },
4489 },
4490 .slaves = omap44xx_timer9_slaves,
4491 .slaves_cnt = ARRAY_SIZE(omap44xx_timer9_slaves),
4492 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4493};
4494
4495/* timer10 */
4496static struct omap_hwmod omap44xx_timer10_hwmod;
4497static struct omap_hwmod_irq_info omap44xx_timer10_irqs[] = {
4498 { .irq = 46 + OMAP44XX_IRQ_GIC_START },
4499};
4500
4501static struct omap_hwmod_addr_space omap44xx_timer10_addrs[] = {
4502 {
4503 .pa_start = 0x48086000,
4504 .pa_end = 0x4808607f,
4505 .flags = ADDR_TYPE_RT
4506 },
4507};
4508
4509/* l4_per -> timer10 */
4510static struct omap_hwmod_ocp_if omap44xx_l4_per__timer10 = {
4511 .master = &omap44xx_l4_per_hwmod,
4512 .slave = &omap44xx_timer10_hwmod,
4513 .clk = "l4_div_ck",
4514 .addr = omap44xx_timer10_addrs,
4515 .addr_cnt = ARRAY_SIZE(omap44xx_timer10_addrs),
4516 .user = OCP_USER_MPU | OCP_USER_SDMA,
4517};
4518
4519/* timer10 slave ports */
4520static struct omap_hwmod_ocp_if *omap44xx_timer10_slaves[] = {
4521 &omap44xx_l4_per__timer10,
4522};
4523
4524static struct omap_hwmod omap44xx_timer10_hwmod = {
4525 .name = "timer10",
4526 .class = &omap44xx_timer_1ms_hwmod_class,
4527 .mpu_irqs = omap44xx_timer10_irqs,
4528 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer10_irqs),
4529 .main_clk = "timer10_fck",
4530 .prcm = {
4531 .omap4 = {
4532 .clkctrl_reg = OMAP4430_CM_L4PER_DMTIMER10_CLKCTRL,
4533 },
4534 },
4535 .slaves = omap44xx_timer10_slaves,
4536 .slaves_cnt = ARRAY_SIZE(omap44xx_timer10_slaves),
4537 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4538};
4539
4540/* timer11 */
4541static struct omap_hwmod omap44xx_timer11_hwmod;
4542static struct omap_hwmod_irq_info omap44xx_timer11_irqs[] = {
4543 { .irq = 47 + OMAP44XX_IRQ_GIC_START },
4544};
4545
4546static struct omap_hwmod_addr_space omap44xx_timer11_addrs[] = {
4547 {
4548 .pa_start = 0x48088000,
4549 .pa_end = 0x4808807f,
4550 .flags = ADDR_TYPE_RT
4551 },
4552};
4553
4554/* l4_per -> timer11 */
4555static struct omap_hwmod_ocp_if omap44xx_l4_per__timer11 = {
4556 .master = &omap44xx_l4_per_hwmod,
4557 .slave = &omap44xx_timer11_hwmod,
4558 .clk = "l4_div_ck",
4559 .addr = omap44xx_timer11_addrs,
4560 .addr_cnt = ARRAY_SIZE(omap44xx_timer11_addrs),
4561 .user = OCP_USER_MPU | OCP_USER_SDMA,
4562};
4563
4564/* timer11 slave ports */
4565static struct omap_hwmod_ocp_if *omap44xx_timer11_slaves[] = {
4566 &omap44xx_l4_per__timer11,
4567};
4568
4569static struct omap_hwmod omap44xx_timer11_hwmod = {
4570 .name = "timer11",
4571 .class = &omap44xx_timer_hwmod_class,
4572 .mpu_irqs = omap44xx_timer11_irqs,
4573 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer11_irqs),
4574 .main_clk = "timer11_fck",
4575 .prcm = {
4576 .omap4 = {
4577 .clkctrl_reg = OMAP4430_CM_L4PER_DMTIMER11_CLKCTRL,
4578 },
4579 },
4580 .slaves = omap44xx_timer11_slaves,
4581 .slaves_cnt = ARRAY_SIZE(omap44xx_timer11_slaves),
4582 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4583};
4584
4585/*
1642 * 'uart' class 4586 * 'uart' class
1643 * universal asynchronous receiver/transmitter (uart) 4587 * universal asynchronous receiver/transmitter (uart)
1644 */ 4588 */
@@ -1870,6 +4814,88 @@ static struct omap_hwmod omap44xx_uart4_hwmod = {
1870}; 4814};
1871 4815
1872/* 4816/*
4817 * 'usb_otg_hs' class
4818 * high-speed on-the-go universal serial bus (usb_otg_hs) controller
4819 */
4820
4821static struct omap_hwmod_class_sysconfig omap44xx_usb_otg_hs_sysc = {
4822 .rev_offs = 0x0400,
4823 .sysc_offs = 0x0404,
4824 .syss_offs = 0x0408,
4825 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP |
4826 SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE |
4827 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
4828 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
4829 SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
4830 MSTANDBY_SMART),
4831 .sysc_fields = &omap_hwmod_sysc_type1,
4832};
4833
4834static struct omap_hwmod_class omap44xx_usb_otg_hs_hwmod_class = {
4835 .name = "usb_otg_hs",
4836 .sysc = &omap44xx_usb_otg_hs_sysc,
4837};
4838
4839/* usb_otg_hs */
4840static struct omap_hwmod_irq_info omap44xx_usb_otg_hs_irqs[] = {
4841 { .name = "mc", .irq = 92 + OMAP44XX_IRQ_GIC_START },
4842 { .name = "dma", .irq = 93 + OMAP44XX_IRQ_GIC_START },
4843};
4844
4845/* usb_otg_hs master ports */
4846static struct omap_hwmod_ocp_if *omap44xx_usb_otg_hs_masters[] = {
4847 &omap44xx_usb_otg_hs__l3_main_2,
4848};
4849
4850static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = {
4851 {
4852 .pa_start = 0x4a0ab000,
4853 .pa_end = 0x4a0ab003,
4854 .flags = ADDR_TYPE_RT
4855 },
4856};
4857
4858/* l4_cfg -> usb_otg_hs */
4859static struct omap_hwmod_ocp_if omap44xx_l4_cfg__usb_otg_hs = {
4860 .master = &omap44xx_l4_cfg_hwmod,
4861 .slave = &omap44xx_usb_otg_hs_hwmod,
4862 .clk = "l4_div_ck",
4863 .addr = omap44xx_usb_otg_hs_addrs,
4864 .addr_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_addrs),
4865 .user = OCP_USER_MPU | OCP_USER_SDMA,
4866};
4867
4868/* usb_otg_hs slave ports */
4869static struct omap_hwmod_ocp_if *omap44xx_usb_otg_hs_slaves[] = {
4870 &omap44xx_l4_cfg__usb_otg_hs,
4871};
4872
4873static struct omap_hwmod_opt_clk usb_otg_hs_opt_clks[] = {
4874 { .role = "xclk", .clk = "usb_otg_hs_xclk" },
4875};
4876
4877static struct omap_hwmod omap44xx_usb_otg_hs_hwmod = {
4878 .name = "usb_otg_hs",
4879 .class = &omap44xx_usb_otg_hs_hwmod_class,
4880 .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY,
4881 .mpu_irqs = omap44xx_usb_otg_hs_irqs,
4882 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_irqs),
4883 .main_clk = "usb_otg_hs_ick",
4884 .prcm = {
4885 .omap4 = {
4886 .clkctrl_reg = OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL,
4887 },
4888 },
4889 .opt_clks = usb_otg_hs_opt_clks,
4890 .opt_clks_cnt = ARRAY_SIZE(usb_otg_hs_opt_clks),
4891 .slaves = omap44xx_usb_otg_hs_slaves,
4892 .slaves_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_slaves),
4893 .masters = omap44xx_usb_otg_hs_masters,
4894 .masters_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_masters),
4895 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4896};
4897
4898/*
1873 * 'wd_timer' class 4899 * 'wd_timer' class
1874 * 32-bit watchdog upward counter that generates a pulse on the reset pin on 4900 * 32-bit watchdog upward counter that generates a pulse on the reset pin on
1875 * overflow condition 4901 * overflow condition
@@ -2024,13 +5050,34 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
2024 /* mpu_bus class */ 5050 /* mpu_bus class */
2025 &omap44xx_mpu_private_hwmod, 5051 &omap44xx_mpu_private_hwmod,
2026 5052
5053 /* aess class */
5054/* &omap44xx_aess_hwmod, */
5055
5056 /* bandgap class */
5057 &omap44xx_bandgap_hwmod,
5058
5059 /* counter class */
5060/* &omap44xx_counter_32k_hwmod, */
5061
2027 /* dma class */ 5062 /* dma class */
2028 &omap44xx_dma_system_hwmod, 5063 &omap44xx_dma_system_hwmod,
2029 5064
5065 /* dmic class */
5066 &omap44xx_dmic_hwmod,
5067
2030 /* dsp class */ 5068 /* dsp class */
2031 &omap44xx_dsp_hwmod, 5069 &omap44xx_dsp_hwmod,
2032 &omap44xx_dsp_c0_hwmod, 5070 &omap44xx_dsp_c0_hwmod,
2033 5071
5072 /* dss class */
5073 &omap44xx_dss_hwmod,
5074 &omap44xx_dss_dispc_hwmod,
5075 &omap44xx_dss_dsi1_hwmod,
5076 &omap44xx_dss_dsi2_hwmod,
5077 &omap44xx_dss_hdmi_hwmod,
5078 &omap44xx_dss_rfbi_hwmod,
5079 &omap44xx_dss_venc_hwmod,
5080
2034 /* gpio class */ 5081 /* gpio class */
2035 &omap44xx_gpio1_hwmod, 5082 &omap44xx_gpio1_hwmod,
2036 &omap44xx_gpio2_hwmod, 5083 &omap44xx_gpio2_hwmod,
@@ -2039,17 +5086,56 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
2039 &omap44xx_gpio5_hwmod, 5086 &omap44xx_gpio5_hwmod,
2040 &omap44xx_gpio6_hwmod, 5087 &omap44xx_gpio6_hwmod,
2041 5088
5089 /* hsi class */
5090/* &omap44xx_hsi_hwmod, */
5091
2042 /* i2c class */ 5092 /* i2c class */
2043 &omap44xx_i2c1_hwmod, 5093 &omap44xx_i2c1_hwmod,
2044 &omap44xx_i2c2_hwmod, 5094 &omap44xx_i2c2_hwmod,
2045 &omap44xx_i2c3_hwmod, 5095 &omap44xx_i2c3_hwmod,
2046 &omap44xx_i2c4_hwmod, 5096 &omap44xx_i2c4_hwmod,
2047 5097
5098 /* ipu class */
5099 &omap44xx_ipu_hwmod,
5100 &omap44xx_ipu_c0_hwmod,
5101 &omap44xx_ipu_c1_hwmod,
5102
5103 /* iss class */
5104/* &omap44xx_iss_hwmod, */
5105
2048 /* iva class */ 5106 /* iva class */
2049 &omap44xx_iva_hwmod, 5107 &omap44xx_iva_hwmod,
2050 &omap44xx_iva_seq0_hwmod, 5108 &omap44xx_iva_seq0_hwmod,
2051 &omap44xx_iva_seq1_hwmod, 5109 &omap44xx_iva_seq1_hwmod,
2052 5110
5111 /* kbd class */
5112/* &omap44xx_kbd_hwmod, */
5113
5114 /* mailbox class */
5115 &omap44xx_mailbox_hwmod,
5116
5117 /* mcbsp class */
5118 &omap44xx_mcbsp1_hwmod,
5119 &omap44xx_mcbsp2_hwmod,
5120 &omap44xx_mcbsp3_hwmod,
5121 &omap44xx_mcbsp4_hwmod,
5122
5123 /* mcpdm class */
5124/* &omap44xx_mcpdm_hwmod, */
5125
5126 /* mcspi class */
5127 &omap44xx_mcspi1_hwmod,
5128 &omap44xx_mcspi2_hwmod,
5129 &omap44xx_mcspi3_hwmod,
5130 &omap44xx_mcspi4_hwmod,
5131
5132 /* mmc class */
5133 &omap44xx_mmc1_hwmod,
5134 &omap44xx_mmc2_hwmod,
5135 &omap44xx_mmc3_hwmod,
5136 &omap44xx_mmc4_hwmod,
5137 &omap44xx_mmc5_hwmod,
5138
2053 /* mpu class */ 5139 /* mpu class */
2054 &omap44xx_mpu_hwmod, 5140 &omap44xx_mpu_hwmod,
2055 5141
@@ -2058,12 +5144,31 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
2058 &omap44xx_smartreflex_iva_hwmod, 5144 &omap44xx_smartreflex_iva_hwmod,
2059 &omap44xx_smartreflex_mpu_hwmod, 5145 &omap44xx_smartreflex_mpu_hwmod,
2060 5146
5147 /* spinlock class */
5148 &omap44xx_spinlock_hwmod,
5149
5150 /* timer class */
5151 &omap44xx_timer1_hwmod,
5152 &omap44xx_timer2_hwmod,
5153 &omap44xx_timer3_hwmod,
5154 &omap44xx_timer4_hwmod,
5155 &omap44xx_timer5_hwmod,
5156 &omap44xx_timer6_hwmod,
5157 &omap44xx_timer7_hwmod,
5158 &omap44xx_timer8_hwmod,
5159 &omap44xx_timer9_hwmod,
5160 &omap44xx_timer10_hwmod,
5161 &omap44xx_timer11_hwmod,
5162
2061 /* uart class */ 5163 /* uart class */
2062 &omap44xx_uart1_hwmod, 5164 &omap44xx_uart1_hwmod,
2063 &omap44xx_uart2_hwmod, 5165 &omap44xx_uart2_hwmod,
2064 &omap44xx_uart3_hwmod, 5166 &omap44xx_uart3_hwmod,
2065 &omap44xx_uart4_hwmod, 5167 &omap44xx_uart4_hwmod,
2066 5168
5169 /* usb_otg_hs class */
5170 &omap44xx_usb_otg_hs_hwmod,
5171
2067 /* wd_timer class */ 5172 /* wd_timer class */
2068 &omap44xx_wd_timer2_hwmod, 5173 &omap44xx_wd_timer2_hwmod,
2069 &omap44xx_wd_timer3_hwmod, 5174 &omap44xx_wd_timer3_hwmod,
@@ -2073,6 +5178,6 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
2073 5178
2074int __init omap44xx_hwmod_init(void) 5179int __init omap44xx_hwmod_init(void)
2075{ 5180{
2076 return omap_hwmod_init(omap44xx_hwmods); 5181 return omap_hwmod_register(omap44xx_hwmods);
2077} 5182}
2078 5183
diff --git a/arch/arm/mach-omap2/omap_l3_noc.c b/arch/arm/mach-omap2/omap_l3_noc.c
new file mode 100644
index 000000000000..82632c24076f
--- /dev/null
+++ b/arch/arm/mach-omap2/omap_l3_noc.c
@@ -0,0 +1,253 @@
1/*
2 * OMAP4XXX L3 Interconnect error handling driver
3 *
4 * Copyright (C) 2011 Texas Corporation
5 * Santosh Shilimkar <santosh.shilimkar@ti.com>
6 * Sricharan <r.sricharan@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 * USA
22 */
23#include <linux/init.h>
24#include <linux/io.h>
25#include <linux/platform_device.h>
26#include <linux/interrupt.h>
27#include <linux/kernel.h>
28#include <linux/slab.h>
29
30#include "omap_l3_noc.h"
31
32/*
33 * Interrupt Handler for L3 error detection.
34 * 1) Identify the L3 clockdomain partition to which the error belongs to.
35 * 2) Identify the slave where the error information is logged
36 * 3) Print the logged information.
37 * 4) Add dump stack to provide kernel trace.
38 *
39 * Two Types of errors :
40 * 1) Custom errors in L3 :
41 * Target like DMM/FW/EMIF generates SRESP=ERR error
42 * 2) Standard L3 error:
43 * - Unsupported CMD.
44 * L3 tries to access target while it is idle
45 * - OCP disconnect.
46 * - Address hole error:
47 * If DSS/ISS/FDIF/USBHOSTFS access a target where they
48 * do not have connectivity, the error is logged in
49 * their default target which is DMM2.
50 *
51 * On High Secure devices, firewall errors are possible and those
52 * can be trapped as well. But the trapping is implemented as part
53 * secure software and hence need not be implemented here.
54 */
55static irqreturn_t l3_interrupt_handler(int irq, void *_l3)
56{
57
58 struct omap4_l3 *l3 = _l3;
59 int inttype, i, j;
60 int err_src = 0;
61 u32 std_err_main_addr, std_err_main, err_reg;
62 u32 base, slave_addr, clear;
63 char *source_name;
64
65 /* Get the Type of interrupt */
66 if (irq == l3->app_irq)
67 inttype = L3_APPLICATION_ERROR;
68 else
69 inttype = L3_DEBUG_ERROR;
70
71 for (i = 0; i < L3_MODULES; i++) {
72 /*
73 * Read the regerr register of the clock domain
74 * to determine the source
75 */
76 base = (u32)l3->l3_base[i];
77 err_reg = readl(base + l3_flagmux[i] + (inttype << 3));
78
79 /* Get the corresponding error and analyse */
80 if (err_reg) {
81 /* Identify the source from control status register */
82 for (j = 0; !(err_reg & (1 << j)); j++)
83 ;
84
85 err_src = j;
86 /* Read the stderrlog_main_source from clk domain */
87 std_err_main_addr = base + (*(l3_targ[i] + err_src));
88 std_err_main = readl(std_err_main_addr);
89
90 switch ((std_err_main & CUSTOM_ERROR)) {
91 case STANDARD_ERROR:
92 source_name =
93 l3_targ_stderrlog_main_name[i][err_src];
94
95 slave_addr = std_err_main_addr +
96 L3_SLAVE_ADDRESS_OFFSET;
97 WARN(true, "L3 standard error: SOURCE:%s at address 0x%x\n",
98 source_name, readl(slave_addr));
99 /* clear the std error log*/
100 clear = std_err_main | CLEAR_STDERR_LOG;
101 writel(clear, std_err_main_addr);
102 break;
103
104 case CUSTOM_ERROR:
105 source_name =
106 l3_targ_stderrlog_main_name[i][err_src];
107
108 WARN(true, "CUSTOM SRESP error with SOURCE:%s\n",
109 source_name);
110 /* clear the std error log*/
111 clear = std_err_main | CLEAR_STDERR_LOG;
112 writel(clear, std_err_main_addr);
113 break;
114
115 default:
116 /* Nothing to be handled here as of now */
117 break;
118 }
119 /* Error found so break the for loop */
120 break;
121 }
122 }
123 return IRQ_HANDLED;
124}
125
126static int __init omap4_l3_probe(struct platform_device *pdev)
127{
128 static struct omap4_l3 *l3;
129 struct resource *res;
130 int ret;
131 int irq;
132
133 l3 = kzalloc(sizeof(*l3), GFP_KERNEL);
134 if (!l3)
135 ret = -ENOMEM;
136
137 platform_set_drvdata(pdev, l3);
138 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
139 if (!res) {
140 dev_err(&pdev->dev, "couldn't find resource 0\n");
141 ret = -ENODEV;
142 goto err1;
143 }
144
145 l3->l3_base[0] = ioremap(res->start, resource_size(res));
146 if (!(l3->l3_base[0])) {
147 dev_err(&pdev->dev, "ioremap failed\n");
148 ret = -ENOMEM;
149 goto err2;
150 }
151
152 res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
153 if (!res) {
154 dev_err(&pdev->dev, "couldn't find resource 1\n");
155 ret = -ENODEV;
156 goto err3;
157 }
158
159 l3->l3_base[1] = ioremap(res->start, resource_size(res));
160 if (!(l3->l3_base[1])) {
161 dev_err(&pdev->dev, "ioremap failed\n");
162 ret = -ENOMEM;
163 goto err4;
164 }
165
166 res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
167 if (!res) {
168 dev_err(&pdev->dev, "couldn't find resource 2\n");
169 ret = -ENODEV;
170 goto err5;
171 }
172
173 l3->l3_base[2] = ioremap(res->start, resource_size(res));
174 if (!(l3->l3_base[2])) {
175 dev_err(&pdev->dev, "ioremap failed\n");
176 ret = -ENOMEM;
177 goto err6;
178 }
179
180 /*
181 * Setup interrupt Handlers
182 */
183 irq = platform_get_irq(pdev, 0);
184 ret = request_irq(irq,
185 l3_interrupt_handler,
186 IRQF_DISABLED, "l3-dbg-irq", l3);
187 if (ret) {
188 pr_crit("L3: request_irq failed to register for 0x%x\n",
189 OMAP44XX_IRQ_L3_DBG);
190 goto err7;
191 }
192 l3->debug_irq = irq;
193
194 irq = platform_get_irq(pdev, 1);
195 ret = request_irq(irq,
196 l3_interrupt_handler,
197 IRQF_DISABLED, "l3-app-irq", l3);
198 if (ret) {
199 pr_crit("L3: request_irq failed to register for 0x%x\n",
200 OMAP44XX_IRQ_L3_APP);
201 goto err8;
202 }
203 l3->app_irq = irq;
204
205 goto err0;
206err8:
207err7:
208 iounmap(l3->l3_base[2]);
209err6:
210err5:
211 iounmap(l3->l3_base[1]);
212err4:
213err3:
214 iounmap(l3->l3_base[0]);
215err2:
216err1:
217 kfree(l3);
218err0:
219 return ret;
220}
221
222static int __exit omap4_l3_remove(struct platform_device *pdev)
223{
224 struct omap4_l3 *l3 = platform_get_drvdata(pdev);
225
226 free_irq(l3->app_irq, l3);
227 free_irq(l3->debug_irq, l3);
228 iounmap(l3->l3_base[0]);
229 iounmap(l3->l3_base[1]);
230 iounmap(l3->l3_base[2]);
231 kfree(l3);
232
233 return 0;
234}
235
236static struct platform_driver omap4_l3_driver = {
237 .remove = __exit_p(omap4_l3_remove),
238 .driver = {
239 .name = "omap_l3_noc",
240 },
241};
242
243static int __init omap4_l3_init(void)
244{
245 return platform_driver_probe(&omap4_l3_driver, omap4_l3_probe);
246}
247postcore_initcall_sync(omap4_l3_init);
248
249static void __exit omap4_l3_exit(void)
250{
251 platform_driver_unregister(&omap4_l3_driver);
252}
253module_exit(omap4_l3_exit);
diff --git a/arch/arm/mach-omap2/omap_l3_noc.h b/arch/arm/mach-omap2/omap_l3_noc.h
new file mode 100644
index 000000000000..359b83348aed
--- /dev/null
+++ b/arch/arm/mach-omap2/omap_l3_noc.h
@@ -0,0 +1,132 @@
1 /*
2 * OMAP4XXX L3 Interconnect error handling driver header
3 *
4 * Copyright (C) 2011 Texas Corporation
5 * Santosh Shilimkar <santosh.shilimkar@ti.com>
6 * sricharan <r.sricharan@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 * USA
22 */
23#ifndef __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H
24#define __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H
25
26/*
27 * L3 register offsets
28 */
29#define L3_MODULES 3
30#define CLEAR_STDERR_LOG (1 << 31)
31#define CUSTOM_ERROR 0x2
32#define STANDARD_ERROR 0x0
33#define INBAND_ERROR 0x0
34#define EMIF_KERRLOG_OFFSET 0x10
35#define L3_SLAVE_ADDRESS_OFFSET 0x14
36#define LOGICAL_ADDR_ERRORLOG 0x4
37#define L3_APPLICATION_ERROR 0x0
38#define L3_DEBUG_ERROR 0x1
39
40u32 l3_flagmux[L3_MODULES] = {
41 0x50C,
42 0x100C,
43 0X020C
44};
45
46/*
47 * L3 Target standard Error register offsets
48 */
49u32 l3_targ_stderrlog_main_clk1[] = {
50 0x148, /* DMM1 */
51 0x248, /* DMM2 */
52 0x348, /* ABE */
53 0x448, /* L4CFG */
54 0x648 /* CLK2 PWR DISC */
55};
56
57u32 l3_targ_stderrlog_main_clk2[] = {
58 0x548, /* CORTEX M3 */
59 0x348, /* DSS */
60 0x148, /* GPMC */
61 0x448, /* ISS */
62 0x748, /* IVAHD */
63 0xD48, /* missing in TRM corresponds to AES1*/
64 0x948, /* L4 PER0*/
65 0x248, /* OCMRAM */
66 0x148, /* missing in TRM corresponds to GPMC sERROR*/
67 0x648, /* SGX */
68 0x848, /* SL2 */
69 0x1648, /* C2C */
70 0x1148, /* missing in TRM corresponds PWR DISC CLK1*/
71 0xF48, /* missing in TRM corrsponds to SHA1*/
72 0xE48, /* missing in TRM corresponds to AES2*/
73 0xC48, /* L4 PER3 */
74 0xA48, /* L4 PER1*/
75 0xB48 /* L4 PER2*/
76};
77
78u32 l3_targ_stderrlog_main_clk3[] = {
79 0x0148 /* EMUSS */
80};
81
82char *l3_targ_stderrlog_main_name[L3_MODULES][18] = {
83 {
84 "DMM1",
85 "DMM2",
86 "ABE",
87 "L4CFG",
88 "CLK2 PWR DISC",
89 },
90 {
91 "CORTEX M3" ,
92 "DSS ",
93 "GPMC ",
94 "ISS ",
95 "IVAHD ",
96 "AES1",
97 "L4 PER0",
98 "OCMRAM ",
99 "GPMC sERROR",
100 "SGX ",
101 "SL2 ",
102 "C2C ",
103 "PWR DISC CLK1",
104 "SHA1",
105 "AES2",
106 "L4 PER3",
107 "L4 PER1",
108 "L4 PER2",
109 },
110 {
111 "EMUSS",
112 },
113};
114
115u32 *l3_targ[L3_MODULES] = {
116 l3_targ_stderrlog_main_clk1,
117 l3_targ_stderrlog_main_clk2,
118 l3_targ_stderrlog_main_clk3,
119};
120
121struct omap4_l3 {
122 struct device *dev;
123 struct clk *ick;
124
125 /* memory base */
126 void __iomem *l3_base[4];
127
128 int debug_irq;
129 int app_irq;
130};
131
132#endif
diff --git a/arch/arm/mach-omap2/omap_l3_smx.c b/arch/arm/mach-omap2/omap_l3_smx.c
new file mode 100644
index 000000000000..265bff3acb9e
--- /dev/null
+++ b/arch/arm/mach-omap2/omap_l3_smx.c
@@ -0,0 +1,314 @@
1 /*
2 * OMAP3XXX L3 Interconnect Driver
3 *
4 * Copyright (C) 2011 Texas Corporation
5 * Felipe Balbi <balbi@ti.com>
6 * Santosh Shilimkar <santosh.shilimkar@ti.com>
7 * Sricharan <r.sricharan@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 * USA
23 */
24
25#include <linux/kernel.h>
26#include <linux/slab.h>
27#include <linux/platform_device.h>
28#include <linux/interrupt.h>
29#include <linux/io.h>
30#include "omap_l3_smx.h"
31
32static inline u64 omap3_l3_readll(void __iomem *base, u16 reg)
33{
34 return __raw_readll(base + reg);
35}
36
37static inline void omap3_l3_writell(void __iomem *base, u16 reg, u64 value)
38{
39 __raw_writell(value, base + reg);
40}
41
42static inline enum omap3_l3_code omap3_l3_decode_error_code(u64 error)
43{
44 return (error & 0x0f000000) >> L3_ERROR_LOG_CODE;
45}
46
47static inline u32 omap3_l3_decode_addr(u64 error_addr)
48{
49 return error_addr & 0xffffffff;
50}
51
52static inline unsigned omap3_l3_decode_cmd(u64 error)
53{
54 return (error & 0x07) >> L3_ERROR_LOG_CMD;
55}
56
57static inline enum omap3_l3_initiator_id omap3_l3_decode_initid(u64 error)
58{
59 return (error & 0xff00) >> L3_ERROR_LOG_INITID;
60}
61
62static inline unsigned omap3_l3_decode_req_info(u64 error)
63{
64 return (error >> 32) & 0xffff;
65}
66
67static char *omap3_l3_code_string(u8 code)
68{
69 switch (code) {
70 case OMAP_L3_CODE_NOERROR:
71 return "No Error";
72 case OMAP_L3_CODE_UNSUP_CMD:
73 return "Unsupported Command";
74 case OMAP_L3_CODE_ADDR_HOLE:
75 return "Address Hole";
76 case OMAP_L3_CODE_PROTECT_VIOLATION:
77 return "Protection Violation";
78 case OMAP_L3_CODE_IN_BAND_ERR:
79 return "In-band Error";
80 case OMAP_L3_CODE_REQ_TOUT_NOT_ACCEPT:
81 return "Request Timeout Not Accepted";
82 case OMAP_L3_CODE_REQ_TOUT_NO_RESP:
83 return "Request Timeout, no response";
84 default:
85 return "UNKNOWN error";
86 }
87}
88
89static char *omap3_l3_initiator_string(u8 initid)
90{
91 switch (initid) {
92 case OMAP_L3_LCD:
93 return "LCD";
94 case OMAP_L3_SAD2D:
95 return "SAD2D";
96 case OMAP_L3_IA_MPU_SS_1:
97 case OMAP_L3_IA_MPU_SS_2:
98 case OMAP_L3_IA_MPU_SS_3:
99 case OMAP_L3_IA_MPU_SS_4:
100 case OMAP_L3_IA_MPU_SS_5:
101 return "MPU";
102 case OMAP_L3_IA_IVA_SS_1:
103 case OMAP_L3_IA_IVA_SS_2:
104 case OMAP_L3_IA_IVA_SS_3:
105 return "IVA_SS";
106 case OMAP_L3_IA_IVA_SS_DMA_1:
107 case OMAP_L3_IA_IVA_SS_DMA_2:
108 case OMAP_L3_IA_IVA_SS_DMA_3:
109 case OMAP_L3_IA_IVA_SS_DMA_4:
110 case OMAP_L3_IA_IVA_SS_DMA_5:
111 case OMAP_L3_IA_IVA_SS_DMA_6:
112 return "IVA_SS_DMA";
113 case OMAP_L3_IA_SGX:
114 return "SGX";
115 case OMAP_L3_IA_CAM_1:
116 case OMAP_L3_IA_CAM_2:
117 case OMAP_L3_IA_CAM_3:
118 return "CAM";
119 case OMAP_L3_IA_DAP:
120 return "DAP";
121 case OMAP_L3_SDMA_WR_1:
122 case OMAP_L3_SDMA_WR_2:
123 return "SDMA_WR";
124 case OMAP_L3_SDMA_RD_1:
125 case OMAP_L3_SDMA_RD_2:
126 case OMAP_L3_SDMA_RD_3:
127 case OMAP_L3_SDMA_RD_4:
128 return "SDMA_RD";
129 case OMAP_L3_USBOTG:
130 return "USB_OTG";
131 case OMAP_L3_USBHOST:
132 return "USB_HOST";
133 default:
134 return "UNKNOWN Initiator";
135 }
136}
137
138/**
139 * omap3_l3_block_irq - handles a register block's irq
140 * @l3: struct omap3_l3 *
141 * @base: register block base address
142 * @error: L3_ERROR_LOG register of our block
143 *
144 * Called in hard-irq context. Caller should take care of locking
145 *
146 * OMAP36xx TRM gives, on page 2001, Figure 9-10, the Typical Error
147 * Analysis Sequence, we are following that sequence here, please
148 * refer to that Figure for more information on the subject.
149 */
150static irqreturn_t omap3_l3_block_irq(struct omap3_l3 *l3,
151 u64 error, int error_addr)
152{
153 u8 code = omap3_l3_decode_error_code(error);
154 u8 initid = omap3_l3_decode_initid(error);
155 u8 multi = error & L3_ERROR_LOG_MULTI;
156 u32 address = omap3_l3_decode_addr(error_addr);
157
158 WARN(true, "%s Error seen by %s %s at address %x\n",
159 omap3_l3_code_string(code),
160 omap3_l3_initiator_string(initid),
161 multi ? "Multiple Errors" : "",
162 address);
163
164 return IRQ_HANDLED;
165}
166
167static irqreturn_t omap3_l3_app_irq(int irq, void *_l3)
168{
169 struct omap3_l3 *l3 = _l3;
170
171 u64 status, clear;
172 u64 error;
173 u64 error_addr;
174 u64 err_source = 0;
175 void __iomem *base;
176 int int_type;
177
178 irqreturn_t ret = IRQ_NONE;
179
180 if (irq == l3->app_irq)
181 int_type = L3_APPLICATION_ERROR;
182 else
183 int_type = L3_DEBUG_ERROR;
184
185 if (!int_type) {
186 status = omap3_l3_readll(l3->rt, L3_SI_FLAG_STATUS_0);
187 /*
188 * if we have a timeout error, there's nothing we can
189 * do besides rebooting the board. So let's BUG on any
190 * of such errors and handle the others. timeout error
191 * is severe and not expected to occur.
192 */
193 BUG_ON(status & L3_STATUS_0_TIMEOUT_MASK);
194 } else {
195 status = omap3_l3_readll(l3->rt, L3_SI_FLAG_STATUS_1);
196 /* No timeout error for debug sources */
197 }
198
199 base = ((l3->rt) + (*(omap3_l3_bases[int_type] + err_source)));
200
201 /* identify the error source */
202 for (err_source = 0; !(status & (1 << err_source)); err_source++)
203 ;
204 error = omap3_l3_readll(base, L3_ERROR_LOG);
205
206 if (error) {
207 error_addr = omap3_l3_readll(base, L3_ERROR_LOG_ADDR);
208
209 ret |= omap3_l3_block_irq(l3, error, error_addr);
210 }
211
212 /* Clear the status register */
213 clear = ((L3_AGENT_STATUS_CLEAR_IA << int_type) |
214 (L3_AGENT_STATUS_CLEAR_TA));
215
216 omap3_l3_writell(base, L3_AGENT_STATUS, clear);
217
218 /* clear the error log register */
219 omap3_l3_writell(base, L3_ERROR_LOG, error);
220
221 return ret;
222}
223
224static int __init omap3_l3_probe(struct platform_device *pdev)
225{
226 struct omap3_l3 *l3;
227 struct resource *res;
228 int ret;
229 int irq;
230
231 l3 = kzalloc(sizeof(*l3), GFP_KERNEL);
232 if (!l3) {
233 ret = -ENOMEM;
234 goto err0;
235 }
236
237 platform_set_drvdata(pdev, l3);
238
239 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
240 if (!res) {
241 dev_err(&pdev->dev, "couldn't find resource\n");
242 ret = -ENODEV;
243 goto err1;
244 }
245 l3->rt = ioremap(res->start, resource_size(res));
246 if (!(l3->rt)) {
247 dev_err(&pdev->dev, "ioremap failed\n");
248 ret = -ENOMEM;
249 goto err2;
250 }
251
252 irq = platform_get_irq(pdev, 0);
253 ret = request_irq(irq, omap3_l3_app_irq,
254 IRQF_DISABLED | IRQF_TRIGGER_RISING,
255 "l3-debug-irq", l3);
256 if (ret) {
257 dev_err(&pdev->dev, "couldn't request debug irq\n");
258 goto err3;
259 }
260 l3->debug_irq = irq;
261
262 irq = platform_get_irq(pdev, 1);
263 ret = request_irq(irq, omap3_l3_app_irq,
264 IRQF_DISABLED | IRQF_TRIGGER_RISING,
265 "l3-app-irq", l3);
266
267 if (ret) {
268 dev_err(&pdev->dev, "couldn't request app irq\n");
269 goto err4;
270 }
271
272 l3->app_irq = irq;
273 goto err0;
274
275err4:
276err3:
277 iounmap(l3->rt);
278err2:
279err1:
280 kfree(l3);
281err0:
282 return ret;
283}
284
285static int __exit omap3_l3_remove(struct platform_device *pdev)
286{
287 struct omap3_l3 *l3 = platform_get_drvdata(pdev);
288
289 free_irq(l3->app_irq, l3);
290 free_irq(l3->debug_irq, l3);
291 iounmap(l3->rt);
292 kfree(l3);
293
294 return 0;
295}
296
297static struct platform_driver omap3_l3_driver = {
298 .remove = __exit_p(omap3_l3_remove),
299 .driver = {
300 .name = "omap_l3_smx",
301 },
302};
303
304static int __init omap3_l3_init(void)
305{
306 return platform_driver_probe(&omap3_l3_driver, omap3_l3_probe);
307}
308postcore_initcall_sync(omap3_l3_init);
309
310static void __exit omap3_l3_exit(void)
311{
312 platform_driver_unregister(&omap3_l3_driver);
313}
314module_exit(omap3_l3_exit);
diff --git a/arch/arm/mach-omap2/omap_l3_smx.h b/arch/arm/mach-omap2/omap_l3_smx.h
new file mode 100644
index 000000000000..ba2ed9a850cc
--- /dev/null
+++ b/arch/arm/mach-omap2/omap_l3_smx.h
@@ -0,0 +1,338 @@
1 /*
2 * OMAP3XXX L3 Interconnect Driver header
3 *
4 * Copyright (C) 2011 Texas Corporation
5 * Felipe Balbi <balbi@ti.com>
6 * Santosh Shilimkar <santosh.shilimkar@ti.com>
7 * sricharan <r.sricharan@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 * USA
23 */
24#ifndef __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H
25#define __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H
26
27/* Register definitions. All 64-bit wide */
28#define L3_COMPONENT 0x000
29#define L3_CORE 0x018
30#define L3_AGENT_CONTROL 0x020
31#define L3_AGENT_STATUS 0x028
32#define L3_ERROR_LOG 0x058
33
34#define L3_ERROR_LOG_MULTI (1 << 31)
35#define L3_ERROR_LOG_SECONDARY (1 << 30)
36
37#define L3_ERROR_LOG_ADDR 0x060
38
39/* Register definitions for Sideband Interconnect */
40#define L3_SI_CONTROL 0x020
41#define L3_SI_FLAG_STATUS_0 0x510
42
43const u64 shift = 1;
44
45#define L3_STATUS_0_MPUIA_BRST (shift << 0)
46#define L3_STATUS_0_MPUIA_RSP (shift << 1)
47#define L3_STATUS_0_MPUIA_INBAND (shift << 2)
48#define L3_STATUS_0_IVAIA_BRST (shift << 6)
49#define L3_STATUS_0_IVAIA_RSP (shift << 7)
50#define L3_STATUS_0_IVAIA_INBAND (shift << 8)
51#define L3_STATUS_0_SGXIA_BRST (shift << 9)
52#define L3_STATUS_0_SGXIA_RSP (shift << 10)
53#define L3_STATUS_0_SGXIA_MERROR (shift << 11)
54#define L3_STATUS_0_CAMIA_BRST (shift << 12)
55#define L3_STATUS_0_CAMIA_RSP (shift << 13)
56#define L3_STATUS_0_CAMIA_INBAND (shift << 14)
57#define L3_STATUS_0_DISPIA_BRST (shift << 15)
58#define L3_STATUS_0_DISPIA_RSP (shift << 16)
59#define L3_STATUS_0_DMARDIA_BRST (shift << 18)
60#define L3_STATUS_0_DMARDIA_RSP (shift << 19)
61#define L3_STATUS_0_DMAWRIA_BRST (shift << 21)
62#define L3_STATUS_0_DMAWRIA_RSP (shift << 22)
63#define L3_STATUS_0_USBOTGIA_BRST (shift << 24)
64#define L3_STATUS_0_USBOTGIA_RSP (shift << 25)
65#define L3_STATUS_0_USBOTGIA_INBAND (shift << 26)
66#define L3_STATUS_0_USBHOSTIA_BRST (shift << 27)
67#define L3_STATUS_0_USBHOSTIA_INBAND (shift << 28)
68#define L3_STATUS_0_SMSTA_REQ (shift << 48)
69#define L3_STATUS_0_GPMCTA_REQ (shift << 49)
70#define L3_STATUS_0_OCMRAMTA_REQ (shift << 50)
71#define L3_STATUS_0_OCMROMTA_REQ (shift << 51)
72#define L3_STATUS_0_IVATA_REQ (shift << 54)
73#define L3_STATUS_0_SGXTA_REQ (shift << 55)
74#define L3_STATUS_0_SGXTA_SERROR (shift << 56)
75#define L3_STATUS_0_GPMCTA_SERROR (shift << 57)
76#define L3_STATUS_0_L4CORETA_REQ (shift << 58)
77#define L3_STATUS_0_L4PERTA_REQ (shift << 59)
78#define L3_STATUS_0_L4EMUTA_REQ (shift << 60)
79#define L3_STATUS_0_MAD2DTA_REQ (shift << 61)
80
81#define L3_STATUS_0_TIMEOUT_MASK (L3_STATUS_0_MPUIA_BRST \
82 | L3_STATUS_0_MPUIA_RSP \
83 | L3_STATUS_0_IVAIA_BRST \
84 | L3_STATUS_0_IVAIA_RSP \
85 | L3_STATUS_0_SGXIA_BRST \
86 | L3_STATUS_0_SGXIA_RSP \
87 | L3_STATUS_0_CAMIA_BRST \
88 | L3_STATUS_0_CAMIA_RSP \
89 | L3_STATUS_0_DISPIA_BRST \
90 | L3_STATUS_0_DISPIA_RSP \
91 | L3_STATUS_0_DMARDIA_BRST \
92 | L3_STATUS_0_DMARDIA_RSP \
93 | L3_STATUS_0_DMAWRIA_BRST \
94 | L3_STATUS_0_DMAWRIA_RSP \
95 | L3_STATUS_0_USBOTGIA_BRST \
96 | L3_STATUS_0_USBOTGIA_RSP \
97 | L3_STATUS_0_USBHOSTIA_BRST \
98 | L3_STATUS_0_SMSTA_REQ \
99 | L3_STATUS_0_GPMCTA_REQ \
100 | L3_STATUS_0_OCMRAMTA_REQ \
101 | L3_STATUS_0_OCMROMTA_REQ \
102 | L3_STATUS_0_IVATA_REQ \
103 | L3_STATUS_0_SGXTA_REQ \
104 | L3_STATUS_0_L4CORETA_REQ \
105 | L3_STATUS_0_L4PERTA_REQ \
106 | L3_STATUS_0_L4EMUTA_REQ \
107 | L3_STATUS_0_MAD2DTA_REQ)
108
109#define L3_SI_FLAG_STATUS_1 0x530
110
111#define L3_STATUS_1_MPU_DATAIA (1 << 0)
112#define L3_STATUS_1_DAPIA0 (1 << 3)
113#define L3_STATUS_1_DAPIA1 (1 << 4)
114#define L3_STATUS_1_IVAIA (1 << 6)
115
116#define L3_PM_ERROR_LOG 0x020
117#define L3_PM_CONTROL 0x028
118#define L3_PM_ERROR_CLEAR_SINGLE 0x030
119#define L3_PM_ERROR_CLEAR_MULTI 0x038
120#define L3_PM_REQ_INFO_PERMISSION(n) (0x048 + (0x020 * n))
121#define L3_PM_READ_PERMISSION(n) (0x050 + (0x020 * n))
122#define L3_PM_WRITE_PERMISSION(n) (0x058 + (0x020 * n))
123#define L3_PM_ADDR_MATCH(n) (0x060 + (0x020 * n))
124
125/* L3 error log bit fields. Common for IA and TA */
126#define L3_ERROR_LOG_CODE 24
127#define L3_ERROR_LOG_INITID 8
128#define L3_ERROR_LOG_CMD 0
129
130/* L3 agent status bit fields. */
131#define L3_AGENT_STATUS_CLEAR_IA 0x10000000
132#define L3_AGENT_STATUS_CLEAR_TA 0x01000000
133
134#define OMAP34xx_IRQ_L3_APP 10
135#define L3_APPLICATION_ERROR 0x0
136#define L3_DEBUG_ERROR 0x1
137
138enum omap3_l3_initiator_id {
139 /* LCD has 1 ID */
140 OMAP_L3_LCD = 29,
141 /* SAD2D has 1 ID */
142 OMAP_L3_SAD2D = 28,
143 /* MPU has 5 IDs */
144 OMAP_L3_IA_MPU_SS_1 = 27,
145 OMAP_L3_IA_MPU_SS_2 = 26,
146 OMAP_L3_IA_MPU_SS_3 = 25,
147 OMAP_L3_IA_MPU_SS_4 = 24,
148 OMAP_L3_IA_MPU_SS_5 = 23,
149 /* IVA2.2 SS has 3 IDs*/
150 OMAP_L3_IA_IVA_SS_1 = 22,
151 OMAP_L3_IA_IVA_SS_2 = 21,
152 OMAP_L3_IA_IVA_SS_3 = 20,
153 /* IVA 2.2 SS DMA has 6 IDS */
154 OMAP_L3_IA_IVA_SS_DMA_1 = 19,
155 OMAP_L3_IA_IVA_SS_DMA_2 = 18,
156 OMAP_L3_IA_IVA_SS_DMA_3 = 17,
157 OMAP_L3_IA_IVA_SS_DMA_4 = 16,
158 OMAP_L3_IA_IVA_SS_DMA_5 = 15,
159 OMAP_L3_IA_IVA_SS_DMA_6 = 14,
160 /* SGX has 1 ID */
161 OMAP_L3_IA_SGX = 13,
162 /* CAM has 3 ID */
163 OMAP_L3_IA_CAM_1 = 12,
164 OMAP_L3_IA_CAM_2 = 11,
165 OMAP_L3_IA_CAM_3 = 10,
166 /* DAP has 1 ID */
167 OMAP_L3_IA_DAP = 9,
168 /* SDMA WR has 2 IDs */
169 OMAP_L3_SDMA_WR_1 = 8,
170 OMAP_L3_SDMA_WR_2 = 7,
171 /* SDMA RD has 4 IDs */
172 OMAP_L3_SDMA_RD_1 = 6,
173 OMAP_L3_SDMA_RD_2 = 5,
174 OMAP_L3_SDMA_RD_3 = 4,
175 OMAP_L3_SDMA_RD_4 = 3,
176 /* HSUSB OTG has 1 ID */
177 OMAP_L3_USBOTG = 2,
178 /* HSUSB HOST has 1 ID */
179 OMAP_L3_USBHOST = 1,
180};
181
182enum omap3_l3_code {
183 OMAP_L3_CODE_NOERROR = 0,
184 OMAP_L3_CODE_UNSUP_CMD = 1,
185 OMAP_L3_CODE_ADDR_HOLE = 2,
186 OMAP_L3_CODE_PROTECT_VIOLATION = 3,
187 OMAP_L3_CODE_IN_BAND_ERR = 4,
188 /* codes 5 and 6 are reserved */
189 OMAP_L3_CODE_REQ_TOUT_NOT_ACCEPT = 7,
190 OMAP_L3_CODE_REQ_TOUT_NO_RESP = 8,
191 /* codes 9 - 15 are also reserved */
192};
193
194struct omap3_l3 {
195 struct device *dev;
196 struct clk *ick;
197
198 /* memory base*/
199 void __iomem *rt;
200
201 int debug_irq;
202 int app_irq;
203
204 /* true when and inband functional error occurs */
205 unsigned inband:1;
206};
207
208/* offsets for l3 agents in order with the Flag status register */
209unsigned int __iomem omap3_l3_app_bases[] = {
210 /* MPU IA */
211 0x1400,
212 0x1400,
213 0x1400,
214 /* RESERVED */
215 0,
216 0,
217 0,
218 /* IVA 2.2 IA */
219 0x1800,
220 0x1800,
221 0x1800,
222 /* SGX IA */
223 0x1c00,
224 0x1c00,
225 /* RESERVED */
226 0,
227 /* CAMERA IA */
228 0x5800,
229 0x5800,
230 0x5800,
231 /* DISPLAY IA */
232 0x5400,
233 0x5400,
234 /* RESERVED */
235 0,
236 /*SDMA RD IA */
237 0x4c00,
238 0x4c00,
239 /* RESERVED */
240 0,
241 /* SDMA WR IA */
242 0x5000,
243 0x5000,
244 /* RESERVED */
245 0,
246 /* USB OTG IA */
247 0x4400,
248 0x4400,
249 0x4400,
250 /* USB HOST IA */
251 0x4000,
252 0x4000,
253 /* RESERVED */
254 0,
255 0,
256 0,
257 0,
258 /* SAD2D IA */
259 0x3000,
260 0x3000,
261 0x3000,
262 /* RESERVED */
263 0,
264 0,
265 0,
266 0,
267 0,
268 0,
269 0,
270 0,
271 0,
272 0,
273 0,
274 0,
275 /* SMA TA */
276 0x2000,
277 /* GPMC TA */
278 0x2400,
279 /* OCM RAM TA */
280 0x2800,
281 /* OCM ROM TA */
282 0x2C00,
283 /* L4 CORE TA */
284 0x6800,
285 /* L4 PER TA */
286 0x6c00,
287 /* IVA 2.2 TA */
288 0x6000,
289 /* SGX TA */
290 0x6400,
291 /* L4 EMU TA */
292 0x7000,
293 /* GPMC TA */
294 0x2400,
295 /* L4 CORE TA */
296 0x6800,
297 /* L4 PER TA */
298 0x6c00,
299 /* L4 EMU TA */
300 0x7000,
301 /* MAD2D TA */
302 0x3400,
303 /* RESERVED */
304 0,
305 0,
306};
307
308unsigned int __iomem omap3_l3_debug_bases[] = {
309 /* MPU DATA IA */
310 0x1400,
311 /* RESERVED */
312 0,
313 0,
314 /* DAP IA */
315 0x5c00,
316 0x5c00,
317 /* RESERVED */
318 0,
319 /* IVA 2.2 IA */
320 0x1800,
321 /* REST RESERVED */
322};
323
324u32 *omap3_l3_bases[] = {
325 omap3_l3_app_bases,
326 omap3_l3_debug_bases,
327};
328
329/*
330 * REVISIT define __raw_readll/__raw_writell here, but move them to
331 * <asm/io.h> at some point
332 */
333#define __raw_writell(v, a) (__chk_io_ptr(a), \
334 *(volatile u64 __force *)(a) = (v))
335#define __raw_readll(a) (__chk_io_ptr(a), \
336 *(volatile u64 __force *)(a))
337
338#endif
diff --git a/arch/arm/mach-omap2/omap_opp_data.h b/arch/arm/mach-omap2/omap_opp_data.h
index 46ac27dd6c84..c784c12f98a1 100644
--- a/arch/arm/mach-omap2/omap_opp_data.h
+++ b/arch/arm/mach-omap2/omap_opp_data.h
@@ -21,6 +21,8 @@
21 21
22#include <plat/omap_hwmod.h> 22#include <plat/omap_hwmod.h>
23 23
24#include "voltage.h"
25
24/* 26/*
25 * *BIG FAT WARNING*: 27 * *BIG FAT WARNING*:
26 * USE the following ONLY in opp data initialization common to an SoC. 28 * USE the following ONLY in opp data initialization common to an SoC.
@@ -65,8 +67,30 @@ struct omap_opp_def {
65 .u_volt = _uv, \ 67 .u_volt = _uv, \
66} 68}
67 69
70/*
71 * Initialization wrapper used to define SmartReflex process data
72 * XXX Is this needed? Just use C99 initializers in data files?
73 */
74#define VOLT_DATA_DEFINE(_v_nom, _efuse_offs, _errminlimit, _errgain) \
75{ \
76 .volt_nominal = _v_nom, \
77 .sr_efuse_offs = _efuse_offs, \
78 .sr_errminlimit = _errminlimit, \
79 .vp_errgain = _errgain \
80}
81
68/* Use this to initialize the default table */ 82/* Use this to initialize the default table */
69extern int __init omap_init_opp_table(struct omap_opp_def *opp_def, 83extern int __init omap_init_opp_table(struct omap_opp_def *opp_def,
70 u32 opp_def_size); 84 u32 opp_def_size);
71 85
86
87extern struct omap_volt_data omap34xx_vddmpu_volt_data[];
88extern struct omap_volt_data omap34xx_vddcore_volt_data[];
89extern struct omap_volt_data omap36xx_vddmpu_volt_data[];
90extern struct omap_volt_data omap36xx_vddcore_volt_data[];
91
92extern struct omap_volt_data omap44xx_vdd_mpu_volt_data[];
93extern struct omap_volt_data omap44xx_vdd_iva_volt_data[];
94extern struct omap_volt_data omap44xx_vdd_core_volt_data[];
95
72#endif /* __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H */ 96#endif /* __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H */
diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c
index 745252c60e32..e2e605fe9138 100644
--- a/arch/arm/mach-omap2/omap_phy_internal.c
+++ b/arch/arm/mach-omap2/omap_phy_internal.c
@@ -29,6 +29,7 @@
29#include <linux/usb.h> 29#include <linux/usb.h>
30 30
31#include <plat/usb.h> 31#include <plat/usb.h>
32#include "control.h"
32 33
33/* OMAP control module register for UTMI PHY */ 34/* OMAP control module register for UTMI PHY */
34#define CONTROL_DEV_CONF 0x300 35#define CONTROL_DEV_CONF 0x300
@@ -43,6 +44,7 @@
43 44
44static struct clk *phyclk, *clk48m, *clk32k; 45static struct clk *phyclk, *clk48m, *clk32k;
45static void __iomem *ctrl_base; 46static void __iomem *ctrl_base;
47static int usbotghs_control;
46 48
47int omap4430_phy_init(struct device *dev) 49int omap4430_phy_init(struct device *dev)
48{ 50{
@@ -103,13 +105,6 @@ int omap4430_phy_set_clk(struct device *dev, int on)
103int omap4430_phy_power(struct device *dev, int ID, int on) 105int omap4430_phy_power(struct device *dev, int ID, int on)
104{ 106{
105 if (on) { 107 if (on) {
106 /* enabled the clocks */
107 omap4430_phy_set_clk(dev, 1);
108 /* power on the phy */
109 if (__raw_readl(ctrl_base + CONTROL_DEV_CONF) & PHY_PD) {
110 __raw_writel(~PHY_PD, ctrl_base + CONTROL_DEV_CONF);
111 mdelay(200);
112 }
113 if (ID) 108 if (ID)
114 /* enable VBUS valid, IDDIG groung */ 109 /* enable VBUS valid, IDDIG groung */
115 __raw_writel(AVALID | VBUSVALID, ctrl_base + 110 __raw_writel(AVALID | VBUSVALID, ctrl_base +
@@ -125,10 +120,31 @@ int omap4430_phy_power(struct device *dev, int ID, int on)
125 /* Enable session END and IDIG to high impedence. */ 120 /* Enable session END and IDIG to high impedence. */
126 __raw_writel(SESSEND | IDDIG, ctrl_base + 121 __raw_writel(SESSEND | IDDIG, ctrl_base +
127 USBOTGHS_CONTROL); 122 USBOTGHS_CONTROL);
123 }
124 return 0;
125}
126
127int omap4430_phy_suspend(struct device *dev, int suspend)
128{
129 if (suspend) {
128 /* Disable the clocks */ 130 /* Disable the clocks */
129 omap4430_phy_set_clk(dev, 0); 131 omap4430_phy_set_clk(dev, 0);
130 /* Power down the phy */ 132 /* Power down the phy */
131 __raw_writel(PHY_PD, ctrl_base + CONTROL_DEV_CONF); 133 __raw_writel(PHY_PD, ctrl_base + CONTROL_DEV_CONF);
134
135 /* save the context */
136 usbotghs_control = __raw_readl(ctrl_base + USBOTGHS_CONTROL);
137 } else {
138 /* Enable the internel phy clcoks */
139 omap4430_phy_set_clk(dev, 1);
140 /* power on the phy */
141 if (__raw_readl(ctrl_base + CONTROL_DEV_CONF) & PHY_PD) {
142 __raw_writel(~PHY_PD, ctrl_base + CONTROL_DEV_CONF);
143 mdelay(200);
144 }
145
146 /* restore the context */
147 __raw_writel(usbotghs_control, ctrl_base + USBOTGHS_CONTROL);
132 } 148 }
133 149
134 return 0; 150 return 0;
@@ -147,3 +163,95 @@ int omap4430_phy_exit(struct device *dev)
147 163
148 return 0; 164 return 0;
149} 165}
166
167void am35x_musb_reset(void)
168{
169 u32 regval;
170
171 /* Reset the musb interface */
172 regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
173
174 regval |= AM35XX_USBOTGSS_SW_RST;
175 omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET);
176
177 regval &= ~AM35XX_USBOTGSS_SW_RST;
178 omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET);
179
180 regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
181}
182
183void am35x_musb_phy_power(u8 on)
184{
185 unsigned long timeout = jiffies + msecs_to_jiffies(100);
186 u32 devconf2;
187
188 if (on) {
189 /*
190 * Start the on-chip PHY and its PLL.
191 */
192 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
193
194 devconf2 &= ~(CONF2_RESET | CONF2_PHYPWRDN | CONF2_OTGPWRDN);
195 devconf2 |= CONF2_PHY_PLLON;
196
197 omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
198
199 pr_info(KERN_INFO "Waiting for PHY clock good...\n");
200 while (!(omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2)
201 & CONF2_PHYCLKGD)) {
202 cpu_relax();
203
204 if (time_after(jiffies, timeout)) {
205 pr_err(KERN_ERR "musb PHY clock good timed out\n");
206 break;
207 }
208 }
209 } else {
210 /*
211 * Power down the on-chip PHY.
212 */
213 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
214
215 devconf2 &= ~CONF2_PHY_PLLON;
216 devconf2 |= CONF2_PHYPWRDN | CONF2_OTGPWRDN;
217 omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
218 }
219}
220
221void am35x_musb_clear_irq(void)
222{
223 u32 regval;
224
225 regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
226 regval |= AM35XX_USBOTGSS_INT_CLR;
227 omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
228 regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
229}
230
231void am35x_musb_set_mode(u8 musb_mode)
232{
233 u32 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
234
235 devconf2 &= ~CONF2_OTGMODE;
236 switch (musb_mode) {
237#ifdef CONFIG_USB_MUSB_HDRC_HCD
238 case MUSB_HOST: /* Force VBUS valid, ID = 0 */
239 devconf2 |= CONF2_FORCE_HOST;
240 break;
241#endif
242#ifdef CONFIG_USB_GADGET_MUSB_HDRC
243 case MUSB_PERIPHERAL: /* Force VBUS valid, ID = 1 */
244 devconf2 |= CONF2_FORCE_DEVICE;
245 break;
246#endif
247#ifdef CONFIG_USB_MUSB_OTG
248 case MUSB_OTG: /* Don't override the VBUS/ID comparators */
249 devconf2 |= CONF2_NO_OVERRIDE;
250 break;
251#endif
252 default:
253 pr_info(KERN_INFO "Unsupported mode %u\n", musb_mode);
254 }
255
256 omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
257}
diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c
index 00e1d2b53683..0a8e74e3e811 100644
--- a/arch/arm/mach-omap2/omap_twl.c
+++ b/arch/arm/mach-omap2/omap_twl.c
@@ -18,7 +18,7 @@
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/i2c/twl.h> 19#include <linux/i2c/twl.h>
20 20
21#include <plat/voltage.h> 21#include "voltage.h"
22 22
23#include "pm.h" 23#include "pm.h"
24 24
@@ -59,8 +59,15 @@
59 59
60static bool is_offset_valid; 60static bool is_offset_valid;
61static u8 smps_offset; 61static u8 smps_offset;
62/*
63 * Flag to ensure Smartreflex bit in TWL
64 * being cleared in board file is not overwritten.
65 */
66static bool __initdata twl_sr_enable_autoinit;
62 67
68#define TWL4030_DCDC_GLOBAL_CFG 0x06
63#define REG_SMPS_OFFSET 0xE0 69#define REG_SMPS_OFFSET 0xE0
70#define SMARTREFLEX_ENABLE BIT(3)
64 71
65static unsigned long twl4030_vsel_to_uv(const u8 vsel) 72static unsigned long twl4030_vsel_to_uv(const u8 vsel)
66{ 73{
@@ -269,6 +276,18 @@ int __init omap3_twl_init(void)
269 omap3_core_volt_info.vp_vddmax = OMAP3630_VP2_VLIMITTO_VDDMAX; 276 omap3_core_volt_info.vp_vddmax = OMAP3630_VP2_VLIMITTO_VDDMAX;
270 } 277 }
271 278
279 /*
280 * The smartreflex bit on twl4030 specifies if the setting of voltage
281 * is done over the I2C_SR path. Since this setting is independent of
282 * the actual usage of smartreflex AVS module, we enable TWL SR bit
283 * by default irrespective of whether smartreflex AVS module is enabled
284 * on the OMAP side or not. This is because without this bit enabled,
285 * the voltage scaling through vp forceupdate/bypass mechanism of
286 * voltage scaling will not function on TWL over I2C_SR.
287 */
288 if (!twl_sr_enable_autoinit)
289 omap3_twl_set_sr_bit(true);
290
272 voltdm = omap_voltage_domain_lookup("mpu"); 291 voltdm = omap_voltage_domain_lookup("mpu");
273 omap_voltage_register_pmic(voltdm, &omap3_mpu_volt_info); 292 omap_voltage_register_pmic(voltdm, &omap3_mpu_volt_info);
274 293
@@ -277,3 +296,44 @@ int __init omap3_twl_init(void)
277 296
278 return 0; 297 return 0;
279} 298}
299
300/**
301 * omap3_twl_set_sr_bit() - Set/Clear SR bit on TWL
302 * @enable: enable SR mode in twl or not
303 *
304 * If 'enable' is true, enables Smartreflex bit on TWL 4030 to make sure
305 * voltage scaling through OMAP SR works. Else, the smartreflex bit
306 * on twl4030 is cleared as there are platforms which use OMAP3 and T2 but
307 * use Synchronized Scaling Hardware Strategy (ENABLE_VMODE=1) and Direct
308 * Strategy Software Scaling Mode (ENABLE_VMODE=0), for setting the voltages,
309 * in those scenarios this bit is to be cleared (enable = false).
310 *
311 * Returns 0 on sucess, error is returned if I2C read/write fails.
312 */
313int __init omap3_twl_set_sr_bit(bool enable)
314{
315 u8 temp;
316 int ret;
317 if (twl_sr_enable_autoinit)
318 pr_warning("%s: unexpected multiple calls\n", __func__);
319
320 ret = twl_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, &temp,
321 TWL4030_DCDC_GLOBAL_CFG);
322 if (ret)
323 goto err;
324
325 if (enable)
326 temp |= SMARTREFLEX_ENABLE;
327 else
328 temp &= ~SMARTREFLEX_ENABLE;
329
330 ret = twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, temp,
331 TWL4030_DCDC_GLOBAL_CFG);
332 if (!ret) {
333 twl_sr_enable_autoinit = true;
334 return 0;
335 }
336err:
337 pr_err("%s: Error access to TWL4030 (%d)\n", __func__, ret);
338 return ret;
339}
diff --git a/arch/arm/mach-omap2/opp2xxx.h b/arch/arm/mach-omap2/opp2xxx.h
index 38b730550506..8affc66a92c2 100644
--- a/arch/arm/mach-omap2/opp2xxx.h
+++ b/arch/arm/mach-omap2/opp2xxx.h
@@ -418,7 +418,7 @@ struct prcm_config {
418 418
419extern const struct prcm_config omap2420_rate_table[]; 419extern const struct prcm_config omap2420_rate_table[];
420 420
421#ifdef CONFIG_ARCH_OMAP2430 421#ifdef CONFIG_SOC_OMAP2430
422extern const struct prcm_config omap2430_rate_table[]; 422extern const struct prcm_config omap2430_rate_table[];
423#else 423#else
424#define omap2430_rate_table NULL 424#define omap2430_rate_table NULL
diff --git a/arch/arm/mach-omap2/opp3xxx_data.c b/arch/arm/mach-omap2/opp3xxx_data.c
index 0486fce8a92c..d95f3f945d4a 100644
--- a/arch/arm/mach-omap2/opp3xxx_data.c
+++ b/arch/arm/mach-omap2/opp3xxx_data.c
@@ -4,8 +4,9 @@
4 * Copyright (C) 2009-2010 Texas Instruments Incorporated - http://www.ti.com/ 4 * Copyright (C) 2009-2010 Texas Instruments Incorporated - http://www.ti.com/
5 * Nishanth Menon 5 * Nishanth Menon
6 * Kevin Hilman 6 * Kevin Hilman
7 * Copyright (C) 2010 Nokia Corporation. 7 * Copyright (C) 2010-2011 Nokia Corporation.
8 * Eduardo Valentin 8 * Eduardo Valentin
9 * Paul Walmsley
9 * 10 *
10 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 12 * it under the terms of the GNU General Public License version 2 as
@@ -20,19 +21,83 @@
20 21
21#include <plat/cpu.h> 22#include <plat/cpu.h>
22 23
24#include "control.h"
23#include "omap_opp_data.h" 25#include "omap_opp_data.h"
26#include "pm.h"
27
28/* 34xx */
29
30/* VDD1 */
31
32#define OMAP3430_VDD_MPU_OPP1_UV 975000
33#define OMAP3430_VDD_MPU_OPP2_UV 1075000
34#define OMAP3430_VDD_MPU_OPP3_UV 1200000
35#define OMAP3430_VDD_MPU_OPP4_UV 1270000
36#define OMAP3430_VDD_MPU_OPP5_UV 1350000
37
38struct omap_volt_data omap34xx_vddmpu_volt_data[] = {
39 VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP1_UV, OMAP343X_CONTROL_FUSE_OPP1_VDD1, 0xf4, 0x0c),
40 VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP2_UV, OMAP343X_CONTROL_FUSE_OPP2_VDD1, 0xf4, 0x0c),
41 VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP3_UV, OMAP343X_CONTROL_FUSE_OPP3_VDD1, 0xf9, 0x18),
42 VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP4_UV, OMAP343X_CONTROL_FUSE_OPP4_VDD1, 0xf9, 0x18),
43 VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP5_UV, OMAP343X_CONTROL_FUSE_OPP5_VDD1, 0xf9, 0x18),
44 VOLT_DATA_DEFINE(0, 0, 0, 0),
45};
46
47/* VDD2 */
48
49#define OMAP3430_VDD_CORE_OPP1_UV 975000
50#define OMAP3430_VDD_CORE_OPP2_UV 1050000
51#define OMAP3430_VDD_CORE_OPP3_UV 1150000
52
53struct omap_volt_data omap34xx_vddcore_volt_data[] = {
54 VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP1_UV, OMAP343X_CONTROL_FUSE_OPP1_VDD2, 0xf4, 0x0c),
55 VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP2_UV, OMAP343X_CONTROL_FUSE_OPP2_VDD2, 0xf4, 0x0c),
56 VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP3_UV, OMAP343X_CONTROL_FUSE_OPP3_VDD2, 0xf9, 0x18),
57 VOLT_DATA_DEFINE(0, 0, 0, 0),
58};
59
60/* 36xx */
61
62/* VDD1 */
63
64#define OMAP3630_VDD_MPU_OPP50_UV 1012500
65#define OMAP3630_VDD_MPU_OPP100_UV 1200000
66#define OMAP3630_VDD_MPU_OPP120_UV 1325000
67#define OMAP3630_VDD_MPU_OPP1G_UV 1375000
68
69struct omap_volt_data omap36xx_vddmpu_volt_data[] = {
70 VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP50_UV, OMAP3630_CONTROL_FUSE_OPP50_VDD1, 0xf4, 0x0c),
71 VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP100_UV, OMAP3630_CONTROL_FUSE_OPP100_VDD1, 0xf9, 0x16),
72 VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP120_UV, OMAP3630_CONTROL_FUSE_OPP120_VDD1, 0xfa, 0x23),
73 VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP1G_UV, OMAP3630_CONTROL_FUSE_OPP1G_VDD1, 0xfa, 0x27),
74 VOLT_DATA_DEFINE(0, 0, 0, 0),
75};
76
77/* VDD2 */
78
79#define OMAP3630_VDD_CORE_OPP50_UV 1000000
80#define OMAP3630_VDD_CORE_OPP100_UV 1200000
81
82struct omap_volt_data omap36xx_vddcore_volt_data[] = {
83 VOLT_DATA_DEFINE(OMAP3630_VDD_CORE_OPP50_UV, OMAP3630_CONTROL_FUSE_OPP50_VDD2, 0xf4, 0x0c),
84 VOLT_DATA_DEFINE(OMAP3630_VDD_CORE_OPP100_UV, OMAP3630_CONTROL_FUSE_OPP100_VDD2, 0xf9, 0x16),
85 VOLT_DATA_DEFINE(0, 0, 0, 0),
86};
87
88/* OPP data */
24 89
25static struct omap_opp_def __initdata omap34xx_opp_def_list[] = { 90static struct omap_opp_def __initdata omap34xx_opp_def_list[] = {
26 /* MPU OPP1 */ 91 /* MPU OPP1 */
27 OPP_INITIALIZER("mpu", true, 125000000, 975000), 92 OPP_INITIALIZER("mpu", true, 125000000, OMAP3430_VDD_MPU_OPP1_UV),
28 /* MPU OPP2 */ 93 /* MPU OPP2 */
29 OPP_INITIALIZER("mpu", true, 250000000, 1075000), 94 OPP_INITIALIZER("mpu", true, 250000000, OMAP3430_VDD_MPU_OPP2_UV),
30 /* MPU OPP3 */ 95 /* MPU OPP3 */
31 OPP_INITIALIZER("mpu", true, 500000000, 1200000), 96 OPP_INITIALIZER("mpu", true, 500000000, OMAP3430_VDD_MPU_OPP3_UV),
32 /* MPU OPP4 */ 97 /* MPU OPP4 */
33 OPP_INITIALIZER("mpu", true, 550000000, 1270000), 98 OPP_INITIALIZER("mpu", true, 550000000, OMAP3430_VDD_MPU_OPP4_UV),
34 /* MPU OPP5 */ 99 /* MPU OPP5 */
35 OPP_INITIALIZER("mpu", true, 600000000, 1350000), 100 OPP_INITIALIZER("mpu", true, 600000000, OMAP3430_VDD_MPU_OPP5_UV),
36 101
37 /* 102 /*
38 * L3 OPP1 - 41.5 MHz is disabled because: The voltage for that OPP is 103 * L3 OPP1 - 41.5 MHz is disabled because: The voltage for that OPP is
@@ -42,53 +107,53 @@ static struct omap_opp_def __initdata omap34xx_opp_def_list[] = {
42 * impact that frequency will do to the MPU and the whole system in 107 * impact that frequency will do to the MPU and the whole system in
43 * general. 108 * general.
44 */ 109 */
45 OPP_INITIALIZER("l3_main", false, 41500000, 975000), 110 OPP_INITIALIZER("l3_main", false, 41500000, OMAP3430_VDD_CORE_OPP1_UV),
46 /* L3 OPP2 */ 111 /* L3 OPP2 */
47 OPP_INITIALIZER("l3_main", true, 83000000, 1050000), 112 OPP_INITIALIZER("l3_main", true, 83000000, OMAP3430_VDD_CORE_OPP2_UV),
48 /* L3 OPP3 */ 113 /* L3 OPP3 */
49 OPP_INITIALIZER("l3_main", true, 166000000, 1150000), 114 OPP_INITIALIZER("l3_main", true, 166000000, OMAP3430_VDD_CORE_OPP3_UV),
50 115
51 /* DSP OPP1 */ 116 /* DSP OPP1 */
52 OPP_INITIALIZER("iva", true, 90000000, 975000), 117 OPP_INITIALIZER("iva", true, 90000000, OMAP3430_VDD_MPU_OPP1_UV),
53 /* DSP OPP2 */ 118 /* DSP OPP2 */
54 OPP_INITIALIZER("iva", true, 180000000, 1075000), 119 OPP_INITIALIZER("iva", true, 180000000, OMAP3430_VDD_MPU_OPP2_UV),
55 /* DSP OPP3 */ 120 /* DSP OPP3 */
56 OPP_INITIALIZER("iva", true, 360000000, 1200000), 121 OPP_INITIALIZER("iva", true, 360000000, OMAP3430_VDD_MPU_OPP3_UV),
57 /* DSP OPP4 */ 122 /* DSP OPP4 */
58 OPP_INITIALIZER("iva", true, 400000000, 1270000), 123 OPP_INITIALIZER("iva", true, 400000000, OMAP3430_VDD_MPU_OPP4_UV),
59 /* DSP OPP5 */ 124 /* DSP OPP5 */
60 OPP_INITIALIZER("iva", true, 430000000, 1350000), 125 OPP_INITIALIZER("iva", true, 430000000, OMAP3430_VDD_MPU_OPP5_UV),
61}; 126};
62 127
63static struct omap_opp_def __initdata omap36xx_opp_def_list[] = { 128static struct omap_opp_def __initdata omap36xx_opp_def_list[] = {
64 /* MPU OPP1 - OPP50 */ 129 /* MPU OPP1 - OPP50 */
65 OPP_INITIALIZER("mpu", true, 300000000, 1012500), 130 OPP_INITIALIZER("mpu", true, 300000000, OMAP3630_VDD_MPU_OPP50_UV),
66 /* MPU OPP2 - OPP100 */ 131 /* MPU OPP2 - OPP100 */
67 OPP_INITIALIZER("mpu", true, 600000000, 1200000), 132 OPP_INITIALIZER("mpu", true, 600000000, OMAP3630_VDD_MPU_OPP100_UV),
68 /* MPU OPP3 - OPP-Turbo */ 133 /* MPU OPP3 - OPP-Turbo */
69 OPP_INITIALIZER("mpu", false, 800000000, 1325000), 134 OPP_INITIALIZER("mpu", false, 800000000, OMAP3630_VDD_MPU_OPP120_UV),
70 /* MPU OPP4 - OPP-SB */ 135 /* MPU OPP4 - OPP-SB */
71 OPP_INITIALIZER("mpu", false, 1000000000, 1375000), 136 OPP_INITIALIZER("mpu", false, 1000000000, OMAP3630_VDD_MPU_OPP1G_UV),
72 137
73 /* L3 OPP1 - OPP50 */ 138 /* L3 OPP1 - OPP50 */
74 OPP_INITIALIZER("l3_main", true, 100000000, 1000000), 139 OPP_INITIALIZER("l3_main", true, 100000000, OMAP3630_VDD_CORE_OPP50_UV),
75 /* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */ 140 /* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */
76 OPP_INITIALIZER("l3_main", true, 200000000, 1200000), 141 OPP_INITIALIZER("l3_main", true, 200000000, OMAP3630_VDD_CORE_OPP100_UV),
77 142
78 /* DSP OPP1 - OPP50 */ 143 /* DSP OPP1 - OPP50 */
79 OPP_INITIALIZER("iva", true, 260000000, 1012500), 144 OPP_INITIALIZER("iva", true, 260000000, OMAP3630_VDD_MPU_OPP50_UV),
80 /* DSP OPP2 - OPP100 */ 145 /* DSP OPP2 - OPP100 */
81 OPP_INITIALIZER("iva", true, 520000000, 1200000), 146 OPP_INITIALIZER("iva", true, 520000000, OMAP3630_VDD_MPU_OPP100_UV),
82 /* DSP OPP3 - OPP-Turbo */ 147 /* DSP OPP3 - OPP-Turbo */
83 OPP_INITIALIZER("iva", false, 660000000, 1325000), 148 OPP_INITIALIZER("iva", false, 660000000, OMAP3630_VDD_MPU_OPP120_UV),
84 /* DSP OPP4 - OPP-SB */ 149 /* DSP OPP4 - OPP-SB */
85 OPP_INITIALIZER("iva", false, 800000000, 1375000), 150 OPP_INITIALIZER("iva", false, 800000000, OMAP3630_VDD_MPU_OPP1G_UV),
86}; 151};
87 152
88/** 153/**
89 * omap3_opp_init() - initialize omap3 opp table 154 * omap3_opp_init() - initialize omap3 opp table
90 */ 155 */
91static int __init omap3_opp_init(void) 156int __init omap3_opp_init(void)
92{ 157{
93 int r = -ENODEV; 158 int r = -ENODEV;
94 159
diff --git a/arch/arm/mach-omap2/opp4xxx_data.c b/arch/arm/mach-omap2/opp4xxx_data.c
index a11fa566d8ee..2293ba27101b 100644
--- a/arch/arm/mach-omap2/opp4xxx_data.c
+++ b/arch/arm/mach-omap2/opp4xxx_data.c
@@ -5,8 +5,9 @@
5 * Nishanth Menon 5 * Nishanth Menon
6 * Kevin Hilman 6 * Kevin Hilman
7 * Thara Gopinath 7 * Thara Gopinath
8 * Copyright (C) 2010 Nokia Corporation. 8 * Copyright (C) 2010-2011 Nokia Corporation.
9 * Eduardo Valentin 9 * Eduardo Valentin
10 * Paul Walmsley
10 * 11 *
11 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as 13 * it under the terms of the GNU General Public License version 2 as
@@ -21,28 +22,75 @@
21 22
22#include <plat/cpu.h> 23#include <plat/cpu.h>
23 24
25#include "control.h"
24#include "omap_opp_data.h" 26#include "omap_opp_data.h"
27#include "pm.h"
28
29/*
30 * Structures containing OMAP4430 voltage supported and various
31 * voltage dependent data for each VDD.
32 */
33
34#define OMAP4430_VDD_MPU_OPP50_UV 1025000
35#define OMAP4430_VDD_MPU_OPP100_UV 1200000
36#define OMAP4430_VDD_MPU_OPPTURBO_UV 1313000
37#define OMAP4430_VDD_MPU_OPPNITRO_UV 1375000
38
39struct omap_volt_data omap44xx_vdd_mpu_volt_data[] = {
40 VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP50_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP50, 0xf4, 0x0c),
41 VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP100_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP100, 0xf9, 0x16),
42 VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO, 0xfa, 0x23),
43 VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPNITRO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO, 0xfa, 0x27),
44 VOLT_DATA_DEFINE(0, 0, 0, 0),
45};
46
47#define OMAP4430_VDD_IVA_OPP50_UV 1013000
48#define OMAP4430_VDD_IVA_OPP100_UV 1188000
49#define OMAP4430_VDD_IVA_OPPTURBO_UV 1300000
50
51struct omap_volt_data omap44xx_vdd_iva_volt_data[] = {
52 VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP50_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP50, 0xf4, 0x0c),
53 VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP100_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP100, 0xf9, 0x16),
54 VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO, 0xfa, 0x23),
55 VOLT_DATA_DEFINE(0, 0, 0, 0),
56};
57
58#define OMAP4430_VDD_CORE_OPP50_UV 1025000
59#define OMAP4430_VDD_CORE_OPP100_UV 1200000
60
61struct omap_volt_data omap44xx_vdd_core_volt_data[] = {
62 VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP50_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP50, 0xf4, 0x0c),
63 VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP100_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP100, 0xf9, 0x16),
64 VOLT_DATA_DEFINE(0, 0, 0, 0),
65};
66
25 67
26static struct omap_opp_def __initdata omap44xx_opp_def_list[] = { 68static struct omap_opp_def __initdata omap44xx_opp_def_list[] = {
27 /* MPU OPP1 - OPP50 */ 69 /* MPU OPP1 - OPP50 */
28 OPP_INITIALIZER("mpu", true, 300000000, 1100000), 70 OPP_INITIALIZER("mpu", true, 300000000, OMAP4430_VDD_MPU_OPP50_UV),
29 /* MPU OPP2 - OPP100 */ 71 /* MPU OPP2 - OPP100 */
30 OPP_INITIALIZER("mpu", true, 600000000, 1200000), 72 OPP_INITIALIZER("mpu", true, 600000000, OMAP4430_VDD_MPU_OPP100_UV),
31 /* MPU OPP3 - OPP-Turbo */ 73 /* MPU OPP3 - OPP-Turbo */
32 OPP_INITIALIZER("mpu", false, 800000000, 1260000), 74 OPP_INITIALIZER("mpu", true, 800000000, OMAP4430_VDD_MPU_OPPTURBO_UV),
33 /* MPU OPP4 - OPP-SB */ 75 /* MPU OPP4 - OPP-SB */
34 OPP_INITIALIZER("mpu", false, 1008000000, 1350000), 76 OPP_INITIALIZER("mpu", true, 1008000000, OMAP4430_VDD_MPU_OPPNITRO_UV),
35 /* L3 OPP1 - OPP50 */ 77 /* L3 OPP1 - OPP50 */
36 OPP_INITIALIZER("l3_main_1", true, 100000000, 930000), 78 OPP_INITIALIZER("l3_main_1", true, 100000000, OMAP4430_VDD_CORE_OPP50_UV),
37 /* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */ 79 /* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */
38 OPP_INITIALIZER("l3_main_1", true, 200000000, 1100000), 80 OPP_INITIALIZER("l3_main_1", true, 200000000, OMAP4430_VDD_CORE_OPP100_UV),
39 /* TODO: add IVA, DSP, aess, fdif, gpu */ 81 /* IVA OPP1 - OPP50 */
82 OPP_INITIALIZER("iva", true, 133000000, OMAP4430_VDD_IVA_OPP50_UV),
83 /* IVA OPP2 - OPP100 */
84 OPP_INITIALIZER("iva", true, 266100000, OMAP4430_VDD_IVA_OPP100_UV),
85 /* IVA OPP3 - OPP-Turbo */
86 OPP_INITIALIZER("iva", false, 332000000, OMAP4430_VDD_IVA_OPPTURBO_UV),
87 /* TODO: add DSP, aess, fdif, gpu */
40}; 88};
41 89
42/** 90/**
43 * omap4_opp_init() - initialize omap4 opp table 91 * omap4_opp_init() - initialize omap4 opp table
44 */ 92 */
45static int __init omap4_opp_init(void) 93int __init omap4_opp_init(void)
46{ 94{
47 int r = -ENODEV; 95 int r = -ENODEV;
48 96
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index 125f56591fb5..a5a83b358ddd 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -637,14 +637,14 @@ static int __init pm_dbg_init(void)
637 637
638 } 638 }
639 639
640 (void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUGO, d, 640 (void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUSR, d,
641 &enable_off_mode, &pm_dbg_option_fops); 641 &enable_off_mode, &pm_dbg_option_fops);
642 (void) debugfs_create_file("sleep_while_idle", S_IRUGO | S_IWUGO, d, 642 (void) debugfs_create_file("sleep_while_idle", S_IRUGO | S_IWUSR, d,
643 &sleep_while_idle, &pm_dbg_option_fops); 643 &sleep_while_idle, &pm_dbg_option_fops);
644 (void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUGO, d, 644 (void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUSR, d,
645 &wakeup_timer_seconds, &pm_dbg_option_fops); 645 &wakeup_timer_seconds, &pm_dbg_option_fops);
646 (void) debugfs_create_file("wakeup_timer_milliseconds", 646 (void) debugfs_create_file("wakeup_timer_milliseconds",
647 S_IRUGO | S_IWUGO, d, &wakeup_timer_milliseconds, 647 S_IRUGO | S_IWUSR, d, &wakeup_timer_milliseconds,
648 &pm_dbg_option_fops); 648 &pm_dbg_option_fops);
649 pm_dbg_init_done = 1; 649 pm_dbg_init_done = 1;
650 650
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index d5a102c71989..30af3351c2d6 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -18,8 +18,8 @@
18#include <plat/omap-pm.h> 18#include <plat/omap-pm.h>
19#include <plat/omap_device.h> 19#include <plat/omap_device.h>
20#include <plat/common.h> 20#include <plat/common.h>
21#include <plat/voltage.h>
22 21
22#include "voltage.h"
23#include "powerdomain.h" 23#include "powerdomain.h"
24#include "clockdomain.h" 24#include "clockdomain.h"
25#include "pm.h" 25#include "pm.h"
@@ -83,7 +83,9 @@ static int _init_omap_device(char *name, struct device **new_dev)
83static void omap2_init_processor_devices(void) 83static void omap2_init_processor_devices(void)
84{ 84{
85 _init_omap_device("mpu", &mpu_dev); 85 _init_omap_device("mpu", &mpu_dev);
86 _init_omap_device("iva", &iva_dev); 86 if (omap3_has_iva())
87 _init_omap_device("iva", &iva_dev);
88
87 if (cpu_is_omap44xx()) { 89 if (cpu_is_omap44xx()) {
88 _init_omap_device("l3_main_1", &l3_dev); 90 _init_omap_device("l3_main_1", &l3_dev);
89 _init_omap_device("dsp", &dsp_dev); 91 _init_omap_device("dsp", &dsp_dev);
@@ -124,7 +126,7 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
124 (pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE)) { 126 (pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE)) {
125 sleep_switch = LOWPOWERSTATE_SWITCH; 127 sleep_switch = LOWPOWERSTATE_SWITCH;
126 } else { 128 } else {
127 omap2_clkdm_wakeup(pwrdm->pwrdm_clkdms[0]); 129 clkdm_wakeup(pwrdm->pwrdm_clkdms[0]);
128 pwrdm_wait_transition(pwrdm); 130 pwrdm_wait_transition(pwrdm);
129 sleep_switch = FORCEWAKEUP_SWITCH; 131 sleep_switch = FORCEWAKEUP_SWITCH;
130 } 132 }
@@ -140,9 +142,9 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
140 switch (sleep_switch) { 142 switch (sleep_switch) {
141 case FORCEWAKEUP_SWITCH: 143 case FORCEWAKEUP_SWITCH:
142 if (pwrdm->pwrdm_clkdms[0]->flags & CLKDM_CAN_ENABLE_AUTO) 144 if (pwrdm->pwrdm_clkdms[0]->flags & CLKDM_CAN_ENABLE_AUTO)
143 omap2_clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]); 145 clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]);
144 else 146 else
145 omap2_clkdm_sleep(pwrdm->pwrdm_clkdms[0]); 147 clkdm_sleep(pwrdm->pwrdm_clkdms[0]);
146 break; 148 break;
147 case LOWPOWERSTATE_SWITCH: 149 case LOWPOWERSTATE_SWITCH:
148 pwrdm_set_lowpwrstchange(pwrdm); 150 pwrdm_set_lowpwrstchange(pwrdm);
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index 1c1b0ab5b978..797bfd12b643 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -92,7 +92,7 @@ extern void omap24xx_idle_loop_suspend(void);
92extern void omap24xx_cpu_suspend(u32 dll_ctrl, void __iomem *sdrc_dlla_ctrl, 92extern void omap24xx_cpu_suspend(u32 dll_ctrl, void __iomem *sdrc_dlla_ctrl,
93 void __iomem *sdrc_power); 93 void __iomem *sdrc_power);
94extern void omap34xx_cpu_suspend(u32 *addr, int save_state); 94extern void omap34xx_cpu_suspend(u32 *addr, int save_state);
95extern void save_secure_ram_context(u32 *addr); 95extern int save_secure_ram_context(u32 *addr);
96extern void omap3_save_scratchpad_contents(void); 96extern void omap3_save_scratchpad_contents(void);
97 97
98extern unsigned int omap24xx_idle_loop_suspend_sz; 98extern unsigned int omap24xx_idle_loop_suspend_sz;
@@ -127,6 +127,7 @@ static inline void omap_enable_smartreflex_on_init(void) {}
127#ifdef CONFIG_TWL4030_CORE 127#ifdef CONFIG_TWL4030_CORE
128extern int omap3_twl_init(void); 128extern int omap3_twl_init(void);
129extern int omap4_twl_init(void); 129extern int omap4_twl_init(void);
130extern int omap3_twl_set_sr_bit(bool enable);
130#else 131#else
131static inline int omap3_twl_init(void) 132static inline int omap3_twl_init(void)
132{ 133{
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
index 9e5dc8ed51e9..df3ded6fe194 100644
--- a/arch/arm/mach-omap2/pm24xx.c
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -134,7 +134,7 @@ static void omap2_enter_full_retention(void)
134 134
135 /* Block console output in case it is on one of the OMAP UARTs */ 135 /* Block console output in case it is on one of the OMAP UARTs */
136 if (!is_suspending()) 136 if (!is_suspending())
137 if (try_acquire_console_sem()) 137 if (!console_trylock())
138 goto no_sleep; 138 goto no_sleep;
139 139
140 omap_uart_prepare_idle(0); 140 omap_uart_prepare_idle(0);
@@ -151,7 +151,7 @@ static void omap2_enter_full_retention(void)
151 omap_uart_resume_idle(0); 151 omap_uart_resume_idle(0);
152 152
153 if (!is_suspending()) 153 if (!is_suspending())
154 release_console_sem(); 154 console_unlock();
155 155
156no_sleep: 156no_sleep:
157 if (omap2_pm_debug) { 157 if (omap2_pm_debug) {
@@ -363,14 +363,11 @@ static const struct platform_suspend_ops __initdata omap_pm_ops;
363/* XXX This function should be shareable between OMAP2xxx and OMAP3 */ 363/* XXX This function should be shareable between OMAP2xxx and OMAP3 */
364static int __init clkdms_setup(struct clockdomain *clkdm, void *unused) 364static int __init clkdms_setup(struct clockdomain *clkdm, void *unused)
365{ 365{
366 clkdm_clear_all_wkdeps(clkdm);
367 clkdm_clear_all_sleepdeps(clkdm);
368
369 if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO) 366 if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO)
370 omap2_clkdm_allow_idle(clkdm); 367 clkdm_allow_idle(clkdm);
371 else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP && 368 else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP &&
372 atomic_read(&clkdm->usecount) == 0) 369 atomic_read(&clkdm->usecount) == 0)
373 omap2_clkdm_sleep(clkdm); 370 clkdm_sleep(clkdm);
374 return 0; 371 return 0;
375} 372}
376 373
@@ -379,7 +376,10 @@ static void __init prcm_setup_regs(void)
379 int i, num_mem_banks; 376 int i, num_mem_banks;
380 struct powerdomain *pwrdm; 377 struct powerdomain *pwrdm;
381 378
382 /* Enable autoidle */ 379 /*
380 * Enable autoidle
381 * XXX This should be handled by hwmod code or PRCM init code
382 */
383 omap2_prm_write_mod_reg(OMAP24XX_AUTOIDLE_MASK, OCP_MOD, 383 omap2_prm_write_mod_reg(OMAP24XX_AUTOIDLE_MASK, OCP_MOD,
384 OMAP2_PRCM_SYSCONFIG_OFFSET); 384 OMAP2_PRCM_SYSCONFIG_OFFSET);
385 385
@@ -405,83 +405,16 @@ static void __init prcm_setup_regs(void)
405 405
406 pwrdm = clkdm_get_pwrdm(dsp_clkdm); 406 pwrdm = clkdm_get_pwrdm(dsp_clkdm);
407 pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF); 407 pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF);
408 omap2_clkdm_sleep(dsp_clkdm); 408 clkdm_sleep(dsp_clkdm);
409 409
410 pwrdm = clkdm_get_pwrdm(gfx_clkdm); 410 pwrdm = clkdm_get_pwrdm(gfx_clkdm);
411 pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF); 411 pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF);
412 omap2_clkdm_sleep(gfx_clkdm); 412 clkdm_sleep(gfx_clkdm);
413 413
414 /* 414 /* Enable hardware-supervised idle for all clkdms */
415 * Clear clockdomain wakeup dependencies and enable
416 * hardware-supervised idle for all clkdms
417 */
418 clkdm_for_each(clkdms_setup, NULL); 415 clkdm_for_each(clkdms_setup, NULL);
419 clkdm_add_wkdep(mpu_clkdm, wkup_clkdm); 416 clkdm_add_wkdep(mpu_clkdm, wkup_clkdm);
420 417
421 /* Enable clock autoidle for all domains */
422 omap2_cm_write_mod_reg(OMAP24XX_AUTO_CAM_MASK |
423 OMAP24XX_AUTO_MAILBOXES_MASK |
424 OMAP24XX_AUTO_WDT4_MASK |
425 OMAP2420_AUTO_WDT3_MASK |
426 OMAP24XX_AUTO_MSPRO_MASK |
427 OMAP2420_AUTO_MMC_MASK |
428 OMAP24XX_AUTO_FAC_MASK |
429 OMAP2420_AUTO_EAC_MASK |
430 OMAP24XX_AUTO_HDQ_MASK |
431 OMAP24XX_AUTO_UART2_MASK |
432 OMAP24XX_AUTO_UART1_MASK |
433 OMAP24XX_AUTO_I2C2_MASK |
434 OMAP24XX_AUTO_I2C1_MASK |
435 OMAP24XX_AUTO_MCSPI2_MASK |
436 OMAP24XX_AUTO_MCSPI1_MASK |
437 OMAP24XX_AUTO_MCBSP2_MASK |
438 OMAP24XX_AUTO_MCBSP1_MASK |
439 OMAP24XX_AUTO_GPT12_MASK |
440 OMAP24XX_AUTO_GPT11_MASK |
441 OMAP24XX_AUTO_GPT10_MASK |
442 OMAP24XX_AUTO_GPT9_MASK |
443 OMAP24XX_AUTO_GPT8_MASK |
444 OMAP24XX_AUTO_GPT7_MASK |
445 OMAP24XX_AUTO_GPT6_MASK |
446 OMAP24XX_AUTO_GPT5_MASK |
447 OMAP24XX_AUTO_GPT4_MASK |
448 OMAP24XX_AUTO_GPT3_MASK |
449 OMAP24XX_AUTO_GPT2_MASK |
450 OMAP2420_AUTO_VLYNQ_MASK |
451 OMAP24XX_AUTO_DSS_MASK,
452 CORE_MOD, CM_AUTOIDLE1);
453 omap2_cm_write_mod_reg(OMAP24XX_AUTO_UART3_MASK |
454 OMAP24XX_AUTO_SSI_MASK |
455 OMAP24XX_AUTO_USB_MASK,
456 CORE_MOD, CM_AUTOIDLE2);
457 omap2_cm_write_mod_reg(OMAP24XX_AUTO_SDRC_MASK |
458 OMAP24XX_AUTO_GPMC_MASK |
459 OMAP24XX_AUTO_SDMA_MASK,
460 CORE_MOD, CM_AUTOIDLE3);
461 omap2_cm_write_mod_reg(OMAP24XX_AUTO_PKA_MASK |
462 OMAP24XX_AUTO_AES_MASK |
463 OMAP24XX_AUTO_RNG_MASK |
464 OMAP24XX_AUTO_SHA_MASK |
465 OMAP24XX_AUTO_DES_MASK,
466 CORE_MOD, OMAP24XX_CM_AUTOIDLE4);
467
468 omap2_cm_write_mod_reg(OMAP2420_AUTO_DSP_IPI_MASK, OMAP24XX_DSP_MOD,
469 CM_AUTOIDLE);
470
471 /* Put DPLL and both APLLs into autoidle mode */
472 omap2_cm_write_mod_reg((0x03 << OMAP24XX_AUTO_DPLL_SHIFT) |
473 (0x03 << OMAP24XX_AUTO_96M_SHIFT) |
474 (0x03 << OMAP24XX_AUTO_54M_SHIFT),
475 PLL_MOD, CM_AUTOIDLE);
476
477 omap2_cm_write_mod_reg(OMAP24XX_AUTO_OMAPCTRL_MASK |
478 OMAP24XX_AUTO_WDT1_MASK |
479 OMAP24XX_AUTO_MPU_WDT_MASK |
480 OMAP24XX_AUTO_GPIOS_MASK |
481 OMAP24XX_AUTO_32KSYNC_MASK |
482 OMAP24XX_AUTO_GPT1_MASK,
483 WKUP_MOD, CM_AUTOIDLE);
484
485 /* REVISIT: Configure number of 32 kHz clock cycles for sys_clk 418 /* REVISIT: Configure number of 32 kHz clock cycles for sys_clk
486 * stabilisation */ 419 * stabilisation */
487 omap2_prm_write_mod_reg(15 << OMAP_SETUP_TIME_SHIFT, OMAP24XX_GR_MOD, 420 omap2_prm_write_mod_reg(15 << OMAP_SETUP_TIME_SHIFT, OMAP24XX_GR_MOD,
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 8cbbeade4b8a..0c5e3a46a3ad 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -29,6 +29,7 @@
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <linux/console.h> 31#include <linux/console.h>
32#include <trace/events/power.h>
32 33
33#include <plat/sram.h> 34#include <plat/sram.h>
34#include "clockdomain.h" 35#include "clockdomain.h"
@@ -168,9 +169,10 @@ static void omap3_core_restore_context(void)
168 * once during boot sequence, but this works as we are not using secure 169 * once during boot sequence, but this works as we are not using secure
169 * services. 170 * services.
170 */ 171 */
171static void omap3_save_secure_ram_context(u32 target_mpu_state) 172static void omap3_save_secure_ram_context(void)
172{ 173{
173 u32 ret; 174 u32 ret;
175 int mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm);
174 176
175 if (omap_type() != OMAP2_DEVICE_TYPE_GP) { 177 if (omap_type() != OMAP2_DEVICE_TYPE_GP) {
176 /* 178 /*
@@ -181,7 +183,7 @@ static void omap3_save_secure_ram_context(u32 target_mpu_state)
181 pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON); 183 pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON);
182 ret = _omap_save_secure_sram((u32 *) 184 ret = _omap_save_secure_sram((u32 *)
183 __pa(omap3_secure_ram_storage)); 185 __pa(omap3_secure_ram_storage));
184 pwrdm_set_next_pwrst(mpu_pwrdm, target_mpu_state); 186 pwrdm_set_next_pwrst(mpu_pwrdm, mpu_next_state);
185 /* Following is for error tracking, it should not happen */ 187 /* Following is for error tracking, it should not happen */
186 if (ret) { 188 if (ret) {
187 printk(KERN_ERR "save_secure_sram() returns %08x\n", 189 printk(KERN_ERR "save_secure_sram() returns %08x\n",
@@ -310,11 +312,6 @@ static irqreturn_t prcm_interrupt_handler (int irq, void *dev_id)
310 return IRQ_HANDLED; 312 return IRQ_HANDLED;
311} 313}
312 314
313static void restore_control_register(u32 val)
314{
315 __asm__ __volatile__ ("mcr p15, 0, %0, c1, c0, 0" : : "r" (val));
316}
317
318/* Function to restore the table entry that was modified for enabling MMU */ 315/* Function to restore the table entry that was modified for enabling MMU */
319static void restore_table_entry(void) 316static void restore_table_entry(void)
320{ 317{
@@ -336,7 +333,7 @@ static void restore_table_entry(void)
336 control_reg_value = __raw_readl(scratchpad_address 333 control_reg_value = __raw_readl(scratchpad_address
337 + OMAP343X_CONTROL_REG_VALUE_OFFSET); 334 + OMAP343X_CONTROL_REG_VALUE_OFFSET);
338 /* This will enable caches and prediction */ 335 /* This will enable caches and prediction */
339 restore_control_register(control_reg_value); 336 set_cr(control_reg_value);
340} 337}
341 338
342void omap_sram_idle(void) 339void omap_sram_idle(void)
@@ -398,7 +395,7 @@ void omap_sram_idle(void)
398 if (!is_suspending()) 395 if (!is_suspending())
399 if (per_next_state < PWRDM_POWER_ON || 396 if (per_next_state < PWRDM_POWER_ON ||
400 core_next_state < PWRDM_POWER_ON) 397 core_next_state < PWRDM_POWER_ON)
401 if (try_acquire_console_sem()) 398 if (!console_trylock())
402 goto console_still_active; 399 goto console_still_active;
403 400
404 /* PER */ 401 /* PER */
@@ -481,7 +478,7 @@ void omap_sram_idle(void)
481 } 478 }
482 479
483 if (!is_suspending()) 480 if (!is_suspending())
484 release_console_sem(); 481 console_unlock();
485 482
486console_still_active: 483console_still_active:
487 /* Disable IO-PAD and IO-CHAIN wakeup */ 484 /* Disable IO-PAD and IO-CHAIN wakeup */
@@ -495,7 +492,7 @@ console_still_active:
495 492
496 pwrdm_post_transition(); 493 pwrdm_post_transition();
497 494
498 omap2_clkdm_allow_idle(mpu_pwrdm->pwrdm_clkdms[0]); 495 clkdm_allow_idle(mpu_pwrdm->pwrdm_clkdms[0]);
499} 496}
500 497
501int omap3_can_sleep(void) 498int omap3_can_sleep(void)
@@ -518,8 +515,14 @@ static void omap3_pm_idle(void)
518 if (omap_irq_pending() || need_resched()) 515 if (omap_irq_pending() || need_resched())
519 goto out; 516 goto out;
520 517
518 trace_power_start(POWER_CSTATE, 1, smp_processor_id());
519 trace_cpu_idle(1, smp_processor_id());
520
521 omap_sram_idle(); 521 omap_sram_idle();
522 522
523 trace_power_end(smp_processor_id());
524 trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
525
523out: 526out:
524 local_fiq_enable(); 527 local_fiq_enable();
525 local_irq_enable(); 528 local_irq_enable();
@@ -687,149 +690,15 @@ static void __init omap3_d2d_idle(void)
687 690
688static void __init prcm_setup_regs(void) 691static void __init prcm_setup_regs(void)
689{ 692{
690 u32 omap3630_auto_uart4_mask = cpu_is_omap3630() ?
691 OMAP3630_AUTO_UART4_MASK : 0;
692 u32 omap3630_en_uart4_mask = cpu_is_omap3630() ? 693 u32 omap3630_en_uart4_mask = cpu_is_omap3630() ?
693 OMAP3630_EN_UART4_MASK : 0; 694 OMAP3630_EN_UART4_MASK : 0;
694 u32 omap3630_grpsel_uart4_mask = cpu_is_omap3630() ? 695 u32 omap3630_grpsel_uart4_mask = cpu_is_omap3630() ?
695 OMAP3630_GRPSEL_UART4_MASK : 0; 696 OMAP3630_GRPSEL_UART4_MASK : 0;
696 697
697 698 /* XXX This should be handled by hwmod code or SCM init code */
698 /* XXX Reset all wkdeps. This should be done when initializing
699 * powerdomains */
700 omap2_prm_write_mod_reg(0, OMAP3430_IVA2_MOD, PM_WKDEP);
701 omap2_prm_write_mod_reg(0, MPU_MOD, PM_WKDEP);
702 omap2_prm_write_mod_reg(0, OMAP3430_DSS_MOD, PM_WKDEP);
703 omap2_prm_write_mod_reg(0, OMAP3430_NEON_MOD, PM_WKDEP);
704 omap2_prm_write_mod_reg(0, OMAP3430_CAM_MOD, PM_WKDEP);
705 omap2_prm_write_mod_reg(0, OMAP3430_PER_MOD, PM_WKDEP);
706 if (omap_rev() > OMAP3430_REV_ES1_0) {
707 omap2_prm_write_mod_reg(0, OMAP3430ES2_SGX_MOD, PM_WKDEP);
708 omap2_prm_write_mod_reg(0, OMAP3430ES2_USBHOST_MOD, PM_WKDEP);
709 } else
710 omap2_prm_write_mod_reg(0, GFX_MOD, PM_WKDEP);
711
712 /*
713 * Enable interface clock autoidle for all modules.
714 * Note that in the long run this should be done by clockfw
715 */
716 omap2_cm_write_mod_reg(
717 OMAP3430_AUTO_MODEM_MASK |
718 OMAP3430ES2_AUTO_MMC3_MASK |
719 OMAP3430ES2_AUTO_ICR_MASK |
720 OMAP3430_AUTO_AES2_MASK |
721 OMAP3430_AUTO_SHA12_MASK |
722 OMAP3430_AUTO_DES2_MASK |
723 OMAP3430_AUTO_MMC2_MASK |
724 OMAP3430_AUTO_MMC1_MASK |
725 OMAP3430_AUTO_MSPRO_MASK |
726 OMAP3430_AUTO_HDQ_MASK |
727 OMAP3430_AUTO_MCSPI4_MASK |
728 OMAP3430_AUTO_MCSPI3_MASK |
729 OMAP3430_AUTO_MCSPI2_MASK |
730 OMAP3430_AUTO_MCSPI1_MASK |
731 OMAP3430_AUTO_I2C3_MASK |
732 OMAP3430_AUTO_I2C2_MASK |
733 OMAP3430_AUTO_I2C1_MASK |
734 OMAP3430_AUTO_UART2_MASK |
735 OMAP3430_AUTO_UART1_MASK |
736 OMAP3430_AUTO_GPT11_MASK |
737 OMAP3430_AUTO_GPT10_MASK |
738 OMAP3430_AUTO_MCBSP5_MASK |
739 OMAP3430_AUTO_MCBSP1_MASK |
740 OMAP3430ES1_AUTO_FAC_MASK | /* This is es1 only */
741 OMAP3430_AUTO_MAILBOXES_MASK |
742 OMAP3430_AUTO_OMAPCTRL_MASK |
743 OMAP3430ES1_AUTO_FSHOSTUSB_MASK |
744 OMAP3430_AUTO_HSOTGUSB_MASK |
745 OMAP3430_AUTO_SAD2D_MASK |
746 OMAP3430_AUTO_SSI_MASK,
747 CORE_MOD, CM_AUTOIDLE1);
748
749 omap2_cm_write_mod_reg(
750 OMAP3430_AUTO_PKA_MASK |
751 OMAP3430_AUTO_AES1_MASK |
752 OMAP3430_AUTO_RNG_MASK |
753 OMAP3430_AUTO_SHA11_MASK |
754 OMAP3430_AUTO_DES1_MASK,
755 CORE_MOD, CM_AUTOIDLE2);
756
757 if (omap_rev() > OMAP3430_REV_ES1_0) {
758 omap2_cm_write_mod_reg(
759 OMAP3430_AUTO_MAD2D_MASK |
760 OMAP3430ES2_AUTO_USBTLL_MASK,
761 CORE_MOD, CM_AUTOIDLE3);
762 }
763
764 omap2_cm_write_mod_reg(
765 OMAP3430_AUTO_WDT2_MASK |
766 OMAP3430_AUTO_WDT1_MASK |
767 OMAP3430_AUTO_GPIO1_MASK |
768 OMAP3430_AUTO_32KSYNC_MASK |
769 OMAP3430_AUTO_GPT12_MASK |
770 OMAP3430_AUTO_GPT1_MASK,
771 WKUP_MOD, CM_AUTOIDLE);
772
773 omap2_cm_write_mod_reg(
774 OMAP3430_AUTO_DSS_MASK,
775 OMAP3430_DSS_MOD,
776 CM_AUTOIDLE);
777
778 omap2_cm_write_mod_reg(
779 OMAP3430_AUTO_CAM_MASK,
780 OMAP3430_CAM_MOD,
781 CM_AUTOIDLE);
782
783 omap2_cm_write_mod_reg(
784 omap3630_auto_uart4_mask |
785 OMAP3430_AUTO_GPIO6_MASK |
786 OMAP3430_AUTO_GPIO5_MASK |
787 OMAP3430_AUTO_GPIO4_MASK |
788 OMAP3430_AUTO_GPIO3_MASK |
789 OMAP3430_AUTO_GPIO2_MASK |
790 OMAP3430_AUTO_WDT3_MASK |
791 OMAP3430_AUTO_UART3_MASK |
792 OMAP3430_AUTO_GPT9_MASK |
793 OMAP3430_AUTO_GPT8_MASK |
794 OMAP3430_AUTO_GPT7_MASK |
795 OMAP3430_AUTO_GPT6_MASK |
796 OMAP3430_AUTO_GPT5_MASK |
797 OMAP3430_AUTO_GPT4_MASK |
798 OMAP3430_AUTO_GPT3_MASK |
799 OMAP3430_AUTO_GPT2_MASK |
800 OMAP3430_AUTO_MCBSP4_MASK |
801 OMAP3430_AUTO_MCBSP3_MASK |
802 OMAP3430_AUTO_MCBSP2_MASK,
803 OMAP3430_PER_MOD,
804 CM_AUTOIDLE);
805
806 if (omap_rev() > OMAP3430_REV_ES1_0) {
807 omap2_cm_write_mod_reg(
808 OMAP3430ES2_AUTO_USBHOST_MASK,
809 OMAP3430ES2_USBHOST_MOD,
810 CM_AUTOIDLE);
811 }
812
813 omap_ctrl_writel(OMAP3430_AUTOIDLE_MASK, OMAP2_CONTROL_SYSCONFIG); 699 omap_ctrl_writel(OMAP3430_AUTOIDLE_MASK, OMAP2_CONTROL_SYSCONFIG);
814 700
815 /* 701 /*
816 * Set all plls to autoidle. This is needed until autoidle is
817 * enabled by clockfw
818 */
819 omap2_cm_write_mod_reg(1 << OMAP3430_AUTO_IVA2_DPLL_SHIFT,
820 OMAP3430_IVA2_MOD, CM_AUTOIDLE2);
821 omap2_cm_write_mod_reg(1 << OMAP3430_AUTO_MPU_DPLL_SHIFT,
822 MPU_MOD,
823 CM_AUTOIDLE2);
824 omap2_cm_write_mod_reg((1 << OMAP3430_AUTO_PERIPH_DPLL_SHIFT) |
825 (1 << OMAP3430_AUTO_CORE_DPLL_SHIFT),
826 PLL_MOD,
827 CM_AUTOIDLE);
828 omap2_cm_write_mod_reg(1 << OMAP3430ES2_AUTO_PERIPH2_DPLL_SHIFT,
829 PLL_MOD,
830 CM_AUTOIDLE2);
831
832 /*
833 * Enable control of expternal oscillator through 702 * Enable control of expternal oscillator through
834 * sys_clkreq. In the long run clock framework should 703 * sys_clkreq. In the long run clock framework should
835 * take care of this. 704 * take care of this.
@@ -927,8 +796,7 @@ void omap3_pm_off_mode_enable(int enable)
927 pwrst->pwrdm == core_pwrdm && 796 pwrst->pwrdm == core_pwrdm &&
928 state == PWRDM_POWER_OFF) { 797 state == PWRDM_POWER_OFF) {
929 pwrst->next_state = PWRDM_POWER_RET; 798 pwrst->next_state = PWRDM_POWER_RET;
930 WARN_ONCE(1, 799 pr_warn("%s: Core OFF disabled due to errata i583\n",
931 "%s: Core OFF disabled due to errata i583\n",
932 __func__); 800 __func__);
933 } else { 801 } else {
934 pwrst->next_state = state; 802 pwrst->next_state = state;
@@ -989,10 +857,10 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
989static int __init clkdms_setup(struct clockdomain *clkdm, void *unused) 857static int __init clkdms_setup(struct clockdomain *clkdm, void *unused)
990{ 858{
991 if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO) 859 if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO)
992 omap2_clkdm_allow_idle(clkdm); 860 clkdm_allow_idle(clkdm);
993 else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP && 861 else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP &&
994 atomic_read(&clkdm->usecount) == 0) 862 atomic_read(&clkdm->usecount) == 0)
995 omap2_clkdm_sleep(clkdm); 863 clkdm_sleep(clkdm);
996 return 0; 864 return 0;
997} 865}
998 866
@@ -1094,7 +962,7 @@ static int __init omap3_pm_init(void)
1094 local_fiq_disable(); 962 local_fiq_disable();
1095 963
1096 omap_dma_global_context_save(); 964 omap_dma_global_context_save();
1097 omap3_save_secure_ram_context(PWRDM_POWER_ON); 965 omap3_save_secure_ram_context();
1098 omap_dma_global_context_restore(); 966 omap_dma_global_context_restore();
1099 967
1100 local_irq_enable(); 968 local_irq_enable();
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index eaed0df16699..49c6513e90d8 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -2,7 +2,7 @@
2 * OMAP powerdomain control 2 * OMAP powerdomain control
3 * 3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008 Texas Instruments, Inc.
5 * Copyright (C) 2007-2009 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 * 6 *
7 * Written by Paul Walmsley 7 * Written by Paul Walmsley
8 * Added OMAP4 specific support by Abhijit Pagare <abhijitpagare@ti.com> 8 * Added OMAP4 specific support by Abhijit Pagare <abhijitpagare@ti.com>
@@ -19,12 +19,15 @@
19#include <linux/list.h> 19#include <linux/list.h>
20#include <linux/errno.h> 20#include <linux/errno.h>
21#include <linux/string.h> 21#include <linux/string.h>
22#include <trace/events/power.h>
23
22#include "cm2xxx_3xxx.h" 24#include "cm2xxx_3xxx.h"
23#include "prcm44xx.h" 25#include "prcm44xx.h"
24#include "cm44xx.h" 26#include "cm44xx.h"
25#include "prm2xxx_3xxx.h" 27#include "prm2xxx_3xxx.h"
26#include "prm44xx.h" 28#include "prm44xx.h"
27 29
30#include <asm/cpu.h>
28#include <plat/cpu.h> 31#include <plat/cpu.h>
29#include "powerdomain.h" 32#include "powerdomain.h"
30#include "clockdomain.h" 33#include "clockdomain.h"
@@ -32,6 +35,8 @@
32 35
33#include "pm.h" 36#include "pm.h"
34 37
38#define PWRDM_TRACE_STATES_FLAG (1<<31)
39
35enum { 40enum {
36 PWRDM_STATE_NOW = 0, 41 PWRDM_STATE_NOW = 0,
37 PWRDM_STATE_PREV, 42 PWRDM_STATE_PREV,
@@ -130,8 +135,7 @@ static void _update_logic_membank_counters(struct powerdomain *pwrdm)
130static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag) 135static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
131{ 136{
132 137
133 int prev; 138 int prev, state, trace_state = 0;
134 int state;
135 139
136 if (pwrdm == NULL) 140 if (pwrdm == NULL)
137 return -EINVAL; 141 return -EINVAL;
@@ -148,6 +152,17 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
148 pwrdm->state_counter[prev]++; 152 pwrdm->state_counter[prev]++;
149 if (prev == PWRDM_POWER_RET) 153 if (prev == PWRDM_POWER_RET)
150 _update_logic_membank_counters(pwrdm); 154 _update_logic_membank_counters(pwrdm);
155 /*
156 * If the power domain did not hit the desired state,
157 * generate a trace event with both the desired and hit states
158 */
159 if (state != prev) {
160 trace_state = (PWRDM_TRACE_STATES_FLAG |
161 ((state & OMAP_POWERSTATE_MASK) << 8) |
162 ((prev & OMAP_POWERSTATE_MASK) << 0));
163 trace_power_domain_target(pwrdm->name, trace_state,
164 smp_processor_id());
165 }
151 break; 166 break;
152 default: 167 default:
153 return -EINVAL; 168 return -EINVAL;
@@ -406,8 +421,13 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
406 pr_debug("powerdomain: setting next powerstate for %s to %0x\n", 421 pr_debug("powerdomain: setting next powerstate for %s to %0x\n",
407 pwrdm->name, pwrst); 422 pwrdm->name, pwrst);
408 423
409 if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) 424 if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
425 /* Trace the pwrdm desired target state */
426 trace_power_domain_target(pwrdm->name, pwrst,
427 smp_processor_id());
428 /* Program the pwrdm desired target state */
410 ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst); 429 ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
430 }
411 431
412 return ret; 432 return ret;
413} 433}
@@ -938,3 +958,44 @@ u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm)
938 958
939 return count; 959 return count;
940} 960}
961
962/**
963 * pwrdm_can_ever_lose_context - can this powerdomain ever lose context?
964 * @pwrdm: struct powerdomain *
965 *
966 * Given a struct powerdomain * @pwrdm, returns 1 if the powerdomain
967 * can lose either memory or logic context or if @pwrdm is invalid, or
968 * returns 0 otherwise. This function is not concerned with how the
969 * powerdomain registers are programmed (i.e., to go off or not); it's
970 * concerned with whether it's ever possible for this powerdomain to
971 * go off while some other part of the chip is active. This function
972 * assumes that every powerdomain can go to either ON or INACTIVE.
973 */
974bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm)
975{
976 int i;
977
978 if (IS_ERR_OR_NULL(pwrdm)) {
979 pr_debug("powerdomain: %s: invalid powerdomain pointer\n",
980 __func__);
981 return 1;
982 }
983
984 if (pwrdm->pwrsts & PWRSTS_OFF)
985 return 1;
986
987 if (pwrdm->pwrsts & PWRSTS_RET) {
988 if (pwrdm->pwrsts_logic_ret & PWRSTS_OFF)
989 return 1;
990
991 for (i = 0; i < pwrdm->banks; i++)
992 if (pwrdm->pwrsts_mem_ret[i] & PWRSTS_OFF)
993 return 1;
994 }
995
996 for (i = 0; i < pwrdm->banks; i++)
997 if (pwrdm->pwrsts_mem_on[i] & PWRSTS_OFF)
998 return 1;
999
1000 return 0;
1001}
diff --git a/arch/arm/mach-omap2/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h
index c66431edfeb7..027f40bd235d 100644
--- a/arch/arm/mach-omap2/powerdomain.h
+++ b/arch/arm/mach-omap2/powerdomain.h
@@ -2,7 +2,7 @@
2 * OMAP2/3/4 powerdomain control 2 * OMAP2/3/4 powerdomain control
3 * 3 *
4 * Copyright (C) 2007-2008, 2010 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008, 2010 Texas Instruments, Inc.
5 * Copyright (C) 2007-2010 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 * 6 *
7 * Paul Walmsley 7 * Paul Walmsley
8 * 8 *
@@ -34,17 +34,14 @@
34 34
35/* Powerdomain allowable state bitfields */ 35/* Powerdomain allowable state bitfields */
36#define PWRSTS_ON (1 << PWRDM_POWER_ON) 36#define PWRSTS_ON (1 << PWRDM_POWER_ON)
37#define PWRSTS_INACTIVE (1 << PWRDM_POWER_INACTIVE)
38#define PWRSTS_RET (1 << PWRDM_POWER_RET)
37#define PWRSTS_OFF (1 << PWRDM_POWER_OFF) 39#define PWRSTS_OFF (1 << PWRDM_POWER_OFF)
38#define PWRSTS_OFF_ON ((1 << PWRDM_POWER_OFF) | \
39 (1 << PWRDM_POWER_ON))
40 40
41#define PWRSTS_OFF_RET ((1 << PWRDM_POWER_OFF) | \ 41#define PWRSTS_OFF_ON (PWRSTS_OFF | PWRSTS_ON)
42 (1 << PWRDM_POWER_RET)) 42#define PWRSTS_OFF_RET (PWRSTS_OFF | PWRSTS_RET)
43 43#define PWRSTS_RET_ON (PWRSTS_RET | PWRSTS_ON)
44#define PWRSTS_RET_ON ((1 << PWRDM_POWER_RET) | \ 44#define PWRSTS_OFF_RET_ON (PWRSTS_OFF_RET | PWRSTS_ON)
45 (1 << PWRDM_POWER_ON))
46
47#define PWRSTS_OFF_RET_ON (PWRSTS_OFF_RET | (1 << PWRDM_POWER_ON))
48 45
49 46
50/* Powerdomain flags */ 47/* Powerdomain flags */
@@ -165,7 +162,6 @@ struct pwrdm_ops {
165 int (*pwrdm_wait_transition)(struct powerdomain *pwrdm); 162 int (*pwrdm_wait_transition)(struct powerdomain *pwrdm);
166}; 163};
167 164
168void pwrdm_fw_init(void);
169void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs); 165void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs);
170 166
171struct powerdomain *pwrdm_lookup(const char *name); 167struct powerdomain *pwrdm_lookup(const char *name);
@@ -212,6 +208,7 @@ int pwrdm_pre_transition(void);
212int pwrdm_post_transition(void); 208int pwrdm_post_transition(void);
213int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm); 209int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm);
214u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm); 210u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm);
211bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm);
215 212
216extern void omap2xxx_powerdomains_init(void); 213extern void omap2xxx_powerdomains_init(void);
217extern void omap3xxx_powerdomains_init(void); 214extern void omap3xxx_powerdomains_init(void);
diff --git a/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c b/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c
index d5233890370c..cf600e22bf8e 100644
--- a/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c
@@ -19,7 +19,6 @@
19#include <plat/prcm.h> 19#include <plat/prcm.h>
20 20
21#include "powerdomain.h" 21#include "powerdomain.h"
22#include "prm-regbits-34xx.h"
23#include "prm.h" 22#include "prm.h"
24#include "prm-regbits-24xx.h" 23#include "prm-regbits-24xx.h"
25#include "prm-regbits-34xx.h" 24#include "prm-regbits-34xx.h"
diff --git a/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
index 5b4dd971320a..4210c3399769 100644
--- a/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
+++ b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
@@ -2,7 +2,7 @@
2 * OMAP2/3 common powerdomain definitions 2 * OMAP2/3 common powerdomain definitions
3 * 3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008 Texas Instruments, Inc.
5 * Copyright (C) 2007-2010 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 * 6 *
7 * Paul Walmsley, Jouni Högander 7 * Paul Walmsley, Jouni Högander
8 * 8 *
@@ -62,13 +62,13 @@ struct powerdomain gfx_omap2_pwrdm = {
62 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | 62 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
63 CHIP_IS_OMAP3430ES1), 63 CHIP_IS_OMAP3430ES1),
64 .pwrsts = PWRSTS_OFF_RET_ON, 64 .pwrsts = PWRSTS_OFF_RET_ON,
65 .pwrsts_logic_ret = PWRDM_POWER_RET, 65 .pwrsts_logic_ret = PWRSTS_RET,
66 .banks = 1, 66 .banks = 1,
67 .pwrsts_mem_ret = { 67 .pwrsts_mem_ret = {
68 [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 68 [0] = PWRSTS_RET, /* MEMRETSTATE */
69 }, 69 },
70 .pwrsts_mem_on = { 70 .pwrsts_mem_on = {
71 [0] = PWRDM_POWER_ON, /* MEMONSTATE */ 71 [0] = PWRSTS_ON, /* MEMONSTATE */
72 }, 72 },
73}; 73};
74 74
@@ -76,4 +76,5 @@ struct powerdomain wkup_omap2_pwrdm = {
76 .name = "wkup_pwrdm", 76 .name = "wkup_pwrdm",
77 .prcm_offs = WKUP_MOD, 77 .prcm_offs = WKUP_MOD,
78 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), 78 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
79 .pwrsts = PWRSTS_ON,
79}; 80};
diff --git a/arch/arm/mach-omap2/powerdomains2xxx_data.c b/arch/arm/mach-omap2/powerdomains2xxx_data.c
index 9b1a33500577..cc389fb2005d 100644
--- a/arch/arm/mach-omap2/powerdomains2xxx_data.c
+++ b/arch/arm/mach-omap2/powerdomains2xxx_data.c
@@ -2,7 +2,7 @@
2 * OMAP2XXX powerdomain definitions 2 * OMAP2XXX powerdomain definitions
3 * 3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008 Texas Instruments, Inc.
5 * Copyright (C) 2007-2010 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 * 6 *
7 * Paul Walmsley, Jouni Högander 7 * Paul Walmsley, Jouni Högander
8 * 8 *
@@ -30,13 +30,13 @@ static struct powerdomain dsp_pwrdm = {
30 .prcm_offs = OMAP24XX_DSP_MOD, 30 .prcm_offs = OMAP24XX_DSP_MOD,
31 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), 31 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
32 .pwrsts = PWRSTS_OFF_RET_ON, 32 .pwrsts = PWRSTS_OFF_RET_ON,
33 .pwrsts_logic_ret = PWRDM_POWER_RET, 33 .pwrsts_logic_ret = PWRSTS_RET,
34 .banks = 1, 34 .banks = 1,
35 .pwrsts_mem_ret = { 35 .pwrsts_mem_ret = {
36 [0] = PWRDM_POWER_RET, 36 [0] = PWRSTS_RET,
37 }, 37 },
38 .pwrsts_mem_on = { 38 .pwrsts_mem_on = {
39 [0] = PWRDM_POWER_ON, 39 [0] = PWRSTS_ON,
40 }, 40 },
41}; 41};
42 42
@@ -48,10 +48,10 @@ static struct powerdomain mpu_24xx_pwrdm = {
48 .pwrsts_logic_ret = PWRSTS_OFF_RET, 48 .pwrsts_logic_ret = PWRSTS_OFF_RET,
49 .banks = 1, 49 .banks = 1,
50 .pwrsts_mem_ret = { 50 .pwrsts_mem_ret = {
51 [0] = PWRDM_POWER_RET, 51 [0] = PWRSTS_RET,
52 }, 52 },
53 .pwrsts_mem_on = { 53 .pwrsts_mem_on = {
54 [0] = PWRDM_POWER_ON, 54 [0] = PWRSTS_ON,
55 }, 55 },
56}; 56};
57 57
@@ -78,7 +78,7 @@ static struct powerdomain core_24xx_pwrdm = {
78 * 2430-specific powerdomains 78 * 2430-specific powerdomains
79 */ 79 */
80 80
81#ifdef CONFIG_ARCH_OMAP2430 81#ifdef CONFIG_SOC_OMAP2430
82 82
83/* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */ 83/* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */
84 84
@@ -87,17 +87,17 @@ static struct powerdomain mdm_pwrdm = {
87 .prcm_offs = OMAP2430_MDM_MOD, 87 .prcm_offs = OMAP2430_MDM_MOD,
88 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 88 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
89 .pwrsts = PWRSTS_OFF_RET_ON, 89 .pwrsts = PWRSTS_OFF_RET_ON,
90 .pwrsts_logic_ret = PWRDM_POWER_RET, 90 .pwrsts_logic_ret = PWRSTS_RET,
91 .banks = 1, 91 .banks = 1,
92 .pwrsts_mem_ret = { 92 .pwrsts_mem_ret = {
93 [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 93 [0] = PWRSTS_RET, /* MEMRETSTATE */
94 }, 94 },
95 .pwrsts_mem_on = { 95 .pwrsts_mem_on = {
96 [0] = PWRDM_POWER_ON, /* MEMONSTATE */ 96 [0] = PWRSTS_ON, /* MEMONSTATE */
97 }, 97 },
98}; 98};
99 99
100#endif /* CONFIG_ARCH_OMAP2430 */ 100#endif /* CONFIG_SOC_OMAP2430 */
101 101
102/* As powerdomains are added or removed above, this list must also be changed */ 102/* As powerdomains are added or removed above, this list must also be changed */
103static struct powerdomain *powerdomains_omap2xxx[] __initdata = { 103static struct powerdomain *powerdomains_omap2xxx[] __initdata = {
@@ -111,7 +111,7 @@ static struct powerdomain *powerdomains_omap2xxx[] __initdata = {
111 &core_24xx_pwrdm, 111 &core_24xx_pwrdm,
112#endif 112#endif
113 113
114#ifdef CONFIG_ARCH_OMAP2430 114#ifdef CONFIG_SOC_OMAP2430
115 &mdm_pwrdm, 115 &mdm_pwrdm,
116#endif 116#endif
117 NULL 117 NULL
diff --git a/arch/arm/mach-omap2/powerdomains3xxx_data.c b/arch/arm/mach-omap2/powerdomains3xxx_data.c
index e1bec562625b..9c9c113788b9 100644
--- a/arch/arm/mach-omap2/powerdomains3xxx_data.c
+++ b/arch/arm/mach-omap2/powerdomains3xxx_data.c
@@ -2,7 +2,7 @@
2 * OMAP3 powerdomain definitions 2 * OMAP3 powerdomain definitions
3 * 3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008 Texas Instruments, Inc.
5 * Copyright (C) 2007-2010 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 * 6 *
7 * Paul Walmsley, Jouni Högander 7 * Paul Walmsley, Jouni Högander
8 * 8 *
@@ -47,10 +47,10 @@ static struct powerdomain iva2_pwrdm = {
47 [3] = PWRSTS_OFF_RET, 47 [3] = PWRSTS_OFF_RET,
48 }, 48 },
49 .pwrsts_mem_on = { 49 .pwrsts_mem_on = {
50 [0] = PWRDM_POWER_ON, 50 [0] = PWRSTS_ON,
51 [1] = PWRDM_POWER_ON, 51 [1] = PWRSTS_ON,
52 [2] = PWRSTS_OFF_ON, 52 [2] = PWRSTS_OFF_ON,
53 [3] = PWRDM_POWER_ON, 53 [3] = PWRSTS_ON,
54 }, 54 },
55}; 55};
56 56
@@ -128,13 +128,13 @@ static struct powerdomain dss_pwrdm = {
128 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 128 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
129 .prcm_offs = OMAP3430_DSS_MOD, 129 .prcm_offs = OMAP3430_DSS_MOD,
130 .pwrsts = PWRSTS_OFF_RET_ON, 130 .pwrsts = PWRSTS_OFF_RET_ON,
131 .pwrsts_logic_ret = PWRDM_POWER_RET, 131 .pwrsts_logic_ret = PWRSTS_RET,
132 .banks = 1, 132 .banks = 1,
133 .pwrsts_mem_ret = { 133 .pwrsts_mem_ret = {
134 [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 134 [0] = PWRSTS_RET, /* MEMRETSTATE */
135 }, 135 },
136 .pwrsts_mem_on = { 136 .pwrsts_mem_on = {
137 [0] = PWRDM_POWER_ON, /* MEMONSTATE */ 137 [0] = PWRSTS_ON, /* MEMONSTATE */
138 }, 138 },
139}; 139};
140 140
@@ -149,13 +149,13 @@ static struct powerdomain sgx_pwrdm = {
149 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), 149 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
150 /* XXX This is accurate for 3430 SGX, but what about GFX? */ 150 /* XXX This is accurate for 3430 SGX, but what about GFX? */
151 .pwrsts = PWRSTS_OFF_ON, 151 .pwrsts = PWRSTS_OFF_ON,
152 .pwrsts_logic_ret = PWRDM_POWER_RET, 152 .pwrsts_logic_ret = PWRSTS_RET,
153 .banks = 1, 153 .banks = 1,
154 .pwrsts_mem_ret = { 154 .pwrsts_mem_ret = {
155 [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 155 [0] = PWRSTS_RET, /* MEMRETSTATE */
156 }, 156 },
157 .pwrsts_mem_on = { 157 .pwrsts_mem_on = {
158 [0] = PWRDM_POWER_ON, /* MEMONSTATE */ 158 [0] = PWRSTS_ON, /* MEMONSTATE */
159 }, 159 },
160}; 160};
161 161
@@ -164,13 +164,13 @@ static struct powerdomain cam_pwrdm = {
164 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 164 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
165 .prcm_offs = OMAP3430_CAM_MOD, 165 .prcm_offs = OMAP3430_CAM_MOD,
166 .pwrsts = PWRSTS_OFF_RET_ON, 166 .pwrsts = PWRSTS_OFF_RET_ON,
167 .pwrsts_logic_ret = PWRDM_POWER_RET, 167 .pwrsts_logic_ret = PWRSTS_RET,
168 .banks = 1, 168 .banks = 1,
169 .pwrsts_mem_ret = { 169 .pwrsts_mem_ret = {
170 [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 170 [0] = PWRSTS_RET, /* MEMRETSTATE */
171 }, 171 },
172 .pwrsts_mem_on = { 172 .pwrsts_mem_on = {
173 [0] = PWRDM_POWER_ON, /* MEMONSTATE */ 173 [0] = PWRSTS_ON, /* MEMONSTATE */
174 }, 174 },
175}; 175};
176 176
@@ -182,10 +182,10 @@ static struct powerdomain per_pwrdm = {
182 .pwrsts_logic_ret = PWRSTS_OFF_RET, 182 .pwrsts_logic_ret = PWRSTS_OFF_RET,
183 .banks = 1, 183 .banks = 1,
184 .pwrsts_mem_ret = { 184 .pwrsts_mem_ret = {
185 [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 185 [0] = PWRSTS_RET, /* MEMRETSTATE */
186 }, 186 },
187 .pwrsts_mem_on = { 187 .pwrsts_mem_on = {
188 [0] = PWRDM_POWER_ON, /* MEMONSTATE */ 188 [0] = PWRSTS_ON, /* MEMONSTATE */
189 }, 189 },
190}; 190};
191 191
@@ -200,7 +200,7 @@ static struct powerdomain neon_pwrdm = {
200 .prcm_offs = OMAP3430_NEON_MOD, 200 .prcm_offs = OMAP3430_NEON_MOD,
201 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 201 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
202 .pwrsts = PWRSTS_OFF_RET_ON, 202 .pwrsts = PWRSTS_OFF_RET_ON,
203 .pwrsts_logic_ret = PWRDM_POWER_RET, 203 .pwrsts_logic_ret = PWRSTS_RET,
204}; 204};
205 205
206static struct powerdomain usbhost_pwrdm = { 206static struct powerdomain usbhost_pwrdm = {
@@ -208,7 +208,7 @@ static struct powerdomain usbhost_pwrdm = {
208 .prcm_offs = OMAP3430ES2_USBHOST_MOD, 208 .prcm_offs = OMAP3430ES2_USBHOST_MOD,
209 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), 209 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
210 .pwrsts = PWRSTS_OFF_RET_ON, 210 .pwrsts = PWRSTS_OFF_RET_ON,
211 .pwrsts_logic_ret = PWRDM_POWER_RET, 211 .pwrsts_logic_ret = PWRSTS_RET,
212 /* 212 /*
213 * REVISIT: Enabling usb host save and restore mechanism seems to 213 * REVISIT: Enabling usb host save and restore mechanism seems to
214 * leave the usb host domain permanently in ACTIVE mode after 214 * leave the usb host domain permanently in ACTIVE mode after
@@ -218,10 +218,10 @@ static struct powerdomain usbhost_pwrdm = {
218 /*.flags = PWRDM_HAS_HDWR_SAR,*/ /* for USBHOST ctrlr only */ 218 /*.flags = PWRDM_HAS_HDWR_SAR,*/ /* for USBHOST ctrlr only */
219 .banks = 1, 219 .banks = 1,
220 .pwrsts_mem_ret = { 220 .pwrsts_mem_ret = {
221 [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 221 [0] = PWRSTS_RET, /* MEMRETSTATE */
222 }, 222 },
223 .pwrsts_mem_on = { 223 .pwrsts_mem_on = {
224 [0] = PWRDM_POWER_ON, /* MEMONSTATE */ 224 [0] = PWRSTS_ON, /* MEMONSTATE */
225 }, 225 },
226}; 226};
227 227
diff --git a/arch/arm/mach-omap2/powerdomains44xx_data.c b/arch/arm/mach-omap2/powerdomains44xx_data.c
index 26d7641076d7..c4222c7036a5 100644
--- a/arch/arm/mach-omap2/powerdomains44xx_data.c
+++ b/arch/arm/mach-omap2/powerdomains44xx_data.c
@@ -2,7 +2,7 @@
2 * OMAP4 Power domains framework 2 * OMAP4 Power domains framework
3 * 3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc. 4 * Copyright (C) 2009-2010 Texas Instruments, Inc.
5 * Copyright (C) 2009-2010 Nokia Corporation 5 * Copyright (C) 2009-2011 Nokia Corporation
6 * 6 *
7 * Abhijit Pagare (abhijitpagare@ti.com) 7 * Abhijit Pagare (abhijitpagare@ti.com)
8 * Benoit Cousson (b-cousson@ti.com) 8 * Benoit Cousson (b-cousson@ti.com)
@@ -40,18 +40,18 @@ static struct powerdomain core_44xx_pwrdm = {
40 .pwrsts_logic_ret = PWRSTS_OFF_RET, 40 .pwrsts_logic_ret = PWRSTS_OFF_RET,
41 .banks = 5, 41 .banks = 5,
42 .pwrsts_mem_ret = { 42 .pwrsts_mem_ret = {
43 [0] = PWRDM_POWER_OFF, /* core_nret_bank */ 43 [0] = PWRSTS_OFF, /* core_nret_bank */
44 [1] = PWRSTS_OFF_RET, /* core_ocmram */ 44 [1] = PWRSTS_OFF_RET, /* core_ocmram */
45 [2] = PWRDM_POWER_RET, /* core_other_bank */ 45 [2] = PWRSTS_RET, /* core_other_bank */
46 [3] = PWRSTS_OFF_RET, /* ducati_l2ram */ 46 [3] = PWRSTS_OFF_RET, /* ducati_l2ram */
47 [4] = PWRSTS_OFF_RET, /* ducati_unicache */ 47 [4] = PWRSTS_OFF_RET, /* ducati_unicache */
48 }, 48 },
49 .pwrsts_mem_on = { 49 .pwrsts_mem_on = {
50 [0] = PWRDM_POWER_ON, /* core_nret_bank */ 50 [0] = PWRSTS_ON, /* core_nret_bank */
51 [1] = PWRSTS_OFF_RET, /* core_ocmram */ 51 [1] = PWRSTS_OFF_RET, /* core_ocmram */
52 [2] = PWRDM_POWER_ON, /* core_other_bank */ 52 [2] = PWRSTS_ON, /* core_other_bank */
53 [3] = PWRDM_POWER_ON, /* ducati_l2ram */ 53 [3] = PWRSTS_ON, /* ducati_l2ram */
54 [4] = PWRDM_POWER_ON, /* ducati_unicache */ 54 [4] = PWRSTS_ON, /* ducati_unicache */
55 }, 55 },
56 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 56 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
57}; 57};
@@ -65,10 +65,10 @@ static struct powerdomain gfx_44xx_pwrdm = {
65 .pwrsts = PWRSTS_OFF_ON, 65 .pwrsts = PWRSTS_OFF_ON,
66 .banks = 1, 66 .banks = 1,
67 .pwrsts_mem_ret = { 67 .pwrsts_mem_ret = {
68 [0] = PWRDM_POWER_OFF, /* gfx_mem */ 68 [0] = PWRSTS_OFF, /* gfx_mem */
69 }, 69 },
70 .pwrsts_mem_on = { 70 .pwrsts_mem_on = {
71 [0] = PWRDM_POWER_ON, /* gfx_mem */ 71 [0] = PWRSTS_ON, /* gfx_mem */
72 }, 72 },
73 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 73 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
74}; 74};
@@ -80,15 +80,15 @@ static struct powerdomain abe_44xx_pwrdm = {
80 .prcm_partition = OMAP4430_PRM_PARTITION, 80 .prcm_partition = OMAP4430_PRM_PARTITION,
81 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 81 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
82 .pwrsts = PWRSTS_OFF_RET_ON, 82 .pwrsts = PWRSTS_OFF_RET_ON,
83 .pwrsts_logic_ret = PWRDM_POWER_OFF, 83 .pwrsts_logic_ret = PWRSTS_OFF,
84 .banks = 2, 84 .banks = 2,
85 .pwrsts_mem_ret = { 85 .pwrsts_mem_ret = {
86 [0] = PWRDM_POWER_RET, /* aessmem */ 86 [0] = PWRSTS_RET, /* aessmem */
87 [1] = PWRDM_POWER_OFF, /* periphmem */ 87 [1] = PWRSTS_OFF, /* periphmem */
88 }, 88 },
89 .pwrsts_mem_on = { 89 .pwrsts_mem_on = {
90 [0] = PWRDM_POWER_ON, /* aessmem */ 90 [0] = PWRSTS_ON, /* aessmem */
91 [1] = PWRDM_POWER_ON, /* periphmem */ 91 [1] = PWRSTS_ON, /* periphmem */
92 }, 92 },
93 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 93 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
94}; 94};
@@ -103,10 +103,10 @@ static struct powerdomain dss_44xx_pwrdm = {
103 .pwrsts_logic_ret = PWRSTS_OFF, 103 .pwrsts_logic_ret = PWRSTS_OFF,
104 .banks = 1, 104 .banks = 1,
105 .pwrsts_mem_ret = { 105 .pwrsts_mem_ret = {
106 [0] = PWRDM_POWER_OFF, /* dss_mem */ 106 [0] = PWRSTS_OFF, /* dss_mem */
107 }, 107 },
108 .pwrsts_mem_on = { 108 .pwrsts_mem_on = {
109 [0] = PWRDM_POWER_ON, /* dss_mem */ 109 [0] = PWRSTS_ON, /* dss_mem */
110 }, 110 },
111 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 111 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
112}; 112};
@@ -121,14 +121,14 @@ static struct powerdomain tesla_44xx_pwrdm = {
121 .pwrsts_logic_ret = PWRSTS_OFF_RET, 121 .pwrsts_logic_ret = PWRSTS_OFF_RET,
122 .banks = 3, 122 .banks = 3,
123 .pwrsts_mem_ret = { 123 .pwrsts_mem_ret = {
124 [0] = PWRDM_POWER_RET, /* tesla_edma */ 124 [0] = PWRSTS_RET, /* tesla_edma */
125 [1] = PWRSTS_OFF_RET, /* tesla_l1 */ 125 [1] = PWRSTS_OFF_RET, /* tesla_l1 */
126 [2] = PWRSTS_OFF_RET, /* tesla_l2 */ 126 [2] = PWRSTS_OFF_RET, /* tesla_l2 */
127 }, 127 },
128 .pwrsts_mem_on = { 128 .pwrsts_mem_on = {
129 [0] = PWRDM_POWER_ON, /* tesla_edma */ 129 [0] = PWRSTS_ON, /* tesla_edma */
130 [1] = PWRDM_POWER_ON, /* tesla_l1 */ 130 [1] = PWRSTS_ON, /* tesla_l1 */
131 [2] = PWRDM_POWER_ON, /* tesla_l2 */ 131 [2] = PWRSTS_ON, /* tesla_l2 */
132 }, 132 },
133 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 133 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
134}; 134};
@@ -142,10 +142,10 @@ static struct powerdomain wkup_44xx_pwrdm = {
142 .pwrsts = PWRSTS_ON, 142 .pwrsts = PWRSTS_ON,
143 .banks = 1, 143 .banks = 1,
144 .pwrsts_mem_ret = { 144 .pwrsts_mem_ret = {
145 [0] = PWRDM_POWER_OFF, /* wkup_bank */ 145 [0] = PWRSTS_OFF, /* wkup_bank */
146 }, 146 },
147 .pwrsts_mem_on = { 147 .pwrsts_mem_on = {
148 [0] = PWRDM_POWER_ON, /* wkup_bank */ 148 [0] = PWRSTS_ON, /* wkup_bank */
149 }, 149 },
150}; 150};
151 151
@@ -162,7 +162,7 @@ static struct powerdomain cpu0_44xx_pwrdm = {
162 [0] = PWRSTS_OFF_RET, /* cpu0_l1 */ 162 [0] = PWRSTS_OFF_RET, /* cpu0_l1 */
163 }, 163 },
164 .pwrsts_mem_on = { 164 .pwrsts_mem_on = {
165 [0] = PWRDM_POWER_ON, /* cpu0_l1 */ 165 [0] = PWRSTS_ON, /* cpu0_l1 */
166 }, 166 },
167}; 167};
168 168
@@ -179,7 +179,7 @@ static struct powerdomain cpu1_44xx_pwrdm = {
179 [0] = PWRSTS_OFF_RET, /* cpu1_l1 */ 179 [0] = PWRSTS_OFF_RET, /* cpu1_l1 */
180 }, 180 },
181 .pwrsts_mem_on = { 181 .pwrsts_mem_on = {
182 [0] = PWRDM_POWER_ON, /* cpu1_l1 */ 182 [0] = PWRSTS_ON, /* cpu1_l1 */
183 }, 183 },
184}; 184};
185 185
@@ -192,10 +192,10 @@ static struct powerdomain emu_44xx_pwrdm = {
192 .pwrsts = PWRSTS_OFF_ON, 192 .pwrsts = PWRSTS_OFF_ON,
193 .banks = 1, 193 .banks = 1,
194 .pwrsts_mem_ret = { 194 .pwrsts_mem_ret = {
195 [0] = PWRDM_POWER_OFF, /* emu_bank */ 195 [0] = PWRSTS_OFF, /* emu_bank */
196 }, 196 },
197 .pwrsts_mem_on = { 197 .pwrsts_mem_on = {
198 [0] = PWRDM_POWER_ON, /* emu_bank */ 198 [0] = PWRSTS_ON, /* emu_bank */
199 }, 199 },
200}; 200};
201 201
@@ -211,12 +211,12 @@ static struct powerdomain mpu_44xx_pwrdm = {
211 .pwrsts_mem_ret = { 211 .pwrsts_mem_ret = {
212 [0] = PWRSTS_OFF_RET, /* mpu_l1 */ 212 [0] = PWRSTS_OFF_RET, /* mpu_l1 */
213 [1] = PWRSTS_OFF_RET, /* mpu_l2 */ 213 [1] = PWRSTS_OFF_RET, /* mpu_l2 */
214 [2] = PWRDM_POWER_RET, /* mpu_ram */ 214 [2] = PWRSTS_RET, /* mpu_ram */
215 }, 215 },
216 .pwrsts_mem_on = { 216 .pwrsts_mem_on = {
217 [0] = PWRDM_POWER_ON, /* mpu_l1 */ 217 [0] = PWRSTS_ON, /* mpu_l1 */
218 [1] = PWRDM_POWER_ON, /* mpu_l2 */ 218 [1] = PWRSTS_ON, /* mpu_l2 */
219 [2] = PWRDM_POWER_ON, /* mpu_ram */ 219 [2] = PWRSTS_ON, /* mpu_ram */
220 }, 220 },
221}; 221};
222 222
@@ -227,19 +227,19 @@ static struct powerdomain ivahd_44xx_pwrdm = {
227 .prcm_partition = OMAP4430_PRM_PARTITION, 227 .prcm_partition = OMAP4430_PRM_PARTITION,
228 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 228 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
229 .pwrsts = PWRSTS_OFF_RET_ON, 229 .pwrsts = PWRSTS_OFF_RET_ON,
230 .pwrsts_logic_ret = PWRDM_POWER_OFF, 230 .pwrsts_logic_ret = PWRSTS_OFF,
231 .banks = 4, 231 .banks = 4,
232 .pwrsts_mem_ret = { 232 .pwrsts_mem_ret = {
233 [0] = PWRDM_POWER_OFF, /* hwa_mem */ 233 [0] = PWRSTS_OFF, /* hwa_mem */
234 [1] = PWRSTS_OFF_RET, /* sl2_mem */ 234 [1] = PWRSTS_OFF_RET, /* sl2_mem */
235 [2] = PWRSTS_OFF_RET, /* tcm1_mem */ 235 [2] = PWRSTS_OFF_RET, /* tcm1_mem */
236 [3] = PWRSTS_OFF_RET, /* tcm2_mem */ 236 [3] = PWRSTS_OFF_RET, /* tcm2_mem */
237 }, 237 },
238 .pwrsts_mem_on = { 238 .pwrsts_mem_on = {
239 [0] = PWRDM_POWER_ON, /* hwa_mem */ 239 [0] = PWRSTS_ON, /* hwa_mem */
240 [1] = PWRDM_POWER_ON, /* sl2_mem */ 240 [1] = PWRSTS_ON, /* sl2_mem */
241 [2] = PWRDM_POWER_ON, /* tcm1_mem */ 241 [2] = PWRSTS_ON, /* tcm1_mem */
242 [3] = PWRDM_POWER_ON, /* tcm2_mem */ 242 [3] = PWRSTS_ON, /* tcm2_mem */
243 }, 243 },
244 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 244 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
245}; 245};
@@ -253,10 +253,10 @@ static struct powerdomain cam_44xx_pwrdm = {
253 .pwrsts = PWRSTS_OFF_ON, 253 .pwrsts = PWRSTS_OFF_ON,
254 .banks = 1, 254 .banks = 1,
255 .pwrsts_mem_ret = { 255 .pwrsts_mem_ret = {
256 [0] = PWRDM_POWER_OFF, /* cam_mem */ 256 [0] = PWRSTS_OFF, /* cam_mem */
257 }, 257 },
258 .pwrsts_mem_on = { 258 .pwrsts_mem_on = {
259 [0] = PWRDM_POWER_ON, /* cam_mem */ 259 [0] = PWRSTS_ON, /* cam_mem */
260 }, 260 },
261 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 261 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
262}; 262};
@@ -271,10 +271,10 @@ static struct powerdomain l3init_44xx_pwrdm = {
271 .pwrsts_logic_ret = PWRSTS_OFF_RET, 271 .pwrsts_logic_ret = PWRSTS_OFF_RET,
272 .banks = 1, 272 .banks = 1,
273 .pwrsts_mem_ret = { 273 .pwrsts_mem_ret = {
274 [0] = PWRDM_POWER_OFF, /* l3init_bank1 */ 274 [0] = PWRSTS_OFF, /* l3init_bank1 */
275 }, 275 },
276 .pwrsts_mem_on = { 276 .pwrsts_mem_on = {
277 [0] = PWRDM_POWER_ON, /* l3init_bank1 */ 277 [0] = PWRSTS_ON, /* l3init_bank1 */
278 }, 278 },
279 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 279 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
280}; 280};
@@ -289,12 +289,12 @@ static struct powerdomain l4per_44xx_pwrdm = {
289 .pwrsts_logic_ret = PWRSTS_OFF_RET, 289 .pwrsts_logic_ret = PWRSTS_OFF_RET,
290 .banks = 2, 290 .banks = 2,
291 .pwrsts_mem_ret = { 291 .pwrsts_mem_ret = {
292 [0] = PWRDM_POWER_OFF, /* nonretained_bank */ 292 [0] = PWRSTS_OFF, /* nonretained_bank */
293 [1] = PWRDM_POWER_RET, /* retained_bank */ 293 [1] = PWRSTS_RET, /* retained_bank */
294 }, 294 },
295 .pwrsts_mem_on = { 295 .pwrsts_mem_on = {
296 [0] = PWRDM_POWER_ON, /* nonretained_bank */ 296 [0] = PWRSTS_ON, /* nonretained_bank */
297 [1] = PWRDM_POWER_ON, /* retained_bank */ 297 [1] = PWRSTS_ON, /* retained_bank */
298 }, 298 },
299 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 299 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
300}; 300};
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h
index 87486f559784..0363dcb0ef93 100644
--- a/arch/arm/mach-omap2/prcm-common.h
+++ b/arch/arm/mach-omap2/prcm-common.h
@@ -121,6 +121,10 @@
121#define OMAP24XX_ST_MCSPI2_MASK (1 << 18) 121#define OMAP24XX_ST_MCSPI2_MASK (1 << 18)
122#define OMAP24XX_ST_MCSPI1_SHIFT 17 122#define OMAP24XX_ST_MCSPI1_SHIFT 17
123#define OMAP24XX_ST_MCSPI1_MASK (1 << 17) 123#define OMAP24XX_ST_MCSPI1_MASK (1 << 17)
124#define OMAP24XX_ST_MCBSP2_SHIFT 16
125#define OMAP24XX_ST_MCBSP2_MASK (1 << 16)
126#define OMAP24XX_ST_MCBSP1_SHIFT 15
127#define OMAP24XX_ST_MCBSP1_MASK (1 << 15)
124#define OMAP24XX_ST_GPT12_SHIFT 14 128#define OMAP24XX_ST_GPT12_SHIFT 14
125#define OMAP24XX_ST_GPT12_MASK (1 << 14) 129#define OMAP24XX_ST_GPT12_MASK (1 << 14)
126#define OMAP24XX_ST_GPT11_SHIFT 13 130#define OMAP24XX_ST_GPT11_SHIFT 13
@@ -191,6 +195,8 @@
191#define OMAP3430_AUTOIDLE_MASK (1 << 0) 195#define OMAP3430_AUTOIDLE_MASK (1 << 0)
192 196
193/* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */ 197/* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */
198#define OMAP3430_EN_MMC3_MASK (1 << 30)
199#define OMAP3430_EN_MMC3_SHIFT 30
194#define OMAP3430_EN_MMC2_MASK (1 << 25) 200#define OMAP3430_EN_MMC2_MASK (1 << 25)
195#define OMAP3430_EN_MMC2_SHIFT 25 201#define OMAP3430_EN_MMC2_SHIFT 25
196#define OMAP3430_EN_MMC1_MASK (1 << 24) 202#define OMAP3430_EN_MMC1_MASK (1 << 24)
@@ -231,6 +237,8 @@
231#define OMAP3430_EN_HSOTGUSB_SHIFT 4 237#define OMAP3430_EN_HSOTGUSB_SHIFT 4
232 238
233/* PM_WKST1_CORE, CM_IDLEST1_CORE shared bits */ 239/* PM_WKST1_CORE, CM_IDLEST1_CORE shared bits */
240#define OMAP3430_ST_MMC3_SHIFT 30
241#define OMAP3430_ST_MMC3_MASK (1 << 30)
234#define OMAP3430_ST_MMC2_SHIFT 25 242#define OMAP3430_ST_MMC2_SHIFT 25
235#define OMAP3430_ST_MMC2_MASK (1 << 25) 243#define OMAP3430_ST_MMC2_MASK (1 << 25)
236#define OMAP3430_ST_MMC1_SHIFT 24 244#define OMAP3430_ST_MMC1_SHIFT 24
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
index 679bcd28576e..6be14389e4f3 100644
--- a/arch/arm/mach-omap2/prcm.c
+++ b/arch/arm/mach-omap2/prcm.c
@@ -24,6 +24,7 @@
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26 26
27#include <mach/system.h>
27#include <plat/common.h> 28#include <plat/common.h>
28#include <plat/prcm.h> 29#include <plat/prcm.h>
29#include <plat/irqs.h> 30#include <plat/irqs.h>
@@ -57,7 +58,7 @@ u32 omap_prcm_get_reset_sources(void)
57EXPORT_SYMBOL(omap_prcm_get_reset_sources); 58EXPORT_SYMBOL(omap_prcm_get_reset_sources);
58 59
59/* Resets clock rates and reboots the system. Only called from system.h */ 60/* Resets clock rates and reboots the system. Only called from system.h */
60void omap_prcm_arch_reset(char mode, const char *cmd) 61static void omap_prcm_arch_reset(char mode, const char *cmd)
61{ 62{
62 s16 prcm_offs = 0; 63 s16 prcm_offs = 0;
63 64
@@ -108,6 +109,8 @@ void omap_prcm_arch_reset(char mode, const char *cmd)
108 omap2_prm_read_mod_reg(prcm_offs, OMAP2_RM_RSTCTRL); /* OCP barrier */ 109 omap2_prm_read_mod_reg(prcm_offs, OMAP2_RM_RSTCTRL); /* OCP barrier */
109} 110}
110 111
112void (*arch_reset)(char, const char *) = omap_prcm_arch_reset;
113
111/** 114/**
112 * omap2_cm_wait_idlest - wait for IDLEST bit to indicate module readiness 115 * omap2_cm_wait_idlest - wait for IDLEST bit to indicate module readiness
113 * @reg: physical address of module IDLEST register 116 * @reg: physical address of module IDLEST register
diff --git a/arch/arm/mach-omap2/prcm_mpu44xx.h b/arch/arm/mach-omap2/prcm_mpu44xx.h
index 729a644ce852..d22d1b43bccd 100644
--- a/arch/arm/mach-omap2/prcm_mpu44xx.h
+++ b/arch/arm/mach-omap2/prcm_mpu44xx.h
@@ -38,8 +38,8 @@
38#define OMAP4430_PRCM_MPU_CPU1_INST 0x0800 38#define OMAP4430_PRCM_MPU_CPU1_INST 0x0800
39 39
40/* PRCM_MPU clockdomain register offsets (from instance start) */ 40/* PRCM_MPU clockdomain register offsets (from instance start) */
41#define OMAP4430_PRCM_MPU_CPU0_MPU_CDOFFS 0x0000 41#define OMAP4430_PRCM_MPU_CPU0_CPU0_CDOFFS 0x0018
42#define OMAP4430_PRCM_MPU_CPU1_MPU_CDOFFS 0x0000 42#define OMAP4430_PRCM_MPU_CPU1_CPU1_CDOFFS 0x0018
43 43
44 44
45/* 45/*
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c
index ec0362574b5e..051213fbc346 100644
--- a/arch/arm/mach-omap2/prm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c
@@ -118,7 +118,8 @@ int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift)
118/** 118/**
119 * omap2_prm_deassert_hardreset - deassert a submodule hardreset line and wait 119 * omap2_prm_deassert_hardreset - deassert a submodule hardreset line and wait
120 * @prm_mod: PRM submodule base (e.g. CORE_MOD) 120 * @prm_mod: PRM submodule base (e.g. CORE_MOD)
121 * @shift: register bit shift corresponding to the reset line to deassert 121 * @rst_shift: register bit shift corresponding to the reset line to deassert
122 * @st_shift: register bit shift for the status of the deasserted submodule
122 * 123 *
123 * Some IPs like dsp or iva contain processors that require an HW 124 * Some IPs like dsp or iva contain processors that require an HW
124 * reset line to be asserted / deasserted in order to fully enable the 125 * reset line to be asserted / deasserted in order to fully enable the
@@ -129,27 +130,28 @@ int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift)
129 * -EINVAL upon an argument error, -EEXIST if the submodule was already out 130 * -EINVAL upon an argument error, -EEXIST if the submodule was already out
130 * of reset, or -EBUSY if the submodule did not exit reset promptly. 131 * of reset, or -EBUSY if the submodule did not exit reset promptly.
131 */ 132 */
132int omap2_prm_deassert_hardreset(s16 prm_mod, u8 shift) 133int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift)
133{ 134{
134 u32 mask; 135 u32 rst, st;
135 int c; 136 int c;
136 137
137 if (!(cpu_is_omap24xx() || cpu_is_omap34xx())) 138 if (!(cpu_is_omap24xx() || cpu_is_omap34xx()))
138 return -EINVAL; 139 return -EINVAL;
139 140
140 mask = 1 << shift; 141 rst = 1 << rst_shift;
142 st = 1 << st_shift;
141 143
142 /* Check the current status to avoid de-asserting the line twice */ 144 /* Check the current status to avoid de-asserting the line twice */
143 if (omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTCTRL, mask) == 0) 145 if (omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTCTRL, rst) == 0)
144 return -EEXIST; 146 return -EEXIST;
145 147
146 /* Clear the reset status by writing 1 to the status bit */ 148 /* Clear the reset status by writing 1 to the status bit */
147 omap2_prm_rmw_mod_reg_bits(0xffffffff, mask, prm_mod, OMAP2_RM_RSTST); 149 omap2_prm_rmw_mod_reg_bits(0xffffffff, st, prm_mod, OMAP2_RM_RSTST);
148 /* de-assert the reset control line */ 150 /* de-assert the reset control line */
149 omap2_prm_rmw_mod_reg_bits(mask, 0, prm_mod, OMAP2_RM_RSTCTRL); 151 omap2_prm_rmw_mod_reg_bits(rst, 0, prm_mod, OMAP2_RM_RSTCTRL);
150 /* wait the status to be set */ 152 /* wait the status to be set */
151 omap_test_timeout(omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTST, 153 omap_test_timeout(omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTST,
152 mask), 154 st),
153 MAX_MODULE_HARDRESET_WAIT, c); 155 MAX_MODULE_HARDRESET_WAIT, c);
154 156
155 return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0; 157 return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0;
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.h b/arch/arm/mach-omap2/prm2xxx_3xxx.h
index 49654c8d18f5..a1fc62a39dbb 100644
--- a/arch/arm/mach-omap2/prm2xxx_3xxx.h
+++ b/arch/arm/mach-omap2/prm2xxx_3xxx.h
@@ -282,7 +282,8 @@ static inline int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift)
282 "not suppose to be used on omap4\n"); 282 "not suppose to be used on omap4\n");
283 return 0; 283 return 0;
284} 284}
285static inline int omap2_prm_deassert_hardreset(s16 prm_mod, u8 shift) 285static inline int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift,
286 u8 st_shift)
286{ 287{
287 WARN(1, "prm: omap2xxx/omap3xxx specific function and " 288 WARN(1, "prm: omap2xxx/omap3xxx specific function and "
288 "not suppose to be used on omap4\n"); 289 "not suppose to be used on omap4\n");
@@ -300,7 +301,7 @@ extern u32 omap2_prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask);
300/* These omap2_ PRM functions apply to both OMAP2 and 3 */ 301/* These omap2_ PRM functions apply to both OMAP2 and 3 */
301extern int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift); 302extern int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift);
302extern int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift); 303extern int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift);
303extern int omap2_prm_deassert_hardreset(s16 prm_mod, u8 shift); 304extern int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift);
304 305
305#endif /* CONFIG_ARCH_OMAP4 */ 306#endif /* CONFIG_ARCH_OMAP4 */
306#endif 307#endif
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 302da7403a10..1ac361b7b8cb 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -486,7 +486,7 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
486 mod_timer(&uart->timer, jiffies + uart->timeout); 486 mod_timer(&uart->timer, jiffies + uart->timeout);
487 omap_uart_smart_idle_enable(uart, 0); 487 omap_uart_smart_idle_enable(uart, 0);
488 488
489 if (cpu_is_omap34xx()) { 489 if (cpu_is_omap34xx() && !cpu_is_ti816x()) {
490 u32 mod = (uart->num > 1) ? OMAP3430_PER_MOD : CORE_MOD; 490 u32 mod = (uart->num > 1) ? OMAP3430_PER_MOD : CORE_MOD;
491 u32 wk_mask = 0; 491 u32 wk_mask = 0;
492 u32 padconf = 0; 492 u32 padconf = 0;
@@ -655,7 +655,7 @@ static void serial_out_override(struct uart_port *up, int offset, int value)
655} 655}
656#endif 656#endif
657 657
658void __init omap_serial_early_init(void) 658static int __init omap_serial_early_init(void)
659{ 659{
660 int i = 0; 660 int i = 0;
661 661
@@ -672,7 +672,7 @@ void __init omap_serial_early_init(void)
672 672
673 uart = kzalloc(sizeof(struct omap_uart_state), GFP_KERNEL); 673 uart = kzalloc(sizeof(struct omap_uart_state), GFP_KERNEL);
674 if (WARN_ON(!uart)) 674 if (WARN_ON(!uart))
675 return; 675 return -ENODEV;
676 676
677 uart->oh = oh; 677 uart->oh = oh;
678 uart->num = i++; 678 uart->num = i++;
@@ -680,7 +680,7 @@ void __init omap_serial_early_init(void)
680 num_uarts++; 680 num_uarts++;
681 681
682 /* 682 /*
683 * NOTE: omap_hwmod_init() has not yet been called, 683 * NOTE: omap_hwmod_setup*() has not yet been called,
684 * so no hwmod functions will work yet. 684 * so no hwmod functions will work yet.
685 */ 685 */
686 686
@@ -691,7 +691,10 @@ void __init omap_serial_early_init(void)
691 */ 691 */
692 uart->oh->flags |= HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET; 692 uart->oh->flags |= HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET;
693 } while (1); 693 } while (1);
694
695 return 0;
694} 696}
697core_initcall(omap_serial_early_init);
695 698
696/** 699/**
697 * omap_serial_init_port() - initialize single serial port 700 * omap_serial_init_port() - initialize single serial port
@@ -759,13 +762,13 @@ void __init omap_serial_init_port(struct omap_board_data *bdata)
759 p->private_data = uart; 762 p->private_data = uart;
760 763
761 /* 764 /*
762 * omap44xx: Never read empty UART fifo 765 * omap44xx, ti816x: Never read empty UART fifo
763 * omap3xxx: Never read empty UART fifo on UARTs 766 * omap3xxx: Never read empty UART fifo on UARTs
764 * with IP rev >=0x52 767 * with IP rev >=0x52
765 */ 768 */
766 uart->regshift = p->regshift; 769 uart->regshift = p->regshift;
767 uart->membase = p->membase; 770 uart->membase = p->membase;
768 if (cpu_is_omap44xx()) 771 if (cpu_is_omap44xx() || cpu_is_ti816x())
769 uart->errata |= UART_ERRATA_FIFO_FULL_ABORT; 772 uart->errata |= UART_ERRATA_FIFO_FULL_ABORT;
770 else if ((serial_read_reg(uart, UART_OMAP_MVER) & 0xFF) 773 else if ((serial_read_reg(uart, UART_OMAP_MVER) & 0xFF)
771 >= UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV) 774 >= UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV)
@@ -812,7 +815,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata)
812 815
813 oh->dev_attr = uart; 816 oh->dev_attr = uart;
814 817
815 acquire_console_sem(); /* in case the earlycon is on the UART */ 818 console_lock(); /* in case the earlycon is on the UART */
816 819
817 /* 820 /*
818 * Because of early UART probing, UART did not get idled 821 * Because of early UART probing, UART did not get idled
@@ -838,7 +841,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata)
838 omap_uart_block_sleep(uart); 841 omap_uart_block_sleep(uart);
839 uart->timeout = DEFAULT_TIMEOUT; 842 uart->timeout = DEFAULT_TIMEOUT;
840 843
841 release_console_sem(); 844 console_unlock();
842 845
843 if ((cpu_is_omap34xx() && uart->padconf) || 846 if ((cpu_is_omap34xx() && uart->padconf) ||
844 (uart->wk_en && uart->wk_mask)) { 847 (uart->wk_en && uart->wk_mask)) {
@@ -847,7 +850,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata)
847 } 850 }
848 851
849 /* Enable the MDR1 errata for OMAP3 */ 852 /* Enable the MDR1 errata for OMAP3 */
850 if (cpu_is_omap34xx()) 853 if (cpu_is_omap34xx() && !cpu_is_ti816x())
851 uart->errata |= UART_ERRATA_i202_MDR1_ACCESS; 854 uart->errata |= UART_ERRATA_i202_MDR1_ACCESS;
852} 855}
853 856
diff --git a/arch/arm/mach-omap2/sleep24xx.S b/arch/arm/mach-omap2/sleep24xx.S
index c7780cc8d919..b5071a47ec39 100644
--- a/arch/arm/mach-omap2/sleep24xx.S
+++ b/arch/arm/mach-omap2/sleep24xx.S
@@ -47,6 +47,7 @@
47 * Note: This code get's copied to internal SRAM at boot. When the OMAP 47 * Note: This code get's copied to internal SRAM at boot. When the OMAP
48 * wakes up it continues execution at the point it went to sleep. 48 * wakes up it continues execution at the point it went to sleep.
49 */ 49 */
50 .align 3
50ENTRY(omap24xx_idle_loop_suspend) 51ENTRY(omap24xx_idle_loop_suspend)
51 stmfd sp!, {r0, lr} @ save registers on stack 52 stmfd sp!, {r0, lr} @ save registers on stack
52 mov r0, #0 @ clear for mcr setup 53 mov r0, #0 @ clear for mcr setup
@@ -82,6 +83,7 @@ ENTRY(omap24xx_idle_loop_suspend_sz)
82 * The DLL load value is not kept in RETENTION or OFF. It needs to be restored 83 * The DLL load value is not kept in RETENTION or OFF. It needs to be restored
83 * at wake 84 * at wake
84 */ 85 */
86 .align 3
85ENTRY(omap24xx_cpu_suspend) 87ENTRY(omap24xx_cpu_suspend)
86 stmfd sp!, {r0 - r12, lr} @ save registers on stack 88 stmfd sp!, {r0 - r12, lr} @ save registers on stack
87 mov r3, #0x0 @ clear for mcr call 89 mov r3, #0x0 @ clear for mcr call
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
index 98d8232808b8..63f10669571a 100644
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -64,6 +64,11 @@
64#define SDRC_DLLA_STATUS_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS) 64#define SDRC_DLLA_STATUS_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS)
65#define SDRC_DLLA_CTRL_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL) 65#define SDRC_DLLA_CTRL_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL)
66 66
67/*
68 * This file needs be built unconditionally as ARM to interoperate correctly
69 * with non-Thumb-2-capable firmware.
70 */
71 .arm
67 72
68/* 73/*
69 * API functions 74 * API functions
@@ -82,6 +87,8 @@ ENTRY(get_restore_pointer)
82 stmfd sp!, {lr} @ save registers on stack 87 stmfd sp!, {lr} @ save registers on stack
83 adr r0, restore 88 adr r0, restore
84 ldmfd sp!, {pc} @ restore regs and return 89 ldmfd sp!, {pc} @ restore regs and return
90ENDPROC(get_restore_pointer)
91 .align
85ENTRY(get_restore_pointer_sz) 92ENTRY(get_restore_pointer_sz)
86 .word . - get_restore_pointer 93 .word . - get_restore_pointer
87 94
@@ -91,6 +98,8 @@ ENTRY(get_omap3630_restore_pointer)
91 stmfd sp!, {lr} @ save registers on stack 98 stmfd sp!, {lr} @ save registers on stack
92 adr r0, restore_3630 99 adr r0, restore_3630
93 ldmfd sp!, {pc} @ restore regs and return 100 ldmfd sp!, {pc} @ restore regs and return
101ENDPROC(get_omap3630_restore_pointer)
102 .align
94ENTRY(get_omap3630_restore_pointer_sz) 103ENTRY(get_omap3630_restore_pointer_sz)
95 .word . - get_omap3630_restore_pointer 104 .word . - get_omap3630_restore_pointer
96 105
@@ -100,6 +109,8 @@ ENTRY(get_es3_restore_pointer)
100 stmfd sp!, {lr} @ save registers on stack 109 stmfd sp!, {lr} @ save registers on stack
101 adr r0, restore_es3 110 adr r0, restore_es3
102 ldmfd sp!, {pc} @ restore regs and return 111 ldmfd sp!, {pc} @ restore regs and return
112ENDPROC(get_es3_restore_pointer)
113 .align
103ENTRY(get_es3_restore_pointer_sz) 114ENTRY(get_es3_restore_pointer_sz)
104 .word . - get_es3_restore_pointer 115 .word . - get_es3_restore_pointer
105 116
@@ -113,11 +124,14 @@ ENTRY(enable_omap3630_toggle_l2_on_restore)
113 stmfd sp!, {lr} @ save registers on stack 124 stmfd sp!, {lr} @ save registers on stack
114 /* Setup so that we will disable and enable l2 */ 125 /* Setup so that we will disable and enable l2 */
115 mov r1, #0x1 126 mov r1, #0x1
116 str r1, l2dis_3630 127 adrl r2, l2dis_3630 @ may be too distant for plain adr
128 str r1, [r2]
117 ldmfd sp!, {pc} @ restore regs and return 129 ldmfd sp!, {pc} @ restore regs and return
130ENDPROC(enable_omap3630_toggle_l2_on_restore)
118 131
119 .text 132 .text
120/* Function to call rom code to save secure ram context */ 133/* Function to call rom code to save secure ram context */
134 .align 3
121ENTRY(save_secure_ram_context) 135ENTRY(save_secure_ram_context)
122 stmfd sp!, {r1-r12, lr} @ save registers on stack 136 stmfd sp!, {r1-r12, lr} @ save registers on stack
123 adr r3, api_params @ r3 points to parameters 137 adr r3, api_params @ r3 points to parameters
@@ -131,20 +145,22 @@ ENTRY(save_secure_ram_context)
131 mov r1, #0 @ set task id for ROM code in r1 145 mov r1, #0 @ set task id for ROM code in r1
132 mov r2, #4 @ set some flags in r2, r6 146 mov r2, #4 @ set some flags in r2, r6
133 mov r6, #0xff 147 mov r6, #0xff
134 mcr p15, 0, r0, c7, c10, 4 @ data write barrier 148 dsb @ data write barrier
135 mcr p15, 0, r0, c7, c10, 5 @ data memory barrier 149 dmb @ data memory barrier
136 .word 0xE1600071 @ call SMI monitor (smi #1) 150 smc #1 @ call SMI monitor (smi #1)
137 nop 151 nop
138 nop 152 nop
139 nop 153 nop
140 nop 154 nop
141 ldmfd sp!, {r1-r12, pc} 155 ldmfd sp!, {r1-r12, pc}
156 .align
142sram_phy_addr_mask: 157sram_phy_addr_mask:
143 .word SRAM_BASE_P 158 .word SRAM_BASE_P
144high_mask: 159high_mask:
145 .word 0xffff 160 .word 0xffff
146api_params: 161api_params:
147 .word 0x4, 0x0, 0x0, 0x1, 0x1 162 .word 0x4, 0x0, 0x0, 0x1, 0x1
163ENDPROC(save_secure_ram_context)
148ENTRY(save_secure_ram_context_sz) 164ENTRY(save_secure_ram_context_sz)
149 .word . - save_secure_ram_context 165 .word . - save_secure_ram_context
150 166
@@ -169,16 +185,17 @@ ENTRY(save_secure_ram_context_sz)
169 * depending on the low power mode (non-OFF vs OFF modes), 185 * depending on the low power mode (non-OFF vs OFF modes),
170 * cf. 'Resume path for xxx mode' comments. 186 * cf. 'Resume path for xxx mode' comments.
171 */ 187 */
188 .align 3
172ENTRY(omap34xx_cpu_suspend) 189ENTRY(omap34xx_cpu_suspend)
173 stmfd sp!, {r0-r12, lr} @ save registers on stack 190 stmfd sp!, {r0-r12, lr} @ save registers on stack
174 191
175 /* 192 /*
176 * r0 contains restore pointer in sdram 193 * r0 contains CPU context save/restore pointer in sdram
177 * r1 contains information about saving context: 194 * r1 contains information about saving context:
178 * 0 - No context lost 195 * 0 - No context lost
179 * 1 - Only L1 and logic lost 196 * 1 - Only L1 and logic lost
180 * 2 - Only L2 lost 197 * 2 - Only L2 lost (Even L1 is retained we clean it along with L2)
181 * 3 - Both L1 and L2 lost 198 * 3 - Both L1 and L2 lost and logic lost
182 */ 199 */
183 200
184 /* Directly jump to WFI is the context save is not required */ 201 /* Directly jump to WFI is the context save is not required */
@@ -199,89 +216,74 @@ save_context_wfi:
199 beq clean_caches 216 beq clean_caches
200 217
201l1_logic_lost: 218l1_logic_lost:
202 /* Store sp and spsr to SDRAM */ 219 mov r4, sp @ Store sp
203 mov r4, sp 220 mrs r5, spsr @ Store spsr
204 mrs r5, spsr 221 mov r6, lr @ Store lr
205 mov r6, lr
206 stmia r8!, {r4-r6} 222 stmia r8!, {r4-r6}
207 /* Save all ARM registers */ 223
208 /* Coprocessor access control register */ 224 mrc p15, 0, r4, c1, c0, 2 @ Coprocessor access control register
209 mrc p15, 0, r6, c1, c0, 2 225 mrc p15, 0, r5, c2, c0, 0 @ TTBR0
210 stmia r8!, {r6} 226 mrc p15, 0, r6, c2, c0, 1 @ TTBR1
211 /* TTBR0, TTBR1 and Translation table base control */ 227 mrc p15, 0, r7, c2, c0, 2 @ TTBCR
212 mrc p15, 0, r4, c2, c0, 0
213 mrc p15, 0, r5, c2, c0, 1
214 mrc p15, 0, r6, c2, c0, 2
215 stmia r8!, {r4-r6}
216 /*
217 * Domain access control register, data fault status register,
218 * and instruction fault status register
219 */
220 mrc p15, 0, r4, c3, c0, 0
221 mrc p15, 0, r5, c5, c0, 0
222 mrc p15, 0, r6, c5, c0, 1
223 stmia r8!, {r4-r6}
224 /*
225 * Data aux fault status register, instruction aux fault status,
226 * data fault address register and instruction fault address register
227 */
228 mrc p15, 0, r4, c5, c1, 0
229 mrc p15, 0, r5, c5, c1, 1
230 mrc p15, 0, r6, c6, c0, 0
231 mrc p15, 0, r7, c6, c0, 2
232 stmia r8!, {r4-r7}
233 /*
234 * user r/w thread and process ID, user r/o thread and process ID,
235 * priv only thread and process ID, cache size selection
236 */
237 mrc p15, 0, r4, c13, c0, 2
238 mrc p15, 0, r5, c13, c0, 3
239 mrc p15, 0, r6, c13, c0, 4
240 mrc p15, 2, r7, c0, c0, 0
241 stmia r8!, {r4-r7} 228 stmia r8!, {r4-r7}
242 /* Data TLB lockdown, instruction TLB lockdown registers */
243 mrc p15, 0, r5, c10, c0, 0
244 mrc p15, 0, r6, c10, c0, 1
245 stmia r8!, {r5-r6}
246 /* Secure or non secure vector base address, FCSE PID, Context PID*/
247 mrc p15, 0, r4, c12, c0, 0
248 mrc p15, 0, r5, c13, c0, 0
249 mrc p15, 0, r6, c13, c0, 1
250 stmia r8!, {r4-r6}
251 /* Primary remap, normal remap registers */
252 mrc p15, 0, r4, c10, c2, 0
253 mrc p15, 0, r5, c10, c2, 1
254 stmia r8!,{r4-r5}
255 229
256 /* Store current cpsr*/ 230 mrc p15, 0, r4, c3, c0, 0 @ Domain access Control Register
257 mrs r2, cpsr 231 mrc p15, 0, r5, c10, c2, 0 @ PRRR
258 stmia r8!, {r2} 232 mrc p15, 0, r6, c10, c2, 1 @ NMRR
233 stmia r8!,{r4-r6}
259 234
260 mrc p15, 0, r4, c1, c0, 0 235 mrc p15, 0, r4, c13, c0, 1 @ Context ID
261 /* save control register */ 236 mrc p15, 0, r5, c13, c0, 2 @ User r/w thread and process ID
237 mrc p15, 0, r6, c12, c0, 0 @ Secure or NS vector base address
238 mrs r7, cpsr @ Store current cpsr
239 stmia r8!, {r4-r7}
240
241 mrc p15, 0, r4, c1, c0, 0 @ save control register
262 stmia r8!, {r4} 242 stmia r8!, {r4}
263 243
264clean_caches: 244clean_caches:
265 /* 245 /*
266 * Clean Data or unified cache to POU
267 * How to invalidate only L1 cache???? - #FIX_ME#
268 * mcr p15, 0, r11, c7, c11, 1
269 */
270 cmp r1, #0x1 @ Check whether L2 inval is required
271 beq omap3_do_wfi
272
273clean_l2:
274 /*
275 * jump out to kernel flush routine 246 * jump out to kernel flush routine
276 * - reuse that code is better 247 * - reuse that code is better
277 * - it executes in a cached space so is faster than refetch per-block 248 * - it executes in a cached space so is faster than refetch per-block
278 * - should be faster and will change with kernel 249 * - should be faster and will change with kernel
279 * - 'might' have to copy address, load and jump to it 250 * - 'might' have to copy address, load and jump to it
251 * Flush all data from the L1 data cache before disabling
252 * SCTLR.C bit.
280 */ 253 */
281 ldr r1, kernel_flush 254 ldr r1, kernel_flush
282 mov lr, pc 255 mov lr, pc
283 bx r1 256 bx r1
284 257
258 /*
259 * Clear the SCTLR.C bit to prevent further data cache
260 * allocation. Clearing SCTLR.C would make all the data accesses
261 * strongly ordered and would not hit the cache.
262 */
263 mrc p15, 0, r0, c1, c0, 0
264 bic r0, r0, #(1 << 2) @ Disable the C bit
265 mcr p15, 0, r0, c1, c0, 0
266 isb
267
268 /*
269 * Invalidate L1 data cache. Even though only invalidate is
270 * necessary exported flush API is used here. Doing clean
271 * on already clean cache would be almost NOP.
272 */
273 ldr r1, kernel_flush
274 blx r1
275 /*
276 * The kernel doesn't interwork: v7_flush_dcache_all in particluar will
277 * always return in Thumb state when CONFIG_THUMB2_KERNEL is enabled.
278 * This sequence switches back to ARM. Note that .align may insert a
279 * nop: bx pc needs to be word-aligned in order to work.
280 */
281 THUMB( .thumb )
282 THUMB( .align )
283 THUMB( bx pc )
284 THUMB( nop )
285 .arm
286
285omap3_do_wfi: 287omap3_do_wfi:
286 ldr r4, sdrc_power @ read the SDRC_POWER register 288 ldr r4, sdrc_power @ read the SDRC_POWER register
287 ldr r5, [r4] @ read the contents of SDRC_POWER 289 ldr r5, [r4] @ read the contents of SDRC_POWER
@@ -289,9 +291,8 @@ omap3_do_wfi:
289 str r5, [r4] @ write back to SDRC_POWER register 291 str r5, [r4] @ write back to SDRC_POWER register
290 292
291 /* Data memory barrier and Data sync barrier */ 293 /* Data memory barrier and Data sync barrier */
292 mov r1, #0 294 dsb
293 mcr p15, 0, r1, c7, c10, 4 295 dmb
294 mcr p15, 0, r1, c7, c10, 5
295 296
296/* 297/*
297 * =================================== 298 * ===================================
@@ -317,6 +318,12 @@ omap3_do_wfi:
317 nop 318 nop
318 bl wait_sdrc_ok 319 bl wait_sdrc_ok
319 320
321 mrc p15, 0, r0, c1, c0, 0
322 tst r0, #(1 << 2) @ Check C bit enabled?
323 orreq r0, r0, #(1 << 2) @ Enable the C bit if cleared
324 mcreq p15, 0, r0, c1, c0, 0
325 isb
326
320/* 327/*
321 * =================================== 328 * ===================================
322 * == Exit point from non-OFF modes == 329 * == Exit point from non-OFF modes ==
@@ -406,9 +413,9 @@ skipl2dis:
406 mov r2, #4 @ set some flags in r2, r6 413 mov r2, #4 @ set some flags in r2, r6
407 mov r6, #0xff 414 mov r6, #0xff
408 adr r3, l2_inv_api_params @ r3 points to dummy parameters 415 adr r3, l2_inv_api_params @ r3 points to dummy parameters
409 mcr p15, 0, r0, c7, c10, 4 @ data write barrier 416 dsb @ data write barrier
410 mcr p15, 0, r0, c7, c10, 5 @ data memory barrier 417 dmb @ data memory barrier
411 .word 0xE1600071 @ call SMI monitor (smi #1) 418 smc #1 @ call SMI monitor (smi #1)
412 /* Write to Aux control register to set some bits */ 419 /* Write to Aux control register to set some bits */
413 mov r0, #42 @ set service ID for PPA 420 mov r0, #42 @ set service ID for PPA
414 mov r12, r0 @ copy secure Service ID in r12 421 mov r12, r0 @ copy secure Service ID in r12
@@ -417,9 +424,9 @@ skipl2dis:
417 mov r6, #0xff 424 mov r6, #0xff
418 ldr r4, scratchpad_base 425 ldr r4, scratchpad_base
419 ldr r3, [r4, #0xBC] @ r3 points to parameters 426 ldr r3, [r4, #0xBC] @ r3 points to parameters
420 mcr p15, 0, r0, c7, c10, 4 @ data write barrier 427 dsb @ data write barrier
421 mcr p15, 0, r0, c7, c10, 5 @ data memory barrier 428 dmb @ data memory barrier
422 .word 0xE1600071 @ call SMI monitor (smi #1) 429 smc #1 @ call SMI monitor (smi #1)
423 430
424#ifdef CONFIG_OMAP3_L2_AUX_SECURE_SAVE_RESTORE 431#ifdef CONFIG_OMAP3_L2_AUX_SECURE_SAVE_RESTORE
425 /* Restore L2 aux control register */ 432 /* Restore L2 aux control register */
@@ -432,29 +439,30 @@ skipl2dis:
432 ldr r4, scratchpad_base 439 ldr r4, scratchpad_base
433 ldr r3, [r4, #0xBC] 440 ldr r3, [r4, #0xBC]
434 adds r3, r3, #8 @ r3 points to parameters 441 adds r3, r3, #8 @ r3 points to parameters
435 mcr p15, 0, r0, c7, c10, 4 @ data write barrier 442 dsb @ data write barrier
436 mcr p15, 0, r0, c7, c10, 5 @ data memory barrier 443 dmb @ data memory barrier
437 .word 0xE1600071 @ call SMI monitor (smi #1) 444 smc #1 @ call SMI monitor (smi #1)
438#endif 445#endif
439 b logic_l1_restore 446 b logic_l1_restore
440 447
448 .align
441l2_inv_api_params: 449l2_inv_api_params:
442 .word 0x1, 0x00 450 .word 0x1, 0x00
443l2_inv_gp: 451l2_inv_gp:
444 /* Execute smi to invalidate L2 cache */ 452 /* Execute smi to invalidate L2 cache */
445 mov r12, #0x1 @ set up to invalidate L2 453 mov r12, #0x1 @ set up to invalidate L2
446 .word 0xE1600070 @ Call SMI monitor (smieq) 454 smc #0 @ Call SMI monitor (smieq)
447 /* Write to Aux control register to set some bits */ 455 /* Write to Aux control register to set some bits */
448 ldr r4, scratchpad_base 456 ldr r4, scratchpad_base
449 ldr r3, [r4,#0xBC] 457 ldr r3, [r4,#0xBC]
450 ldr r0, [r3,#4] 458 ldr r0, [r3,#4]
451 mov r12, #0x3 459 mov r12, #0x3
452 .word 0xE1600070 @ Call SMI monitor (smieq) 460 smc #0 @ Call SMI monitor (smieq)
453 ldr r4, scratchpad_base 461 ldr r4, scratchpad_base
454 ldr r3, [r4,#0xBC] 462 ldr r3, [r4,#0xBC]
455 ldr r0, [r3,#12] 463 ldr r0, [r3,#12]
456 mov r12, #0x2 464 mov r12, #0x2
457 .word 0xE1600070 @ Call SMI monitor (smieq) 465 smc #0 @ Call SMI monitor (smieq)
458logic_l1_restore: 466logic_l1_restore:
459 ldr r1, l2dis_3630 467 ldr r1, l2dis_3630
460 cmp r1, #0x1 @ Test if L2 re-enable needed on 3630 468 cmp r1, #0x1 @ Test if L2 re-enable needed on 3630
@@ -473,68 +481,29 @@ skipl2reen:
473 ldr r4, scratchpad_base 481 ldr r4, scratchpad_base
474 ldr r3, [r4,#0xBC] 482 ldr r3, [r4,#0xBC]
475 adds r3, r3, #16 483 adds r3, r3, #16
484
476 ldmia r3!, {r4-r6} 485 ldmia r3!, {r4-r6}
477 mov sp, r4 486 mov sp, r4 @ Restore sp
478 msr spsr_cxsf, r5 487 msr spsr_cxsf, r5 @ Restore spsr
479 mov lr, r6 488 mov lr, r6 @ Restore lr
480 489
481 ldmia r3!, {r4-r9} 490 ldmia r3!, {r4-r7}
482 /* Coprocessor access Control Register */ 491 mcr p15, 0, r4, c1, c0, 2 @ Coprocessor access Control Register
483 mcr p15, 0, r4, c1, c0, 2 492 mcr p15, 0, r5, c2, c0, 0 @ TTBR0
484 493 mcr p15, 0, r6, c2, c0, 1 @ TTBR1
485 /* TTBR0 */ 494 mcr p15, 0, r7, c2, c0, 2 @ TTBCR
486 MCR p15, 0, r5, c2, c0, 0 495
487 /* TTBR1 */ 496 ldmia r3!,{r4-r6}
488 MCR p15, 0, r6, c2, c0, 1 497 mcr p15, 0, r4, c3, c0, 0 @ Domain access Control Register
489 /* Translation table base control register */ 498 mcr p15, 0, r5, c10, c2, 0 @ PRRR
490 MCR p15, 0, r7, c2, c0, 2 499 mcr p15, 0, r6, c10, c2, 1 @ NMRR
491 /* Domain access Control Register */ 500
492 MCR p15, 0, r8, c3, c0, 0
493 /* Data fault status Register */
494 MCR p15, 0, r9, c5, c0, 0
495
496 ldmia r3!,{r4-r8}
497 /* Instruction fault status Register */
498 MCR p15, 0, r4, c5, c0, 1
499 /* Data Auxiliary Fault Status Register */
500 MCR p15, 0, r5, c5, c1, 0
501 /* Instruction Auxiliary Fault Status Register*/
502 MCR p15, 0, r6, c5, c1, 1
503 /* Data Fault Address Register */
504 MCR p15, 0, r7, c6, c0, 0
505 /* Instruction Fault Address Register*/
506 MCR p15, 0, r8, c6, c0, 2
507 ldmia r3!,{r4-r7}
508 501
509 /* User r/w thread and process ID */ 502 ldmia r3!,{r4-r7}
510 MCR p15, 0, r4, c13, c0, 2 503 mcr p15, 0, r4, c13, c0, 1 @ Context ID
511 /* User ro thread and process ID */ 504 mcr p15, 0, r5, c13, c0, 2 @ User r/w thread and process ID
512 MCR p15, 0, r5, c13, c0, 3 505 mrc p15, 0, r6, c12, c0, 0 @ Secure or NS vector base address
513 /* Privileged only thread and process ID */ 506 msr cpsr, r7 @ store cpsr
514 MCR p15, 0, r6, c13, c0, 4
515 /* Cache size selection */
516 MCR p15, 2, r7, c0, c0, 0
517 ldmia r3!,{r4-r8}
518 /* Data TLB lockdown registers */
519 MCR p15, 0, r4, c10, c0, 0
520 /* Instruction TLB lockdown registers */
521 MCR p15, 0, r5, c10, c0, 1
522 /* Secure or Nonsecure Vector Base Address */
523 MCR p15, 0, r6, c12, c0, 0
524 /* FCSE PID */
525 MCR p15, 0, r7, c13, c0, 0
526 /* Context PID */
527 MCR p15, 0, r8, c13, c0, 1
528
529 ldmia r3!,{r4-r5}
530 /* Primary memory remap register */
531 MCR p15, 0, r4, c10, c2, 0
532 /* Normal memory remap register */
533 MCR p15, 0, r5, c10, c2, 1
534
535 /* Restore cpsr */
536 ldmia r3!,{r4} @ load CPSR from SDRAM
537 msr cpsr, r4 @ store cpsr
538 507
539 /* Enabling MMU here */ 508 /* Enabling MMU here */
540 mrc p15, 0, r7, c2, c0, 2 @ Read TTBRControl 509 mrc p15, 0, r7, c2, c0, 2 @ Read TTBRControl
@@ -592,12 +561,17 @@ usettbr0:
592 ldr r2, cache_pred_disable_mask 561 ldr r2, cache_pred_disable_mask
593 and r4, r2 562 and r4, r2
594 mcr p15, 0, r4, c1, c0, 0 563 mcr p15, 0, r4, c1, c0, 0
564 dsb
565 isb
566 ldr r0, =restoremmu_on
567 bx r0
595 568
596/* 569/*
597 * ============================== 570 * ==============================
598 * == Exit point from OFF mode == 571 * == Exit point from OFF mode ==
599 * ============================== 572 * ==============================
600 */ 573 */
574restoremmu_on:
601 ldmfd sp!, {r0-r12, pc} @ restore regs and return 575 ldmfd sp!, {r0-r12, pc} @ restore regs and return
602 576
603 577
@@ -607,6 +581,7 @@ usettbr0:
607 581
608/* This function implements the erratum ID i443 WA, applies to 34xx >= ES3.0 */ 582/* This function implements the erratum ID i443 WA, applies to 34xx >= ES3.0 */
609 .text 583 .text
584 .align 3
610ENTRY(es3_sdrc_fix) 585ENTRY(es3_sdrc_fix)
611 ldr r4, sdrc_syscfg @ get config addr 586 ldr r4, sdrc_syscfg @ get config addr
612 ldr r5, [r4] @ get value 587 ldr r5, [r4] @ get value
@@ -634,6 +609,7 @@ ENTRY(es3_sdrc_fix)
634 str r5, [r4] @ kick off refreshes 609 str r5, [r4] @ kick off refreshes
635 bx lr 610 bx lr
636 611
612 .align
637sdrc_syscfg: 613sdrc_syscfg:
638 .word SDRC_SYSCONFIG_P 614 .word SDRC_SYSCONFIG_P
639sdrc_mr_0: 615sdrc_mr_0:
@@ -648,6 +624,7 @@ sdrc_emr2_1:
648 .word SDRC_EMR2_1_P 624 .word SDRC_EMR2_1_P
649sdrc_manual_1: 625sdrc_manual_1:
650 .word SDRC_MANUAL_1_P 626 .word SDRC_MANUAL_1_P
627ENDPROC(es3_sdrc_fix)
651ENTRY(es3_sdrc_fix_sz) 628ENTRY(es3_sdrc_fix_sz)
652 .word . - es3_sdrc_fix 629 .word . - es3_sdrc_fix
653 630
@@ -682,6 +659,12 @@ wait_sdrc_ready:
682 bic r5, r5, #0x40 659 bic r5, r5, #0x40
683 str r5, [r4] 660 str r5, [r4]
684 661
662/*
663 * PC-relative stores lead to undefined behaviour in Thumb-2: use a r7 as a
664 * base instead.
665 * Be careful not to clobber r7 when maintaing this code.
666 */
667
685is_dll_in_lock_mode: 668is_dll_in_lock_mode:
686 /* Is dll in lock mode? */ 669 /* Is dll in lock mode? */
687 ldr r4, sdrc_dlla_ctrl 670 ldr r4, sdrc_dlla_ctrl
@@ -689,10 +672,11 @@ is_dll_in_lock_mode:
689 tst r5, #0x4 672 tst r5, #0x4
690 bxne lr @ Return if locked 673 bxne lr @ Return if locked
691 /* wait till dll locks */ 674 /* wait till dll locks */
675 adr r7, kick_counter
692wait_dll_lock_timed: 676wait_dll_lock_timed:
693 ldr r4, wait_dll_lock_counter 677 ldr r4, wait_dll_lock_counter
694 add r4, r4, #1 678 add r4, r4, #1
695 str r4, wait_dll_lock_counter 679 str r4, [r7, #wait_dll_lock_counter - kick_counter]
696 ldr r4, sdrc_dlla_status 680 ldr r4, sdrc_dlla_status
697 /* Wait 20uS for lock */ 681 /* Wait 20uS for lock */
698 mov r6, #8 682 mov r6, #8
@@ -718,9 +702,10 @@ kick_dll:
718 dsb 702 dsb
719 ldr r4, kick_counter 703 ldr r4, kick_counter
720 add r4, r4, #1 704 add r4, r4, #1
721 str r4, kick_counter 705 str r4, [r7] @ kick_counter
722 b wait_dll_lock_timed 706 b wait_dll_lock_timed
723 707
708 .align
724cm_idlest1_core: 709cm_idlest1_core:
725 .word CM_IDLEST1_CORE_V 710 .word CM_IDLEST1_CORE_V
726cm_idlest_ckgen: 711cm_idlest_ckgen:
@@ -763,6 +748,7 @@ kick_counter:
763 .word 0 748 .word 0
764wait_dll_lock_counter: 749wait_dll_lock_counter:
765 .word 0 750 .word 0
751ENDPROC(omap34xx_cpu_suspend)
766 752
767ENTRY(omap34xx_cpu_suspend_sz) 753ENTRY(omap34xx_cpu_suspend_sz)
768 .word . - omap34xx_cpu_suspend 754 .word . - omap34xx_cpu_suspend
diff --git a/arch/arm/mach-omap2/smartreflex-class3.c b/arch/arm/mach-omap2/smartreflex-class3.c
index 60e70552b4c5..f438cf4d847b 100644
--- a/arch/arm/mach-omap2/smartreflex-class3.c
+++ b/arch/arm/mach-omap2/smartreflex-class3.c
@@ -11,7 +11,7 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 */ 12 */
13 13
14#include <plat/smartreflex.h> 14#include "smartreflex.h"
15 15
16static int sr_class3_enable(struct voltagedomain *voltdm) 16static int sr_class3_enable(struct voltagedomain *voltdm)
17{ 17{
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index 77ecebf3fae2..8f674c9442bf 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -26,9 +26,9 @@
26#include <linux/pm_runtime.h> 26#include <linux/pm_runtime.h>
27 27
28#include <plat/common.h> 28#include <plat/common.h>
29#include <plat/smartreflex.h>
30 29
31#include "pm.h" 30#include "pm.h"
31#include "smartreflex.h"
32 32
33#define SMARTREFLEX_NAME_LEN 16 33#define SMARTREFLEX_NAME_LEN 16
34#define NVALUE_NAME_LEN 40 34#define NVALUE_NAME_LEN 40
@@ -54,6 +54,7 @@ struct omap_sr {
54 struct list_head node; 54 struct list_head node;
55 struct omap_sr_nvalue_table *nvalue_table; 55 struct omap_sr_nvalue_table *nvalue_table;
56 struct voltagedomain *voltdm; 56 struct voltagedomain *voltdm;
57 struct dentry *dbg_dir;
57}; 58};
58 59
59/* sr_list contains all the instances of smartreflex module */ 60/* sr_list contains all the instances of smartreflex module */
@@ -260,9 +261,11 @@ static int sr_late_init(struct omap_sr *sr_info)
260 if (sr_class->class_type == SR_CLASS2 && 261 if (sr_class->class_type == SR_CLASS2 &&
261 sr_class->notify_flags && sr_info->irq) { 262 sr_class->notify_flags && sr_info->irq) {
262 263
263 name = kzalloc(SMARTREFLEX_NAME_LEN + 1, GFP_KERNEL); 264 name = kasprintf(GFP_KERNEL, "sr_%s", sr_info->voltdm->name);
264 strcpy(name, "sr_"); 265 if (name == NULL) {
265 strcat(name, sr_info->voltdm->name); 266 ret = -ENOMEM;
267 goto error;
268 }
266 ret = request_irq(sr_info->irq, sr_interrupt, 269 ret = request_irq(sr_info->irq, sr_interrupt,
267 0, name, (void *)sr_info); 270 0, name, (void *)sr_info);
268 if (ret) 271 if (ret)
@@ -282,6 +285,7 @@ error:
282 dev_err(&sr_info->pdev->dev, "%s: ERROR in registering" 285 dev_err(&sr_info->pdev->dev, "%s: ERROR in registering"
283 "interrupt handler. Smartreflex will" 286 "interrupt handler. Smartreflex will"
284 "not function as desired\n", __func__); 287 "not function as desired\n", __func__);
288 kfree(name);
285 kfree(sr_info); 289 kfree(sr_info);
286 return ret; 290 return ret;
287} 291}
@@ -780,8 +784,7 @@ static int omap_sr_autocomp_show(void *data, u64 *val)
780 struct omap_sr *sr_info = (struct omap_sr *) data; 784 struct omap_sr *sr_info = (struct omap_sr *) data;
781 785
782 if (!sr_info) { 786 if (!sr_info) {
783 pr_warning("%s: omap_sr struct for sr_%s not found\n", 787 pr_warning("%s: omap_sr struct not found\n", __func__);
784 __func__, sr_info->voltdm->name);
785 return -EINVAL; 788 return -EINVAL;
786 } 789 }
787 790
@@ -795,8 +798,7 @@ static int omap_sr_autocomp_store(void *data, u64 val)
795 struct omap_sr *sr_info = (struct omap_sr *) data; 798 struct omap_sr *sr_info = (struct omap_sr *) data;
796 799
797 if (!sr_info) { 800 if (!sr_info) {
798 pr_warning("%s: omap_sr struct for sr_%s not found\n", 801 pr_warning("%s: omap_sr struct not found\n", __func__);
799 __func__, sr_info->voltdm->name);
800 return -EINVAL; 802 return -EINVAL;
801 } 803 }
802 804
@@ -822,7 +824,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
822 struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL); 824 struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL);
823 struct omap_sr_data *pdata = pdev->dev.platform_data; 825 struct omap_sr_data *pdata = pdev->dev.platform_data;
824 struct resource *mem, *irq; 826 struct resource *mem, *irq;
825 struct dentry *vdd_dbg_dir, *dbg_dir, *nvalue_dir; 827 struct dentry *vdd_dbg_dir, *nvalue_dir;
826 struct omap_volt_data *volt_data; 828 struct omap_volt_data *volt_data;
827 int i, ret = 0; 829 int i, ret = 0;
828 830
@@ -834,7 +836,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)
834 836
835 if (!pdata) { 837 if (!pdata) {
836 dev_err(&pdev->dev, "%s: platform data missing\n", __func__); 838 dev_err(&pdev->dev, "%s: platform data missing\n", __func__);
837 return -EINVAL; 839 ret = -EINVAL;
840 goto err_free_devinfo;
838 } 841 }
839 842
840 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 843 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -880,7 +883,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
880 ret = sr_late_init(sr_info); 883 ret = sr_late_init(sr_info);
881 if (ret) { 884 if (ret) {
882 pr_warning("%s: Error in SR late init\n", __func__); 885 pr_warning("%s: Error in SR late init\n", __func__);
883 return ret; 886 goto err_release_region;
884 } 887 }
885 } 888 }
886 889
@@ -891,30 +894,34 @@ static int __init omap_sr_probe(struct platform_device *pdev)
891 * not try to create rest of the debugfs entries. 894 * not try to create rest of the debugfs entries.
892 */ 895 */
893 vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm); 896 vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm);
894 if (!vdd_dbg_dir) 897 if (!vdd_dbg_dir) {
895 return -EINVAL; 898 ret = -EINVAL;
899 goto err_release_region;
900 }
896 901
897 dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir); 902 sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
898 if (IS_ERR(dbg_dir)) { 903 if (IS_ERR(sr_info->dbg_dir)) {
899 dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n", 904 dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
900 __func__); 905 __func__);
901 return PTR_ERR(dbg_dir); 906 ret = PTR_ERR(sr_info->dbg_dir);
907 goto err_release_region;
902 } 908 }
903 909
904 (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUGO, dbg_dir, 910 (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR,
905 (void *)sr_info, &pm_sr_fops); 911 sr_info->dbg_dir, (void *)sr_info, &pm_sr_fops);
906 (void) debugfs_create_x32("errweight", S_IRUGO, dbg_dir, 912 (void) debugfs_create_x32("errweight", S_IRUGO, sr_info->dbg_dir,
907 &sr_info->err_weight); 913 &sr_info->err_weight);
908 (void) debugfs_create_x32("errmaxlimit", S_IRUGO, dbg_dir, 914 (void) debugfs_create_x32("errmaxlimit", S_IRUGO, sr_info->dbg_dir,
909 &sr_info->err_maxlimit); 915 &sr_info->err_maxlimit);
910 (void) debugfs_create_x32("errminlimit", S_IRUGO, dbg_dir, 916 (void) debugfs_create_x32("errminlimit", S_IRUGO, sr_info->dbg_dir,
911 &sr_info->err_minlimit); 917 &sr_info->err_minlimit);
912 918
913 nvalue_dir = debugfs_create_dir("nvalue", dbg_dir); 919 nvalue_dir = debugfs_create_dir("nvalue", sr_info->dbg_dir);
914 if (IS_ERR(nvalue_dir)) { 920 if (IS_ERR(nvalue_dir)) {
915 dev_err(&pdev->dev, "%s: Unable to create debugfs directory" 921 dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
916 "for n-values\n", __func__); 922 "for n-values\n", __func__);
917 return PTR_ERR(nvalue_dir); 923 ret = PTR_ERR(nvalue_dir);
924 goto err_release_region;
918 } 925 }
919 926
920 omap_voltage_get_volttable(sr_info->voltdm, &volt_data); 927 omap_voltage_get_volttable(sr_info->voltdm, &volt_data);
@@ -923,24 +930,16 @@ static int __init omap_sr_probe(struct platform_device *pdev)
923 " corresponding vdd vdd_%s. Cannot create debugfs" 930 " corresponding vdd vdd_%s. Cannot create debugfs"
924 "entries for n-values\n", 931 "entries for n-values\n",
925 __func__, sr_info->voltdm->name); 932 __func__, sr_info->voltdm->name);
926 return -ENODATA; 933 ret = -ENODATA;
934 goto err_release_region;
927 } 935 }
928 936
929 for (i = 0; i < sr_info->nvalue_count; i++) { 937 for (i = 0; i < sr_info->nvalue_count; i++) {
930 char *name; 938 char name[NVALUE_NAME_LEN + 1];
931 char volt_name[32];
932
933 name = kzalloc(NVALUE_NAME_LEN + 1, GFP_KERNEL);
934 if (!name) {
935 dev_err(&pdev->dev, "%s: Unable to allocate memory"
936 " for n-value directory name\n", __func__);
937 return -ENOMEM;
938 }
939 939
940 strcpy(name, "volt_"); 940 snprintf(name, sizeof(name), "volt_%d",
941 sprintf(volt_name, "%d", volt_data[i].volt_nominal); 941 volt_data[i].volt_nominal);
942 strcat(name, volt_name); 942 (void) debugfs_create_x32(name, S_IRUGO | S_IWUSR, nvalue_dir,
943 (void) debugfs_create_x32(name, S_IRUGO | S_IWUGO, nvalue_dir,
944 &(sr_info->nvalue_table[i].nvalue)); 943 &(sr_info->nvalue_table[i].nvalue));
945 } 944 }
946 945
@@ -966,7 +965,7 @@ static int __devexit omap_sr_remove(struct platform_device *pdev)
966 } 965 }
967 966
968 sr_info = _sr_lookup(pdata->voltdm); 967 sr_info = _sr_lookup(pdata->voltdm);
969 if (!sr_info) { 968 if (IS_ERR(sr_info)) {
970 dev_warn(&pdev->dev, "%s: omap_sr struct not found\n", 969 dev_warn(&pdev->dev, "%s: omap_sr struct not found\n",
971 __func__); 970 __func__);
972 return -EINVAL; 971 return -EINVAL;
@@ -974,6 +973,8 @@ static int __devexit omap_sr_remove(struct platform_device *pdev)
974 973
975 if (sr_info->autocomp_active) 974 if (sr_info->autocomp_active)
976 sr_stop_vddautocomp(sr_info); 975 sr_stop_vddautocomp(sr_info);
976 if (sr_info->dbg_dir)
977 debugfs_remove_recursive(sr_info->dbg_dir);
977 978
978 list_del(&sr_info->node); 979 list_del(&sr_info->node);
979 iounmap(sr_info->base); 980 iounmap(sr_info->base);
diff --git a/arch/arm/plat-omap/include/plat/smartreflex.h b/arch/arm/mach-omap2/smartreflex.h
index 6568c885f37a..5f35b9e25556 100644
--- a/arch/arm/plat-omap/include/plat/smartreflex.h
+++ b/arch/arm/mach-omap2/smartreflex.h
@@ -21,7 +21,8 @@
21#define __ASM_ARM_OMAP_SMARTREFLEX_H 21#define __ASM_ARM_OMAP_SMARTREFLEX_H
22 22
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <plat/voltage.h> 24
25#include "voltage.h"
25 26
26/* 27/*
27 * Different Smartreflex IPs version. The v1 is the 65nm version used in 28 * Different Smartreflex IPs version. The v1 is the 65nm version used in
diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
index b1e0af18a26a..10d3c5ee8018 100644
--- a/arch/arm/mach-omap2/sr_device.c
+++ b/arch/arm/mach-omap2/sr_device.c
@@ -23,9 +23,9 @@
23#include <linux/io.h> 23#include <linux/io.h>
24 24
25#include <plat/omap_device.h> 25#include <plat/omap_device.h>
26#include <plat/smartreflex.h>
27#include <plat/voltage.h>
28 26
27#include "smartreflex.h"
28#include "voltage.h"
29#include "control.h" 29#include "control.h"
30#include "pm.h" 30#include "pm.h"
31 31
diff --git a/arch/arm/mach-omap2/sram242x.S b/arch/arm/mach-omap2/sram242x.S
index 055310cc77de..ff9b9dbcb30e 100644
--- a/arch/arm/mach-omap2/sram242x.S
+++ b/arch/arm/mach-omap2/sram242x.S
@@ -39,6 +39,7 @@
39 39
40 .text 40 .text
41 41
42 .align 3
42ENTRY(omap242x_sram_ddr_init) 43ENTRY(omap242x_sram_ddr_init)
43 stmfd sp!, {r0 - r12, lr} @ save registers on stack 44 stmfd sp!, {r0 - r12, lr} @ save registers on stack
44 45
@@ -143,6 +144,7 @@ ENTRY(omap242x_sram_ddr_init_sz)
143 * r0 = [PRCM_FULL | PRCM_HALF] r1 = SDRC_DLLA_CTRL value r2 = [DDR | SDR] 144 * r0 = [PRCM_FULL | PRCM_HALF] r1 = SDRC_DLLA_CTRL value r2 = [DDR | SDR]
144 * PRCM_FULL = 2, PRCM_HALF = 1, DDR = 1, SDR = 0 145 * PRCM_FULL = 2, PRCM_HALF = 1, DDR = 1, SDR = 0
145 */ 146 */
147 .align 3
146ENTRY(omap242x_sram_reprogram_sdrc) 148ENTRY(omap242x_sram_reprogram_sdrc)
147 stmfd sp!, {r0 - r10, lr} @ save registers on stack 149 stmfd sp!, {r0 - r10, lr} @ save registers on stack
148 mov r3, #0x0 @ clear for mrc call 150 mov r3, #0x0 @ clear for mrc call
@@ -238,6 +240,7 @@ ENTRY(omap242x_sram_reprogram_sdrc_sz)
238/* 240/*
239 * Set dividers and pll. Also recalculate DLL value for DDR and unlock mode. 241 * Set dividers and pll. Also recalculate DLL value for DDR and unlock mode.
240 */ 242 */
243 .align 3
241ENTRY(omap242x_sram_set_prcm) 244ENTRY(omap242x_sram_set_prcm)
242 stmfd sp!, {r0-r12, lr} @ regs to stack 245 stmfd sp!, {r0-r12, lr} @ regs to stack
243 adr r4, pbegin @ addr of preload start 246 adr r4, pbegin @ addr of preload start
diff --git a/arch/arm/mach-omap2/sram243x.S b/arch/arm/mach-omap2/sram243x.S
index f9007580aea3..76730209fa0e 100644
--- a/arch/arm/mach-omap2/sram243x.S
+++ b/arch/arm/mach-omap2/sram243x.S
@@ -39,6 +39,7 @@
39 39
40 .text 40 .text
41 41
42 .align 3
42ENTRY(omap243x_sram_ddr_init) 43ENTRY(omap243x_sram_ddr_init)
43 stmfd sp!, {r0 - r12, lr} @ save registers on stack 44 stmfd sp!, {r0 - r12, lr} @ save registers on stack
44 45
@@ -143,6 +144,7 @@ ENTRY(omap243x_sram_ddr_init_sz)
143 * r0 = [PRCM_FULL | PRCM_HALF] r1 = SDRC_DLLA_CTRL value r2 = [DDR | SDR] 144 * r0 = [PRCM_FULL | PRCM_HALF] r1 = SDRC_DLLA_CTRL value r2 = [DDR | SDR]
144 * PRCM_FULL = 2, PRCM_HALF = 1, DDR = 1, SDR = 0 145 * PRCM_FULL = 2, PRCM_HALF = 1, DDR = 1, SDR = 0
145 */ 146 */
147 .align 3
146ENTRY(omap243x_sram_reprogram_sdrc) 148ENTRY(omap243x_sram_reprogram_sdrc)
147 stmfd sp!, {r0 - r10, lr} @ save registers on stack 149 stmfd sp!, {r0 - r10, lr} @ save registers on stack
148 mov r3, #0x0 @ clear for mrc call 150 mov r3, #0x0 @ clear for mrc call
@@ -238,6 +240,7 @@ ENTRY(omap243x_sram_reprogram_sdrc_sz)
238/* 240/*
239 * Set dividers and pll. Also recalculate DLL value for DDR and unlock mode. 241 * Set dividers and pll. Also recalculate DLL value for DDR and unlock mode.
240 */ 242 */
243 .align 3
241ENTRY(omap243x_sram_set_prcm) 244ENTRY(omap243x_sram_set_prcm)
242 stmfd sp!, {r0-r12, lr} @ regs to stack 245 stmfd sp!, {r0-r12, lr} @ regs to stack
243 adr r4, pbegin @ addr of preload start 246 adr r4, pbegin @ addr of preload start
diff --git a/arch/arm/mach-omap2/sram34xx.S b/arch/arm/mach-omap2/sram34xx.S
index 7f893a29d500..6f5849aaa7c0 100644
--- a/arch/arm/mach-omap2/sram34xx.S
+++ b/arch/arm/mach-omap2/sram34xx.S
@@ -34,6 +34,12 @@
34#include "sdrc.h" 34#include "sdrc.h"
35#include "cm2xxx_3xxx.h" 35#include "cm2xxx_3xxx.h"
36 36
37/*
38 * This file needs be built unconditionally as ARM to interoperate correctly
39 * with non-Thumb-2-capable firmware.
40 */
41 .arm
42
37 .text 43 .text
38 44
39/* r1 parameters */ 45/* r1 parameters */
@@ -111,29 +117,42 @@
111 * since it will cause the ARM MMU to attempt to walk the page tables. 117 * since it will cause the ARM MMU to attempt to walk the page tables.
112 * These crashes may be intermittent. 118 * These crashes may be intermittent.
113 */ 119 */
120 .align 3
114ENTRY(omap3_sram_configure_core_dpll) 121ENTRY(omap3_sram_configure_core_dpll)
115 stmfd sp!, {r1-r12, lr} @ store regs to stack 122 stmfd sp!, {r1-r12, lr} @ store regs to stack
116 123
117 @ pull the extra args off the stack 124 @ pull the extra args off the stack
118 @ and store them in SRAM 125 @ and store them in SRAM
126
127/*
128 * PC-relative stores are deprecated in ARMv7 and lead to undefined behaviour
129 * in Thumb-2: use a r7 as a base instead.
130 * Be careful not to clobber r7 when maintaing this file.
131 */
132 THUMB( adr r7, omap3_sram_configure_core_dpll )
133 .macro strtext Rt:req, label:req
134 ARM( str \Rt, \label )
135 THUMB( str \Rt, [r7, \label - omap3_sram_configure_core_dpll] )
136 .endm
137
119 ldr r4, [sp, #52] 138 ldr r4, [sp, #52]
120 str r4, omap_sdrc_rfr_ctrl_0_val 139 strtext r4, omap_sdrc_rfr_ctrl_0_val
121 ldr r4, [sp, #56] 140 ldr r4, [sp, #56]
122 str r4, omap_sdrc_actim_ctrl_a_0_val 141 strtext r4, omap_sdrc_actim_ctrl_a_0_val
123 ldr r4, [sp, #60] 142 ldr r4, [sp, #60]
124 str r4, omap_sdrc_actim_ctrl_b_0_val 143 strtext r4, omap_sdrc_actim_ctrl_b_0_val
125 ldr r4, [sp, #64] 144 ldr r4, [sp, #64]
126 str r4, omap_sdrc_mr_0_val 145 strtext r4, omap_sdrc_mr_0_val
127 ldr r4, [sp, #68] 146 ldr r4, [sp, #68]
128 str r4, omap_sdrc_rfr_ctrl_1_val 147 strtext r4, omap_sdrc_rfr_ctrl_1_val
129 cmp r4, #0 @ if SDRC_RFR_CTRL_1 is 0, 148 cmp r4, #0 @ if SDRC_RFR_CTRL_1 is 0,
130 beq skip_cs1_params @ do not use cs1 params 149 beq skip_cs1_params @ do not use cs1 params
131 ldr r4, [sp, #72] 150 ldr r4, [sp, #72]
132 str r4, omap_sdrc_actim_ctrl_a_1_val 151 strtext r4, omap_sdrc_actim_ctrl_a_1_val
133 ldr r4, [sp, #76] 152 ldr r4, [sp, #76]
134 str r4, omap_sdrc_actim_ctrl_b_1_val 153 strtext r4, omap_sdrc_actim_ctrl_b_1_val
135 ldr r4, [sp, #80] 154 ldr r4, [sp, #80]
136 str r4, omap_sdrc_mr_1_val 155 strtext r4, omap_sdrc_mr_1_val
137skip_cs1_params: 156skip_cs1_params:
138 mrc p15, 0, r8, c1, c0, 0 @ read ctrl register 157 mrc p15, 0, r8, c1, c0, 0 @ read ctrl register
139 bic r10, r8, #0x800 @ clear Z-bit, disable branch prediction 158 bic r10, r8, #0x800 @ clear Z-bit, disable branch prediction
@@ -271,6 +290,7 @@ skip_cs1_prog:
271 ldr r12, [r11] @ posted-write barrier for SDRC 290 ldr r12, [r11] @ posted-write barrier for SDRC
272 bx lr 291 bx lr
273 292
293 .align
274omap3_sdrc_power: 294omap3_sdrc_power:
275 .word OMAP34XX_SDRC_REGADDR(SDRC_POWER) 295 .word OMAP34XX_SDRC_REGADDR(SDRC_POWER)
276omap3_cm_clksel1_pll: 296omap3_cm_clksel1_pll:
@@ -319,6 +339,7 @@ omap3_sdrc_dlla_ctrl:
319 .word OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL) 339 .word OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL)
320core_m2_mask_val: 340core_m2_mask_val:
321 .word 0x07FFFFFF 341 .word 0x07FFFFFF
342ENDPROC(omap3_sram_configure_core_dpll)
322 343
323ENTRY(omap3_sram_configure_core_dpll_sz) 344ENTRY(omap3_sram_configure_core_dpll_sz)
324 .word . - omap3_sram_configure_core_dpll 345 .word . - omap3_sram_configure_core_dpll
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c
index 4e48e786bec7..3b9cf85f4bb9 100644
--- a/arch/arm/mach-omap2/timer-gp.c
+++ b/arch/arm/mach-omap2/timer-gp.c
@@ -39,9 +39,13 @@
39#include <asm/mach/time.h> 39#include <asm/mach/time.h>
40#include <plat/dmtimer.h> 40#include <plat/dmtimer.h>
41#include <asm/localtimer.h> 41#include <asm/localtimer.h>
42#include <asm/sched_clock.h>
43#include <plat/common.h>
44#include <plat/omap_hwmod.h>
42 45
43#include "timer-gp.h" 46#include "timer-gp.h"
44 47
48
45/* MAX_GPTIMER_ID: number of GPTIMERs on the chip */ 49/* MAX_GPTIMER_ID: number of GPTIMERs on the chip */
46#define MAX_GPTIMER_ID 12 50#define MAX_GPTIMER_ID 12
47 51
@@ -130,9 +134,13 @@ static void __init omap2_gp_clockevent_init(void)
130{ 134{
131 u32 tick_rate; 135 u32 tick_rate;
132 int src; 136 int src;
137 char clockevent_hwmod_name[8]; /* 8 = sizeof("timerXX0") */
133 138
134 inited = 1; 139 inited = 1;
135 140
141 sprintf(clockevent_hwmod_name, "timer%d", gptimer_id);
142 omap_hwmod_setup_one(clockevent_hwmod_name);
143
136 gptimer = omap_dm_timer_request_specific(gptimer_id); 144 gptimer = omap_dm_timer_request_specific(gptimer_id);
137 BUG_ON(gptimer == NULL); 145 BUG_ON(gptimer == NULL);
138 gptimer_wakeup = gptimer; 146 gptimer_wakeup = gptimer;
@@ -176,14 +184,19 @@ static void __init omap2_gp_clockevent_init(void)
176/* 184/*
177 * When 32k-timer is enabled, don't use GPTimer for clocksource 185 * When 32k-timer is enabled, don't use GPTimer for clocksource
178 * instead, just leave default clocksource which uses the 32k 186 * instead, just leave default clocksource which uses the 32k
179 * sync counter. See clocksource setup in see plat-omap/common.c. 187 * sync counter. See clocksource setup in plat-omap/counter_32k.c
180 */ 188 */
181 189
182static inline void __init omap2_gp_clocksource_init(void) {} 190static void __init omap2_gp_clocksource_init(void)
191{
192 omap_init_clocksource_32k();
193}
194
183#else 195#else
184/* 196/*
185 * clocksource 197 * clocksource
186 */ 198 */
199static DEFINE_CLOCK_DATA(cd);
187static struct omap_dm_timer *gpt_clocksource; 200static struct omap_dm_timer *gpt_clocksource;
188static cycle_t clocksource_read_cycles(struct clocksource *cs) 201static cycle_t clocksource_read_cycles(struct clocksource *cs)
189{ 202{
@@ -198,6 +211,15 @@ static struct clocksource clocksource_gpt = {
198 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 211 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
199}; 212};
200 213
214static void notrace dmtimer_update_sched_clock(void)
215{
216 u32 cyc;
217
218 cyc = omap_dm_timer_read_counter(gpt_clocksource);
219
220 update_sched_clock(&cd, cyc, (u32)~0);
221}
222
201/* Setup free-running counter for clocksource */ 223/* Setup free-running counter for clocksource */
202static void __init omap2_gp_clocksource_init(void) 224static void __init omap2_gp_clocksource_init(void)
203{ 225{
@@ -218,6 +240,8 @@ static void __init omap2_gp_clocksource_init(void)
218 240
219 omap_dm_timer_set_load_start(gpt, 1, 0); 241 omap_dm_timer_set_load_start(gpt, 1, 0);
220 242
243 init_sched_clock(&cd, dmtimer_update_sched_clock, 32, tick_rate);
244
221 if (clocksource_register_hz(&clocksource_gpt, tick_rate)) 245 if (clocksource_register_hz(&clocksource_gpt, tick_rate))
222 printk(err2, clocksource_gpt.name); 246 printk(err2, clocksource_gpt.name);
223} 247}
diff --git a/arch/arm/mach-omap2/timer-mpu.c b/arch/arm/mach-omap2/timer-mpu.c
index 954682e64399..31c0ac4cd66a 100644
--- a/arch/arm/mach-omap2/timer-mpu.c
+++ b/arch/arm/mach-omap2/timer-mpu.c
@@ -26,9 +26,14 @@
26/* 26/*
27 * Setup the local clock events for a CPU. 27 * Setup the local clock events for a CPU.
28 */ 28 */
29void __cpuinit local_timer_setup(struct clock_event_device *evt) 29int __cpuinit local_timer_setup(struct clock_event_device *evt)
30{ 30{
31 /* Local timers are not supprted on OMAP4430 ES1.0 */
32 if (omap_rev() == OMAP4430_REV_ES1_0)
33 return -ENXIO;
34
31 evt->irq = OMAP44XX_IRQ_LOCALTIMER; 35 evt->irq = OMAP44XX_IRQ_LOCALTIMER;
32 twd_timer_setup(evt); 36 twd_timer_setup(evt);
37 return 0;
33} 38}
34 39
diff --git a/arch/arm/mach-omap2/usb-ehci.c b/arch/arm/mach-omap2/usb-host.c
index 25eeadabc39b..89ae29847c59 100644
--- a/arch/arm/mach-omap2/usb-ehci.c
+++ b/arch/arm/mach-omap2/usb-host.c
@@ -1,14 +1,15 @@
1/* 1/*
2 * linux/arch/arm/mach-omap2/usb-ehci.c 2 * usb-host.c - OMAP USB Host
3 * 3 *
4 * This file will contain the board specific details for the 4 * This file will contain the board specific details for the
5 * Synopsys EHCI host controller on OMAP3430 5 * Synopsys EHCI/OHCI host controller on OMAP3430 and onwards
6 * 6 *
7 * Copyright (C) 2007 Texas Instruments 7 * Copyright (C) 2007-2011 Texas Instruments
8 * Author: Vikram Pandita <vikram.pandita@ti.com> 8 * Author: Vikram Pandita <vikram.pandita@ti.com>
9 * Author: Keshava Munegowda <keshava_mgowda@ti.com>
9 * 10 *
10 * Generalization by: 11 * Generalization by:
11 * Felipe Balbi <felipe.balbi@nokia.com> 12 * Felipe Balbi <balbi@ti.com>
12 * 13 *
13 * This program is free software; you can redistribute it and/or modify 14 * 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 * it under the terms of the GNU General Public License version 2 as
@@ -19,7 +20,7 @@
19#include <linux/errno.h> 20#include <linux/errno.h>
20#include <linux/delay.h> 21#include <linux/delay.h>
21#include <linux/platform_device.h> 22#include <linux/platform_device.h>
22#include <linux/clk.h> 23#include <linux/slab.h>
23#include <linux/dma-mapping.h> 24#include <linux/dma-mapping.h>
24 25
25#include <asm/io.h> 26#include <asm/io.h>
@@ -30,44 +31,56 @@
30 31
31#include "mux.h" 32#include "mux.h"
32 33
33#if defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE) 34#ifdef CONFIG_MFD_OMAP_USB_HOST
34 35
35static struct resource ehci_resources[] = { 36#define OMAP_USBHS_DEVICE "usbhs-omap"
37
38static struct resource usbhs_resources[] = {
39 {
40 .name = "uhh",
41 .flags = IORESOURCE_MEM,
42 },
36 { 43 {
44 .name = "tll",
37 .flags = IORESOURCE_MEM, 45 .flags = IORESOURCE_MEM,
38 }, 46 },
39 { 47 {
48 .name = "ehci",
40 .flags = IORESOURCE_MEM, 49 .flags = IORESOURCE_MEM,
41 }, 50 },
42 { 51 {
52 .name = "ehci-irq",
53 .flags = IORESOURCE_IRQ,
54 },
55 {
56 .name = "ohci",
43 .flags = IORESOURCE_MEM, 57 .flags = IORESOURCE_MEM,
44 }, 58 },
45 { /* general IRQ */ 59 {
46 .flags = IORESOURCE_IRQ, 60 .name = "ohci-irq",
61 .flags = IORESOURCE_IRQ,
47 } 62 }
48}; 63};
49 64
50static u64 ehci_dmamask = ~(u32)0; 65static struct platform_device usbhs_device = {
51static struct platform_device ehci_device = { 66 .name = OMAP_USBHS_DEVICE,
52 .name = "ehci-omap", 67 .id = 0,
53 .id = 0, 68 .num_resources = ARRAY_SIZE(usbhs_resources),
54 .dev = { 69 .resource = usbhs_resources,
55 .dma_mask = &ehci_dmamask,
56 .coherent_dma_mask = 0xffffffff,
57 .platform_data = NULL,
58 },
59 .num_resources = ARRAY_SIZE(ehci_resources),
60 .resource = ehci_resources,
61}; 70};
62 71
72static struct usbhs_omap_platform_data usbhs_data;
73static struct ehci_hcd_omap_platform_data ehci_data;
74static struct ohci_hcd_omap_platform_data ohci_data;
75
63/* MUX settings for EHCI pins */ 76/* MUX settings for EHCI pins */
64/* 77/*
65 * setup_ehci_io_mux - initialize IO pad mux for USBHOST 78 * setup_ehci_io_mux - initialize IO pad mux for USBHOST
66 */ 79 */
67static void setup_ehci_io_mux(const enum ehci_hcd_omap_mode *port_mode) 80static void setup_ehci_io_mux(const enum usbhs_omap_port_mode *port_mode)
68{ 81{
69 switch (port_mode[0]) { 82 switch (port_mode[0]) {
70 case EHCI_HCD_OMAP_MODE_PHY: 83 case OMAP_EHCI_PORT_MODE_PHY:
71 omap_mux_init_signal("hsusb1_stp", OMAP_PIN_OUTPUT); 84 omap_mux_init_signal("hsusb1_stp", OMAP_PIN_OUTPUT);
72 omap_mux_init_signal("hsusb1_clk", OMAP_PIN_OUTPUT); 85 omap_mux_init_signal("hsusb1_clk", OMAP_PIN_OUTPUT);
73 omap_mux_init_signal("hsusb1_dir", OMAP_PIN_INPUT_PULLDOWN); 86 omap_mux_init_signal("hsusb1_dir", OMAP_PIN_INPUT_PULLDOWN);
@@ -81,7 +94,7 @@ static void setup_ehci_io_mux(const enum ehci_hcd_omap_mode *port_mode)
81 omap_mux_init_signal("hsusb1_data6", OMAP_PIN_INPUT_PULLDOWN); 94 omap_mux_init_signal("hsusb1_data6", OMAP_PIN_INPUT_PULLDOWN);
82 omap_mux_init_signal("hsusb1_data7", OMAP_PIN_INPUT_PULLDOWN); 95 omap_mux_init_signal("hsusb1_data7", OMAP_PIN_INPUT_PULLDOWN);
83 break; 96 break;
84 case EHCI_HCD_OMAP_MODE_TLL: 97 case OMAP_EHCI_PORT_MODE_TLL:
85 omap_mux_init_signal("hsusb1_tll_stp", 98 omap_mux_init_signal("hsusb1_tll_stp",
86 OMAP_PIN_INPUT_PULLUP); 99 OMAP_PIN_INPUT_PULLUP);
87 omap_mux_init_signal("hsusb1_tll_clk", 100 omap_mux_init_signal("hsusb1_tll_clk",
@@ -107,14 +120,14 @@ static void setup_ehci_io_mux(const enum ehci_hcd_omap_mode *port_mode)
107 omap_mux_init_signal("hsusb1_tll_data7", 120 omap_mux_init_signal("hsusb1_tll_data7",
108 OMAP_PIN_INPUT_PULLDOWN); 121 OMAP_PIN_INPUT_PULLDOWN);
109 break; 122 break;
110 case EHCI_HCD_OMAP_MODE_UNKNOWN: 123 case OMAP_USBHS_PORT_MODE_UNUSED:
111 /* FALLTHROUGH */ 124 /* FALLTHROUGH */
112 default: 125 default:
113 break; 126 break;
114 } 127 }
115 128
116 switch (port_mode[1]) { 129 switch (port_mode[1]) {
117 case EHCI_HCD_OMAP_MODE_PHY: 130 case OMAP_EHCI_PORT_MODE_PHY:
118 omap_mux_init_signal("hsusb2_stp", OMAP_PIN_OUTPUT); 131 omap_mux_init_signal("hsusb2_stp", OMAP_PIN_OUTPUT);
119 omap_mux_init_signal("hsusb2_clk", OMAP_PIN_OUTPUT); 132 omap_mux_init_signal("hsusb2_clk", OMAP_PIN_OUTPUT);
120 omap_mux_init_signal("hsusb2_dir", OMAP_PIN_INPUT_PULLDOWN); 133 omap_mux_init_signal("hsusb2_dir", OMAP_PIN_INPUT_PULLDOWN);
@@ -136,7 +149,7 @@ static void setup_ehci_io_mux(const enum ehci_hcd_omap_mode *port_mode)
136 omap_mux_init_signal("hsusb2_data7", 149 omap_mux_init_signal("hsusb2_data7",
137 OMAP_PIN_INPUT_PULLDOWN); 150 OMAP_PIN_INPUT_PULLDOWN);
138 break; 151 break;
139 case EHCI_HCD_OMAP_MODE_TLL: 152 case OMAP_EHCI_PORT_MODE_TLL:
140 omap_mux_init_signal("hsusb2_tll_stp", 153 omap_mux_init_signal("hsusb2_tll_stp",
141 OMAP_PIN_INPUT_PULLUP); 154 OMAP_PIN_INPUT_PULLUP);
142 omap_mux_init_signal("hsusb2_tll_clk", 155 omap_mux_init_signal("hsusb2_tll_clk",
@@ -162,17 +175,17 @@ static void setup_ehci_io_mux(const enum ehci_hcd_omap_mode *port_mode)
162 omap_mux_init_signal("hsusb2_tll_data7", 175 omap_mux_init_signal("hsusb2_tll_data7",
163 OMAP_PIN_INPUT_PULLDOWN); 176 OMAP_PIN_INPUT_PULLDOWN);
164 break; 177 break;
165 case EHCI_HCD_OMAP_MODE_UNKNOWN: 178 case OMAP_USBHS_PORT_MODE_UNUSED:
166 /* FALLTHROUGH */ 179 /* FALLTHROUGH */
167 default: 180 default:
168 break; 181 break;
169 } 182 }
170 183
171 switch (port_mode[2]) { 184 switch (port_mode[2]) {
172 case EHCI_HCD_OMAP_MODE_PHY: 185 case OMAP_EHCI_PORT_MODE_PHY:
173 printk(KERN_WARNING "Port3 can't be used in PHY mode\n"); 186 printk(KERN_WARNING "Port3 can't be used in PHY mode\n");
174 break; 187 break;
175 case EHCI_HCD_OMAP_MODE_TLL: 188 case OMAP_EHCI_PORT_MODE_TLL:
176 omap_mux_init_signal("hsusb3_tll_stp", 189 omap_mux_init_signal("hsusb3_tll_stp",
177 OMAP_PIN_INPUT_PULLUP); 190 OMAP_PIN_INPUT_PULLUP);
178 omap_mux_init_signal("hsusb3_tll_clk", 191 omap_mux_init_signal("hsusb3_tll_clk",
@@ -198,7 +211,7 @@ static void setup_ehci_io_mux(const enum ehci_hcd_omap_mode *port_mode)
198 omap_mux_init_signal("hsusb3_tll_data7", 211 omap_mux_init_signal("hsusb3_tll_data7",
199 OMAP_PIN_INPUT_PULLDOWN); 212 OMAP_PIN_INPUT_PULLDOWN);
200 break; 213 break;
201 case EHCI_HCD_OMAP_MODE_UNKNOWN: 214 case OMAP_USBHS_PORT_MODE_UNUSED:
202 /* FALLTHROUGH */ 215 /* FALLTHROUGH */
203 default: 216 default:
204 break; 217 break;
@@ -207,10 +220,10 @@ static void setup_ehci_io_mux(const enum ehci_hcd_omap_mode *port_mode)
207 return; 220 return;
208} 221}
209 222
210static void setup_4430ehci_io_mux(const enum ehci_hcd_omap_mode *port_mode) 223static void setup_4430ehci_io_mux(const enum usbhs_omap_port_mode *port_mode)
211{ 224{
212 switch (port_mode[0]) { 225 switch (port_mode[0]) {
213 case EHCI_HCD_OMAP_MODE_PHY: 226 case OMAP_EHCI_PORT_MODE_PHY:
214 omap_mux_init_signal("usbb1_ulpiphy_stp", 227 omap_mux_init_signal("usbb1_ulpiphy_stp",
215 OMAP_PIN_OUTPUT); 228 OMAP_PIN_OUTPUT);
216 omap_mux_init_signal("usbb1_ulpiphy_clk", 229 omap_mux_init_signal("usbb1_ulpiphy_clk",
@@ -236,7 +249,7 @@ static void setup_4430ehci_io_mux(const enum ehci_hcd_omap_mode *port_mode)
236 omap_mux_init_signal("usbb1_ulpiphy_dat7", 249 omap_mux_init_signal("usbb1_ulpiphy_dat7",
237 OMAP_PIN_INPUT_PULLDOWN); 250 OMAP_PIN_INPUT_PULLDOWN);
238 break; 251 break;
239 case EHCI_HCD_OMAP_MODE_TLL: 252 case OMAP_EHCI_PORT_MODE_TLL:
240 omap_mux_init_signal("usbb1_ulpitll_stp", 253 omap_mux_init_signal("usbb1_ulpitll_stp",
241 OMAP_PIN_INPUT_PULLUP); 254 OMAP_PIN_INPUT_PULLUP);
242 omap_mux_init_signal("usbb1_ulpitll_clk", 255 omap_mux_init_signal("usbb1_ulpitll_clk",
@@ -262,12 +275,12 @@ static void setup_4430ehci_io_mux(const enum ehci_hcd_omap_mode *port_mode)
262 omap_mux_init_signal("usbb1_ulpitll_dat7", 275 omap_mux_init_signal("usbb1_ulpitll_dat7",
263 OMAP_PIN_INPUT_PULLDOWN); 276 OMAP_PIN_INPUT_PULLDOWN);
264 break; 277 break;
265 case EHCI_HCD_OMAP_MODE_UNKNOWN: 278 case OMAP_USBHS_PORT_MODE_UNUSED:
266 default: 279 default:
267 break; 280 break;
268 } 281 }
269 switch (port_mode[1]) { 282 switch (port_mode[1]) {
270 case EHCI_HCD_OMAP_MODE_PHY: 283 case OMAP_EHCI_PORT_MODE_PHY:
271 omap_mux_init_signal("usbb2_ulpiphy_stp", 284 omap_mux_init_signal("usbb2_ulpiphy_stp",
272 OMAP_PIN_OUTPUT); 285 OMAP_PIN_OUTPUT);
273 omap_mux_init_signal("usbb2_ulpiphy_clk", 286 omap_mux_init_signal("usbb2_ulpiphy_clk",
@@ -293,7 +306,7 @@ static void setup_4430ehci_io_mux(const enum ehci_hcd_omap_mode *port_mode)
293 omap_mux_init_signal("usbb2_ulpiphy_dat7", 306 omap_mux_init_signal("usbb2_ulpiphy_dat7",
294 OMAP_PIN_INPUT_PULLDOWN); 307 OMAP_PIN_INPUT_PULLDOWN);
295 break; 308 break;
296 case EHCI_HCD_OMAP_MODE_TLL: 309 case OMAP_EHCI_PORT_MODE_TLL:
297 omap_mux_init_signal("usbb2_ulpitll_stp", 310 omap_mux_init_signal("usbb2_ulpitll_stp",
298 OMAP_PIN_INPUT_PULLUP); 311 OMAP_PIN_INPUT_PULLUP);
299 omap_mux_init_signal("usbb2_ulpitll_clk", 312 omap_mux_init_signal("usbb2_ulpitll_clk",
@@ -319,90 +332,13 @@ static void setup_4430ehci_io_mux(const enum ehci_hcd_omap_mode *port_mode)
319 omap_mux_init_signal("usbb2_ulpitll_dat7", 332 omap_mux_init_signal("usbb2_ulpitll_dat7",
320 OMAP_PIN_INPUT_PULLDOWN); 333 OMAP_PIN_INPUT_PULLDOWN);
321 break; 334 break;
322 case EHCI_HCD_OMAP_MODE_UNKNOWN: 335 case OMAP_USBHS_PORT_MODE_UNUSED:
323 default: 336 default:
324 break; 337 break;
325 } 338 }
326} 339}
327 340
328void __init usb_ehci_init(const struct ehci_hcd_omap_platform_data *pdata) 341static void setup_ohci_io_mux(const enum usbhs_omap_port_mode *port_mode)
329{
330 platform_device_add_data(&ehci_device, pdata, sizeof(*pdata));
331
332 /* Setup Pin IO MUX for EHCI */
333 if (cpu_is_omap34xx()) {
334 ehci_resources[0].start = OMAP34XX_EHCI_BASE;
335 ehci_resources[0].end = OMAP34XX_EHCI_BASE + SZ_1K - 1;
336 ehci_resources[1].start = OMAP34XX_UHH_CONFIG_BASE;
337 ehci_resources[1].end = OMAP34XX_UHH_CONFIG_BASE + SZ_1K - 1;
338 ehci_resources[2].start = OMAP34XX_USBTLL_BASE;
339 ehci_resources[2].end = OMAP34XX_USBTLL_BASE + SZ_4K - 1;
340 ehci_resources[3].start = INT_34XX_EHCI_IRQ;
341 setup_ehci_io_mux(pdata->port_mode);
342 } else if (cpu_is_omap44xx()) {
343 ehci_resources[0].start = OMAP44XX_HSUSB_EHCI_BASE;
344 ehci_resources[0].end = OMAP44XX_HSUSB_EHCI_BASE + SZ_1K - 1;
345 ehci_resources[1].start = OMAP44XX_UHH_CONFIG_BASE;
346 ehci_resources[1].end = OMAP44XX_UHH_CONFIG_BASE + SZ_2K - 1;
347 ehci_resources[2].start = OMAP44XX_USBTLL_BASE;
348 ehci_resources[2].end = OMAP44XX_USBTLL_BASE + SZ_4K - 1;
349 ehci_resources[3].start = OMAP44XX_IRQ_EHCI;
350 setup_4430ehci_io_mux(pdata->port_mode);
351 }
352
353 if (platform_device_register(&ehci_device) < 0) {
354 printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n");
355 return;
356 }
357}
358
359#else
360
361void __init usb_ehci_init(const struct ehci_hcd_omap_platform_data *pdata)
362
363{
364}
365
366#endif /* CONFIG_USB_EHCI_HCD */
367
368#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
369
370static struct resource ohci_resources[] = {
371 {
372 .start = OMAP34XX_OHCI_BASE,
373 .end = OMAP34XX_OHCI_BASE + SZ_1K - 1,
374 .flags = IORESOURCE_MEM,
375 },
376 {
377 .start = OMAP34XX_UHH_CONFIG_BASE,
378 .end = OMAP34XX_UHH_CONFIG_BASE + SZ_1K - 1,
379 .flags = IORESOURCE_MEM,
380 },
381 {
382 .start = OMAP34XX_USBTLL_BASE,
383 .end = OMAP34XX_USBTLL_BASE + SZ_4K - 1,
384 .flags = IORESOURCE_MEM,
385 },
386 { /* general IRQ */
387 .start = INT_34XX_OHCI_IRQ,
388 .flags = IORESOURCE_IRQ,
389 }
390};
391
392static u64 ohci_dmamask = DMA_BIT_MASK(32);
393
394static struct platform_device ohci_device = {
395 .name = "ohci-omap3",
396 .id = 0,
397 .dev = {
398 .dma_mask = &ohci_dmamask,
399 .coherent_dma_mask = 0xffffffff,
400 },
401 .num_resources = ARRAY_SIZE(ohci_resources),
402 .resource = ohci_resources,
403};
404
405static void setup_ohci_io_mux(const enum ohci_omap3_port_mode *port_mode)
406{ 342{
407 switch (port_mode[0]) { 343 switch (port_mode[0]) {
408 case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0: 344 case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0:
@@ -430,7 +366,7 @@ static void setup_ohci_io_mux(const enum ohci_omap3_port_mode *port_mode)
430 omap_mux_init_signal("mm1_txdat", 366 omap_mux_init_signal("mm1_txdat",
431 OMAP_PIN_INPUT_PULLDOWN); 367 OMAP_PIN_INPUT_PULLDOWN);
432 break; 368 break;
433 case OMAP_OHCI_PORT_MODE_UNUSED: 369 case OMAP_USBHS_PORT_MODE_UNUSED:
434 /* FALLTHROUGH */ 370 /* FALLTHROUGH */
435 default: 371 default:
436 break; 372 break;
@@ -461,7 +397,7 @@ static void setup_ohci_io_mux(const enum ohci_omap3_port_mode *port_mode)
461 omap_mux_init_signal("mm2_txdat", 397 omap_mux_init_signal("mm2_txdat",
462 OMAP_PIN_INPUT_PULLDOWN); 398 OMAP_PIN_INPUT_PULLDOWN);
463 break; 399 break;
464 case OMAP_OHCI_PORT_MODE_UNUSED: 400 case OMAP_USBHS_PORT_MODE_UNUSED:
465 /* FALLTHROUGH */ 401 /* FALLTHROUGH */
466 default: 402 default:
467 break; 403 break;
@@ -492,31 +428,147 @@ static void setup_ohci_io_mux(const enum ohci_omap3_port_mode *port_mode)
492 omap_mux_init_signal("mm3_txdat", 428 omap_mux_init_signal("mm3_txdat",
493 OMAP_PIN_INPUT_PULLDOWN); 429 OMAP_PIN_INPUT_PULLDOWN);
494 break; 430 break;
495 case OMAP_OHCI_PORT_MODE_UNUSED: 431 case OMAP_USBHS_PORT_MODE_UNUSED:
496 /* FALLTHROUGH */ 432 /* FALLTHROUGH */
497 default: 433 default:
498 break; 434 break;
499 } 435 }
500} 436}
501 437
502void __init usb_ohci_init(const struct ohci_hcd_omap_platform_data *pdata) 438static void setup_4430ohci_io_mux(const enum usbhs_omap_port_mode *port_mode)
503{ 439{
504 platform_device_add_data(&ohci_device, pdata, sizeof(*pdata)); 440 switch (port_mode[0]) {
441 case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0:
442 case OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM:
443 case OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0:
444 case OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM:
445 omap_mux_init_signal("usbb1_mm_rxdp",
446 OMAP_PIN_INPUT_PULLDOWN);
447 omap_mux_init_signal("usbb1_mm_rxdm",
448 OMAP_PIN_INPUT_PULLDOWN);
505 449
506 /* Setup Pin IO MUX for OHCI */ 450 case OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM:
507 if (cpu_is_omap34xx()) 451 case OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM:
452 omap_mux_init_signal("usbb1_mm_rxrcv",
453 OMAP_PIN_INPUT_PULLDOWN);
454
455 case OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0:
456 case OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0:
457 omap_mux_init_signal("usbb1_mm_txen",
458 OMAP_PIN_INPUT_PULLDOWN);
459
460
461 case OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0:
462 case OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM:
463 omap_mux_init_signal("usbb1_mm_txdat",
464 OMAP_PIN_INPUT_PULLDOWN);
465 omap_mux_init_signal("usbb1_mm_txse0",
466 OMAP_PIN_INPUT_PULLDOWN);
467 break;
468
469 case OMAP_USBHS_PORT_MODE_UNUSED:
470 default:
471 break;
472 }
473
474 switch (port_mode[1]) {
475 case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0:
476 case OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM:
477 case OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0:
478 case OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM:
479 omap_mux_init_signal("usbb2_mm_rxdp",
480 OMAP_PIN_INPUT_PULLDOWN);
481 omap_mux_init_signal("usbb2_mm_rxdm",
482 OMAP_PIN_INPUT_PULLDOWN);
483
484 case OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM:
485 case OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM:
486 omap_mux_init_signal("usbb2_mm_rxrcv",
487 OMAP_PIN_INPUT_PULLDOWN);
488
489 case OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0:
490 case OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0:
491 omap_mux_init_signal("usbb2_mm_txen",
492 OMAP_PIN_INPUT_PULLDOWN);
493
494
495 case OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0:
496 case OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM:
497 omap_mux_init_signal("usbb2_mm_txdat",
498 OMAP_PIN_INPUT_PULLDOWN);
499 omap_mux_init_signal("usbb2_mm_txse0",
500 OMAP_PIN_INPUT_PULLDOWN);
501 break;
502
503 case OMAP_USBHS_PORT_MODE_UNUSED:
504 default:
505 break;
506 }
507}
508
509void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
510{
511 int i;
512
513 for (i = 0; i < OMAP3_HS_USB_PORTS; i++) {
514 usbhs_data.port_mode[i] = pdata->port_mode[i];
515 ohci_data.port_mode[i] = pdata->port_mode[i];
516 ehci_data.port_mode[i] = pdata->port_mode[i];
517 ehci_data.reset_gpio_port[i] = pdata->reset_gpio_port[i];
518 ehci_data.regulator[i] = pdata->regulator[i];
519 }
520 ehci_data.phy_reset = pdata->phy_reset;
521 ohci_data.es2_compatibility = pdata->es2_compatibility;
522 usbhs_data.ehci_data = &ehci_data;
523 usbhs_data.ohci_data = &ohci_data;
524
525 if (cpu_is_omap34xx()) {
526 usbhs_resources[0].start = OMAP34XX_UHH_CONFIG_BASE;
527 usbhs_resources[0].end = OMAP34XX_UHH_CONFIG_BASE + SZ_1K - 1;
528 usbhs_resources[1].start = OMAP34XX_USBTLL_BASE;
529 usbhs_resources[1].end = OMAP34XX_USBTLL_BASE + SZ_4K - 1;
530 usbhs_resources[2].start = OMAP34XX_EHCI_BASE;
531 usbhs_resources[2].end = OMAP34XX_EHCI_BASE + SZ_1K - 1;
532 usbhs_resources[3].start = INT_34XX_EHCI_IRQ;
533 usbhs_resources[4].start = OMAP34XX_OHCI_BASE;
534 usbhs_resources[4].end = OMAP34XX_OHCI_BASE + SZ_1K - 1;
535 usbhs_resources[5].start = INT_34XX_OHCI_IRQ;
536 setup_ehci_io_mux(pdata->port_mode);
508 setup_ohci_io_mux(pdata->port_mode); 537 setup_ohci_io_mux(pdata->port_mode);
538 } else if (cpu_is_omap44xx()) {
539 usbhs_resources[0].start = OMAP44XX_UHH_CONFIG_BASE;
540 usbhs_resources[0].end = OMAP44XX_UHH_CONFIG_BASE + SZ_1K - 1;
541 usbhs_resources[1].start = OMAP44XX_USBTLL_BASE;
542 usbhs_resources[1].end = OMAP44XX_USBTLL_BASE + SZ_4K - 1;
543 usbhs_resources[2].start = OMAP44XX_HSUSB_EHCI_BASE;
544 usbhs_resources[2].end = OMAP44XX_HSUSB_EHCI_BASE + SZ_1K - 1;
545 usbhs_resources[3].start = OMAP44XX_IRQ_EHCI;
546 usbhs_resources[4].start = OMAP44XX_HSUSB_OHCI_BASE;
547 usbhs_resources[4].end = OMAP44XX_HSUSB_OHCI_BASE + SZ_1K - 1;
548 usbhs_resources[5].start = OMAP44XX_IRQ_OHCI;
549 setup_4430ehci_io_mux(pdata->port_mode);
550 setup_4430ohci_io_mux(pdata->port_mode);
551 }
509 552
510 if (platform_device_register(&ohci_device) < 0) { 553 if (platform_device_add_data(&usbhs_device,
511 pr_err("Unable to register FS-USB (OHCI) device\n"); 554 &usbhs_data, sizeof(usbhs_data)) < 0) {
512 return; 555 printk(KERN_ERR "USBHS platform_device_add_data failed\n");
556 goto init_end;
513 } 557 }
558
559 if (platform_device_register(&usbhs_device) < 0)
560 printk(KERN_ERR "USBHS platform_device_register failed\n");
561
562init_end:
563 return;
514} 564}
515 565
516#else 566#else
517 567
518void __init usb_ohci_init(const struct ohci_hcd_omap_platform_data *pdata) 568void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
519{ 569{
520} 570}
521 571
522#endif /* CONFIG_USB_OHCI_HCD */ 572#endif
573
574
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 5298949d4b11..35559f77e2de 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -30,118 +30,11 @@
30#include <mach/irqs.h> 30#include <mach/irqs.h>
31#include <mach/am35xx.h> 31#include <mach/am35xx.h>
32#include <plat/usb.h> 32#include <plat/usb.h>
33#include "control.h" 33#include <plat/omap_device.h>
34#include "mux.h"
34 35
35#if defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined (CONFIG_USB_MUSB_AM35X) 36#if defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined (CONFIG_USB_MUSB_AM35X)
36 37
37static void am35x_musb_reset(void)
38{
39 u32 regval;
40
41 /* Reset the musb interface */
42 regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
43
44 regval |= AM35XX_USBOTGSS_SW_RST;
45 omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET);
46
47 regval &= ~AM35XX_USBOTGSS_SW_RST;
48 omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET);
49
50 regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
51}
52
53static void am35x_musb_phy_power(u8 on)
54{
55 unsigned long timeout = jiffies + msecs_to_jiffies(100);
56 u32 devconf2;
57
58 if (on) {
59 /*
60 * Start the on-chip PHY and its PLL.
61 */
62 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
63
64 devconf2 &= ~(CONF2_RESET | CONF2_PHYPWRDN | CONF2_OTGPWRDN);
65 devconf2 |= CONF2_PHY_PLLON;
66
67 omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
68
69 pr_info(KERN_INFO "Waiting for PHY clock good...\n");
70 while (!(omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2)
71 & CONF2_PHYCLKGD)) {
72 cpu_relax();
73
74 if (time_after(jiffies, timeout)) {
75 pr_err(KERN_ERR "musb PHY clock good timed out\n");
76 break;
77 }
78 }
79 } else {
80 /*
81 * Power down the on-chip PHY.
82 */
83 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
84
85 devconf2 &= ~CONF2_PHY_PLLON;
86 devconf2 |= CONF2_PHYPWRDN | CONF2_OTGPWRDN;
87 omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
88 }
89}
90
91static void am35x_musb_clear_irq(void)
92{
93 u32 regval;
94
95 regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
96 regval |= AM35XX_USBOTGSS_INT_CLR;
97 omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
98 regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
99}
100
101static void am35x_musb_set_mode(u8 musb_mode)
102{
103 u32 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
104
105 devconf2 &= ~CONF2_OTGMODE;
106 switch (musb_mode) {
107#ifdef CONFIG_USB_MUSB_HDRC_HCD
108 case MUSB_HOST: /* Force VBUS valid, ID = 0 */
109 devconf2 |= CONF2_FORCE_HOST;
110 break;
111#endif
112#ifdef CONFIG_USB_GADGET_MUSB_HDRC
113 case MUSB_PERIPHERAL: /* Force VBUS valid, ID = 1 */
114 devconf2 |= CONF2_FORCE_DEVICE;
115 break;
116#endif
117#ifdef CONFIG_USB_MUSB_OTG
118 case MUSB_OTG: /* Don't override the VBUS/ID comparators */
119 devconf2 |= CONF2_NO_OVERRIDE;
120 break;
121#endif
122 default:
123 pr_info(KERN_INFO "Unsupported mode %u\n", musb_mode);
124 }
125
126 omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
127}
128
129static struct resource musb_resources[] = {
130 [0] = { /* start and end set dynamically */
131 .flags = IORESOURCE_MEM,
132 },
133 [1] = { /* general IRQ */
134 .start = INT_243X_HS_USB_MC,
135 .flags = IORESOURCE_IRQ,
136 .name = "mc",
137 },
138 [2] = { /* DMA IRQ */
139 .start = INT_243X_HS_USB_DMA,
140 .flags = IORESOURCE_IRQ,
141 .name = "dma",
142 },
143};
144
145static struct musb_hdrc_config musb_config = { 38static struct musb_hdrc_config musb_config = {
146 .multipoint = 1, 39 .multipoint = 1,
147 .dyn_fifo = 1, 40 .dyn_fifo = 1,
@@ -169,38 +62,65 @@ static struct musb_hdrc_platform_data musb_plat = {
169 62
170static u64 musb_dmamask = DMA_BIT_MASK(32); 63static u64 musb_dmamask = DMA_BIT_MASK(32);
171 64
172static struct platform_device musb_device = { 65static struct omap_device_pm_latency omap_musb_latency[] = {
173 .name = "musb-omap2430", 66 {
174 .id = -1, 67 .deactivate_func = omap_device_idle_hwmods,
175 .dev = { 68 .activate_func = omap_device_enable_hwmods,
176 .dma_mask = &musb_dmamask, 69 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
177 .coherent_dma_mask = DMA_BIT_MASK(32),
178 .platform_data = &musb_plat,
179 }, 70 },
180 .num_resources = ARRAY_SIZE(musb_resources),
181 .resource = musb_resources,
182}; 71};
183 72
73static void usb_musb_mux_init(struct omap_musb_board_data *board_data)
74{
75 switch (board_data->interface_type) {
76 case MUSB_INTERFACE_UTMI:
77 omap_mux_init_signal("usba0_otg_dp", OMAP_PIN_INPUT);
78 omap_mux_init_signal("usba0_otg_dm", OMAP_PIN_INPUT);
79 break;
80 case MUSB_INTERFACE_ULPI:
81 omap_mux_init_signal("usba0_ulpiphy_clk",
82 OMAP_PIN_INPUT_PULLDOWN);
83 omap_mux_init_signal("usba0_ulpiphy_stp",
84 OMAP_PIN_INPUT_PULLDOWN);
85 omap_mux_init_signal("usba0_ulpiphy_dir",
86 OMAP_PIN_INPUT_PULLDOWN);
87 omap_mux_init_signal("usba0_ulpiphy_nxt",
88 OMAP_PIN_INPUT_PULLDOWN);
89 omap_mux_init_signal("usba0_ulpiphy_dat0",
90 OMAP_PIN_INPUT_PULLDOWN);
91 omap_mux_init_signal("usba0_ulpiphy_dat1",
92 OMAP_PIN_INPUT_PULLDOWN);
93 omap_mux_init_signal("usba0_ulpiphy_dat2",
94 OMAP_PIN_INPUT_PULLDOWN);
95 omap_mux_init_signal("usba0_ulpiphy_dat3",
96 OMAP_PIN_INPUT_PULLDOWN);
97 omap_mux_init_signal("usba0_ulpiphy_dat4",
98 OMAP_PIN_INPUT_PULLDOWN);
99 omap_mux_init_signal("usba0_ulpiphy_dat5",
100 OMAP_PIN_INPUT_PULLDOWN);
101 omap_mux_init_signal("usba0_ulpiphy_dat6",
102 OMAP_PIN_INPUT_PULLDOWN);
103 omap_mux_init_signal("usba0_ulpiphy_dat7",
104 OMAP_PIN_INPUT_PULLDOWN);
105 break;
106 default:
107 break;
108 }
109}
110
184void __init usb_musb_init(struct omap_musb_board_data *board_data) 111void __init usb_musb_init(struct omap_musb_board_data *board_data)
185{ 112{
186 if (cpu_is_omap243x()) { 113 struct omap_hwmod *oh;
187 musb_resources[0].start = OMAP243X_HS_BASE; 114 struct omap_device *od;
188 } else if (cpu_is_omap3517() || cpu_is_omap3505()) { 115 struct platform_device *pdev;
189 musb_device.name = "musb-am35x"; 116 struct device *dev;
190 musb_resources[0].start = AM35XX_IPSS_USBOTGSS_BASE; 117 int bus_id = -1;
191 musb_resources[1].start = INT_35XX_USBOTG_IRQ; 118 const char *oh_name, *name;
192 board_data->set_phy_power = am35x_musb_phy_power; 119
193 board_data->clear_irq = am35x_musb_clear_irq; 120 if (cpu_is_omap3517() || cpu_is_omap3505()) {
194 board_data->set_mode = am35x_musb_set_mode;
195 board_data->reset = am35x_musb_reset;
196 } else if (cpu_is_omap34xx()) {
197 musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE;
198 } else if (cpu_is_omap44xx()) { 121 } else if (cpu_is_omap44xx()) {
199 musb_resources[0].start = OMAP44XX_HSUSB_OTG_BASE; 122 usb_musb_mux_init(board_data);
200 musb_resources[1].start = OMAP44XX_IRQ_HS_USB_MC_N;
201 musb_resources[2].start = OMAP44XX_IRQ_HS_USB_DMA_N;
202 } 123 }
203 musb_resources[0].end = musb_resources[0].start + SZ_4K - 1;
204 124
205 /* 125 /*
206 * REVISIT: This line can be removed once all the platforms using 126 * REVISIT: This line can be removed once all the platforms using
@@ -212,8 +132,38 @@ void __init usb_musb_init(struct omap_musb_board_data *board_data)
212 musb_plat.mode = board_data->mode; 132 musb_plat.mode = board_data->mode;
213 musb_plat.extvbus = board_data->extvbus; 133 musb_plat.extvbus = board_data->extvbus;
214 134
215 if (platform_device_register(&musb_device) < 0) 135 if (cpu_is_omap44xx())
216 printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n"); 136 omap4430_phy_init(dev);
137
138 if (cpu_is_omap3517() || cpu_is_omap3505()) {
139 oh_name = "am35x_otg_hs";
140 name = "musb-am35x";
141 } else {
142 oh_name = "usb_otg_hs";
143 name = "musb-omap2430";
144 }
145
146 oh = omap_hwmod_lookup(oh_name);
147 if (!oh) {
148 pr_err("Could not look up %s\n", oh_name);
149 return;
150 }
151
152 od = omap_device_build(name, bus_id, oh, &musb_plat,
153 sizeof(musb_plat), omap_musb_latency,
154 ARRAY_SIZE(omap_musb_latency), false);
155 if (IS_ERR(od)) {
156 pr_err("Could not build omap_device for %s %s\n",
157 name, oh_name);
158 return;
159 }
160
161 pdev = &od->pdev;
162 dev = &pdev->dev;
163 get_device(dev);
164 dev->dma_mask = &musb_dmamask;
165 dev->coherent_dma_mask = musb_dmamask;
166 put_device(dev);
217} 167}
218 168
219#else 169#else
diff --git a/arch/arm/mach-omap2/vc.h b/arch/arm/mach-omap2/vc.h
new file mode 100644
index 000000000000..e7767771de49
--- /dev/null
+++ b/arch/arm/mach-omap2/vc.h
@@ -0,0 +1,83 @@
1/*
2 * OMAP3/4 Voltage Controller (VC) structure and macro definitions
3 *
4 * Copyright (C) 2007, 2010 Texas Instruments, Inc.
5 * Rajendra Nayak <rnayak@ti.com>
6 * Lesly A M <x0080970@ti.com>
7 * Thara Gopinath <thara@ti.com>
8 *
9 * Copyright (C) 2008, 2011 Nokia Corporation
10 * Kalle Jokiniemi
11 * Paul Walmsley
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License version
15 * 2 as published by the Free Software Foundation.
16 */
17#ifndef __ARCH_ARM_MACH_OMAP2_VC_H
18#define __ARCH_ARM_MACH_OMAP2_VC_H
19
20#include <linux/kernel.h>
21
22/**
23 * struct omap_vc_common_data - per-VC register/bitfield data
24 * @cmd_on_mask: ON bitmask in PRM_VC_CMD_VAL* register
25 * @valid: VALID bitmask in PRM_VC_BYPASS_VAL register
26 * @smps_sa_reg: Offset of PRM_VC_SMPS_SA reg from PRM start
27 * @smps_volra_reg: Offset of PRM_VC_SMPS_VOL_RA reg from PRM start
28 * @bypass_val_reg: Offset of PRM_VC_BYPASS_VAL reg from PRM start
29 * @data_shift: DATA field shift in PRM_VC_BYPASS_VAL register
30 * @slaveaddr_shift: SLAVEADDR field shift in PRM_VC_BYPASS_VAL register
31 * @regaddr_shift: REGADDR field shift in PRM_VC_BYPASS_VAL register
32 * @cmd_on_shift: ON field shift in PRM_VC_CMD_VAL_* register
33 * @cmd_onlp_shift: ONLP field shift in PRM_VC_CMD_VAL_* register
34 * @cmd_ret_shift: RET field shift in PRM_VC_CMD_VAL_* register
35 * @cmd_off_shift: OFF field shift in PRM_VC_CMD_VAL_* register
36 *
37 * XXX One of cmd_on_mask and cmd_on_shift are not needed
38 * XXX VALID should probably be a shift, not a mask
39 */
40struct omap_vc_common_data {
41 u32 cmd_on_mask;
42 u32 valid;
43 u8 smps_sa_reg;
44 u8 smps_volra_reg;
45 u8 bypass_val_reg;
46 u8 data_shift;
47 u8 slaveaddr_shift;
48 u8 regaddr_shift;
49 u8 cmd_on_shift;
50 u8 cmd_onlp_shift;
51 u8 cmd_ret_shift;
52 u8 cmd_off_shift;
53};
54
55/**
56 * struct omap_vc_instance_data - VC per-instance data
57 * @vc_common: pointer to VC common data for this platform
58 * @smps_sa_mask: SA* bitmask in the PRM_VC_SMPS_SA register
59 * @smps_volra_mask: VOLRA* bitmask in the PRM_VC_VOL_RA register
60 * @smps_sa_shift: SA* field shift in the PRM_VC_SMPS_SA register
61 * @smps_volra_shift: VOLRA* field shift in the PRM_VC_VOL_RA register
62 *
63 * XXX It is not necessary to have both a *_mask and a *_shift -
64 * remove one
65 */
66struct omap_vc_instance_data {
67 const struct omap_vc_common_data *vc_common;
68 u32 smps_sa_mask;
69 u32 smps_volra_mask;
70 u8 cmdval_reg;
71 u8 smps_sa_shift;
72 u8 smps_volra_shift;
73};
74
75extern struct omap_vc_instance_data omap3_vc1_data;
76extern struct omap_vc_instance_data omap3_vc2_data;
77
78extern struct omap_vc_instance_data omap4_vc_mpu_data;
79extern struct omap_vc_instance_data omap4_vc_iva_data;
80extern struct omap_vc_instance_data omap4_vc_core_data;
81
82#endif
83
diff --git a/arch/arm/mach-omap2/vc3xxx_data.c b/arch/arm/mach-omap2/vc3xxx_data.c
new file mode 100644
index 000000000000..f37dc4bc379a
--- /dev/null
+++ b/arch/arm/mach-omap2/vc3xxx_data.c
@@ -0,0 +1,63 @@
1/*
2 * OMAP3 Voltage Controller (VC) data
3 *
4 * Copyright (C) 2007, 2010 Texas Instruments, Inc.
5 * Rajendra Nayak <rnayak@ti.com>
6 * Lesly A M <x0080970@ti.com>
7 * Thara Gopinath <thara@ti.com>
8 *
9 * Copyright (C) 2008, 2011 Nokia Corporation
10 * Kalle Jokiniemi
11 * Paul Walmsley
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#include <linux/io.h>
18#include <linux/err.h>
19#include <linux/init.h>
20
21#include <plat/common.h>
22
23#include "prm-regbits-34xx.h"
24#include "voltage.h"
25
26#include "vc.h"
27
28/*
29 * VC data common to 34xx/36xx chips
30 * XXX This stuff presumably belongs in the vc3xxx.c or vc.c file.
31 */
32static struct omap_vc_common_data omap3_vc_common = {
33 .smps_sa_reg = OMAP3_PRM_VC_SMPS_SA_OFFSET,
34 .smps_volra_reg = OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET,
35 .bypass_val_reg = OMAP3_PRM_VC_BYPASS_VAL_OFFSET,
36 .data_shift = OMAP3430_DATA_SHIFT,
37 .slaveaddr_shift = OMAP3430_SLAVEADDR_SHIFT,
38 .regaddr_shift = OMAP3430_REGADDR_SHIFT,
39 .valid = OMAP3430_VALID_MASK,
40 .cmd_on_shift = OMAP3430_VC_CMD_ON_SHIFT,
41 .cmd_on_mask = OMAP3430_VC_CMD_ON_MASK,
42 .cmd_onlp_shift = OMAP3430_VC_CMD_ONLP_SHIFT,
43 .cmd_ret_shift = OMAP3430_VC_CMD_RET_SHIFT,
44 .cmd_off_shift = OMAP3430_VC_CMD_OFF_SHIFT,
45};
46
47struct omap_vc_instance_data omap3_vc1_data = {
48 .vc_common = &omap3_vc_common,
49 .cmdval_reg = OMAP3_PRM_VC_CMD_VAL_0_OFFSET,
50 .smps_sa_shift = OMAP3430_PRM_VC_SMPS_SA_SA0_SHIFT,
51 .smps_sa_mask = OMAP3430_PRM_VC_SMPS_SA_SA0_MASK,
52 .smps_volra_shift = OMAP3430_VOLRA0_SHIFT,
53 .smps_volra_mask = OMAP3430_VOLRA0_MASK,
54};
55
56struct omap_vc_instance_data omap3_vc2_data = {
57 .vc_common = &omap3_vc_common,
58 .cmdval_reg = OMAP3_PRM_VC_CMD_VAL_1_OFFSET,
59 .smps_sa_shift = OMAP3430_PRM_VC_SMPS_SA_SA1_SHIFT,
60 .smps_sa_mask = OMAP3430_PRM_VC_SMPS_SA_SA1_MASK,
61 .smps_volra_shift = OMAP3430_VOLRA1_SHIFT,
62 .smps_volra_mask = OMAP3430_VOLRA1_MASK,
63};
diff --git a/arch/arm/mach-omap2/vc44xx_data.c b/arch/arm/mach-omap2/vc44xx_data.c
new file mode 100644
index 000000000000..a98da8ddec52
--- /dev/null
+++ b/arch/arm/mach-omap2/vc44xx_data.c
@@ -0,0 +1,75 @@
1/*
2 * OMAP4 Voltage Controller (VC) data
3 *
4 * Copyright (C) 2007, 2010 Texas Instruments, Inc.
5 * Rajendra Nayak <rnayak@ti.com>
6 * Lesly A M <x0080970@ti.com>
7 * Thara Gopinath <thara@ti.com>
8 *
9 * Copyright (C) 2008, 2011 Nokia Corporation
10 * Kalle Jokiniemi
11 * Paul Walmsley
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#include <linux/io.h>
18#include <linux/err.h>
19#include <linux/init.h>
20
21#include <plat/common.h>
22
23#include "prm44xx.h"
24#include "prm-regbits-44xx.h"
25#include "voltage.h"
26
27#include "vc.h"
28
29/*
30 * VC data common to 44xx chips
31 * XXX This stuff presumably belongs in the vc3xxx.c or vc.c file.
32 */
33static const struct omap_vc_common_data omap4_vc_common = {
34 .smps_sa_reg = OMAP4_PRM_VC_SMPS_SA_OFFSET,
35 .smps_volra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_VOL_OFFSET,
36 .bypass_val_reg = OMAP4_PRM_VC_VAL_BYPASS_OFFSET,
37 .data_shift = OMAP4430_DATA_SHIFT,
38 .slaveaddr_shift = OMAP4430_SLAVEADDR_SHIFT,
39 .regaddr_shift = OMAP4430_REGADDR_SHIFT,
40 .valid = OMAP4430_VALID_MASK,
41 .cmd_on_shift = OMAP4430_ON_SHIFT,
42 .cmd_on_mask = OMAP4430_ON_MASK,
43 .cmd_onlp_shift = OMAP4430_ONLP_SHIFT,
44 .cmd_ret_shift = OMAP4430_RET_SHIFT,
45 .cmd_off_shift = OMAP4430_OFF_SHIFT,
46};
47
48/* VC instance data for each controllable voltage line */
49struct omap_vc_instance_data omap4_vc_mpu_data = {
50 .vc_common = &omap4_vc_common,
51 .cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_MPU_L_OFFSET,
52 .smps_sa_shift = OMAP4430_SA_VDD_MPU_L_PRM_VC_SMPS_SA_SHIFT,
53 .smps_sa_mask = OMAP4430_SA_VDD_MPU_L_PRM_VC_SMPS_SA_MASK,
54 .smps_volra_shift = OMAP4430_VOLRA_VDD_MPU_L_SHIFT,
55 .smps_volra_mask = OMAP4430_VOLRA_VDD_MPU_L_MASK,
56};
57
58struct omap_vc_instance_data omap4_vc_iva_data = {
59 .vc_common = &omap4_vc_common,
60 .cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_IVA_L_OFFSET,
61 .smps_sa_shift = OMAP4430_SA_VDD_IVA_L_PRM_VC_SMPS_SA_SHIFT,
62 .smps_sa_mask = OMAP4430_SA_VDD_IVA_L_PRM_VC_SMPS_SA_MASK,
63 .smps_volra_shift = OMAP4430_VOLRA_VDD_IVA_L_SHIFT,
64 .smps_volra_mask = OMAP4430_VOLRA_VDD_IVA_L_MASK,
65};
66
67struct omap_vc_instance_data omap4_vc_core_data = {
68 .vc_common = &omap4_vc_common,
69 .cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_CORE_L_OFFSET,
70 .smps_sa_shift = OMAP4430_SA_VDD_CORE_L_0_6_SHIFT,
71 .smps_sa_mask = OMAP4430_SA_VDD_CORE_L_0_6_MASK,
72 .smps_volra_shift = OMAP4430_VOLRA_VDD_CORE_L_SHIFT,
73 .smps_volra_mask = OMAP4430_VOLRA_VDD_CORE_L_MASK,
74};
75
diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c
index ed6079c94c57..c6facf7becf8 100644
--- a/arch/arm/mach-omap2/voltage.c
+++ b/arch/arm/mach-omap2/voltage.c
@@ -7,8 +7,9 @@
7 * Rajendra Nayak <rnayak@ti.com> 7 * Rajendra Nayak <rnayak@ti.com>
8 * Lesly A M <x0080970@ti.com> 8 * Lesly A M <x0080970@ti.com>
9 * 9 *
10 * Copyright (C) 2008 Nokia Corporation 10 * Copyright (C) 2008, 2011 Nokia Corporation
11 * Kalle Jokiniemi 11 * Kalle Jokiniemi
12 * Paul Walmsley
12 * 13 *
13 * Copyright (C) 2010 Texas Instruments, Inc. 14 * Copyright (C) 2010 Texas Instruments, Inc.
14 * Thara Gopinath <thara@ti.com> 15 * Thara Gopinath <thara@ti.com>
@@ -26,7 +27,6 @@
26#include <linux/slab.h> 27#include <linux/slab.h>
27 28
28#include <plat/common.h> 29#include <plat/common.h>
29#include <plat/voltage.h>
30 30
31#include "prm-regbits-34xx.h" 31#include "prm-regbits-34xx.h"
32#include "prm-regbits-44xx.h" 32#include "prm-regbits-44xx.h"
@@ -35,284 +35,30 @@
35#include "prminst44xx.h" 35#include "prminst44xx.h"
36#include "control.h" 36#include "control.h"
37 37
38#define VP_IDLE_TIMEOUT 200 38#include "voltage.h"
39#define VP_TRANXDONE_TIMEOUT 300 39
40#include "vc.h"
41#include "vp.h"
42
40#define VOLTAGE_DIR_SIZE 16 43#define VOLTAGE_DIR_SIZE 16
41 44
42/* Voltage processor register offsets */
43struct vp_reg_offs {
44 u8 vpconfig;
45 u8 vstepmin;
46 u8 vstepmax;
47 u8 vlimitto;
48 u8 vstatus;
49 u8 voltage;
50};
51
52/* Voltage Processor bit field values, shifts and masks */
53struct vp_reg_val {
54 /* PRM module */
55 u16 prm_mod;
56 /* VPx_VPCONFIG */
57 u32 vpconfig_erroroffset;
58 u16 vpconfig_errorgain;
59 u32 vpconfig_errorgain_mask;
60 u8 vpconfig_errorgain_shift;
61 u32 vpconfig_initvoltage_mask;
62 u8 vpconfig_initvoltage_shift;
63 u32 vpconfig_timeouten;
64 u32 vpconfig_initvdd;
65 u32 vpconfig_forceupdate;
66 u32 vpconfig_vpenable;
67 /* VPx_VSTEPMIN */
68 u8 vstepmin_stepmin;
69 u16 vstepmin_smpswaittimemin;
70 u8 vstepmin_stepmin_shift;
71 u8 vstepmin_smpswaittimemin_shift;
72 /* VPx_VSTEPMAX */
73 u8 vstepmax_stepmax;
74 u16 vstepmax_smpswaittimemax;
75 u8 vstepmax_stepmax_shift;
76 u8 vstepmax_smpswaittimemax_shift;
77 /* VPx_VLIMITTO */
78 u8 vlimitto_vddmin;
79 u8 vlimitto_vddmax;
80 u16 vlimitto_timeout;
81 u8 vlimitto_vddmin_shift;
82 u8 vlimitto_vddmax_shift;
83 u8 vlimitto_timeout_shift;
84 /* PRM_IRQSTATUS*/
85 u32 tranxdone_status;
86};
87
88/* Voltage controller registers and offsets */
89struct vc_reg_info {
90 /* PRM module */
91 u16 prm_mod;
92 /* VC register offsets */
93 u8 smps_sa_reg;
94 u8 smps_volra_reg;
95 u8 bypass_val_reg;
96 u8 cmdval_reg;
97 u8 voltsetup_reg;
98 /*VC_SMPS_SA*/
99 u8 smps_sa_shift;
100 u32 smps_sa_mask;
101 /* VC_SMPS_VOL_RA */
102 u8 smps_volra_shift;
103 u32 smps_volra_mask;
104 /* VC_BYPASS_VAL */
105 u8 data_shift;
106 u8 slaveaddr_shift;
107 u8 regaddr_shift;
108 u32 valid;
109 /* VC_CMD_VAL */
110 u8 cmd_on_shift;
111 u8 cmd_onlp_shift;
112 u8 cmd_ret_shift;
113 u8 cmd_off_shift;
114 u32 cmd_on_mask;
115 /* PRM_VOLTSETUP */
116 u8 voltsetup_shift;
117 u32 voltsetup_mask;
118};
119 45
120/** 46static struct omap_vdd_info **vdd_info;
121 * omap_vdd_info - Per Voltage Domain info 47
122 *
123 * @volt_data : voltage table having the distinct voltages supported
124 * by the domain and other associated per voltage data.
125 * @pmic_info : pmic specific parameters which should be populted by
126 * the pmic drivers.
127 * @vp_offs : structure containing the offsets for various
128 * vp registers
129 * @vp_reg : the register values, shifts, masks for various
130 * vp registers
131 * @vc_reg : structure containing various various vc registers,
132 * shifts, masks etc.
133 * @voltdm : pointer to the voltage domain structure
134 * @debug_dir : debug directory for this voltage domain.
135 * @curr_volt : current voltage for this vdd.
136 * @ocp_mod : The prm module for accessing the prm irqstatus reg.
137 * @prm_irqst_reg : prm irqstatus register.
138 * @vp_enabled : flag to keep track of whether vp is enabled or not
139 * @volt_scale : API to scale the voltage of the vdd.
140 */
141struct omap_vdd_info {
142 struct omap_volt_data *volt_data;
143 struct omap_volt_pmic_info *pmic_info;
144 struct vp_reg_offs vp_offs;
145 struct vp_reg_val vp_reg;
146 struct vc_reg_info vc_reg;
147 struct voltagedomain voltdm;
148 struct dentry *debug_dir;
149 u32 curr_volt;
150 u16 ocp_mod;
151 u8 prm_irqst_reg;
152 bool vp_enabled;
153 u32 (*read_reg) (u16 mod, u8 offset);
154 void (*write_reg) (u32 val, u16 mod, u8 offset);
155 int (*volt_scale) (struct omap_vdd_info *vdd,
156 unsigned long target_volt);
157};
158
159static struct omap_vdd_info *vdd_info;
160/* 48/*
161 * Number of scalable voltage domains. 49 * Number of scalable voltage domains.
162 */ 50 */
163static int nr_scalable_vdd; 51static int nr_scalable_vdd;
164 52
165/* OMAP3 VDD sturctures */ 53/* XXX document */
166static struct omap_vdd_info omap3_vdd_info[] = { 54static s16 prm_mod_offs;
167 { 55static s16 prm_irqst_ocp_mod_offs;
168 .vp_offs = {
169 .vpconfig = OMAP3_PRM_VP1_CONFIG_OFFSET,
170 .vstepmin = OMAP3_PRM_VP1_VSTEPMIN_OFFSET,
171 .vstepmax = OMAP3_PRM_VP1_VSTEPMAX_OFFSET,
172 .vlimitto = OMAP3_PRM_VP1_VLIMITTO_OFFSET,
173 .vstatus = OMAP3_PRM_VP1_STATUS_OFFSET,
174 .voltage = OMAP3_PRM_VP1_VOLTAGE_OFFSET,
175 },
176 .voltdm = {
177 .name = "mpu",
178 },
179 },
180 {
181 .vp_offs = {
182 .vpconfig = OMAP3_PRM_VP2_CONFIG_OFFSET,
183 .vstepmin = OMAP3_PRM_VP2_VSTEPMIN_OFFSET,
184 .vstepmax = OMAP3_PRM_VP2_VSTEPMAX_OFFSET,
185 .vlimitto = OMAP3_PRM_VP2_VLIMITTO_OFFSET,
186 .vstatus = OMAP3_PRM_VP2_STATUS_OFFSET,
187 .voltage = OMAP3_PRM_VP2_VOLTAGE_OFFSET,
188 },
189 .voltdm = {
190 .name = "core",
191 },
192 },
193};
194
195#define OMAP3_NR_SCALABLE_VDD ARRAY_SIZE(omap3_vdd_info)
196
197/* OMAP4 VDD sturctures */
198static struct omap_vdd_info omap4_vdd_info[] = {
199 {
200 .vp_offs = {
201 .vpconfig = OMAP4_PRM_VP_MPU_CONFIG_OFFSET,
202 .vstepmin = OMAP4_PRM_VP_MPU_VSTEPMIN_OFFSET,
203 .vstepmax = OMAP4_PRM_VP_MPU_VSTEPMAX_OFFSET,
204 .vlimitto = OMAP4_PRM_VP_MPU_VLIMITTO_OFFSET,
205 .vstatus = OMAP4_PRM_VP_MPU_STATUS_OFFSET,
206 .voltage = OMAP4_PRM_VP_MPU_VOLTAGE_OFFSET,
207 },
208 .voltdm = {
209 .name = "mpu",
210 },
211 },
212 {
213 .vp_offs = {
214 .vpconfig = OMAP4_PRM_VP_IVA_CONFIG_OFFSET,
215 .vstepmin = OMAP4_PRM_VP_IVA_VSTEPMIN_OFFSET,
216 .vstepmax = OMAP4_PRM_VP_IVA_VSTEPMAX_OFFSET,
217 .vlimitto = OMAP4_PRM_VP_IVA_VLIMITTO_OFFSET,
218 .vstatus = OMAP4_PRM_VP_IVA_STATUS_OFFSET,
219 .voltage = OMAP4_PRM_VP_IVA_VOLTAGE_OFFSET,
220 },
221 .voltdm = {
222 .name = "iva",
223 },
224 },
225 {
226 .vp_offs = {
227 .vpconfig = OMAP4_PRM_VP_CORE_CONFIG_OFFSET,
228 .vstepmin = OMAP4_PRM_VP_CORE_VSTEPMIN_OFFSET,
229 .vstepmax = OMAP4_PRM_VP_CORE_VSTEPMAX_OFFSET,
230 .vlimitto = OMAP4_PRM_VP_CORE_VLIMITTO_OFFSET,
231 .vstatus = OMAP4_PRM_VP_CORE_STATUS_OFFSET,
232 .voltage = OMAP4_PRM_VP_CORE_VOLTAGE_OFFSET,
233 },
234 .voltdm = {
235 .name = "core",
236 },
237 },
238};
239
240#define OMAP4_NR_SCALABLE_VDD ARRAY_SIZE(omap4_vdd_info)
241
242/*
243 * Structures containing OMAP3430/OMAP3630 voltage supported and various
244 * voltage dependent data for each VDD.
245 */
246#define VOLT_DATA_DEFINE(_v_nom, _efuse_offs, _errminlimit, _errgain) \
247{ \
248 .volt_nominal = _v_nom, \
249 .sr_efuse_offs = _efuse_offs, \
250 .sr_errminlimit = _errminlimit, \
251 .vp_errgain = _errgain \
252}
253
254/* VDD1 */
255static struct omap_volt_data omap34xx_vddmpu_volt_data[] = {
256 VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP1_UV, OMAP343X_CONTROL_FUSE_OPP1_VDD1, 0xf4, 0x0c),
257 VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP2_UV, OMAP343X_CONTROL_FUSE_OPP2_VDD1, 0xf4, 0x0c),
258 VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP3_UV, OMAP343X_CONTROL_FUSE_OPP3_VDD1, 0xf9, 0x18),
259 VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP4_UV, OMAP343X_CONTROL_FUSE_OPP4_VDD1, 0xf9, 0x18),
260 VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP5_UV, OMAP343X_CONTROL_FUSE_OPP5_VDD1, 0xf9, 0x18),
261 VOLT_DATA_DEFINE(0, 0, 0, 0),
262};
263
264static struct omap_volt_data omap36xx_vddmpu_volt_data[] = {
265 VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP50_UV, OMAP3630_CONTROL_FUSE_OPP50_VDD1, 0xf4, 0x0c),
266 VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP100_UV, OMAP3630_CONTROL_FUSE_OPP100_VDD1, 0xf9, 0x16),
267 VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP120_UV, OMAP3630_CONTROL_FUSE_OPP120_VDD1, 0xfa, 0x23),
268 VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP1G_UV, OMAP3630_CONTROL_FUSE_OPP1G_VDD1, 0xfa, 0x27),
269 VOLT_DATA_DEFINE(0, 0, 0, 0),
270};
271
272/* VDD2 */
273static struct omap_volt_data omap34xx_vddcore_volt_data[] = {
274 VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP1_UV, OMAP343X_CONTROL_FUSE_OPP1_VDD2, 0xf4, 0x0c),
275 VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP2_UV, OMAP343X_CONTROL_FUSE_OPP2_VDD2, 0xf4, 0x0c),
276 VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP3_UV, OMAP343X_CONTROL_FUSE_OPP3_VDD2, 0xf9, 0x18),
277 VOLT_DATA_DEFINE(0, 0, 0, 0),
278};
279
280static struct omap_volt_data omap36xx_vddcore_volt_data[] = {
281 VOLT_DATA_DEFINE(OMAP3630_VDD_CORE_OPP50_UV, OMAP3630_CONTROL_FUSE_OPP50_VDD2, 0xf4, 0x0c),
282 VOLT_DATA_DEFINE(OMAP3630_VDD_CORE_OPP100_UV, OMAP3630_CONTROL_FUSE_OPP100_VDD2, 0xf9, 0x16),
283 VOLT_DATA_DEFINE(0, 0, 0, 0),
284};
285
286/*
287 * Structures containing OMAP4430 voltage supported and various
288 * voltage dependent data for each VDD.
289 */
290static struct omap_volt_data omap44xx_vdd_mpu_volt_data[] = {
291 VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP50_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP50, 0xf4, 0x0c),
292 VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP100_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP100, 0xf9, 0x16),
293 VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO, 0xfa, 0x23),
294 VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPNITRO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO, 0xfa, 0x27),
295 VOLT_DATA_DEFINE(0, 0, 0, 0),
296};
297
298static struct omap_volt_data omap44xx_vdd_iva_volt_data[] = {
299 VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP50_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP50, 0xf4, 0x0c),
300 VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP100_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP100, 0xf9, 0x16),
301 VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO, 0xfa, 0x23),
302 VOLT_DATA_DEFINE(0, 0, 0, 0),
303};
304
305static struct omap_volt_data omap44xx_vdd_core_volt_data[] = {
306 VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP50_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP50, 0xf4, 0x0c),
307 VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP100_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP100, 0xf9, 0x16),
308 VOLT_DATA_DEFINE(0, 0, 0, 0),
309};
310 56
311static struct dentry *voltage_dir; 57static struct dentry *voltage_dir;
312 58
313/* Init function pointers */ 59/* Init function pointers */
314static void (*vc_init) (struct omap_vdd_info *vdd); 60static int vp_forceupdate_scale_voltage(struct omap_vdd_info *vdd,
315static int (*vdd_data_configure) (struct omap_vdd_info *vdd); 61 unsigned long target_volt);
316 62
317static u32 omap3_voltage_read_reg(u16 mod, u8 offset) 63static u32 omap3_voltage_read_reg(u16 mod, u8 offset)
318{ 64{
@@ -335,6 +81,62 @@ static void omap4_voltage_write_reg(u32 val, u16 mod, u8 offset)
335 omap4_prminst_write_inst_reg(val, OMAP4430_PRM_PARTITION, mod, offset); 81 omap4_prminst_write_inst_reg(val, OMAP4430_PRM_PARTITION, mod, offset);
336} 82}
337 83
84static int __init _config_common_vdd_data(struct omap_vdd_info *vdd)
85{
86 char *sys_ck_name;
87 struct clk *sys_ck;
88 u32 sys_clk_speed, timeout_val, waittime;
89
90 /*
91 * XXX Clockfw should handle this, or this should be in a
92 * struct record
93 */
94 if (cpu_is_omap24xx() || cpu_is_omap34xx())
95 sys_ck_name = "sys_ck";
96 else if (cpu_is_omap44xx())
97 sys_ck_name = "sys_clkin_ck";
98 else
99 return -EINVAL;
100
101 /*
102 * Sys clk rate is require to calculate vp timeout value and
103 * smpswaittimemin and smpswaittimemax.
104 */
105 sys_ck = clk_get(NULL, sys_ck_name);
106 if (IS_ERR(sys_ck)) {
107 pr_warning("%s: Could not get the sys clk to calculate"
108 "various vdd_%s params\n", __func__, vdd->voltdm.name);
109 return -EINVAL;
110 }
111 sys_clk_speed = clk_get_rate(sys_ck);
112 clk_put(sys_ck);
113 /* Divide to avoid overflow */
114 sys_clk_speed /= 1000;
115
116 /* Generic voltage parameters */
117 vdd->curr_volt = 1200000;
118 vdd->volt_scale = vp_forceupdate_scale_voltage;
119 vdd->vp_enabled = false;
120
121 vdd->vp_rt_data.vpconfig_erroroffset =
122 (vdd->pmic_info->vp_erroroffset <<
123 vdd->vp_data->vp_common->vpconfig_erroroffset_shift);
124
125 timeout_val = (sys_clk_speed * vdd->pmic_info->vp_timeout_us) / 1000;
126 vdd->vp_rt_data.vlimitto_timeout = timeout_val;
127 vdd->vp_rt_data.vlimitto_vddmin = vdd->pmic_info->vp_vddmin;
128 vdd->vp_rt_data.vlimitto_vddmax = vdd->pmic_info->vp_vddmax;
129
130 waittime = ((vdd->pmic_info->step_size / vdd->pmic_info->slew_rate) *
131 sys_clk_speed) / 1000;
132 vdd->vp_rt_data.vstepmin_smpswaittimemin = waittime;
133 vdd->vp_rt_data.vstepmax_smpswaittimemax = waittime;
134 vdd->vp_rt_data.vstepmin_stepmin = vdd->pmic_info->vp_vstepmin;
135 vdd->vp_rt_data.vstepmax_stepmax = vdd->pmic_info->vp_vstepmax;
136
137 return 0;
138}
139
338/* Voltage debugfs support */ 140/* Voltage debugfs support */
339static int vp_volt_debug_get(void *data, u64 *val) 141static int vp_volt_debug_get(void *data, u64 *val)
340{ 142{
@@ -346,7 +148,7 @@ static int vp_volt_debug_get(void *data, u64 *val)
346 return -EINVAL; 148 return -EINVAL;
347 } 149 }
348 150
349 vsel = vdd->read_reg(vdd->vp_reg.prm_mod, vdd->vp_offs.voltage); 151 vsel = vdd->read_reg(prm_mod_offs, vdd->vp_data->voltage);
350 pr_notice("curr_vsel = %x\n", vsel); 152 pr_notice("curr_vsel = %x\n", vsel);
351 153
352 if (!vdd->pmic_info->vsel_to_uv) { 154 if (!vdd->pmic_info->vsel_to_uv) {
@@ -379,7 +181,6 @@ DEFINE_SIMPLE_ATTRIBUTE(nom_volt_debug_fops, nom_volt_debug_get, NULL,
379static void vp_latch_vsel(struct omap_vdd_info *vdd) 181static void vp_latch_vsel(struct omap_vdd_info *vdd)
380{ 182{
381 u32 vpconfig; 183 u32 vpconfig;
382 u16 mod;
383 unsigned long uvdc; 184 unsigned long uvdc;
384 char vsel; 185 char vsel;
385 186
@@ -396,30 +197,27 @@ static void vp_latch_vsel(struct omap_vdd_info *vdd)
396 return; 197 return;
397 } 198 }
398 199
399 mod = vdd->vp_reg.prm_mod;
400
401 vsel = vdd->pmic_info->uv_to_vsel(uvdc); 200 vsel = vdd->pmic_info->uv_to_vsel(uvdc);
402 201
403 vpconfig = vdd->read_reg(mod, vdd->vp_offs.vpconfig); 202 vpconfig = vdd->read_reg(prm_mod_offs, vdd->vp_data->vpconfig);
404 vpconfig &= ~(vdd->vp_reg.vpconfig_initvoltage_mask | 203 vpconfig &= ~(vdd->vp_data->vp_common->vpconfig_initvoltage_mask |
405 vdd->vp_reg.vpconfig_initvdd); 204 vdd->vp_data->vp_common->vpconfig_initvdd);
406 vpconfig |= vsel << vdd->vp_reg.vpconfig_initvoltage_shift; 205 vpconfig |= vsel << vdd->vp_data->vp_common->vpconfig_initvoltage_shift;
407 206
408 vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig); 207 vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig);
409 208
410 /* Trigger initVDD value copy to voltage processor */ 209 /* Trigger initVDD value copy to voltage processor */
411 vdd->write_reg((vpconfig | vdd->vp_reg.vpconfig_initvdd), mod, 210 vdd->write_reg((vpconfig | vdd->vp_data->vp_common->vpconfig_initvdd),
412 vdd->vp_offs.vpconfig); 211 prm_mod_offs, vdd->vp_data->vpconfig);
413 212
414 /* Clear initVDD copy trigger bit */ 213 /* Clear initVDD copy trigger bit */
415 vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig); 214 vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig);
416} 215}
417 216
418/* Generic voltage init functions */ 217/* Generic voltage init functions */
419static void __init vp_init(struct omap_vdd_info *vdd) 218static void __init vp_init(struct omap_vdd_info *vdd)
420{ 219{
421 u32 vp_val; 220 u32 vp_val;
422 u16 mod;
423 221
424 if (!vdd->read_reg || !vdd->write_reg) { 222 if (!vdd->read_reg || !vdd->write_reg) {
425 pr_err("%s: No read/write API for accessing vdd_%s regs\n", 223 pr_err("%s: No read/write API for accessing vdd_%s regs\n",
@@ -427,33 +225,31 @@ static void __init vp_init(struct omap_vdd_info *vdd)
427 return; 225 return;
428 } 226 }
429 227
430 mod = vdd->vp_reg.prm_mod; 228 vp_val = vdd->vp_rt_data.vpconfig_erroroffset |
431 229 (vdd->vp_rt_data.vpconfig_errorgain <<
432 vp_val = vdd->vp_reg.vpconfig_erroroffset | 230 vdd->vp_data->vp_common->vpconfig_errorgain_shift) |
433 (vdd->vp_reg.vpconfig_errorgain << 231 vdd->vp_data->vp_common->vpconfig_timeouten;
434 vdd->vp_reg.vpconfig_errorgain_shift) | 232 vdd->write_reg(vp_val, prm_mod_offs, vdd->vp_data->vpconfig);
435 vdd->vp_reg.vpconfig_timeouten; 233
436 vdd->write_reg(vp_val, mod, vdd->vp_offs.vpconfig); 234 vp_val = ((vdd->vp_rt_data.vstepmin_smpswaittimemin <<
437 235 vdd->vp_data->vp_common->vstepmin_smpswaittimemin_shift) |
438 vp_val = ((vdd->vp_reg.vstepmin_smpswaittimemin << 236 (vdd->vp_rt_data.vstepmin_stepmin <<
439 vdd->vp_reg.vstepmin_smpswaittimemin_shift) | 237 vdd->vp_data->vp_common->vstepmin_stepmin_shift));
440 (vdd->vp_reg.vstepmin_stepmin << 238 vdd->write_reg(vp_val, prm_mod_offs, vdd->vp_data->vstepmin);
441 vdd->vp_reg.vstepmin_stepmin_shift)); 239
442 vdd->write_reg(vp_val, mod, vdd->vp_offs.vstepmin); 240 vp_val = ((vdd->vp_rt_data.vstepmax_smpswaittimemax <<
443 241 vdd->vp_data->vp_common->vstepmax_smpswaittimemax_shift) |
444 vp_val = ((vdd->vp_reg.vstepmax_smpswaittimemax << 242 (vdd->vp_rt_data.vstepmax_stepmax <<
445 vdd->vp_reg.vstepmax_smpswaittimemax_shift) | 243 vdd->vp_data->vp_common->vstepmax_stepmax_shift));
446 (vdd->vp_reg.vstepmax_stepmax << 244 vdd->write_reg(vp_val, prm_mod_offs, vdd->vp_data->vstepmax);
447 vdd->vp_reg.vstepmax_stepmax_shift)); 245
448 vdd->write_reg(vp_val, mod, vdd->vp_offs.vstepmax); 246 vp_val = ((vdd->vp_rt_data.vlimitto_vddmax <<
449 247 vdd->vp_data->vp_common->vlimitto_vddmax_shift) |
450 vp_val = ((vdd->vp_reg.vlimitto_vddmax << 248 (vdd->vp_rt_data.vlimitto_vddmin <<
451 vdd->vp_reg.vlimitto_vddmax_shift) | 249 vdd->vp_data->vp_common->vlimitto_vddmin_shift) |
452 (vdd->vp_reg.vlimitto_vddmin << 250 (vdd->vp_rt_data.vlimitto_timeout <<
453 vdd->vp_reg.vlimitto_vddmin_shift) | 251 vdd->vp_data->vp_common->vlimitto_timeout_shift));
454 (vdd->vp_reg.vlimitto_timeout << 252 vdd->write_reg(vp_val, prm_mod_offs, vdd->vp_data->vlimitto);
455 vdd->vp_reg.vlimitto_timeout_shift));
456 vdd->write_reg(vp_val, mod, vdd->vp_offs.vlimitto);
457} 253}
458 254
459static void __init vdd_debugfs_init(struct omap_vdd_info *vdd) 255static void __init vdd_debugfs_init(struct omap_vdd_info *vdd)
@@ -471,6 +267,7 @@ static void __init vdd_debugfs_init(struct omap_vdd_info *vdd)
471 strcat(name, vdd->voltdm.name); 267 strcat(name, vdd->voltdm.name);
472 268
473 vdd->debug_dir = debugfs_create_dir(name, voltage_dir); 269 vdd->debug_dir = debugfs_create_dir(name, voltage_dir);
270 kfree(name);
474 if (IS_ERR(vdd->debug_dir)) { 271 if (IS_ERR(vdd->debug_dir)) {
475 pr_warning("%s: Unable to create debugfs directory for" 272 pr_warning("%s: Unable to create debugfs directory for"
476 " vdd_%s\n", __func__, vdd->voltdm.name); 273 " vdd_%s\n", __func__, vdd->voltdm.name);
@@ -479,23 +276,23 @@ static void __init vdd_debugfs_init(struct omap_vdd_info *vdd)
479 } 276 }
480 277
481 (void) debugfs_create_x16("vp_errorgain", S_IRUGO, vdd->debug_dir, 278 (void) debugfs_create_x16("vp_errorgain", S_IRUGO, vdd->debug_dir,
482 &(vdd->vp_reg.vpconfig_errorgain)); 279 &(vdd->vp_rt_data.vpconfig_errorgain));
483 (void) debugfs_create_x16("vp_smpswaittimemin", S_IRUGO, 280 (void) debugfs_create_x16("vp_smpswaittimemin", S_IRUGO,
484 vdd->debug_dir, 281 vdd->debug_dir,
485 &(vdd->vp_reg.vstepmin_smpswaittimemin)); 282 &(vdd->vp_rt_data.vstepmin_smpswaittimemin));
486 (void) debugfs_create_x8("vp_stepmin", S_IRUGO, vdd->debug_dir, 283 (void) debugfs_create_x8("vp_stepmin", S_IRUGO, vdd->debug_dir,
487 &(vdd->vp_reg.vstepmin_stepmin)); 284 &(vdd->vp_rt_data.vstepmin_stepmin));
488 (void) debugfs_create_x16("vp_smpswaittimemax", S_IRUGO, 285 (void) debugfs_create_x16("vp_smpswaittimemax", S_IRUGO,
489 vdd->debug_dir, 286 vdd->debug_dir,
490 &(vdd->vp_reg.vstepmax_smpswaittimemax)); 287 &(vdd->vp_rt_data.vstepmax_smpswaittimemax));
491 (void) debugfs_create_x8("vp_stepmax", S_IRUGO, vdd->debug_dir, 288 (void) debugfs_create_x8("vp_stepmax", S_IRUGO, vdd->debug_dir,
492 &(vdd->vp_reg.vstepmax_stepmax)); 289 &(vdd->vp_rt_data.vstepmax_stepmax));
493 (void) debugfs_create_x8("vp_vddmax", S_IRUGO, vdd->debug_dir, 290 (void) debugfs_create_x8("vp_vddmax", S_IRUGO, vdd->debug_dir,
494 &(vdd->vp_reg.vlimitto_vddmax)); 291 &(vdd->vp_rt_data.vlimitto_vddmax));
495 (void) debugfs_create_x8("vp_vddmin", S_IRUGO, vdd->debug_dir, 292 (void) debugfs_create_x8("vp_vddmin", S_IRUGO, vdd->debug_dir,
496 &(vdd->vp_reg.vlimitto_vddmin)); 293 &(vdd->vp_rt_data.vlimitto_vddmin));
497 (void) debugfs_create_x16("vp_timeout", S_IRUGO, vdd->debug_dir, 294 (void) debugfs_create_x16("vp_timeout", S_IRUGO, vdd->debug_dir,
498 &(vdd->vp_reg.vlimitto_timeout)); 295 &(vdd->vp_rt_data.vlimitto_timeout));
499 (void) debugfs_create_file("curr_vp_volt", S_IRUGO, vdd->debug_dir, 296 (void) debugfs_create_file("curr_vp_volt", S_IRUGO, vdd->debug_dir,
500 (void *) vdd, &vp_volt_debug_fops); 297 (void *) vdd, &vp_volt_debug_fops);
501 (void) debugfs_create_file("curr_nominal_volt", S_IRUGO, 298 (void) debugfs_create_file("curr_nominal_volt", S_IRUGO,
@@ -508,8 +305,12 @@ static int _pre_volt_scale(struct omap_vdd_info *vdd,
508 unsigned long target_volt, u8 *target_vsel, u8 *current_vsel) 305 unsigned long target_volt, u8 *target_vsel, u8 *current_vsel)
509{ 306{
510 struct omap_volt_data *volt_data; 307 struct omap_volt_data *volt_data;
308 const struct omap_vc_common_data *vc_common;
309 const struct omap_vp_common_data *vp_common;
511 u32 vc_cmdval, vp_errgain_val; 310 u32 vc_cmdval, vp_errgain_val;
512 u16 vp_mod, vc_mod; 311
312 vc_common = vdd->vc_data->vc_common;
313 vp_common = vdd->vp_data->vp_common;
513 314
514 /* Check if suffiecient pmic info is available for this vdd */ 315 /* Check if suffiecient pmic info is available for this vdd */
515 if (!vdd->pmic_info) { 316 if (!vdd->pmic_info) {
@@ -531,33 +332,30 @@ static int _pre_volt_scale(struct omap_vdd_info *vdd,
531 return -EINVAL; 332 return -EINVAL;
532 } 333 }
533 334
534 vp_mod = vdd->vp_reg.prm_mod;
535 vc_mod = vdd->vc_reg.prm_mod;
536
537 /* Get volt_data corresponding to target_volt */ 335 /* Get volt_data corresponding to target_volt */
538 volt_data = omap_voltage_get_voltdata(&vdd->voltdm, target_volt); 336 volt_data = omap_voltage_get_voltdata(&vdd->voltdm, target_volt);
539 if (IS_ERR(volt_data)) 337 if (IS_ERR(volt_data))
540 volt_data = NULL; 338 volt_data = NULL;
541 339
542 *target_vsel = vdd->pmic_info->uv_to_vsel(target_volt); 340 *target_vsel = vdd->pmic_info->uv_to_vsel(target_volt);
543 *current_vsel = vdd->read_reg(vp_mod, vdd->vp_offs.voltage); 341 *current_vsel = vdd->read_reg(prm_mod_offs, vdd->vp_data->voltage);
544 342
545 /* Setting the ON voltage to the new target voltage */ 343 /* Setting the ON voltage to the new target voltage */
546 vc_cmdval = vdd->read_reg(vc_mod, vdd->vc_reg.cmdval_reg); 344 vc_cmdval = vdd->read_reg(prm_mod_offs, vdd->vc_data->cmdval_reg);
547 vc_cmdval &= ~vdd->vc_reg.cmd_on_mask; 345 vc_cmdval &= ~vc_common->cmd_on_mask;
548 vc_cmdval |= (*target_vsel << vdd->vc_reg.cmd_on_shift); 346 vc_cmdval |= (*target_vsel << vc_common->cmd_on_shift);
549 vdd->write_reg(vc_cmdval, vc_mod, vdd->vc_reg.cmdval_reg); 347 vdd->write_reg(vc_cmdval, prm_mod_offs, vdd->vc_data->cmdval_reg);
550 348
551 /* Setting vp errorgain based on the voltage */ 349 /* Setting vp errorgain based on the voltage */
552 if (volt_data) { 350 if (volt_data) {
553 vp_errgain_val = vdd->read_reg(vp_mod, 351 vp_errgain_val = vdd->read_reg(prm_mod_offs,
554 vdd->vp_offs.vpconfig); 352 vdd->vp_data->vpconfig);
555 vdd->vp_reg.vpconfig_errorgain = volt_data->vp_errgain; 353 vdd->vp_rt_data.vpconfig_errorgain = volt_data->vp_errgain;
556 vp_errgain_val &= ~vdd->vp_reg.vpconfig_errorgain_mask; 354 vp_errgain_val &= ~vp_common->vpconfig_errorgain_mask;
557 vp_errgain_val |= vdd->vp_reg.vpconfig_errorgain << 355 vp_errgain_val |= vdd->vp_rt_data.vpconfig_errorgain <<
558 vdd->vp_reg.vpconfig_errorgain_shift; 356 vp_common->vpconfig_errorgain_shift;
559 vdd->write_reg(vp_errgain_val, vp_mod, 357 vdd->write_reg(vp_errgain_val, prm_mod_offs,
560 vdd->vp_offs.vpconfig); 358 vdd->vp_data->vpconfig);
561 } 359 }
562 360
563 return 0; 361 return 0;
@@ -583,7 +381,6 @@ static int vc_bypass_scale_voltage(struct omap_vdd_info *vdd,
583{ 381{
584 u32 loop_cnt = 0, retries_cnt = 0; 382 u32 loop_cnt = 0, retries_cnt = 0;
585 u32 vc_valid, vc_bypass_val_reg, vc_bypass_value; 383 u32 vc_valid, vc_bypass_val_reg, vc_bypass_value;
586 u16 mod;
587 u8 target_vsel, current_vsel; 384 u8 target_vsel, current_vsel;
588 int ret; 385 int ret;
589 386
@@ -591,20 +388,19 @@ static int vc_bypass_scale_voltage(struct omap_vdd_info *vdd,
591 if (ret) 388 if (ret)
592 return ret; 389 return ret;
593 390
594 mod = vdd->vc_reg.prm_mod; 391 vc_valid = vdd->vc_data->vc_common->valid;
595 392 vc_bypass_val_reg = vdd->vc_data->vc_common->bypass_val_reg;
596 vc_valid = vdd->vc_reg.valid; 393 vc_bypass_value = (target_vsel << vdd->vc_data->vc_common->data_shift) |
597 vc_bypass_val_reg = vdd->vc_reg.bypass_val_reg;
598 vc_bypass_value = (target_vsel << vdd->vc_reg.data_shift) |
599 (vdd->pmic_info->pmic_reg << 394 (vdd->pmic_info->pmic_reg <<
600 vdd->vc_reg.regaddr_shift) | 395 vdd->vc_data->vc_common->regaddr_shift) |
601 (vdd->pmic_info->i2c_slave_addr << 396 (vdd->pmic_info->i2c_slave_addr <<
602 vdd->vc_reg.slaveaddr_shift); 397 vdd->vc_data->vc_common->slaveaddr_shift);
603 398
604 vdd->write_reg(vc_bypass_value, mod, vc_bypass_val_reg); 399 vdd->write_reg(vc_bypass_value, prm_mod_offs, vc_bypass_val_reg);
605 vdd->write_reg(vc_bypass_value | vc_valid, mod, vc_bypass_val_reg); 400 vdd->write_reg(vc_bypass_value | vc_valid, prm_mod_offs,
401 vc_bypass_val_reg);
606 402
607 vc_bypass_value = vdd->read_reg(mod, vc_bypass_val_reg); 403 vc_bypass_value = vdd->read_reg(prm_mod_offs, vc_bypass_val_reg);
608 /* 404 /*
609 * Loop till the bypass command is acknowledged from the SMPS. 405 * Loop till the bypass command is acknowledged from the SMPS.
610 * NOTE: This is legacy code. The loop count and retry count needs 406 * NOTE: This is legacy code. The loop count and retry count needs
@@ -623,7 +419,8 @@ static int vc_bypass_scale_voltage(struct omap_vdd_info *vdd,
623 loop_cnt = 0; 419 loop_cnt = 0;
624 udelay(10); 420 udelay(10);
625 } 421 }
626 vc_bypass_value = vdd->read_reg(mod, vc_bypass_val_reg); 422 vc_bypass_value = vdd->read_reg(prm_mod_offs,
423 vc_bypass_val_reg);
627 } 424 }
628 425
629 _post_volt_scale(vdd, target_volt, target_vsel, current_vsel); 426 _post_volt_scale(vdd, target_volt, target_vsel, current_vsel);
@@ -635,7 +432,6 @@ static int vp_forceupdate_scale_voltage(struct omap_vdd_info *vdd,
635 unsigned long target_volt) 432 unsigned long target_volt)
636{ 433{
637 u32 vpconfig; 434 u32 vpconfig;
638 u16 mod, ocp_mod;
639 u8 target_vsel, current_vsel, prm_irqst_reg; 435 u8 target_vsel, current_vsel, prm_irqst_reg;
640 int ret, timeout = 0; 436 int ret, timeout = 0;
641 437
@@ -643,20 +439,18 @@ static int vp_forceupdate_scale_voltage(struct omap_vdd_info *vdd,
643 if (ret) 439 if (ret)
644 return ret; 440 return ret;
645 441
646 mod = vdd->vp_reg.prm_mod; 442 prm_irqst_reg = vdd->vp_data->prm_irqst_data->prm_irqst_reg;
647 ocp_mod = vdd->ocp_mod;
648 prm_irqst_reg = vdd->prm_irqst_reg;
649 443
650 /* 444 /*
651 * Clear all pending TransactionDone interrupt/status. Typical latency 445 * Clear all pending TransactionDone interrupt/status. Typical latency
652 * is <3us 446 * is <3us
653 */ 447 */
654 while (timeout++ < VP_TRANXDONE_TIMEOUT) { 448 while (timeout++ < VP_TRANXDONE_TIMEOUT) {
655 vdd->write_reg(vdd->vp_reg.tranxdone_status, 449 vdd->write_reg(vdd->vp_data->prm_irqst_data->tranxdone_status,
656 ocp_mod, prm_irqst_reg); 450 prm_irqst_ocp_mod_offs, prm_irqst_reg);
657 if (!(vdd->read_reg(ocp_mod, prm_irqst_reg) & 451 if (!(vdd->read_reg(prm_irqst_ocp_mod_offs, prm_irqst_reg) &
658 vdd->vp_reg.tranxdone_status)) 452 vdd->vp_data->prm_irqst_data->tranxdone_status))
659 break; 453 break;
660 udelay(1); 454 udelay(1);
661 } 455 }
662 if (timeout >= VP_TRANXDONE_TIMEOUT) { 456 if (timeout >= VP_TRANXDONE_TIMEOUT) {
@@ -666,30 +460,30 @@ static int vp_forceupdate_scale_voltage(struct omap_vdd_info *vdd,
666 } 460 }
667 461
668 /* Configure for VP-Force Update */ 462 /* Configure for VP-Force Update */
669 vpconfig = vdd->read_reg(mod, vdd->vp_offs.vpconfig); 463 vpconfig = vdd->read_reg(prm_mod_offs, vdd->vp_data->vpconfig);
670 vpconfig &= ~(vdd->vp_reg.vpconfig_initvdd | 464 vpconfig &= ~(vdd->vp_data->vp_common->vpconfig_initvdd |
671 vdd->vp_reg.vpconfig_forceupdate | 465 vdd->vp_data->vp_common->vpconfig_forceupdate |
672 vdd->vp_reg.vpconfig_initvoltage_mask); 466 vdd->vp_data->vp_common->vpconfig_initvoltage_mask);
673 vpconfig |= ((target_vsel << 467 vpconfig |= ((target_vsel <<
674 vdd->vp_reg.vpconfig_initvoltage_shift)); 468 vdd->vp_data->vp_common->vpconfig_initvoltage_shift));
675 vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig); 469 vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig);
676 470
677 /* Trigger initVDD value copy to voltage processor */ 471 /* Trigger initVDD value copy to voltage processor */
678 vpconfig |= vdd->vp_reg.vpconfig_initvdd; 472 vpconfig |= vdd->vp_data->vp_common->vpconfig_initvdd;
679 vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig); 473 vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig);
680 474
681 /* Force update of voltage */ 475 /* Force update of voltage */
682 vpconfig |= vdd->vp_reg.vpconfig_forceupdate; 476 vpconfig |= vdd->vp_data->vp_common->vpconfig_forceupdate;
683 vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig); 477 vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig);
684 478
685 /* 479 /*
686 * Wait for TransactionDone. Typical latency is <200us. 480 * Wait for TransactionDone. Typical latency is <200us.
687 * Depends on SMPSWAITTIMEMIN/MAX and voltage change 481 * Depends on SMPSWAITTIMEMIN/MAX and voltage change
688 */ 482 */
689 timeout = 0; 483 timeout = 0;
690 omap_test_timeout((vdd->read_reg(ocp_mod, prm_irqst_reg) & 484 omap_test_timeout((vdd->read_reg(prm_irqst_ocp_mod_offs, prm_irqst_reg) &
691 vdd->vp_reg.tranxdone_status), 485 vdd->vp_data->prm_irqst_data->tranxdone_status),
692 VP_TRANXDONE_TIMEOUT, timeout); 486 VP_TRANXDONE_TIMEOUT, timeout);
693 if (timeout >= VP_TRANXDONE_TIMEOUT) 487 if (timeout >= VP_TRANXDONE_TIMEOUT)
694 pr_err("%s: vdd_%s TRANXDONE timeout exceeded." 488 pr_err("%s: vdd_%s TRANXDONE timeout exceeded."
695 "TRANXDONE never got set after the voltage update\n", 489 "TRANXDONE never got set after the voltage update\n",
@@ -703,11 +497,11 @@ static int vp_forceupdate_scale_voltage(struct omap_vdd_info *vdd,
703 */ 497 */
704 timeout = 0; 498 timeout = 0;
705 while (timeout++ < VP_TRANXDONE_TIMEOUT) { 499 while (timeout++ < VP_TRANXDONE_TIMEOUT) {
706 vdd->write_reg(vdd->vp_reg.tranxdone_status, 500 vdd->write_reg(vdd->vp_data->prm_irqst_data->tranxdone_status,
707 ocp_mod, prm_irqst_reg); 501 prm_irqst_ocp_mod_offs, prm_irqst_reg);
708 if (!(vdd->read_reg(ocp_mod, prm_irqst_reg) & 502 if (!(vdd->read_reg(prm_irqst_ocp_mod_offs, prm_irqst_reg) &
709 vdd->vp_reg.tranxdone_status)) 503 vdd->vp_data->prm_irqst_data->tranxdone_status))
710 break; 504 break;
711 udelay(1); 505 udelay(1);
712 } 506 }
713 507
@@ -716,222 +510,95 @@ static int vp_forceupdate_scale_voltage(struct omap_vdd_info *vdd,
716 "to clear the TRANXDONE status\n", 510 "to clear the TRANXDONE status\n",
717 __func__, vdd->voltdm.name); 511 __func__, vdd->voltdm.name);
718 512
719 vpconfig = vdd->read_reg(mod, vdd->vp_offs.vpconfig); 513 vpconfig = vdd->read_reg(prm_mod_offs, vdd->vp_data->vpconfig);
720 /* Clear initVDD copy trigger bit */ 514 /* Clear initVDD copy trigger bit */
721 vpconfig &= ~vdd->vp_reg.vpconfig_initvdd;; 515 vpconfig &= ~vdd->vp_data->vp_common->vpconfig_initvdd;
722 vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig); 516 vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig);
723 /* Clear force bit */ 517 /* Clear force bit */
724 vpconfig &= ~vdd->vp_reg.vpconfig_forceupdate; 518 vpconfig &= ~vdd->vp_data->vp_common->vpconfig_forceupdate;
725 vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig); 519 vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig);
726 520
727 return 0; 521 return 0;
728} 522}
729 523
730/* OMAP3 specific voltage init functions */ 524static void __init omap3_vfsm_init(struct omap_vdd_info *vdd)
525{
526 /*
527 * Voltage Manager FSM parameters init
528 * XXX This data should be passed in from the board file
529 */
530 vdd->write_reg(OMAP3_CLKSETUP, prm_mod_offs, OMAP3_PRM_CLKSETUP_OFFSET);
531 vdd->write_reg(OMAP3_VOLTOFFSET, prm_mod_offs,
532 OMAP3_PRM_VOLTOFFSET_OFFSET);
533 vdd->write_reg(OMAP3_VOLTSETUP2, prm_mod_offs,
534 OMAP3_PRM_VOLTSETUP2_OFFSET);
535}
731 536
732/*
733 * Intializes the voltage controller registers with the PMIC and board
734 * specific parameters and voltage setup times for OMAP3.
735 */
736static void __init omap3_vc_init(struct omap_vdd_info *vdd) 537static void __init omap3_vc_init(struct omap_vdd_info *vdd)
737{ 538{
738 u32 vc_val;
739 u16 mod;
740 u8 on_vsel, onlp_vsel, ret_vsel, off_vsel;
741 static bool is_initialized; 539 static bool is_initialized;
540 u8 on_vsel, onlp_vsel, ret_vsel, off_vsel;
541 u32 vc_val;
742 542
743 if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) { 543 if (is_initialized)
744 pr_err("%s: PMIC info requried to configure vc for"
745 "vdd_%s not populated.Hence cannot initialize vc\n",
746 __func__, vdd->voltdm.name);
747 return;
748 }
749
750 if (!vdd->read_reg || !vdd->write_reg) {
751 pr_err("%s: No read/write API for accessing vdd_%s regs\n",
752 __func__, vdd->voltdm.name);
753 return; 544 return;
754 }
755
756 mod = vdd->vc_reg.prm_mod;
757
758 /* Set up the SMPS_SA(i2c slave address in VC */
759 vc_val = vdd->read_reg(mod, vdd->vc_reg.smps_sa_reg);
760 vc_val &= ~vdd->vc_reg.smps_sa_mask;
761 vc_val |= vdd->pmic_info->i2c_slave_addr << vdd->vc_reg.smps_sa_shift;
762 vdd->write_reg(vc_val, mod, vdd->vc_reg.smps_sa_reg);
763
764 /* Setup the VOLRA(pmic reg addr) in VC */
765 vc_val = vdd->read_reg(mod, vdd->vc_reg.smps_volra_reg);
766 vc_val &= ~vdd->vc_reg.smps_volra_mask;
767 vc_val |= vdd->pmic_info->pmic_reg << vdd->vc_reg.smps_volra_shift;
768 vdd->write_reg(vc_val, mod, vdd->vc_reg.smps_volra_reg);
769
770 /*Configure the setup times */
771 vc_val = vdd->read_reg(mod, vdd->vc_reg.voltsetup_reg);
772 vc_val &= ~vdd->vc_reg.voltsetup_mask;
773 vc_val |= vdd->pmic_info->volt_setup_time <<
774 vdd->vc_reg.voltsetup_shift;
775 vdd->write_reg(vc_val, mod, vdd->vc_reg.voltsetup_reg);
776 545
777 /* Set up the on, inactive, retention and off voltage */ 546 /* Set up the on, inactive, retention and off voltage */
778 on_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->on_volt); 547 on_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->on_volt);
779 onlp_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->onlp_volt); 548 onlp_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->onlp_volt);
780 ret_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->ret_volt); 549 ret_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->ret_volt);
781 off_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->off_volt); 550 off_vsel = vdd->pmic_info->uv_to_vsel(vdd->pmic_info->off_volt);
782 vc_val = ((on_vsel << vdd->vc_reg.cmd_on_shift) | 551 vc_val = ((on_vsel << vdd->vc_data->vc_common->cmd_on_shift) |
783 (onlp_vsel << vdd->vc_reg.cmd_onlp_shift) | 552 (onlp_vsel << vdd->vc_data->vc_common->cmd_onlp_shift) |
784 (ret_vsel << vdd->vc_reg.cmd_ret_shift) | 553 (ret_vsel << vdd->vc_data->vc_common->cmd_ret_shift) |
785 (off_vsel << vdd->vc_reg.cmd_off_shift)); 554 (off_vsel << vdd->vc_data->vc_common->cmd_off_shift));
786 vdd->write_reg(vc_val, mod, vdd->vc_reg.cmdval_reg); 555 vdd->write_reg(vc_val, prm_mod_offs, vdd->vc_data->cmdval_reg);
787
788 if (is_initialized)
789 return;
790 556
791 /* Generic VC parameters init */ 557 /*
792 vdd->write_reg(OMAP3430_CMD1_MASK | OMAP3430_RAV1_MASK, mod, 558 * Generic VC parameters init
559 * XXX This data should be abstracted out
560 */
561 vdd->write_reg(OMAP3430_CMD1_MASK | OMAP3430_RAV1_MASK, prm_mod_offs,
793 OMAP3_PRM_VC_CH_CONF_OFFSET); 562 OMAP3_PRM_VC_CH_CONF_OFFSET);
794 vdd->write_reg(OMAP3430_MCODE_SHIFT | OMAP3430_HSEN_MASK, mod, 563 vdd->write_reg(OMAP3430_MCODE_SHIFT | OMAP3430_HSEN_MASK, prm_mod_offs,
795 OMAP3_PRM_VC_I2C_CFG_OFFSET); 564 OMAP3_PRM_VC_I2C_CFG_OFFSET);
796 vdd->write_reg(OMAP3_CLKSETUP, mod, OMAP3_PRM_CLKSETUP_OFFSET); 565
797 vdd->write_reg(OMAP3_VOLTOFFSET, mod, OMAP3_PRM_VOLTOFFSET_OFFSET); 566 omap3_vfsm_init(vdd);
798 vdd->write_reg(OMAP3_VOLTSETUP2, mod, OMAP3_PRM_VOLTSETUP2_OFFSET); 567
799 is_initialized = true; 568 is_initialized = true;
800} 569}
801 570
802/* Sets up all the VDD related info for OMAP3 */ 571
803static int __init omap3_vdd_data_configure(struct omap_vdd_info *vdd) 572/* OMAP4 specific voltage init functions */
573static void __init omap4_vc_init(struct omap_vdd_info *vdd)
804{ 574{
805 struct clk *sys_ck; 575 static bool is_initialized;
806 u32 sys_clk_speed, timeout_val, waittime; 576 u32 vc_val;
807 577
808 if (!vdd->pmic_info) { 578 if (is_initialized)
809 pr_err("%s: PMIC info requried to configure vdd_%s not" 579 return;
810 "populated.Hence cannot initialize vdd_%s\n",
811 __func__, vdd->voltdm.name, vdd->voltdm.name);
812 return -EINVAL;
813 }
814 580
815 if (!strcmp(vdd->voltdm.name, "mpu")) { 581 /* TODO: Configure setup times and CMD_VAL values*/
816 if (cpu_is_omap3630())
817 vdd->volt_data = omap36xx_vddmpu_volt_data;
818 else
819 vdd->volt_data = omap34xx_vddmpu_volt_data;
820
821 vdd->vp_reg.tranxdone_status = OMAP3430_VP1_TRANXDONE_ST_MASK;
822 vdd->vc_reg.cmdval_reg = OMAP3_PRM_VC_CMD_VAL_0_OFFSET;
823 vdd->vc_reg.smps_sa_shift = OMAP3430_PRM_VC_SMPS_SA_SA0_SHIFT;
824 vdd->vc_reg.smps_sa_mask = OMAP3430_PRM_VC_SMPS_SA_SA0_MASK;
825 vdd->vc_reg.smps_volra_shift = OMAP3430_VOLRA0_SHIFT;
826 vdd->vc_reg.smps_volra_mask = OMAP3430_VOLRA0_MASK;
827 vdd->vc_reg.voltsetup_shift = OMAP3430_SETUP_TIME1_SHIFT;
828 vdd->vc_reg.voltsetup_mask = OMAP3430_SETUP_TIME1_MASK;
829 } else if (!strcmp(vdd->voltdm.name, "core")) {
830 if (cpu_is_omap3630())
831 vdd->volt_data = omap36xx_vddcore_volt_data;
832 else
833 vdd->volt_data = omap34xx_vddcore_volt_data;
834
835 vdd->vp_reg.tranxdone_status = OMAP3430_VP2_TRANXDONE_ST_MASK;
836 vdd->vc_reg.cmdval_reg = OMAP3_PRM_VC_CMD_VAL_1_OFFSET;
837 vdd->vc_reg.smps_sa_shift = OMAP3430_PRM_VC_SMPS_SA_SA1_SHIFT;
838 vdd->vc_reg.smps_sa_mask = OMAP3430_PRM_VC_SMPS_SA_SA1_MASK;
839 vdd->vc_reg.smps_volra_shift = OMAP3430_VOLRA1_SHIFT;
840 vdd->vc_reg.smps_volra_mask = OMAP3430_VOLRA1_MASK;
841 vdd->vc_reg.voltsetup_shift = OMAP3430_SETUP_TIME2_SHIFT;
842 vdd->vc_reg.voltsetup_mask = OMAP3430_SETUP_TIME2_MASK;
843 } else {
844 pr_warning("%s: vdd_%s does not exisit in OMAP3\n",
845 __func__, vdd->voltdm.name);
846 return -EINVAL;
847 }
848 582
849 /* 583 /*
850 * Sys clk rate is require to calculate vp timeout value and 584 * Generic VC parameters init
851 * smpswaittimemin and smpswaittimemax. 585 * XXX This data should be abstracted out
852 */ 586 */
853 sys_ck = clk_get(NULL, "sys_ck"); 587 vc_val = (OMAP4430_RAV_VDD_MPU_L_MASK | OMAP4430_CMD_VDD_MPU_L_MASK |
854 if (IS_ERR(sys_ck)) { 588 OMAP4430_RAV_VDD_IVA_L_MASK | OMAP4430_CMD_VDD_IVA_L_MASK |
855 pr_warning("%s: Could not get the sys clk to calculate" 589 OMAP4430_RAV_VDD_CORE_L_MASK | OMAP4430_CMD_VDD_CORE_L_MASK);
856 "various vdd_%s params\n", __func__, vdd->voltdm.name); 590 vdd->write_reg(vc_val, prm_mod_offs, OMAP4_PRM_VC_CFG_CHANNEL_OFFSET);
857 return -EINVAL;
858 }
859 sys_clk_speed = clk_get_rate(sys_ck);
860 clk_put(sys_ck);
861 /* Divide to avoid overflow */
862 sys_clk_speed /= 1000;
863
864 /* Generic voltage parameters */
865 vdd->curr_volt = 1200000;
866 vdd->ocp_mod = OCP_MOD;
867 vdd->prm_irqst_reg = OMAP3_PRM_IRQSTATUS_MPU_OFFSET;
868 vdd->read_reg = omap3_voltage_read_reg;
869 vdd->write_reg = omap3_voltage_write_reg;
870 vdd->volt_scale = vp_forceupdate_scale_voltage;
871 vdd->vp_enabled = false;
872 591
873 /* VC parameters */ 592 /* XXX These are magic numbers and do not belong! */
874 vdd->vc_reg.prm_mod = OMAP3430_GR_MOD; 593 vc_val = (0x60 << OMAP4430_SCLL_SHIFT | 0x26 << OMAP4430_SCLH_SHIFT);
875 vdd->vc_reg.smps_sa_reg = OMAP3_PRM_VC_SMPS_SA_OFFSET; 594 vdd->write_reg(vc_val, prm_mod_offs, OMAP4_PRM_VC_CFG_I2C_CLK_OFFSET);
876 vdd->vc_reg.smps_volra_reg = OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET;
877 vdd->vc_reg.bypass_val_reg = OMAP3_PRM_VC_BYPASS_VAL_OFFSET;
878 vdd->vc_reg.voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET;
879 vdd->vc_reg.data_shift = OMAP3430_DATA_SHIFT;
880 vdd->vc_reg.slaveaddr_shift = OMAP3430_SLAVEADDR_SHIFT;
881 vdd->vc_reg.regaddr_shift = OMAP3430_REGADDR_SHIFT;
882 vdd->vc_reg.valid = OMAP3430_VALID_MASK;
883 vdd->vc_reg.cmd_on_shift = OMAP3430_VC_CMD_ON_SHIFT;
884 vdd->vc_reg.cmd_on_mask = OMAP3430_VC_CMD_ON_MASK;
885 vdd->vc_reg.cmd_onlp_shift = OMAP3430_VC_CMD_ONLP_SHIFT;
886 vdd->vc_reg.cmd_ret_shift = OMAP3430_VC_CMD_RET_SHIFT;
887 vdd->vc_reg.cmd_off_shift = OMAP3430_VC_CMD_OFF_SHIFT;
888
889 vdd->vp_reg.prm_mod = OMAP3430_GR_MOD;
890
891 /* VPCONFIG bit fields */
892 vdd->vp_reg.vpconfig_erroroffset = (vdd->pmic_info->vp_erroroffset <<
893 OMAP3430_ERROROFFSET_SHIFT);
894 vdd->vp_reg.vpconfig_errorgain_mask = OMAP3430_ERRORGAIN_MASK;
895 vdd->vp_reg.vpconfig_errorgain_shift = OMAP3430_ERRORGAIN_SHIFT;
896 vdd->vp_reg.vpconfig_initvoltage_shift = OMAP3430_INITVOLTAGE_SHIFT;
897 vdd->vp_reg.vpconfig_initvoltage_mask = OMAP3430_INITVOLTAGE_MASK;
898 vdd->vp_reg.vpconfig_timeouten = OMAP3430_TIMEOUTEN_MASK;
899 vdd->vp_reg.vpconfig_initvdd = OMAP3430_INITVDD_MASK;
900 vdd->vp_reg.vpconfig_forceupdate = OMAP3430_FORCEUPDATE_MASK;
901 vdd->vp_reg.vpconfig_vpenable = OMAP3430_VPENABLE_MASK;
902
903 /* VSTEPMIN VSTEPMAX bit fields */
904 waittime = ((vdd->pmic_info->step_size / vdd->pmic_info->slew_rate) *
905 sys_clk_speed) / 1000;
906 vdd->vp_reg.vstepmin_smpswaittimemin = waittime;
907 vdd->vp_reg.vstepmax_smpswaittimemax = waittime;
908 vdd->vp_reg.vstepmin_stepmin = vdd->pmic_info->vp_vstepmin;
909 vdd->vp_reg.vstepmax_stepmax = vdd->pmic_info->vp_vstepmax;
910 vdd->vp_reg.vstepmin_smpswaittimemin_shift =
911 OMAP3430_SMPSWAITTIMEMIN_SHIFT;
912 vdd->vp_reg.vstepmax_smpswaittimemax_shift =
913 OMAP3430_SMPSWAITTIMEMAX_SHIFT;
914 vdd->vp_reg.vstepmin_stepmin_shift = OMAP3430_VSTEPMIN_SHIFT;
915 vdd->vp_reg.vstepmax_stepmax_shift = OMAP3430_VSTEPMAX_SHIFT;
916
917 /* VLIMITTO bit fields */
918 timeout_val = (sys_clk_speed * vdd->pmic_info->vp_timeout_us) / 1000;
919 vdd->vp_reg.vlimitto_timeout = timeout_val;
920 vdd->vp_reg.vlimitto_vddmin = vdd->pmic_info->vp_vddmin;
921 vdd->vp_reg.vlimitto_vddmax = vdd->pmic_info->vp_vddmax;
922 vdd->vp_reg.vlimitto_vddmin_shift = OMAP3430_VDDMIN_SHIFT;
923 vdd->vp_reg.vlimitto_vddmax_shift = OMAP3430_VDDMAX_SHIFT;
924 vdd->vp_reg.vlimitto_timeout_shift = OMAP3430_TIMEOUT_SHIFT;
925 595
926 return 0; 596 is_initialized = true;
927} 597}
928 598
929/* OMAP4 specific voltage init functions */ 599static void __init omap_vc_init(struct omap_vdd_info *vdd)
930static void __init omap4_vc_init(struct omap_vdd_info *vdd)
931{ 600{
932 u32 vc_val; 601 u32 vc_val;
933 u16 mod;
934 static bool is_initialized;
935 602
936 if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) { 603 if (!vdd->pmic_info || !vdd->pmic_info->uv_to_vsel) {
937 pr_err("%s: PMIC info requried to configure vc for" 604 pr_err("%s: PMIC info requried to configure vc for"
@@ -946,173 +613,61 @@ static void __init omap4_vc_init(struct omap_vdd_info *vdd)
946 return; 613 return;
947 } 614 }
948 615
949 mod = vdd->vc_reg.prm_mod;
950
951 /* Set up the SMPS_SA(i2c slave address in VC */ 616 /* Set up the SMPS_SA(i2c slave address in VC */
952 vc_val = vdd->read_reg(mod, vdd->vc_reg.smps_sa_reg); 617 vc_val = vdd->read_reg(prm_mod_offs,
953 vc_val &= ~vdd->vc_reg.smps_sa_mask; 618 vdd->vc_data->vc_common->smps_sa_reg);
954 vc_val |= vdd->pmic_info->i2c_slave_addr << vdd->vc_reg.smps_sa_shift; 619 vc_val &= ~vdd->vc_data->smps_sa_mask;
955 vdd->write_reg(vc_val, mod, vdd->vc_reg.smps_sa_reg); 620 vc_val |= vdd->pmic_info->i2c_slave_addr << vdd->vc_data->smps_sa_shift;
621 vdd->write_reg(vc_val, prm_mod_offs,
622 vdd->vc_data->vc_common->smps_sa_reg);
956 623
957 /* Setup the VOLRA(pmic reg addr) in VC */ 624 /* Setup the VOLRA(pmic reg addr) in VC */
958 vc_val = vdd->read_reg(mod, vdd->vc_reg.smps_volra_reg); 625 vc_val = vdd->read_reg(prm_mod_offs,
959 vc_val &= ~vdd->vc_reg.smps_volra_mask; 626 vdd->vc_data->vc_common->smps_volra_reg);
960 vc_val |= vdd->pmic_info->pmic_reg << vdd->vc_reg.smps_volra_shift; 627 vc_val &= ~vdd->vc_data->smps_volra_mask;
961 vdd->write_reg(vc_val, mod, vdd->vc_reg.smps_volra_reg); 628 vc_val |= vdd->pmic_info->pmic_reg << vdd->vc_data->smps_volra_shift;
962 629 vdd->write_reg(vc_val, prm_mod_offs,
963 /* TODO: Configure setup times and CMD_VAL values*/ 630 vdd->vc_data->vc_common->smps_volra_reg);
964 631
965 if (is_initialized) 632 /* Configure the setup times */
966 return; 633 vc_val = vdd->read_reg(prm_mod_offs, vdd->vfsm->voltsetup_reg);
967 634 vc_val &= ~vdd->vfsm->voltsetup_mask;
968 /* Generic VC parameters init */ 635 vc_val |= vdd->pmic_info->volt_setup_time <<
969 vc_val = (OMAP4430_RAV_VDD_MPU_L_MASK | OMAP4430_CMD_VDD_MPU_L_MASK | 636 vdd->vfsm->voltsetup_shift;
970 OMAP4430_RAV_VDD_IVA_L_MASK | OMAP4430_CMD_VDD_IVA_L_MASK | 637 vdd->write_reg(vc_val, prm_mod_offs, vdd->vfsm->voltsetup_reg);
971 OMAP4430_RAV_VDD_CORE_L_MASK | OMAP4430_CMD_VDD_CORE_L_MASK);
972 vdd->write_reg(vc_val, mod, OMAP4_PRM_VC_CFG_CHANNEL_OFFSET);
973
974 vc_val = (0x60 << OMAP4430_SCLL_SHIFT | 0x26 << OMAP4430_SCLH_SHIFT);
975 vdd->write_reg(vc_val, mod, OMAP4_PRM_VC_CFG_I2C_CLK_OFFSET);
976 638
977 is_initialized = true; 639 if (cpu_is_omap34xx())
640 omap3_vc_init(vdd);
641 else if (cpu_is_omap44xx())
642 omap4_vc_init(vdd);
978} 643}
979 644
980/* Sets up all the VDD related info for OMAP4 */ 645static int __init omap_vdd_data_configure(struct omap_vdd_info *vdd)
981static int __init omap4_vdd_data_configure(struct omap_vdd_info *vdd)
982{ 646{
983 struct clk *sys_ck; 647 int ret = -EINVAL;
984 u32 sys_clk_speed, timeout_val, waittime;
985 648
986 if (!vdd->pmic_info) { 649 if (!vdd->pmic_info) {
987 pr_err("%s: PMIC info requried to configure vdd_%s not" 650 pr_err("%s: PMIC info requried to configure vdd_%s not"
988 "populated.Hence cannot initialize vdd_%s\n", 651 "populated.Hence cannot initialize vdd_%s\n",
989 __func__, vdd->voltdm.name, vdd->voltdm.name); 652 __func__, vdd->voltdm.name, vdd->voltdm.name);
990 return -EINVAL; 653 goto ovdc_out;
991 } 654 }
992 655
993 if (!strcmp(vdd->voltdm.name, "mpu")) { 656 if (IS_ERR_VALUE(_config_common_vdd_data(vdd)))
994 vdd->volt_data = omap44xx_vdd_mpu_volt_data; 657 goto ovdc_out;
995 vdd->vp_reg.tranxdone_status =
996 OMAP4430_VP_MPU_TRANXDONE_ST_MASK;
997 vdd->vc_reg.cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_MPU_L_OFFSET;
998 vdd->vc_reg.smps_sa_shift =
999 OMAP4430_SA_VDD_MPU_L_PRM_VC_SMPS_SA_SHIFT;
1000 vdd->vc_reg.smps_sa_mask =
1001 OMAP4430_SA_VDD_MPU_L_PRM_VC_SMPS_SA_MASK;
1002 vdd->vc_reg.smps_volra_shift = OMAP4430_VOLRA_VDD_MPU_L_SHIFT;
1003 vdd->vc_reg.smps_volra_mask = OMAP4430_VOLRA_VDD_MPU_L_MASK;
1004 vdd->vc_reg.voltsetup_reg =
1005 OMAP4_PRM_VOLTSETUP_MPU_RET_SLEEP_OFFSET;
1006 vdd->prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET;
1007 } else if (!strcmp(vdd->voltdm.name, "core")) {
1008 vdd->volt_data = omap44xx_vdd_core_volt_data;
1009 vdd->vp_reg.tranxdone_status =
1010 OMAP4430_VP_CORE_TRANXDONE_ST_MASK;
1011 vdd->vc_reg.cmdval_reg =
1012 OMAP4_PRM_VC_VAL_CMD_VDD_CORE_L_OFFSET;
1013 vdd->vc_reg.smps_sa_shift = OMAP4430_SA_VDD_CORE_L_0_6_SHIFT;
1014 vdd->vc_reg.smps_sa_mask = OMAP4430_SA_VDD_CORE_L_0_6_MASK;
1015 vdd->vc_reg.smps_volra_shift = OMAP4430_VOLRA_VDD_CORE_L_SHIFT;
1016 vdd->vc_reg.smps_volra_mask = OMAP4430_VOLRA_VDD_CORE_L_MASK;
1017 vdd->vc_reg.voltsetup_reg =
1018 OMAP4_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET;
1019 vdd->prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET;
1020 } else if (!strcmp(vdd->voltdm.name, "iva")) {
1021 vdd->volt_data = omap44xx_vdd_iva_volt_data;
1022 vdd->vp_reg.tranxdone_status =
1023 OMAP4430_VP_IVA_TRANXDONE_ST_MASK;
1024 vdd->vc_reg.cmdval_reg = OMAP4_PRM_VC_VAL_CMD_VDD_IVA_L_OFFSET;
1025 vdd->vc_reg.smps_sa_shift =
1026 OMAP4430_SA_VDD_IVA_L_PRM_VC_SMPS_SA_SHIFT;
1027 vdd->vc_reg.smps_sa_mask =
1028 OMAP4430_SA_VDD_IVA_L_PRM_VC_SMPS_SA_MASK;
1029 vdd->vc_reg.smps_volra_shift = OMAP4430_VOLRA_VDD_IVA_L_SHIFT;
1030 vdd->vc_reg.smps_volra_mask = OMAP4430_VOLRA_VDD_IVA_L_MASK;
1031 vdd->vc_reg.voltsetup_reg =
1032 OMAP4_PRM_VOLTSETUP_IVA_RET_SLEEP_OFFSET;
1033 vdd->prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET;
1034 } else {
1035 pr_warning("%s: vdd_%s does not exisit in OMAP4\n",
1036 __func__, vdd->voltdm.name);
1037 return -EINVAL;
1038 }
1039 658
1040 /* 659 if (cpu_is_omap34xx()) {
1041 * Sys clk rate is require to calculate vp timeout value and 660 vdd->read_reg = omap3_voltage_read_reg;
1042 * smpswaittimemin and smpswaittimemax. 661 vdd->write_reg = omap3_voltage_write_reg;
1043 */ 662 ret = 0;
1044 sys_ck = clk_get(NULL, "sys_clkin_ck"); 663 } else if (cpu_is_omap44xx()) {
1045 if (IS_ERR(sys_ck)) { 664 vdd->read_reg = omap4_voltage_read_reg;
1046 pr_warning("%s: Could not get the sys clk to calculate" 665 vdd->write_reg = omap4_voltage_write_reg;
1047 "various vdd_%s params\n", __func__, vdd->voltdm.name); 666 ret = 0;
1048 return -EINVAL;
1049 } 667 }
1050 sys_clk_speed = clk_get_rate(sys_ck);
1051 clk_put(sys_ck);
1052 /* Divide to avoid overflow */
1053 sys_clk_speed /= 1000;
1054
1055 /* Generic voltage parameters */
1056 vdd->curr_volt = 1200000;
1057 vdd->ocp_mod = OMAP4430_PRM_OCP_SOCKET_INST;
1058 vdd->read_reg = omap4_voltage_read_reg;
1059 vdd->write_reg = omap4_voltage_write_reg;
1060 vdd->volt_scale = vp_forceupdate_scale_voltage;
1061 vdd->vp_enabled = false;
1062 668
1063 /* VC parameters */ 669ovdc_out:
1064 vdd->vc_reg.prm_mod = OMAP4430_PRM_DEVICE_INST; 670 return ret;
1065 vdd->vc_reg.smps_sa_reg = OMAP4_PRM_VC_SMPS_SA_OFFSET;
1066 vdd->vc_reg.smps_volra_reg = OMAP4_PRM_VC_VAL_SMPS_RA_VOL_OFFSET;
1067 vdd->vc_reg.bypass_val_reg = OMAP4_PRM_VC_VAL_BYPASS_OFFSET;
1068 vdd->vc_reg.data_shift = OMAP4430_DATA_SHIFT;
1069 vdd->vc_reg.slaveaddr_shift = OMAP4430_SLAVEADDR_SHIFT;
1070 vdd->vc_reg.regaddr_shift = OMAP4430_REGADDR_SHIFT;
1071 vdd->vc_reg.valid = OMAP4430_VALID_MASK;
1072 vdd->vc_reg.cmd_on_shift = OMAP4430_ON_SHIFT;
1073 vdd->vc_reg.cmd_on_mask = OMAP4430_ON_MASK;
1074 vdd->vc_reg.cmd_onlp_shift = OMAP4430_ONLP_SHIFT;
1075 vdd->vc_reg.cmd_ret_shift = OMAP4430_RET_SHIFT;
1076 vdd->vc_reg.cmd_off_shift = OMAP4430_OFF_SHIFT;
1077
1078 vdd->vp_reg.prm_mod = OMAP4430_PRM_DEVICE_INST;
1079
1080 /* VPCONFIG bit fields */
1081 vdd->vp_reg.vpconfig_erroroffset = (vdd->pmic_info->vp_erroroffset <<
1082 OMAP4430_ERROROFFSET_SHIFT);
1083 vdd->vp_reg.vpconfig_errorgain_mask = OMAP4430_ERRORGAIN_MASK;
1084 vdd->vp_reg.vpconfig_errorgain_shift = OMAP4430_ERRORGAIN_SHIFT;
1085 vdd->vp_reg.vpconfig_initvoltage_shift = OMAP4430_INITVOLTAGE_SHIFT;
1086 vdd->vp_reg.vpconfig_initvoltage_mask = OMAP4430_INITVOLTAGE_MASK;
1087 vdd->vp_reg.vpconfig_timeouten = OMAP4430_TIMEOUTEN_MASK;
1088 vdd->vp_reg.vpconfig_initvdd = OMAP4430_INITVDD_MASK;
1089 vdd->vp_reg.vpconfig_forceupdate = OMAP4430_FORCEUPDATE_MASK;
1090 vdd->vp_reg.vpconfig_vpenable = OMAP4430_VPENABLE_MASK;
1091
1092 /* VSTEPMIN VSTEPMAX bit fields */
1093 waittime = ((vdd->pmic_info->step_size / vdd->pmic_info->slew_rate) *
1094 sys_clk_speed) / 1000;
1095 vdd->vp_reg.vstepmin_smpswaittimemin = waittime;
1096 vdd->vp_reg.vstepmax_smpswaittimemax = waittime;
1097 vdd->vp_reg.vstepmin_stepmin = vdd->pmic_info->vp_vstepmin;
1098 vdd->vp_reg.vstepmax_stepmax = vdd->pmic_info->vp_vstepmax;
1099 vdd->vp_reg.vstepmin_smpswaittimemin_shift =
1100 OMAP4430_SMPSWAITTIMEMIN_SHIFT;
1101 vdd->vp_reg.vstepmax_smpswaittimemax_shift =
1102 OMAP4430_SMPSWAITTIMEMAX_SHIFT;
1103 vdd->vp_reg.vstepmin_stepmin_shift = OMAP4430_VSTEPMIN_SHIFT;
1104 vdd->vp_reg.vstepmax_stepmax_shift = OMAP4430_VSTEPMAX_SHIFT;
1105
1106 /* VLIMITTO bit fields */
1107 timeout_val = (sys_clk_speed * vdd->pmic_info->vp_timeout_us) / 1000;
1108 vdd->vp_reg.vlimitto_timeout = timeout_val;
1109 vdd->vp_reg.vlimitto_vddmin = vdd->pmic_info->vp_vddmin;
1110 vdd->vp_reg.vlimitto_vddmax = vdd->pmic_info->vp_vddmax;
1111 vdd->vp_reg.vlimitto_vddmin_shift = OMAP4430_VDDMIN_SHIFT;
1112 vdd->vp_reg.vlimitto_vddmax_shift = OMAP4430_VDDMAX_SHIFT;
1113 vdd->vp_reg.vlimitto_timeout_shift = OMAP4430_TIMEOUT_SHIFT;
1114
1115 return 0;
1116} 671}
1117 672
1118/* Public functions */ 673/* Public functions */
@@ -1160,8 +715,7 @@ unsigned long omap_vp_get_curr_volt(struct voltagedomain *voltdm)
1160 return 0; 715 return 0;
1161 } 716 }
1162 717
1163 curr_vsel = vdd->read_reg(vdd->vp_reg.prm_mod, 718 curr_vsel = vdd->read_reg(prm_mod_offs, vdd->vp_data->voltage);
1164 vdd->vp_offs.voltage);
1165 719
1166 if (!vdd->pmic_info || !vdd->pmic_info->vsel_to_uv) { 720 if (!vdd->pmic_info || !vdd->pmic_info->vsel_to_uv) {
1167 pr_warning("%s: PMIC function to convert vsel to voltage" 721 pr_warning("%s: PMIC function to convert vsel to voltage"
@@ -1183,7 +737,6 @@ void omap_vp_enable(struct voltagedomain *voltdm)
1183{ 737{
1184 struct omap_vdd_info *vdd; 738 struct omap_vdd_info *vdd;
1185 u32 vpconfig; 739 u32 vpconfig;
1186 u16 mod;
1187 740
1188 if (!voltdm || IS_ERR(voltdm)) { 741 if (!voltdm || IS_ERR(voltdm)) {
1189 pr_warning("%s: VDD specified does not exist!\n", __func__); 742 pr_warning("%s: VDD specified does not exist!\n", __func__);
@@ -1197,8 +750,6 @@ void omap_vp_enable(struct voltagedomain *voltdm)
1197 return; 750 return;
1198 } 751 }
1199 752
1200 mod = vdd->vp_reg.prm_mod;
1201
1202 /* If VP is already enabled, do nothing. Return */ 753 /* If VP is already enabled, do nothing. Return */
1203 if (vdd->vp_enabled) 754 if (vdd->vp_enabled)
1204 return; 755 return;
@@ -1206,9 +757,9 @@ void omap_vp_enable(struct voltagedomain *voltdm)
1206 vp_latch_vsel(vdd); 757 vp_latch_vsel(vdd);
1207 758
1208 /* Enable VP */ 759 /* Enable VP */
1209 vpconfig = vdd->read_reg(mod, vdd->vp_offs.vpconfig); 760 vpconfig = vdd->read_reg(prm_mod_offs, vdd->vp_data->vpconfig);
1210 vpconfig |= vdd->vp_reg.vpconfig_vpenable; 761 vpconfig |= vdd->vp_data->vp_common->vpconfig_vpenable;
1211 vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig); 762 vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig);
1212 vdd->vp_enabled = true; 763 vdd->vp_enabled = true;
1213} 764}
1214 765
@@ -1223,7 +774,6 @@ void omap_vp_disable(struct voltagedomain *voltdm)
1223{ 774{
1224 struct omap_vdd_info *vdd; 775 struct omap_vdd_info *vdd;
1225 u32 vpconfig; 776 u32 vpconfig;
1226 u16 mod;
1227 int timeout; 777 int timeout;
1228 778
1229 if (!voltdm || IS_ERR(voltdm)) { 779 if (!voltdm || IS_ERR(voltdm)) {
@@ -1238,8 +788,6 @@ void omap_vp_disable(struct voltagedomain *voltdm)
1238 return; 788 return;
1239 } 789 }
1240 790
1241 mod = vdd->vp_reg.prm_mod;
1242
1243 /* If VP is already disabled, do nothing. Return */ 791 /* If VP is already disabled, do nothing. Return */
1244 if (!vdd->vp_enabled) { 792 if (!vdd->vp_enabled) {
1245 pr_warning("%s: Trying to disable VP for vdd_%s when" 793 pr_warning("%s: Trying to disable VP for vdd_%s when"
@@ -1248,14 +796,14 @@ void omap_vp_disable(struct voltagedomain *voltdm)
1248 } 796 }
1249 797
1250 /* Disable VP */ 798 /* Disable VP */
1251 vpconfig = vdd->read_reg(mod, vdd->vp_offs.vpconfig); 799 vpconfig = vdd->read_reg(prm_mod_offs, vdd->vp_data->vpconfig);
1252 vpconfig &= ~vdd->vp_reg.vpconfig_vpenable; 800 vpconfig &= ~vdd->vp_data->vp_common->vpconfig_vpenable;
1253 vdd->write_reg(vpconfig, mod, vdd->vp_offs.vpconfig); 801 vdd->write_reg(vpconfig, prm_mod_offs, vdd->vp_data->vpconfig);
1254 802
1255 /* 803 /*
1256 * Wait for VP idle Typical latency is <2us. Maximum latency is ~100us 804 * Wait for VP idle Typical latency is <2us. Maximum latency is ~100us
1257 */ 805 */
1258 omap_test_timeout((vdd->read_reg(mod, vdd->vp_offs.vstatus)), 806 omap_test_timeout((vdd->read_reg(prm_mod_offs, vdd->vp_data->vstatus)),
1259 VP_IDLE_TIMEOUT, timeout); 807 VP_IDLE_TIMEOUT, timeout);
1260 808
1261 if (timeout >= VP_IDLE_TIMEOUT) 809 if (timeout >= VP_IDLE_TIMEOUT)
@@ -1508,8 +1056,8 @@ struct voltagedomain *omap_voltage_domain_lookup(char *name)
1508 } 1056 }
1509 1057
1510 for (i = 0; i < nr_scalable_vdd; i++) { 1058 for (i = 0; i < nr_scalable_vdd; i++) {
1511 if (!(strcmp(name, vdd_info[i].voltdm.name))) 1059 if (!(strcmp(name, vdd_info[i]->voltdm.name)))
1512 return &vdd_info[i].voltdm; 1060 return &vdd_info[i]->voltdm;
1513 } 1061 }
1514 1062
1515 return ERR_PTR(-EINVAL); 1063 return ERR_PTR(-EINVAL);
@@ -1537,35 +1085,24 @@ int __init omap_voltage_late_init(void)
1537 pr_err("%s: Unable to create voltage debugfs main dir\n", 1085 pr_err("%s: Unable to create voltage debugfs main dir\n",
1538 __func__); 1086 __func__);
1539 for (i = 0; i < nr_scalable_vdd; i++) { 1087 for (i = 0; i < nr_scalable_vdd; i++) {
1540 if (vdd_data_configure(&vdd_info[i])) 1088 if (omap_vdd_data_configure(vdd_info[i]))
1541 continue; 1089 continue;
1542 vc_init(&vdd_info[i]); 1090 omap_vc_init(vdd_info[i]);
1543 vp_init(&vdd_info[i]); 1091 vp_init(vdd_info[i]);
1544 vdd_debugfs_init(&vdd_info[i]); 1092 vdd_debugfs_init(vdd_info[i]);
1545 } 1093 }
1546 1094
1547 return 0; 1095 return 0;
1548} 1096}
1549 1097
1550/** 1098/* XXX document */
1551 * omap_voltage_early_init()- Volatage driver early init 1099int __init omap_voltage_early_init(s16 prm_mod, s16 prm_irqst_ocp_mod,
1552 */ 1100 struct omap_vdd_info *omap_vdd_array[],
1553static int __init omap_voltage_early_init(void) 1101 u8 omap_vdd_count)
1554{ 1102{
1555 if (cpu_is_omap34xx()) { 1103 prm_mod_offs = prm_mod;
1556 vdd_info = omap3_vdd_info; 1104 prm_irqst_ocp_mod_offs = prm_irqst_ocp_mod;
1557 nr_scalable_vdd = OMAP3_NR_SCALABLE_VDD; 1105 vdd_info = omap_vdd_array;
1558 vc_init = omap3_vc_init; 1106 nr_scalable_vdd = omap_vdd_count;
1559 vdd_data_configure = omap3_vdd_data_configure;
1560 } else if (cpu_is_omap44xx()) {
1561 vdd_info = omap4_vdd_info;
1562 nr_scalable_vdd = OMAP4_NR_SCALABLE_VDD;
1563 vc_init = omap4_vc_init;
1564 vdd_data_configure = omap4_vdd_data_configure;
1565 } else {
1566 pr_warning("%s: voltage driver support not added\n", __func__);
1567 }
1568
1569 return 0; 1107 return 0;
1570} 1108}
1571core_initcall(omap_voltage_early_init);
diff --git a/arch/arm/plat-omap/include/plat/voltage.h b/arch/arm/mach-omap2/voltage.h
index 5bd204e55c32..e9f5408244e0 100644
--- a/arch/arm/plat-omap/include/plat/voltage.h
+++ b/arch/arm/mach-omap2/voltage.h
@@ -16,6 +16,10 @@
16 16
17#include <linux/err.h> 17#include <linux/err.h>
18 18
19#include "vc.h"
20#include "vp.h"
21
22/* XXX document */
19#define VOLTSCALE_VPFORCEUPDATE 1 23#define VOLTSCALE_VPFORCEUPDATE 1
20#define VOLTSCALE_VCBYPASS 2 24#define VOLTSCALE_VCBYPASS 2
21 25
@@ -27,36 +31,22 @@
27#define OMAP3_VOLTOFFSET 0xff 31#define OMAP3_VOLTOFFSET 0xff
28#define OMAP3_VOLTSETUP2 0xff 32#define OMAP3_VOLTSETUP2 0xff
29 33
30/* Voltage value defines */ 34/**
31#define OMAP3430_VDD_MPU_OPP1_UV 975000 35 * struct omap_vfsm_instance_data - per-voltage manager FSM register/bitfield
32#define OMAP3430_VDD_MPU_OPP2_UV 1075000 36 * data
33#define OMAP3430_VDD_MPU_OPP3_UV 1200000 37 * @voltsetup_mask: SETUP_TIME* bitmask in the PRM_VOLTSETUP* register
34#define OMAP3430_VDD_MPU_OPP4_UV 1270000 38 * @voltsetup_reg: register offset of PRM_VOLTSETUP from PRM base
35#define OMAP3430_VDD_MPU_OPP5_UV 1350000 39 * @voltsetup_shift: SETUP_TIME* field shift in the PRM_VOLTSETUP* register
36 40 *
37#define OMAP3430_VDD_CORE_OPP1_UV 975000 41 * XXX What about VOLTOFFSET/VOLTCTRL?
38#define OMAP3430_VDD_CORE_OPP2_UV 1050000 42 * XXX It is not necessary to have both a _mask and a _shift for the same
39#define OMAP3430_VDD_CORE_OPP3_UV 1150000 43 * bitfield - remove one!
40 44 */
41#define OMAP3630_VDD_MPU_OPP50_UV 1012500 45struct omap_vfsm_instance_data {
42#define OMAP3630_VDD_MPU_OPP100_UV 1200000 46 u32 voltsetup_mask;
43#define OMAP3630_VDD_MPU_OPP120_UV 1325000 47 u8 voltsetup_reg;
44#define OMAP3630_VDD_MPU_OPP1G_UV 1375000 48 u8 voltsetup_shift;
45 49};
46#define OMAP3630_VDD_CORE_OPP50_UV 1000000
47#define OMAP3630_VDD_CORE_OPP100_UV 1200000
48
49#define OMAP4430_VDD_MPU_OPP50_UV 930000
50#define OMAP4430_VDD_MPU_OPP100_UV 1100000
51#define OMAP4430_VDD_MPU_OPPTURBO_UV 1260000
52#define OMAP4430_VDD_MPU_OPPNITRO_UV 1350000
53
54#define OMAP4430_VDD_IVA_OPP50_UV 930000
55#define OMAP4430_VDD_IVA_OPP100_UV 1100000
56#define OMAP4430_VDD_IVA_OPPTURBO_UV 1260000
57
58#define OMAP4430_VDD_CORE_OPP50_UV 930000
59#define OMAP4430_VDD_CORE_OPP100_UV 1100000
60 50
61/** 51/**
62 * struct voltagedomain - omap voltage domain global structure. 52 * struct voltagedomain - omap voltage domain global structure.
@@ -113,6 +103,42 @@ struct omap_volt_pmic_info {
113 u8 (*uv_to_vsel) (unsigned long uV); 103 u8 (*uv_to_vsel) (unsigned long uV);
114}; 104};
115 105
106/**
107 * omap_vdd_info - Per Voltage Domain info
108 *
109 * @volt_data : voltage table having the distinct voltages supported
110 * by the domain and other associated per voltage data.
111 * @pmic_info : pmic specific parameters which should be populted by
112 * the pmic drivers.
113 * @vp_data : the register values, shifts, masks for various
114 * vp registers
115 * @vp_rt_data : VP data derived at runtime, not predefined
116 * @vc_data : structure containing various various vc registers,
117 * shifts, masks etc.
118 * @vfsm : voltage manager FSM data
119 * @voltdm : pointer to the voltage domain structure
120 * @debug_dir : debug directory for this voltage domain.
121 * @curr_volt : current voltage for this vdd.
122 * @vp_enabled : flag to keep track of whether vp is enabled or not
123 * @volt_scale : API to scale the voltage of the vdd.
124 */
125struct omap_vdd_info {
126 struct omap_volt_data *volt_data;
127 struct omap_volt_pmic_info *pmic_info;
128 struct omap_vp_instance_data *vp_data;
129 struct omap_vp_runtime_data vp_rt_data;
130 struct omap_vc_instance_data *vc_data;
131 const struct omap_vfsm_instance_data *vfsm;
132 struct voltagedomain voltdm;
133 struct dentry *debug_dir;
134 u32 curr_volt;
135 bool vp_enabled;
136 u32 (*read_reg) (u16 mod, u8 offset);
137 void (*write_reg) (u32 val, u16 mod, u8 offset);
138 int (*volt_scale) (struct omap_vdd_info *vdd,
139 unsigned long target_volt);
140};
141
116unsigned long omap_vp_get_curr_volt(struct voltagedomain *voltdm); 142unsigned long omap_vp_get_curr_volt(struct voltagedomain *voltdm);
117void omap_vp_enable(struct voltagedomain *voltdm); 143void omap_vp_enable(struct voltagedomain *voltdm);
118void omap_vp_disable(struct voltagedomain *voltdm); 144void omap_vp_disable(struct voltagedomain *voltdm);
@@ -125,6 +151,9 @@ struct omap_volt_data *omap_voltage_get_voltdata(struct voltagedomain *voltdm,
125 unsigned long volt); 151 unsigned long volt);
126unsigned long omap_voltage_get_nom_volt(struct voltagedomain *voltdm); 152unsigned long omap_voltage_get_nom_volt(struct voltagedomain *voltdm);
127struct dentry *omap_voltage_get_dbgdir(struct voltagedomain *voltdm); 153struct dentry *omap_voltage_get_dbgdir(struct voltagedomain *voltdm);
154int __init omap_voltage_early_init(s16 prm_mod, s16 prm_irqst_mod,
155 struct omap_vdd_info *omap_vdd_array[],
156 u8 omap_vdd_count);
128#ifdef CONFIG_PM 157#ifdef CONFIG_PM
129int omap_voltage_register_pmic(struct voltagedomain *voltdm, 158int omap_voltage_register_pmic(struct voltagedomain *voltdm,
130 struct omap_volt_pmic_info *pmic_info); 159 struct omap_volt_pmic_info *pmic_info);
diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
new file mode 100644
index 000000000000..def230fd2fde
--- /dev/null
+++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
@@ -0,0 +1,95 @@
1/*
2 * OMAP3 voltage domain data
3 *
4 * Copyright (C) 2007, 2010 Texas Instruments, Inc.
5 * Rajendra Nayak <rnayak@ti.com>
6 * Lesly A M <x0080970@ti.com>
7 * Thara Gopinath <thara@ti.com>
8 *
9 * Copyright (C) 2008, 2011 Nokia Corporation
10 * Kalle Jokiniemi
11 * Paul Walmsley
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#include <linux/kernel.h>
18#include <linux/err.h>
19#include <linux/init.h>
20
21#include <plat/common.h>
22#include <plat/cpu.h>
23
24#include "prm-regbits-34xx.h"
25#include "omap_opp_data.h"
26#include "voltage.h"
27#include "vc.h"
28#include "vp.h"
29
30/*
31 * VDD data
32 */
33
34static const struct omap_vfsm_instance_data omap3_vdd1_vfsm_data = {
35 .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET,
36 .voltsetup_shift = OMAP3430_SETUP_TIME1_SHIFT,
37 .voltsetup_mask = OMAP3430_SETUP_TIME1_MASK,
38};
39
40static struct omap_vdd_info omap3_vdd1_info = {
41 .vp_data = &omap3_vp1_data,
42 .vc_data = &omap3_vc1_data,
43 .vfsm = &omap3_vdd1_vfsm_data,
44 .voltdm = {
45 .name = "mpu",
46 },
47};
48
49static const struct omap_vfsm_instance_data omap3_vdd2_vfsm_data = {
50 .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET,
51 .voltsetup_shift = OMAP3430_SETUP_TIME2_SHIFT,
52 .voltsetup_mask = OMAP3430_SETUP_TIME2_MASK,
53};
54
55static struct omap_vdd_info omap3_vdd2_info = {
56 .vp_data = &omap3_vp2_data,
57 .vc_data = &omap3_vc2_data,
58 .vfsm = &omap3_vdd2_vfsm_data,
59 .voltdm = {
60 .name = "core",
61 },
62};
63
64/* OMAP3 VDD structures */
65static struct omap_vdd_info *omap3_vdd_info[] = {
66 &omap3_vdd1_info,
67 &omap3_vdd2_info,
68};
69
70/* OMAP3 specific voltage init functions */
71static int __init omap3xxx_voltage_early_init(void)
72{
73 s16 prm_mod = OMAP3430_GR_MOD;
74 s16 prm_irqst_ocp_mod = OCP_MOD;
75
76 if (!cpu_is_omap34xx())
77 return 0;
78
79 /*
80 * XXX Will depend on the process, validation, and binning
81 * for the currently-running IC
82 */
83 if (cpu_is_omap3630()) {
84 omap3_vdd1_info.volt_data = omap36xx_vddmpu_volt_data;
85 omap3_vdd2_info.volt_data = omap36xx_vddcore_volt_data;
86 } else {
87 omap3_vdd1_info.volt_data = omap34xx_vddmpu_volt_data;
88 omap3_vdd2_info.volt_data = omap34xx_vddcore_volt_data;
89 }
90
91 return omap_voltage_early_init(prm_mod, prm_irqst_ocp_mod,
92 omap3_vdd_info,
93 ARRAY_SIZE(omap3_vdd_info));
94};
95core_initcall(omap3xxx_voltage_early_init);
diff --git a/arch/arm/mach-omap2/voltagedomains44xx_data.c b/arch/arm/mach-omap2/voltagedomains44xx_data.c
new file mode 100644
index 000000000000..cb64996de0e1
--- /dev/null
+++ b/arch/arm/mach-omap2/voltagedomains44xx_data.c
@@ -0,0 +1,102 @@
1/*
2 * OMAP3/OMAP4 Voltage Management Routines
3 *
4 * Author: Thara Gopinath <thara@ti.com>
5 *
6 * Copyright (C) 2007 Texas Instruments, Inc.
7 * Rajendra Nayak <rnayak@ti.com>
8 * Lesly A M <x0080970@ti.com>
9 *
10 * Copyright (C) 2008 Nokia Corporation
11 * Kalle Jokiniemi
12 *
13 * Copyright (C) 2010 Texas Instruments, Inc.
14 * Thara Gopinath <thara@ti.com>
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License version 2 as
18 * published by the Free Software Foundation.
19 */
20#include <linux/kernel.h>
21#include <linux/err.h>
22#include <linux/init.h>
23
24#include <plat/common.h>
25
26#include "prm-regbits-44xx.h"
27#include "prm44xx.h"
28#include "prcm44xx.h"
29#include "prminst44xx.h"
30#include "voltage.h"
31#include "omap_opp_data.h"
32#include "vc.h"
33#include "vp.h"
34
35static const struct omap_vfsm_instance_data omap4_vdd_mpu_vfsm_data = {
36 .voltsetup_reg = OMAP4_PRM_VOLTSETUP_MPU_RET_SLEEP_OFFSET,
37};
38
39static struct omap_vdd_info omap4_vdd_mpu_info = {
40 .vp_data = &omap4_vp_mpu_data,
41 .vc_data = &omap4_vc_mpu_data,
42 .vfsm = &omap4_vdd_mpu_vfsm_data,
43 .voltdm = {
44 .name = "mpu",
45 },
46};
47
48static const struct omap_vfsm_instance_data omap4_vdd_iva_vfsm_data = {
49 .voltsetup_reg = OMAP4_PRM_VOLTSETUP_IVA_RET_SLEEP_OFFSET,
50};
51
52static struct omap_vdd_info omap4_vdd_iva_info = {
53 .vp_data = &omap4_vp_iva_data,
54 .vc_data = &omap4_vc_iva_data,
55 .vfsm = &omap4_vdd_iva_vfsm_data,
56 .voltdm = {
57 .name = "iva",
58 },
59};
60
61static const struct omap_vfsm_instance_data omap4_vdd_core_vfsm_data = {
62 .voltsetup_reg = OMAP4_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET,
63};
64
65static struct omap_vdd_info omap4_vdd_core_info = {
66 .vp_data = &omap4_vp_core_data,
67 .vc_data = &omap4_vc_core_data,
68 .vfsm = &omap4_vdd_core_vfsm_data,
69 .voltdm = {
70 .name = "core",
71 },
72};
73
74/* OMAP4 VDD structures */
75static struct omap_vdd_info *omap4_vdd_info[] = {
76 &omap4_vdd_mpu_info,
77 &omap4_vdd_iva_info,
78 &omap4_vdd_core_info,
79};
80
81/* OMAP4 specific voltage init functions */
82static int __init omap44xx_voltage_early_init(void)
83{
84 s16 prm_mod = OMAP4430_PRM_DEVICE_INST;
85 s16 prm_irqst_ocp_mod = OMAP4430_PRM_OCP_SOCKET_INST;
86
87 if (!cpu_is_omap44xx())
88 return 0;
89
90 /*
91 * XXX Will depend on the process, validation, and binning
92 * for the currently-running IC
93 */
94 omap4_vdd_mpu_info.volt_data = omap44xx_vdd_mpu_volt_data;
95 omap4_vdd_iva_info.volt_data = omap44xx_vdd_iva_volt_data;
96 omap4_vdd_core_info.volt_data = omap44xx_vdd_core_volt_data;
97
98 return omap_voltage_early_init(prm_mod, prm_irqst_ocp_mod,
99 omap4_vdd_info,
100 ARRAY_SIZE(omap4_vdd_info));
101};
102core_initcall(omap44xx_voltage_early_init);
diff --git a/arch/arm/mach-omap2/vp.h b/arch/arm/mach-omap2/vp.h
new file mode 100644
index 000000000000..7ce134f7de79
--- /dev/null
+++ b/arch/arm/mach-omap2/vp.h
@@ -0,0 +1,143 @@
1/*
2 * OMAP3/4 Voltage Processor (VP) structure and macro definitions
3 *
4 * Copyright (C) 2007, 2010 Texas Instruments, Inc.
5 * Rajendra Nayak <rnayak@ti.com>
6 * Lesly A M <x0080970@ti.com>
7 * Thara Gopinath <thara@ti.com>
8 *
9 * Copyright (C) 2008, 2011 Nokia Corporation
10 * Kalle Jokiniemi
11 * Paul Walmsley
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License version
15 * 2 as published by the Free Software Foundation.
16 */
17#ifndef __ARCH_ARM_MACH_OMAP2_VP_H
18#define __ARCH_ARM_MACH_OMAP2_VP_H
19
20#include <linux/kernel.h>
21
22/* XXX document */
23#define VP_IDLE_TIMEOUT 200
24#define VP_TRANXDONE_TIMEOUT 300
25
26
27/**
28 * struct omap_vp_common_data - register data common to all VDDs
29 * @vpconfig_errorgain_mask: ERRORGAIN bitmask in the PRM_VP*_CONFIG reg
30 * @vpconfig_initvoltage_mask: INITVOLTAGE bitmask in the PRM_VP*_CONFIG reg
31 * @vpconfig_timeouten_mask: TIMEOUT bitmask in the PRM_VP*_CONFIG reg
32 * @vpconfig_initvdd: INITVDD bitmask in the PRM_VP*_CONFIG reg
33 * @vpconfig_forceupdate: FORCEUPDATE bitmask in the PRM_VP*_CONFIG reg
34 * @vpconfig_vpenable: VPENABLE bitmask in the PRM_VP*_CONFIG reg
35 * @vpconfig_erroroffset_shift: ERROROFFSET field shift in PRM_VP*_CONFIG reg
36 * @vpconfig_errorgain_shift: ERRORGAIN field shift in PRM_VP*_CONFIG reg
37 * @vpconfig_initvoltage_shift: INITVOLTAGE field shift in PRM_VP*_CONFIG reg
38 * @vpconfig_stepmin_shift: VSTEPMIN field shift in the PRM_VP*_VSTEPMIN reg
39 * @vpconfig_smpswaittimemin_shift: SMPSWAITTIMEMIN field shift in PRM_VP*_VSTEPMIN reg
40 * @vpconfig_stepmax_shift: VSTEPMAX field shift in the PRM_VP*_VSTEPMAX reg
41 * @vpconfig_smpswaittimemax_shift: SMPSWAITTIMEMAX field shift in PRM_VP*_VSTEPMAX reg
42 * @vpconfig_vlimitto_vddmin_shift: VDDMIN field shift in PRM_VP*_VLIMITTO reg
43 * @vpconfig_vlimitto_vddmax_shift: VDDMAX field shift in PRM_VP*_VLIMITTO reg
44 * @vpconfig_vlimitto_timeout_shift: TIMEOUT field shift in PRM_VP*_VLIMITTO reg
45 *
46 * XXX It it not necessary to have both a mask and a shift for the same
47 * bitfield - remove one
48 * XXX Many of these fields are wrongly named -- e.g., vpconfig_smps* -- fix!
49 */
50struct omap_vp_common_data {
51 u32 vpconfig_errorgain_mask;
52 u32 vpconfig_initvoltage_mask;
53 u32 vpconfig_timeouten;
54 u32 vpconfig_initvdd;
55 u32 vpconfig_forceupdate;
56 u32 vpconfig_vpenable;
57 u8 vpconfig_erroroffset_shift;
58 u8 vpconfig_errorgain_shift;
59 u8 vpconfig_initvoltage_shift;
60 u8 vstepmin_stepmin_shift;
61 u8 vstepmin_smpswaittimemin_shift;
62 u8 vstepmax_stepmax_shift;
63 u8 vstepmax_smpswaittimemax_shift;
64 u8 vlimitto_vddmin_shift;
65 u8 vlimitto_vddmax_shift;
66 u8 vlimitto_timeout_shift;
67};
68
69/**
70 * struct omap_vp_prm_irqst_data - PRM_IRQSTATUS_MPU.VP_TRANXDONE_ST data
71 * @prm_irqst_reg: reg offset for PRM_IRQSTATUS_MPU from top of PRM
72 * @tranxdone_status: VP_TRANXDONE_ST bitmask in PRM_IRQSTATUS_MPU reg
73 *
74 * XXX prm_irqst_reg does not belong here
75 * XXX Note that on OMAP3, VP_TRANXDONE interrupt may not work due to a
76 * hardware bug
77 * XXX This structure is probably not needed
78 */
79struct omap_vp_prm_irqst_data {
80 u8 prm_irqst_reg;
81 u32 tranxdone_status;
82};
83
84/**
85 * struct omap_vp_instance_data - VP register offsets (per-VDD)
86 * @vp_common: pointer to struct omap_vp_common_data * for this SoC
87 * @prm_irqst_data: pointer to struct omap_vp_prm_irqst_data for this VDD
88 * @vpconfig: PRM_VP*_CONFIG reg offset from PRM start
89 * @vstepmin: PRM_VP*_VSTEPMIN reg offset from PRM start
90 * @vlimitto: PRM_VP*_VLIMITTO reg offset from PRM start
91 * @vstatus: PRM_VP*_VSTATUS reg offset from PRM start
92 * @voltage: PRM_VP*_VOLTAGE reg offset from PRM start
93 *
94 * XXX vp_common is probably not needed since it is per-SoC
95 */
96struct omap_vp_instance_data {
97 const struct omap_vp_common_data *vp_common;
98 const struct omap_vp_prm_irqst_data *prm_irqst_data;
99 u8 vpconfig;
100 u8 vstepmin;
101 u8 vstepmax;
102 u8 vlimitto;
103 u8 vstatus;
104 u8 voltage;
105};
106
107/**
108 * struct omap_vp_runtime_data - VP data populated at runtime by code
109 * @vpconfig_erroroffset: value of ERROROFFSET bitfield in PRM_VP*_CONFIG
110 * @vpconfig_errorgain: value of ERRORGAIN bitfield in PRM_VP*_CONFIG
111 * @vstepmin_smpswaittimemin: value of SMPSWAITTIMEMIN bitfield in PRM_VP*_VSTEPMIN
112 * @vstepmax_smpswaittimemax: value of SMPSWAITTIMEMAX bitfield in PRM_VP*_VSTEPMAX
113 * @vlimitto_timeout: value of TIMEOUT bitfield in PRM_VP*_VLIMITTO
114 * @vstepmin_stepmin: value of VSTEPMIN bitfield in PRM_VP*_VSTEPMIN
115 * @vstepmax_stepmax: value of VSTEPMAX bitfield in PRM_VP*_VSTEPMAX
116 * @vlimitto_vddmin: value of VDDMIN bitfield in PRM_VP*_VLIMITTO
117 * @vlimitto_vddmax: value of VDDMAX bitfield in PRM_VP*_VLIMITTO
118 *
119 * XXX Is this structure really needed? Why not just program the
120 * device directly? They are in PRM space, therefore in the WKUP
121 * powerdomain, so register contents should not be lost in off-mode.
122 * XXX Some of these fields are incorrectly named, e.g., vstep*
123 */
124struct omap_vp_runtime_data {
125 u32 vpconfig_erroroffset;
126 u16 vpconfig_errorgain;
127 u16 vstepmin_smpswaittimemin;
128 u16 vstepmax_smpswaittimemax;
129 u16 vlimitto_timeout;
130 u8 vstepmin_stepmin;
131 u8 vstepmax_stepmax;
132 u8 vlimitto_vddmin;
133 u8 vlimitto_vddmax;
134};
135
136extern struct omap_vp_instance_data omap3_vp1_data;
137extern struct omap_vp_instance_data omap3_vp2_data;
138
139extern struct omap_vp_instance_data omap4_vp_mpu_data;
140extern struct omap_vp_instance_data omap4_vp_iva_data;
141extern struct omap_vp_instance_data omap4_vp_core_data;
142
143#endif
diff --git a/arch/arm/mach-omap2/vp3xxx_data.c b/arch/arm/mach-omap2/vp3xxx_data.c
new file mode 100644
index 000000000000..645217094e51
--- /dev/null
+++ b/arch/arm/mach-omap2/vp3xxx_data.c
@@ -0,0 +1,82 @@
1/*
2 * OMAP3 Voltage Processor (VP) data
3 *
4 * Copyright (C) 2007, 2010 Texas Instruments, Inc.
5 * Rajendra Nayak <rnayak@ti.com>
6 * Lesly A M <x0080970@ti.com>
7 * Thara Gopinath <thara@ti.com>
8 *
9 * Copyright (C) 2008, 2011 Nokia Corporation
10 * Kalle Jokiniemi
11 * Paul Walmsley
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
18#include <linux/io.h>
19#include <linux/err.h>
20#include <linux/init.h>
21
22#include <plat/common.h>
23
24#include "prm-regbits-34xx.h"
25#include "voltage.h"
26
27#include "vp.h"
28
29/*
30 * VP data common to 34xx/36xx chips
31 * XXX This stuff presumably belongs in the vp3xxx.c or vp.c file.
32 */
33static const struct omap_vp_common_data omap3_vp_common = {
34 .vpconfig_erroroffset_shift = OMAP3430_ERROROFFSET_SHIFT,
35 .vpconfig_errorgain_mask = OMAP3430_ERRORGAIN_MASK,
36 .vpconfig_errorgain_shift = OMAP3430_ERRORGAIN_SHIFT,
37 .vpconfig_initvoltage_shift = OMAP3430_INITVOLTAGE_SHIFT,
38 .vpconfig_initvoltage_mask = OMAP3430_INITVOLTAGE_MASK,
39 .vpconfig_timeouten = OMAP3430_TIMEOUTEN_MASK,
40 .vpconfig_initvdd = OMAP3430_INITVDD_MASK,
41 .vpconfig_forceupdate = OMAP3430_FORCEUPDATE_MASK,
42 .vpconfig_vpenable = OMAP3430_VPENABLE_MASK,
43 .vstepmin_smpswaittimemin_shift = OMAP3430_SMPSWAITTIMEMIN_SHIFT,
44 .vstepmax_smpswaittimemax_shift = OMAP3430_SMPSWAITTIMEMAX_SHIFT,
45 .vstepmin_stepmin_shift = OMAP3430_VSTEPMIN_SHIFT,
46 .vstepmax_stepmax_shift = OMAP3430_VSTEPMAX_SHIFT,
47 .vlimitto_vddmin_shift = OMAP3430_VDDMIN_SHIFT,
48 .vlimitto_vddmax_shift = OMAP3430_VDDMAX_SHIFT,
49 .vlimitto_timeout_shift = OMAP3430_TIMEOUT_SHIFT,
50};
51
52static const struct omap_vp_prm_irqst_data omap3_vp1_prm_irqst_data = {
53 .prm_irqst_reg = OMAP3_PRM_IRQSTATUS_MPU_OFFSET,
54 .tranxdone_status = OMAP3430_VP1_TRANXDONE_ST_MASK,
55};
56
57struct omap_vp_instance_data omap3_vp1_data = {
58 .vp_common = &omap3_vp_common,
59 .vpconfig = OMAP3_PRM_VP1_CONFIG_OFFSET,
60 .vstepmin = OMAP3_PRM_VP1_VSTEPMIN_OFFSET,
61 .vstepmax = OMAP3_PRM_VP1_VSTEPMAX_OFFSET,
62 .vlimitto = OMAP3_PRM_VP1_VLIMITTO_OFFSET,
63 .vstatus = OMAP3_PRM_VP1_STATUS_OFFSET,
64 .voltage = OMAP3_PRM_VP1_VOLTAGE_OFFSET,
65 .prm_irqst_data = &omap3_vp1_prm_irqst_data,
66};
67
68static const struct omap_vp_prm_irqst_data omap3_vp2_prm_irqst_data = {
69 .prm_irqst_reg = OMAP3_PRM_IRQSTATUS_MPU_OFFSET,
70 .tranxdone_status = OMAP3430_VP2_TRANXDONE_ST_MASK,
71};
72
73struct omap_vp_instance_data omap3_vp2_data = {
74 .vp_common = &omap3_vp_common,
75 .vpconfig = OMAP3_PRM_VP2_CONFIG_OFFSET,
76 .vstepmin = OMAP3_PRM_VP2_VSTEPMIN_OFFSET,
77 .vstepmax = OMAP3_PRM_VP2_VSTEPMAX_OFFSET,
78 .vlimitto = OMAP3_PRM_VP2_VLIMITTO_OFFSET,
79 .vstatus = OMAP3_PRM_VP2_STATUS_OFFSET,
80 .voltage = OMAP3_PRM_VP2_VOLTAGE_OFFSET,
81 .prm_irqst_data = &omap3_vp2_prm_irqst_data,
82};
diff --git a/arch/arm/mach-omap2/vp44xx_data.c b/arch/arm/mach-omap2/vp44xx_data.c
new file mode 100644
index 000000000000..65d1ad63800a
--- /dev/null
+++ b/arch/arm/mach-omap2/vp44xx_data.c
@@ -0,0 +1,100 @@
1/*
2 * OMAP3 Voltage Processor (VP) data
3 *
4 * Copyright (C) 2007, 2010 Texas Instruments, Inc.
5 * Rajendra Nayak <rnayak@ti.com>
6 * Lesly A M <x0080970@ti.com>
7 * Thara Gopinath <thara@ti.com>
8 *
9 * Copyright (C) 2008, 2011 Nokia Corporation
10 * Kalle Jokiniemi
11 * Paul Walmsley
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
18#include <linux/io.h>
19#include <linux/err.h>
20#include <linux/init.h>
21
22#include <plat/common.h>
23
24#include "prm44xx.h"
25#include "prm-regbits-44xx.h"
26#include "voltage.h"
27
28#include "vp.h"
29
30/*
31 * VP data common to 44xx chips
32 * XXX This stuff presumably belongs in the vp44xx.c or vp.c file.
33 */
34static const struct omap_vp_common_data omap4_vp_common = {
35 .vpconfig_erroroffset_shift = OMAP4430_ERROROFFSET_SHIFT,
36 .vpconfig_errorgain_mask = OMAP4430_ERRORGAIN_MASK,
37 .vpconfig_errorgain_shift = OMAP4430_ERRORGAIN_SHIFT,
38 .vpconfig_initvoltage_shift = OMAP4430_INITVOLTAGE_SHIFT,
39 .vpconfig_initvoltage_mask = OMAP4430_INITVOLTAGE_MASK,
40 .vpconfig_timeouten = OMAP4430_TIMEOUTEN_MASK,
41 .vpconfig_initvdd = OMAP4430_INITVDD_MASK,
42 .vpconfig_forceupdate = OMAP4430_FORCEUPDATE_MASK,
43 .vpconfig_vpenable = OMAP4430_VPENABLE_MASK,
44 .vstepmin_smpswaittimemin_shift = OMAP4430_SMPSWAITTIMEMIN_SHIFT,
45 .vstepmax_smpswaittimemax_shift = OMAP4430_SMPSWAITTIMEMAX_SHIFT,
46 .vstepmin_stepmin_shift = OMAP4430_VSTEPMIN_SHIFT,
47 .vstepmax_stepmax_shift = OMAP4430_VSTEPMAX_SHIFT,
48 .vlimitto_vddmin_shift = OMAP4430_VDDMIN_SHIFT,
49 .vlimitto_vddmax_shift = OMAP4430_VDDMAX_SHIFT,
50 .vlimitto_timeout_shift = OMAP4430_TIMEOUT_SHIFT,
51};
52
53static const struct omap_vp_prm_irqst_data omap4_vp_mpu_prm_irqst_data = {
54 .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET,
55 .tranxdone_status = OMAP4430_VP_MPU_TRANXDONE_ST_MASK,
56};
57
58struct omap_vp_instance_data omap4_vp_mpu_data = {
59 .vp_common = &omap4_vp_common,
60 .vpconfig = OMAP4_PRM_VP_MPU_CONFIG_OFFSET,
61 .vstepmin = OMAP4_PRM_VP_MPU_VSTEPMIN_OFFSET,
62 .vstepmax = OMAP4_PRM_VP_MPU_VSTEPMAX_OFFSET,
63 .vlimitto = OMAP4_PRM_VP_MPU_VLIMITTO_OFFSET,
64 .vstatus = OMAP4_PRM_VP_MPU_STATUS_OFFSET,
65 .voltage = OMAP4_PRM_VP_MPU_VOLTAGE_OFFSET,
66 .prm_irqst_data = &omap4_vp_mpu_prm_irqst_data,
67};
68
69static const struct omap_vp_prm_irqst_data omap4_vp_iva_prm_irqst_data = {
70 .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET,
71 .tranxdone_status = OMAP4430_VP_IVA_TRANXDONE_ST_MASK,
72};
73
74struct omap_vp_instance_data omap4_vp_iva_data = {
75 .vp_common = &omap4_vp_common,
76 .vpconfig = OMAP4_PRM_VP_IVA_CONFIG_OFFSET,
77 .vstepmin = OMAP4_PRM_VP_IVA_VSTEPMIN_OFFSET,
78 .vstepmax = OMAP4_PRM_VP_IVA_VSTEPMAX_OFFSET,
79 .vlimitto = OMAP4_PRM_VP_IVA_VLIMITTO_OFFSET,
80 .vstatus = OMAP4_PRM_VP_IVA_STATUS_OFFSET,
81 .voltage = OMAP4_PRM_VP_IVA_VOLTAGE_OFFSET,
82 .prm_irqst_data = &omap4_vp_iva_prm_irqst_data,
83};
84
85static const struct omap_vp_prm_irqst_data omap4_vp_core_prm_irqst_data = {
86 .prm_irqst_reg = OMAP4_PRM_IRQSTATUS_MPU_OFFSET,
87 .tranxdone_status = OMAP4430_VP_CORE_TRANXDONE_ST_MASK,
88};
89
90struct omap_vp_instance_data omap4_vp_core_data = {
91 .vp_common = &omap4_vp_common,
92 .vpconfig = OMAP4_PRM_VP_CORE_CONFIG_OFFSET,
93 .vstepmin = OMAP4_PRM_VP_CORE_VSTEPMIN_OFFSET,
94 .vstepmax = OMAP4_PRM_VP_CORE_VSTEPMAX_OFFSET,
95 .vlimitto = OMAP4_PRM_VP_CORE_VLIMITTO_OFFSET,
96 .vstatus = OMAP4_PRM_VP_CORE_STATUS_OFFSET,
97 .voltage = OMAP4_PRM_VP_CORE_VOLTAGE_OFFSET,
98 .prm_irqst_data = &omap4_vp_core_prm_irqst_data,
99};
100
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index 8dc2c76d2260..986c3bf4e6b8 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -26,6 +26,7 @@
26#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
27#include <asm/mach/map.h> 27#include <asm/mach/map.h>
28#include <asm/mach/time.h> 28#include <asm/mach/time.h>
29#include <mach/bridge-regs.h>
29#include <mach/hardware.h> 30#include <mach/hardware.h>
30#include <mach/orion5x.h> 31#include <mach/orion5x.h>
31#include <plat/ehci-orion.h> 32#include <plat/ehci-orion.h>
@@ -599,6 +600,11 @@ void __init orion5x_wdt_init(void)
599/***************************************************************************** 600/*****************************************************************************
600 * Time handling 601 * Time handling
601 ****************************************************************************/ 602 ****************************************************************************/
603void __init orion5x_init_early(void)
604{
605 orion_time_set_base(TIMER_VIRT_BASE);
606}
607
602int orion5x_tclk; 608int orion5x_tclk;
603 609
604int __init orion5x_find_tclk(void) 610int __init orion5x_find_tclk(void)
@@ -616,7 +622,9 @@ int __init orion5x_find_tclk(void)
616static void orion5x_timer_init(void) 622static void orion5x_timer_init(void)
617{ 623{
618 orion5x_tclk = orion5x_find_tclk(); 624 orion5x_tclk = orion5x_find_tclk();
619 orion_time_init(IRQ_ORION5X_BRIDGE, orion5x_tclk); 625
626 orion_time_init(ORION5X_BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR,
627 IRQ_ORION5X_BRIDGE, orion5x_tclk);
620} 628}
621 629
622struct sys_timer orion5x_timer = { 630struct sys_timer orion5x_timer = {
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h
index 8f004503c96d..f2b2b35e8646 100644
--- a/arch/arm/mach-orion5x/common.h
+++ b/arch/arm/mach-orion5x/common.h
@@ -9,6 +9,7 @@ struct mv_sata_platform_data;
9 * Basic Orion init functions used early by machine-setup. 9 * Basic Orion init functions used early by machine-setup.
10 */ 10 */
11void orion5x_map_io(void); 11void orion5x_map_io(void);
12void orion5x_init_early(void);
12void orion5x_init_irq(void); 13void orion5x_init_irq(void);
13void orion5x_init(void); 14void orion5x_init(void);
14extern int orion5x_tclk; 15extern int orion5x_tclk;
diff --git a/arch/arm/mach-orion5x/d2net-setup.c b/arch/arm/mach-orion5x/d2net-setup.c
index b1c451f5ee27..425807579303 100644
--- a/arch/arm/mach-orion5x/d2net-setup.c
+++ b/arch/arm/mach-orion5x/d2net-setup.c
@@ -339,6 +339,7 @@ MACHINE_START(D2NET, "LaCie d2 Network")
339 .boot_params = 0x00000100, 339 .boot_params = 0x00000100,
340 .init_machine = d2net_init, 340 .init_machine = d2net_init,
341 .map_io = orion5x_map_io, 341 .map_io = orion5x_map_io,
342 .init_early = orion5x_init_early,
342 .init_irq = orion5x_init_irq, 343 .init_irq = orion5x_init_irq,
343 .timer = &orion5x_timer, 344 .timer = &orion5x_timer,
344 .fixup = tag_fixup_mem32, 345 .fixup = tag_fixup_mem32,
@@ -350,6 +351,7 @@ MACHINE_START(BIGDISK, "LaCie Big Disk Network")
350 .boot_params = 0x00000100, 351 .boot_params = 0x00000100,
351 .init_machine = d2net_init, 352 .init_machine = d2net_init,
352 .map_io = orion5x_map_io, 353 .map_io = orion5x_map_io,
354 .init_early = orion5x_init_early,
353 .init_irq = orion5x_init_irq, 355 .init_irq = orion5x_init_irq,
354 .timer = &orion5x_timer, 356 .timer = &orion5x_timer,
355 .fixup = tag_fixup_mem32, 357 .fixup = tag_fixup_mem32,
diff --git a/arch/arm/mach-orion5x/db88f5281-setup.c b/arch/arm/mach-orion5x/db88f5281-setup.c
index df1083f5b6eb..c10a11715376 100644
--- a/arch/arm/mach-orion5x/db88f5281-setup.c
+++ b/arch/arm/mach-orion5x/db88f5281-setup.c
@@ -361,6 +361,7 @@ MACHINE_START(DB88F5281, "Marvell Orion-2 Development Board")
361 .boot_params = 0x00000100, 361 .boot_params = 0x00000100,
362 .init_machine = db88f5281_init, 362 .init_machine = db88f5281_init,
363 .map_io = orion5x_map_io, 363 .map_io = orion5x_map_io,
364 .init_early = orion5x_init_early,
364 .init_irq = orion5x_init_irq, 365 .init_irq = orion5x_init_irq,
365 .timer = &orion5x_timer, 366 .timer = &orion5x_timer,
366MACHINE_END 367MACHINE_END
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
index 3a7bc0e36982..90ab022eabeb 100644
--- a/arch/arm/mach-orion5x/dns323-setup.c
+++ b/arch/arm/mach-orion5x/dns323-setup.c
@@ -733,6 +733,7 @@ MACHINE_START(DNS323, "D-Link DNS-323")
733 .boot_params = 0x00000100, 733 .boot_params = 0x00000100,
734 .init_machine = dns323_init, 734 .init_machine = dns323_init,
735 .map_io = orion5x_map_io, 735 .map_io = orion5x_map_io,
736 .init_early = orion5x_init_early,
736 .init_irq = orion5x_init_irq, 737 .init_irq = orion5x_init_irq,
737 .timer = &orion5x_timer, 738 .timer = &orion5x_timer,
738 .fixup = tag_fixup_mem32, 739 .fixup = tag_fixup_mem32,
diff --git a/arch/arm/mach-orion5x/edmini_v2-setup.c b/arch/arm/mach-orion5x/edmini_v2-setup.c
index ba98459f44b0..d037a90c216c 100644
--- a/arch/arm/mach-orion5x/edmini_v2-setup.c
+++ b/arch/arm/mach-orion5x/edmini_v2-setup.c
@@ -254,6 +254,7 @@ MACHINE_START(EDMINI_V2, "LaCie Ethernet Disk mini V2")
254 .boot_params = 0x00000100, 254 .boot_params = 0x00000100,
255 .init_machine = edmini_v2_init, 255 .init_machine = edmini_v2_init,
256 .map_io = orion5x_map_io, 256 .map_io = orion5x_map_io,
257 .init_early = orion5x_init_early,
257 .init_irq = orion5x_init_irq, 258 .init_irq = orion5x_init_irq,
258 .timer = &orion5x_timer, 259 .timer = &orion5x_timer,
259 .fixup = tag_fixup_mem32, 260 .fixup = tag_fixup_mem32,
diff --git a/arch/arm/mach-orion5x/include/mach/bridge-regs.h b/arch/arm/mach-orion5x/include/mach/bridge-regs.h
index 5c9744cd8ef6..96484bcd34ca 100644
--- a/arch/arm/mach-orion5x/include/mach/bridge-regs.h
+++ b/arch/arm/mach-orion5x/include/mach/bridge-regs.h
@@ -22,14 +22,12 @@
22 22
23#define CPU_SOFT_RESET (ORION5X_BRIDGE_VIRT_BASE | 0x10c) 23#define CPU_SOFT_RESET (ORION5X_BRIDGE_VIRT_BASE | 0x10c)
24 24
25#define BRIDGE_CAUSE (ORION5X_BRIDGE_VIRT_BASE | 0x110)
26
25#define POWER_MNG_CTRL_REG (ORION5X_BRIDGE_VIRT_BASE | 0x11C) 27#define POWER_MNG_CTRL_REG (ORION5X_BRIDGE_VIRT_BASE | 0x11C)
26 28
27#define BRIDGE_CAUSE (ORION5X_BRIDGE_VIRT_BASE | 0x110)
28#define WDT_INT_REQ 0x0008 29#define WDT_INT_REQ 0x0008
29 30
30#define BRIDGE_MASK (ORION5X_BRIDGE_VIRT_BASE | 0x114)
31#define BRIDGE_INT_TIMER0 0x0002
32#define BRIDGE_INT_TIMER1 0x0004
33#define BRIDGE_INT_TIMER1_CLR (~0x0004) 31#define BRIDGE_INT_TIMER1_CLR (~0x0004)
34 32
35#define MAIN_IRQ_CAUSE (ORION5X_BRIDGE_VIRT_BASE | 0x200) 33#define MAIN_IRQ_CAUSE (ORION5X_BRIDGE_VIRT_BASE | 0x200)
diff --git a/arch/arm/mach-orion5x/include/mach/gpio.h b/arch/arm/mach-orion5x/include/mach/gpio.h
index d8182e87ac16..a1d0b78decb1 100644
--- a/arch/arm/mach-orion5x/include/mach/gpio.h
+++ b/arch/arm/mach-orion5x/include/mach/gpio.h
@@ -6,32 +6,4 @@
6 * warranty of any kind, whether express or implied. 6 * warranty of any kind, whether express or implied.
7 */ 7 */
8 8
9#ifndef __ASM_ARCH_GPIO_H
10#define __ASM_ARCH_GPIO_H
11
12#include <mach/irqs.h>
13#include <plat/gpio.h> 9#include <plat/gpio.h>
14#include <asm-generic/gpio.h> /* cansleep wrappers */
15
16#define GPIO_MAX 32
17#define GPIO_OUT(pin) ORION5X_DEV_BUS_REG(0x100)
18#define GPIO_IO_CONF(pin) ORION5X_DEV_BUS_REG(0x104)
19#define GPIO_BLINK_EN(pin) ORION5X_DEV_BUS_REG(0x108)
20#define GPIO_IN_POL(pin) ORION5X_DEV_BUS_REG(0x10c)
21#define GPIO_DATA_IN(pin) ORION5X_DEV_BUS_REG(0x110)
22#define GPIO_EDGE_CAUSE(pin) ORION5X_DEV_BUS_REG(0x114)
23#define GPIO_EDGE_MASK(pin) ORION5X_DEV_BUS_REG(0x118)
24#define GPIO_LEVEL_MASK(pin) ORION5X_DEV_BUS_REG(0x11c)
25
26static inline int gpio_to_irq(int pin)
27{
28 return pin + IRQ_ORION5X_GPIO_START;
29}
30
31static inline int irq_to_gpio(int irq)
32{
33 return irq - IRQ_ORION5X_GPIO_START;
34}
35
36
37#endif
diff --git a/arch/arm/mach-orion5x/include/mach/memory.h b/arch/arm/mach-orion5x/include/mach/memory.h
index 52a2955d0f87..6769917882fe 100644
--- a/arch/arm/mach-orion5x/include/mach/memory.h
+++ b/arch/arm/mach-orion5x/include/mach/memory.h
@@ -7,6 +7,6 @@
7#ifndef __ASM_ARCH_MEMORY_H 7#ifndef __ASM_ARCH_MEMORY_H
8#define __ASM_ARCH_MEMORY_H 8#define __ASM_ARCH_MEMORY_H
9 9
10#define PHYS_OFFSET UL(0x00000000) 10#define PLAT_PHYS_OFFSET UL(0x00000000)
11 11
12#endif 12#endif
diff --git a/arch/arm/mach-orion5x/include/mach/orion5x.h b/arch/arm/mach-orion5x/include/mach/orion5x.h
index 2d8766570531..0a28bbc76891 100644
--- a/arch/arm/mach-orion5x/include/mach/orion5x.h
+++ b/arch/arm/mach-orion5x/include/mach/orion5x.h
@@ -73,6 +73,7 @@
73#define ORION5X_DEV_BUS_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x10000) 73#define ORION5X_DEV_BUS_PHYS_BASE (ORION5X_REGS_PHYS_BASE | 0x10000)
74#define ORION5X_DEV_BUS_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x10000) 74#define ORION5X_DEV_BUS_VIRT_BASE (ORION5X_REGS_VIRT_BASE | 0x10000)
75#define ORION5X_DEV_BUS_REG(x) (ORION5X_DEV_BUS_VIRT_BASE | (x)) 75#define ORION5X_DEV_BUS_REG(x) (ORION5X_DEV_BUS_VIRT_BASE | (x))
76#define GPIO_VIRT_BASE ORION5X_DEV_BUS_REG(0x0100)
76#define SPI_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x0600) 77#define SPI_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x0600)
77#define I2C_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x1000) 78#define I2C_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x1000)
78#define UART0_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x2000) 79#define UART0_PHYS_BASE (ORION5X_DEV_BUS_PHYS_BASE | 0x2000)
diff --git a/arch/arm/mach-orion5x/irq.c b/arch/arm/mach-orion5x/irq.c
index d7512b925a85..ed85891f8699 100644
--- a/arch/arm/mach-orion5x/irq.c
+++ b/arch/arm/mach-orion5x/irq.c
@@ -28,27 +28,12 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
28 28
29void __init orion5x_init_irq(void) 29void __init orion5x_init_irq(void)
30{ 30{
31 int i;
32
33 orion_irq_init(0, (void __iomem *)MAIN_IRQ_MASK); 31 orion_irq_init(0, (void __iomem *)MAIN_IRQ_MASK);
34 32
35 /* 33 /*
36 * Mask and clear GPIO IRQ interrupts 34 * Initialize gpiolib for GPIOs 0-31.
37 */
38 writel(0x0, GPIO_LEVEL_MASK(0));
39 writel(0x0, GPIO_EDGE_MASK(0));
40 writel(0x0, GPIO_EDGE_CAUSE(0));
41
42 /*
43 * Register chained level handlers for GPIO IRQs by default.
44 * User can use set_type() if he wants to use edge types handlers.
45 */ 35 */
46 for (i = IRQ_ORION5X_GPIO_START; i < NR_IRQS; i++) { 36 orion_gpio_init(0, 32, GPIO_VIRT_BASE, 0, IRQ_ORION5X_GPIO_START);
47 set_irq_chip(i, &orion_gpio_irq_chip);
48 set_irq_handler(i, handle_level_irq);
49 irq_desc[i].status |= IRQ_LEVEL;
50 set_irq_flags(i, IRQF_VALID);
51 }
52 set_irq_chained_handler(IRQ_ORION5X_GPIO_0_7, gpio_irq_handler); 37 set_irq_chained_handler(IRQ_ORION5X_GPIO_0_7, gpio_irq_handler);
53 set_irq_chained_handler(IRQ_ORION5X_GPIO_8_15, gpio_irq_handler); 38 set_irq_chained_handler(IRQ_ORION5X_GPIO_8_15, gpio_irq_handler);
54 set_irq_chained_handler(IRQ_ORION5X_GPIO_16_23, gpio_irq_handler); 39 set_irq_chained_handler(IRQ_ORION5X_GPIO_16_23, gpio_irq_handler);
diff --git a/arch/arm/mach-orion5x/kurobox_pro-setup.c b/arch/arm/mach-orion5x/kurobox_pro-setup.c
index 4be9aa08de69..47497c76162a 100644
--- a/arch/arm/mach-orion5x/kurobox_pro-setup.c
+++ b/arch/arm/mach-orion5x/kurobox_pro-setup.c
@@ -382,6 +382,7 @@ MACHINE_START(KUROBOX_PRO, "Buffalo/Revogear Kurobox Pro")
382 .boot_params = 0x00000100, 382 .boot_params = 0x00000100,
383 .init_machine = kurobox_pro_init, 383 .init_machine = kurobox_pro_init,
384 .map_io = orion5x_map_io, 384 .map_io = orion5x_map_io,
385 .init_early = orion5x_init_early,
385 .init_irq = orion5x_init_irq, 386 .init_irq = orion5x_init_irq,
386 .timer = &orion5x_timer, 387 .timer = &orion5x_timer,
387 .fixup = tag_fixup_mem32, 388 .fixup = tag_fixup_mem32,
@@ -394,6 +395,7 @@ MACHINE_START(LINKSTATION_PRO, "Buffalo Linkstation Pro/Live")
394 .boot_params = 0x00000100, 395 .boot_params = 0x00000100,
395 .init_machine = kurobox_pro_init, 396 .init_machine = kurobox_pro_init,
396 .map_io = orion5x_map_io, 397 .map_io = orion5x_map_io,
398 .init_early = orion5x_init_early,
397 .init_irq = orion5x_init_irq, 399 .init_irq = orion5x_init_irq,
398 .timer = &orion5x_timer, 400 .timer = &orion5x_timer,
399 .fixup = tag_fixup_mem32, 401 .fixup = tag_fixup_mem32,
diff --git a/arch/arm/mach-orion5x/ls-chl-setup.c b/arch/arm/mach-orion5x/ls-chl-setup.c
index 20a9b66cbafa..6ae12aa6d759 100644
--- a/arch/arm/mach-orion5x/ls-chl-setup.c
+++ b/arch/arm/mach-orion5x/ls-chl-setup.c
@@ -321,6 +321,7 @@ MACHINE_START(LINKSTATION_LSCHL, "Buffalo Linkstation LiveV3 (LS-CHL)")
321 .boot_params = 0x00000100, 321 .boot_params = 0x00000100,
322 .init_machine = lschl_init, 322 .init_machine = lschl_init,
323 .map_io = orion5x_map_io, 323 .map_io = orion5x_map_io,
324 .init_early = orion5x_init_early,
324 .init_irq = orion5x_init_irq, 325 .init_irq = orion5x_init_irq,
325 .timer = &orion5x_timer, 326 .timer = &orion5x_timer,
326 .fixup = tag_fixup_mem32, 327 .fixup = tag_fixup_mem32,
diff --git a/arch/arm/mach-orion5x/ls_hgl-setup.c b/arch/arm/mach-orion5x/ls_hgl-setup.c
index 437364b7168e..7adafd79cf98 100644
--- a/arch/arm/mach-orion5x/ls_hgl-setup.c
+++ b/arch/arm/mach-orion5x/ls_hgl-setup.c
@@ -268,6 +268,7 @@ MACHINE_START(LINKSTATION_LS_HGL, "Buffalo Linkstation LS-HGL")
268 .boot_params = 0x00000100, 268 .boot_params = 0x00000100,
269 .init_machine = ls_hgl_init, 269 .init_machine = ls_hgl_init,
270 .map_io = orion5x_map_io, 270 .map_io = orion5x_map_io,
271 .init_early = orion5x_init_early,
271 .init_irq = orion5x_init_irq, 272 .init_irq = orion5x_init_irq,
272 .timer = &orion5x_timer, 273 .timer = &orion5x_timer,
273 .fixup = tag_fixup_mem32, 274 .fixup = tag_fixup_mem32,
diff --git a/arch/arm/mach-orion5x/lsmini-setup.c b/arch/arm/mach-orion5x/lsmini-setup.c
index ab9b0cf0a90b..869958f5c394 100644
--- a/arch/arm/mach-orion5x/lsmini-setup.c
+++ b/arch/arm/mach-orion5x/lsmini-setup.c
@@ -270,6 +270,7 @@ MACHINE_START(LINKSTATION_MINI, "Buffalo Linkstation Mini")
270 .boot_params = 0x00000100, 270 .boot_params = 0x00000100,
271 .init_machine = lsmini_init, 271 .init_machine = lsmini_init,
272 .map_io = orion5x_map_io, 272 .map_io = orion5x_map_io,
273 .init_early = orion5x_init_early,
273 .init_irq = orion5x_init_irq, 274 .init_irq = orion5x_init_irq,
274 .timer = &orion5x_timer, 275 .timer = &orion5x_timer,
275 .fixup = tag_fixup_mem32, 276 .fixup = tag_fixup_mem32,
diff --git a/arch/arm/mach-orion5x/mpp.c b/arch/arm/mach-orion5x/mpp.c
index db485d3b8144..2288207726e4 100644
--- a/arch/arm/mach-orion5x/mpp.c
+++ b/arch/arm/mach-orion5x/mpp.c
@@ -124,9 +124,6 @@ void __init orion5x_mpp_conf(struct orion5x_mpp_mode *mode)
124 u32 mpp_8_15_ctrl = readl(MPP_8_15_CTRL); 124 u32 mpp_8_15_ctrl = readl(MPP_8_15_CTRL);
125 u32 mpp_16_19_ctrl = readl(MPP_16_19_CTRL); 125 u32 mpp_16_19_ctrl = readl(MPP_16_19_CTRL);
126 126
127 /* Initialize gpiolib. */
128 orion_gpio_init();
129
130 for ( ; mode->mpp >= 0; mode++) { 127 for ( ; mode->mpp >= 0; mode++) {
131 u32 *reg; 128 u32 *reg;
132 int num_type; 129 int num_type;
diff --git a/arch/arm/mach-orion5x/mss2-setup.c b/arch/arm/mach-orion5x/mss2-setup.c
index 2f0e16cd7e81..b43b208153cb 100644
--- a/arch/arm/mach-orion5x/mss2-setup.c
+++ b/arch/arm/mach-orion5x/mss2-setup.c
@@ -264,6 +264,7 @@ MACHINE_START(MSS2, "Maxtor Shared Storage II")
264 .boot_params = 0x00000100, 264 .boot_params = 0x00000100,
265 .init_machine = mss2_init, 265 .init_machine = mss2_init,
266 .map_io = orion5x_map_io, 266 .map_io = orion5x_map_io,
267 .init_early = orion5x_init_early,
267 .init_irq = orion5x_init_irq, 268 .init_irq = orion5x_init_irq,
268 .timer = &orion5x_timer, 269 .timer = &orion5x_timer,
269 .fixup = tag_fixup_mem32 270 .fixup = tag_fixup_mem32
diff --git a/arch/arm/mach-orion5x/mv2120-setup.c b/arch/arm/mach-orion5x/mv2120-setup.c
index b3d90f25de9f..c55d071707f5 100644
--- a/arch/arm/mach-orion5x/mv2120-setup.c
+++ b/arch/arm/mach-orion5x/mv2120-setup.c
@@ -232,6 +232,7 @@ MACHINE_START(MV2120, "HP Media Vault mv2120")
232 .boot_params = 0x00000100, 232 .boot_params = 0x00000100,
233 .init_machine = mv2120_init, 233 .init_machine = mv2120_init,
234 .map_io = orion5x_map_io, 234 .map_io = orion5x_map_io,
235 .init_early = orion5x_init_early,
235 .init_irq = orion5x_init_irq, 236 .init_irq = orion5x_init_irq,
236 .timer = &orion5x_timer, 237 .timer = &orion5x_timer,
237 .fixup = tag_fixup_mem32 238 .fixup = tag_fixup_mem32
diff --git a/arch/arm/mach-orion5x/net2big-setup.c b/arch/arm/mach-orion5x/net2big-setup.c
index d6665b31665f..429ecafe9fdd 100644
--- a/arch/arm/mach-orion5x/net2big-setup.c
+++ b/arch/arm/mach-orion5x/net2big-setup.c
@@ -422,6 +422,7 @@ MACHINE_START(NET2BIG, "LaCie 2Big Network")
422 .boot_params = 0x00000100, 422 .boot_params = 0x00000100,
423 .init_machine = net2big_init, 423 .init_machine = net2big_init,
424 .map_io = orion5x_map_io, 424 .map_io = orion5x_map_io,
425 .init_early = orion5x_init_early,
425 .init_irq = orion5x_init_irq, 426 .init_irq = orion5x_init_irq,
426 .timer = &orion5x_timer, 427 .timer = &orion5x_timer,
427 .fixup = tag_fixup_mem32, 428 .fixup = tag_fixup_mem32,
diff --git a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
index f4c26fd731f4..34310ab56e29 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
@@ -172,6 +172,7 @@ MACHINE_START(RD88F5181L_FXO, "Marvell Orion-VoIP FXO Reference Design")
172 .boot_params = 0x00000100, 172 .boot_params = 0x00000100,
173 .init_machine = rd88f5181l_fxo_init, 173 .init_machine = rd88f5181l_fxo_init,
174 .map_io = orion5x_map_io, 174 .map_io = orion5x_map_io,
175 .init_early = orion5x_init_early,
175 .init_irq = orion5x_init_irq, 176 .init_irq = orion5x_init_irq,
176 .timer = &orion5x_timer, 177 .timer = &orion5x_timer,
177 .fixup = tag_fixup_mem32, 178 .fixup = tag_fixup_mem32,
diff --git a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
index b5942909bab0..c1f79fa014ed 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
@@ -184,6 +184,7 @@ MACHINE_START(RD88F5181L_GE, "Marvell Orion-VoIP GE Reference Design")
184 .boot_params = 0x00000100, 184 .boot_params = 0x00000100,
185 .init_machine = rd88f5181l_ge_init, 185 .init_machine = rd88f5181l_ge_init,
186 .map_io = orion5x_map_io, 186 .map_io = orion5x_map_io,
187 .init_early = orion5x_init_early,
187 .init_irq = orion5x_init_irq, 188 .init_irq = orion5x_init_irq,
188 .timer = &orion5x_timer, 189 .timer = &orion5x_timer,
189 .fixup = tag_fixup_mem32, 190 .fixup = tag_fixup_mem32,
diff --git a/arch/arm/mach-orion5x/rd88f5182-setup.c b/arch/arm/mach-orion5x/rd88f5182-setup.c
index 165ed87029b2..67ec6959b267 100644
--- a/arch/arm/mach-orion5x/rd88f5182-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5182-setup.c
@@ -308,6 +308,7 @@ MACHINE_START(RD88F5182, "Marvell Orion-NAS Reference Design")
308 .boot_params = 0x00000100, 308 .boot_params = 0x00000100,
309 .init_machine = rd88f5182_init, 309 .init_machine = rd88f5182_init,
310 .map_io = orion5x_map_io, 310 .map_io = orion5x_map_io,
311 .init_early = orion5x_init_early,
311 .init_irq = orion5x_init_irq, 312 .init_irq = orion5x_init_irq,
312 .timer = &orion5x_timer, 313 .timer = &orion5x_timer,
313MACHINE_END 314MACHINE_END
diff --git a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
index 02ff45f3e2e3..b080c6966d10 100644
--- a/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
+++ b/arch/arm/mach-orion5x/rd88f6183ap-ge-setup.c
@@ -126,6 +126,7 @@ MACHINE_START(RD88F6183AP_GE, "Marvell Orion-1-90 AP GE Reference Design")
126 .boot_params = 0x00000100, 126 .boot_params = 0x00000100,
127 .init_machine = rd88f6183ap_ge_init, 127 .init_machine = rd88f6183ap_ge_init,
128 .map_io = orion5x_map_io, 128 .map_io = orion5x_map_io,
129 .init_early = orion5x_init_early,
129 .init_irq = orion5x_init_irq, 130 .init_irq = orion5x_init_irq,
130 .timer = &orion5x_timer, 131 .timer = &orion5x_timer,
131 .fixup = tag_fixup_mem32, 132 .fixup = tag_fixup_mem32,
diff --git a/arch/arm/mach-orion5x/terastation_pro2-setup.c b/arch/arm/mach-orion5x/terastation_pro2-setup.c
index 4403fae5ab0e..5653ee6c71d8 100644
--- a/arch/arm/mach-orion5x/terastation_pro2-setup.c
+++ b/arch/arm/mach-orion5x/terastation_pro2-setup.c
@@ -361,6 +361,7 @@ MACHINE_START(TERASTATION_PRO2, "Buffalo Terastation Pro II/Live")
361 .boot_params = 0x00000100, 361 .boot_params = 0x00000100,
362 .init_machine = tsp2_init, 362 .init_machine = tsp2_init,
363 .map_io = orion5x_map_io, 363 .map_io = orion5x_map_io,
364 .init_early = orion5x_init_early,
364 .init_irq = orion5x_init_irq, 365 .init_irq = orion5x_init_irq,
365 .timer = &orion5x_timer, 366 .timer = &orion5x_timer,
366 .fixup = tag_fixup_mem32, 367 .fixup = tag_fixup_mem32,
diff --git a/arch/arm/mach-orion5x/ts209-setup.c b/arch/arm/mach-orion5x/ts209-setup.c
index 1e196129d763..8bbd27ea6735 100644
--- a/arch/arm/mach-orion5x/ts209-setup.c
+++ b/arch/arm/mach-orion5x/ts209-setup.c
@@ -325,6 +325,7 @@ MACHINE_START(TS209, "QNAP TS-109/TS-209")
325 .boot_params = 0x00000100, 325 .boot_params = 0x00000100,
326 .init_machine = qnap_ts209_init, 326 .init_machine = qnap_ts209_init,
327 .map_io = orion5x_map_io, 327 .map_io = orion5x_map_io,
328 .init_early = orion5x_init_early,
328 .init_irq = orion5x_init_irq, 329 .init_irq = orion5x_init_irq,
329 .timer = &orion5x_timer, 330 .timer = &orion5x_timer,
330 .fixup = tag_fixup_mem32, 331 .fixup = tag_fixup_mem32,
diff --git a/arch/arm/mach-orion5x/ts409-setup.c b/arch/arm/mach-orion5x/ts409-setup.c
index 428af2046e36..92f393f08fa4 100644
--- a/arch/arm/mach-orion5x/ts409-setup.c
+++ b/arch/arm/mach-orion5x/ts409-setup.c
@@ -314,6 +314,7 @@ MACHINE_START(TS409, "QNAP TS-409")
314 .boot_params = 0x00000100, 314 .boot_params = 0x00000100,
315 .init_machine = qnap_ts409_init, 315 .init_machine = qnap_ts409_init,
316 .map_io = orion5x_map_io, 316 .map_io = orion5x_map_io,
317 .init_early = orion5x_init_early,
317 .init_irq = orion5x_init_irq, 318 .init_irq = orion5x_init_irq,
318 .timer = &orion5x_timer, 319 .timer = &orion5x_timer,
319 .fixup = tag_fixup_mem32, 320 .fixup = tag_fixup_mem32,
diff --git a/arch/arm/mach-orion5x/ts78xx-fpga.h b/arch/arm/mach-orion5x/ts78xx-fpga.h
index 37b3d4875291..151e89e1e676 100644
--- a/arch/arm/mach-orion5x/ts78xx-fpga.h
+++ b/arch/arm/mach-orion5x/ts78xx-fpga.h
@@ -1,3 +1,4 @@
1#define TS7800_FPGA_MAGIC 0x00b480
1#define FPGAID(_magic, _rev) ((_magic << 8) + _rev) 2#define FPGAID(_magic, _rev) ((_magic << 8) + _rev)
2 3
3/* 4/*
@@ -6,11 +7,15 @@
6 */ 7 */
7enum fpga_ids { 8enum fpga_ids {
8 /* Technologic Systems */ 9 /* Technologic Systems */
9 TS7800_REV_1 = FPGAID(0x00b480, 0x01), 10 TS7800_REV_1 = FPGAID(TS7800_FPGA_MAGIC, 0x01),
10 TS7800_REV_2 = FPGAID(0x00b480, 0x02), 11 TS7800_REV_2 = FPGAID(TS7800_FPGA_MAGIC, 0x02),
11 TS7800_REV_3 = FPGAID(0x00b480, 0x03), 12 TS7800_REV_3 = FPGAID(TS7800_FPGA_MAGIC, 0x03),
12 TS7800_REV_4 = FPGAID(0x00b480, 0x04), 13 TS7800_REV_4 = FPGAID(TS7800_FPGA_MAGIC, 0x04),
13 TS7800_REV_5 = FPGAID(0x00b480, 0x05), 14 TS7800_REV_5 = FPGAID(TS7800_FPGA_MAGIC, 0x05),
15 TS7800_REV_6 = FPGAID(TS7800_FPGA_MAGIC, 0x06),
16 TS7800_REV_7 = FPGAID(TS7800_FPGA_MAGIC, 0x07),
17 TS7800_REV_8 = FPGAID(TS7800_FPGA_MAGIC, 0x08),
18 TS7800_REV_9 = FPGAID(TS7800_FPGA_MAGIC, 0x09),
14 19
15 /* Unaffordable & Expensive */ 20 /* Unaffordable & Expensive */
16 UAE_DUMMY = FPGAID(0xffffff, 0x01), 21 UAE_DUMMY = FPGAID(0xffffff, 0x01),
diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c
index c1c1cd04bdde..8554707d20a9 100644
--- a/arch/arm/mach-orion5x/ts78xx-setup.c
+++ b/arch/arm/mach-orion5x/ts78xx-setup.c
@@ -191,6 +191,60 @@ static int ts78xx_ts_nand_dev_ready(struct mtd_info *mtd)
191 return readb(TS_NAND_CTRL) & 0x20; 191 return readb(TS_NAND_CTRL) & 0x20;
192} 192}
193 193
194static void ts78xx_ts_nand_write_buf(struct mtd_info *mtd,
195 const uint8_t *buf, int len)
196{
197 struct nand_chip *chip = mtd->priv;
198 void __iomem *io_base = chip->IO_ADDR_W;
199 unsigned long off = ((unsigned long)buf & 3);
200 int sz;
201
202 if (off) {
203 sz = min_t(int, 4 - off, len);
204 writesb(io_base, buf, sz);
205 buf += sz;
206 len -= sz;
207 }
208
209 sz = len >> 2;
210 if (sz) {
211 u32 *buf32 = (u32 *)buf;
212 writesl(io_base, buf32, sz);
213 buf += sz << 2;
214 len -= sz << 2;
215 }
216
217 if (len)
218 writesb(io_base, buf, len);
219}
220
221static void ts78xx_ts_nand_read_buf(struct mtd_info *mtd,
222 uint8_t *buf, int len)
223{
224 struct nand_chip *chip = mtd->priv;
225 void __iomem *io_base = chip->IO_ADDR_R;
226 unsigned long off = ((unsigned long)buf & 3);
227 int sz;
228
229 if (off) {
230 sz = min_t(int, 4 - off, len);
231 readsb(io_base, buf, sz);
232 buf += sz;
233 len -= sz;
234 }
235
236 sz = len >> 2;
237 if (sz) {
238 u32 *buf32 = (u32 *)buf;
239 readsl(io_base, buf32, sz);
240 buf += sz << 2;
241 len -= sz << 2;
242 }
243
244 if (len)
245 readsb(io_base, buf, len);
246}
247
194const char *ts_nand_part_probes[] = { "cmdlinepart", NULL }; 248const char *ts_nand_part_probes[] = { "cmdlinepart", NULL };
195 249
196static struct mtd_partition ts78xx_ts_nand_parts[] = { 250static struct mtd_partition ts78xx_ts_nand_parts[] = {
@@ -233,6 +287,8 @@ static struct platform_nand_data ts78xx_ts_nand_data = {
233 */ 287 */
234 .cmd_ctrl = ts78xx_ts_nand_cmd_ctrl, 288 .cmd_ctrl = ts78xx_ts_nand_cmd_ctrl,
235 .dev_ready = ts78xx_ts_nand_dev_ready, 289 .dev_ready = ts78xx_ts_nand_dev_ready,
290 .write_buf = ts78xx_ts_nand_write_buf,
291 .read_buf = ts78xx_ts_nand_read_buf,
236 }, 292 },
237}; 293};
238 294
@@ -334,14 +390,29 @@ static void ts78xx_fpga_supports(void)
334 case TS7800_REV_3: 390 case TS7800_REV_3:
335 case TS7800_REV_4: 391 case TS7800_REV_4:
336 case TS7800_REV_5: 392 case TS7800_REV_5:
393 case TS7800_REV_6:
394 case TS7800_REV_7:
395 case TS7800_REV_8:
396 case TS7800_REV_9:
337 ts78xx_fpga.supports.ts_rtc.present = 1; 397 ts78xx_fpga.supports.ts_rtc.present = 1;
338 ts78xx_fpga.supports.ts_nand.present = 1; 398 ts78xx_fpga.supports.ts_nand.present = 1;
339 ts78xx_fpga.supports.ts_rng.present = 1; 399 ts78xx_fpga.supports.ts_rng.present = 1;
340 break; 400 break;
341 default: 401 default:
342 ts78xx_fpga.supports.ts_rtc.present = 0; 402 /* enable devices if magic matches */
343 ts78xx_fpga.supports.ts_nand.present = 0; 403 switch ((ts78xx_fpga.id >> 8) & 0xffffff) {
344 ts78xx_fpga.supports.ts_rng.present = 0; 404 case TS7800_FPGA_MAGIC:
405 printk(KERN_WARNING "TS-7800 FPGA: unrecognized revision 0x%.2x\n",
406 ts78xx_fpga.id & 0xff);
407 ts78xx_fpga.supports.ts_rtc.present = 1;
408 ts78xx_fpga.supports.ts_nand.present = 1;
409 ts78xx_fpga.supports.ts_rng.present = 1;
410 break;
411 default:
412 ts78xx_fpga.supports.ts_rtc.present = 0;
413 ts78xx_fpga.supports.ts_nand.present = 0;
414 ts78xx_fpga.supports.ts_rng.present = 0;
415 }
345 } 416 }
346} 417}
347 418
@@ -553,6 +624,7 @@ MACHINE_START(TS78XX, "Technologic Systems TS-78xx SBC")
553 .boot_params = 0x00000100, 624 .boot_params = 0x00000100,
554 .init_machine = ts78xx_init, 625 .init_machine = ts78xx_init,
555 .map_io = ts78xx_map_io, 626 .map_io = ts78xx_map_io,
627 .init_early = orion5x_init_early,
556 .init_irq = orion5x_init_irq, 628 .init_irq = orion5x_init_irq,
557 .timer = &orion5x_timer, 629 .timer = &orion5x_timer,
558MACHINE_END 630MACHINE_END
diff --git a/arch/arm/mach-orion5x/wnr854t-setup.c b/arch/arm/mach-orion5x/wnr854t-setup.c
index 7994d6ec08a8..4e5216be0745 100644
--- a/arch/arm/mach-orion5x/wnr854t-setup.c
+++ b/arch/arm/mach-orion5x/wnr854t-setup.c
@@ -175,6 +175,7 @@ MACHINE_START(WNR854T, "Netgear WNR854T")
175 .boot_params = 0x00000100, 175 .boot_params = 0x00000100,
176 .init_machine = wnr854t_init, 176 .init_machine = wnr854t_init,
177 .map_io = orion5x_map_io, 177 .map_io = orion5x_map_io,
178 .init_early = orion5x_init_early,
178 .init_irq = orion5x_init_irq, 179 .init_irq = orion5x_init_irq,
179 .timer = &orion5x_timer, 180 .timer = &orion5x_timer,
180 .fixup = tag_fixup_mem32, 181 .fixup = tag_fixup_mem32,
diff --git a/arch/arm/mach-orion5x/wrt350n-v2-setup.c b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
index a5989b7eb53e..fab79d09cc5c 100644
--- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c
+++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
@@ -263,6 +263,7 @@ MACHINE_START(WRT350N_V2, "Linksys WRT350N v2")
263 .boot_params = 0x00000100, 263 .boot_params = 0x00000100,
264 .init_machine = wrt350n_v2_init, 264 .init_machine = wrt350n_v2_init,
265 .map_io = orion5x_map_io, 265 .map_io = orion5x_map_io,
266 .init_early = orion5x_init_early,
266 .init_irq = orion5x_init_irq, 267 .init_irq = orion5x_init_irq,
267 .timer = &orion5x_timer, 268 .timer = &orion5x_timer,
268 .fixup = tag_fixup_mem32, 269 .fixup = tag_fixup_mem32,
diff --git a/arch/arm/mach-pnx4008/include/mach/memory.h b/arch/arm/mach-pnx4008/include/mach/memory.h
index 0e8770081058..1275db61cee5 100644
--- a/arch/arm/mach-pnx4008/include/mach/memory.h
+++ b/arch/arm/mach-pnx4008/include/mach/memory.h
@@ -16,6 +16,6 @@
16/* 16/*
17 * Physical DRAM offset. 17 * Physical DRAM offset.
18 */ 18 */
19#define PHYS_OFFSET UL(0x80000000) 19#define PLAT_PHYS_OFFSET UL(0x80000000)
20 20
21#endif 21#endif
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
index a134a1413e01..d2af73321dae 100644
--- a/arch/arm/mach-pxa/balloon3.c
+++ b/arch/arm/mach-pxa/balloon3.c
@@ -27,6 +27,7 @@
27#include <linux/mtd/partitions.h> 27#include <linux/mtd/partitions.h>
28#include <linux/types.h> 28#include <linux/types.h>
29#include <linux/i2c/pcf857x.h> 29#include <linux/i2c/pcf857x.h>
30#include <linux/i2c/pxa-i2c.h>
30#include <linux/mtd/nand.h> 31#include <linux/mtd/nand.h>
31#include <linux/mtd/physmap.h> 32#include <linux/mtd/physmap.h>
32#include <linux/regulator/max1586.h> 33#include <linux/regulator/max1586.h>
@@ -51,8 +52,6 @@
51#include <mach/irda.h> 52#include <mach/irda.h>
52#include <mach/ohci.h> 53#include <mach/ohci.h>
53 54
54#include <plat/i2c.h>
55
56#include "generic.h" 55#include "generic.h"
57#include "devices.h" 56#include "devices.h"
58 57
@@ -829,5 +828,5 @@ MACHINE_START(BALLOON3, "Balloon3")
829 .init_irq = balloon3_init_irq, 828 .init_irq = balloon3_init_irq,
830 .timer = &pxa_timer, 829 .timer = &pxa_timer,
831 .init_machine = balloon3_init, 830 .init_machine = balloon3_init,
832 .boot_params = PHYS_OFFSET + 0x100, 831 .boot_params = PLAT_PHYS_OFFSET + 0x100,
833MACHINE_END 832MACHINE_END
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index 7984268508b6..bfca7ed2fea3 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -29,6 +29,7 @@
29 29
30#include <linux/i2c.h> 30#include <linux/i2c.h>
31#include <linux/i2c/pca953x.h> 31#include <linux/i2c/pca953x.h>
32#include <linux/i2c/pxa-i2c.h>
32 33
33#include <linux/mfd/da903x.h> 34#include <linux/mfd/da903x.h>
34#include <linux/regulator/machine.h> 35#include <linux/regulator/machine.h>
@@ -48,7 +49,6 @@
48#include <mach/pxafb.h> 49#include <mach/pxafb.h>
49#include <mach/mmc.h> 50#include <mach/mmc.h>
50#include <mach/ohci.h> 51#include <mach/ohci.h>
51#include <plat/i2c.h>
52#include <plat/pxa3xx_nand.h> 52#include <plat/pxa3xx_nand.h>
53#include <mach/audio.h> 53#include <mach/audio.h>
54#include <mach/pxa3xx-u2d.h> 54#include <mach/pxa3xx-u2d.h>
diff --git a/arch/arm/mach-pxa/colibri-evalboard.c b/arch/arm/mach-pxa/colibri-evalboard.c
index 6b2c800a1133..81c3c433e2d6 100644
--- a/arch/arm/mach-pxa/colibri-evalboard.c
+++ b/arch/arm/mach-pxa/colibri-evalboard.c
@@ -20,6 +20,7 @@
20#include <mach/hardware.h> 20#include <mach/hardware.h>
21#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
22#include <linux/i2c.h> 22#include <linux/i2c.h>
23#include <linux/i2c/pxa-i2c.h>
23 24
24#include <mach/pxa27x.h> 25#include <mach/pxa27x.h>
25#include <mach/colibri.h> 26#include <mach/colibri.h>
@@ -27,8 +28,6 @@
27#include <mach/ohci.h> 28#include <mach/ohci.h>
28#include <mach/pxa27x-udc.h> 29#include <mach/pxa27x-udc.h>
29 30
30#include <plat/i2c.h>
31
32#include "generic.h" 31#include "generic.h"
33#include "devices.h" 32#include "devices.h"
34 33
@@ -50,7 +49,7 @@ static void __init colibri_mmc_init(void)
50 GPIO0_COLIBRI_PXA270_SD_DETECT; 49 GPIO0_COLIBRI_PXA270_SD_DETECT;
51 if (machine_is_colibri300()) /* PXA300 Colibri */ 50 if (machine_is_colibri300()) /* PXA300 Colibri */
52 colibri_mci_platform_data.gpio_card_detect = 51 colibri_mci_platform_data.gpio_card_detect =
53 GPIO39_COLIBRI_PXA300_SD_DETECT; 52 GPIO13_COLIBRI_PXA300_SD_DETECT;
54 else /* PXA320 Colibri */ 53 else /* PXA320 Colibri */
55 colibri_mci_platform_data.gpio_card_detect = 54 colibri_mci_platform_data.gpio_card_detect =
56 GPIO28_COLIBRI_PXA320_SD_DETECT; 55 GPIO28_COLIBRI_PXA320_SD_DETECT;
diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c b/arch/arm/mach-pxa/colibri-pxa270-income.c
index 07b62a096f17..ee797397dc5b 100644
--- a/arch/arm/mach-pxa/colibri-pxa270-income.c
+++ b/arch/arm/mach-pxa/colibri-pxa270-income.c
@@ -21,6 +21,7 @@
21#include <linux/kernel.h> 21#include <linux/kernel.h>
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/sysdev.h> 25#include <linux/sysdev.h>
25 26
26#include <asm/irq.h> 27#include <asm/irq.h>
@@ -33,8 +34,6 @@
33#include <mach/pxa27x-udc.h> 34#include <mach/pxa27x-udc.h>
34#include <mach/pxafb.h> 35#include <mach/pxafb.h>
35 36
36#include <plat/i2c.h>
37
38#include "devices.h" 37#include "devices.h"
39#include "generic.h" 38#include "generic.h"
40 39
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c
index fddb16d07eb0..66dd81cbc8a0 100644
--- a/arch/arm/mach-pxa/colibri-pxa300.c
+++ b/arch/arm/mach-pxa/colibri-pxa300.c
@@ -41,7 +41,7 @@ static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {
41 GPIO4_MMC1_DAT1, 41 GPIO4_MMC1_DAT1,
42 GPIO5_MMC1_DAT2, 42 GPIO5_MMC1_DAT2,
43 GPIO6_MMC1_DAT3, 43 GPIO6_MMC1_DAT3,
44 GPIO39_GPIO, /* SD detect */ 44 GPIO13_GPIO, /* GPIO13_COLIBRI_PXA300_SD_DETECT */
45 45
46 /* UHC */ 46 /* UHC */
47 GPIO0_2_USBH_PEN, 47 GPIO0_2_USBH_PEN,
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index a5452a3a276d..d4e705caefea 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -24,6 +24,7 @@
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/backlight.h> 25#include <linux/backlight.h>
26#include <linux/i2c.h> 26#include <linux/i2c.h>
27#include <linux/i2c/pxa-i2c.h>
27#include <linux/io.h> 28#include <linux/io.h>
28#include <linux/spi/spi.h> 29#include <linux/spi/spi.h>
29#include <linux/spi/ads7846.h> 30#include <linux/spi/ads7846.h>
@@ -45,7 +46,6 @@
45#include <asm/mach/irq.h> 46#include <asm/mach/irq.h>
46 47
47#include <mach/pxa25x.h> 48#include <mach/pxa25x.h>
48#include <plat/i2c.h>
49#include <mach/irda.h> 49#include <mach/irda.h>
50#include <mach/mmc.h> 50#include <mach/mmc.h>
51#include <mach/udc.h> 51#include <mach/udc.h>
diff --git a/arch/arm/mach-pxa/csb726.c b/arch/arm/mach-pxa/csb726.c
index a305424a967d..0481c29a70e8 100644
--- a/arch/arm/mach-pxa/csb726.c
+++ b/arch/arm/mach-pxa/csb726.c
@@ -17,12 +17,12 @@
17#include <linux/mtd/partitions.h> 17#include <linux/mtd/partitions.h>
18#include <linux/sm501.h> 18#include <linux/sm501.h>
19#include <linux/smsc911x.h> 19#include <linux/smsc911x.h>
20#include <linux/i2c/pxa-i2c.h>
20 21
21#include <asm/mach-types.h> 22#include <asm/mach-types.h>
22#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
23#include <mach/csb726.h> 24#include <mach/csb726.h>
24#include <mach/mfp-pxa27x.h> 25#include <mach/mfp-pxa27x.h>
25#include <plat/i2c.h>
26#include <mach/mmc.h> 26#include <mach/mmc.h>
27#include <mach/ohci.h> 27#include <mach/ohci.h>
28#include <mach/pxa2xx-regs.h> 28#include <mach/pxa2xx-regs.h>
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index 4c766e3b4af3..c4bf08b3eb61 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -4,6 +4,7 @@
4#include <linux/platform_device.h> 4#include <linux/platform_device.h>
5#include <linux/dma-mapping.h> 5#include <linux/dma-mapping.h>
6#include <linux/spi/pxa2xx_spi.h> 6#include <linux/spi/pxa2xx_spi.h>
7#include <linux/i2c/pxa-i2c.h>
7 8
8#include <asm/pmu.h> 9#include <asm/pmu.h>
9#include <mach/udc.h> 10#include <mach/udc.h>
@@ -16,7 +17,6 @@
16#include <mach/camera.h> 17#include <mach/camera.h>
17#include <mach/audio.h> 18#include <mach/audio.h>
18#include <mach/hardware.h> 19#include <mach/hardware.h>
19#include <plat/i2c.h>
20#include <plat/pxa3xx_nand.h> 20#include <plat/pxa3xx_nand.h>
21 21
22#include "devices.h" 22#include "devices.h"
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index a78bb3097739..b411d7cbf5a1 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -31,6 +31,7 @@
31#include <linux/apm-emulation.h> 31#include <linux/apm-emulation.h>
32#include <linux/i2c.h> 32#include <linux/i2c.h>
33#include <linux/i2c/pca953x.h> 33#include <linux/i2c/pca953x.h>
34#include <linux/i2c/pxa-i2c.h>
34#include <linux/regulator/userspace-consumer.h> 35#include <linux/regulator/userspace-consumer.h>
35 36
36#include <media/soc_camera.h> 37#include <media/soc_camera.h>
@@ -45,7 +46,6 @@
45#include <mach/ohci.h> 46#include <mach/ohci.h>
46#include <mach/mmc.h> 47#include <mach/mmc.h>
47#include <plat/pxa27x_keypad.h> 48#include <plat/pxa27x_keypad.h>
48#include <plat/i2c.h>
49#include <mach/camera.h> 49#include <mach/camera.h>
50 50
51#include "generic.h" 51#include "generic.h"
diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 87cec0abe5b0..93f05e024313 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -20,6 +20,7 @@
20#include <linux/gpio.h> 20#include <linux/gpio.h>
21#include <linux/gpio_keys.h> 21#include <linux/gpio_keys.h>
22#include <linux/leds-lp3944.h> 22#include <linux/leds-lp3944.h>
23#include <linux/i2c/pxa-i2c.h>
23 24
24#include <media/soc_camera.h> 25#include <media/soc_camera.h>
25 26
@@ -30,7 +31,6 @@
30#include <mach/pxa27x.h> 31#include <mach/pxa27x.h>
31#include <mach/pxafb.h> 32#include <mach/pxafb.h>
32#include <mach/ohci.h> 33#include <mach/ohci.h>
33#include <plat/i2c.h>
34#include <mach/hardware.h> 34#include <mach/hardware.h>
35#include <plat/pxa27x_keypad.h> 35#include <plat/pxa27x_keypad.h>
36#include <mach/camera.h> 36#include <mach/camera.h>
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
index a908e0a5f396..6de0ad0eea65 100644
--- a/arch/arm/mach-pxa/hx4700.c
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -35,6 +35,7 @@
35#include <linux/spi/spi.h> 35#include <linux/spi/spi.h>
36#include <linux/spi/pxa2xx_spi.h> 36#include <linux/spi/pxa2xx_spi.h>
37#include <linux/usb/gpio_vbus.h> 37#include <linux/usb/gpio_vbus.h>
38#include <linux/i2c/pxa-i2c.h>
38 39
39#include <mach/hardware.h> 40#include <mach/hardware.h>
40#include <asm/mach-types.h> 41#include <asm/mach-types.h>
@@ -42,7 +43,6 @@
42 43
43#include <mach/pxa27x.h> 44#include <mach/pxa27x.h>
44#include <mach/hx4700.h> 45#include <mach/hx4700.h>
45#include <plat/i2c.h>
46#include <mach/irda.h> 46#include <mach/irda.h>
47 47
48#include <video/platform_lcd.h> 48#include <video/platform_lcd.h>
diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h
index 388a96f1ef93..cb4236e98a0f 100644
--- a/arch/arm/mach-pxa/include/mach/colibri.h
+++ b/arch/arm/mach-pxa/include/mach/colibri.h
@@ -60,7 +60,7 @@ static inline void colibri_pxa3xx_init_nand(void) {}
60#define GPIO113_COLIBRI_PXA270_TS_IRQ 113 60#define GPIO113_COLIBRI_PXA270_TS_IRQ 113
61 61
62/* GPIO definitions for Colibri PXA300/310 */ 62/* GPIO definitions for Colibri PXA300/310 */
63#define GPIO39_COLIBRI_PXA300_SD_DETECT 39 63#define GPIO13_COLIBRI_PXA300_SD_DETECT 13
64 64
65/* GPIO definitions for Colibri PXA320 */ 65/* GPIO definitions for Colibri PXA320 */
66#define GPIO28_COLIBRI_PXA320_SD_DETECT 28 66#define GPIO28_COLIBRI_PXA320_SD_DETECT 28
diff --git a/arch/arm/mach-pxa/include/mach/memory.h b/arch/arm/mach-pxa/include/mach/memory.h
index 92361a66b223..7f68724dcc27 100644
--- a/arch/arm/mach-pxa/include/mach/memory.h
+++ b/arch/arm/mach-pxa/include/mach/memory.h
@@ -15,7 +15,7 @@
15/* 15/*
16 * Physical DRAM offset. 16 * Physical DRAM offset.
17 */ 17 */
18#define 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(__ASSEMBLY__) && defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI)
21void cmx2xx_pci_adjust_zones(unsigned long *size, unsigned long *holes); 21void cmx2xx_pci_adjust_zones(unsigned long *size, unsigned long *holes);
diff --git a/arch/arm/mach-pxa/include/mach/pm.h b/arch/arm/mach-pxa/include/mach/pm.h
index fd8360c6839d..f15afe012995 100644
--- a/arch/arm/mach-pxa/include/mach/pm.h
+++ b/arch/arm/mach-pxa/include/mach/pm.h
@@ -22,9 +22,8 @@ struct pxa_cpu_pm_fns {
22extern struct pxa_cpu_pm_fns *pxa_cpu_pm_fns; 22extern struct pxa_cpu_pm_fns *pxa_cpu_pm_fns;
23 23
24/* sleep.S */ 24/* sleep.S */
25extern void pxa25x_cpu_suspend(unsigned int); 25extern void pxa25x_cpu_suspend(unsigned int, long);
26extern void pxa27x_cpu_suspend(unsigned int); 26extern void pxa27x_cpu_suspend(unsigned int, long);
27extern void pxa_cpu_resume(void);
28 27
29extern int pxa_pm_enter(suspend_state_t state); 28extern int pxa_pm_enter(suspend_state_t state);
30extern int pxa_pm_prepare(void); 29extern int pxa_pm_prepare(void);
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c
index ccb7bfad17ca..87c1ed9ccd2f 100644
--- a/arch/arm/mach-pxa/littleton.c
+++ b/arch/arm/mach-pxa/littleton.c
@@ -28,6 +28,7 @@
28#include <linux/leds.h> 28#include <linux/leds.h>
29#include <linux/mfd/da903x.h> 29#include <linux/mfd/da903x.h>
30#include <linux/i2c/max732x.h> 30#include <linux/i2c/max732x.h>
31#include <linux/i2c/pxa-i2c.h>
31 32
32#include <asm/types.h> 33#include <asm/types.h>
33#include <asm/setup.h> 34#include <asm/setup.h>
@@ -45,7 +46,6 @@
45#include <mach/mmc.h> 46#include <mach/mmc.h>
46#include <plat/pxa27x_keypad.h> 47#include <plat/pxa27x_keypad.h>
47#include <mach/littleton.h> 48#include <mach/littleton.h>
48#include <plat/i2c.h>
49#include <plat/pxa3xx_nand.h> 49#include <plat/pxa3xx_nand.h>
50 50
51#include "generic.h" 51#include "generic.h"
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 41198f0dc3ac..5535991c4a3c 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -28,6 +28,7 @@
28#include <linux/regulator/bq24022.h> 28#include <linux/regulator/bq24022.h>
29#include <linux/regulator/machine.h> 29#include <linux/regulator/machine.h>
30#include <linux/usb/gpio_vbus.h> 30#include <linux/usb/gpio_vbus.h>
31#include <linux/i2c/pxa-i2c.h>
31 32
32#include <mach/hardware.h> 33#include <mach/hardware.h>
33#include <asm/mach-types.h> 34#include <asm/mach-types.h>
@@ -36,7 +37,6 @@
36#include <mach/pxa27x.h> 37#include <mach/pxa27x.h>
37#include <mach/magician.h> 38#include <mach/magician.h>
38#include <mach/pxafb.h> 39#include <mach/pxafb.h>
39#include <plat/i2c.h>
40#include <mach/mmc.h> 40#include <mach/mmc.h>
41#include <mach/irda.h> 41#include <mach/irda.h>
42#include <mach/ohci.h> 42#include <mach/ohci.h>
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index d4b6f2375f2c..f9542220595a 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -27,6 +27,7 @@
27#include <linux/gpio_keys.h> 27#include <linux/gpio_keys.h>
28#include <linux/pwm_backlight.h> 28#include <linux/pwm_backlight.h>
29#include <linux/smc91x.h> 29#include <linux/smc91x.h>
30#include <linux/i2c/pxa-i2c.h>
30 31
31#include <asm/types.h> 32#include <asm/types.h>
32#include <asm/setup.h> 33#include <asm/setup.h>
@@ -46,7 +47,6 @@
46#include <mach/mainstone.h> 47#include <mach/mainstone.h>
47#include <mach/audio.h> 48#include <mach/audio.h>
48#include <mach/pxafb.h> 49#include <mach/pxafb.h>
49#include <plat/i2c.h>
50#include <mach/mmc.h> 50#include <mach/mmc.h>
51#include <mach/irda.h> 51#include <mach/irda.h>
52#include <mach/ohci.h> 52#include <mach/ohci.h>
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index faafea3542fb..78d98a8607ec 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -39,6 +39,7 @@
39#include <linux/usb/gpio_vbus.h> 39#include <linux/usb/gpio_vbus.h>
40#include <linux/regulator/max1586.h> 40#include <linux/regulator/max1586.h>
41#include <linux/slab.h> 41#include <linux/slab.h>
42#include <linux/i2c/pxa-i2c.h>
42 43
43#include <asm/mach-types.h> 44#include <asm/mach-types.h>
44#include <asm/mach/arch.h> 45#include <asm/mach/arch.h>
@@ -50,7 +51,6 @@
50#include <mach/mmc.h> 51#include <mach/mmc.h>
51#include <mach/udc.h> 52#include <mach/udc.h>
52#include <mach/pxa27x-udc.h> 53#include <mach/pxa27x-udc.h>
53#include <plat/i2c.h>
54#include <mach/camera.h> 54#include <mach/camera.h>
55#include <mach/audio.h> 55#include <mach/audio.h>
56#include <media/soc_camera.h> 56#include <media/soc_camera.h>
diff --git a/arch/arm/mach-pxa/mxm8x10.c b/arch/arm/mach-pxa/mxm8x10.c
index cdf7f41e2bb3..b5a8fd3fce04 100644
--- a/arch/arm/mach-pxa/mxm8x10.c
+++ b/arch/arm/mach-pxa/mxm8x10.c
@@ -22,8 +22,8 @@
22#include <linux/serial_8250.h> 22#include <linux/serial_8250.h>
23#include <linux/dm9000.h> 23#include <linux/dm9000.h>
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/i2c/pxa-i2c.h>
25 26
26#include <plat/i2c.h>
27#include <plat/pxa3xx_nand.h> 27#include <plat/pxa3xx_nand.h>
28 28
29#include <mach/pxafb.h> 29#include <mach/pxafb.h>
diff --git a/arch/arm/mach-pxa/palm27x.c b/arch/arm/mach-pxa/palm27x.c
index 405b92a29793..72adb3ae2b43 100644
--- a/arch/arm/mach-pxa/palm27x.c
+++ b/arch/arm/mach-pxa/palm27x.c
@@ -22,6 +22,7 @@
22#include <linux/power_supply.h> 22#include <linux/power_supply.h>
23#include <linux/usb/gpio_vbus.h> 23#include <linux/usb/gpio_vbus.h>
24#include <linux/regulator/max1586.h> 24#include <linux/regulator/max1586.h>
25#include <linux/i2c/pxa-i2c.h>
25 26
26#include <asm/mach-types.h> 27#include <asm/mach-types.h>
27#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
@@ -36,8 +37,6 @@
36#include <mach/palmasoc.h> 37#include <mach/palmasoc.h>
37#include <mach/palm27x.h> 38#include <mach/palm27x.h>
38 39
39#include <plat/i2c.h>
40
41#include "generic.h" 40#include "generic.h"
42#include "devices.h" 41#include "devices.h"
43 42
@@ -323,7 +322,7 @@ static struct platform_pwm_backlight_data palm27x_backlight_data = {
323 .pwm_id = 0, 322 .pwm_id = 0,
324 .max_brightness = 0xfe, 323 .max_brightness = 0xfe,
325 .dft_brightness = 0x7e, 324 .dft_brightness = 0x7e,
326 .pwm_period_ns = 3500, 325 .pwm_period_ns = 3500 * 1024,
327 .init = palm27x_backlight_init, 326 .init = palm27x_backlight_init,
328 .notify = palm27x_backlight_notify, 327 .notify = palm27x_backlight_notify,
329 .exit = palm27x_backlight_exit, 328 .exit = palm27x_backlight_exit,
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c
index 7bf4017326e3..3010193b081e 100644
--- a/arch/arm/mach-pxa/palmz72.c
+++ b/arch/arm/mach-pxa/palmz72.c
@@ -212,7 +212,7 @@ static unsigned long store_ptr;
212static int palmz72_pm_suspend(struct sys_device *dev, pm_message_t msg) 212static int palmz72_pm_suspend(struct sys_device *dev, pm_message_t msg)
213{ 213{
214 /* setup the resume_info struct for the original bootloader */ 214 /* setup the resume_info struct for the original bootloader */
215 palmz72_resume_info.resume_addr = (u32) pxa_cpu_resume; 215 palmz72_resume_info.resume_addr = (u32) cpu_resume;
216 216
217 /* Storing memory touched by ROM */ 217 /* Storing memory touched by ROM */
218 store_ptr = *PALMZ72_SAVE_DWORD; 218 store_ptr = *PALMZ72_SAVE_DWORD;
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index 90820faa711a..9dbf3ccd4150 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -23,12 +23,12 @@
23#include <linux/irq.h> 23#include <linux/irq.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/i2c.h> 25#include <linux/i2c.h>
26#include <linux/i2c/pxa-i2c.h>
26#include <linux/pwm_backlight.h> 27#include <linux/pwm_backlight.h>
27 28
28#include <media/soc_camera.h> 29#include <media/soc_camera.h>
29 30
30#include <asm/gpio.h> 31#include <asm/gpio.h>
31#include <plat/i2c.h>
32#include <mach/camera.h> 32#include <mach/camera.h>
33#include <asm/mach/map.h> 33#include <asm/mach/map.h>
34#include <mach/pxa27x.h> 34#include <mach/pxa27x.h>
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c
index 978e1b289544..51e1583265b2 100644
--- a/arch/arm/mach-pxa/pm.c
+++ b/arch/arm/mach-pxa/pm.c
@@ -33,7 +33,7 @@ int pxa_pm_enter(suspend_state_t state)
33#endif 33#endif
34 34
35 /* skip registers saving for standby */ 35 /* skip registers saving for standby */
36 if (state != PM_SUSPEND_STANDBY) { 36 if (state != PM_SUSPEND_STANDBY && pxa_cpu_pm_fns->save) {
37 pxa_cpu_pm_fns->save(sleep_save); 37 pxa_cpu_pm_fns->save(sleep_save);
38 /* before sleeping, calculate and save a checksum */ 38 /* before sleeping, calculate and save a checksum */
39 for (i = 0; i < pxa_cpu_pm_fns->save_count - 1; i++) 39 for (i = 0; i < pxa_cpu_pm_fns->save_count - 1; i++)
@@ -44,7 +44,7 @@ int pxa_pm_enter(suspend_state_t state)
44 pxa_cpu_pm_fns->enter(state); 44 pxa_cpu_pm_fns->enter(state);
45 cpu_init(); 45 cpu_init();
46 46
47 if (state != PM_SUSPEND_STANDBY) { 47 if (state != PM_SUSPEND_STANDBY && pxa_cpu_pm_fns->restore) {
48 /* after sleeping, validate the checksum */ 48 /* after sleeping, validate the checksum */
49 for (i = 0; i < pxa_cpu_pm_fns->save_count - 1; i++) 49 for (i = 0; i < pxa_cpu_pm_fns->save_count - 1; i++)
50 checksum += sleep_save[i]; 50 checksum += sleep_save[i];
@@ -67,11 +67,6 @@ int pxa_pm_enter(suspend_state_t state)
67 67
68EXPORT_SYMBOL_GPL(pxa_pm_enter); 68EXPORT_SYMBOL_GPL(pxa_pm_enter);
69 69
70unsigned long sleep_phys_sp(void *sp)
71{
72 return virt_to_phys(sp);
73}
74
75static int pxa_pm_valid(suspend_state_t state) 70static int pxa_pm_valid(suspend_state_t state)
76{ 71{
77 if (pxa_cpu_pm_fns) 72 if (pxa_cpu_pm_fns)
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index 4f0ff1ab623d..35353af345d5 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -23,6 +23,7 @@
23#include <linux/mtd/physmap.h> 23#include <linux/mtd/physmap.h>
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/i2c.h> 25#include <linux/i2c.h>
26#include <linux/i2c/pxa-i2c.h>
26#include <linux/spi/spi.h> 27#include <linux/spi/spi.h>
27#include <linux/spi/ads7846.h> 28#include <linux/spi/ads7846.h>
28#include <linux/spi/pxa2xx_spi.h> 29#include <linux/spi/pxa2xx_spi.h>
@@ -44,7 +45,6 @@
44#include <mach/irda.h> 45#include <mach/irda.h>
45#include <mach/poodle.h> 46#include <mach/poodle.h>
46#include <mach/pxafb.h> 47#include <mach/pxafb.h>
47#include <plat/i2c.h>
48 48
49#include <asm/hardware/scoop.h> 49#include <asm/hardware/scoop.h>
50#include <asm/hardware/locomo.h> 50#include <asm/hardware/locomo.h>
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index fbc5b775f895..6bde5956358d 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -244,7 +244,7 @@ static void pxa25x_cpu_pm_enter(suspend_state_t state)
244 244
245 switch (state) { 245 switch (state) {
246 case PM_SUSPEND_MEM: 246 case PM_SUSPEND_MEM:
247 pxa25x_cpu_suspend(PWRMODE_SLEEP); 247 pxa25x_cpu_suspend(PWRMODE_SLEEP, PLAT_PHYS_OFFSET - PAGE_OFFSET);
248 break; 248 break;
249 } 249 }
250} 250}
@@ -252,7 +252,7 @@ static void pxa25x_cpu_pm_enter(suspend_state_t state)
252static int pxa25x_cpu_pm_prepare(void) 252static int pxa25x_cpu_pm_prepare(void)
253{ 253{
254 /* set resume return address */ 254 /* set resume return address */
255 PSPR = virt_to_phys(pxa_cpu_resume); 255 PSPR = virt_to_phys(cpu_resume);
256 return 0; 256 return 0;
257} 257}
258 258
@@ -347,6 +347,7 @@ static struct platform_device *pxa25x_devices[] __initdata = {
347 &pxa25x_device_assp, 347 &pxa25x_device_assp,
348 &pxa25x_device_pwm0, 348 &pxa25x_device_pwm0,
349 &pxa25x_device_pwm1, 349 &pxa25x_device_pwm1,
350 &pxa_device_asoc_platform,
350}; 351};
351 352
352static struct sys_device pxa25x_sysdev[] = { 353static struct sys_device pxa25x_sysdev[] = {
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 987301ff4c33..1cb5d0f9723f 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -19,6 +19,7 @@
19#include <linux/sysdev.h> 19#include <linux/sysdev.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 23
23#include <asm/mach/map.h> 24#include <asm/mach/map.h>
24#include <mach/hardware.h> 25#include <mach/hardware.h>
@@ -32,8 +33,6 @@
32#include <mach/dma.h> 33#include <mach/dma.h>
33#include <mach/smemc.h> 34#include <mach/smemc.h>
34 35
35#include <plat/i2c.h>
36
37#include "generic.h" 36#include "generic.h"
38#include "devices.h" 37#include "devices.h"
39#include "clock.h" 38#include "clock.h"
@@ -300,7 +299,7 @@ void pxa27x_cpu_pm_enter(suspend_state_t state)
300 pxa_cpu_standby(); 299 pxa_cpu_standby();
301 break; 300 break;
302 case PM_SUSPEND_MEM: 301 case PM_SUSPEND_MEM:
303 pxa27x_cpu_suspend(pwrmode); 302 pxa27x_cpu_suspend(pwrmode, PLAT_PHYS_OFFSET - PAGE_OFFSET);
304 break; 303 break;
305 } 304 }
306} 305}
@@ -313,7 +312,7 @@ static int pxa27x_cpu_pm_valid(suspend_state_t state)
313static int pxa27x_cpu_pm_prepare(void) 312static int pxa27x_cpu_pm_prepare(void)
314{ 313{
315 /* set resume return address */ 314 /* set resume return address */
316 PSPR = virt_to_phys(pxa_cpu_resume); 315 PSPR = virt_to_phys(cpu_resume);
317 return 0; 316 return 0;
318} 317}
319 318
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index a7a19e1cd640..f374247b8466 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -21,6 +21,7 @@
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/sysdev.h>
24#include <linux/i2c/pxa-i2c.h>
24 25
25#include <asm/mach/map.h> 26#include <asm/mach/map.h>
26#include <mach/hardware.h> 27#include <mach/hardware.h>
@@ -32,7 +33,6 @@
32#include <mach/dma.h> 33#include <mach/dma.h>
33#include <mach/regs-intc.h> 34#include <mach/regs-intc.h>
34#include <mach/smemc.h> 35#include <mach/smemc.h>
35#include <plat/i2c.h>
36 36
37#include "generic.h" 37#include "generic.h"
38#include "devices.h" 38#include "devices.h"
@@ -142,8 +142,7 @@ static void pxa3xx_cpu_pm_suspend(void)
142 volatile unsigned long *p = (volatile void *)0xc0000000; 142 volatile unsigned long *p = (volatile void *)0xc0000000;
143 unsigned long saved_data = *p; 143 unsigned long saved_data = *p;
144 144
145 extern void pxa3xx_cpu_suspend(void); 145 extern void pxa3xx_cpu_suspend(long);
146 extern void pxa3xx_cpu_resume(void);
147 146
148 /* resuming from D2 requires the HSIO2/BOOT/TPM clocks enabled */ 147 /* resuming from D2 requires the HSIO2/BOOT/TPM clocks enabled */
149 CKENA |= (1 << CKEN_BOOT) | (1 << CKEN_TPM); 148 CKENA |= (1 << CKEN_BOOT) | (1 << CKEN_TPM);
@@ -161,9 +160,9 @@ static void pxa3xx_cpu_pm_suspend(void)
161 PSPR = 0x5c014000; 160 PSPR = 0x5c014000;
162 161
163 /* overwrite with the resume address */ 162 /* overwrite with the resume address */
164 *p = virt_to_phys(pxa3xx_cpu_resume); 163 *p = virt_to_phys(cpu_resume);
165 164
166 pxa3xx_cpu_suspend(); 165 pxa3xx_cpu_suspend(PLAT_PHYS_OFFSET - PAGE_OFFSET);
167 166
168 *p = saved_data; 167 *p = saved_data;
169 168
diff --git a/arch/arm/mach-pxa/pxa95x.c b/arch/arm/mach-pxa/pxa95x.c
index 437980f72710..23b229bd06e9 100644
--- a/arch/arm/mach-pxa/pxa95x.c
+++ b/arch/arm/mach-pxa/pxa95x.c
@@ -15,6 +15,7 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/pm.h> 16#include <linux/pm.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/i2c/pxa-i2c.h>
18#include <linux/irq.h> 19#include <linux/irq.h>
19#include <linux/io.h> 20#include <linux/io.h>
20#include <linux/sysdev.h> 21#include <linux/sysdev.h>
@@ -27,7 +28,6 @@
27#include <mach/pm.h> 28#include <mach/pm.h>
28#include <mach/dma.h> 29#include <mach/dma.h>
29#include <mach/regs-intc.h> 30#include <mach/regs-intc.h>
30#include <plat/i2c.h>
31 31
32#include "generic.h" 32#include "generic.h"
33#include "devices.h" 33#include "devices.h"
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c
index 8361151be054..47094188e029 100644
--- a/arch/arm/mach-pxa/raumfeld.c
+++ b/arch/arm/mach-pxa/raumfeld.c
@@ -32,6 +32,7 @@
32#include <linux/sched.h> 32#include <linux/sched.h>
33#include <linux/pwm_backlight.h> 33#include <linux/pwm_backlight.h>
34#include <linux/i2c.h> 34#include <linux/i2c.h>
35#include <linux/i2c/pxa-i2c.h>
35#include <linux/spi/spi.h> 36#include <linux/spi/spi.h>
36#include <linux/spi/spi_gpio.h> 37#include <linux/spi/spi_gpio.h>
37#include <linux/lis3lv02d.h> 38#include <linux/lis3lv02d.h>
@@ -53,7 +54,6 @@
53#include <mach/ohci.h> 54#include <mach/ohci.h>
54#include <mach/pxafb.h> 55#include <mach/pxafb.h>
55#include <mach/mmc.h> 56#include <mach/mmc.h>
56#include <plat/i2c.h>
57#include <plat/pxa3xx_nand.h> 57#include <plat/pxa3xx_nand.h>
58 58
59#include "generic.h" 59#include "generic.h"
diff --git a/arch/arm/mach-pxa/saar.c b/arch/arm/mach-pxa/saar.c
index c1ca8cb467fc..eb83c89428ef 100644
--- a/arch/arm/mach-pxa/saar.c
+++ b/arch/arm/mach-pxa/saar.c
@@ -20,6 +20,7 @@
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/fb.h> 21#include <linux/fb.h>
22#include <linux/i2c.h> 22#include <linux/i2c.h>
23#include <linux/i2c/pxa-i2c.h>
23#include <linux/smc91x.h> 24#include <linux/smc91x.h>
24#include <linux/mfd/da903x.h> 25#include <linux/mfd/da903x.h>
25#include <linux/mtd/mtd.h> 26#include <linux/mtd/mtd.h>
@@ -31,7 +32,6 @@
31#include <asm/mach/flash.h> 32#include <asm/mach/flash.h>
32 33
33#include <mach/pxa930.h> 34#include <mach/pxa930.h>
34#include <plat/i2c.h>
35#include <mach/pxafb.h> 35#include <mach/pxafb.h>
36 36
37#include "devices.h" 37#include "devices.h"
diff --git a/arch/arm/mach-pxa/saarb.c b/arch/arm/mach-pxa/saarb.c
index e497922f761a..9322fe527c7f 100644
--- a/arch/arm/mach-pxa/saarb.c
+++ b/arch/arm/mach-pxa/saarb.c
@@ -13,6 +13,7 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/i2c.h> 15#include <linux/i2c.h>
16#include <linux/i2c/pxa-i2c.h>
16#include <linux/mfd/88pm860x.h> 17#include <linux/mfd/88pm860x.h>
17 18
18#include <asm/mach-types.h> 19#include <asm/mach-types.h>
@@ -24,8 +25,6 @@
24#include <mach/mfp-pxa930.h> 25#include <mach/mfp-pxa930.h>
25#include <mach/gpio.h> 26#include <mach/gpio.h>
26 27
27#include <plat/i2c.h>
28
29#include "generic.h" 28#include "generic.h"
30 29
31#define SAARB_NR_IRQS (IRQ_BOARD_START + 40) 30#define SAARB_NR_IRQS (IRQ_BOARD_START + 40)
diff --git a/arch/arm/mach-pxa/sleep.S b/arch/arm/mach-pxa/sleep.S
index c551da86baf6..6f5368899d84 100644
--- a/arch/arm/mach-pxa/sleep.S
+++ b/arch/arm/mach-pxa/sleep.S
@@ -22,133 +22,26 @@
22 22
23 .text 23 .text
24 24
25pxa_cpu_save_cp:
26 @ get coprocessor registers
27 mrc p14, 0, r3, c6, c0, 0 @ clock configuration, for turbo mode
28 mrc p15, 0, r4, c15, c1, 0 @ CP access reg
29 mrc p15, 0, r5, c13, c0, 0 @ PID
30 mrc p15, 0, r6, c3, c0, 0 @ domain ID
31 mrc p15, 0, r7, c2, c0, 0 @ translation table base addr
32 mrc p15, 0, r8, c1, c1, 0 @ auxiliary control reg
33 mrc p15, 0, r9, c1, c0, 0 @ control reg
34
35 bic r3, r3, #2 @ clear frequency change bit
36
37 @ store them plus current virtual stack ptr on stack
38 mov r10, sp
39 stmfd sp!, {r3 - r10}
40
41 mov pc, lr
42
43pxa_cpu_save_sp:
44 @ preserve phys address of stack
45 mov r0, sp
46 str lr, [sp, #-4]!
47 bl sleep_phys_sp
48 ldr r1, =sleep_save_sp
49 str r0, [r1]
50 ldr pc, [sp], #4
51
52#ifdef CONFIG_PXA3xx 25#ifdef CONFIG_PXA3xx
53/* 26/*
54 * pxa3xx_cpu_suspend() - forces CPU into sleep state (S2D3C4) 27 * pxa3xx_cpu_suspend() - forces CPU into sleep state (S2D3C4)
55 * 28 *
56 * NOTE: unfortunately, pxa_cpu_save_cp can not be reused here since 29 * r0 = v:p offset
57 * the auxiliary control register address is different between pxa3xx
58 * and pxa{25x,27x}
59 */ 30 */
60
61ENTRY(pxa3xx_cpu_suspend) 31ENTRY(pxa3xx_cpu_suspend)
62 32
63#ifndef CONFIG_IWMMXT 33#ifndef CONFIG_IWMMXT
64 mra r2, r3, acc0 34 mra r2, r3, acc0
65#endif 35#endif
66 stmfd sp!, {r2 - r12, lr} @ save registers on stack 36 stmfd sp!, {r2 - r12, lr} @ save registers on stack
67 37 mov r1, r0
68 mrc p14, 0, r3, c6, c0, 0 @ clock configuration, for turbo mode 38 ldr r3, =pxa_cpu_resume @ resume function
69 mrc p15, 0, r4, c15, c1, 0 @ CP access reg 39 bl cpu_suspend
70 mrc p15, 0, r5, c13, c0, 0 @ PID
71 mrc p15, 0, r6, c3, c0, 0 @ domain ID
72 mrc p15, 0, r7, c2, c0, 0 @ translation table base addr
73 mrc p15, 0, r8, c1, c0, 1 @ auxiliary control reg
74 mrc p15, 0, r9, c1, c0, 0 @ control reg
75
76 bic r3, r3, #2 @ clear frequency change bit
77
78 @ store them plus current virtual stack ptr on stack
79 mov r10, sp
80 stmfd sp!, {r3 - r10}
81
82 @ store physical address of stack pointer
83 mov r0, sp
84 bl sleep_phys_sp
85 ldr r1, =sleep_save_sp
86 str r0, [r1]
87
88 @ clean data cache
89 bl xsc3_flush_kern_cache_all
90 40
91 mov r0, #0x06 @ S2D3C4 mode 41 mov r0, #0x06 @ S2D3C4 mode
92 mcr p14, 0, r0, c7, c0, 0 @ enter sleep 42 mcr p14, 0, r0, c7, c0, 0 @ enter sleep
93 43
9420: b 20b @ waiting for sleep 4420: b 20b @ waiting for sleep
95
96 .data
97 .align 5
98/*
99 * pxa3xx_cpu_resume
100 */
101
102ENTRY(pxa3xx_cpu_resume)
103
104 mov r0, #PSR_I_BIT | PSR_F_BIT | SVC_MODE @ set SVC, irqs off
105 msr cpsr_c, r0
106
107 ldr r0, sleep_save_sp @ stack phys addr
108 ldmfd r0, {r3 - r9, sp} @ CP regs + virt stack ptr
109
110 mov r1, #0
111 mcr p15, 0, r1, c7, c7, 0 @ invalidate I & D caches, BTB
112 mcr p15, 0, r1, c7, c10, 4 @ drain write (&fill) buffer
113 mcr p15, 0, r1, c7, c5, 4 @ flush prefetch buffer
114 mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs
115
116 mcr p14, 0, r3, c6, c0, 0 @ clock configuration, turbo mode.
117 mcr p15, 0, r4, c15, c1, 0 @ CP access reg
118 mcr p15, 0, r5, c13, c0, 0 @ PID
119 mcr p15, 0, r6, c3, c0, 0 @ domain ID
120 mcr p15, 0, r7, c2, c0, 0 @ translation table base addr
121 mcr p15, 0, r8, c1, c0, 1 @ auxiliary control reg
122
123 @ temporarily map resume_turn_on_mmu into the page table,
124 @ otherwise prefetch abort occurs after MMU is turned on
125 mov r1, r7
126 bic r1, r1, #0x00ff
127 bic r1, r1, #0x3f00
128 ldr r2, =0x542e
129
130 adr r3, resume_turn_on_mmu
131 mov r3, r3, lsr #20
132 orr r4, r2, r3, lsl #20
133 ldr r5, [r1, r3, lsl #2]
134 str r4, [r1, r3, lsl #2]
135
136 @ Mapping page table address in the page table
137 mov r6, r1, lsr #20
138 orr r7, r2, r6, lsl #20
139 ldr r8, [r1, r6, lsl #2]
140 str r7, [r1, r6, lsl #2]
141
142 ldr r2, =pxa3xx_resume_after_mmu @ absolute virtual address
143 b resume_turn_on_mmu @ cache align execution
144
145 .text
146pxa3xx_resume_after_mmu:
147 /* restore the temporary mapping */
148 str r5, [r1, r3, lsl #2]
149 str r8, [r1, r6, lsl #2]
150 b resume_after_mmu
151
152#endif /* CONFIG_PXA3xx */ 45#endif /* CONFIG_PXA3xx */
153 46
154#ifdef CONFIG_PXA27x 47#ifdef CONFIG_PXA27x
@@ -158,28 +51,23 @@ pxa3xx_resume_after_mmu:
158 * Forces CPU into sleep state. 51 * Forces CPU into sleep state.
159 * 52 *
160 * r0 = value for PWRMODE M field for desired sleep state 53 * r0 = value for PWRMODE M field for desired sleep state
54 * r1 = v:p offset
161 */ 55 */
162
163ENTRY(pxa27x_cpu_suspend) 56ENTRY(pxa27x_cpu_suspend)
164 57
165#ifndef CONFIG_IWMMXT 58#ifndef CONFIG_IWMMXT
166 mra r2, r3, acc0 59 mra r2, r3, acc0
167#endif 60#endif
168 stmfd sp!, {r2 - r12, lr} @ save registers on stack 61 stmfd sp!, {r2 - r12, lr} @ save registers on stack
169 62 mov r4, r0 @ save sleep mode
170 bl pxa_cpu_save_cp 63 ldr r3, =pxa_cpu_resume @ resume function
171 64 bl cpu_suspend
172 mov r5, r0 @ save sleep mode
173 bl pxa_cpu_save_sp
174
175 @ clean data cache
176 bl xscale_flush_kern_cache_all
177 65
178 @ Put the processor to sleep 66 @ Put the processor to sleep
179 @ (also workaround for sighting 28071) 67 @ (also workaround for sighting 28071)
180 68
181 @ prepare value for sleep mode 69 @ prepare value for sleep mode
182 mov r1, r5 @ sleep mode 70 mov r1, r4 @ sleep mode
183 71
184 @ prepare pointer to physical address 0 (virtual mapping in generic.c) 72 @ prepare pointer to physical address 0 (virtual mapping in generic.c)
185 mov r2, #UNCACHED_PHYS_0 73 mov r2, #UNCACHED_PHYS_0
@@ -216,21 +104,16 @@ ENTRY(pxa27x_cpu_suspend)
216 * Forces CPU into sleep state. 104 * Forces CPU into sleep state.
217 * 105 *
218 * r0 = value for PWRMODE M field for desired sleep state 106 * r0 = value for PWRMODE M field for desired sleep state
107 * r1 = v:p offset
219 */ 108 */
220 109
221ENTRY(pxa25x_cpu_suspend) 110ENTRY(pxa25x_cpu_suspend)
222 stmfd sp!, {r2 - r12, lr} @ save registers on stack 111 stmfd sp!, {r2 - r12, lr} @ save registers on stack
223 112 mov r4, r0 @ save sleep mode
224 bl pxa_cpu_save_cp 113 ldr r3, =pxa_cpu_resume @ resume function
225 114 bl cpu_suspend
226 mov r5, r0 @ save sleep mode
227 bl pxa_cpu_save_sp
228
229 @ clean data cache
230 bl xscale_flush_kern_cache_all
231
232 @ prepare value for sleep mode 115 @ prepare value for sleep mode
233 mov r1, r5 @ sleep mode 116 mov r1, r4 @ sleep mode
234 117
235 @ prepare pointer to physical address 0 (virtual mapping in generic.c) 118 @ prepare pointer to physical address 0 (virtual mapping in generic.c)
236 mov r2, #UNCACHED_PHYS_0 119 mov r2, #UNCACHED_PHYS_0
@@ -317,53 +200,9 @@ pxa_cpu_do_suspend:
317 * pxa_cpu_resume() 200 * pxa_cpu_resume()
318 * 201 *
319 * entry point from bootloader into kernel during resume 202 * entry point from bootloader into kernel during resume
320 *
321 * Note: Yes, part of the following code is located into the .data section.
322 * This is to allow sleep_save_sp to be accessed with a relative load
323 * while we can't rely on any MMU translation. We could have put
324 * sleep_save_sp in the .text section as well, but some setups might
325 * insist on it to be truly read-only.
326 */ 203 */
327
328 .data
329 .align 5
330ENTRY(pxa_cpu_resume)
331 mov r0, #PSR_I_BIT | PSR_F_BIT | SVC_MODE @ set SVC, irqs off
332 msr cpsr_c, r0
333
334 ldr r0, sleep_save_sp @ stack phys addr
335 ldr r2, =resume_after_mmu @ its absolute virtual address
336 ldmfd r0, {r3 - r9, sp} @ CP regs + virt stack ptr
337
338 mov r1, #0
339 mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs
340 mcr p15, 0, r1, c7, c7, 0 @ invalidate I & D caches, BTB
341
342 mcr p14, 0, r3, c6, c0, 0 @ clock configuration, turbo mode.
343 mcr p15, 0, r4, c15, c1, 0 @ CP access reg
344 mcr p15, 0, r5, c13, c0, 0 @ PID
345 mcr p15, 0, r6, c3, c0, 0 @ domain ID
346 mcr p15, 0, r7, c2, c0, 0 @ translation table base addr
347 mcr p15, 0, r8, c1, c1, 0 @ auxiliary control reg
348 b resume_turn_on_mmu @ cache align execution
349
350 .align 5 204 .align 5
351resume_turn_on_mmu: 205pxa_cpu_resume:
352 mcr p15, 0, r9, c1, c0, 0 @ turn on MMU, caches, etc.
353
354 @ Let us ensure we jump to resume_after_mmu only when the mcr above
355 @ actually took effect. They call it the "cpwait" operation.
356 mrc p15, 0, r0, c2, c0, 0 @ queue a dependency on CP15
357 sub pc, r2, r0, lsr #32 @ jump to virtual addr
358 nop
359 nop
360 nop
361
362sleep_save_sp:
363 .word 0 @ preserve stack phys ptr here
364
365 .text
366resume_after_mmu:
367 ldmfd sp!, {r2, r3} 206 ldmfd sp!, {r2, r3}
368#ifndef CONFIG_IWMMXT 207#ifndef CONFIG_IWMMXT
369 mar acc0, r2, r3 208 mar acc0, r2, r3
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index b49a2c21124c..38e2c0912b9a 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -19,6 +19,7 @@
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/leds.h> 20#include <linux/leds.h>
21#include <linux/i2c.h> 21#include <linux/i2c.h>
22#include <linux/i2c/pxa-i2c.h>
22#include <linux/i2c/pca953x.h> 23#include <linux/i2c/pca953x.h>
23#include <linux/spi/spi.h> 24#include <linux/spi/spi.h>
24#include <linux/spi/ads7846.h> 25#include <linux/spi/ads7846.h>
@@ -47,8 +48,6 @@
47#include <mach/sharpsl_pm.h> 48#include <mach/sharpsl_pm.h>
48#include <mach/smemc.h> 49#include <mach/smemc.h>
49 50
50#include <plat/i2c.h>
51
52#include "generic.h" 51#include "generic.h"
53#include "devices.h" 52#include "devices.h"
54 53
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c
index 9a14fdb83c82..cb5611daf5fe 100644
--- a/arch/arm/mach-pxa/stargate2.c
+++ b/arch/arm/mach-pxa/stargate2.c
@@ -25,6 +25,7 @@
25#include <linux/mtd/plat-ram.h> 25#include <linux/mtd/plat-ram.h>
26#include <linux/mtd/partitions.h> 26#include <linux/mtd/partitions.h>
27 27
28#include <linux/i2c/pxa-i2c.h>
28#include <linux/i2c/pcf857x.h> 29#include <linux/i2c/pcf857x.h>
29#include <linux/i2c/at24.h> 30#include <linux/i2c/at24.h>
30#include <linux/smc91x.h> 31#include <linux/smc91x.h>
@@ -43,7 +44,6 @@
43#include <asm/mach/flash.h> 44#include <asm/mach/flash.h>
44 45
45#include <mach/pxa27x.h> 46#include <mach/pxa27x.h>
46#include <plat/i2c.h>
47#include <mach/mmc.h> 47#include <mach/mmc.h>
48#include <mach/udc.h> 48#include <mach/udc.h>
49#include <mach/pxa27x-udc.h> 49#include <mach/pxa27x-udc.h>
diff --git a/arch/arm/mach-pxa/tavorevb3.c b/arch/arm/mach-pxa/tavorevb3.c
index 70191a9450eb..79f4422f12f4 100644
--- a/arch/arm/mach-pxa/tavorevb3.c
+++ b/arch/arm/mach-pxa/tavorevb3.c
@@ -15,6 +15,7 @@
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/i2c.h> 17#include <linux/i2c.h>
18#include <linux/i2c/pxa-i2c.h>
18#include <linux/gpio.h> 19#include <linux/gpio.h>
19#include <linux/mfd/88pm860x.h> 20#include <linux/mfd/88pm860x.h>
20 21
@@ -23,8 +24,6 @@
23 24
24#include <mach/pxa930.h> 25#include <mach/pxa930.h>
25 26
26#include <plat/i2c.h>
27
28#include "devices.h" 27#include "devices.h"
29#include "generic.h" 28#include "generic.h"
30 29
diff --git a/arch/arm/mach-pxa/tosa-bt.c b/arch/arm/mach-pxa/tosa-bt.c
index c31e601eb49c..b9b1e5c2b290 100644
--- a/arch/arm/mach-pxa/tosa-bt.c
+++ b/arch/arm/mach-pxa/tosa-bt.c
@@ -81,8 +81,6 @@ static int tosa_bt_probe(struct platform_device *dev)
81 goto err_rfk_alloc; 81 goto err_rfk_alloc;
82 } 82 }
83 83
84 rfkill_set_led_trigger_name(rfk, "tosa-bt");
85
86 rc = rfkill_register(rfk); 84 rc = rfkill_register(rfk);
87 if (rc) 85 if (rc)
88 goto err_rfkill; 86 goto err_rfkill;
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index af152e70cfcf..5ad3807af334 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -34,6 +34,7 @@
34#include <linux/spi/spi.h> 34#include <linux/spi/spi.h>
35#include <linux/spi/pxa2xx_spi.h> 35#include <linux/spi/pxa2xx_spi.h>
36#include <linux/input/matrix_keypad.h> 36#include <linux/input/matrix_keypad.h>
37#include <linux/i2c/pxa-i2c.h>
37 38
38#include <asm/setup.h> 39#include <asm/setup.h>
39#include <asm/mach-types.h> 40#include <asm/mach-types.h>
@@ -41,7 +42,6 @@
41#include <mach/pxa25x.h> 42#include <mach/pxa25x.h>
42#include <mach/reset.h> 43#include <mach/reset.h>
43#include <mach/irda.h> 44#include <mach/irda.h>
44#include <plat/i2c.h>
45#include <mach/mmc.h> 45#include <mach/mmc.h>
46#include <mach/udc.h> 46#include <mach/udc.h>
47#include <mach/tosa_bt.h> 47#include <mach/tosa_bt.h>
@@ -875,6 +875,11 @@ static struct platform_device sharpsl_rom_device = {
875 .dev.platform_data = &sharpsl_rom_data, 875 .dev.platform_data = &sharpsl_rom_data,
876}; 876};
877 877
878static struct platform_device wm9712_device = {
879 .name = "wm9712-codec",
880 .id = -1,
881};
882
878static struct platform_device *devices[] __initdata = { 883static struct platform_device *devices[] __initdata = {
879 &tosascoop_device, 884 &tosascoop_device,
880 &tosascoop_jc_device, 885 &tosascoop_jc_device,
@@ -885,6 +890,7 @@ static struct platform_device *devices[] __initdata = {
885 &tosaled_device, 890 &tosaled_device,
886 &tosa_bt_device, 891 &tosa_bt_device,
887 &sharpsl_rom_device, 892 &sharpsl_rom_device,
893 &wm9712_device,
888}; 894};
889 895
890static void tosa_poweroff(void) 896static void tosa_poweroff(void)
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
index 423261d63d07..857bb2e63486 100644
--- a/arch/arm/mach-pxa/trizeps4.c
+++ b/arch/arm/mach-pxa/trizeps4.c
@@ -26,6 +26,7 @@
26#include <linux/dm9000.h> 26#include <linux/dm9000.h>
27#include <linux/mtd/physmap.h> 27#include <linux/mtd/physmap.h>
28#include <linux/mtd/partitions.h> 28#include <linux/mtd/partitions.h>
29#include <linux/i2c/pxa-i2c.h>
29 30
30#include <asm/types.h> 31#include <asm/types.h>
31#include <asm/setup.h> 32#include <asm/setup.h>
@@ -47,7 +48,6 @@
47#include <mach/irda.h> 48#include <mach/irda.h>
48#include <mach/ohci.h> 49#include <mach/ohci.h>
49#include <mach/smemc.h> 50#include <mach/smemc.h>
50#include <plat/i2c.h>
51 51
52#include "generic.h" 52#include "generic.h"
53#include "devices.h" 53#include "devices.h"
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index 49eeeab23689..12279214c875 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -36,6 +36,7 @@
36#include <linux/gpio.h> 36#include <linux/gpio.h>
37#include <linux/jiffies.h> 37#include <linux/jiffies.h>
38#include <linux/i2c-gpio.h> 38#include <linux/i2c-gpio.h>
39#include <linux/i2c/pxa-i2c.h>
39#include <linux/serial_8250.h> 40#include <linux/serial_8250.h>
40#include <linux/smc91x.h> 41#include <linux/smc91x.h>
41#include <linux/pwm_backlight.h> 42#include <linux/pwm_backlight.h>
@@ -47,7 +48,6 @@
47#include <mach/pxa25x.h> 48#include <mach/pxa25x.h>
48#include <mach/audio.h> 49#include <mach/audio.h>
49#include <mach/pxafb.h> 50#include <mach/pxafb.h>
50#include <plat/i2c.h>
51#include <mach/regs-uart.h> 51#include <mach/regs-uart.h>
52#include <mach/arcom-pcmcia.h> 52#include <mach/arcom-pcmcia.h>
53#include <mach/viper.h> 53#include <mach/viper.h>
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
index b9b579715ff6..e709fd459268 100644
--- a/arch/arm/mach-pxa/vpac270.c
+++ b/arch/arm/mach-pxa/vpac270.c
@@ -26,6 +26,7 @@
26#include <linux/ucb1400.h> 26#include <linux/ucb1400.h>
27#include <linux/ata_platform.h> 27#include <linux/ata_platform.h>
28#include <linux/regulator/max1586.h> 28#include <linux/regulator/max1586.h>
29#include <linux/i2c/pxa-i2c.h>
29 30
30#include <asm/mach-types.h> 31#include <asm/mach-types.h>
31#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
@@ -40,8 +41,6 @@
40#include <mach/udc.h> 41#include <mach/udc.h>
41#include <mach/pata_pxa.h> 42#include <mach/pata_pxa.h>
42 43
43#include <plat/i2c.h>
44
45#include "generic.h" 44#include "generic.h"
46#include "devices.h" 45#include "devices.h"
47 46
diff --git a/arch/arm/mach-pxa/xcep.c b/arch/arm/mach-pxa/xcep.c
index 51c0281c6e0a..f55f8f2e0db3 100644
--- a/arch/arm/mach-pxa/xcep.c
+++ b/arch/arm/mach-pxa/xcep.c
@@ -16,6 +16,7 @@
16 16
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/i2c.h> 18#include <linux/i2c.h>
19#include <linux/i2c/pxa-i2c.h>
19#include <linux/smc91x.h> 20#include <linux/smc91x.h>
20#include <linux/mtd/mtd.h> 21#include <linux/mtd/mtd.h>
21#include <linux/mtd/partitions.h> 22#include <linux/mtd/partitions.h>
@@ -26,8 +27,6 @@
26#include <asm/mach/irq.h> 27#include <asm/mach/irq.h>
27#include <asm/mach/map.h> 28#include <asm/mach/map.h>
28 29
29#include <plat/i2c.h>
30
31#include <mach/hardware.h> 30#include <mach/hardware.h>
32#include <mach/pxa2xx-regs.h> 31#include <mach/pxa2xx-regs.h>
33#include <mach/mfp-pxa25x.h> 32#include <mach/mfp-pxa25x.h>
diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c
index a323e076129e..aaf883754ef4 100644
--- a/arch/arm/mach-pxa/z2.c
+++ b/arch/arm/mach-pxa/z2.c
@@ -29,6 +29,7 @@
29#include <linux/gpio_keys.h> 29#include <linux/gpio_keys.h>
30#include <linux/delay.h> 30#include <linux/delay.h>
31#include <linux/regulator/machine.h> 31#include <linux/regulator/machine.h>
32#include <linux/i2c/pxa-i2c.h>
32 33
33#include <asm/mach-types.h> 34#include <asm/mach-types.h>
34#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
@@ -40,8 +41,6 @@
40#include <mach/mmc.h> 41#include <mach/mmc.h>
41#include <plat/pxa27x_keypad.h> 42#include <plat/pxa27x_keypad.h>
42 43
43#include <plat/i2c.h>
44
45#include "generic.h" 44#include "generic.h"
46#include "devices.h" 45#include "devices.h"
47 46
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
index f4b053b35815..730f51e57c17 100644
--- a/arch/arm/mach-pxa/zeus.c
+++ b/arch/arm/mach-pxa/zeus.c
@@ -25,6 +25,7 @@
25#include <linux/mtd/partitions.h> 25#include <linux/mtd/partitions.h>
26#include <linux/mtd/physmap.h> 26#include <linux/mtd/physmap.h>
27#include <linux/i2c.h> 27#include <linux/i2c.h>
28#include <linux/i2c/pxa-i2c.h>
28#include <linux/i2c/pca953x.h> 29#include <linux/i2c/pca953x.h>
29#include <linux/apm-emulation.h> 30#include <linux/apm-emulation.h>
30#include <linux/can/platform/mcp251x.h> 31#include <linux/can/platform/mcp251x.h>
@@ -33,8 +34,6 @@
33#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
34#include <asm/mach/map.h> 35#include <asm/mach/map.h>
35 36
36#include <plat/i2c.h>
37
38#include <mach/pxa2xx-regs.h> 37#include <mach/pxa2xx-regs.h>
39#include <mach/regs-uart.h> 38#include <mach/regs-uart.h>
40#include <mach/ohci.h> 39#include <mach/ohci.h>
@@ -676,7 +675,7 @@ static struct pxa2xx_udc_mach_info zeus_udc_info = {
676static void zeus_power_off(void) 675static void zeus_power_off(void)
677{ 676{
678 local_irq_disable(); 677 local_irq_disable();
679 pxa27x_cpu_suspend(PWRMODE_DEEPSLEEP); 678 pxa27x_cpu_suspend(PWRMODE_DEEPSLEEP, PLAT_PHYS_OFFSET - PAGE_OFFSET);
680} 679}
681#else 680#else
682#define zeus_power_off NULL 681#define zeus_power_off NULL
diff --git a/arch/arm/mach-pxa/zylonite_pxa300.c b/arch/arm/mach-pxa/zylonite_pxa300.c
index 3aa73b3e33f2..93c64d8d7de9 100644
--- a/arch/arm/mach-pxa/zylonite_pxa300.c
+++ b/arch/arm/mach-pxa/zylonite_pxa300.c
@@ -17,11 +17,11 @@
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/i2c.h> 19#include <linux/i2c.h>
20#include <linux/i2c/pxa-i2c.h>
20#include <linux/i2c/pca953x.h> 21#include <linux/i2c/pca953x.h>
21#include <linux/gpio.h> 22#include <linux/gpio.h>
22 23
23#include <mach/pxa300.h> 24#include <mach/pxa300.h>
24#include <plat/i2c.h>
25#include <mach/zylonite.h> 25#include <mach/zylonite.h>
26 26
27#include "generic.h" 27#include "generic.h"
diff --git a/arch/arm/mach-realview/Kconfig b/arch/arm/mach-realview/Kconfig
index b4575ae9648e..b9a9805e4828 100644
--- a/arch/arm/mach-realview/Kconfig
+++ b/arch/arm/mach-realview/Kconfig
@@ -2,52 +2,57 @@ menu "RealView platform type"
2 depends on ARCH_REALVIEW 2 depends on ARCH_REALVIEW
3 3
4config MACH_REALVIEW_EB 4config MACH_REALVIEW_EB
5 bool "Support RealView/EB platform" 5 bool "Support RealView(R) Emulation Baseboard"
6 select ARM_GIC 6 select ARM_GIC
7 help 7 help
8 Include support for the ARM(R) RealView Emulation Baseboard platform. 8 Include support for the ARM(R) RealView(R) Emulation Baseboard
9 platform.
9 10
10config REALVIEW_EB_A9MP 11config REALVIEW_EB_A9MP
11 bool "Support Multicore Cortex-A9" 12 bool "Support Multicore Cortex-A9 Tile"
12 depends on MACH_REALVIEW_EB 13 depends on MACH_REALVIEW_EB
13 select CPU_V7 14 select CPU_V7
14 help 15 help
15 Enable support for the Cortex-A9MPCore tile on the Realview platform. 16 Enable support for the Cortex-A9MPCore tile fitted to the
17 Realview(R) Emulation Baseboard platform.
16 18
17config REALVIEW_EB_ARM11MP 19config REALVIEW_EB_ARM11MP
18 bool "Support ARM11MPCore tile" 20 bool "Support ARM11MPCore Tile"
19 depends on MACH_REALVIEW_EB 21 depends on MACH_REALVIEW_EB
20 select CPU_V6 22 select CPU_V6K
21 select ARCH_HAS_BARRIERS if SMP 23 select ARCH_HAS_BARRIERS if SMP
22 help 24 help
23 Enable support for the ARM11MPCore tile on the Realview platform. 25 Enable support for the ARM11MPCore tile fitted to the Realview(R)
26 Emulation Baseboard platform.
24 27
25config REALVIEW_EB_ARM11MP_REVB 28config REALVIEW_EB_ARM11MP_REVB
26 bool "Support ARM11MPCore RevB tile" 29 bool "Support ARM11MPCore RevB Tile"
27 depends on REALVIEW_EB_ARM11MP 30 depends on REALVIEW_EB_ARM11MP
28 help 31 help
29 Enable support for the ARM11MPCore RevB tile on the Realview 32 Enable support for the ARM11MPCore Revision B tile on the
30 platform. Since there are device address differences, a 33 Realview(R) Emulation Baseboard platform. Since there are device
31 kernel built with this option enabled is not compatible with 34 address differences, a kernel built with this option enabled is
32 other revisions of the ARM11MPCore tile. 35 not compatible with other revisions of the ARM11MPCore tile.
33 36
34config MACH_REALVIEW_PB11MP 37config MACH_REALVIEW_PB11MP
35 bool "Support RealView/PB11MPCore platform" 38 bool "Support RealView(R) Platform Baseboard for ARM11MPCore"
36 select CPU_V6 39 select CPU_V6K
37 select ARM_GIC 40 select ARM_GIC
38 select HAVE_PATA_PLATFORM 41 select HAVE_PATA_PLATFORM
39 select ARCH_HAS_BARRIERS if SMP 42 select ARCH_HAS_BARRIERS if SMP
40 help 43 help
41 Include support for the ARM(R) RealView MPCore Platform Baseboard. 44 Include support for the ARM(R) RealView(R) Platform Baseboard for
42 PB11MPCore is a platform with an on-board ARM11MPCore and has 45 the ARM11MPCore. This platform has an on-board ARM11MPCore and has
43 support for PCI-E and Compact Flash. 46 support for PCI-E and Compact Flash.
44 47
48# ARMv6 CPU without K extensions, but does have the new exclusive ops
45config MACH_REALVIEW_PB1176 49config MACH_REALVIEW_PB1176
46 bool "Support RealView/PB1176 platform" 50 bool "Support RealView(R) Platform Baseboard for ARM1176JZF-S"
47 select CPU_V6 51 select CPU_V6
48 select ARM_GIC 52 select ARM_GIC
49 help 53 help
50 Include support for the ARM(R) RealView ARM1176 Platform Baseboard. 54 Include support for the ARM(R) RealView(R) Platform Baseboard for
55 ARM1176JZF-S.
51 56
52config REALVIEW_PB1176_SECURE_FLASH 57config REALVIEW_PB1176_SECURE_FLASH
53 bool "Allow access to the secure flash memory block" 58 bool "Allow access to the secure flash memory block"
@@ -59,23 +64,24 @@ config REALVIEW_PB1176_SECURE_FLASH
59 block (64MB @ 0x3c000000) is required. 64 block (64MB @ 0x3c000000) is required.
60 65
61config MACH_REALVIEW_PBA8 66config MACH_REALVIEW_PBA8
62 bool "Support RealView/PB-A8 platform" 67 bool "Support RealView(R) Platform Baseboard for Cortex(tm)-A8 platform"
63 select CPU_V7 68 select CPU_V7
64 select ARM_GIC 69 select ARM_GIC
65 select HAVE_PATA_PLATFORM 70 select HAVE_PATA_PLATFORM
66 help 71 help
67 Include support for the ARM(R) RealView Cortex-A8 Platform Baseboard. 72 Include support for the ARM(R) RealView Platform Baseboard for
68 PB-A8 is a platform with an on-board Cortex-A8 and has support for 73 Cortex(tm)-A8. This platform has an on-board Cortex-A8 and has
69 PCI-E and Compact Flash. 74 support for PCI-E and Compact Flash.
70 75
71config MACH_REALVIEW_PBX 76config MACH_REALVIEW_PBX
72 bool "Support RealView/PBX platform" 77 bool "Support RealView(R) Platform Baseboard Explore"
73 select ARM_GIC 78 select ARM_GIC
74 select HAVE_PATA_PLATFORM 79 select HAVE_PATA_PLATFORM
75 select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !REALVIEW_HIGH_PHYS_OFFSET 80 select ARCH_SPARSEMEM_ENABLE if CPU_V7 && !REALVIEW_HIGH_PHYS_OFFSET
76 select ZONE_DMA if SPARSEMEM 81 select ZONE_DMA if SPARSEMEM
77 help 82 help
78 Include support for the ARM(R) RealView PBX platform. 83 Include support for the ARM(R) RealView(R) Platform Baseboard
84 Explore.
79 85
80config REALVIEW_HIGH_PHYS_OFFSET 86config REALVIEW_HIGH_PHYS_OFFSET
81 bool "High physical base address for the RealView platform" 87 bool "High physical base address for the RealView platform"
diff --git a/arch/arm/mach-realview/Makefile b/arch/arm/mach-realview/Makefile
index a01b76b7c956..541fa4c109ef 100644
--- a/arch/arm/mach-realview/Makefile
+++ b/arch/arm/mach-realview/Makefile
@@ -8,6 +8,5 @@ obj-$(CONFIG_MACH_REALVIEW_PB11MP) += realview_pb11mp.o
8obj-$(CONFIG_MACH_REALVIEW_PB1176) += realview_pb1176.o 8obj-$(CONFIG_MACH_REALVIEW_PB1176) += realview_pb1176.o
9obj-$(CONFIG_MACH_REALVIEW_PBA8) += realview_pba8.o 9obj-$(CONFIG_MACH_REALVIEW_PBA8) += realview_pba8.o
10obj-$(CONFIG_MACH_REALVIEW_PBX) += realview_pbx.o 10obj-$(CONFIG_MACH_REALVIEW_PBX) += realview_pbx.o
11obj-$(CONFIG_SMP) += platsmp.o headsmp.o 11obj-$(CONFIG_SMP) += platsmp.o
12obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 12obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
13obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 1c6602cf50e4..75dbc8791d05 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -51,6 +51,7 @@
51#include <mach/irqs.h> 51#include <mach/irqs.h>
52#include <asm/hardware/timer-sp.h> 52#include <asm/hardware/timer-sp.h>
53 53
54#include <plat/clcd.h>
54#include <plat/sched_clock.h> 55#include <plat/sched_clock.h>
55 56
56#include "core.h" 57#include "core.h"
@@ -359,18 +360,19 @@ static struct clk_lookup lookups[] = {
359 } 360 }
360}; 361};
361 362
362static int __init clk_init(void) 363void __init realview_init_early(void)
363{ 364{
365 void __iomem *sys = __io_address(REALVIEW_SYS_BASE);
366
364 if (machine_is_realview_pb1176()) 367 if (machine_is_realview_pb1176())
365 oscvco_clk.vcoreg = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC0_OFFSET; 368 oscvco_clk.vcoreg = sys + REALVIEW_SYS_OSC0_OFFSET;
366 else 369 else
367 oscvco_clk.vcoreg = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_OSC4_OFFSET; 370 oscvco_clk.vcoreg = sys + REALVIEW_SYS_OSC4_OFFSET;
368 371
369 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 372 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
370 373
371 return 0; 374 versatile_sched_clock_init(sys + REALVIEW_SYS_24MHz_OFFSET, 24000000);
372} 375}
373core_initcall(clk_init);
374 376
375/* 377/*
376 * CLCD support. 378 * CLCD support.
@@ -385,157 +387,6 @@ core_initcall(clk_init);
385#define SYS_CLCD_ID_SANYO_2_5 (0x07 << 8) 387#define SYS_CLCD_ID_SANYO_2_5 (0x07 << 8)
386#define SYS_CLCD_ID_VGA (0x1f << 8) 388#define SYS_CLCD_ID_VGA (0x1f << 8)
387 389
388static struct clcd_panel vga = {
389 .mode = {
390 .name = "VGA",
391 .refresh = 60,
392 .xres = 640,
393 .yres = 480,
394 .pixclock = 39721,
395 .left_margin = 40,
396 .right_margin = 24,
397 .upper_margin = 32,
398 .lower_margin = 11,
399 .hsync_len = 96,
400 .vsync_len = 2,
401 .sync = 0,
402 .vmode = FB_VMODE_NONINTERLACED,
403 },
404 .width = -1,
405 .height = -1,
406 .tim2 = TIM2_BCD | TIM2_IPC,
407 .cntl = CNTL_LCDTFT | CNTL_BGR | CNTL_LCDVCOMP(1),
408 .bpp = 16,
409};
410
411static struct clcd_panel xvga = {
412 .mode = {
413 .name = "XVGA",
414 .refresh = 60,
415 .xres = 1024,
416 .yres = 768,
417 .pixclock = 15748,
418 .left_margin = 152,
419 .right_margin = 48,
420 .upper_margin = 23,
421 .lower_margin = 3,
422 .hsync_len = 104,
423 .vsync_len = 4,
424 .sync = 0,
425 .vmode = FB_VMODE_NONINTERLACED,
426 },
427 .width = -1,
428 .height = -1,
429 .tim2 = TIM2_BCD | TIM2_IPC,
430 .cntl = CNTL_LCDTFT | CNTL_BGR | CNTL_LCDVCOMP(1),
431 .bpp = 16,
432};
433
434static struct clcd_panel sanyo_3_8_in = {
435 .mode = {
436 .name = "Sanyo QVGA",
437 .refresh = 116,
438 .xres = 320,
439 .yres = 240,
440 .pixclock = 100000,
441 .left_margin = 6,
442 .right_margin = 6,
443 .upper_margin = 5,
444 .lower_margin = 5,
445 .hsync_len = 6,
446 .vsync_len = 6,
447 .sync = 0,
448 .vmode = FB_VMODE_NONINTERLACED,
449 },
450 .width = -1,
451 .height = -1,
452 .tim2 = TIM2_BCD,
453 .cntl = CNTL_LCDTFT | CNTL_BGR | CNTL_LCDVCOMP(1),
454 .bpp = 16,
455};
456
457static struct clcd_panel sanyo_2_5_in = {
458 .mode = {
459 .name = "Sanyo QVGA Portrait",
460 .refresh = 116,
461 .xres = 240,
462 .yres = 320,
463 .pixclock = 100000,
464 .left_margin = 20,
465 .right_margin = 10,
466 .upper_margin = 2,
467 .lower_margin = 2,
468 .hsync_len = 10,
469 .vsync_len = 2,
470 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
471 .vmode = FB_VMODE_NONINTERLACED,
472 },
473 .width = -1,
474 .height = -1,
475 .tim2 = TIM2_IVS | TIM2_IHS | TIM2_IPC,
476 .cntl = CNTL_LCDTFT | CNTL_BGR | CNTL_LCDVCOMP(1),
477 .bpp = 16,
478};
479
480static struct clcd_panel epson_2_2_in = {
481 .mode = {
482 .name = "Epson QCIF",
483 .refresh = 390,
484 .xres = 176,
485 .yres = 220,
486 .pixclock = 62500,
487 .left_margin = 3,
488 .right_margin = 2,
489 .upper_margin = 1,
490 .lower_margin = 0,
491 .hsync_len = 3,
492 .vsync_len = 2,
493 .sync = 0,
494 .vmode = FB_VMODE_NONINTERLACED,
495 },
496 .width = -1,
497 .height = -1,
498 .tim2 = TIM2_BCD | TIM2_IPC,
499 .cntl = CNTL_LCDTFT | CNTL_BGR | CNTL_LCDVCOMP(1),
500 .bpp = 16,
501};
502
503/*
504 * Detect which LCD panel is connected, and return the appropriate
505 * clcd_panel structure. Note: we do not have any information on
506 * the required timings for the 8.4in panel, so we presently assume
507 * VGA timings.
508 */
509static struct clcd_panel *realview_clcd_panel(void)
510{
511 void __iomem *sys_clcd = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_CLCD_OFFSET;
512 struct clcd_panel *vga_panel;
513 struct clcd_panel *panel;
514 u32 val;
515
516 if (machine_is_realview_eb())
517 vga_panel = &vga;
518 else
519 vga_panel = &xvga;
520
521 val = readl(sys_clcd) & SYS_CLCD_ID_MASK;
522 if (val == SYS_CLCD_ID_SANYO_3_8)
523 panel = &sanyo_3_8_in;
524 else if (val == SYS_CLCD_ID_SANYO_2_5)
525 panel = &sanyo_2_5_in;
526 else if (val == SYS_CLCD_ID_EPSON_2_2)
527 panel = &epson_2_2_in;
528 else if (val == SYS_CLCD_ID_VGA)
529 panel = vga_panel;
530 else {
531 printk(KERN_ERR "CLCD: unknown LCD panel ID 0x%08x, using VGA\n",
532 val);
533 panel = vga_panel;
534 }
535
536 return panel;
537}
538
539/* 390/*
540 * Disable all display connectors on the interface module. 391 * Disable all display connectors on the interface module.
541 */ 392 */
@@ -565,56 +416,60 @@ static void realview_clcd_enable(struct clcd_fb *fb)
565 writel(val, sys_clcd); 416 writel(val, sys_clcd);
566} 417}
567 418
419/*
420 * Detect which LCD panel is connected, and return the appropriate
421 * clcd_panel structure. Note: we do not have any information on
422 * the required timings for the 8.4in panel, so we presently assume
423 * VGA timings.
424 */
568static int realview_clcd_setup(struct clcd_fb *fb) 425static int realview_clcd_setup(struct clcd_fb *fb)
569{ 426{
427 void __iomem *sys_clcd = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_CLCD_OFFSET;
428 const char *panel_name, *vga_panel_name;
570 unsigned long framesize; 429 unsigned long framesize;
571 dma_addr_t dma; 430 u32 val;
572 431
573 if (machine_is_realview_eb()) 432 if (machine_is_realview_eb()) {
574 /* VGA, 16bpp */ 433 /* VGA, 16bpp */
575 framesize = 640 * 480 * 2; 434 framesize = 640 * 480 * 2;
576 else 435 vga_panel_name = "VGA";
436 } else {
577 /* XVGA, 16bpp */ 437 /* XVGA, 16bpp */
578 framesize = 1024 * 768 * 2; 438 framesize = 1024 * 768 * 2;
579 439 vga_panel_name = "XVGA";
580 fb->panel = realview_clcd_panel();
581
582 fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize,
583 &dma, GFP_KERNEL | GFP_DMA);
584 if (!fb->fb.screen_base) {
585 printk(KERN_ERR "CLCD: unable to map framebuffer\n");
586 return -ENOMEM;
587 } 440 }
588 441
589 fb->fb.fix.smem_start = dma; 442 val = readl(sys_clcd) & SYS_CLCD_ID_MASK;
590 fb->fb.fix.smem_len = framesize; 443 if (val == SYS_CLCD_ID_SANYO_3_8)
591 444 panel_name = "Sanyo TM38QV67A02A";
592 return 0; 445 else if (val == SYS_CLCD_ID_SANYO_2_5)
593} 446 panel_name = "Sanyo QVGA Portrait";
447 else if (val == SYS_CLCD_ID_EPSON_2_2)
448 panel_name = "Epson L2F50113T00";
449 else if (val == SYS_CLCD_ID_VGA)
450 panel_name = vga_panel_name;
451 else {
452 pr_err("CLCD: unknown LCD panel ID 0x%08x, using VGA\n", val);
453 panel_name = vga_panel_name;
454 }
594 455
595static int realview_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma) 456 fb->panel = versatile_clcd_get_panel(panel_name);
596{ 457 if (!fb->panel)
597 return dma_mmap_writecombine(&fb->dev->dev, vma, 458 return -EINVAL;
598 fb->fb.screen_base,
599 fb->fb.fix.smem_start,
600 fb->fb.fix.smem_len);
601}
602 459
603static void realview_clcd_remove(struct clcd_fb *fb) 460 return versatile_clcd_setup_dma(fb, framesize);
604{
605 dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len,
606 fb->fb.screen_base, fb->fb.fix.smem_start);
607} 461}
608 462
609struct clcd_board clcd_plat_data = { 463struct clcd_board clcd_plat_data = {
610 .name = "RealView", 464 .name = "RealView",
465 .caps = CLCD_CAP_ALL,
611 .check = clcdfb_check, 466 .check = clcdfb_check,
612 .decode = clcdfb_decode, 467 .decode = clcdfb_decode,
613 .disable = realview_clcd_disable, 468 .disable = realview_clcd_disable,
614 .enable = realview_clcd_enable, 469 .enable = realview_clcd_enable,
615 .setup = realview_clcd_setup, 470 .setup = realview_clcd_setup,
616 .mmap = realview_clcd_mmap, 471 .mmap = versatile_clcd_mmap_dma,
617 .remove = realview_clcd_remove, 472 .remove = versatile_clcd_remove_dma,
618}; 473};
619 474
620#ifdef CONFIG_LEDS 475#ifdef CONFIG_LEDS
@@ -656,12 +511,6 @@ void realview_leds_event(led_event_t ledevt)
656#endif /* CONFIG_LEDS */ 511#endif /* CONFIG_LEDS */
657 512
658/* 513/*
659 * The sched_clock counter
660 */
661#define REFCOUNTER (__io_address(REALVIEW_SYS_BASE) + \
662 REALVIEW_SYS_24MHz_OFFSET)
663
664/*
665 * Where is the timer (VA)? 514 * Where is the timer (VA)?
666 */ 515 */
667void __iomem *timer0_va_base; 516void __iomem *timer0_va_base;
@@ -676,8 +525,6 @@ void __init realview_timer_init(unsigned int timer_irq)
676{ 525{
677 u32 val; 526 u32 val;
678 527
679 versatile_sched_clock_init(REFCOUNTER, 24000000);
680
681 /* 528 /*
682 * set clock frequency: 529 * set clock frequency:
683 * REALVIEW_REFCLK is 32KHz 530 * REALVIEW_REFCLK is 32KHz
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h
index 693239ddc39e..5c83d1e87a03 100644
--- a/arch/arm/mach-realview/core.h
+++ b/arch/arm/mach-realview/core.h
@@ -42,7 +42,6 @@ static struct amba_device name##_device = { \
42 }, \ 42 }, \
43 .dma_mask = ~0, \ 43 .dma_mask = ~0, \
44 .irq = base##_IRQ, \ 44 .irq = base##_IRQ, \
45 /* .dma = base##_DMA,*/ \
46} 45}
47 46
48struct machine_desc; 47struct machine_desc;
@@ -63,6 +62,7 @@ extern void realview_timer_init(unsigned int timer_irq);
63extern int realview_flash_register(struct resource *res, u32 num); 62extern int realview_flash_register(struct resource *res, u32 num);
64extern int realview_eth_register(const char *name, struct resource *res); 63extern int realview_eth_register(const char *name, struct resource *res);
65extern int realview_usb_register(struct resource *res); 64extern int realview_usb_register(struct resource *res);
65extern void realview_init_early(void);
66extern void realview_fixup(struct machine_desc *mdesc, struct tag *tags, 66extern void realview_fixup(struct machine_desc *mdesc, struct tag *tags,
67 char **from, struct meminfo *meminfo); 67 char **from, struct meminfo *meminfo);
68extern void (*realview_reset)(char); 68extern void (*realview_reset)(char);
diff --git a/arch/arm/mach-realview/headsmp.S b/arch/arm/mach-realview/headsmp.S
deleted file mode 100644
index b34be4554d40..000000000000
--- a/arch/arm/mach-realview/headsmp.S
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * linux/arch/arm/mach-realview/headsmp.S
3 *
4 * Copyright (c) 2003 ARM Limited
5 * 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 version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/linkage.h>
12#include <linux/init.h>
13
14 __INIT
15
16/*
17 * Realview specific entry point for secondary CPUs. This provides
18 * a "holding pen" into which all secondary cores are held until we're
19 * ready for them to initialise.
20 */
21ENTRY(realview_secondary_startup)
22 mrc p15, 0, r0, c0, c0, 5
23 and r0, r0, #15
24 adr r4, 1f
25 ldmia r4, {r5, r6}
26 sub r4, r4, r5
27 add r6, r6, r4
28pen: ldr r7, [r6]
29 cmp r7, r0
30 bne pen
31
32 /*
33 * we've been released from the holding pen: secondary_stack
34 * should now contain the SVC stack for this core
35 */
36 b secondary_startup
37
38 .align
391: .long .
40 .long pen_release
diff --git a/arch/arm/mach-realview/include/mach/memory.h b/arch/arm/mach-realview/include/mach/memory.h
index 5dafc157b276..e05fc2c4c080 100644
--- a/arch/arm/mach-realview/include/mach/memory.h
+++ b/arch/arm/mach-realview/include/mach/memory.h
@@ -24,9 +24,9 @@
24 * Physical DRAM offset. 24 * Physical DRAM offset.
25 */ 25 */
26#ifdef CONFIG_REALVIEW_HIGH_PHYS_OFFSET 26#ifdef CONFIG_REALVIEW_HIGH_PHYS_OFFSET
27#define PHYS_OFFSET UL(0x70000000) 27#define PLAT_PHYS_OFFSET UL(0x70000000)
28#else 28#else
29#define 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#if !defined(__ASSEMBLY__) && defined(CONFIG_ZONE_DMA)
diff --git a/arch/arm/mach-realview/localtimer.c b/arch/arm/mach-realview/localtimer.c
deleted file mode 100644
index 60b4e111f459..000000000000
--- a/arch/arm/mach-realview/localtimer.c
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * linux/arch/arm/mach-realview/localtimer.c
3 *
4 * Copyright (C) 2002 ARM Ltd.
5 * 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 version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/init.h>
12#include <linux/smp.h>
13#include <linux/clockchips.h>
14
15#include <asm/irq.h>
16#include <asm/smp_twd.h>
17#include <asm/localtimer.h>
18
19/*
20 * Setup the local clock events for a CPU.
21 */
22void __cpuinit local_timer_setup(struct clock_event_device *evt)
23{
24 evt->irq = IRQ_LOCALTIMER;
25 twd_timer_setup(evt);
26}
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c
index a22bf67f2f78..23919229e12d 100644
--- a/arch/arm/mach-realview/platsmp.c
+++ b/arch/arm/mach-realview/platsmp.c
@@ -10,44 +10,21 @@
10 */ 10 */
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/errno.h> 12#include <linux/errno.h>
13#include <linux/delay.h>
14#include <linux/device.h>
15#include <linux/jiffies.h>
16#include <linux/smp.h> 13#include <linux/smp.h>
17#include <linux/io.h> 14#include <linux/io.h>
18 15
19#include <asm/cacheflush.h>
20#include <mach/hardware.h> 16#include <mach/hardware.h>
21#include <asm/mach-types.h> 17#include <asm/mach-types.h>
18#include <asm/smp_scu.h>
22#include <asm/unified.h> 19#include <asm/unified.h>
23 20
24#include <mach/board-eb.h> 21#include <mach/board-eb.h>
25#include <mach/board-pb11mp.h> 22#include <mach/board-pb11mp.h>
26#include <mach/board-pbx.h> 23#include <mach/board-pbx.h>
27#include <asm/smp_scu.h>
28 24
29#include "core.h" 25#include "core.h"
30 26
31extern void realview_secondary_startup(void); 27extern void versatile_secondary_startup(void);
32
33/*
34 * control for which core is the next to come out of the secondary
35 * boot "holding pen"
36 */
37volatile int __cpuinitdata pen_release = -1;
38
39/*
40 * Write pen_release in a way that is guaranteed to be visible to all
41 * observers, irrespective of whether they're taking part in coherency
42 * or not. This is necessary for the hotplug code to work reliably.
43 */
44static void write_pen_release(int val)
45{
46 pen_release = val;
47 smp_wmb();
48 __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
49 outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
50}
51 28
52static void __iomem *scu_base_addr(void) 29static void __iomem *scu_base_addr(void)
53{ 30{
@@ -62,75 +39,6 @@ static void __iomem *scu_base_addr(void)
62 return (void __iomem *)0; 39 return (void __iomem *)0;
63} 40}
64 41
65static DEFINE_SPINLOCK(boot_lock);
66
67void __cpuinit platform_secondary_init(unsigned int cpu)
68{
69 /*
70 * if any interrupts are already enabled for the primary
71 * core (e.g. timer irq), then they will not have been enabled
72 * for us: do so
73 */
74 gic_secondary_init(0);
75
76 /*
77 * let the primary processor know we're out of the
78 * pen, then head off into the C entry point
79 */
80 write_pen_release(-1);
81
82 /*
83 * Synchronise with the boot thread.
84 */
85 spin_lock(&boot_lock);
86 spin_unlock(&boot_lock);
87}
88
89int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
90{
91 unsigned long timeout;
92
93 /*
94 * set synchronisation state between this boot processor
95 * and the secondary one
96 */
97 spin_lock(&boot_lock);
98
99 /*
100 * The secondary processor is waiting to be released from
101 * the holding pen - release it, then wait for it to flag
102 * that it has been released by resetting pen_release.
103 *
104 * Note that "pen_release" is the hardware CPU ID, whereas
105 * "cpu" is Linux's internal ID.
106 */
107 write_pen_release(cpu);
108
109 /*
110 * Send the secondary CPU a soft interrupt, thereby causing
111 * the boot monitor to read the system wide flags register,
112 * and branch to the address found there.
113 */
114 smp_cross_call(cpumask_of(cpu), 1);
115
116 timeout = jiffies + (1 * HZ);
117 while (time_before(jiffies, timeout)) {
118 smp_rmb();
119 if (pen_release == -1)
120 break;
121
122 udelay(10);
123 }
124
125 /*
126 * now the secondary core is starting up let it run its
127 * calibrations, then wait for it to finish
128 */
129 spin_unlock(&boot_lock);
130
131 return pen_release != -1 ? -ENOSYS : 0;
132}
133
134/* 42/*
135 * Initialise the CPU possible map early - this describes the CPUs 43 * Initialise the CPU possible map early - this describes the CPUs
136 * which may be present or become present in the system. 44 * which may be present or become present in the system.
@@ -174,6 +82,6 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
174 * until it receives a soft interrupt, and then the 82 * until it receives a soft interrupt, and then the
175 * secondary CPU branches to this address. 83 * secondary CPU branches to this address.
176 */ 84 */
177 __raw_writel(BSYM(virt_to_phys(realview_secondary_startup)), 85 __raw_writel(BSYM(virt_to_phys(versatile_secondary_startup)),
178 __io_address(REALVIEW_SYS_FLAGSSET)); 86 __io_address(REALVIEW_SYS_FLAGSSET));
179} 87}
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index 6ef5c5e528b2..2ecc1d94284e 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -144,60 +144,39 @@ static struct pl022_ssp_controller ssp0_plat_data = {
144 * These devices are connected via the core APB bridge 144 * These devices are connected via the core APB bridge
145 */ 145 */
146#define GPIO2_IRQ { IRQ_EB_GPIO2, NO_IRQ } 146#define GPIO2_IRQ { IRQ_EB_GPIO2, NO_IRQ }
147#define GPIO2_DMA { 0, 0 }
148#define GPIO3_IRQ { IRQ_EB_GPIO3, NO_IRQ } 147#define GPIO3_IRQ { IRQ_EB_GPIO3, NO_IRQ }
149#define GPIO3_DMA { 0, 0 }
150 148
151#define AACI_IRQ { IRQ_EB_AACI, NO_IRQ } 149#define AACI_IRQ { IRQ_EB_AACI, NO_IRQ }
152#define AACI_DMA { 0x80, 0x81 }
153#define MMCI0_IRQ { IRQ_EB_MMCI0A, IRQ_EB_MMCI0B } 150#define MMCI0_IRQ { IRQ_EB_MMCI0A, IRQ_EB_MMCI0B }
154#define MMCI0_DMA { 0x84, 0 }
155#define KMI0_IRQ { IRQ_EB_KMI0, NO_IRQ } 151#define KMI0_IRQ { IRQ_EB_KMI0, NO_IRQ }
156#define KMI0_DMA { 0, 0 }
157#define KMI1_IRQ { IRQ_EB_KMI1, NO_IRQ } 152#define KMI1_IRQ { IRQ_EB_KMI1, NO_IRQ }
158#define KMI1_DMA { 0, 0 }
159 153
160/* 154/*
161 * These devices are connected directly to the multi-layer AHB switch 155 * These devices are connected directly to the multi-layer AHB switch
162 */ 156 */
163#define EB_SMC_IRQ { NO_IRQ, NO_IRQ } 157#define EB_SMC_IRQ { NO_IRQ, NO_IRQ }
164#define EB_SMC_DMA { 0, 0 }
165#define MPMC_IRQ { NO_IRQ, NO_IRQ } 158#define MPMC_IRQ { NO_IRQ, NO_IRQ }
166#define MPMC_DMA { 0, 0 }
167#define EB_CLCD_IRQ { IRQ_EB_CLCD, NO_IRQ } 159#define EB_CLCD_IRQ { IRQ_EB_CLCD, NO_IRQ }
168#define EB_CLCD_DMA { 0, 0 }
169#define DMAC_IRQ { IRQ_EB_DMA, NO_IRQ } 160#define DMAC_IRQ { IRQ_EB_DMA, NO_IRQ }
170#define DMAC_DMA { 0, 0 }
171 161
172/* 162/*
173 * These devices are connected via the core APB bridge 163 * These devices are connected via the core APB bridge
174 */ 164 */
175#define SCTL_IRQ { NO_IRQ, NO_IRQ } 165#define SCTL_IRQ { NO_IRQ, NO_IRQ }
176#define SCTL_DMA { 0, 0 }
177#define EB_WATCHDOG_IRQ { IRQ_EB_WDOG, NO_IRQ } 166#define EB_WATCHDOG_IRQ { IRQ_EB_WDOG, NO_IRQ }
178#define EB_WATCHDOG_DMA { 0, 0 }
179#define EB_GPIO0_IRQ { IRQ_EB_GPIO0, NO_IRQ } 167#define EB_GPIO0_IRQ { IRQ_EB_GPIO0, NO_IRQ }
180#define EB_GPIO0_DMA { 0, 0 }
181#define GPIO1_IRQ { IRQ_EB_GPIO1, NO_IRQ } 168#define GPIO1_IRQ { IRQ_EB_GPIO1, NO_IRQ }
182#define GPIO1_DMA { 0, 0 }
183#define EB_RTC_IRQ { IRQ_EB_RTC, NO_IRQ } 169#define EB_RTC_IRQ { IRQ_EB_RTC, NO_IRQ }
184#define EB_RTC_DMA { 0, 0 }
185 170
186/* 171/*
187 * These devices are connected via the DMA APB bridge 172 * These devices are connected via the DMA APB bridge
188 */ 173 */
189#define SCI_IRQ { IRQ_EB_SCI, NO_IRQ } 174#define SCI_IRQ { IRQ_EB_SCI, NO_IRQ }
190#define SCI_DMA { 7, 6 }
191#define EB_UART0_IRQ { IRQ_EB_UART0, NO_IRQ } 175#define EB_UART0_IRQ { IRQ_EB_UART0, NO_IRQ }
192#define EB_UART0_DMA { 15, 14 }
193#define EB_UART1_IRQ { IRQ_EB_UART1, NO_IRQ } 176#define EB_UART1_IRQ { IRQ_EB_UART1, NO_IRQ }
194#define EB_UART1_DMA { 13, 12 }
195#define EB_UART2_IRQ { IRQ_EB_UART2, NO_IRQ } 177#define EB_UART2_IRQ { IRQ_EB_UART2, NO_IRQ }
196#define EB_UART2_DMA { 11, 10 }
197#define EB_UART3_IRQ { IRQ_EB_UART3, NO_IRQ } 178#define EB_UART3_IRQ { IRQ_EB_UART3, NO_IRQ }
198#define EB_UART3_DMA { 0x86, 0x87 }
199#define EB_SSP_IRQ { IRQ_EB_SSP, NO_IRQ } 179#define EB_SSP_IRQ { IRQ_EB_SSP, NO_IRQ }
200#define EB_SSP_DMA { 9, 8 }
201 180
202/* FPGA Primecells */ 181/* FPGA Primecells */
203AMBA_DEVICE(aaci, "fpga:aaci", AACI, NULL); 182AMBA_DEVICE(aaci, "fpga:aaci", AACI, NULL);
@@ -484,9 +463,10 @@ static void __init realview_eb_init(void)
484 463
485MACHINE_START(REALVIEW_EB, "ARM-RealView EB") 464MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
486 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 465 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
487 .boot_params = PHYS_OFFSET + 0x00000100, 466 .boot_params = PLAT_PHYS_OFFSET + 0x00000100,
488 .fixup = realview_fixup, 467 .fixup = realview_fixup,
489 .map_io = realview_eb_map_io, 468 .map_io = realview_eb_map_io,
469 .init_early = realview_init_early,
490 .init_irq = gic_init_irq, 470 .init_irq = gic_init_irq,
491 .timer = &realview_eb_timer, 471 .timer = &realview_eb_timer,
492 .init_machine = realview_eb_init, 472 .init_machine = realview_eb_init,
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index cbdc97a5685f..eab6070f66d0 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -134,47 +134,26 @@ static struct pl022_ssp_controller ssp0_plat_data = {
134 * RealView PB1176 AMBA devices 134 * RealView PB1176 AMBA devices
135 */ 135 */
136#define GPIO2_IRQ { IRQ_PB1176_GPIO2, NO_IRQ } 136#define GPIO2_IRQ { IRQ_PB1176_GPIO2, NO_IRQ }
137#define GPIO2_DMA { 0, 0 }
138#define GPIO3_IRQ { IRQ_PB1176_GPIO3, NO_IRQ } 137#define GPIO3_IRQ { IRQ_PB1176_GPIO3, NO_IRQ }
139#define GPIO3_DMA { 0, 0 }
140#define AACI_IRQ { IRQ_PB1176_AACI, NO_IRQ } 138#define AACI_IRQ { IRQ_PB1176_AACI, NO_IRQ }
141#define AACI_DMA { 0x80, 0x81 }
142#define MMCI0_IRQ { IRQ_PB1176_MMCI0A, IRQ_PB1176_MMCI0B } 139#define MMCI0_IRQ { IRQ_PB1176_MMCI0A, IRQ_PB1176_MMCI0B }
143#define MMCI0_DMA { 0x84, 0 }
144#define KMI0_IRQ { IRQ_PB1176_KMI0, NO_IRQ } 140#define KMI0_IRQ { IRQ_PB1176_KMI0, NO_IRQ }
145#define KMI0_DMA { 0, 0 }
146#define KMI1_IRQ { IRQ_PB1176_KMI1, NO_IRQ } 141#define KMI1_IRQ { IRQ_PB1176_KMI1, NO_IRQ }
147#define KMI1_DMA { 0, 0 }
148#define PB1176_SMC_IRQ { NO_IRQ, NO_IRQ } 142#define PB1176_SMC_IRQ { NO_IRQ, NO_IRQ }
149#define PB1176_SMC_DMA { 0, 0 }
150#define MPMC_IRQ { NO_IRQ, NO_IRQ } 143#define MPMC_IRQ { NO_IRQ, NO_IRQ }
151#define MPMC_DMA { 0, 0 }
152#define PB1176_CLCD_IRQ { IRQ_DC1176_CLCD, NO_IRQ } 144#define PB1176_CLCD_IRQ { IRQ_DC1176_CLCD, NO_IRQ }
153#define PB1176_CLCD_DMA { 0, 0 }
154#define SCTL_IRQ { NO_IRQ, NO_IRQ } 145#define SCTL_IRQ { NO_IRQ, NO_IRQ }
155#define SCTL_DMA { 0, 0 }
156#define PB1176_WATCHDOG_IRQ { IRQ_DC1176_WATCHDOG, NO_IRQ } 146#define PB1176_WATCHDOG_IRQ { IRQ_DC1176_WATCHDOG, NO_IRQ }
157#define PB1176_WATCHDOG_DMA { 0, 0 }
158#define PB1176_GPIO0_IRQ { IRQ_PB1176_GPIO0, NO_IRQ } 147#define PB1176_GPIO0_IRQ { IRQ_PB1176_GPIO0, NO_IRQ }
159#define PB1176_GPIO0_DMA { 0, 0 }
160#define GPIO1_IRQ { IRQ_PB1176_GPIO1, NO_IRQ } 148#define GPIO1_IRQ { IRQ_PB1176_GPIO1, NO_IRQ }
161#define GPIO1_DMA { 0, 0 }
162#define PB1176_RTC_IRQ { IRQ_DC1176_RTC, NO_IRQ } 149#define PB1176_RTC_IRQ { IRQ_DC1176_RTC, NO_IRQ }
163#define PB1176_RTC_DMA { 0, 0 }
164#define SCI_IRQ { IRQ_PB1176_SCI, NO_IRQ } 150#define SCI_IRQ { IRQ_PB1176_SCI, NO_IRQ }
165#define SCI_DMA { 7, 6 }
166#define PB1176_UART0_IRQ { IRQ_DC1176_UART0, NO_IRQ } 151#define PB1176_UART0_IRQ { IRQ_DC1176_UART0, NO_IRQ }
167#define PB1176_UART0_DMA { 15, 14 }
168#define PB1176_UART1_IRQ { IRQ_DC1176_UART1, NO_IRQ } 152#define PB1176_UART1_IRQ { IRQ_DC1176_UART1, NO_IRQ }
169#define PB1176_UART1_DMA { 13, 12 }
170#define PB1176_UART2_IRQ { IRQ_DC1176_UART2, NO_IRQ } 153#define PB1176_UART2_IRQ { IRQ_DC1176_UART2, NO_IRQ }
171#define PB1176_UART2_DMA { 11, 10 }
172#define PB1176_UART3_IRQ { IRQ_DC1176_UART3, NO_IRQ } 154#define PB1176_UART3_IRQ { IRQ_DC1176_UART3, NO_IRQ }
173#define PB1176_UART3_DMA { 0x86, 0x87 }
174#define PB1176_UART4_IRQ { IRQ_PB1176_UART4, NO_IRQ } 155#define PB1176_UART4_IRQ { IRQ_PB1176_UART4, NO_IRQ }
175#define PB1176_UART4_DMA { 0, 0 }
176#define PB1176_SSP_IRQ { IRQ_DC1176_SSP, NO_IRQ } 156#define PB1176_SSP_IRQ { IRQ_DC1176_SSP, NO_IRQ }
177#define PB1176_SSP_DMA { 9, 8 }
178 157
179/* FPGA Primecells */ 158/* FPGA Primecells */
180AMBA_DEVICE(aaci, "fpga:aaci", AACI, NULL); 159AMBA_DEVICE(aaci, "fpga:aaci", AACI, NULL);
@@ -379,9 +358,10 @@ static void __init realview_pb1176_init(void)
379 358
380MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176") 359MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176")
381 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 360 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
382 .boot_params = PHYS_OFFSET + 0x00000100, 361 .boot_params = PLAT_PHYS_OFFSET + 0x00000100,
383 .fixup = realview_pb1176_fixup, 362 .fixup = realview_pb1176_fixup,
384 .map_io = realview_pb1176_map_io, 363 .map_io = realview_pb1176_map_io,
364 .init_early = realview_init_early,
385 .init_irq = gic_init_irq, 365 .init_irq = gic_init_irq,
386 .timer = &realview_pb1176_timer, 366 .timer = &realview_pb1176_timer,
387 .init_machine = realview_pb1176_init, 367 .init_machine = realview_pb1176_init,
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c
index 8e8ab7d29a6a..b2985fc7cd4e 100644
--- a/arch/arm/mach-realview/realview_pb11mp.c
+++ b/arch/arm/mach-realview/realview_pb11mp.c
@@ -136,47 +136,26 @@ static struct pl022_ssp_controller ssp0_plat_data = {
136 */ 136 */
137 137
138#define GPIO2_IRQ { IRQ_PB11MP_GPIO2, NO_IRQ } 138#define GPIO2_IRQ { IRQ_PB11MP_GPIO2, NO_IRQ }
139#define GPIO2_DMA { 0, 0 }
140#define GPIO3_IRQ { IRQ_PB11MP_GPIO3, NO_IRQ } 139#define GPIO3_IRQ { IRQ_PB11MP_GPIO3, NO_IRQ }
141#define GPIO3_DMA { 0, 0 }
142#define AACI_IRQ { IRQ_TC11MP_AACI, NO_IRQ } 140#define AACI_IRQ { IRQ_TC11MP_AACI, NO_IRQ }
143#define AACI_DMA { 0x80, 0x81 }
144#define MMCI0_IRQ { IRQ_TC11MP_MMCI0A, IRQ_TC11MP_MMCI0B } 141#define MMCI0_IRQ { IRQ_TC11MP_MMCI0A, IRQ_TC11MP_MMCI0B }
145#define MMCI0_DMA { 0x84, 0 }
146#define KMI0_IRQ { IRQ_TC11MP_KMI0, NO_IRQ } 142#define KMI0_IRQ { IRQ_TC11MP_KMI0, NO_IRQ }
147#define KMI0_DMA { 0, 0 }
148#define KMI1_IRQ { IRQ_TC11MP_KMI1, NO_IRQ } 143#define KMI1_IRQ { IRQ_TC11MP_KMI1, NO_IRQ }
149#define KMI1_DMA { 0, 0 }
150#define PB11MP_SMC_IRQ { NO_IRQ, NO_IRQ } 144#define PB11MP_SMC_IRQ { NO_IRQ, NO_IRQ }
151#define PB11MP_SMC_DMA { 0, 0 }
152#define MPMC_IRQ { NO_IRQ, NO_IRQ } 145#define MPMC_IRQ { NO_IRQ, NO_IRQ }
153#define MPMC_DMA { 0, 0 }
154#define PB11MP_CLCD_IRQ { IRQ_PB11MP_CLCD, NO_IRQ } 146#define PB11MP_CLCD_IRQ { IRQ_PB11MP_CLCD, NO_IRQ }
155#define PB11MP_CLCD_DMA { 0, 0 }
156#define DMAC_IRQ { IRQ_PB11MP_DMAC, NO_IRQ } 147#define DMAC_IRQ { IRQ_PB11MP_DMAC, NO_IRQ }
157#define DMAC_DMA { 0, 0 }
158#define SCTL_IRQ { NO_IRQ, NO_IRQ } 148#define SCTL_IRQ { NO_IRQ, NO_IRQ }
159#define SCTL_DMA { 0, 0 }
160#define PB11MP_WATCHDOG_IRQ { IRQ_PB11MP_WATCHDOG, NO_IRQ } 149#define PB11MP_WATCHDOG_IRQ { IRQ_PB11MP_WATCHDOG, NO_IRQ }
161#define PB11MP_WATCHDOG_DMA { 0, 0 }
162#define PB11MP_GPIO0_IRQ { IRQ_PB11MP_GPIO0, NO_IRQ } 150#define PB11MP_GPIO0_IRQ { IRQ_PB11MP_GPIO0, NO_IRQ }
163#define PB11MP_GPIO0_DMA { 0, 0 }
164#define GPIO1_IRQ { IRQ_PB11MP_GPIO1, NO_IRQ } 151#define GPIO1_IRQ { IRQ_PB11MP_GPIO1, NO_IRQ }
165#define GPIO1_DMA { 0, 0 }
166#define PB11MP_RTC_IRQ { IRQ_TC11MP_RTC, NO_IRQ } 152#define PB11MP_RTC_IRQ { IRQ_TC11MP_RTC, NO_IRQ }
167#define PB11MP_RTC_DMA { 0, 0 }
168#define SCI_IRQ { IRQ_PB11MP_SCI, NO_IRQ } 153#define SCI_IRQ { IRQ_PB11MP_SCI, NO_IRQ }
169#define SCI_DMA { 7, 6 }
170#define PB11MP_UART0_IRQ { IRQ_TC11MP_UART0, NO_IRQ } 154#define PB11MP_UART0_IRQ { IRQ_TC11MP_UART0, NO_IRQ }
171#define PB11MP_UART0_DMA { 15, 14 }
172#define PB11MP_UART1_IRQ { IRQ_TC11MP_UART1, NO_IRQ } 155#define PB11MP_UART1_IRQ { IRQ_TC11MP_UART1, NO_IRQ }
173#define PB11MP_UART1_DMA { 13, 12 }
174#define PB11MP_UART2_IRQ { IRQ_PB11MP_UART2, NO_IRQ } 156#define PB11MP_UART2_IRQ { IRQ_PB11MP_UART2, NO_IRQ }
175#define PB11MP_UART2_DMA { 11, 10 }
176#define PB11MP_UART3_IRQ { IRQ_PB11MP_UART3, NO_IRQ } 157#define PB11MP_UART3_IRQ { IRQ_PB11MP_UART3, NO_IRQ }
177#define PB11MP_UART3_DMA { 0x86, 0x87 }
178#define PB11MP_SSP_IRQ { IRQ_PB11MP_SSP, NO_IRQ } 158#define PB11MP_SSP_IRQ { IRQ_PB11MP_SSP, NO_IRQ }
179#define PB11MP_SSP_DMA { 9, 8 }
180 159
181/* FPGA Primecells */ 160/* FPGA Primecells */
182AMBA_DEVICE(aaci, "fpga:aaci", AACI, NULL); 161AMBA_DEVICE(aaci, "fpga:aaci", AACI, NULL);
@@ -381,9 +360,10 @@ static void __init realview_pb11mp_init(void)
381 360
382MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore") 361MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")
383 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 362 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
384 .boot_params = PHYS_OFFSET + 0x00000100, 363 .boot_params = PLAT_PHYS_OFFSET + 0x00000100,
385 .fixup = realview_fixup, 364 .fixup = realview_fixup,
386 .map_io = realview_pb11mp_map_io, 365 .map_io = realview_pb11mp_map_io,
366 .init_early = realview_init_early,
387 .init_irq = gic_init_irq, 367 .init_irq = gic_init_irq,
388 .timer = &realview_pb11mp_timer, 368 .timer = &realview_pb11mp_timer,
389 .init_machine = realview_pb11mp_init, 369 .init_machine = realview_pb11mp_init,
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c
index 841118e3e118..fb6866558760 100644
--- a/arch/arm/mach-realview/realview_pba8.c
+++ b/arch/arm/mach-realview/realview_pba8.c
@@ -126,47 +126,26 @@ static struct pl022_ssp_controller ssp0_plat_data = {
126 */ 126 */
127 127
128#define GPIO2_IRQ { IRQ_PBA8_GPIO2, NO_IRQ } 128#define GPIO2_IRQ { IRQ_PBA8_GPIO2, NO_IRQ }
129#define GPIO2_DMA { 0, 0 }
130#define GPIO3_IRQ { IRQ_PBA8_GPIO3, NO_IRQ } 129#define GPIO3_IRQ { IRQ_PBA8_GPIO3, NO_IRQ }
131#define GPIO3_DMA { 0, 0 }
132#define AACI_IRQ { IRQ_PBA8_AACI, NO_IRQ } 130#define AACI_IRQ { IRQ_PBA8_AACI, NO_IRQ }
133#define AACI_DMA { 0x80, 0x81 }
134#define MMCI0_IRQ { IRQ_PBA8_MMCI0A, IRQ_PBA8_MMCI0B } 131#define MMCI0_IRQ { IRQ_PBA8_MMCI0A, IRQ_PBA8_MMCI0B }
135#define MMCI0_DMA { 0x84, 0 }
136#define KMI0_IRQ { IRQ_PBA8_KMI0, NO_IRQ } 132#define KMI0_IRQ { IRQ_PBA8_KMI0, NO_IRQ }
137#define KMI0_DMA { 0, 0 }
138#define KMI1_IRQ { IRQ_PBA8_KMI1, NO_IRQ } 133#define KMI1_IRQ { IRQ_PBA8_KMI1, NO_IRQ }
139#define KMI1_DMA { 0, 0 }
140#define PBA8_SMC_IRQ { NO_IRQ, NO_IRQ } 134#define PBA8_SMC_IRQ { NO_IRQ, NO_IRQ }
141#define PBA8_SMC_DMA { 0, 0 }
142#define MPMC_IRQ { NO_IRQ, NO_IRQ } 135#define MPMC_IRQ { NO_IRQ, NO_IRQ }
143#define MPMC_DMA { 0, 0 }
144#define PBA8_CLCD_IRQ { IRQ_PBA8_CLCD, NO_IRQ } 136#define PBA8_CLCD_IRQ { IRQ_PBA8_CLCD, NO_IRQ }
145#define PBA8_CLCD_DMA { 0, 0 }
146#define DMAC_IRQ { IRQ_PBA8_DMAC, NO_IRQ } 137#define DMAC_IRQ { IRQ_PBA8_DMAC, NO_IRQ }
147#define DMAC_DMA { 0, 0 }
148#define SCTL_IRQ { NO_IRQ, NO_IRQ } 138#define SCTL_IRQ { NO_IRQ, NO_IRQ }
149#define SCTL_DMA { 0, 0 }
150#define PBA8_WATCHDOG_IRQ { IRQ_PBA8_WATCHDOG, NO_IRQ } 139#define PBA8_WATCHDOG_IRQ { IRQ_PBA8_WATCHDOG, NO_IRQ }
151#define PBA8_WATCHDOG_DMA { 0, 0 }
152#define PBA8_GPIO0_IRQ { IRQ_PBA8_GPIO0, NO_IRQ } 140#define PBA8_GPIO0_IRQ { IRQ_PBA8_GPIO0, NO_IRQ }
153#define PBA8_GPIO0_DMA { 0, 0 }
154#define GPIO1_IRQ { IRQ_PBA8_GPIO1, NO_IRQ } 141#define GPIO1_IRQ { IRQ_PBA8_GPIO1, NO_IRQ }
155#define GPIO1_DMA { 0, 0 }
156#define PBA8_RTC_IRQ { IRQ_PBA8_RTC, NO_IRQ } 142#define PBA8_RTC_IRQ { IRQ_PBA8_RTC, NO_IRQ }
157#define PBA8_RTC_DMA { 0, 0 }
158#define SCI_IRQ { IRQ_PBA8_SCI, NO_IRQ } 143#define SCI_IRQ { IRQ_PBA8_SCI, NO_IRQ }
159#define SCI_DMA { 7, 6 }
160#define PBA8_UART0_IRQ { IRQ_PBA8_UART0, NO_IRQ } 144#define PBA8_UART0_IRQ { IRQ_PBA8_UART0, NO_IRQ }
161#define PBA8_UART0_DMA { 15, 14 }
162#define PBA8_UART1_IRQ { IRQ_PBA8_UART1, NO_IRQ } 145#define PBA8_UART1_IRQ { IRQ_PBA8_UART1, NO_IRQ }
163#define PBA8_UART1_DMA { 13, 12 }
164#define PBA8_UART2_IRQ { IRQ_PBA8_UART2, NO_IRQ } 146#define PBA8_UART2_IRQ { IRQ_PBA8_UART2, NO_IRQ }
165#define PBA8_UART2_DMA { 11, 10 }
166#define PBA8_UART3_IRQ { IRQ_PBA8_UART3, NO_IRQ } 147#define PBA8_UART3_IRQ { IRQ_PBA8_UART3, NO_IRQ }
167#define PBA8_UART3_DMA { 0x86, 0x87 }
168#define PBA8_SSP_IRQ { IRQ_PBA8_SSP, NO_IRQ } 148#define PBA8_SSP_IRQ { IRQ_PBA8_SSP, NO_IRQ }
169#define PBA8_SSP_DMA { 9, 8 }
170 149
171/* FPGA Primecells */ 150/* FPGA Primecells */
172AMBA_DEVICE(aaci, "fpga:aaci", AACI, NULL); 151AMBA_DEVICE(aaci, "fpga:aaci", AACI, NULL);
@@ -331,9 +310,10 @@ static void __init realview_pba8_init(void)
331 310
332MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8") 311MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8")
333 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 312 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
334 .boot_params = PHYS_OFFSET + 0x00000100, 313 .boot_params = PLAT_PHYS_OFFSET + 0x00000100,
335 .fixup = realview_fixup, 314 .fixup = realview_fixup,
336 .map_io = realview_pba8_map_io, 315 .map_io = realview_pba8_map_io,
316 .init_early = realview_init_early,
337 .init_irq = gic_init_irq, 317 .init_irq = gic_init_irq,
338 .timer = &realview_pba8_timer, 318 .timer = &realview_pba8_timer,
339 .init_machine = realview_pba8_init, 319 .init_machine = realview_pba8_init,
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c
index 02b755b009db..92ace2cf2b2c 100644
--- a/arch/arm/mach-realview/realview_pbx.c
+++ b/arch/arm/mach-realview/realview_pbx.c
@@ -148,47 +148,26 @@ static struct pl022_ssp_controller ssp0_plat_data = {
148 */ 148 */
149 149
150#define GPIO2_IRQ { IRQ_PBX_GPIO2, NO_IRQ } 150#define GPIO2_IRQ { IRQ_PBX_GPIO2, NO_IRQ }
151#define GPIO2_DMA { 0, 0 }
152#define GPIO3_IRQ { IRQ_PBX_GPIO3, NO_IRQ } 151#define GPIO3_IRQ { IRQ_PBX_GPIO3, NO_IRQ }
153#define GPIO3_DMA { 0, 0 }
154#define AACI_IRQ { IRQ_PBX_AACI, NO_IRQ } 152#define AACI_IRQ { IRQ_PBX_AACI, NO_IRQ }
155#define AACI_DMA { 0x80, 0x81 }
156#define MMCI0_IRQ { IRQ_PBX_MMCI0A, IRQ_PBX_MMCI0B } 153#define MMCI0_IRQ { IRQ_PBX_MMCI0A, IRQ_PBX_MMCI0B }
157#define MMCI0_DMA { 0x84, 0 }
158#define KMI0_IRQ { IRQ_PBX_KMI0, NO_IRQ } 154#define KMI0_IRQ { IRQ_PBX_KMI0, NO_IRQ }
159#define KMI0_DMA { 0, 0 }
160#define KMI1_IRQ { IRQ_PBX_KMI1, NO_IRQ } 155#define KMI1_IRQ { IRQ_PBX_KMI1, NO_IRQ }
161#define KMI1_DMA { 0, 0 }
162#define PBX_SMC_IRQ { NO_IRQ, NO_IRQ } 156#define PBX_SMC_IRQ { NO_IRQ, NO_IRQ }
163#define PBX_SMC_DMA { 0, 0 }
164#define MPMC_IRQ { NO_IRQ, NO_IRQ } 157#define MPMC_IRQ { NO_IRQ, NO_IRQ }
165#define MPMC_DMA { 0, 0 }
166#define PBX_CLCD_IRQ { IRQ_PBX_CLCD, NO_IRQ } 158#define PBX_CLCD_IRQ { IRQ_PBX_CLCD, NO_IRQ }
167#define PBX_CLCD_DMA { 0, 0 }
168#define DMAC_IRQ { IRQ_PBX_DMAC, NO_IRQ } 159#define DMAC_IRQ { IRQ_PBX_DMAC, NO_IRQ }
169#define DMAC_DMA { 0, 0 }
170#define SCTL_IRQ { NO_IRQ, NO_IRQ } 160#define SCTL_IRQ { NO_IRQ, NO_IRQ }
171#define SCTL_DMA { 0, 0 }
172#define PBX_WATCHDOG_IRQ { IRQ_PBX_WATCHDOG, NO_IRQ } 161#define PBX_WATCHDOG_IRQ { IRQ_PBX_WATCHDOG, NO_IRQ }
173#define PBX_WATCHDOG_DMA { 0, 0 }
174#define PBX_GPIO0_IRQ { IRQ_PBX_GPIO0, NO_IRQ } 162#define PBX_GPIO0_IRQ { IRQ_PBX_GPIO0, NO_IRQ }
175#define PBX_GPIO0_DMA { 0, 0 }
176#define GPIO1_IRQ { IRQ_PBX_GPIO1, NO_IRQ } 163#define GPIO1_IRQ { IRQ_PBX_GPIO1, NO_IRQ }
177#define GPIO1_DMA { 0, 0 }
178#define PBX_RTC_IRQ { IRQ_PBX_RTC, NO_IRQ } 164#define PBX_RTC_IRQ { IRQ_PBX_RTC, NO_IRQ }
179#define PBX_RTC_DMA { 0, 0 }
180#define SCI_IRQ { IRQ_PBX_SCI, NO_IRQ } 165#define SCI_IRQ { IRQ_PBX_SCI, NO_IRQ }
181#define SCI_DMA { 7, 6 }
182#define PBX_UART0_IRQ { IRQ_PBX_UART0, NO_IRQ } 166#define PBX_UART0_IRQ { IRQ_PBX_UART0, NO_IRQ }
183#define PBX_UART0_DMA { 15, 14 }
184#define PBX_UART1_IRQ { IRQ_PBX_UART1, NO_IRQ } 167#define PBX_UART1_IRQ { IRQ_PBX_UART1, NO_IRQ }
185#define PBX_UART1_DMA { 13, 12 }
186#define PBX_UART2_IRQ { IRQ_PBX_UART2, NO_IRQ } 168#define PBX_UART2_IRQ { IRQ_PBX_UART2, NO_IRQ }
187#define PBX_UART2_DMA { 11, 10 }
188#define PBX_UART3_IRQ { IRQ_PBX_UART3, NO_IRQ } 169#define PBX_UART3_IRQ { IRQ_PBX_UART3, NO_IRQ }
189#define PBX_UART3_DMA { 0x86, 0x87 }
190#define PBX_SSP_IRQ { IRQ_PBX_SSP, NO_IRQ } 170#define PBX_SSP_IRQ { IRQ_PBX_SSP, NO_IRQ }
191#define PBX_SSP_DMA { 9, 8 }
192 171
193/* FPGA Primecells */ 172/* FPGA Primecells */
194AMBA_DEVICE(aaci, "fpga:aaci", AACI, NULL); 173AMBA_DEVICE(aaci, "fpga:aaci", AACI, NULL);
@@ -414,9 +393,10 @@ static void __init realview_pbx_init(void)
414 393
415MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX") 394MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX")
416 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 395 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
417 .boot_params = PHYS_OFFSET + 0x00000100, 396 .boot_params = PLAT_PHYS_OFFSET + 0x00000100,
418 .fixup = realview_pbx_fixup, 397 .fixup = realview_pbx_fixup,
419 .map_io = realview_pbx_map_io, 398 .map_io = realview_pbx_map_io,
399 .init_early = realview_init_early,
420 .init_irq = gic_init_irq, 400 .init_irq = gic_init_irq,
421 .timer = &realview_pbx_timer, 401 .timer = &realview_pbx_timer,
422 .init_machine = realview_pbx_init, 402 .init_machine = realview_pbx_init,
diff --git a/arch/arm/mach-rpc/include/mach/memory.h b/arch/arm/mach-rpc/include/mach/memory.h
index 78191bf25192..18a221093bf5 100644
--- a/arch/arm/mach-rpc/include/mach/memory.h
+++ b/arch/arm/mach-rpc/include/mach/memory.h
@@ -21,7 +21,7 @@
21/* 21/*
22 * Physical DRAM offset. 22 * Physical DRAM offset.
23 */ 23 */
24#define PHYS_OFFSET UL(0x10000000) 24#define PLAT_PHYS_OFFSET UL(0x10000000)
25 25
26/* 26/*
27 * Cache flushing area - ROM 27 * Cache flushing area - ROM
diff --git a/arch/arm/mach-s3c2400/include/mach/memory.h b/arch/arm/mach-s3c2400/include/mach/memory.h
index cf5901ffd385..3f33670dd012 100644
--- a/arch/arm/mach-s3c2400/include/mach/memory.h
+++ b/arch/arm/mach-s3c2400/include/mach/memory.h
@@ -15,6 +15,6 @@
15#ifndef __ASM_ARCH_MEMORY_H 15#ifndef __ASM_ARCH_MEMORY_H
16#define __ASM_ARCH_MEMORY_H 16#define __ASM_ARCH_MEMORY_H
17 17
18#define PHYS_OFFSET UL(0x0C000000) 18#define PLAT_PHYS_OFFSET UL(0x0C000000)
19 19
20#endif 20#endif
diff --git a/arch/arm/mach-s3c2410/h1940-bluetooth.c b/arch/arm/mach-s3c2410/h1940-bluetooth.c
index 6b86a722a7db..2c126bbca08d 100644
--- a/arch/arm/mach-s3c2410/h1940-bluetooth.c
+++ b/arch/arm/mach-s3c2410/h1940-bluetooth.c
@@ -18,12 +18,14 @@
18#include <linux/leds.h> 18#include <linux/leds.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/rfkill.h> 20#include <linux/rfkill.h>
21#include <linux/leds.h>
21 22
22#include <mach/regs-gpio.h> 23#include <mach/regs-gpio.h>
23#include <mach/hardware.h> 24#include <mach/hardware.h>
24#include <mach/h1940-latch.h> 25#include <mach/h1940-latch.h>
26#include <mach/h1940.h>
25 27
26#define DRV_NAME "h1940-bt" 28#define DRV_NAME "h1940-bt"
27 29
28/* Bluetooth control */ 30/* Bluetooth control */
29static void h1940bt_enable(int on) 31static void h1940bt_enable(int on)
@@ -37,6 +39,8 @@ static void h1940bt_enable(int on)
37 gpio_set_value(S3C2410_GPH(1), 1); 39 gpio_set_value(S3C2410_GPH(1), 1);
38 mdelay(10); 40 mdelay(10);
39 gpio_set_value(S3C2410_GPH(1), 0); 41 gpio_set_value(S3C2410_GPH(1), 0);
42
43 h1940_led_blink_set(-EINVAL, GPIO_LED_BLINK, NULL, NULL);
40 } 44 }
41 else { 45 else {
42 gpio_set_value(S3C2410_GPH(1), 1); 46 gpio_set_value(S3C2410_GPH(1), 1);
@@ -44,6 +48,8 @@ static void h1940bt_enable(int on)
44 gpio_set_value(S3C2410_GPH(1), 0); 48 gpio_set_value(S3C2410_GPH(1), 0);
45 mdelay(10); 49 mdelay(10);
46 gpio_set_value(H1940_LATCH_BLUETOOTH_POWER, 0); 50 gpio_set_value(H1940_LATCH_BLUETOOTH_POWER, 0);
51
52 h1940_led_blink_set(-EINVAL, GPIO_LED_NO_BLINK_LOW, NULL, NULL);
47 } 53 }
48} 54}
49 55
@@ -85,7 +91,6 @@ static int __devinit h1940bt_probe(struct platform_device *pdev)
85 s3c_gpio_cfgpin(S3C2410_GPH(3), S3C2410_GPH3_RXD0); 91 s3c_gpio_cfgpin(S3C2410_GPH(3), S3C2410_GPH3_RXD0);
86 s3c_gpio_setpull(S3C2410_GPH(3), S3C_GPIO_PULL_NONE); 92 s3c_gpio_setpull(S3C2410_GPH(3), S3C_GPIO_PULL_NONE);
87 93
88
89 rfk = rfkill_alloc(DRV_NAME, &pdev->dev, RFKILL_TYPE_BLUETOOTH, 94 rfk = rfkill_alloc(DRV_NAME, &pdev->dev, RFKILL_TYPE_BLUETOOTH,
90 &h1940bt_rfkill_ops, NULL); 95 &h1940bt_rfkill_ops, NULL);
91 if (!rfk) { 96 if (!rfk) {
@@ -93,8 +98,6 @@ static int __devinit h1940bt_probe(struct platform_device *pdev)
93 goto err_rfk_alloc; 98 goto err_rfk_alloc;
94 } 99 }
95 100
96 rfkill_set_led_trigger_name(rfk, "h1940-bluetooth");
97
98 ret = rfkill_register(rfk); 101 ret = rfkill_register(rfk);
99 if (ret) 102 if (ret)
100 goto err_rfkill; 103 goto err_rfkill;
diff --git a/arch/arm/mach-s3c2410/include/mach/h1940.h b/arch/arm/mach-s3c2410/include/mach/h1940.h
index 4559784129c0..2aa683c8d3d6 100644
--- a/arch/arm/mach-s3c2410/include/mach/h1940.h
+++ b/arch/arm/mach-s3c2410/include/mach/h1940.h
@@ -17,5 +17,8 @@
17#define H1940_SUSPEND_CHECK (0x30080000) 17#define H1940_SUSPEND_CHECK (0x30080000)
18 18
19extern void h1940_pm_return(void); 19extern void h1940_pm_return(void);
20extern int h1940_led_blink_set(unsigned gpio, int state,
21 unsigned long *delay_on, unsigned long *delay_off);
22
20 23
21#endif /* __ASM_ARCH_H1940_H */ 24#endif /* __ASM_ARCH_H1940_H */
diff --git a/arch/arm/mach-s3c2410/include/mach/memory.h b/arch/arm/mach-s3c2410/include/mach/memory.h
index 6f1e5871ae4b..f92b97b89c0c 100644
--- a/arch/arm/mach-s3c2410/include/mach/memory.h
+++ b/arch/arm/mach-s3c2410/include/mach/memory.h
@@ -11,6 +11,6 @@
11#ifndef __ASM_ARCH_MEMORY_H 11#ifndef __ASM_ARCH_MEMORY_H
12#define __ASM_ARCH_MEMORY_H 12#define __ASM_ARCH_MEMORY_H
13 13
14#define PHYS_OFFSET UL(0x30000000) 14#define PLAT_PHYS_OFFSET UL(0x30000000)
15 15
16#endif 16#endif
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 1a81fe12ccd7..2a2fa0620133 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -23,8 +23,15 @@
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/gpio.h> 25#include <linux/gpio.h>
26#include <linux/input.h>
27#include <linux/gpio_keys.h>
26#include <linux/pwm_backlight.h> 28#include <linux/pwm_backlight.h>
27#include <linux/i2c.h> 29#include <linux/i2c.h>
30#include <linux/leds.h>
31#include <linux/pda_power.h>
32#include <linux/s3c_adc_battery.h>
33#include <linux/delay.h>
34
28#include <video/platform_lcd.h> 35#include <video/platform_lcd.h>
29 36
30#include <linux/mmc/host.h> 37#include <linux/mmc/host.h>
@@ -162,29 +169,10 @@ struct gpio_chip h1940_latch_gpiochip = {
162 .get = h1940_gpiolib_latch_get, 169 .get = h1940_gpiolib_latch_get,
163}; 170};
164 171
165static void h1940_udc_pullup(enum s3c2410_udc_cmd_e cmd)
166{
167 printk(KERN_DEBUG "udc: pullup(%d)\n",cmd);
168
169 switch (cmd)
170 {
171 case S3C2410_UDC_P_ENABLE :
172 gpio_set_value(H1940_LATCH_USB_DP, 1);
173 break;
174 case S3C2410_UDC_P_DISABLE :
175 gpio_set_value(H1940_LATCH_USB_DP, 0);
176 break;
177 case S3C2410_UDC_P_RESET :
178 break;
179 default:
180 break;
181 }
182}
183
184static struct s3c2410_udc_mach_info h1940_udc_cfg __initdata = { 172static struct s3c2410_udc_mach_info h1940_udc_cfg __initdata = {
185 .udc_command = h1940_udc_pullup,
186 .vbus_pin = S3C2410_GPG(5), 173 .vbus_pin = S3C2410_GPG(5),
187 .vbus_pin_inverted = 1, 174 .vbus_pin_inverted = 1,
175 .pullup_pin = H1940_LATCH_USB_DP,
188}; 176};
189 177
190static struct s3c2410_ts_mach_info h1940_ts_cfg __initdata = { 178static struct s3c2410_ts_mach_info h1940_ts_cfg __initdata = {
@@ -222,20 +210,239 @@ static struct s3c2410fb_mach_info h1940_fb_info __initdata = {
222 .num_displays = 1, 210 .num_displays = 1,
223 .default_display = 0, 211 .default_display = 0,
224 212
225 .lpcsel= 0x02, 213 .lpcsel = 0x02,
226 .gpccon= 0xaa940659, 214 .gpccon = 0xaa940659,
227 .gpccon_mask= 0xffffffff, 215 .gpccon_mask = 0xffffc0f0,
228 .gpcup= 0x0000ffff, 216 .gpcup = 0x0000ffff,
229 .gpcup_mask= 0xffffffff, 217 .gpcup_mask = 0xffffffff,
230 .gpdcon= 0xaa84aaa0, 218 .gpdcon = 0xaa84aaa0,
231 .gpdcon_mask= 0xffffffff, 219 .gpdcon_mask = 0xffffffff,
232 .gpdup= 0x0000faff, 220 .gpdup = 0x0000faff,
233 .gpdup_mask= 0xffffffff, 221 .gpdup_mask = 0xffffffff,
234}; 222};
235 223
236static struct platform_device h1940_device_leds = { 224static int power_supply_init(struct device *dev)
237 .name = "h1940-leds", 225{
226 return gpio_request(S3C2410_GPF(2), "cable plugged");
227}
228
229static int h1940_is_ac_online(void)
230{
231 return !gpio_get_value(S3C2410_GPF(2));
232}
233
234static void power_supply_exit(struct device *dev)
235{
236 gpio_free(S3C2410_GPF(2));
237}
238
239static char *h1940_supplicants[] = {
240 "main-battery",
241 "backup-battery",
242};
243
244static struct pda_power_pdata power_supply_info = {
245 .init = power_supply_init,
246 .is_ac_online = h1940_is_ac_online,
247 .exit = power_supply_exit,
248 .supplied_to = h1940_supplicants,
249 .num_supplicants = ARRAY_SIZE(h1940_supplicants),
250};
251
252static struct resource power_supply_resources[] = {
253 [0] = {
254 .name = "ac",
255 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE |
256 IORESOURCE_IRQ_HIGHEDGE,
257 .start = IRQ_EINT2,
258 .end = IRQ_EINT2,
259 },
260};
261
262static struct platform_device power_supply = {
263 .name = "pda-power",
264 .id = -1,
265 .dev = {
266 .platform_data =
267 &power_supply_info,
268 },
269 .resource = power_supply_resources,
270 .num_resources = ARRAY_SIZE(power_supply_resources),
271};
272
273static const struct s3c_adc_bat_thresh bat_lut_noac[] = {
274 { .volt = 4070, .cur = 162, .level = 100},
275 { .volt = 4040, .cur = 165, .level = 95},
276 { .volt = 4016, .cur = 164, .level = 90},
277 { .volt = 3996, .cur = 166, .level = 85},
278 { .volt = 3971, .cur = 168, .level = 80},
279 { .volt = 3951, .cur = 168, .level = 75},
280 { .volt = 3931, .cur = 170, .level = 70},
281 { .volt = 3903, .cur = 172, .level = 65},
282 { .volt = 3886, .cur = 172, .level = 60},
283 { .volt = 3858, .cur = 176, .level = 55},
284 { .volt = 3842, .cur = 176, .level = 50},
285 { .volt = 3818, .cur = 176, .level = 45},
286 { .volt = 3789, .cur = 180, .level = 40},
287 { .volt = 3769, .cur = 180, .level = 35},
288 { .volt = 3749, .cur = 184, .level = 30},
289 { .volt = 3732, .cur = 184, .level = 25},
290 { .volt = 3716, .cur = 184, .level = 20},
291 { .volt = 3708, .cur = 184, .level = 15},
292 { .volt = 3716, .cur = 96, .level = 10},
293 { .volt = 3700, .cur = 96, .level = 5},
294 { .volt = 3684, .cur = 96, .level = 0},
295};
296
297static const struct s3c_adc_bat_thresh bat_lut_acin[] = {
298 { .volt = 4130, .cur = 0, .level = 100},
299 { .volt = 3982, .cur = 0, .level = 50},
300 { .volt = 3854, .cur = 0, .level = 10},
301 { .volt = 3841, .cur = 0, .level = 0},
302};
303
304int h1940_bat_init(void)
305{
306 int ret;
307
308 ret = gpio_request(H1940_LATCH_SM803_ENABLE, "h1940-charger-enable");
309 if (ret)
310 return ret;
311 gpio_direction_output(H1940_LATCH_SM803_ENABLE, 0);
312
313 return 0;
314
315}
316
317void h1940_bat_exit(void)
318{
319 gpio_free(H1940_LATCH_SM803_ENABLE);
320}
321
322void h1940_enable_charger(void)
323{
324 gpio_set_value(H1940_LATCH_SM803_ENABLE, 1);
325}
326
327void h1940_disable_charger(void)
328{
329 gpio_set_value(H1940_LATCH_SM803_ENABLE, 0);
330}
331
332static struct s3c_adc_bat_pdata h1940_bat_cfg = {
333 .init = h1940_bat_init,
334 .exit = h1940_bat_exit,
335 .enable_charger = h1940_enable_charger,
336 .disable_charger = h1940_disable_charger,
337 .gpio_charge_finished = S3C2410_GPF(3),
338 .gpio_inverted = 1,
339 .lut_noac = bat_lut_noac,
340 .lut_noac_cnt = ARRAY_SIZE(bat_lut_noac),
341 .lut_acin = bat_lut_acin,
342 .lut_acin_cnt = ARRAY_SIZE(bat_lut_acin),
343 .volt_channel = 0,
344 .current_channel = 1,
345 .volt_mult = 4056,
346 .current_mult = 1893,
347 .internal_impedance = 200,
348 .backup_volt_channel = 3,
349 /* TODO Check backup volt multiplier */
350 .backup_volt_mult = 4056,
351 .backup_volt_min = 0,
352 .backup_volt_max = 4149288
353};
354
355static struct platform_device h1940_battery = {
356 .name = "s3c-adc-battery",
238 .id = -1, 357 .id = -1,
358 .dev = {
359 .parent = &s3c_device_adc.dev,
360 .platform_data = &h1940_bat_cfg,
361 },
362};
363
364DEFINE_SPINLOCK(h1940_blink_spin);
365
366int h1940_led_blink_set(unsigned gpio, int state,
367 unsigned long *delay_on, unsigned long *delay_off)
368{
369 int blink_gpio, check_gpio1, check_gpio2;
370
371 switch (gpio) {
372 case H1940_LATCH_LED_GREEN:
373 blink_gpio = S3C2410_GPA(7);
374 check_gpio1 = S3C2410_GPA(1);
375 check_gpio2 = S3C2410_GPA(3);
376 break;
377 case H1940_LATCH_LED_RED:
378 blink_gpio = S3C2410_GPA(1);
379 check_gpio1 = S3C2410_GPA(7);
380 check_gpio2 = S3C2410_GPA(3);
381 break;
382 default:
383 blink_gpio = S3C2410_GPA(3);
384 check_gpio1 = S3C2410_GPA(1);
385 check_gpio1 = S3C2410_GPA(7);
386 break;
387 }
388
389 if (delay_on && delay_off && !*delay_on && !*delay_off)
390 *delay_on = *delay_off = 500;
391
392 spin_lock(&h1940_blink_spin);
393
394 switch (state) {
395 case GPIO_LED_NO_BLINK_LOW:
396 case GPIO_LED_NO_BLINK_HIGH:
397 if (!gpio_get_value(check_gpio1) &&
398 !gpio_get_value(check_gpio2))
399 gpio_set_value(H1940_LATCH_LED_FLASH, 0);
400 gpio_set_value(blink_gpio, 0);
401 if (gpio_is_valid(gpio))
402 gpio_set_value(gpio, state);
403 break;
404 case GPIO_LED_BLINK:
405 if (gpio_is_valid(gpio))
406 gpio_set_value(gpio, 0);
407 gpio_set_value(H1940_LATCH_LED_FLASH, 1);
408 gpio_set_value(blink_gpio, 1);
409 break;
410 }
411
412 spin_unlock(&h1940_blink_spin);
413
414 return 0;
415}
416EXPORT_SYMBOL(h1940_led_blink_set);
417
418static struct gpio_led h1940_leds_desc[] = {
419 {
420 .name = "Green",
421 .default_trigger = "main-battery-full",
422 .gpio = H1940_LATCH_LED_GREEN,
423 .retain_state_suspended = 1,
424 },
425 {
426 .name = "Red",
427 .default_trigger
428 = "main-battery-charging-blink-full-solid",
429 .gpio = H1940_LATCH_LED_RED,
430 .retain_state_suspended = 1,
431 },
432};
433
434static struct gpio_led_platform_data h1940_leds_pdata = {
435 .num_leds = ARRAY_SIZE(h1940_leds_desc),
436 .leds = h1940_leds_desc,
437 .gpio_blink_set = h1940_led_blink_set,
438};
439
440static struct platform_device h1940_device_leds = {
441 .name = "leds-gpio",
442 .id = -1,
443 .dev = {
444 .platform_data = &h1940_leds_pdata,
445 },
239}; 446};
240 447
241static struct platform_device h1940_device_bluetooth = { 448static struct platform_device h1940_device_bluetooth = {
@@ -321,14 +528,14 @@ static struct platform_device h1940_backlight = {
321static void h1940_lcd_power_set(struct plat_lcd_data *pd, 528static void h1940_lcd_power_set(struct plat_lcd_data *pd,
322 unsigned int power) 529 unsigned int power)
323{ 530{
324 int value; 531 int value, retries = 100;
325 532
326 if (!power) { 533 if (!power) {
327 gpio_set_value(S3C2410_GPC(0), 0); 534 gpio_set_value(S3C2410_GPC(0), 0);
328 /* wait for 3ac */ 535 /* wait for 3ac */
329 do { 536 do {
330 value = gpio_get_value(S3C2410_GPC(6)); 537 value = gpio_get_value(S3C2410_GPC(6));
331 } while (value); 538 } while (value && retries--);
332 539
333 gpio_set_value(H1940_LATCH_LCD_P2, 0); 540 gpio_set_value(H1940_LATCH_LCD_P2, 0);
334 gpio_set_value(H1940_LATCH_LCD_P3, 0); 541 gpio_set_value(H1940_LATCH_LCD_P3, 0);
@@ -346,6 +553,9 @@ static void h1940_lcd_power_set(struct plat_lcd_data *pd,
346 gpio_set_value(H1940_LATCH_LCD_P0, 1); 553 gpio_set_value(H1940_LATCH_LCD_P0, 1);
347 gpio_set_value(H1940_LATCH_LCD_P1, 1); 554 gpio_set_value(H1940_LATCH_LCD_P1, 1);
348 555
556 gpio_direction_input(S3C2410_GPC(1));
557 gpio_direction_input(S3C2410_GPC(4));
558 mdelay(10);
349 s3c_gpio_cfgpin(S3C2410_GPC(1), S3C_GPIO_SFN(2)); 559 s3c_gpio_cfgpin(S3C2410_GPC(1), S3C_GPIO_SFN(2));
350 s3c_gpio_cfgpin(S3C2410_GPC(4), S3C_GPIO_SFN(2)); 560 s3c_gpio_cfgpin(S3C2410_GPC(4), S3C_GPIO_SFN(2));
351 561
@@ -381,7 +591,44 @@ static struct i2c_board_info h1940_i2c_devices[] = {
381 }, 591 },
382}; 592};
383 593
594#define DECLARE_BUTTON(p, k, n, w) \
595 { \
596 .gpio = p, \
597 .code = k, \
598 .desc = n, \
599 .wakeup = w, \
600 .active_low = 1, \
601 }
602
603static struct gpio_keys_button h1940_buttons[] = {
604 DECLARE_BUTTON(S3C2410_GPF(0), KEY_POWER, "Power", 1),
605 DECLARE_BUTTON(S3C2410_GPF(6), KEY_ENTER, "Select", 1),
606 DECLARE_BUTTON(S3C2410_GPF(7), KEY_RECORD, "Record", 0),
607 DECLARE_BUTTON(S3C2410_GPG(0), KEY_F11, "Calendar", 0),
608 DECLARE_BUTTON(S3C2410_GPG(2), KEY_F12, "Contacts", 0),
609 DECLARE_BUTTON(S3C2410_GPG(3), KEY_MAIL, "Mail", 0),
610 DECLARE_BUTTON(S3C2410_GPG(6), KEY_LEFT, "Left_arrow", 0),
611 DECLARE_BUTTON(S3C2410_GPG(7), KEY_HOMEPAGE, "Home", 0),
612 DECLARE_BUTTON(S3C2410_GPG(8), KEY_RIGHT, "Right_arrow", 0),
613 DECLARE_BUTTON(S3C2410_GPG(9), KEY_UP, "Up_arrow", 0),
614 DECLARE_BUTTON(S3C2410_GPG(10), KEY_DOWN, "Down_arrow", 0),
615};
616
617static struct gpio_keys_platform_data h1940_buttons_data = {
618 .buttons = h1940_buttons,
619 .nbuttons = ARRAY_SIZE(h1940_buttons),
620};
621
622static struct platform_device h1940_dev_buttons = {
623 .name = "gpio-keys",
624 .id = -1,
625 .dev = {
626 .platform_data = &h1940_buttons_data,
627 }
628};
629
384static struct platform_device *h1940_devices[] __initdata = { 630static struct platform_device *h1940_devices[] __initdata = {
631 &h1940_dev_buttons,
385 &s3c_device_ohci, 632 &s3c_device_ohci,
386 &s3c_device_lcd, 633 &s3c_device_lcd,
387 &s3c_device_wdt, 634 &s3c_device_wdt,
@@ -398,6 +645,8 @@ static struct platform_device *h1940_devices[] __initdata = {
398 &h1940_lcd_powerdev, 645 &h1940_lcd_powerdev,
399 &s3c_device_adc, 646 &s3c_device_adc,
400 &s3c_device_ts, 647 &s3c_device_ts,
648 &power_supply,
649 &h1940_battery,
401}; 650};
402 651
403static void __init h1940_map_io(void) 652static void __init h1940_map_io(void)
@@ -475,14 +724,20 @@ static void __init h1940_init(void)
475 gpio_direction_output(H1940_LATCH_LCD_P4, 0); 724 gpio_direction_output(H1940_LATCH_LCD_P4, 0);
476 gpio_direction_output(H1940_LATCH_MAX1698_nSHUTDOWN, 0); 725 gpio_direction_output(H1940_LATCH_MAX1698_nSHUTDOWN, 0);
477 726
478 gpio_request(H1940_LATCH_USB_DP, "USB pullup");
479 gpio_direction_output(H1940_LATCH_USB_DP, 0);
480
481 gpio_request(H1940_LATCH_SD_POWER, "SD power"); 727 gpio_request(H1940_LATCH_SD_POWER, "SD power");
482 gpio_direction_output(H1940_LATCH_SD_POWER, 0); 728 gpio_direction_output(H1940_LATCH_SD_POWER, 0);
483 729
484 platform_add_devices(h1940_devices, ARRAY_SIZE(h1940_devices)); 730 platform_add_devices(h1940_devices, ARRAY_SIZE(h1940_devices));
485 731
732 gpio_request(S3C2410_GPA(1), "Red LED blink");
733 gpio_request(S3C2410_GPA(3), "Blue LED blink");
734 gpio_request(S3C2410_GPA(7), "Green LED blink");
735 gpio_request(H1940_LATCH_LED_FLASH, "LED blink");
736 gpio_direction_output(S3C2410_GPA(1), 0);
737 gpio_direction_output(S3C2410_GPA(3), 0);
738 gpio_direction_output(S3C2410_GPA(7), 0);
739 gpio_direction_output(H1940_LATCH_LED_FLASH, 0);
740
486 i2c_register_board_info(0, h1940_i2c_devices, 741 i2c_register_board_info(0, h1940_i2c_devices,
487 ARRAY_SIZE(h1940_i2c_devices)); 742 ARRAY_SIZE(h1940_i2c_devices));
488} 743}
diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index 271b9aa6d40a..66f44440d5d3 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -84,26 +84,10 @@ static struct s3c2410_uartcfg n30_uartcfgs[] = {
84 }, 84 },
85}; 85};
86 86
87static void n30_udc_pullup(enum s3c2410_udc_cmd_e cmd)
88{
89 switch (cmd) {
90 case S3C2410_UDC_P_ENABLE :
91 gpio_set_value(S3C2410_GPB(3), 1);
92 break;
93 case S3C2410_UDC_P_DISABLE :
94 gpio_set_value(S3C2410_GPB(3), 0);
95 break;
96 case S3C2410_UDC_P_RESET :
97 break;
98 default:
99 break;
100 }
101}
102
103static struct s3c2410_udc_mach_info n30_udc_cfg __initdata = { 87static struct s3c2410_udc_mach_info n30_udc_cfg __initdata = {
104 .udc_command = n30_udc_pullup,
105 .vbus_pin = S3C2410_GPG(1), 88 .vbus_pin = S3C2410_GPG(1),
106 .vbus_pin_inverted = 0, 89 .vbus_pin_inverted = 0,
90 .pullup_pin = S3C2410_GPB(3),
107}; 91};
108 92
109static struct gpio_keys_button n30_buttons[] = { 93static struct gpio_keys_button n30_buttons[] = {
@@ -596,9 +580,6 @@ static void __init n30_init(void)
596 580
597 platform_add_devices(n35_devices, ARRAY_SIZE(n35_devices)); 581 platform_add_devices(n35_devices, ARRAY_SIZE(n35_devices));
598 } 582 }
599
600 WARN_ON(gpio_request(S3C2410_GPB(3), "udc pup"));
601 gpio_direction_output(S3C2410_GPB(3), 0);
602} 583}
603 584
604MACHINE_START(N30, "Acer-N30") 585MACHINE_START(N30, "Acer-N30")
diff --git a/arch/arm/mach-s3c2412/mach-smdk2413.c b/arch/arm/mach-s3c2412/mach-smdk2413.c
index 8e5758bdd666..834cfb61bcfe 100644
--- a/arch/arm/mach-s3c2412/mach-smdk2413.c
+++ b/arch/arm/mach-s3c2412/mach-smdk2413.c
@@ -78,28 +78,9 @@ static struct s3c2410_uartcfg smdk2413_uartcfgs[] __initdata = {
78 } 78 }
79}; 79};
80 80
81static void smdk2413_udc_pullup(enum s3c2410_udc_cmd_e cmd)
82{
83 printk(KERN_DEBUG "udc: pullup(%d)\n",cmd);
84
85 switch (cmd)
86 {
87 case S3C2410_UDC_P_ENABLE :
88 gpio_set_value(S3C2410_GPF(2), 1);
89 break;
90 case S3C2410_UDC_P_DISABLE :
91 gpio_set_value(S3C2410_GPF(2), 0);
92 break;
93 case S3C2410_UDC_P_RESET :
94 break;
95 default:
96 break;
97 }
98}
99
100 81
101static struct s3c2410_udc_mach_info smdk2413_udc_cfg __initdata = { 82static struct s3c2410_udc_mach_info smdk2413_udc_cfg __initdata = {
102 .udc_command = smdk2413_udc_pullup, 83 .pullup_pin = S3C2410_GPF(2),
103}; 84};
104 85
105 86
@@ -133,9 +114,6 @@ static void __init smdk2413_machine_init(void)
133{ /* Turn off suspend on both USB ports, and switch the 114{ /* Turn off suspend on both USB ports, and switch the
134 * selectable USB port to USB device mode. */ 115 * selectable USB port to USB device mode. */
135 116
136 WARN_ON(gpio_request(S3C2410_GPF(2), "udc pull"));
137 gpio_direction_output(S3C2410_GPF(2), 0);
138
139 s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST | 117 s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
140 S3C2410_MISCCR_USBSUSPND0 | 118 S3C2410_MISCCR_USBSUSPND0 |
141 S3C2410_MISCCR_USBSUSPND1, 0x0); 119 S3C2410_MISCCR_USBSUSPND1, 0x0);
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
index a0cb2581894f..50825a3f91cc 100644
--- a/arch/arm/mach-s3c2440/Kconfig
+++ b/arch/arm/mach-s3c2440/Kconfig
@@ -99,6 +99,7 @@ config MACH_NEO1973_GTA02
99 select POWER_SUPPLY 99 select POWER_SUPPLY
100 select MACH_NEO1973 100 select MACH_NEO1973
101 select S3C2410_PWM 101 select S3C2410_PWM
102 select S3C_DEV_USB_HOST
102 help 103 help
103 Say Y here if you are using the Openmoko GTA02 / Freerunner GSM Phone 104 Say Y here if you are using the Openmoko GTA02 / Freerunner GSM Phone
104 105
diff --git a/arch/arm/mach-s3c2440/include/mach/gta02.h b/arch/arm/mach-s3c2440/include/mach/gta02.h
index 953331d8d56a..3a56a229cac6 100644
--- a/arch/arm/mach-s3c2440/include/mach/gta02.h
+++ b/arch/arm/mach-s3c2440/include/mach/gta02.h
@@ -44,19 +44,19 @@
44#define GTA02v3_GPIO_nUSB_FLT S3C2410_GPG(10) /* v3 + v4 only */ 44#define GTA02v3_GPIO_nUSB_FLT S3C2410_GPG(10) /* v3 + v4 only */
45#define GTA02v3_GPIO_nGSM_OC S3C2410_GPG(11) /* v3 + v4 only */ 45#define GTA02v3_GPIO_nGSM_OC S3C2410_GPG(11) /* v3 + v4 only */
46 46
47#define GTA02_GPIO_AMP_SHUT S3C2440_GPJ1 /* v2 + v3 + v4 only */ 47#define GTA02_GPIO_AMP_SHUT S3C2410_GPJ(1) /* v2 + v3 + v4 only */
48#define GTA02v1_GPIO_WLAN_GPIO10 S3C2440_GPJ2 48#define GTA02v1_GPIO_WLAN_GPIO10 S3C2410_GPJ(2)
49#define GTA02_GPIO_HP_IN S3C2440_GPJ2 /* v2 + v3 + v4 only */ 49#define GTA02_GPIO_HP_IN S3C2410_GPJ(2) /* v2 + v3 + v4 only */
50#define GTA02_GPIO_INT0 S3C2440_GPJ3 /* v2 + v3 + v4 only */ 50#define GTA02_GPIO_INT0 S3C2410_GPJ(3) /* v2 + v3 + v4 only */
51#define GTA02_GPIO_nGSM_EN S3C2440_GPJ4 51#define GTA02_GPIO_nGSM_EN S3C2410_GPJ(4)
52#define GTA02_GPIO_3D_RESET S3C2440_GPJ5 52#define GTA02_GPIO_3D_RESET S3C2410_GPJ(5)
53#define GTA02_GPIO_nDL_GSM S3C2440_GPJ6 /* v4 + v5 only */ 53#define GTA02_GPIO_nDL_GSM S3C2410_GPJ(6) /* v4 + v5 only */
54#define GTA02_GPIO_WLAN_GPIO0 S3C2440_GPJ7 54#define GTA02_GPIO_WLAN_GPIO0 S3C2410_GPJ(7)
55#define GTA02v1_GPIO_BAT_ID S3C2440_GPJ8 55#define GTA02v1_GPIO_BAT_ID S3C2410_GPJ(8)
56#define GTA02_GPIO_KEEPACT S3C2440_GPJ8 56#define GTA02_GPIO_KEEPACT S3C2410_GPJ(8)
57#define GTA02v1_GPIO_HP_IN S3C2440_GPJ10 57#define GTA02v1_GPIO_HP_IN S3C2410_GPJ(10)
58#define GTA02_CHIP_PWD S3C2440_GPJ11 /* v2 + v3 + v4 only */ 58#define GTA02_CHIP_PWD S3C2410_GPJ(11) /* v2 + v3 + v4 only */
59#define GTA02_GPIO_nWLAN_RESET S3C2440_GPJ12 /* v2 + v3 + v4 only */ 59#define GTA02_GPIO_nWLAN_RESET S3C2410_GPJ(12) /* v2 + v3 + v4 only */
60 60
61#define GTA02_IRQ_GSENSOR_1 IRQ_EINT0 61#define GTA02_IRQ_GSENSOR_1 IRQ_EINT0
62#define GTA02_IRQ_MODEM IRQ_EINT1 62#define GTA02_IRQ_MODEM IRQ_EINT1
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index 9f2c14ec7181..0db2411ef4bb 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -58,6 +58,9 @@
58#include <linux/mfd/pcf50633/pmic.h> 58#include <linux/mfd/pcf50633/pmic.h>
59#include <linux/mfd/pcf50633/backlight.h> 59#include <linux/mfd/pcf50633/backlight.h>
60 60
61#include <linux/input.h>
62#include <linux/gpio_keys.h>
63
61#include <asm/mach/arch.h> 64#include <asm/mach/arch.h>
62#include <asm/mach/map.h> 65#include <asm/mach/map.h>
63#include <asm/mach/irq.h> 66#include <asm/mach/irq.h>
@@ -86,6 +89,8 @@
86#include <plat/udc.h> 89#include <plat/udc.h>
87#include <plat/gpio-cfg.h> 90#include <plat/gpio-cfg.h>
88#include <plat/iic.h> 91#include <plat/iic.h>
92#include <plat/ts.h>
93
89 94
90static struct pcf50633 *gta02_pcf; 95static struct pcf50633 *gta02_pcf;
91 96
@@ -280,9 +285,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
280 .valid_modes_mask = REGULATOR_MODE_NORMAL, 285 .valid_modes_mask = REGULATOR_MODE_NORMAL,
281 .always_on = 1, 286 .always_on = 1,
282 .apply_uV = 1, 287 .apply_uV = 1,
283 .state_mem = {
284 .enabled = 1,
285 },
286 }, 288 },
287 }, 289 },
288 [PCF50633_REGULATOR_DOWN1] = { 290 [PCF50633_REGULATOR_DOWN1] = {
@@ -301,9 +303,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
301 .valid_modes_mask = REGULATOR_MODE_NORMAL, 303 .valid_modes_mask = REGULATOR_MODE_NORMAL,
302 .apply_uV = 1, 304 .apply_uV = 1,
303 .always_on = 1, 305 .always_on = 1,
304 .state_mem = {
305 .enabled = 1,
306 },
307 }, 306 },
308 }, 307 },
309 [PCF50633_REGULATOR_HCLDO] = { 308 [PCF50633_REGULATOR_HCLDO] = {
@@ -311,8 +310,8 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
311 .min_uV = 2000000, 310 .min_uV = 2000000,
312 .max_uV = 3300000, 311 .max_uV = 3300000,
313 .valid_modes_mask = REGULATOR_MODE_NORMAL, 312 .valid_modes_mask = REGULATOR_MODE_NORMAL,
314 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, 313 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
315 .always_on = 1, 314 REGULATOR_CHANGE_STATUS,
316 }, 315 },
317 }, 316 },
318 [PCF50633_REGULATOR_LDO1] = { 317 [PCF50633_REGULATOR_LDO1] = {
@@ -320,10 +319,8 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
320 .min_uV = 3300000, 319 .min_uV = 3300000,
321 .max_uV = 3300000, 320 .max_uV = 3300000,
322 .valid_modes_mask = REGULATOR_MODE_NORMAL, 321 .valid_modes_mask = REGULATOR_MODE_NORMAL,
322 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
323 .apply_uV = 1, 323 .apply_uV = 1,
324 .state_mem = {
325 .enabled = 0,
326 },
327 }, 324 },
328 }, 325 },
329 [PCF50633_REGULATOR_LDO2] = { 326 [PCF50633_REGULATOR_LDO2] = {
@@ -347,6 +344,7 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
347 .min_uV = 3200000, 344 .min_uV = 3200000,
348 .max_uV = 3200000, 345 .max_uV = 3200000,
349 .valid_modes_mask = REGULATOR_MODE_NORMAL, 346 .valid_modes_mask = REGULATOR_MODE_NORMAL,
347 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
350 .apply_uV = 1, 348 .apply_uV = 1,
351 }, 349 },
352 }, 350 },
@@ -355,10 +353,8 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
355 .min_uV = 3000000, 353 .min_uV = 3000000,
356 .max_uV = 3000000, 354 .max_uV = 3000000,
357 .valid_modes_mask = REGULATOR_MODE_NORMAL, 355 .valid_modes_mask = REGULATOR_MODE_NORMAL,
356 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
358 .apply_uV = 1, 357 .apply_uV = 1,
359 .state_mem = {
360 .enabled = 1,
361 },
362 }, 358 },
363 }, 359 },
364 [PCF50633_REGULATOR_LDO6] = { 360 [PCF50633_REGULATOR_LDO6] = {
@@ -373,9 +369,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
373 .min_uV = 1800000, 369 .min_uV = 1800000,
374 .max_uV = 1800000, 370 .max_uV = 1800000,
375 .valid_modes_mask = REGULATOR_MODE_NORMAL, 371 .valid_modes_mask = REGULATOR_MODE_NORMAL,
376 .state_mem = {
377 .enabled = 1,
378 },
379 }, 372 },
380 }, 373 },
381 374
@@ -455,28 +448,10 @@ static struct s3c2410_platform_nand __initdata gta02_nand_info = {
455}; 448};
456 449
457 450
458static void gta02_udc_command(enum s3c2410_udc_cmd_e cmd)
459{
460 switch (cmd) {
461 case S3C2410_UDC_P_ENABLE:
462 pr_debug("%s S3C2410_UDC_P_ENABLE\n", __func__);
463 gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
464 break;
465 case S3C2410_UDC_P_DISABLE:
466 pr_debug("%s S3C2410_UDC_P_DISABLE\n", __func__);
467 gpio_direction_output(GTA02_GPIO_USB_PULLUP, 0);
468 break;
469 case S3C2410_UDC_P_RESET:
470 pr_debug("%s S3C2410_UDC_P_RESET\n", __func__);
471 /* FIXME: Do something here. */
472 }
473}
474
475/* Get PMU to set USB current limit accordingly. */ 451/* Get PMU to set USB current limit accordingly. */
476static struct s3c2410_udc_mach_info gta02_udc_cfg = { 452static struct s3c2410_udc_mach_info gta02_udc_cfg __initdata = {
477 .vbus_draw = gta02_udc_vbus_draw, 453 .vbus_draw = gta02_udc_vbus_draw,
478 .udc_command = gta02_udc_command, 454 .pullup_pin = GTA02_GPIO_USB_PULLUP,
479
480}; 455};
481 456
482/* USB */ 457/* USB */
@@ -489,6 +464,43 @@ static struct s3c2410_hcd_info gta02_usb_info __initdata = {
489 }, 464 },
490}; 465};
491 466
467/* Touchscreen */
468static struct s3c2410_ts_mach_info gta02_ts_info = {
469 .delay = 10000,
470 .presc = 0xff, /* slow as we can go */
471 .oversampling_shift = 2,
472};
473
474/* Buttons */
475static struct gpio_keys_button gta02_buttons[] = {
476 {
477 .gpio = GTA02_GPIO_AUX_KEY,
478 .code = KEY_PHONE,
479 .desc = "Aux",
480 .type = EV_KEY,
481 .debounce_interval = 100,
482 },
483 {
484 .gpio = GTA02_GPIO_HOLD_KEY,
485 .code = KEY_PAUSE,
486 .desc = "Hold",
487 .type = EV_KEY,
488 .debounce_interval = 100,
489 },
490};
491
492static struct gpio_keys_platform_data gta02_buttons_pdata = {
493 .buttons = gta02_buttons,
494 .nbuttons = ARRAY_SIZE(gta02_buttons),
495};
496
497static struct platform_device gta02_buttons_device = {
498 .name = "gpio-keys",
499 .id = -1,
500 .dev = {
501 .platform_data = &gta02_buttons_pdata,
502 },
503};
492 504
493static void __init gta02_map_io(void) 505static void __init gta02_map_io(void)
494{ 506{
@@ -509,7 +521,11 @@ static struct platform_device *gta02_devices[] __initdata = {
509 &gta02_nor_flash, 521 &gta02_nor_flash,
510 &s3c24xx_pwm_device, 522 &s3c24xx_pwm_device,
511 &s3c_device_iis, 523 &s3c_device_iis,
524 &samsung_asoc_dma,
512 &s3c_device_i2c0, 525 &s3c_device_i2c0,
526 &gta02_buttons_device,
527 &s3c_device_adc,
528 &s3c_device_ts,
513}; 529};
514 530
515/* These guys DO need to be children of PMU. */ 531/* These guys DO need to be children of PMU. */
@@ -559,6 +575,7 @@ static void __init gta02_machine_init(void)
559#endif 575#endif
560 576
561 s3c24xx_udc_set_platdata(&gta02_udc_cfg); 577 s3c24xx_udc_set_platdata(&gta02_udc_cfg);
578 s3c24xx_ts_set_platdata(&gta02_ts_info);
562 s3c_ohci_set_platdata(&gta02_usb_info); 579 s3c_ohci_set_platdata(&gta02_usb_info);
563 s3c_nand_set_platdata(&gta02_nand_info); 580 s3c_nand_set_platdata(&gta02_nand_info);
564 s3c_i2c0_set_platdata(NULL); 581 s3c_i2c0_set_platdata(NULL);
@@ -567,6 +584,8 @@ static void __init gta02_machine_init(void)
567 584
568 platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices)); 585 platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices));
569 pm_power_off = gta02_poweroff; 586 pm_power_off = gta02_poweroff;
587
588 regulator_has_full_constraints();
570} 589}
571 590
572 591
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c
index f62bb4c793bd..dfedc9c9e005 100644
--- a/arch/arm/mach-s3c2440/mach-mini2440.c
+++ b/arch/arm/mach-s3c2440/mach-mini2440.c
@@ -97,26 +97,8 @@ static struct s3c2410_uartcfg mini2440_uartcfgs[] __initdata = {
97 97
98/* USB device UDC support */ 98/* USB device UDC support */
99 99
100static void mini2440_udc_pullup(enum s3c2410_udc_cmd_e cmd)
101{
102 pr_debug("udc: pullup(%d)\n", cmd);
103
104 switch (cmd) {
105 case S3C2410_UDC_P_ENABLE :
106 gpio_set_value(S3C2410_GPC(5), 1);
107 break;
108 case S3C2410_UDC_P_DISABLE :
109 gpio_set_value(S3C2410_GPC(5), 0);
110 break;
111 case S3C2410_UDC_P_RESET :
112 break;
113 default:
114 break;
115 }
116}
117
118static struct s3c2410_udc_mach_info mini2440_udc_cfg __initdata = { 100static struct s3c2410_udc_mach_info mini2440_udc_cfg __initdata = {
119 .udc_command = mini2440_udc_pullup, 101 .pullup_pin = S3C2410_GPC(5),
120}; 102};
121 103
122 104
@@ -506,6 +488,11 @@ static struct i2c_board_info mini2440_i2c_devs[] __initdata = {
506 }, 488 },
507}; 489};
508 490
491static struct platform_device uda1340_codec = {
492 .name = "uda134x-codec",
493 .id = -1,
494};
495
509static struct platform_device *mini2440_devices[] __initdata = { 496static struct platform_device *mini2440_devices[] __initdata = {
510 &s3c_device_ohci, 497 &s3c_device_ohci,
511 &s3c_device_wdt, 498 &s3c_device_wdt,
@@ -521,7 +508,9 @@ static struct platform_device *mini2440_devices[] __initdata = {
521 &s3c_device_nand, 508 &s3c_device_nand,
522 &s3c_device_sdi, 509 &s3c_device_sdi,
523 &s3c_device_iis, 510 &s3c_device_iis,
511 &uda1340_codec,
524 &mini2440_audio, 512 &mini2440_audio,
513 &samsung_asoc_dma,
525}; 514};
526 515
527static void __init mini2440_map_io(void) 516static void __init mini2440_map_io(void)
@@ -644,10 +633,6 @@ static void __init mini2440_init(void)
644 s3c2410_gpio_setpin(S3C2410_GPB(1), 0); 633 s3c2410_gpio_setpin(S3C2410_GPB(1), 0);
645 s3c_gpio_cfgpin(S3C2410_GPB(1), S3C2410_GPIO_INPUT); 634 s3c_gpio_cfgpin(S3C2410_GPB(1), S3C2410_GPIO_INPUT);
646 635
647 /* Make sure the D+ pullup pin is output */
648 WARN_ON(gpio_request(S3C2410_GPC(5), "udc pup"));
649 gpio_direction_output(S3C2410_GPC(5), 0);
650
651 /* mark the key as input, without pullups (there is one on the board) */ 636 /* mark the key as input, without pullups (there is one on the board) */
652 for (i = 0; i < ARRAY_SIZE(mini2440_buttons); i++) { 637 for (i = 0; i < ARRAY_SIZE(mini2440_buttons); i++) {
653 s3c_gpio_setpull(mini2440_buttons[i].gpio, S3C_GPIO_PULL_UP); 638 s3c_gpio_setpull(mini2440_buttons[i].gpio, S3C_GPIO_PULL_UP);
diff --git a/arch/arm/mach-s3c2440/mach-rx1950.c b/arch/arm/mach-s3c2440/mach-rx1950.c
index eab6ae50683c..27ea95096fe1 100644
--- a/arch/arm/mach-s3c2440/mach-rx1950.c
+++ b/arch/arm/mach-s3c2440/mach-rx1950.c
@@ -263,27 +263,78 @@ void rx1950_disable_charger(void)
263 gpio_direction_output(S3C2410_GPJ(3), 0); 263 gpio_direction_output(S3C2410_GPJ(3), 0);
264} 264}
265 265
266DEFINE_SPINLOCK(rx1950_blink_spin);
267
268static int rx1950_led_blink_set(unsigned gpio, int state,
269 unsigned long *delay_on, unsigned long *delay_off)
270{
271 int blink_gpio, check_gpio;
272
273 switch (gpio) {
274 case S3C2410_GPA(6):
275 blink_gpio = S3C2410_GPA(4);
276 check_gpio = S3C2410_GPA(3);
277 break;
278 case S3C2410_GPA(7):
279 blink_gpio = S3C2410_GPA(3);
280 check_gpio = S3C2410_GPA(4);
281 break;
282 default:
283 return -EINVAL;
284 break;
285 }
286
287 if (delay_on && delay_off && !*delay_on && !*delay_off)
288 *delay_on = *delay_off = 500;
289
290 spin_lock(&rx1950_blink_spin);
291
292 switch (state) {
293 case GPIO_LED_NO_BLINK_LOW:
294 case GPIO_LED_NO_BLINK_HIGH:
295 if (!gpio_get_value(check_gpio))
296 gpio_set_value(S3C2410_GPJ(6), 0);
297 gpio_set_value(blink_gpio, 0);
298 gpio_set_value(gpio, state);
299 break;
300 case GPIO_LED_BLINK:
301 gpio_set_value(gpio, 0);
302 gpio_set_value(S3C2410_GPJ(6), 1);
303 gpio_set_value(blink_gpio, 1);
304 break;
305 }
306
307 spin_unlock(&rx1950_blink_spin);
308
309 return 0;
310}
311
266static struct gpio_led rx1950_leds_desc[] = { 312static struct gpio_led rx1950_leds_desc[] = {
267 { 313 {
268 .name = "Green", 314 .name = "Green",
269 .default_trigger = "main-battery-charging-or-full", 315 .default_trigger = "main-battery-full",
270 .gpio = S3C2410_GPA(6), 316 .gpio = S3C2410_GPA(6),
317 .retain_state_suspended = 1,
271 }, 318 },
272 { 319 {
273 .name = "Red", 320 .name = "Red",
274 .default_trigger = "main-battery-full", 321 .default_trigger
275 .gpio = S3C2410_GPA(7), 322 = "main-battery-charging-blink-full-solid",
323 .gpio = S3C2410_GPA(7),
324 .retain_state_suspended = 1,
276 }, 325 },
277 { 326 {
278 .name = "Blue", 327 .name = "Blue",
279 .default_trigger = "rx1950-acx-mem", 328 .default_trigger = "rx1950-acx-mem",
280 .gpio = S3C2410_GPA(11), 329 .gpio = S3C2410_GPA(11),
330 .retain_state_suspended = 1,
281 }, 331 },
282}; 332};
283 333
284static struct gpio_led_platform_data rx1950_leds_pdata = { 334static struct gpio_led_platform_data rx1950_leds_pdata = {
285 .num_leds = ARRAY_SIZE(rx1950_leds_desc), 335 .num_leds = ARRAY_SIZE(rx1950_leds_desc),
286 .leds = rx1950_leds_desc, 336 .leds = rx1950_leds_desc,
337 .gpio_blink_set = rx1950_led_blink_set,
287}; 338};
288 339
289static struct platform_device rx1950_leds = { 340static struct platform_device rx1950_leds = {
@@ -566,26 +617,10 @@ static struct s3c2410_platform_nand rx1950_nand_info = {
566 .sets = rx1950_nand_sets, 617 .sets = rx1950_nand_sets,
567}; 618};
568 619
569static void rx1950_udc_pullup(enum s3c2410_udc_cmd_e cmd)
570{
571 switch (cmd) {
572 case S3C2410_UDC_P_ENABLE:
573 gpio_direction_output(S3C2410_GPJ(5), 1);
574 break;
575 case S3C2410_UDC_P_DISABLE:
576 gpio_direction_output(S3C2410_GPJ(5), 0);
577 break;
578 case S3C2410_UDC_P_RESET:
579 break;
580 default:
581 break;
582 }
583}
584
585static struct s3c2410_udc_mach_info rx1950_udc_cfg __initdata = { 620static struct s3c2410_udc_mach_info rx1950_udc_cfg __initdata = {
586 .udc_command = rx1950_udc_pullup,
587 .vbus_pin = S3C2410_GPG(5), 621 .vbus_pin = S3C2410_GPG(5),
588 .vbus_pin_inverted = 1, 622 .vbus_pin_inverted = 1,
623 .pullup_pin = S3C2410_GPJ(5),
589}; 624};
590 625
591static struct s3c2410_ts_mach_info rx1950_ts_cfg __initdata = { 626static struct s3c2410_ts_mach_info rx1950_ts_cfg __initdata = {
@@ -750,9 +785,6 @@ static void __init rx1950_init_machine(void)
750 S3C2410_MISCCR_USBSUSPND0 | 785 S3C2410_MISCCR_USBSUSPND0 |
751 S3C2410_MISCCR_USBSUSPND1, 0x0); 786 S3C2410_MISCCR_USBSUSPND1, 0x0);
752 787
753 WARN_ON(gpio_request(S3C2410_GPJ(5), "UDC pullup"));
754 gpio_direction_output(S3C2410_GPJ(5), 0);
755
756 /* mmc power is disabled by default */ 788 /* mmc power is disabled by default */
757 WARN_ON(gpio_request(S3C2410_GPJ(1), "MMC power")); 789 WARN_ON(gpio_request(S3C2410_GPJ(1), "MMC power"));
758 gpio_direction_output(S3C2410_GPJ(1), 0); 790 gpio_direction_output(S3C2410_GPJ(1), 0);
@@ -771,6 +803,13 @@ static void __init rx1950_init_machine(void)
771 803
772 WARN_ON(gpio_request(S3C2410_GPB(1), "LCD power")); 804 WARN_ON(gpio_request(S3C2410_GPB(1), "LCD power"));
773 805
806 WARN_ON(gpio_request(S3C2410_GPA(3), "Red blink"));
807 WARN_ON(gpio_request(S3C2410_GPA(4), "Green blink"));
808 WARN_ON(gpio_request(S3C2410_GPJ(6), "LED blink"));
809 gpio_direction_output(S3C2410_GPA(3), 0);
810 gpio_direction_output(S3C2410_GPA(4), 0);
811 gpio_direction_output(S3C2410_GPJ(6), 0);
812
774 platform_add_devices(rx1950_devices, ARRAY_SIZE(rx1950_devices)); 813 platform_add_devices(rx1950_devices, ARRAY_SIZE(rx1950_devices));
775 814
776 i2c_register_board_info(0, rx1950_i2c_devices, 815 i2c_register_board_info(0, rx1950_i2c_devices,
diff --git a/arch/arm/mach-s3c24a0/include/mach/memory.h b/arch/arm/mach-s3c24a0/include/mach/memory.h
index 7d74fd5c8d66..7d208a71b172 100644
--- a/arch/arm/mach-s3c24a0/include/mach/memory.h
+++ b/arch/arm/mach-s3c24a0/include/mach/memory.h
@@ -11,7 +11,7 @@
11#ifndef __ASM_ARCH_24A0_MEMORY_H 11#ifndef __ASM_ARCH_24A0_MEMORY_H
12#define __ASM_ARCH_24A0_MEMORY_H __FILE__ 12#define __ASM_ARCH_24A0_MEMORY_H __FILE__
13 13
14#define PHYS_OFFSET UL(0x10000000) 14#define PLAT_PHYS_OFFSET UL(0x10000000)
15 15
16#define __virt_to_bus(x) __virt_to_phys(x) 16#define __virt_to_bus(x) __virt_to_phys(x)
17#define __bus_to_virt(x) __phys_to_virt(x) 17#define __bus_to_virt(x) __phys_to_virt(x)
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index 579d2f0f4dd0..e4177e22557b 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -143,6 +143,7 @@ config MACH_SMDK6410
143 select S3C_DEV_USB_HSOTG 143 select S3C_DEV_USB_HSOTG
144 select S3C_DEV_WDT 144 select S3C_DEV_WDT
145 select SAMSUNG_DEV_KEYPAD 145 select SAMSUNG_DEV_KEYPAD
146 select SAMSUNG_DEV_PWM
146 select HAVE_S3C2410_WATCHDOG if WATCHDOG 147 select HAVE_S3C2410_WATCHDOG if WATCHDOG
147 select S3C64XX_SETUP_SDHCI 148 select S3C64XX_SETUP_SDHCI
148 select S3C64XX_SETUP_I2C1 149 select S3C64XX_SETUP_I2C1
@@ -231,7 +232,7 @@ config MACH_HMT
231 select S3C_DEV_NAND 232 select S3C_DEV_NAND
232 select S3C_DEV_USB_HOST 233 select S3C_DEV_USB_HOST
233 select S3C64XX_SETUP_FB_24BPP 234 select S3C64XX_SETUP_FB_24BPP
234 select HAVE_PWM 235 select SAMSUNG_DEV_PWM
235 help 236 help
236 Machine support for the Airgoo HMT 237 Machine support for the Airgoo HMT
237 238
@@ -249,8 +250,8 @@ config MACH_SMARTQ
249 select S3C64XX_SETUP_SDHCI 250 select S3C64XX_SETUP_SDHCI
250 select S3C64XX_SETUP_FB_24BPP 251 select S3C64XX_SETUP_FB_24BPP
251 select SAMSUNG_DEV_ADC 252 select SAMSUNG_DEV_ADC
253 select SAMSUNG_DEV_PWM
252 select SAMSUNG_DEV_TS 254 select SAMSUNG_DEV_TS
253 select HAVE_PWM
254 help 255 help
255 Shared machine support for SmartQ 5/7 256 Shared machine support for SmartQ 5/7
256 257
diff --git a/arch/arm/mach-s3c64xx/clock.c b/arch/arm/mach-s3c64xx/clock.c
index dd3782064508..fdfc4d5e37a1 100644
--- a/arch/arm/mach-s3c64xx/clock.c
+++ b/arch/arm/mach-s3c64xx/clock.c
@@ -151,6 +151,12 @@ static struct clk init_clocks_off[] = {
151 .enable = s3c64xx_pclk_ctrl, 151 .enable = s3c64xx_pclk_ctrl,
152 .ctrlbit = S3C_CLKCON_PCLK_IIC, 152 .ctrlbit = S3C_CLKCON_PCLK_IIC,
153 }, { 153 }, {
154 .name = "i2c",
155 .id = 1,
156 .parent = &clk_p,
157 .enable = s3c64xx_pclk_ctrl,
158 .ctrlbit = S3C6410_CLKCON_PCLK_I2C1,
159 }, {
154 .name = "iis", 160 .name = "iis",
155 .id = 0, 161 .id = 0,
156 .parent = &clk_p, 162 .parent = &clk_p,
diff --git a/arch/arm/mach-s3c64xx/cpufreq.c b/arch/arm/mach-s3c64xx/cpufreq.c
index 74c0e8347de5..4375b97588b8 100644
--- a/arch/arm/mach-s3c64xx/cpufreq.c
+++ b/arch/arm/mach-s3c64xx/cpufreq.c
@@ -181,7 +181,7 @@ static void __init s3c64xx_cpufreq_config_regulator(void)
181} 181}
182#endif 182#endif
183 183
184static int __init s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy) 184static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy)
185{ 185{
186 int ret; 186 int ret;
187 struct cpufreq_frequency_table *freq; 187 struct cpufreq_frequency_table *freq;
diff --git a/arch/arm/mach-s3c64xx/dma.c b/arch/arm/mach-s3c64xx/dma.c
index 135db1b41252..c35585cf8c4f 100644
--- a/arch/arm/mach-s3c64xx/dma.c
+++ b/arch/arm/mach-s3c64xx/dma.c
@@ -690,12 +690,12 @@ static int s3c64xx_dma_init1(int chno, enum dma_ch chbase,
690 690
691 regptr = regs + PL080_Cx_BASE(0); 691 regptr = regs + PL080_Cx_BASE(0);
692 692
693 for (ch = 0; ch < 8; ch++, chno++, chptr++) { 693 for (ch = 0; ch < 8; ch++, chptr++) {
694 printk(KERN_INFO "%s: registering DMA %d (%p)\n", 694 pr_debug("%s: registering DMA %d (%p)\n",
695 __func__, chno, regptr); 695 __func__, chno + ch, regptr);
696 696
697 chptr->bit = 1 << ch; 697 chptr->bit = 1 << ch;
698 chptr->number = chno; 698 chptr->number = chno + ch;
699 chptr->dmac = dmac; 699 chptr->dmac = dmac;
700 chptr->regs = regptr; 700 chptr->regs = regptr;
701 regptr += PL080_Cx_STRIDE; 701 regptr += PL080_Cx_STRIDE;
@@ -704,7 +704,8 @@ static int s3c64xx_dma_init1(int chno, enum dma_ch chbase,
704 /* for the moment, permanently enable the controller */ 704 /* for the moment, permanently enable the controller */
705 writel(PL080_CONFIG_ENABLE, regs + PL080_CONFIG); 705 writel(PL080_CONFIG_ENABLE, regs + PL080_CONFIG);
706 706
707 printk(KERN_INFO "PL080: IRQ %d, at %p\n", irq, regs); 707 printk(KERN_INFO "PL080: IRQ %d, at %p, channels %d..%d\n",
708 irq, regs, chno, chno+8);
708 709
709 return 0; 710 return 0;
710 711
diff --git a/arch/arm/mach-s3c64xx/gpiolib.c b/arch/arm/mach-s3c64xx/gpiolib.c
index fd99a82e82c4..92b09085caaa 100644
--- a/arch/arm/mach-s3c64xx/gpiolib.c
+++ b/arch/arm/mach-s3c64xx/gpiolib.c
@@ -72,7 +72,7 @@ static struct s3c_gpio_cfg gpio_4bit_cfg_eint0011 = {
72 .get_pull = s3c_gpio_getpull_updown, 72 .get_pull = s3c_gpio_getpull_updown,
73}; 73};
74 74
75int s3c64xx_gpio2int_gpm(struct gpio_chip *chip, unsigned pin) 75static int s3c64xx_gpio2int_gpm(struct gpio_chip *chip, unsigned pin)
76{ 76{
77 return pin < 5 ? IRQ_EINT(23) + pin : -ENXIO; 77 return pin < 5 ? IRQ_EINT(23) + pin : -ENXIO;
78} 78}
@@ -138,7 +138,7 @@ static struct s3c_gpio_chip gpio_4bit[] = {
138 }, 138 },
139}; 139};
140 140
141int s3c64xx_gpio2int_gpl(struct gpio_chip *chip, unsigned pin) 141static int s3c64xx_gpio2int_gpl(struct gpio_chip *chip, unsigned pin)
142{ 142{
143 return pin >= 8 ? IRQ_EINT(16) + pin - 8 : -ENXIO; 143 return pin >= 8 ? IRQ_EINT(16) + pin - 8 : -ENXIO;
144} 144}
diff --git a/arch/arm/mach-s3c64xx/include/mach/memory.h b/arch/arm/mach-s3c64xx/include/mach/memory.h
index 42cc54e2ee30..4760cdae1eb6 100644
--- a/arch/arm/mach-s3c64xx/include/mach/memory.h
+++ b/arch/arm/mach-s3c64xx/include/mach/memory.h
@@ -13,7 +13,7 @@
13#ifndef __ASM_ARCH_MEMORY_H 13#ifndef __ASM_ARCH_MEMORY_H
14#define __ASM_ARCH_MEMORY_H 14#define __ASM_ARCH_MEMORY_H
15 15
16#define PHYS_OFFSET UL(0x50000000) 16#define PLAT_PHYS_OFFSET UL(0x50000000)
17 17
18#define CONSISTENT_DMA_SIZE SZ_8M 18#define CONSISTENT_DMA_SIZE SZ_8M
19 19
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index e85192a86fbe..686a4f270b12 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -28,6 +28,8 @@
28#include <linux/delay.h> 28#include <linux/delay.h>
29#include <linux/smsc911x.h> 29#include <linux/smsc911x.h>
30#include <linux/regulator/fixed.h> 30#include <linux/regulator/fixed.h>
31#include <linux/regulator/machine.h>
32#include <linux/pwm_backlight.h>
31 33
32#ifdef CONFIG_SMDK6410_WM1190_EV1 34#ifdef CONFIG_SMDK6410_WM1190_EV1
33#include <linux/mfd/wm8350/core.h> 35#include <linux/mfd/wm8350/core.h>
@@ -48,6 +50,7 @@
48#include <mach/hardware.h> 50#include <mach/hardware.h>
49#include <mach/regs-fb.h> 51#include <mach/regs-fb.h>
50#include <mach/map.h> 52#include <mach/map.h>
53#include <mach/gpio-bank-f.h>
51 54
52#include <asm/irq.h> 55#include <asm/irq.h>
53#include <asm/mach-types.h> 56#include <asm/mach-types.h>
@@ -118,7 +121,6 @@ static void smdk6410_lcd_power_set(struct plat_lcd_data *pd,
118{ 121{
119 if (power) { 122 if (power) {
120 gpio_direction_output(S3C64XX_GPF(13), 1); 123 gpio_direction_output(S3C64XX_GPF(13), 1);
121 gpio_direction_output(S3C64XX_GPF(15), 1);
122 124
123 /* fire nRESET on power up */ 125 /* fire nRESET on power up */
124 gpio_direction_output(S3C64XX_GPN(5), 0); 126 gpio_direction_output(S3C64XX_GPN(5), 0);
@@ -126,7 +128,6 @@ static void smdk6410_lcd_power_set(struct plat_lcd_data *pd,
126 gpio_direction_output(S3C64XX_GPN(5), 1); 128 gpio_direction_output(S3C64XX_GPN(5), 1);
127 msleep(1); 129 msleep(1);
128 } else { 130 } else {
129 gpio_direction_output(S3C64XX_GPF(15), 0);
130 gpio_direction_output(S3C64XX_GPF(13), 0); 131 gpio_direction_output(S3C64XX_GPF(13), 0);
131 } 132 }
132} 133}
@@ -269,6 +270,45 @@ static struct samsung_keypad_platdata smdk6410_keypad_data __initdata = {
269 .cols = 8, 270 .cols = 8,
270}; 271};
271 272
273static int smdk6410_backlight_init(struct device *dev)
274{
275 int ret;
276
277 ret = gpio_request(S3C64XX_GPF(15), "Backlight");
278 if (ret) {
279 printk(KERN_ERR "failed to request GPF for PWM-OUT1\n");
280 return ret;
281 }
282
283 /* Configure GPIO pin with S3C64XX_GPF15_PWM_TOUT1 */
284 s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_SFN(2));
285
286 return 0;
287}
288
289static void smdk6410_backlight_exit(struct device *dev)
290{
291 s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_OUTPUT);
292 gpio_free(S3C64XX_GPF(15));
293}
294
295static struct platform_pwm_backlight_data smdk6410_backlight_data = {
296 .pwm_id = 1,
297 .max_brightness = 255,
298 .dft_brightness = 255,
299 .pwm_period_ns = 78770,
300 .init = smdk6410_backlight_init,
301 .exit = smdk6410_backlight_exit,
302};
303
304static struct platform_device smdk6410_backlight_device = {
305 .name = "pwm-backlight",
306 .dev = {
307 .parent = &s3c_device_timer[1].dev,
308 .platform_data = &smdk6410_backlight_data,
309 },
310};
311
272static struct map_desc smdk6410_iodesc[] = {}; 312static struct map_desc smdk6410_iodesc[] = {};
273 313
274static struct platform_device *smdk6410_devices[] __initdata = { 314static struct platform_device *smdk6410_devices[] __initdata = {
@@ -298,6 +338,8 @@ static struct platform_device *smdk6410_devices[] __initdata = {
298 &s3c_device_rtc, 338 &s3c_device_rtc,
299 &s3c_device_ts, 339 &s3c_device_ts,
300 &s3c_device_wdt, 340 &s3c_device_wdt,
341 &s3c_device_timer[1],
342 &smdk6410_backlight_device,
301}; 343};
302 344
303#ifdef CONFIG_REGULATOR 345#ifdef CONFIG_REGULATOR
@@ -351,7 +393,7 @@ static struct regulator_init_data smdk6410_vddpll = {
351/* VDD_UH_MMC, LDO5 on J5 */ 393/* VDD_UH_MMC, LDO5 on J5 */
352static struct regulator_init_data smdk6410_vdduh_mmc = { 394static struct regulator_init_data smdk6410_vdduh_mmc = {
353 .constraints = { 395 .constraints = {
354 .name = "PVDD_UH/PVDD_MMC", 396 .name = "PVDD_UH+PVDD_MMC",
355 .always_on = 1, 397 .always_on = 1,
356 }, 398 },
357}; 399};
@@ -417,7 +459,7 @@ static struct regulator_init_data smdk6410_vddaudio = {
417/* S3C64xx internal logic & PLL */ 459/* S3C64xx internal logic & PLL */
418static struct regulator_init_data wm8350_dcdc1_data = { 460static struct regulator_init_data wm8350_dcdc1_data = {
419 .constraints = { 461 .constraints = {
420 .name = "PVDD_INT/PVDD_PLL", 462 .name = "PVDD_INT+PVDD_PLL",
421 .min_uV = 1200000, 463 .min_uV = 1200000,
422 .max_uV = 1200000, 464 .max_uV = 1200000,
423 .always_on = 1, 465 .always_on = 1,
@@ -452,7 +494,7 @@ static struct regulator_consumer_supply wm8350_dcdc4_consumers[] = {
452 494
453static struct regulator_init_data wm8350_dcdc4_data = { 495static struct regulator_init_data wm8350_dcdc4_data = {
454 .constraints = { 496 .constraints = {
455 .name = "PVDD_HI/PVDD_EXT/PVDD_SYS/PVCCM2MTV", 497 .name = "PVDD_HI+PVDD_EXT+PVDD_SYS+PVCCM2MTV",
456 .min_uV = 3000000, 498 .min_uV = 3000000,
457 .max_uV = 3000000, 499 .max_uV = 3000000,
458 .always_on = 1, 500 .always_on = 1,
@@ -464,7 +506,7 @@ static struct regulator_init_data wm8350_dcdc4_data = {
464/* OTGi/1190-EV1 HPVDD & AVDD */ 506/* OTGi/1190-EV1 HPVDD & AVDD */
465static struct regulator_init_data wm8350_ldo4_data = { 507static struct regulator_init_data wm8350_ldo4_data = {
466 .constraints = { 508 .constraints = {
467 .name = "PVDD_OTGI/HPVDD/AVDD", 509 .name = "PVDD_OTGI+HPVDD+AVDD",
468 .min_uV = 1200000, 510 .min_uV = 1200000,
469 .max_uV = 1200000, 511 .max_uV = 1200000,
470 .apply_uV = 1, 512 .apply_uV = 1,
@@ -552,7 +594,7 @@ static struct wm831x_backlight_pdata wm1192_backlight_pdata = {
552 594
553static struct regulator_init_data wm1192_dcdc3 = { 595static struct regulator_init_data wm1192_dcdc3 = {
554 .constraints = { 596 .constraints = {
555 .name = "PVDD_MEM/PVDD_GPS", 597 .name = "PVDD_MEM+PVDD_GPS",
556 .always_on = 1, 598 .always_on = 1,
557 }, 599 },
558}; 600};
@@ -563,7 +605,7 @@ static struct regulator_consumer_supply wm1192_ldo1_consumers[] = {
563 605
564static struct regulator_init_data wm1192_ldo1 = { 606static struct regulator_init_data wm1192_ldo1 = {
565 .constraints = { 607 .constraints = {
566 .name = "PVDD_LCD/PVDD_EXT", 608 .name = "PVDD_LCD+PVDD_EXT",
567 .always_on = 1, 609 .always_on = 1,
568 }, 610 },
569 .consumer_supplies = wm1192_ldo1_consumers, 611 .consumer_supplies = wm1192_ldo1_consumers,
@@ -693,7 +735,6 @@ static void __init smdk6410_machine_init(void)
693 735
694 gpio_request(S3C64XX_GPN(5), "LCD power"); 736 gpio_request(S3C64XX_GPN(5), "LCD power");
695 gpio_request(S3C64XX_GPF(13), "LCD power"); 737 gpio_request(S3C64XX_GPF(13), "LCD power");
696 gpio_request(S3C64XX_GPF(15), "LCD power");
697 738
698 i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0)); 739 i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
699 i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1)); 740 i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
diff --git a/arch/arm/mach-s3c64xx/setup-keypad.c b/arch/arm/mach-s3c64xx/setup-keypad.c
index f8ed0d22db70..1d4d0ee9e870 100644
--- a/arch/arm/mach-s3c64xx/setup-keypad.c
+++ b/arch/arm/mach-s3c64xx/setup-keypad.c
@@ -17,7 +17,7 @@
17void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols) 17void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)
18{ 18{
19 /* Set all the necessary GPK pins to special-function 3: KP_ROW[x] */ 19 /* Set all the necessary GPK pins to special-function 3: KP_ROW[x] */
20 s3c_gpio_cfgrange_nopull(S3C64XX_GPK(8), 8 + rows, S3C_GPIO_SFN(3)); 20 s3c_gpio_cfgrange_nopull(S3C64XX_GPK(8), rows, S3C_GPIO_SFN(3));
21 21
22 /* Set all the necessary GPL pins to special-function 3: KP_COL[x] */ 22 /* Set all the necessary GPL pins to special-function 3: KP_COL[x] */
23 s3c_gpio_cfgrange_nopull(S3C64XX_GPL(0), cols, S3C_GPIO_SFN(3)); 23 s3c_gpio_cfgrange_nopull(S3C64XX_GPL(0), cols, S3C_GPIO_SFN(3));
diff --git a/arch/arm/mach-s3c64xx/setup-sdhci.c b/arch/arm/mach-s3c64xx/setup-sdhci.c
index 1a942037c4ef..f344a222bc84 100644
--- a/arch/arm/mach-s3c64xx/setup-sdhci.c
+++ b/arch/arm/mach-s3c64xx/setup-sdhci.c
@@ -56,7 +56,7 @@ void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev,
56 else 56 else
57 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0); 57 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
58 58
59 printk(KERN_INFO "%s: CTRL 2=%08x, 3=%08x\n", __func__, ctrl2, ctrl3); 59 pr_debug("%s: CTRL 2=%08x, 3=%08x\n", __func__, ctrl2, ctrl3);
60 writel(ctrl2, r + S3C_SDHCI_CONTROL2); 60 writel(ctrl2, r + S3C_SDHCI_CONTROL2);
61 writel(ctrl3, r + S3C_SDHCI_CONTROL3); 61 writel(ctrl3, r + S3C_SDHCI_CONTROL3);
62} 62}
diff --git a/arch/arm/mach-s3c64xx/sleep.S b/arch/arm/mach-s3c64xx/sleep.S
index b2ef44317368..afe5a762f46e 100644
--- a/arch/arm/mach-s3c64xx/sleep.S
+++ b/arch/arm/mach-s3c64xx/sleep.S
@@ -32,25 +32,13 @@
32 * code after resume. 32 * code after resume.
33 * 33 *
34 * entry: 34 * entry:
35 * r0 = pointer to the save block 35 * r1 = v:p offset
36 */ 36 */
37 37
38ENTRY(s3c_cpu_save) 38ENTRY(s3c_cpu_save)
39 stmfd sp!, { r4 - r12, lr } 39 stmfd sp!, { r4 - r12, lr }
40 40 ldr r3, =resume_with_mmu
41 mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID 41 bl cpu_suspend
42 mrc p15, 0, r5, c3, c0, 0 @ Domain ID
43 mrc p15, 0, r6, c2, c0, 0 @ Translation Table BASE0
44 mrc p15, 0, r7, c2, c0, 1 @ Translation Table BASE1
45 mrc p15, 0, r8, c2, c0, 2 @ Translation Table Control
46 mrc p15, 0, r9, c1, c0, 0 @ Control register
47 mrc p15, 0, r10, c1, c0, 1 @ Auxiliary control register
48 mrc p15, 0, r11, c1, c0, 2 @ Co-processor access controls
49
50 stmia r0, { r4 - r13 } @ Save CP registers and SP
51
52 @@ save our state to ram
53 bl s3c_pm_cb_flushcache
54 42
55 @@ call final suspend code 43 @@ call final suspend code
56 ldr r0, =pm_cpu_sleep 44 ldr r0, =pm_cpu_sleep
@@ -61,18 +49,6 @@ ENTRY(s3c_cpu_save)
61resume_with_mmu: 49resume_with_mmu:
62 ldmfd sp!, { r4 - r12, pc } @ return, from sp from s3c_cpu_save 50 ldmfd sp!, { r4 - r12, pc } @ return, from sp from s3c_cpu_save
63 51
64 .data
65
66 /* the next bit is code, but it requires easy access to the
67 * s3c_sleep_save_phys data before the MMU is switched on, so
68 * we store the code that needs this variable in the .data where
69 * the value can be written to (the .text segment is RO).
70 */
71
72 .global s3c_sleep_save_phys
73s3c_sleep_save_phys:
74 .word 0
75
76 /* Sleep magic, the word before the resume entry point so that the 52 /* Sleep magic, the word before the resume entry point so that the
77 * bootloader can check for a resumeable image. */ 53 * bootloader can check for a resumeable image. */
78 54
@@ -110,35 +86,4 @@ ENTRY(s3c_cpu_resume)
110 orr r0, r0, #1 << 15 @ GPN15 86 orr r0, r0, #1 << 15 @ GPN15
111 str r0, [ r3, #S3C64XX_GPNDAT ] 87 str r0, [ r3, #S3C64XX_GPNDAT ]
112#endif 88#endif
113 89 b cpu_resume
114 /* __v6_setup from arch/arm/mm/proc-v6.S, ensure that the caches
115 * are thoroughly cleaned just in case the bootloader didn't do it
116 * for us. */
117 mov r0, #0
118 mcr p15, 0, r0, c7, c14, 0 @ clean+invalidate D cache
119 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
120 mcr p15, 0, r0, c7, c15, 0 @ clean+invalidate cache
121 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
122 @@mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs
123 @@mcr p15, 0, r0, c7, c7, 0 @ Invalidate I + D caches
124
125 ldr r0, s3c_sleep_save_phys
126 ldmia r0, { r4 - r13 }
127
128 mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID
129 mcr p15, 0, r5, c3, c0, 0 @ Domain ID
130 mcr p15, 0, r6, c2, c0, 0 @ Translation Table BASE0
131 mcr p15, 0, r7, c2, c0, 1 @ Translation Table BASE1
132 mcr p15, 0, r8, c2, c0, 2 @ Translation Table Control
133 mcr p15, 0, r10, c1, c0, 1 @ Auxiliary control register
134
135 mov r0, #0 @ restore copro access controls
136 mcr p15, 0, r11, c1, c0, 2 @ Co-processor access controls
137 mcr p15, 0, r0, c7, c5, 4
138
139 ldr r2, =resume_with_mmu
140 mcr p15, 0, r9, c1, c0, 0 /* turn mmu back on */
141 nop
142 mov pc, r2 /* jump back */
143
144 .end
diff --git a/arch/arm/mach-s5p6442/include/mach/map.h b/arch/arm/mach-s5p6442/include/mach/map.h
index 203dd5a18bd5..058dab4482a1 100644
--- a/arch/arm/mach-s5p6442/include/mach/map.h
+++ b/arch/arm/mach-s5p6442/include/mach/map.h
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s5p6442/include/mach/map.h 1/* linux/arch/arm/mach-s5p6442/include/mach/map.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com/
5 * 5 *
6 * S5P6442 - Memory map definitions 6 * S5P6442 - Memory map definitions
@@ -16,56 +16,61 @@
16#include <plat/map-base.h> 16#include <plat/map-base.h>
17#include <plat/map-s5p.h> 17#include <plat/map-s5p.h>
18 18
19#define S5P6442_PA_CHIPID (0xE0000000) 19#define S5P6442_PA_SDRAM 0x20000000
20#define S5P_PA_CHIPID S5P6442_PA_CHIPID
21 20
22#define S5P6442_PA_SYSCON (0xE0100000) 21#define S5P6442_PA_I2S0 0xC0B00000
23#define S5P_PA_SYSCON S5P6442_PA_SYSCON 22#define S5P6442_PA_I2S1 0xF2200000
24 23
25#define S5P6442_PA_GPIO (0xE0200000) 24#define S5P6442_PA_CHIPID 0xE0000000
26 25
27#define S5P6442_PA_VIC0 (0xE4000000) 26#define S5P6442_PA_SYSCON 0xE0100000
28#define S5P6442_PA_VIC1 (0xE4100000)
29#define S5P6442_PA_VIC2 (0xE4200000)
30 27
31#define S5P6442_PA_SROMC (0xE7000000) 28#define S5P6442_PA_GPIO 0xE0200000
32#define S5P_PA_SROMC S5P6442_PA_SROMC
33 29
34#define S5P6442_PA_MDMA 0xE8000000 30#define S5P6442_PA_VIC0 0xE4000000
35#define S5P6442_PA_PDMA 0xE9000000 31#define S5P6442_PA_VIC1 0xE4100000
32#define S5P6442_PA_VIC2 0xE4200000
36 33
37#define S5P6442_PA_TIMER (0xEA000000) 34#define S5P6442_PA_SROMC 0xE7000000
38#define S5P_PA_TIMER S5P6442_PA_TIMER
39 35
40#define S5P6442_PA_SYSTIMER (0xEA100000) 36#define S5P6442_PA_MDMA 0xE8000000
37#define S5P6442_PA_PDMA 0xE9000000
41 38
42#define S5P6442_PA_WATCHDOG (0xEA200000) 39#define S5P6442_PA_TIMER 0xEA000000
43 40
44#define S5P6442_PA_UART (0xEC000000) 41#define S5P6442_PA_SYSTIMER 0xEA100000
45 42
46#define S5P_PA_UART0 (S5P6442_PA_UART + 0x0) 43#define S5P6442_PA_WATCHDOG 0xEA200000
47#define S5P_PA_UART1 (S5P6442_PA_UART + 0x400)
48#define S5P_PA_UART2 (S5P6442_PA_UART + 0x800)
49#define S5P_SZ_UART SZ_256
50 44
51#define S5P6442_PA_IIC0 (0xEC100000) 45#define S5P6442_PA_UART 0xEC000000
52 46
53#define S5P6442_PA_SDRAM (0x20000000) 47#define S5P6442_PA_IIC0 0xEC100000
54#define S5P_PA_SDRAM S5P6442_PA_SDRAM
55 48
56#define S5P6442_PA_SPI 0xEC300000 49#define S5P6442_PA_SPI 0xEC300000
57 50
58/* I2S */
59#define S5P6442_PA_I2S0 0xC0B00000
60#define S5P6442_PA_I2S1 0xF2200000
61
62/* PCM */
63#define S5P6442_PA_PCM0 0xF2400000 51#define S5P6442_PA_PCM0 0xF2400000
64#define S5P6442_PA_PCM1 0xF2500000 52#define S5P6442_PA_PCM1 0xF2500000
65 53
66/* compatibiltiy defines. */ 54/* Compatibiltiy Defines */
55
56#define S3C_PA_IIC S5P6442_PA_IIC0
67#define S3C_PA_WDT S5P6442_PA_WATCHDOG 57#define S3C_PA_WDT S5P6442_PA_WATCHDOG
58
59#define S5P_PA_CHIPID S5P6442_PA_CHIPID
60#define S5P_PA_SDRAM S5P6442_PA_SDRAM
61#define S5P_PA_SROMC S5P6442_PA_SROMC
62#define S5P_PA_SYSCON S5P6442_PA_SYSCON
63#define S5P_PA_TIMER S5P6442_PA_TIMER
64
65/* UART */
66
68#define S3C_PA_UART S5P6442_PA_UART 67#define S3C_PA_UART S5P6442_PA_UART
69#define S3C_PA_IIC S5P6442_PA_IIC0 68
69#define S5P_PA_UART(x) (S3C_PA_UART + ((x) * S3C_UART_OFFSET))
70#define S5P_PA_UART0 S5P_PA_UART(0)
71#define S5P_PA_UART1 S5P_PA_UART(1)
72#define S5P_PA_UART2 S5P_PA_UART(2)
73
74#define S5P_SZ_UART SZ_256
70 75
71#endif /* __ASM_ARCH_MAP_H */ 76#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-s5p6442/include/mach/memory.h b/arch/arm/mach-s5p6442/include/mach/memory.h
index 9ddd877ba2ea..cfe259dded33 100644
--- a/arch/arm/mach-s5p6442/include/mach/memory.h
+++ b/arch/arm/mach-s5p6442/include/mach/memory.h
@@ -13,7 +13,7 @@
13#ifndef __ASM_ARCH_MEMORY_H 13#ifndef __ASM_ARCH_MEMORY_H
14#define __ASM_ARCH_MEMORY_H 14#define __ASM_ARCH_MEMORY_H
15 15
16#define PHYS_OFFSET UL(0x20000000) 16#define PLAT_PHYS_OFFSET UL(0x20000000)
17#define CONSISTENT_DMA_SIZE SZ_8M 17#define CONSISTENT_DMA_SIZE SZ_8M
18 18
19#endif /* __ASM_ARCH_MEMORY_H */ 19#endif /* __ASM_ARCH_MEMORY_H */
diff --git a/arch/arm/mach-s5p64x0/Kconfig b/arch/arm/mach-s5p64x0/Kconfig
index 164d2783d381..017af4c4293c 100644
--- a/arch/arm/mach-s5p64x0/Kconfig
+++ b/arch/arm/mach-s5p64x0/Kconfig
@@ -10,12 +10,14 @@ if ARCH_S5P64X0
10config CPU_S5P6440 10config CPU_S5P6440
11 bool 11 bool
12 select S3C_PL330_DMA 12 select S3C_PL330_DMA
13 select S5P_HRT
13 help 14 help
14 Enable S5P6440 CPU support 15 Enable S5P6440 CPU support
15 16
16config CPU_S5P6450 17config CPU_S5P6450
17 bool 18 bool
18 select S3C_PL330_DMA 19 select S3C_PL330_DMA
20 select S5P_HRT
19 help 21 help
20 Enable S5P6450 CPU support 22 Enable S5P6450 CPU support
21 23
@@ -34,6 +36,7 @@ config MACH_SMDK6440
34 select S3C_DEV_WDT 36 select S3C_DEV_WDT
35 select S3C64XX_DEV_SPI 37 select S3C64XX_DEV_SPI
36 select SAMSUNG_DEV_ADC 38 select SAMSUNG_DEV_ADC
39 select SAMSUNG_DEV_PWM
37 select SAMSUNG_DEV_TS 40 select SAMSUNG_DEV_TS
38 select S5P64X0_SETUP_I2C1 41 select S5P64X0_SETUP_I2C1
39 help 42 help
@@ -47,6 +50,7 @@ config MACH_SMDK6450
47 select S3C_DEV_WDT 50 select S3C_DEV_WDT
48 select S3C64XX_DEV_SPI 51 select S3C64XX_DEV_SPI
49 select SAMSUNG_DEV_ADC 52 select SAMSUNG_DEV_ADC
53 select SAMSUNG_DEV_PWM
50 select SAMSUNG_DEV_TS 54 select SAMSUNG_DEV_TS
51 select S5P64X0_SETUP_I2C1 55 select S5P64X0_SETUP_I2C1
52 help 56 help
diff --git a/arch/arm/mach-s5p64x0/include/mach/gpio.h b/arch/arm/mach-s5p64x0/include/mach/gpio.h
index 5486c8f01f1d..adb5f298ead8 100644
--- a/arch/arm/mach-s5p64x0/include/mach/gpio.h
+++ b/arch/arm/mach-s5p64x0/include/mach/gpio.h
@@ -23,7 +23,7 @@
23#define S5P6440_GPIO_A_NR (6) 23#define S5P6440_GPIO_A_NR (6)
24#define S5P6440_GPIO_B_NR (7) 24#define S5P6440_GPIO_B_NR (7)
25#define S5P6440_GPIO_C_NR (8) 25#define S5P6440_GPIO_C_NR (8)
26#define S5P6440_GPIO_F_NR (2) 26#define S5P6440_GPIO_F_NR (16)
27#define S5P6440_GPIO_G_NR (7) 27#define S5P6440_GPIO_G_NR (7)
28#define S5P6440_GPIO_H_NR (10) 28#define S5P6440_GPIO_H_NR (10)
29#define S5P6440_GPIO_I_NR (16) 29#define S5P6440_GPIO_I_NR (16)
@@ -36,7 +36,7 @@
36#define S5P6450_GPIO_B_NR (7) 36#define S5P6450_GPIO_B_NR (7)
37#define S5P6450_GPIO_C_NR (8) 37#define S5P6450_GPIO_C_NR (8)
38#define S5P6450_GPIO_D_NR (8) 38#define S5P6450_GPIO_D_NR (8)
39#define S5P6450_GPIO_F_NR (2) 39#define S5P6450_GPIO_F_NR (16)
40#define S5P6450_GPIO_G_NR (14) 40#define S5P6450_GPIO_G_NR (14)
41#define S5P6450_GPIO_H_NR (10) 41#define S5P6450_GPIO_H_NR (10)
42#define S5P6450_GPIO_I_NR (16) 42#define S5P6450_GPIO_I_NR (16)
diff --git a/arch/arm/mach-s5p64x0/include/mach/map.h b/arch/arm/mach-s5p64x0/include/mach/map.h
index a9365e5ba614..95c91257c7ca 100644
--- a/arch/arm/mach-s5p64x0/include/mach/map.h
+++ b/arch/arm/mach-s5p64x0/include/mach/map.h
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s5p64x0/include/mach/map.h 1/* linux/arch/arm/mach-s5p64x0/include/mach/map.h
2 * 2 *
3 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2009-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 4 * http://www.samsung.com
5 * 5 *
6 * S5P64X0 - Memory map definitions 6 * S5P64X0 - Memory map definitions
@@ -16,64 +16,46 @@
16#include <plat/map-base.h> 16#include <plat/map-base.h>
17#include <plat/map-s5p.h> 17#include <plat/map-s5p.h>
18 18
19#define S5P64X0_PA_SDRAM (0x20000000) 19#define S5P64X0_PA_SDRAM 0x20000000
20 20
21#define S5P64X0_PA_CHIPID (0xE0000000) 21#define S5P64X0_PA_CHIPID 0xE0000000
22#define S5P_PA_CHIPID S5P64X0_PA_CHIPID
23
24#define S5P64X0_PA_SYSCON (0xE0100000)
25#define S5P_PA_SYSCON S5P64X0_PA_SYSCON
26
27#define S5P64X0_PA_GPIO (0xE0308000)
28
29#define S5P64X0_PA_VIC0 (0xE4000000)
30#define S5P64X0_PA_VIC1 (0xE4100000)
31 22
32#define S5P64X0_PA_SROMC (0xE7000000) 23#define S5P64X0_PA_SYSCON 0xE0100000
33#define S5P_PA_SROMC S5P64X0_PA_SROMC
34
35#define S5P64X0_PA_PDMA (0xE9000000)
36
37#define S5P64X0_PA_TIMER (0xEA000000)
38#define S5P_PA_TIMER S5P64X0_PA_TIMER
39 24
40#define S5P64X0_PA_RTC (0xEA100000) 25#define S5P64X0_PA_GPIO 0xE0308000
41 26
42#define S5P64X0_PA_WDT (0xEA200000) 27#define S5P64X0_PA_VIC0 0xE4000000
28#define S5P64X0_PA_VIC1 0xE4100000
43 29
44#define S5P6440_PA_UART(x) (0xEC000000 + ((x) * S3C_UART_OFFSET)) 30#define S5P64X0_PA_SROMC 0xE7000000
45#define S5P6450_PA_UART(x) ((x < 5) ? (0xEC800000 + ((x) * S3C_UART_OFFSET)) : (0xEC000000))
46 31
47#define S5P_PA_UART0 S5P6450_PA_UART(0) 32#define S5P64X0_PA_PDMA 0xE9000000
48#define S5P_PA_UART1 S5P6450_PA_UART(1)
49#define S5P_PA_UART2 S5P6450_PA_UART(2)
50#define S5P_PA_UART3 S5P6450_PA_UART(3)
51#define S5P_PA_UART4 S5P6450_PA_UART(4)
52#define S5P_PA_UART5 S5P6450_PA_UART(5)
53 33
54#define S5P_SZ_UART SZ_256 34#define S5P64X0_PA_TIMER 0xEA000000
35#define S5P64X0_PA_RTC 0xEA100000
36#define S5P64X0_PA_WDT 0xEA200000
55 37
56#define S5P6440_PA_IIC0 (0xEC104000) 38#define S5P6440_PA_IIC0 0xEC104000
57#define S5P6440_PA_IIC1 (0xEC20F000) 39#define S5P6440_PA_IIC1 0xEC20F000
58#define S5P6450_PA_IIC0 (0xEC100000) 40#define S5P6450_PA_IIC0 0xEC100000
59#define S5P6450_PA_IIC1 (0xEC200000) 41#define S5P6450_PA_IIC1 0xEC200000
60 42
61#define S5P64X0_PA_SPI0 (0xEC400000) 43#define S5P64X0_PA_SPI0 0xEC400000
62#define S5P64X0_PA_SPI1 (0xEC500000) 44#define S5P64X0_PA_SPI1 0xEC500000
63 45
64#define S5P64X0_PA_HSOTG (0xED100000) 46#define S5P64X0_PA_HSOTG 0xED100000
65 47
66#define S5P64X0_PA_HSMMC(x) (0xED800000 + ((x) * 0x100000)) 48#define S5P64X0_PA_HSMMC(x) (0xED800000 + ((x) * 0x100000))
67 49
68#define S5P64X0_PA_I2S (0xF2000000) 50#define S5P64X0_PA_I2S 0xF2000000
69#define S5P6450_PA_I2S1 0xF2800000 51#define S5P6450_PA_I2S1 0xF2800000
70#define S5P6450_PA_I2S2 0xF2900000 52#define S5P6450_PA_I2S2 0xF2900000
71 53
72#define S5P64X0_PA_PCM (0xF2100000) 54#define S5P64X0_PA_PCM 0xF2100000
73 55
74#define S5P64X0_PA_ADC (0xF3000000) 56#define S5P64X0_PA_ADC 0xF3000000
75 57
76/* compatibiltiy defines. */ 58/* Compatibiltiy Defines */
77 59
78#define S3C_PA_HSMMC0 S5P64X0_PA_HSMMC(0) 60#define S3C_PA_HSMMC0 S5P64X0_PA_HSMMC(0)
79#define S3C_PA_HSMMC1 S5P64X0_PA_HSMMC(1) 61#define S3C_PA_HSMMC1 S5P64X0_PA_HSMMC(1)
@@ -83,6 +65,25 @@
83#define S3C_PA_RTC S5P64X0_PA_RTC 65#define S3C_PA_RTC S5P64X0_PA_RTC
84#define S3C_PA_WDT S5P64X0_PA_WDT 66#define S3C_PA_WDT S5P64X0_PA_WDT
85 67
68#define S5P_PA_CHIPID S5P64X0_PA_CHIPID
69#define S5P_PA_SROMC S5P64X0_PA_SROMC
70#define S5P_PA_SYSCON S5P64X0_PA_SYSCON
71#define S5P_PA_TIMER S5P64X0_PA_TIMER
72
86#define SAMSUNG_PA_ADC S5P64X0_PA_ADC 73#define SAMSUNG_PA_ADC S5P64X0_PA_ADC
87 74
75/* UART */
76
77#define S5P6440_PA_UART(x) (0xEC000000 + ((x) * S3C_UART_OFFSET))
78#define S5P6450_PA_UART(x) ((x < 5) ? (0xEC800000 + ((x) * S3C_UART_OFFSET)) : (0xEC000000))
79
80#define S5P_PA_UART0 S5P6450_PA_UART(0)
81#define S5P_PA_UART1 S5P6450_PA_UART(1)
82#define S5P_PA_UART2 S5P6450_PA_UART(2)
83#define S5P_PA_UART3 S5P6450_PA_UART(3)
84#define S5P_PA_UART4 S5P6450_PA_UART(4)
85#define S5P_PA_UART5 S5P6450_PA_UART(5)
86
87#define S5P_SZ_UART SZ_256
88
88#endif /* __ASM_ARCH_MAP_H */ 89#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-s5p64x0/include/mach/memory.h b/arch/arm/mach-s5p64x0/include/mach/memory.h
index 1b036b0a24ce..365a6eb4b88f 100644
--- a/arch/arm/mach-s5p64x0/include/mach/memory.h
+++ b/arch/arm/mach-s5p64x0/include/mach/memory.h
@@ -13,7 +13,7 @@
13#ifndef __ASM_ARCH_MEMORY_H 13#ifndef __ASM_ARCH_MEMORY_H
14#define __ASM_ARCH_MEMORY_H __FILE__ 14#define __ASM_ARCH_MEMORY_H __FILE__
15 15
16#define PHYS_OFFSET UL(0x20000000) 16#define PLAT_PHYS_OFFSET UL(0x20000000)
17#define CONSISTENT_DMA_SIZE SZ_8M 17#define CONSISTENT_DMA_SIZE SZ_8M
18 18
19#endif /* __ASM_ARCH_MEMORY_H */ 19#endif /* __ASM_ARCH_MEMORY_H */
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c b/arch/arm/mach-s5p64x0/mach-smdk6440.c
index e5beb84e2393..2d559f10fd47 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6440.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c
@@ -22,6 +22,7 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/pwm_backlight.h>
25 26
26#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
27#include <asm/mach/map.h> 28#include <asm/mach/map.h>
@@ -32,6 +33,7 @@
32#include <mach/map.h> 33#include <mach/map.h>
33#include <mach/regs-clock.h> 34#include <mach/regs-clock.h>
34#include <mach/i2c.h> 35#include <mach/i2c.h>
36#include <mach/regs-gpio.h>
35 37
36#include <plat/regs-serial.h> 38#include <plat/regs-serial.h>
37#include <plat/gpio-cfg.h> 39#include <plat/gpio-cfg.h>
@@ -43,6 +45,7 @@
43#include <plat/pll.h> 45#include <plat/pll.h>
44#include <plat/adc.h> 46#include <plat/adc.h>
45#include <plat/ts.h> 47#include <plat/ts.h>
48#include <plat/s5p-time.h>
46 49
47#define SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 50#define SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
48 S3C2410_UCON_RXILEVEL | \ 51 S3C2410_UCON_RXILEVEL | \
@@ -88,6 +91,45 @@ static struct s3c2410_uartcfg smdk6440_uartcfgs[] __initdata = {
88 }, 91 },
89}; 92};
90 93
94static int smdk6440_backlight_init(struct device *dev)
95{
96 int ret;
97
98 ret = gpio_request(S5P6440_GPF(15), "Backlight");
99 if (ret) {
100 printk(KERN_ERR "failed to request GPF for PWM-OUT1\n");
101 return ret;
102 }
103
104 /* Configure GPIO pin with S5P6440_GPF15_PWM_TOUT1 */
105 s3c_gpio_cfgpin(S5P6440_GPF(15), S3C_GPIO_SFN(2));
106
107 return 0;
108}
109
110static void smdk6440_backlight_exit(struct device *dev)
111{
112 s3c_gpio_cfgpin(S5P6440_GPF(15), S3C_GPIO_OUTPUT);
113 gpio_free(S5P6440_GPF(15));
114}
115
116static struct platform_pwm_backlight_data smdk6440_backlight_data = {
117 .pwm_id = 1,
118 .max_brightness = 255,
119 .dft_brightness = 255,
120 .pwm_period_ns = 78770,
121 .init = smdk6440_backlight_init,
122 .exit = smdk6440_backlight_exit,
123};
124
125static struct platform_device smdk6440_backlight_device = {
126 .name = "pwm-backlight",
127 .dev = {
128 .parent = &s3c_device_timer[1].dev,
129 .platform_data = &smdk6440_backlight_data,
130 },
131};
132
91static struct platform_device *smdk6440_devices[] __initdata = { 133static struct platform_device *smdk6440_devices[] __initdata = {
92 &s3c_device_adc, 134 &s3c_device_adc,
93 &s3c_device_rtc, 135 &s3c_device_rtc,
@@ -97,6 +139,8 @@ static struct platform_device *smdk6440_devices[] __initdata = {
97 &s3c_device_wdt, 139 &s3c_device_wdt,
98 &samsung_asoc_dma, 140 &samsung_asoc_dma,
99 &s5p6440_device_iis, 141 &s5p6440_device_iis,
142 &s3c_device_timer[1],
143 &smdk6440_backlight_device,
100}; 144};
101 145
102static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = { 146static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = {
@@ -136,6 +180,7 @@ static void __init smdk6440_map_io(void)
136 s5p_init_io(NULL, 0, S5P64X0_SYS_ID); 180 s5p_init_io(NULL, 0, S5P64X0_SYS_ID);
137 s3c24xx_init_clocks(12000000); 181 s3c24xx_init_clocks(12000000);
138 s3c24xx_init_uarts(smdk6440_uartcfgs, ARRAY_SIZE(smdk6440_uartcfgs)); 182 s3c24xx_init_uarts(smdk6440_uartcfgs, ARRAY_SIZE(smdk6440_uartcfgs));
183 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
139} 184}
140 185
141static void __init smdk6440_machine_init(void) 186static void __init smdk6440_machine_init(void)
@@ -159,5 +204,5 @@ MACHINE_START(SMDK6440, "SMDK6440")
159 .init_irq = s5p6440_init_irq, 204 .init_irq = s5p6440_init_irq,
160 .map_io = smdk6440_map_io, 205 .map_io = smdk6440_map_io,
161 .init_machine = smdk6440_machine_init, 206 .init_machine = smdk6440_machine_init,
162 .timer = &s3c24xx_timer, 207 .timer = &s5p_timer,
163MACHINE_END 208MACHINE_END
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c
index 3a20de0a9264..d19c4690ee97 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6450.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c
@@ -22,6 +22,7 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/pwm_backlight.h>
25 26
26#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
27#include <asm/mach/map.h> 28#include <asm/mach/map.h>
@@ -32,6 +33,7 @@
32#include <mach/map.h> 33#include <mach/map.h>
33#include <mach/regs-clock.h> 34#include <mach/regs-clock.h>
34#include <mach/i2c.h> 35#include <mach/i2c.h>
36#include <mach/regs-gpio.h>
35 37
36#include <plat/regs-serial.h> 38#include <plat/regs-serial.h>
37#include <plat/gpio-cfg.h> 39#include <plat/gpio-cfg.h>
@@ -43,6 +45,7 @@
43#include <plat/pll.h> 45#include <plat/pll.h>
44#include <plat/adc.h> 46#include <plat/adc.h>
45#include <plat/ts.h> 47#include <plat/ts.h>
48#include <plat/s5p-time.h>
46 49
47#define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 50#define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
48 S3C2410_UCON_RXILEVEL | \ 51 S3C2410_UCON_RXILEVEL | \
@@ -106,6 +109,45 @@ static struct s3c2410_uartcfg smdk6450_uartcfgs[] __initdata = {
106#endif 109#endif
107}; 110};
108 111
112static int smdk6450_backlight_init(struct device *dev)
113{
114 int ret;
115
116 ret = gpio_request(S5P6450_GPF(15), "Backlight");
117 if (ret) {
118 printk(KERN_ERR "failed to request GPF for PWM-OUT1\n");
119 return ret;
120 }
121
122 /* Configure GPIO pin with S5P6450_GPF15_PWM_TOUT1 */
123 s3c_gpio_cfgpin(S5P6450_GPF(15), S3C_GPIO_SFN(2));
124
125 return 0;
126}
127
128static void smdk6450_backlight_exit(struct device *dev)
129{
130 s3c_gpio_cfgpin(S5P6450_GPF(15), S3C_GPIO_OUTPUT);
131 gpio_free(S5P6450_GPF(15));
132}
133
134static struct platform_pwm_backlight_data smdk6450_backlight_data = {
135 .pwm_id = 1,
136 .max_brightness = 255,
137 .dft_brightness = 255,
138 .pwm_period_ns = 78770,
139 .init = smdk6450_backlight_init,
140 .exit = smdk6450_backlight_exit,
141};
142
143static struct platform_device smdk6450_backlight_device = {
144 .name = "pwm-backlight",
145 .dev = {
146 .parent = &s3c_device_timer[1].dev,
147 .platform_data = &smdk6450_backlight_data,
148 },
149};
150
109static struct platform_device *smdk6450_devices[] __initdata = { 151static struct platform_device *smdk6450_devices[] __initdata = {
110 &s3c_device_adc, 152 &s3c_device_adc,
111 &s3c_device_rtc, 153 &s3c_device_rtc,
@@ -115,6 +157,8 @@ static struct platform_device *smdk6450_devices[] __initdata = {
115 &s3c_device_wdt, 157 &s3c_device_wdt,
116 &samsung_asoc_dma, 158 &samsung_asoc_dma,
117 &s5p6450_device_iis0, 159 &s5p6450_device_iis0,
160 &s3c_device_timer[1],
161 &smdk6450_backlight_device,
118 /* s5p6450_device_spi0 will be added */ 162 /* s5p6450_device_spi0 will be added */
119}; 163};
120 164
@@ -155,6 +199,7 @@ static void __init smdk6450_map_io(void)
155 s5p_init_io(NULL, 0, S5P64X0_SYS_ID); 199 s5p_init_io(NULL, 0, S5P64X0_SYS_ID);
156 s3c24xx_init_clocks(19200000); 200 s3c24xx_init_clocks(19200000);
157 s3c24xx_init_uarts(smdk6450_uartcfgs, ARRAY_SIZE(smdk6450_uartcfgs)); 201 s3c24xx_init_uarts(smdk6450_uartcfgs, ARRAY_SIZE(smdk6450_uartcfgs));
202 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
158} 203}
159 204
160static void __init smdk6450_machine_init(void) 205static void __init smdk6450_machine_init(void)
@@ -178,5 +223,5 @@ MACHINE_START(SMDK6450, "SMDK6450")
178 .init_irq = s5p6450_init_irq, 223 .init_irq = s5p6450_init_irq,
179 .map_io = smdk6450_map_io, 224 .map_io = smdk6450_map_io,
180 .init_machine = smdk6450_machine_init, 225 .init_machine = smdk6450_machine_init,
181 .timer = &s3c24xx_timer, 226 .timer = &s5p_timer,
182MACHINE_END 227MACHINE_END
diff --git a/arch/arm/mach-s5pc100/Kconfig b/arch/arm/mach-s5pc100/Kconfig
index b8fbf2fcba6f..608722ff4f28 100644
--- a/arch/arm/mach-s5pc100/Kconfig
+++ b/arch/arm/mach-s5pc100/Kconfig
@@ -58,6 +58,7 @@ config MACH_SMDKC100
58 select SAMSUNG_DEV_ADC 58 select SAMSUNG_DEV_ADC
59 select SAMSUNG_DEV_IDE 59 select SAMSUNG_DEV_IDE
60 select SAMSUNG_DEV_KEYPAD 60 select SAMSUNG_DEV_KEYPAD
61 select SAMSUNG_DEV_PWM
61 select SAMSUNG_DEV_TS 62 select SAMSUNG_DEV_TS
62 select S5PC100_SETUP_FB_24BPP 63 select S5PC100_SETUP_FB_24BPP
63 select S5PC100_SETUP_I2C1 64 select S5PC100_SETUP_I2C1
diff --git a/arch/arm/mach-s5pc100/gpiolib.c b/arch/arm/mach-s5pc100/gpiolib.c
index 20856eb7dd51..2842394b28b5 100644
--- a/arch/arm/mach-s5pc100/gpiolib.c
+++ b/arch/arm/mach-s5pc100/gpiolib.c
@@ -348,6 +348,7 @@ static __init int s5pc100_gpiolib_init(void)
348 } 348 }
349 349
350 samsung_gpiolib_add_4bit_chips(s5pc100_gpio_chips, nr_chips); 350 samsung_gpiolib_add_4bit_chips(s5pc100_gpio_chips, nr_chips);
351 s5p_register_gpioint_bank(IRQ_GPIOINT, 0, S5P_GPIOINT_GROUP_MAXNR);
351 352
352 return 0; 353 return 0;
353} 354}
diff --git a/arch/arm/mach-s5pc100/include/mach/map.h b/arch/arm/mach-s5pc100/include/mach/map.h
index 328467b346aa..ccbe6b767f7d 100644
--- a/arch/arm/mach-s5pc100/include/mach/map.h
+++ b/arch/arm/mach-s5pc100/include/mach/map.h
@@ -1,5 +1,8 @@
1/* linux/arch/arm/mach-s5pc100/include/mach/map.h 1/* linux/arch/arm/mach-s5pc100/include/mach/map.h
2 * 2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
3 * Copyright 2009 Samsung Electronics Co. 6 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com> 7 * Byungho Min <bhmin@samsung.com>
5 * 8 *
@@ -16,145 +19,115 @@
16#include <plat/map-base.h> 19#include <plat/map-base.h>
17#include <plat/map-s5p.h> 20#include <plat/map-s5p.h>
18 21
19/* 22#define S5PC100_PA_SDRAM 0x20000000
20 * map-base.h has already defined virtual memory address 23
21 * S3C_VA_IRQ S3C_ADDR(0x00000000) irq controller(s) 24#define S5PC100_PA_ONENAND 0xE7100000
22 * S3C_VA_SYS S3C_ADDR(0x00100000) system control 25#define S5PC100_PA_ONENAND_BUF 0xB0000000
23 * S3C_VA_MEM S3C_ADDR(0x00200000) system control (not used) 26
24 * S3C_VA_TIMER S3C_ADDR(0x00300000) timer block 27#define S5PC100_PA_CHIPID 0xE0000000
25 * S3C_VA_WATCHDOG S3C_ADDR(0x00400000) watchdog
26 * S3C_VA_UART S3C_ADDR(0x01000000) UART
27 *
28 * S5PC100 specific virtual memory address can be defined here
29 * S5PC1XX_VA_GPIO S3C_ADDR(0x00500000) GPIO
30 *
31 */
32 28
33#define S5PC100_PA_ONENAND_BUF (0xB0000000) 29#define S5PC100_PA_SYSCON 0xE0100000
34#define S5PC100_SZ_ONENAND_BUF (SZ_256M - SZ_32M)
35 30
36/* Chip ID */ 31#define S5PC100_PA_OTHERS 0xE0200000
37 32
38#define S5PC100_PA_CHIPID (0xE0000000) 33#define S5PC100_PA_GPIO 0xE0300000
39#define S5P_PA_CHIPID S5PC100_PA_CHIPID
40 34
41#define S5PC100_PA_SYSCON (0xE0100000) 35#define S5PC100_PA_VIC0 0xE4000000
42#define S5P_PA_SYSCON S5PC100_PA_SYSCON 36#define S5PC100_PA_VIC1 0xE4100000
37#define S5PC100_PA_VIC2 0xE4200000
43 38
44#define S5PC100_PA_OTHERS (0xE0200000) 39#define S5PC100_PA_SROMC 0xE7000000
45#define S5PC100_VA_OTHERS (S3C_VA_SYS + 0x10000)
46 40
47#define S5PC100_PA_GPIO (0xE0300000) 41#define S5PC100_PA_CFCON 0xE7800000
48#define S5PC1XX_VA_GPIO S3C_ADDR(0x00500000)
49 42
50/* Interrupt */ 43#define S5PC100_PA_MDMA 0xE8100000
51#define S5PC100_PA_VIC0 (0xE4000000) 44#define S5PC100_PA_PDMA0 0xE9000000
52#define S5PC100_PA_VIC1 (0xE4100000) 45#define S5PC100_PA_PDMA1 0xE9200000
53#define S5PC100_PA_VIC2 (0xE4200000)
54#define S5PC100_VA_VIC S3C_VA_IRQ
55#define S5PC100_VA_VIC_OFFSET 0x10000
56#define S5PC1XX_VA_VIC(x) (S5PC100_VA_VIC + ((x) * S5PC100_VA_VIC_OFFSET))
57 46
58#define S5PC100_PA_SROMC (0xE7000000) 47#define S5PC100_PA_TIMER 0xEA000000
59#define S5P_PA_SROMC S5PC100_PA_SROMC 48#define S5PC100_PA_SYSTIMER 0xEA100000
49#define S5PC100_PA_WATCHDOG 0xEA200000
50#define S5PC100_PA_RTC 0xEA300000
60 51
61#define S5PC100_PA_ONENAND (0xE7100000) 52#define S5PC100_PA_UART 0xEC000000
62 53
63#define S5PC100_PA_CFCON (0xE7800000) 54#define S5PC100_PA_IIC0 0xEC100000
55#define S5PC100_PA_IIC1 0xEC200000
64 56
65/* DMA */ 57#define S5PC100_PA_SPI0 0xEC300000
66#define S5PC100_PA_MDMA (0xE8100000) 58#define S5PC100_PA_SPI1 0xEC400000
67#define S5PC100_PA_PDMA0 (0xE9000000) 59#define S5PC100_PA_SPI2 0xEC500000
68#define S5PC100_PA_PDMA1 (0xE9200000)
69 60
70/* Timer */ 61#define S5PC100_PA_USB_HSOTG 0xED200000
71#define S5PC100_PA_TIMER (0xEA000000) 62#define S5PC100_PA_USB_HSPHY 0xED300000
72#define S5P_PA_TIMER S5PC100_PA_TIMER
73 63
74#define S5PC100_PA_SYSTIMER (0xEA100000) 64#define S5PC100_PA_HSMMC(x) (0xED800000 + ((x) * 0x100000))
75 65
76#define S5PC100_PA_WATCHDOG (0xEA200000) 66#define S5PC100_PA_FB 0xEE000000
77#define S5PC100_PA_RTC (0xEA300000)
78 67
79#define S5PC100_PA_UART (0xEC000000) 68#define S5PC100_PA_FIMC0 0xEE200000
69#define S5PC100_PA_FIMC1 0xEE300000
70#define S5PC100_PA_FIMC2 0xEE400000
80 71
81#define S5P_PA_UART0 (S5PC100_PA_UART + 0x0) 72#define S5PC100_PA_I2S0 0xF2000000
82#define S5P_PA_UART1 (S5PC100_PA_UART + 0x400) 73#define S5PC100_PA_I2S1 0xF2100000
83#define S5P_PA_UART2 (S5PC100_PA_UART + 0x800) 74#define S5PC100_PA_I2S2 0xF2200000
84#define S5P_PA_UART3 (S5PC100_PA_UART + 0xC00)
85#define S5P_SZ_UART SZ_256
86 75
87#define S5PC100_PA_IIC0 (0xEC100000) 76#define S5PC100_PA_AC97 0xF2300000
88#define S5PC100_PA_IIC1 (0xEC200000)
89 77
90/* SPI */ 78#define S5PC100_PA_PCM0 0xF2400000
91#define S5PC100_PA_SPI0 0xEC300000 79#define S5PC100_PA_PCM1 0xF2500000
92#define S5PC100_PA_SPI1 0xEC400000
93#define S5PC100_PA_SPI2 0xEC500000
94 80
95/* USB HS OTG */ 81#define S5PC100_PA_SPDIF 0xF2600000
96#define S5PC100_PA_USB_HSOTG (0xED200000)
97#define S5PC100_PA_USB_HSPHY (0xED300000)
98 82
99#define S5PC100_PA_FB (0xEE000000) 83#define S5PC100_PA_TSADC 0xF3000000
100 84
101#define S5PC100_PA_FIMC0 (0xEE200000) 85#define S5PC100_PA_KEYPAD 0xF3100000
102#define S5PC100_PA_FIMC1 (0xEE300000)
103#define S5PC100_PA_FIMC2 (0xEE400000)
104 86
105#define S5PC100_PA_I2S0 (0xF2000000) 87/* Compatibiltiy Defines */
106#define S5PC100_PA_I2S1 (0xF2100000)
107#define S5PC100_PA_I2S2 (0xF2200000)
108 88
109#define S5PC100_PA_AC97 0xF2300000 89#define S3C_PA_FB S5PC100_PA_FB
90#define S3C_PA_HSMMC0 S5PC100_PA_HSMMC(0)
91#define S3C_PA_HSMMC1 S5PC100_PA_HSMMC(1)
92#define S3C_PA_HSMMC2 S5PC100_PA_HSMMC(2)
93#define S3C_PA_IIC S5PC100_PA_IIC0
94#define S3C_PA_IIC1 S5PC100_PA_IIC1
95#define S3C_PA_KEYPAD S5PC100_PA_KEYPAD
96#define S3C_PA_ONENAND S5PC100_PA_ONENAND
97#define S3C_PA_ONENAND_BUF S5PC100_PA_ONENAND_BUF
98#define S3C_PA_RTC S5PC100_PA_RTC
99#define S3C_PA_TSADC S5PC100_PA_TSADC
100#define S3C_PA_USB_HSOTG S5PC100_PA_USB_HSOTG
101#define S3C_PA_USB_HSPHY S5PC100_PA_USB_HSPHY
102#define S3C_PA_WDT S5PC100_PA_WATCHDOG
110 103
111/* PCM */ 104#define S5P_PA_CHIPID S5PC100_PA_CHIPID
112#define S5PC100_PA_PCM0 0xF2400000 105#define S5P_PA_FIMC0 S5PC100_PA_FIMC0
113#define S5PC100_PA_PCM1 0xF2500000 106#define S5P_PA_FIMC1 S5PC100_PA_FIMC1
107#define S5P_PA_FIMC2 S5PC100_PA_FIMC2
108#define S5P_PA_SDRAM S5PC100_PA_SDRAM
109#define S5P_PA_SROMC S5PC100_PA_SROMC
110#define S5P_PA_SYSCON S5PC100_PA_SYSCON
111#define S5P_PA_TIMER S5PC100_PA_TIMER
114 112
115#define S5PC100_PA_SPDIF 0xF2600000 113#define SAMSUNG_PA_ADC S5PC100_PA_TSADC
114#define SAMSUNG_PA_CFCON S5PC100_PA_CFCON
115#define SAMSUNG_PA_KEYPAD S5PC100_PA_KEYPAD
116 116
117#define S5PC100_PA_TSADC (0xF3000000) 117#define S5PC100_VA_OTHERS (S3C_VA_SYS + 0x10000)
118 118
119/* KEYPAD */ 119#define S3C_SZ_ONENAND_BUF (SZ_256M - SZ_32M)
120#define S5PC100_PA_KEYPAD (0xF3100000)
121 120
122#define S5PC100_PA_HSMMC(x) (0xED800000 + ((x) * 0x100000)) 121/* UART */
123 122
124#define S5PC100_PA_SDRAM (0x20000000) 123#define S3C_PA_UART S5PC100_PA_UART
125#define S5P_PA_SDRAM S5PC100_PA_SDRAM
126 124
127/* compatibiltiy defines. */ 125#define S5P_PA_UART(x) (S3C_PA_UART + ((x) * S3C_UART_OFFSET))
128#define S3C_PA_UART S5PC100_PA_UART 126#define S5P_PA_UART0 S5P_PA_UART(0)
129#define S3C_PA_IIC S5PC100_PA_IIC0 127#define S5P_PA_UART1 S5P_PA_UART(1)
130#define S3C_PA_IIC1 S5PC100_PA_IIC1 128#define S5P_PA_UART2 S5P_PA_UART(2)
131#define S3C_PA_FB S5PC100_PA_FB 129#define S5P_PA_UART3 S5P_PA_UART(3)
132#define S3C_PA_G2D S5PC100_PA_G2D
133#define S3C_PA_G3D S5PC100_PA_G3D
134#define S3C_PA_JPEG S5PC100_PA_JPEG
135#define S3C_PA_ROTATOR S5PC100_PA_ROTATOR
136#define S5P_VA_VIC0 S5PC1XX_VA_VIC(0)
137#define S5P_VA_VIC1 S5PC1XX_VA_VIC(1)
138#define S5P_VA_VIC2 S5PC1XX_VA_VIC(2)
139#define S3C_PA_USB_HSOTG S5PC100_PA_USB_HSOTG
140#define S3C_PA_USB_HSPHY S5PC100_PA_USB_HSPHY
141#define S3C_PA_HSMMC0 S5PC100_PA_HSMMC(0)
142#define S3C_PA_HSMMC1 S5PC100_PA_HSMMC(1)
143#define S3C_PA_HSMMC2 S5PC100_PA_HSMMC(2)
144#define S3C_PA_KEYPAD S5PC100_PA_KEYPAD
145#define S3C_PA_WDT S5PC100_PA_WATCHDOG
146#define S3C_PA_TSADC S5PC100_PA_TSADC
147#define S3C_PA_ONENAND S5PC100_PA_ONENAND
148#define S3C_PA_ONENAND_BUF S5PC100_PA_ONENAND_BUF
149#define S3C_SZ_ONENAND_BUF S5PC100_SZ_ONENAND_BUF
150#define S3C_PA_RTC S5PC100_PA_RTC
151
152#define SAMSUNG_PA_ADC S5PC100_PA_TSADC
153#define SAMSUNG_PA_CFCON S5PC100_PA_CFCON
154#define SAMSUNG_PA_KEYPAD S5PC100_PA_KEYPAD
155 130
156#define S5P_PA_FIMC0 S5PC100_PA_FIMC0 131#define S5P_SZ_UART SZ_256
157#define S5P_PA_FIMC1 S5PC100_PA_FIMC1
158#define S5P_PA_FIMC2 S5PC100_PA_FIMC2
159 132
160#endif /* __ASM_ARCH_C100_MAP_H */ 133#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/memory.h b/arch/arm/mach-s5pc100/include/mach/memory.h
index 4b60d18179f7..bda4e79fd5fc 100644
--- a/arch/arm/mach-s5pc100/include/mach/memory.h
+++ b/arch/arm/mach-s5pc100/include/mach/memory.h
@@ -13,6 +13,6 @@
13#ifndef __ASM_ARCH_MEMORY_H 13#ifndef __ASM_ARCH_MEMORY_H
14#define __ASM_ARCH_MEMORY_H 14#define __ASM_ARCH_MEMORY_H
15 15
16#define PHYS_OFFSET UL(0x20000000) 16#define PLAT_PHYS_OFFSET UL(0x20000000)
17 17
18#endif 18#endif
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c
index dd192a27524d..0525cb3ef406 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -23,12 +23,15 @@
23#include <linux/fb.h> 23#include <linux/fb.h>
24#include <linux/delay.h> 24#include <linux/delay.h>
25#include <linux/input.h> 25#include <linux/input.h>
26#include <linux/pwm_backlight.h>
26 27
27#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
28#include <asm/mach/map.h> 29#include <asm/mach/map.h>
29 30
30#include <mach/map.h> 31#include <mach/map.h>
31#include <mach/regs-fb.h> 32#include <mach/regs-fb.h>
33#include <mach/regs-gpio.h>
34
32#include <video/platform_lcd.h> 35#include <video/platform_lcd.h>
33 36
34#include <asm/irq.h> 37#include <asm/irq.h>
@@ -107,9 +110,6 @@ static struct i2c_board_info i2c_devs1[] __initdata = {
107static void smdkc100_lcd_power_set(struct plat_lcd_data *pd, 110static void smdkc100_lcd_power_set(struct plat_lcd_data *pd,
108 unsigned int power) 111 unsigned int power)
109{ 112{
110 /* backlight */
111 gpio_direction_output(S5PC100_GPD(0), power);
112
113 if (power) { 113 if (power) {
114 /* module reset */ 114 /* module reset */
115 gpio_direction_output(S5PC100_GPH0(6), 1); 115 gpio_direction_output(S5PC100_GPH0(6), 1);
@@ -179,6 +179,45 @@ static struct samsung_keypad_platdata smdkc100_keypad_data __initdata = {
179 .cols = 8, 179 .cols = 8,
180}; 180};
181 181
182static int smdkc100_backlight_init(struct device *dev)
183{
184 int ret;
185
186 ret = gpio_request(S5PC100_GPD(0), "Backlight");
187 if (ret) {
188 printk(KERN_ERR "failed to request GPF for PWM-OUT0\n");
189 return ret;
190 }
191
192 /* Configure GPIO pin with S5PC100_GPD_TOUT_0 */
193 s3c_gpio_cfgpin(S5PC100_GPD(0), S3C_GPIO_SFN(2));
194
195 return 0;
196}
197
198static void smdkc100_backlight_exit(struct device *dev)
199{
200 s3c_gpio_cfgpin(S5PC100_GPD(0), S3C_GPIO_OUTPUT);
201 gpio_free(S5PC100_GPD(0));
202}
203
204static struct platform_pwm_backlight_data smdkc100_backlight_data = {
205 .pwm_id = 0,
206 .max_brightness = 255,
207 .dft_brightness = 255,
208 .pwm_period_ns = 78770,
209 .init = smdkc100_backlight_init,
210 .exit = smdkc100_backlight_exit,
211};
212
213static struct platform_device smdkc100_backlight_device = {
214 .name = "pwm-backlight",
215 .dev = {
216 .parent = &s3c_device_timer[0].dev,
217 .platform_data = &smdkc100_backlight_data,
218 },
219};
220
182static struct platform_device *smdkc100_devices[] __initdata = { 221static struct platform_device *smdkc100_devices[] __initdata = {
183 &s3c_device_adc, 222 &s3c_device_adc,
184 &s3c_device_cfcon, 223 &s3c_device_cfcon,
@@ -200,6 +239,8 @@ static struct platform_device *smdkc100_devices[] __initdata = {
200 &s5p_device_fimc1, 239 &s5p_device_fimc1,
201 &s5p_device_fimc2, 240 &s5p_device_fimc2,
202 &s5pc100_device_spdif, 241 &s5pc100_device_spdif,
242 &s3c_device_timer[0],
243 &smdkc100_backlight_device,
203}; 244};
204 245
205static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = { 246static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
@@ -233,7 +274,6 @@ static void __init smdkc100_machine_init(void)
233 s5pc100_spdif_setup_gpio(S5PC100_SPDIF_GPD); 274 s5pc100_spdif_setup_gpio(S5PC100_SPDIF_GPD);
234 275
235 /* LCD init */ 276 /* LCD init */
236 gpio_request(S5PC100_GPD(0), "GPD");
237 gpio_request(S5PC100_GPH0(6), "GPH0"); 277 gpio_request(S5PC100_GPH0(6), "GPH0");
238 smdkc100_lcd_power_set(&smdkc100_lcd_power_data, 0); 278 smdkc100_lcd_power_set(&smdkc100_lcd_power_data, 0);
239 platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices)); 279 platform_add_devices(smdkc100_devices, ARRAY_SIZE(smdkc100_devices));
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 53aabef1e9ce..37b5a97594a5 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -13,6 +13,7 @@ config CPU_S5PV210
13 bool 13 bool
14 select S3C_PL330_DMA 14 select S3C_PL330_DMA
15 select S5P_EXT_INT 15 select S5P_EXT_INT
16 select S5P_HRT
16 select S5PV210_PM if PM 17 select S5PV210_PM if PM
17 help 18 help
18 Enable S5PV210 CPU support 19 Enable S5PV210 CPU support
@@ -53,6 +54,11 @@ config S5PV210_SETUP_SDHCI_GPIO
53 help 54 help
54 Common setup code for SDHCI gpio. 55 Common setup code for SDHCI gpio.
55 56
57config S5PV210_SETUP_FIMC
58 bool
59 help
60 Common setup code for the camera interfaces.
61
56menu "S5PC110 Machines" 62menu "S5PC110 Machines"
57 63
58config MACH_AQUILA 64config MACH_AQUILA
@@ -130,6 +136,7 @@ config MACH_SMDKV210
130 select SAMSUNG_DEV_ADC 136 select SAMSUNG_DEV_ADC
131 select SAMSUNG_DEV_IDE 137 select SAMSUNG_DEV_IDE
132 select SAMSUNG_DEV_KEYPAD 138 select SAMSUNG_DEV_KEYPAD
139 select SAMSUNG_DEV_PWM
133 select SAMSUNG_DEV_TS 140 select SAMSUNG_DEV_TS
134 select S5PV210_SETUP_FB_24BPP 141 select S5PV210_SETUP_FB_24BPP
135 select S5PV210_SETUP_I2C1 142 select S5PV210_SETUP_I2C1
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index ff1a0db57a2f..11f17907b4e8 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -31,6 +31,7 @@ obj-y += dev-audio.o
31obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o 31obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o
32 32
33obj-$(CONFIG_S5PV210_SETUP_FB_24BPP) += setup-fb-24bpp.o 33obj-$(CONFIG_S5PV210_SETUP_FB_24BPP) += setup-fb-24bpp.o
34obj-$(CONFIG_S5PV210_SETUP_FIMC) += setup-fimc.o
34obj-$(CONFIG_S5PV210_SETUP_I2C1) += setup-i2c1.o 35obj-$(CONFIG_S5PV210_SETUP_I2C1) += setup-i2c1.o
35obj-$(CONFIG_S5PV210_SETUP_I2C2) += setup-i2c2.o 36obj-$(CONFIG_S5PV210_SETUP_I2C2) += setup-i2c2.o
36obj-$(CONFIG_S5PV210_SETUP_IDE) += setup-ide.o 37obj-$(CONFIG_S5PV210_SETUP_IDE) += setup-ide.o
diff --git a/arch/arm/mach-s5pv210/cpufreq.c b/arch/arm/mach-s5pv210/cpufreq.c
index a6f22920a2c2..22046e2f53c2 100644
--- a/arch/arm/mach-s5pv210/cpufreq.c
+++ b/arch/arm/mach-s5pv210/cpufreq.c
@@ -390,8 +390,7 @@ static int s5pv210_target(struct cpufreq_policy *policy,
390} 390}
391 391
392#ifdef CONFIG_PM 392#ifdef CONFIG_PM
393static int s5pv210_cpufreq_suspend(struct cpufreq_policy *policy, 393static int s5pv210_cpufreq_suspend(struct cpufreq_policy *policy)
394 pm_message_t pmsg)
395{ 394{
396 return 0; 395 return 0;
397} 396}
diff --git a/arch/arm/mach-s5pv210/gpiolib.c b/arch/arm/mach-s5pv210/gpiolib.c
index ab673effd767..1ba20a703e05 100644
--- a/arch/arm/mach-s5pv210/gpiolib.c
+++ b/arch/arm/mach-s5pv210/gpiolib.c
@@ -281,6 +281,7 @@ static __init int s5pv210_gpiolib_init(void)
281 } 281 }
282 282
283 samsung_gpiolib_add_4bit_chips(s5pv210_gpio_4bit, nr_chips); 283 samsung_gpiolib_add_4bit_chips(s5pv210_gpio_4bit, nr_chips);
284 s5p_register_gpioint_bank(IRQ_GPIOINT, 0, S5P_GPIOINT_GROUP_MAXNR);
284 285
285 return 0; 286 return 0;
286} 287}
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h b/arch/arm/mach-s5pv210/include/mach/map.h
index 3611492ad681..1dd58836fd4f 100644
--- a/arch/arm/mach-s5pv210/include/mach/map.h
+++ b/arch/arm/mach-s5pv210/include/mach/map.h
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s5pv210/include/mach/map.h 1/* linux/arch/arm/mach-s5pv210/include/mach/map.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com/
5 * 5 *
6 * S5PV210 - Memory map definitions 6 * S5PV210 - Memory map definitions
@@ -16,122 +16,120 @@
16#include <plat/map-base.h> 16#include <plat/map-base.h>
17#include <plat/map-s5p.h> 17#include <plat/map-s5p.h>
18 18
19#define S5PV210_PA_SROM_BANK5 (0xA8000000) 19#define S5PV210_PA_SDRAM 0x20000000
20 20
21#define S5PC110_PA_ONENAND (0xB0000000) 21#define S5PV210_PA_SROM_BANK5 0xA8000000
22#define S5P_PA_ONENAND S5PC110_PA_ONENAND
23 22
24#define S5PC110_PA_ONENAND_DMA (0xB0600000) 23#define S5PC110_PA_ONENAND 0xB0000000
25#define S5P_PA_ONENAND_DMA S5PC110_PA_ONENAND_DMA 24#define S5PC110_PA_ONENAND_DMA 0xB0600000
26 25
27#define S5PV210_PA_CHIPID (0xE0000000) 26#define S5PV210_PA_CHIPID 0xE0000000
28#define S5P_PA_CHIPID S5PV210_PA_CHIPID
29 27
30#define S5PV210_PA_SYSCON (0xE0100000) 28#define S5PV210_PA_SYSCON 0xE0100000
31#define S5P_PA_SYSCON S5PV210_PA_SYSCON
32 29
33#define S5PV210_PA_GPIO (0xE0200000) 30#define S5PV210_PA_GPIO 0xE0200000
34 31
35/* SPI */ 32#define S5PV210_PA_SPDIF 0xE1100000
36#define S5PV210_PA_SPI0 0xE1300000
37#define S5PV210_PA_SPI1 0xE1400000
38 33
39#define S5PV210_PA_KEYPAD (0xE1600000) 34#define S5PV210_PA_SPI0 0xE1300000
35#define S5PV210_PA_SPI1 0xE1400000
40 36
41#define S5PV210_PA_IIC0 (0xE1800000) 37#define S5PV210_PA_KEYPAD 0xE1600000
42#define S5PV210_PA_IIC1 (0xFAB00000)
43#define S5PV210_PA_IIC2 (0xE1A00000)
44 38
45#define S5PV210_PA_TIMER (0xE2500000) 39#define S5PV210_PA_ADC 0xE1700000
46#define S5P_PA_TIMER S5PV210_PA_TIMER
47 40
48#define S5PV210_PA_SYSTIMER (0xE2600000) 41#define S5PV210_PA_IIC0 0xE1800000
42#define S5PV210_PA_IIC1 0xFAB00000
43#define S5PV210_PA_IIC2 0xE1A00000
49 44
50#define S5PV210_PA_WATCHDOG (0xE2700000) 45#define S5PV210_PA_AC97 0xE2200000
51 46
52#define S5PV210_PA_RTC (0xE2800000) 47#define S5PV210_PA_PCM0 0xE2300000
53#define S5PV210_PA_UART (0xE2900000) 48#define S5PV210_PA_PCM1 0xE1200000
49#define S5PV210_PA_PCM2 0xE2B00000
54 50
55#define S5P_PA_UART0 (S5PV210_PA_UART + 0x0) 51#define S5PV210_PA_TIMER 0xE2500000
56#define S5P_PA_UART1 (S5PV210_PA_UART + 0x400) 52#define S5PV210_PA_SYSTIMER 0xE2600000
57#define S5P_PA_UART2 (S5PV210_PA_UART + 0x800) 53#define S5PV210_PA_WATCHDOG 0xE2700000
58#define S5P_PA_UART3 (S5PV210_PA_UART + 0xC00) 54#define S5PV210_PA_RTC 0xE2800000
59 55
60#define S5P_SZ_UART SZ_256 56#define S5PV210_PA_UART 0xE2900000
61 57
62#define S3C_VA_UARTx(x) (S3C_VA_UART + ((x) * S3C_UART_OFFSET)) 58#define S5PV210_PA_SROMC 0xE8000000
63 59
64#define S5PV210_PA_SROMC (0xE8000000) 60#define S5PV210_PA_CFCON 0xE8200000
65#define S5P_PA_SROMC S5PV210_PA_SROMC
66 61
67#define S5PV210_PA_CFCON (0xE8200000) 62#define S5PV210_PA_HSMMC(x) (0xEB000000 + ((x) * 0x100000))
68 63
69#define S5PV210_PA_MDMA 0xFA200000 64#define S5PV210_PA_HSOTG 0xEC000000
70#define S5PV210_PA_PDMA0 0xE0900000 65#define S5PV210_PA_HSPHY 0xEC100000
71#define S5PV210_PA_PDMA1 0xE0A00000
72 66
73#define S5PV210_PA_FB (0xF8000000) 67#define S5PV210_PA_IIS0 0xEEE30000
68#define S5PV210_PA_IIS1 0xE2100000
69#define S5PV210_PA_IIS2 0xE2A00000
74 70
75#define S5PV210_PA_FIMC0 (0xFB200000) 71#define S5PV210_PA_DMC0 0xF0000000
76#define S5PV210_PA_FIMC1 (0xFB300000) 72#define S5PV210_PA_DMC1 0xF1400000
77#define S5PV210_PA_FIMC2 (0xFB400000)
78 73
79#define S5PV210_PA_HSMMC(x) (0xEB000000 + ((x) * 0x100000)) 74#define S5PV210_PA_VIC0 0xF2000000
75#define S5PV210_PA_VIC1 0xF2100000
76#define S5PV210_PA_VIC2 0xF2200000
77#define S5PV210_PA_VIC3 0xF2300000
80 78
81#define S5PV210_PA_HSOTG (0xEC000000) 79#define S5PV210_PA_FB 0xF8000000
82#define S5PV210_PA_HSPHY (0xEC100000)
83 80
84#define S5PV210_PA_VIC0 (0xF2000000) 81#define S5PV210_PA_MDMA 0xFA200000
85#define S5PV210_PA_VIC1 (0xF2100000) 82#define S5PV210_PA_PDMA0 0xE0900000
86#define S5PV210_PA_VIC2 (0xF2200000) 83#define S5PV210_PA_PDMA1 0xE0A00000
87#define S5PV210_PA_VIC3 (0xF2300000)
88 84
89#define S5PV210_PA_SDRAM (0x20000000) 85#define S5PV210_PA_MIPI_CSIS 0xFA600000
90#define S5P_PA_SDRAM S5PV210_PA_SDRAM
91 86
92/* S/PDIF */ 87#define S5PV210_PA_FIMC0 0xFB200000
93#define S5PV210_PA_SPDIF 0xE1100000 88#define S5PV210_PA_FIMC1 0xFB300000
89#define S5PV210_PA_FIMC2 0xFB400000
94 90
95/* I2S */ 91/* Compatibiltiy Defines */
96#define S5PV210_PA_IIS0 0xEEE30000
97#define S5PV210_PA_IIS1 0xE2100000
98#define S5PV210_PA_IIS2 0xE2A00000
99 92
100/* PCM */ 93#define S3C_PA_FB S5PV210_PA_FB
101#define S5PV210_PA_PCM0 0xE2300000 94#define S3C_PA_HSMMC0 S5PV210_PA_HSMMC(0)
102#define S5PV210_PA_PCM1 0xE1200000 95#define S3C_PA_HSMMC1 S5PV210_PA_HSMMC(1)
103#define S5PV210_PA_PCM2 0xE2B00000 96#define S3C_PA_HSMMC2 S5PV210_PA_HSMMC(2)
97#define S3C_PA_HSMMC3 S5PV210_PA_HSMMC(3)
98#define S3C_PA_IIC S5PV210_PA_IIC0
99#define S3C_PA_IIC1 S5PV210_PA_IIC1
100#define S3C_PA_IIC2 S5PV210_PA_IIC2
101#define S3C_PA_RTC S5PV210_PA_RTC
102#define S3C_PA_USB_HSOTG S5PV210_PA_HSOTG
103#define S3C_PA_WDT S5PV210_PA_WATCHDOG
104 104
105/* AC97 */ 105#define S5P_PA_CHIPID S5PV210_PA_CHIPID
106#define S5PV210_PA_AC97 0xE2200000 106#define S5P_PA_FIMC0 S5PV210_PA_FIMC0
107#define S5P_PA_FIMC1 S5PV210_PA_FIMC1
108#define S5P_PA_FIMC2 S5PV210_PA_FIMC2
109#define S5P_PA_MIPI_CSIS0 S5PV210_PA_MIPI_CSIS
110#define S5P_PA_ONENAND S5PC110_PA_ONENAND
111#define S5P_PA_ONENAND_DMA S5PC110_PA_ONENAND_DMA
112#define S5P_PA_SDRAM S5PV210_PA_SDRAM
113#define S5P_PA_SROMC S5PV210_PA_SROMC
114#define S5P_PA_SYSCON S5PV210_PA_SYSCON
115#define S5P_PA_TIMER S5PV210_PA_TIMER
107 116
108#define S5PV210_PA_ADC (0xE1700000) 117#define SAMSUNG_PA_ADC S5PV210_PA_ADC
118#define SAMSUNG_PA_CFCON S5PV210_PA_CFCON
119#define SAMSUNG_PA_KEYPAD S5PV210_PA_KEYPAD
109 120
110#define S5PV210_PA_DMC0 (0xF0000000) 121/* UART */
111#define S5PV210_PA_DMC1 (0xF1400000)
112 122
113#define S5PV210_PA_MIPI_CSIS 0xFA600000 123#define S3C_VA_UARTx(x) (S3C_VA_UART + ((x) * S3C_UART_OFFSET))
114 124
115/* compatibiltiy defines. */ 125#define S3C_PA_UART S5PV210_PA_UART
116#define S3C_PA_UART S5PV210_PA_UART
117#define S3C_PA_HSMMC0 S5PV210_PA_HSMMC(0)
118#define S3C_PA_HSMMC1 S5PV210_PA_HSMMC(1)
119#define S3C_PA_HSMMC2 S5PV210_PA_HSMMC(2)
120#define S3C_PA_HSMMC3 S5PV210_PA_HSMMC(3)
121#define S3C_PA_IIC S5PV210_PA_IIC0
122#define S3C_PA_IIC1 S5PV210_PA_IIC1
123#define S3C_PA_IIC2 S5PV210_PA_IIC2
124#define S3C_PA_FB S5PV210_PA_FB
125#define S3C_PA_RTC S5PV210_PA_RTC
126#define S3C_PA_WDT S5PV210_PA_WATCHDOG
127#define S3C_PA_USB_HSOTG S5PV210_PA_HSOTG
128#define S5P_PA_FIMC0 S5PV210_PA_FIMC0
129#define S5P_PA_FIMC1 S5PV210_PA_FIMC1
130#define S5P_PA_FIMC2 S5PV210_PA_FIMC2
131#define S5P_PA_MIPI_CSIS0 S5PV210_PA_MIPI_CSIS
132 126
133#define SAMSUNG_PA_ADC S5PV210_PA_ADC 127#define S5P_PA_UART(x) (S3C_PA_UART + ((x) * S3C_UART_OFFSET))
134#define SAMSUNG_PA_CFCON S5PV210_PA_CFCON 128#define S5P_PA_UART0 S5P_PA_UART(0)
135#define SAMSUNG_PA_KEYPAD S5PV210_PA_KEYPAD 129#define S5P_PA_UART1 S5P_PA_UART(1)
130#define S5P_PA_UART2 S5P_PA_UART(2)
131#define S5P_PA_UART3 S5P_PA_UART(3)
132
133#define S5P_SZ_UART SZ_256
136 134
137#endif /* __ASM_ARCH_MAP_H */ 135#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/memory.h b/arch/arm/mach-s5pv210/include/mach/memory.h
index d503e0c4ce4f..7b5fcf0da0c4 100644
--- a/arch/arm/mach-s5pv210/include/mach/memory.h
+++ b/arch/arm/mach-s5pv210/include/mach/memory.h
@@ -13,7 +13,7 @@
13#ifndef __ASM_ARCH_MEMORY_H 13#ifndef __ASM_ARCH_MEMORY_H
14#define __ASM_ARCH_MEMORY_H 14#define __ASM_ARCH_MEMORY_H
15 15
16#define PHYS_OFFSET UL(0x20000000) 16#define PLAT_PHYS_OFFSET UL(0x20000000)
17#define CONSISTENT_DMA_SIZE (SZ_8M + SZ_4M + SZ_2M) 17#define CONSISTENT_DMA_SIZE (SZ_8M + SZ_4M + SZ_2M)
18 18
19/* 19/*
diff --git a/arch/arm/mach-s5pv210/include/mach/regs-clock.h b/arch/arm/mach-s5pv210/include/mach/regs-clock.h
index 4c45b74def5f..78925c516346 100644
--- a/arch/arm/mach-s5pv210/include/mach/regs-clock.h
+++ b/arch/arm/mach-s5pv210/include/mach/regs-clock.h
@@ -146,6 +146,10 @@
146#define S5P_OM_STAT S5P_CLKREG(0xE100) 146#define S5P_OM_STAT S5P_CLKREG(0xE100)
147#define S5P_USB_PHY_CONTROL S5P_CLKREG(0xE80C) 147#define S5P_USB_PHY_CONTROL S5P_CLKREG(0xE80C)
148#define S5P_DAC_CONTROL S5P_CLKREG(0xE810) 148#define S5P_DAC_CONTROL S5P_CLKREG(0xE810)
149#define S5P_MIPI_DPHY_CONTROL(x) S5P_CLKREG(0xE814)
150#define S5P_MIPI_DPHY_ENABLE (1 << 0)
151#define S5P_MIPI_DPHY_SRESETN (1 << 1)
152#define S5P_MIPI_DPHY_MRESETN (1 << 2)
149 153
150#define S5P_INFORM0 S5P_CLKREG(0xF000) 154#define S5P_INFORM0 S5P_CLKREG(0xF000)
151#define S5P_INFORM1 S5P_CLKREG(0xF004) 155#define S5P_INFORM1 S5P_CLKREG(0xF004)
@@ -161,7 +165,6 @@
161#define S5P_MDNIE_SEL S5P_CLKREG(0x7008) 165#define S5P_MDNIE_SEL S5P_CLKREG(0x7008)
162#define S5P_MIPI_PHY_CON0 S5P_CLKREG(0x7200) 166#define S5P_MIPI_PHY_CON0 S5P_CLKREG(0x7200)
163#define S5P_MIPI_PHY_CON1 S5P_CLKREG(0x7204) 167#define S5P_MIPI_PHY_CON1 S5P_CLKREG(0x7204)
164#define S5P_MIPI_DPHY_CONTROL S5P_CLKREG(0xE814)
165 168
166#define S5P_IDLE_CFG_TL_MASK (3 << 30) 169#define S5P_IDLE_CFG_TL_MASK (3 << 30)
167#define S5P_IDLE_CFG_TM_MASK (3 << 28) 170#define S5P_IDLE_CFG_TM_MASK (3 << 28)
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c
index 461aa035afc0..4e1d8ff5ae59 100644
--- a/arch/arm/mach-s5pv210/mach-aquila.c
+++ b/arch/arm/mach-s5pv210/mach-aquila.c
@@ -39,6 +39,7 @@
39#include <plat/fb.h> 39#include <plat/fb.h>
40#include <plat/fimc-core.h> 40#include <plat/fimc-core.h>
41#include <plat/sdhci.h> 41#include <plat/sdhci.h>
42#include <plat/s5p-time.h>
42 43
43/* Following are default values for UCON, ULCON and UFCON UART registers */ 44/* Following are default values for UCON, ULCON and UFCON UART registers */
44#define AQUILA_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 45#define AQUILA_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
@@ -149,7 +150,7 @@ static struct regulator_init_data aquila_ldo2_data = {
149 150
150static struct regulator_init_data aquila_ldo3_data = { 151static struct regulator_init_data aquila_ldo3_data = {
151 .constraints = { 152 .constraints = {
152 .name = "VUSB/MIPI_1.1V", 153 .name = "VUSB+MIPI_1.1V",
153 .min_uV = 1100000, 154 .min_uV = 1100000,
154 .max_uV = 1100000, 155 .max_uV = 1100000,
155 .apply_uV = 1, 156 .apply_uV = 1,
@@ -197,7 +198,7 @@ static struct regulator_init_data aquila_ldo7_data = {
197 198
198static struct regulator_init_data aquila_ldo8_data = { 199static struct regulator_init_data aquila_ldo8_data = {
199 .constraints = { 200 .constraints = {
200 .name = "VUSB/VADC_3.3V", 201 .name = "VUSB+VADC_3.3V",
201 .min_uV = 3300000, 202 .min_uV = 3300000,
202 .max_uV = 3300000, 203 .max_uV = 3300000,
203 .apply_uV = 1, 204 .apply_uV = 1,
@@ -207,7 +208,7 @@ static struct regulator_init_data aquila_ldo8_data = {
207 208
208static struct regulator_init_data aquila_ldo9_data = { 209static struct regulator_init_data aquila_ldo9_data = {
209 .constraints = { 210 .constraints = {
210 .name = "VCC/VCAM_2.8V", 211 .name = "VCC+VCAM_2.8V",
211 .min_uV = 2800000, 212 .min_uV = 2800000,
212 .max_uV = 2800000, 213 .max_uV = 2800000,
213 .apply_uV = 1, 214 .apply_uV = 1,
@@ -296,13 +297,11 @@ static struct regulator_init_data aquila_ldo17_data = {
296}; 297};
297 298
298/* BUCK */ 299/* BUCK */
299static struct regulator_consumer_supply buck1_consumer[] = { 300static struct regulator_consumer_supply buck1_consumer =
300 { .supply = "vddarm", }, 301 REGULATOR_SUPPLY("vddarm", NULL);
301};
302 302
303static struct regulator_consumer_supply buck2_consumer[] = { 303static struct regulator_consumer_supply buck2_consumer =
304 { .supply = "vddint", }, 304 REGULATOR_SUPPLY("vddint", NULL);
305};
306 305
307static struct regulator_init_data aquila_buck1_data = { 306static struct regulator_init_data aquila_buck1_data = {
308 .constraints = { 307 .constraints = {
@@ -313,8 +312,8 @@ static struct regulator_init_data aquila_buck1_data = {
313 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 312 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
314 REGULATOR_CHANGE_STATUS, 313 REGULATOR_CHANGE_STATUS,
315 }, 314 },
316 .num_consumer_supplies = ARRAY_SIZE(buck1_consumer), 315 .num_consumer_supplies = 1,
317 .consumer_supplies = buck1_consumer, 316 .consumer_supplies = &buck1_consumer,
318}; 317};
319 318
320static struct regulator_init_data aquila_buck2_data = { 319static struct regulator_init_data aquila_buck2_data = {
@@ -326,8 +325,8 @@ static struct regulator_init_data aquila_buck2_data = {
326 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 325 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
327 REGULATOR_CHANGE_STATUS, 326 REGULATOR_CHANGE_STATUS,
328 }, 327 },
329 .num_consumer_supplies = ARRAY_SIZE(buck2_consumer), 328 .num_consumer_supplies = 1,
330 .consumer_supplies = buck2_consumer, 329 .consumer_supplies = &buck2_consumer,
331}; 330};
332 331
333static struct regulator_init_data aquila_buck3_data = { 332static struct regulator_init_data aquila_buck3_data = {
@@ -381,33 +380,24 @@ static struct max8998_platform_data aquila_max8998_pdata = {
381 .buck1_set1 = S5PV210_GPH0(3), 380 .buck1_set1 = S5PV210_GPH0(3),
382 .buck1_set2 = S5PV210_GPH0(4), 381 .buck1_set2 = S5PV210_GPH0(4),
383 .buck2_set3 = S5PV210_GPH0(5), 382 .buck2_set3 = S5PV210_GPH0(5),
384 .buck1_max_voltage1 = 1200000, 383 .buck1_voltage1 = 1200000,
385 .buck1_max_voltage2 = 1200000, 384 .buck1_voltage2 = 1200000,
386 .buck2_max_voltage = 1200000, 385 .buck1_voltage3 = 1200000,
386 .buck1_voltage4 = 1200000,
387 .buck2_voltage1 = 1200000,
388 .buck2_voltage2 = 1200000,
387}; 389};
388#endif 390#endif
389 391
390static struct regulator_consumer_supply wm8994_fixed_voltage0_supplies[] = { 392static struct regulator_consumer_supply wm8994_fixed_voltage0_supplies[] = {
391 { 393 REGULATOR_SUPPLY("DBVDD", "5-001a"),
392 .dev_name = "5-001a", 394 REGULATOR_SUPPLY("AVDD2", "5-001a"),
393 .supply = "DBVDD", 395 REGULATOR_SUPPLY("CPVDD", "5-001a"),
394 }, {
395 .dev_name = "5-001a",
396 .supply = "AVDD2",
397 }, {
398 .dev_name = "5-001a",
399 .supply = "CPVDD",
400 },
401}; 396};
402 397
403static struct regulator_consumer_supply wm8994_fixed_voltage1_supplies[] = { 398static struct regulator_consumer_supply wm8994_fixed_voltage1_supplies[] = {
404 { 399 REGULATOR_SUPPLY("SPKVDD1", "5-001a"),
405 .dev_name = "5-001a", 400 REGULATOR_SUPPLY("SPKVDD2", "5-001a"),
406 .supply = "SPKVDD1",
407 }, {
408 .dev_name = "5-001a",
409 .supply = "SPKVDD2",
410 },
411}; 401};
412 402
413static struct regulator_init_data wm8994_fixed_voltage0_init_data = { 403static struct regulator_init_data wm8994_fixed_voltage0_init_data = {
@@ -456,15 +446,11 @@ static struct platform_device wm8994_fixed_voltage1 = {
456 }, 446 },
457}; 447};
458 448
459static struct regulator_consumer_supply wm8994_avdd1_supply = { 449static struct regulator_consumer_supply wm8994_avdd1_supply =
460 .dev_name = "5-001a", 450 REGULATOR_SUPPLY("AVDD1", "5-001a");
461 .supply = "AVDD1",
462};
463 451
464static struct regulator_consumer_supply wm8994_dcvdd_supply = { 452static struct regulator_consumer_supply wm8994_dcvdd_supply =
465 .dev_name = "5-001a", 453 REGULATOR_SUPPLY("DCVDD", "5-001a");
466 .supply = "DCVDD",
467};
468 454
469static struct regulator_init_data wm8994_ldo1_data = { 455static struct regulator_init_data wm8994_ldo1_data = {
470 .constraints = { 456 .constraints = {
@@ -661,6 +647,7 @@ static void __init aquila_map_io(void)
661 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 647 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
662 s3c24xx_init_clocks(24000000); 648 s3c24xx_init_clocks(24000000);
663 s3c24xx_init_uarts(aquila_uartcfgs, ARRAY_SIZE(aquila_uartcfgs)); 649 s3c24xx_init_uarts(aquila_uartcfgs, ARRAY_SIZE(aquila_uartcfgs));
650 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
664} 651}
665 652
666static void __init aquila_machine_init(void) 653static void __init aquila_machine_init(void)
@@ -695,5 +682,5 @@ MACHINE_START(AQUILA, "Aquila")
695 .init_irq = s5pv210_init_irq, 682 .init_irq = s5pv210_init_irq,
696 .map_io = aquila_map_io, 683 .map_io = aquila_map_io,
697 .init_machine = aquila_machine_init, 684 .init_machine = aquila_machine_init,
698 .timer = &s3c24xx_timer, 685 .timer = &s5p_timer,
699MACHINE_END 686MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c
index e22d5112fd44..31d5aa769753 100644
--- a/arch/arm/mach-s5pv210/mach-goni.c
+++ b/arch/arm/mach-s5pv210/mach-goni.c
@@ -15,7 +15,7 @@
15#include <linux/fb.h> 15#include <linux/fb.h>
16#include <linux/i2c.h> 16#include <linux/i2c.h>
17#include <linux/i2c-gpio.h> 17#include <linux/i2c-gpio.h>
18#include <linux/i2c/qt602240_ts.h> 18#include <linux/i2c/atmel_mxt_ts.h>
19#include <linux/mfd/max8998.h> 19#include <linux/mfd/max8998.h>
20#include <linux/mfd/wm8994/pdata.h> 20#include <linux/mfd/wm8994/pdata.h>
21#include <linux/regulator/fixed.h> 21#include <linux/regulator/fixed.h>
@@ -25,6 +25,7 @@
25#include <linux/gpio_keys.h> 25#include <linux/gpio_keys.h>
26#include <linux/input.h> 26#include <linux/input.h>
27#include <linux/gpio.h> 27#include <linux/gpio.h>
28#include <linux/interrupt.h>
28 29
29#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
30#include <asm/mach/map.h> 31#include <asm/mach/map.h>
@@ -45,6 +46,7 @@
45#include <plat/keypad.h> 46#include <plat/keypad.h>
46#include <plat/sdhci.h> 47#include <plat/sdhci.h>
47#include <plat/clock.h> 48#include <plat/clock.h>
49#include <plat/s5p-time.h>
48 50
49/* Following are default values for UCON, ULCON and UFCON UART registers */ 51/* Following are default values for UCON, ULCON and UFCON UART registers */
50#define GONI_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 52#define GONI_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
@@ -108,6 +110,8 @@ static struct s3c_fb_pd_win goni_fb_win0 = {
108 }, 110 },
109 .max_bpp = 32, 111 .max_bpp = 32,
110 .default_bpp = 16, 112 .default_bpp = 16,
113 .virtual_x = 480,
114 .virtual_y = 2 * 800,
111}; 115};
112 116
113static struct s3c_fb_platdata goni_lcd_pdata __initdata = { 117static struct s3c_fb_platdata goni_lcd_pdata __initdata = {
@@ -222,7 +226,7 @@ static void __init goni_radio_init(void)
222} 226}
223 227
224/* TSP */ 228/* TSP */
225static struct qt602240_platform_data qt602240_platform_data = { 229static struct mxt_platform_data qt602240_platform_data = {
226 .x_line = 17, 230 .x_line = 17,
227 .y_line = 11, 231 .y_line = 11,
228 .x_size = 800, 232 .x_size = 800,
@@ -230,7 +234,8 @@ static struct qt602240_platform_data qt602240_platform_data = {
230 .blen = 0x21, 234 .blen = 0x21,
231 .threshold = 0x28, 235 .threshold = 0x28,
232 .voltage = 2800000, /* 2.8V */ 236 .voltage = 2800000, /* 2.8V */
233 .orient = QT602240_DIAGONAL, 237 .orient = MXT_DIAGONAL,
238 .irqflags = IRQF_TRIGGER_FALLING,
234}; 239};
235 240
236static struct s3c2410_platform_i2c i2c2_data __initdata = { 241static struct s3c2410_platform_i2c i2c2_data __initdata = {
@@ -269,10 +274,30 @@ static void __init goni_tsp_init(void)
269/* MAX8998 regulators */ 274/* MAX8998 regulators */
270#if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE) 275#if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE)
271 276
277static struct regulator_consumer_supply goni_ldo3_consumers[] = {
278 REGULATOR_SUPPLY("vusb_a", "s3c-hsotg"),
279};
280
272static struct regulator_consumer_supply goni_ldo5_consumers[] = { 281static struct regulator_consumer_supply goni_ldo5_consumers[] = {
273 REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"), 282 REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"),
274}; 283};
275 284
285static struct regulator_consumer_supply goni_ldo8_consumers[] = {
286 REGULATOR_SUPPLY("vusb_d", "s3c-hsotg"),
287};
288
289static struct regulator_consumer_supply goni_ldo11_consumers[] = {
290 REGULATOR_SUPPLY("vddio", "0-0030"), /* "CAM_IO_2.8V" */
291};
292
293static struct regulator_consumer_supply goni_ldo13_consumers[] = {
294 REGULATOR_SUPPLY("vdda", "0-0030"), /* "CAM_A_2.8V" */
295};
296
297static struct regulator_consumer_supply goni_ldo14_consumers[] = {
298 REGULATOR_SUPPLY("vdd_core", "0-0030"), /* "CAM_CIF_1.8V" */
299};
300
276static struct regulator_init_data goni_ldo2_data = { 301static struct regulator_init_data goni_ldo2_data = {
277 .constraints = { 302 .constraints = {
278 .name = "VALIVE_1.1V", 303 .name = "VALIVE_1.1V",
@@ -288,12 +313,14 @@ static struct regulator_init_data goni_ldo2_data = {
288 313
289static struct regulator_init_data goni_ldo3_data = { 314static struct regulator_init_data goni_ldo3_data = {
290 .constraints = { 315 .constraints = {
291 .name = "VUSB/MIPI_1.1V", 316 .name = "VUSB+MIPI_1.1V",
292 .min_uV = 1100000, 317 .min_uV = 1100000,
293 .max_uV = 1100000, 318 .max_uV = 1100000,
294 .apply_uV = 1, 319 .apply_uV = 1,
295 .always_on = 1, 320 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
296 }, 321 },
322 .num_consumer_supplies = ARRAY_SIZE(goni_ldo3_consumers),
323 .consumer_supplies = goni_ldo3_consumers,
297}; 324};
298 325
299static struct regulator_init_data goni_ldo4_data = { 326static struct regulator_init_data goni_ldo4_data = {
@@ -311,6 +338,7 @@ static struct regulator_init_data goni_ldo5_data = {
311 .min_uV = 2800000, 338 .min_uV = 2800000,
312 .max_uV = 2800000, 339 .max_uV = 2800000,
313 .apply_uV = 1, 340 .apply_uV = 1,
341 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
314 }, 342 },
315 .num_consumer_supplies = ARRAY_SIZE(goni_ldo5_consumers), 343 .num_consumer_supplies = ARRAY_SIZE(goni_ldo5_consumers),
316 .consumer_supplies = goni_ldo5_consumers, 344 .consumer_supplies = goni_ldo5_consumers,
@@ -337,21 +365,22 @@ static struct regulator_init_data goni_ldo7_data = {
337 365
338static struct regulator_init_data goni_ldo8_data = { 366static struct regulator_init_data goni_ldo8_data = {
339 .constraints = { 367 .constraints = {
340 .name = "VUSB/VADC_3.3V", 368 .name = "VUSB+VADC_3.3V",
341 .min_uV = 3300000, 369 .min_uV = 3300000,
342 .max_uV = 3300000, 370 .max_uV = 3300000,
343 .apply_uV = 1, 371 .apply_uV = 1,
344 .always_on = 1, 372 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
345 }, 373 },
374 .num_consumer_supplies = ARRAY_SIZE(goni_ldo8_consumers),
375 .consumer_supplies = goni_ldo8_consumers,
346}; 376};
347 377
348static struct regulator_init_data goni_ldo9_data = { 378static struct regulator_init_data goni_ldo9_data = {
349 .constraints = { 379 .constraints = {
350 .name = "VCC/VCAM_2.8V", 380 .name = "VCC+VCAM_2.8V",
351 .min_uV = 2800000, 381 .min_uV = 2800000,
352 .max_uV = 2800000, 382 .max_uV = 2800000,
353 .apply_uV = 1, 383 .apply_uV = 1,
354 .always_on = 1,
355 }, 384 },
356}; 385};
357 386
@@ -371,8 +400,10 @@ static struct regulator_init_data goni_ldo11_data = {
371 .min_uV = 2800000, 400 .min_uV = 2800000,
372 .max_uV = 2800000, 401 .max_uV = 2800000,
373 .apply_uV = 1, 402 .apply_uV = 1,
374 .always_on = 1, 403 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
375 }, 404 },
405 .num_consumer_supplies = ARRAY_SIZE(goni_ldo11_consumers),
406 .consumer_supplies = goni_ldo11_consumers,
376}; 407};
377 408
378static struct regulator_init_data goni_ldo12_data = { 409static struct regulator_init_data goni_ldo12_data = {
@@ -381,7 +412,6 @@ static struct regulator_init_data goni_ldo12_data = {
381 .min_uV = 1200000, 412 .min_uV = 1200000,
382 .max_uV = 1200000, 413 .max_uV = 1200000,
383 .apply_uV = 1, 414 .apply_uV = 1,
384 .always_on = 1,
385 }, 415 },
386}; 416};
387 417
@@ -391,8 +421,10 @@ static struct regulator_init_data goni_ldo13_data = {
391 .min_uV = 2800000, 421 .min_uV = 2800000,
392 .max_uV = 2800000, 422 .max_uV = 2800000,
393 .apply_uV = 1, 423 .apply_uV = 1,
394 .always_on = 1, 424 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
395 }, 425 },
426 .num_consumer_supplies = ARRAY_SIZE(goni_ldo13_consumers),
427 .consumer_supplies = goni_ldo13_consumers,
396}; 428};
397 429
398static struct regulator_init_data goni_ldo14_data = { 430static struct regulator_init_data goni_ldo14_data = {
@@ -401,8 +433,10 @@ static struct regulator_init_data goni_ldo14_data = {
401 .min_uV = 1800000, 433 .min_uV = 1800000,
402 .max_uV = 1800000, 434 .max_uV = 1800000,
403 .apply_uV = 1, 435 .apply_uV = 1,
404 .always_on = 1, 436 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
405 }, 437 },
438 .num_consumer_supplies = ARRAY_SIZE(goni_ldo14_consumers),
439 .consumer_supplies = goni_ldo14_consumers,
406}; 440};
407 441
408static struct regulator_init_data goni_ldo15_data = { 442static struct regulator_init_data goni_ldo15_data = {
@@ -411,7 +445,6 @@ static struct regulator_init_data goni_ldo15_data = {
411 .min_uV = 3300000, 445 .min_uV = 3300000,
412 .max_uV = 3300000, 446 .max_uV = 3300000,
413 .apply_uV = 1, 447 .apply_uV = 1,
414 .always_on = 1,
415 }, 448 },
416}; 449};
417 450
@@ -421,7 +454,6 @@ static struct regulator_init_data goni_ldo16_data = {
421 .min_uV = 1800000, 454 .min_uV = 1800000,
422 .max_uV = 1800000, 455 .max_uV = 1800000,
423 .apply_uV = 1, 456 .apply_uV = 1,
424 .always_on = 1,
425 }, 457 },
426}; 458};
427 459
@@ -436,13 +468,11 @@ static struct regulator_init_data goni_ldo17_data = {
436}; 468};
437 469
438/* BUCK */ 470/* BUCK */
439static struct regulator_consumer_supply buck1_consumer[] = { 471static struct regulator_consumer_supply buck1_consumer =
440 { .supply = "vddarm", }, 472 REGULATOR_SUPPLY("vddarm", NULL);
441};
442 473
443static struct regulator_consumer_supply buck2_consumer[] = { 474static struct regulator_consumer_supply buck2_consumer =
444 { .supply = "vddint", }, 475 REGULATOR_SUPPLY("vddint", NULL);
445};
446 476
447static struct regulator_init_data goni_buck1_data = { 477static struct regulator_init_data goni_buck1_data = {
448 .constraints = { 478 .constraints = {
@@ -453,8 +483,8 @@ static struct regulator_init_data goni_buck1_data = {
453 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 483 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
454 REGULATOR_CHANGE_STATUS, 484 REGULATOR_CHANGE_STATUS,
455 }, 485 },
456 .num_consumer_supplies = ARRAY_SIZE(buck1_consumer), 486 .num_consumer_supplies = 1,
457 .consumer_supplies = buck1_consumer, 487 .consumer_supplies = &buck1_consumer,
458}; 488};
459 489
460static struct regulator_init_data goni_buck2_data = { 490static struct regulator_init_data goni_buck2_data = {
@@ -466,8 +496,8 @@ static struct regulator_init_data goni_buck2_data = {
466 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 496 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
467 REGULATOR_CHANGE_STATUS, 497 REGULATOR_CHANGE_STATUS,
468 }, 498 },
469 .num_consumer_supplies = ARRAY_SIZE(buck2_consumer), 499 .num_consumer_supplies = 1,
470 .consumer_supplies = buck2_consumer, 500 .consumer_supplies = &buck2_consumer,
471}; 501};
472 502
473static struct regulator_init_data goni_buck3_data = { 503static struct regulator_init_data goni_buck3_data = {
@@ -521,33 +551,24 @@ static struct max8998_platform_data goni_max8998_pdata = {
521 .buck1_set1 = S5PV210_GPH0(3), 551 .buck1_set1 = S5PV210_GPH0(3),
522 .buck1_set2 = S5PV210_GPH0(4), 552 .buck1_set2 = S5PV210_GPH0(4),
523 .buck2_set3 = S5PV210_GPH0(5), 553 .buck2_set3 = S5PV210_GPH0(5),
524 .buck1_max_voltage1 = 1200000, 554 .buck1_voltage1 = 1200000,
525 .buck1_max_voltage2 = 1200000, 555 .buck1_voltage2 = 1200000,
526 .buck2_max_voltage = 1200000, 556 .buck1_voltage3 = 1200000,
557 .buck1_voltage4 = 1200000,
558 .buck2_voltage1 = 1200000,
559 .buck2_voltage2 = 1200000,
527}; 560};
528#endif 561#endif
529 562
530static struct regulator_consumer_supply wm8994_fixed_voltage0_supplies[] = { 563static struct regulator_consumer_supply wm8994_fixed_voltage0_supplies[] = {
531 { 564 REGULATOR_SUPPLY("DBVDD", "5-001a"),
532 .dev_name = "5-001a", 565 REGULATOR_SUPPLY("AVDD2", "5-001a"),
533 .supply = "DBVDD", 566 REGULATOR_SUPPLY("CPVDD", "5-001a"),
534 }, {
535 .dev_name = "5-001a",
536 .supply = "AVDD2",
537 }, {
538 .dev_name = "5-001a",
539 .supply = "CPVDD",
540 },
541}; 567};
542 568
543static struct regulator_consumer_supply wm8994_fixed_voltage1_supplies[] = { 569static struct regulator_consumer_supply wm8994_fixed_voltage1_supplies[] = {
544 { 570 REGULATOR_SUPPLY("SPKVDD1", "5-001a"),
545 .dev_name = "5-001a", 571 REGULATOR_SUPPLY("SPKVDD2", "5-001a"),
546 .supply = "SPKVDD1",
547 }, {
548 .dev_name = "5-001a",
549 .supply = "SPKVDD2",
550 },
551}; 572};
552 573
553static struct regulator_init_data wm8994_fixed_voltage0_init_data = { 574static struct regulator_init_data wm8994_fixed_voltage0_init_data = {
@@ -596,15 +617,11 @@ static struct platform_device wm8994_fixed_voltage1 = {
596 }, 617 },
597}; 618};
598 619
599static struct regulator_consumer_supply wm8994_avdd1_supply = { 620static struct regulator_consumer_supply wm8994_avdd1_supply =
600 .dev_name = "5-001a", 621 REGULATOR_SUPPLY("AVDD1", "5-001a");
601 .supply = "AVDD1",
602};
603 622
604static struct regulator_consumer_supply wm8994_dcvdd_supply = { 623static struct regulator_consumer_supply wm8994_dcvdd_supply =
605 .dev_name = "5-001a", 624 REGULATOR_SUPPLY("DCVDD", "5-001a");
606 .supply = "DCVDD",
607};
608 625
609static struct regulator_init_data wm8994_ldo1_data = { 626static struct regulator_init_data wm8994_ldo1_data = {
610 .constraints = { 627 .constraints = {
@@ -791,6 +808,7 @@ static struct platform_device *goni_devices[] __initdata = {
791 &goni_i2c_gpio5, 808 &goni_i2c_gpio5,
792 &mmc2_fixed_voltage, 809 &mmc2_fixed_voltage,
793 &goni_device_gpiokeys, 810 &goni_device_gpiokeys,
811 &s3c_device_i2c0,
794 &s5p_device_fimc0, 812 &s5p_device_fimc0,
795 &s5p_device_fimc1, 813 &s5p_device_fimc1,
796 &s5p_device_fimc2, 814 &s5p_device_fimc2,
@@ -820,6 +838,7 @@ static void __init goni_map_io(void)
820 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 838 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
821 s3c24xx_init_clocks(24000000); 839 s3c24xx_init_clocks(24000000);
822 s3c24xx_init_uarts(goni_uartcfgs, ARRAY_SIZE(goni_uartcfgs)); 840 s3c24xx_init_uarts(goni_uartcfgs, ARRAY_SIZE(goni_uartcfgs));
841 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
823} 842}
824 843
825static void __init goni_machine_init(void) 844static void __init goni_machine_init(void)
@@ -827,6 +846,9 @@ static void __init goni_machine_init(void)
827 /* Radio: call before I2C 1 registeration */ 846 /* Radio: call before I2C 1 registeration */
828 goni_radio_init(); 847 goni_radio_init();
829 848
849 /* I2C0 */
850 s3c_i2c0_set_platdata(NULL);
851
830 /* I2C1 */ 852 /* I2C1 */
831 s3c_i2c1_set_platdata(NULL); 853 s3c_i2c1_set_platdata(NULL);
832 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); 854 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
@@ -870,5 +892,5 @@ MACHINE_START(GONI, "GONI")
870 .init_irq = s5pv210_init_irq, 892 .init_irq = s5pv210_init_irq,
871 .map_io = goni_map_io, 893 .map_io = goni_map_io,
872 .init_machine = goni_machine_init, 894 .init_machine = goni_machine_init,
873 .timer = &s3c24xx_timer, 895 .timer = &s5p_timer,
874MACHINE_END 896MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c b/arch/arm/mach-s5pv210/mach-smdkc110.c
index ce11a02eabf3..6c412c8ceccc 100644
--- a/arch/arm/mach-s5pv210/mach-smdkc110.c
+++ b/arch/arm/mach-s5pv210/mach-smdkc110.c
@@ -30,6 +30,7 @@
30#include <plat/ata.h> 30#include <plat/ata.h>
31#include <plat/iic.h> 31#include <plat/iic.h>
32#include <plat/pm.h> 32#include <plat/pm.h>
33#include <plat/s5p-time.h>
33 34
34/* Following are default values for UCON, ULCON and UFCON UART registers */ 35/* Following are default values for UCON, ULCON and UFCON UART registers */
35#define SMDKC110_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 36#define SMDKC110_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
@@ -111,6 +112,7 @@ static void __init smdkc110_map_io(void)
111 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 112 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
112 s3c24xx_init_clocks(24000000); 113 s3c24xx_init_clocks(24000000);
113 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs)); 114 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
115 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
114} 116}
115 117
116static void __init smdkc110_machine_init(void) 118static void __init smdkc110_machine_init(void)
@@ -138,5 +140,5 @@ MACHINE_START(SMDKC110, "SMDKC110")
138 .init_irq = s5pv210_init_irq, 140 .init_irq = s5pv210_init_irq,
139 .map_io = smdkc110_map_io, 141 .map_io = smdkc110_map_io,
140 .init_machine = smdkc110_machine_init, 142 .init_machine = smdkc110_machine_init,
141 .timer = &s3c24xx_timer, 143 .timer = &s5p_timer,
142MACHINE_END 144MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
index bc9fdb52a020..bc08ac42e7cc 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -18,6 +18,7 @@
18#include <linux/fb.h> 18#include <linux/fb.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/pwm_backlight.h>
21 22
22#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
23#include <asm/mach/map.h> 24#include <asm/mach/map.h>
@@ -43,6 +44,8 @@
43#include <plat/keypad.h> 44#include <plat/keypad.h>
44#include <plat/pm.h> 45#include <plat/pm.h>
45#include <plat/fb.h> 46#include <plat/fb.h>
47#include <plat/gpio-cfg.h>
48#include <plat/s5p-time.h>
46 49
47/* Following are default values for UCON, ULCON and UFCON UART registers */ 50/* Following are default values for UCON, ULCON and UFCON UART registers */
48#define SMDKV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 51#define SMDKV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
@@ -208,6 +211,45 @@ static struct s3c_fb_platdata smdkv210_lcd0_pdata __initdata = {
208 .setup_gpio = s5pv210_fb_gpio_setup_24bpp, 211 .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
209}; 212};
210 213
214static int smdkv210_backlight_init(struct device *dev)
215{
216 int ret;
217
218 ret = gpio_request(S5PV210_GPD0(3), "Backlight");
219 if (ret) {
220 printk(KERN_ERR "failed to request GPD for PWM-OUT 3\n");
221 return ret;
222 }
223
224 /* Configure GPIO pin with S5PV210_GPD_0_3_TOUT_3 */
225 s3c_gpio_cfgpin(S5PV210_GPD0(3), S3C_GPIO_SFN(2));
226
227 return 0;
228}
229
230static void smdkv210_backlight_exit(struct device *dev)
231{
232 s3c_gpio_cfgpin(S5PV210_GPD0(3), S3C_GPIO_OUTPUT);
233 gpio_free(S5PV210_GPD0(3));
234}
235
236static struct platform_pwm_backlight_data smdkv210_backlight_data = {
237 .pwm_id = 3,
238 .max_brightness = 255,
239 .dft_brightness = 255,
240 .pwm_period_ns = 78770,
241 .init = smdkv210_backlight_init,
242 .exit = smdkv210_backlight_exit,
243};
244
245static struct platform_device smdkv210_backlight_device = {
246 .name = "pwm-backlight",
247 .dev = {
248 .parent = &s3c_device_timer[3].dev,
249 .platform_data = &smdkv210_backlight_data,
250 },
251};
252
211static struct platform_device *smdkv210_devices[] __initdata = { 253static struct platform_device *smdkv210_devices[] __initdata = {
212 &s3c_device_adc, 254 &s3c_device_adc,
213 &s3c_device_cfcon, 255 &s3c_device_cfcon,
@@ -229,6 +271,8 @@ static struct platform_device *smdkv210_devices[] __initdata = {
229 &samsung_device_keypad, 271 &samsung_device_keypad,
230 &smdkv210_dm9000, 272 &smdkv210_dm9000,
231 &smdkv210_lcd_lte480wv, 273 &smdkv210_lcd_lte480wv,
274 &s3c_device_timer[3],
275 &smdkv210_backlight_device,
232}; 276};
233 277
234static void __init smdkv210_dm9000_init(void) 278static void __init smdkv210_dm9000_init(void)
@@ -272,6 +316,7 @@ static void __init smdkv210_map_io(void)
272 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 316 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
273 s3c24xx_init_clocks(24000000); 317 s3c24xx_init_clocks(24000000);
274 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs)); 318 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
319 s5p_set_timer_source(S5P_PWM2, S5P_PWM4);
275} 320}
276 321
277static void __init smdkv210_machine_init(void) 322static void __init smdkv210_machine_init(void)
@@ -306,5 +351,5 @@ MACHINE_START(SMDKV210, "SMDKV210")
306 .init_irq = s5pv210_init_irq, 351 .init_irq = s5pv210_init_irq,
307 .map_io = smdkv210_map_io, 352 .map_io = smdkv210_map_io,
308 .init_machine = smdkv210_machine_init, 353 .init_machine = smdkv210_machine_init,
309 .timer = &s3c24xx_timer, 354 .timer = &s5p_timer,
310MACHINE_END 355MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-torbreck.c b/arch/arm/mach-s5pv210/mach-torbreck.c
index 043c938806b0..925fc0dc6252 100644
--- a/arch/arm/mach-s5pv210/mach-torbreck.c
+++ b/arch/arm/mach-s5pv210/mach-torbreck.c
@@ -27,6 +27,7 @@
27#include <plat/devs.h> 27#include <plat/devs.h>
28#include <plat/cpu.h> 28#include <plat/cpu.h>
29#include <plat/iic.h> 29#include <plat/iic.h>
30#include <plat/s5p-time.h>
30 31
31/* Following are default values for UCON, ULCON and UFCON UART registers */ 32/* Following are default values for UCON, ULCON and UFCON UART registers */
32#define TORBRECK_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 33#define TORBRECK_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
@@ -104,6 +105,7 @@ static void __init torbreck_map_io(void)
104 s5p_init_io(NULL, 0, S5P_VA_CHIPID); 105 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
105 s3c24xx_init_clocks(24000000); 106 s3c24xx_init_clocks(24000000);
106 s3c24xx_init_uarts(torbreck_uartcfgs, ARRAY_SIZE(torbreck_uartcfgs)); 107 s3c24xx_init_uarts(torbreck_uartcfgs, ARRAY_SIZE(torbreck_uartcfgs));
108 s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
107} 109}
108 110
109static void __init torbreck_machine_init(void) 111static void __init torbreck_machine_init(void)
@@ -127,5 +129,5 @@ MACHINE_START(TORBRECK, "TORBRECK")
127 .init_irq = s5pv210_init_irq, 129 .init_irq = s5pv210_init_irq,
128 .map_io = torbreck_map_io, 130 .map_io = torbreck_map_io,
129 .init_machine = torbreck_machine_init, 131 .init_machine = torbreck_machine_init,
130 .timer = &s3c24xx_timer, 132 .timer = &s5p_timer,
131MACHINE_END 133MACHINE_END
diff --git a/arch/arm/mach-s5pv210/setup-fimc.c b/arch/arm/mach-s5pv210/setup-fimc.c
new file mode 100644
index 000000000000..54cc5b11be0b
--- /dev/null
+++ b/arch/arm/mach-s5pv210/setup-fimc.c
@@ -0,0 +1,43 @@
1/*
2 * Copyright (C) 2011 Samsung Electronics Co., Ltd.
3 *
4 * S5PV210 camera interface GPIO configuration.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/gpio.h>
12#include <plat/gpio-cfg.h>
13#include <plat/camport.h>
14
15int s5pv210_fimc_setup_gpio(enum s5p_camport_id id)
16{
17 u32 gpio8, gpio5;
18 int ret;
19
20 switch (id) {
21 case S5P_CAMPORT_A:
22 gpio8 = S5PV210_GPE0(0);
23 gpio5 = S5PV210_GPE1(0);
24 break;
25
26 case S5P_CAMPORT_B:
27 gpio8 = S5PV210_GPJ0(0);
28 gpio5 = S5PV210_GPJ1(0);
29 break;
30
31 default:
32 WARN(1, "Wrong camport id: %d\n", id);
33 return -EINVAL;
34 }
35
36 ret = s3c_gpio_cfgall_range(gpio8, 8, S3C_GPIO_SFN(2),
37 S3C_GPIO_PULL_UP);
38 if (ret)
39 return ret;
40
41 return s3c_gpio_cfgall_range(gpio5, 5, S3C_GPIO_SFN(2),
42 S3C_GPIO_PULL_UP);
43}
diff --git a/arch/arm/mach-s5pv210/sleep.S b/arch/arm/mach-s5pv210/sleep.S
index d4d222b716b4..a3d649466fb1 100644
--- a/arch/arm/mach-s5pv210/sleep.S
+++ b/arch/arm/mach-s5pv210/sleep.S
@@ -35,50 +35,24 @@
35 /* s3c_cpu_save 35 /* s3c_cpu_save
36 * 36 *
37 * entry: 37 * entry:
38 * r0 = save address (virtual addr of s3c_sleep_save_phys) 38 * r1 = v:p offset
39 */ 39 */
40 40
41ENTRY(s3c_cpu_save) 41ENTRY(s3c_cpu_save)
42 42
43 stmfd sp!, { r3 - r12, lr } 43 stmfd sp!, { r3 - r12, lr }
44 44 ldr r3, =resume_with_mmu
45 mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID 45 bl cpu_suspend
46 mrc p15, 0, r5, c3, c0, 0 @ Domain ID
47 mrc p15, 0, r6, c2, c0, 0 @ Translation Table BASE0
48 mrc p15, 0, r7, c2, c0, 1 @ Translation Table BASE1
49 mrc p15, 0, r8, c2, c0, 2 @ Translation Table Control
50 mrc p15, 0, r9, c1, c0, 0 @ Control register
51 mrc p15, 0, r10, c1, c0, 1 @ Auxiliary control register
52 mrc p15, 0, r11, c1, c0, 2 @ Co-processor access controls
53 mrc p15, 0, r12, c10, c2, 0 @ Read PRRR
54 mrc p15, 0, r3, c10, c2, 1 @ READ NMRR
55
56 stmia r0, { r3 - r13 }
57
58 bl s3c_pm_cb_flushcache
59 46
60 ldr r0, =pm_cpu_sleep 47 ldr r0, =pm_cpu_sleep
61 ldr r0, [ r0 ] 48 ldr r0, [ r0 ]
62 mov pc, r0 49 mov pc, r0
63 50
64resume_with_mmu: 51resume_with_mmu:
65 /*
66 * After MMU is turned on, restore the previous MMU table.
67 */
68 ldr r9 , =(PAGE_OFFSET - PHYS_OFFSET)
69 add r4, r4, r9
70 str r12, [r4]
71
72 ldmfd sp!, { r3 - r12, pc } 52 ldmfd sp!, { r3 - r12, pc }
73 53
74 .ltorg 54 .ltorg
75 55
76 .data
77
78 .global s3c_sleep_save_phys
79s3c_sleep_save_phys:
80 .word 0
81
82 /* sleep magic, to allow the bootloader to check for an valid 56 /* sleep magic, to allow the bootloader to check for an valid
83 * image to resume to. Must be the first word before the 57 * image to resume to. Must be the first word before the
84 * s3c_cpu_resume entry. 58 * s3c_cpu_resume entry.
@@ -96,75 +70,4 @@ s3c_sleep_save_phys:
96 */ 70 */
97 71
98ENTRY(s3c_cpu_resume) 72ENTRY(s3c_cpu_resume)
99 mov r0, #PSR_I_BIT | PSR_F_BIT | SVC_MODE 73 b cpu_resume
100 msr cpsr_c, r0
101
102 mov r1, #0
103 mcr p15, 0, r1, c8, c7, 0 @ invalidate TLBs
104 mcr p15, 0, r1, c7, c5, 0 @ invalidate I Cache
105
106 ldr r0, s3c_sleep_save_phys @ address of restore block
107 ldmia r0, { r3 - r13 }
108
109 mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID
110 mcr p15, 0, r5, c3, c0, 0 @ Domain ID
111
112 mcr p15, 0, r8, c2, c0, 2 @ Translation Table Control
113 mcr p15, 0, r7, c2, c0, 1 @ Translation Table BASE1
114 mcr p15, 0, r6, c2, c0, 0 @ Translation Table BASE0
115
116 mcr p15, 0, r10, c1, c0, 1 @ Auxiliary control register
117
118 mov r0, #0
119 mcr p15, 0, r0, c8, c7, 0 @ Invalidate I & D TLB
120
121 mov r0, #0 @ restore copro access
122 mcr p15, 0, r11, c1, c0, 2 @ Co-processor access
123 mcr p15, 0, r0, c7, c5, 4
124
125 mcr p15, 0, r12, c10, c2, 0 @ write PRRR
126 mcr p15, 0, r3, c10, c2, 1 @ write NMRR
127
128 /*
129 * In Cortex-A8, when MMU is turned on, the pipeline is flushed.
130 * And there are no valid entries in the MMU table at this point.
131 * So before turning on the MMU, the MMU entry for the DRAM address
132 * range is added. After the MMU is turned on, the other entries
133 * in the MMU table will be restored.
134 */
135
136 /* r6 = Translation Table BASE0 */
137 mov r4, r6
138 mov r4, r4, LSR #14
139 mov r4, r4, LSL #14
140
141 /* Load address for adding to MMU table list */
142 ldr r11, =0xE010F000 @ INFORM0 reg.
143 ldr r10, [r11, #0]
144 mov r10, r10, LSR #18
145 bic r10, r10, #0x3
146 orr r4, r4, r10
147
148 /* Calculate MMU table entry */
149 mov r10, r10, LSL #18
150 ldr r5, =0x40E
151 orr r10, r10, r5
152
153 /* Back up originally data */
154 ldr r12, [r4]
155
156 /* Add calculated MMU table entry into MMU table list */
157 str r10, [r4]
158
159 ldr r2, =resume_with_mmu
160 mcr p15, 0, r9, c1, c0, 0 @ turn on MMU, etc
161
162 nop
163 nop
164 nop
165 nop
166 nop @ second-to-last before mmu
167
168 mov pc, r2 @ go back to virtual address
169
170 .ltorg
diff --git a/arch/arm/mach-s5pv310/Kconfig b/arch/arm/mach-s5pv310/Kconfig
deleted file mode 100644
index 09c4c21b70cc..000000000000
--- a/arch/arm/mach-s5pv310/Kconfig
+++ /dev/null
@@ -1,150 +0,0 @@
1# arch/arm/mach-s5pv310/Kconfig
2#
3# Copyright (c) 2010 Samsung Electronics Co., Ltd.
4# http://www.samsung.com/
5#
6# Licensed under GPLv2
7
8# Configuration options for the S5PV310
9
10if ARCH_S5PV310
11
12config CPU_S5PV310
13 bool
14 select S3C_PL330_DMA
15 help
16 Enable S5PV310 CPU support
17
18config S5PV310_DEV_PD
19 bool
20 help
21 Compile in platform device definitions for Power Domain
22
23config S5PV310_SETUP_I2C1
24 bool
25 help
26 Common setup code for i2c bus 1.
27
28config S5PV310_SETUP_I2C2
29 bool
30 help
31 Common setup code for i2c bus 2.
32
33config S5PV310_SETUP_I2C3
34 bool
35 help
36 Common setup code for i2c bus 3.
37
38config S5PV310_SETUP_I2C4
39 bool
40 help
41 Common setup code for i2c bus 4.
42
43config S5PV310_SETUP_I2C5
44 bool
45 help
46 Common setup code for i2c bus 5.
47
48config S5PV310_SETUP_I2C6
49 bool
50 help
51 Common setup code for i2c bus 6.
52
53config S5PV310_SETUP_I2C7
54 bool
55 help
56 Common setup code for i2c bus 7.
57
58config S5PV310_SETUP_SDHCI
59 bool
60 select S5PV310_SETUP_SDHCI_GPIO
61 help
62 Internal helper functions for S5PV310 based SDHCI systems.
63
64config S5PV310_SETUP_SDHCI_GPIO
65 bool
66 help
67 Common setup code for SDHCI gpio.
68
69config S5PV310_DEV_SYSMMU
70 bool
71 help
72 Common setup code for SYSTEM MMU in S5PV310
73
74# machine support
75
76menu "S5PC210 Machines"
77
78config MACH_SMDKC210
79 bool "SMDKC210"
80 select CPU_S5PV310
81 select S3C_DEV_RTC
82 select S3C_DEV_WDT
83 select S3C_DEV_I2C1
84 select S3C_DEV_HSMMC
85 select S3C_DEV_HSMMC1
86 select S3C_DEV_HSMMC2
87 select S3C_DEV_HSMMC3
88 select S5PV310_DEV_PD
89 select S5PV310_SETUP_I2C1
90 select S5PV310_SETUP_SDHCI
91 select S5PV310_DEV_SYSMMU
92 help
93 Machine support for Samsung SMDKC210
94 S5PC210(MCP) is one of package option of S5PV310
95
96config MACH_UNIVERSAL_C210
97 bool "Mobile UNIVERSAL_C210 Board"
98 select CPU_S5PV310
99 select S5P_DEV_ONENAND
100 select S3C_DEV_HSMMC
101 select S3C_DEV_HSMMC2
102 select S3C_DEV_HSMMC3
103 select S5PV310_SETUP_SDHCI
104 select S3C_DEV_I2C1
105 select S5PV310_SETUP_I2C1
106 help
107 Machine support for Samsung Mobile Universal S5PC210 Reference
108 Board. S5PC210(MCP) is one of package option of S5PV310
109
110endmenu
111
112menu "S5PV310 Machines"
113
114config MACH_SMDKV310
115 bool "SMDKV310"
116 select CPU_S5PV310
117 select S3C_DEV_RTC
118 select S3C_DEV_WDT
119 select S3C_DEV_I2C1
120 select S3C_DEV_HSMMC
121 select S3C_DEV_HSMMC1
122 select S3C_DEV_HSMMC2
123 select S3C_DEV_HSMMC3
124 select S5PV310_DEV_PD
125 select S5PV310_SETUP_I2C1
126 select S5PV310_SETUP_SDHCI
127 help
128 Machine support for Samsung SMDKV310
129
130endmenu
131
132comment "Configuration for HSMMC bus width"
133
134menu "Use 8-bit bus width"
135
136config S5PV310_SDHCI_CH0_8BIT
137 bool "Channel 0 with 8-bit bus"
138 help
139 Support HSMMC Channel 0 8-bit bus.
140 If selected, Channel 1 is disabled.
141
142config S5PV310_SDHCI_CH2_8BIT
143 bool "Channel 2 with 8-bit bus"
144 help
145 Support HSMMC Channel 2 8-bit bus.
146 If selected, Channel 3 is disabled.
147
148endmenu
149
150endif
diff --git a/arch/arm/mach-s5pv310/Makefile b/arch/arm/mach-s5pv310/Makefile
deleted file mode 100644
index 036fb383b830..000000000000
--- a/arch/arm/mach-s5pv310/Makefile
+++ /dev/null
@@ -1,43 +0,0 @@
1# arch/arm/mach-s5pv310/Makefile
2#
3# Copyright (c) 2010 Samsung Electronics Co., Ltd.
4# http://www.samsung.com/
5#
6# Licensed under GPLv2
7
8obj-y :=
9obj-m :=
10obj-n :=
11obj- :=
12
13# Core support for S5PV310 system
14
15obj-$(CONFIG_CPU_S5PV310) += cpu.o init.o clock.o irq-combiner.o
16obj-$(CONFIG_CPU_S5PV310) += setup-i2c0.o time.o gpiolib.o irq-eint.o dma.o
17obj-$(CONFIG_CPU_FREQ) += cpufreq.o
18
19obj-$(CONFIG_SMP) += platsmp.o headsmp.o
20obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
21obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
22
23# machine support
24
25obj-$(CONFIG_MACH_SMDKC210) += mach-smdkc210.o
26obj-$(CONFIG_MACH_SMDKV310) += mach-smdkv310.o
27obj-$(CONFIG_MACH_UNIVERSAL_C210) += mach-universal_c210.o
28
29# device support
30
31obj-y += dev-audio.o
32obj-$(CONFIG_S5PV310_DEV_PD) += dev-pd.o
33obj-$(CONFIG_S5PV310_DEV_SYSMMU) += dev-sysmmu.o
34
35obj-$(CONFIG_S5PV310_SETUP_I2C1) += setup-i2c1.o
36obj-$(CONFIG_S5PV310_SETUP_I2C2) += setup-i2c2.o
37obj-$(CONFIG_S5PV310_SETUP_I2C3) += setup-i2c3.o
38obj-$(CONFIG_S5PV310_SETUP_I2C4) += setup-i2c4.o
39obj-$(CONFIG_S5PV310_SETUP_I2C5) += setup-i2c5.o
40obj-$(CONFIG_S5PV310_SETUP_I2C6) += setup-i2c6.o
41obj-$(CONFIG_S5PV310_SETUP_I2C7) += setup-i2c7.o
42obj-$(CONFIG_S5PV310_SETUP_SDHCI) += setup-sdhci.o
43obj-$(CONFIG_S5PV310_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
diff --git a/arch/arm/mach-s5pv310/gpiolib.c b/arch/arm/mach-s5pv310/gpiolib.c
deleted file mode 100644
index 55217b8923ec..000000000000
--- a/arch/arm/mach-s5pv310/gpiolib.c
+++ /dev/null
@@ -1,304 +0,0 @@
1/* linux/arch/arm/mach-s5pv310/gpiolib.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * S5PV310 - GPIOlib support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/kernel.h>
14#include <linux/irq.h>
15#include <linux/io.h>
16#include <linux/gpio.h>
17
18#include <mach/map.h>
19
20#include <plat/gpio-core.h>
21#include <plat/gpio-cfg.h>
22#include <plat/gpio-cfg-helpers.h>
23
24static struct s3c_gpio_cfg gpio_cfg = {
25 .set_config = s3c_gpio_setcfg_s3c64xx_4bit,
26 .set_pull = s3c_gpio_setpull_updown,
27 .get_pull = s3c_gpio_getpull_updown,
28};
29
30static struct s3c_gpio_cfg gpio_cfg_noint = {
31 .set_config = s3c_gpio_setcfg_s3c64xx_4bit,
32 .set_pull = s3c_gpio_setpull_updown,
33 .get_pull = s3c_gpio_getpull_updown,
34};
35
36/*
37 * Following are the gpio banks in v310.
38 *
39 * The 'config' member when left to NULL, is initialized to the default
40 * structure gpio_cfg in the init function below.
41 *
42 * The 'base' member is also initialized in the init function below.
43 * Note: The initialization of 'base' member of s3c_gpio_chip structure
44 * uses the above macro and depends on the banks being listed in order here.
45 */
46static struct s3c_gpio_chip s5pv310_gpio_part1_4bit[] = {
47 {
48 .chip = {
49 .base = S5PV310_GPA0(0),
50 .ngpio = S5PV310_GPIO_A0_NR,
51 .label = "GPA0",
52 },
53 }, {
54 .chip = {
55 .base = S5PV310_GPA1(0),
56 .ngpio = S5PV310_GPIO_A1_NR,
57 .label = "GPA1",
58 },
59 }, {
60 .chip = {
61 .base = S5PV310_GPB(0),
62 .ngpio = S5PV310_GPIO_B_NR,
63 .label = "GPB",
64 },
65 }, {
66 .chip = {
67 .base = S5PV310_GPC0(0),
68 .ngpio = S5PV310_GPIO_C0_NR,
69 .label = "GPC0",
70 },
71 }, {
72 .chip = {
73 .base = S5PV310_GPC1(0),
74 .ngpio = S5PV310_GPIO_C1_NR,
75 .label = "GPC1",
76 },
77 }, {
78 .chip = {
79 .base = S5PV310_GPD0(0),
80 .ngpio = S5PV310_GPIO_D0_NR,
81 .label = "GPD0",
82 },
83 }, {
84 .chip = {
85 .base = S5PV310_GPD1(0),
86 .ngpio = S5PV310_GPIO_D1_NR,
87 .label = "GPD1",
88 },
89 }, {
90 .chip = {
91 .base = S5PV310_GPE0(0),
92 .ngpio = S5PV310_GPIO_E0_NR,
93 .label = "GPE0",
94 },
95 }, {
96 .chip = {
97 .base = S5PV310_GPE1(0),
98 .ngpio = S5PV310_GPIO_E1_NR,
99 .label = "GPE1",
100 },
101 }, {
102 .chip = {
103 .base = S5PV310_GPE2(0),
104 .ngpio = S5PV310_GPIO_E2_NR,
105 .label = "GPE2",
106 },
107 }, {
108 .chip = {
109 .base = S5PV310_GPE3(0),
110 .ngpio = S5PV310_GPIO_E3_NR,
111 .label = "GPE3",
112 },
113 }, {
114 .chip = {
115 .base = S5PV310_GPE4(0),
116 .ngpio = S5PV310_GPIO_E4_NR,
117 .label = "GPE4",
118 },
119 }, {
120 .chip = {
121 .base = S5PV310_GPF0(0),
122 .ngpio = S5PV310_GPIO_F0_NR,
123 .label = "GPF0",
124 },
125 }, {
126 .chip = {
127 .base = S5PV310_GPF1(0),
128 .ngpio = S5PV310_GPIO_F1_NR,
129 .label = "GPF1",
130 },
131 }, {
132 .chip = {
133 .base = S5PV310_GPF2(0),
134 .ngpio = S5PV310_GPIO_F2_NR,
135 .label = "GPF2",
136 },
137 }, {
138 .chip = {
139 .base = S5PV310_GPF3(0),
140 .ngpio = S5PV310_GPIO_F3_NR,
141 .label = "GPF3",
142 },
143 },
144};
145
146static struct s3c_gpio_chip s5pv310_gpio_part2_4bit[] = {
147 {
148 .chip = {
149 .base = S5PV310_GPJ0(0),
150 .ngpio = S5PV310_GPIO_J0_NR,
151 .label = "GPJ0",
152 },
153 }, {
154 .chip = {
155 .base = S5PV310_GPJ1(0),
156 .ngpio = S5PV310_GPIO_J1_NR,
157 .label = "GPJ1",
158 },
159 }, {
160 .chip = {
161 .base = S5PV310_GPK0(0),
162 .ngpio = S5PV310_GPIO_K0_NR,
163 .label = "GPK0",
164 },
165 }, {
166 .chip = {
167 .base = S5PV310_GPK1(0),
168 .ngpio = S5PV310_GPIO_K1_NR,
169 .label = "GPK1",
170 },
171 }, {
172 .chip = {
173 .base = S5PV310_GPK2(0),
174 .ngpio = S5PV310_GPIO_K2_NR,
175 .label = "GPK2",
176 },
177 }, {
178 .chip = {
179 .base = S5PV310_GPK3(0),
180 .ngpio = S5PV310_GPIO_K3_NR,
181 .label = "GPK3",
182 },
183 }, {
184 .chip = {
185 .base = S5PV310_GPL0(0),
186 .ngpio = S5PV310_GPIO_L0_NR,
187 .label = "GPL0",
188 },
189 }, {
190 .chip = {
191 .base = S5PV310_GPL1(0),
192 .ngpio = S5PV310_GPIO_L1_NR,
193 .label = "GPL1",
194 },
195 }, {
196 .chip = {
197 .base = S5PV310_GPL2(0),
198 .ngpio = S5PV310_GPIO_L2_NR,
199 .label = "GPL2",
200 },
201 }, {
202 .base = (S5P_VA_GPIO2 + 0xC00),
203 .config = &gpio_cfg_noint,
204 .irq_base = IRQ_EINT(0),
205 .chip = {
206 .base = S5PV310_GPX0(0),
207 .ngpio = S5PV310_GPIO_X0_NR,
208 .label = "GPX0",
209 .to_irq = samsung_gpiolib_to_irq,
210 },
211 }, {
212 .base = (S5P_VA_GPIO2 + 0xC20),
213 .config = &gpio_cfg_noint,
214 .irq_base = IRQ_EINT(8),
215 .chip = {
216 .base = S5PV310_GPX1(0),
217 .ngpio = S5PV310_GPIO_X1_NR,
218 .label = "GPX1",
219 .to_irq = samsung_gpiolib_to_irq,
220 },
221 }, {
222 .base = (S5P_VA_GPIO2 + 0xC40),
223 .config = &gpio_cfg_noint,
224 .irq_base = IRQ_EINT(16),
225 .chip = {
226 .base = S5PV310_GPX2(0),
227 .ngpio = S5PV310_GPIO_X2_NR,
228 .label = "GPX2",
229 .to_irq = samsung_gpiolib_to_irq,
230 },
231 }, {
232 .base = (S5P_VA_GPIO2 + 0xC60),
233 .config = &gpio_cfg_noint,
234 .irq_base = IRQ_EINT(24),
235 .chip = {
236 .base = S5PV310_GPX3(0),
237 .ngpio = S5PV310_GPIO_X3_NR,
238 .label = "GPX3",
239 .to_irq = samsung_gpiolib_to_irq,
240 },
241 },
242};
243
244static struct s3c_gpio_chip s5pv310_gpio_part3_4bit[] = {
245 {
246 .chip = {
247 .base = S5PV310_GPZ(0),
248 .ngpio = S5PV310_GPIO_Z_NR,
249 .label = "GPZ",
250 },
251 },
252};
253
254static __init int s5pv310_gpiolib_init(void)
255{
256 struct s3c_gpio_chip *chip;
257 int i;
258 int nr_chips;
259
260 /* GPIO part 1 */
261
262 chip = s5pv310_gpio_part1_4bit;
263 nr_chips = ARRAY_SIZE(s5pv310_gpio_part1_4bit);
264
265 for (i = 0; i < nr_chips; i++, chip++) {
266 if (chip->config == NULL)
267 chip->config = &gpio_cfg;
268 if (chip->base == NULL)
269 chip->base = S5P_VA_GPIO1 + (i) * 0x20;
270 }
271
272 samsung_gpiolib_add_4bit_chips(s5pv310_gpio_part1_4bit, nr_chips);
273
274 /* GPIO part 2 */
275
276 chip = s5pv310_gpio_part2_4bit;
277 nr_chips = ARRAY_SIZE(s5pv310_gpio_part2_4bit);
278
279 for (i = 0; i < nr_chips; i++, chip++) {
280 if (chip->config == NULL)
281 chip->config = &gpio_cfg;
282 if (chip->base == NULL)
283 chip->base = S5P_VA_GPIO2 + (i) * 0x20;
284 }
285
286 samsung_gpiolib_add_4bit_chips(s5pv310_gpio_part2_4bit, nr_chips);
287
288 /* GPIO part 3 */
289
290 chip = s5pv310_gpio_part3_4bit;
291 nr_chips = ARRAY_SIZE(s5pv310_gpio_part3_4bit);
292
293 for (i = 0; i < nr_chips; i++, chip++) {
294 if (chip->config == NULL)
295 chip->config = &gpio_cfg;
296 if (chip->base == NULL)
297 chip->base = S5P_VA_GPIO3 + (i) * 0x20;
298 }
299
300 samsung_gpiolib_add_4bit_chips(s5pv310_gpio_part3_4bit, nr_chips);
301
302 return 0;
303}
304core_initcall(s5pv310_gpiolib_init);
diff --git a/arch/arm/mach-s5pv310/include/mach/gpio.h b/arch/arm/mach-s5pv310/include/mach/gpio.h
deleted file mode 100644
index 20cb80c23466..000000000000
--- a/arch/arm/mach-s5pv310/include/mach/gpio.h
+++ /dev/null
@@ -1,135 +0,0 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/gpio.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5PV310 - GPIO lib support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_GPIO_H
14#define __ASM_ARCH_GPIO_H __FILE__
15
16#define gpio_get_value __gpio_get_value
17#define gpio_set_value __gpio_set_value
18#define gpio_cansleep __gpio_cansleep
19#define gpio_to_irq __gpio_to_irq
20
21/* Practically, GPIO banks upto GPZ are the configurable gpio banks */
22
23/* GPIO bank sizes */
24#define S5PV310_GPIO_A0_NR (8)
25#define S5PV310_GPIO_A1_NR (6)
26#define S5PV310_GPIO_B_NR (8)
27#define S5PV310_GPIO_C0_NR (5)
28#define S5PV310_GPIO_C1_NR (5)
29#define S5PV310_GPIO_D0_NR (4)
30#define S5PV310_GPIO_D1_NR (4)
31#define S5PV310_GPIO_E0_NR (5)
32#define S5PV310_GPIO_E1_NR (8)
33#define S5PV310_GPIO_E2_NR (6)
34#define S5PV310_GPIO_E3_NR (8)
35#define S5PV310_GPIO_E4_NR (8)
36#define S5PV310_GPIO_F0_NR (8)
37#define S5PV310_GPIO_F1_NR (8)
38#define S5PV310_GPIO_F2_NR (8)
39#define S5PV310_GPIO_F3_NR (6)
40#define S5PV310_GPIO_J0_NR (8)
41#define S5PV310_GPIO_J1_NR (5)
42#define S5PV310_GPIO_K0_NR (7)
43#define S5PV310_GPIO_K1_NR (7)
44#define S5PV310_GPIO_K2_NR (7)
45#define S5PV310_GPIO_K3_NR (7)
46#define S5PV310_GPIO_L0_NR (8)
47#define S5PV310_GPIO_L1_NR (3)
48#define S5PV310_GPIO_L2_NR (8)
49#define S5PV310_GPIO_X0_NR (8)
50#define S5PV310_GPIO_X1_NR (8)
51#define S5PV310_GPIO_X2_NR (8)
52#define S5PV310_GPIO_X3_NR (8)
53#define S5PV310_GPIO_Z_NR (7)
54
55/* GPIO bank numbers */
56
57#define S5PV310_GPIO_NEXT(__gpio) \
58 ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1)
59
60enum s5p_gpio_number {
61 S5PV310_GPIO_A0_START = 0,
62 S5PV310_GPIO_A1_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_A0),
63 S5PV310_GPIO_B_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_A1),
64 S5PV310_GPIO_C0_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_B),
65 S5PV310_GPIO_C1_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_C0),
66 S5PV310_GPIO_D0_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_C1),
67 S5PV310_GPIO_D1_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_D0),
68 S5PV310_GPIO_E0_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_D1),
69 S5PV310_GPIO_E1_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_E0),
70 S5PV310_GPIO_E2_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_E1),
71 S5PV310_GPIO_E3_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_E2),
72 S5PV310_GPIO_E4_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_E3),
73 S5PV310_GPIO_F0_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_E4),
74 S5PV310_GPIO_F1_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_F0),
75 S5PV310_GPIO_F2_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_F1),
76 S5PV310_GPIO_F3_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_F2),
77 S5PV310_GPIO_J0_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_F3),
78 S5PV310_GPIO_J1_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_J0),
79 S5PV310_GPIO_K0_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_J1),
80 S5PV310_GPIO_K1_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_K0),
81 S5PV310_GPIO_K2_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_K1),
82 S5PV310_GPIO_K3_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_K2),
83 S5PV310_GPIO_L0_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_K3),
84 S5PV310_GPIO_L1_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_L0),
85 S5PV310_GPIO_L2_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_L1),
86 S5PV310_GPIO_X0_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_L2),
87 S5PV310_GPIO_X1_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_X0),
88 S5PV310_GPIO_X2_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_X1),
89 S5PV310_GPIO_X3_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_X2),
90 S5PV310_GPIO_Z_START = S5PV310_GPIO_NEXT(S5PV310_GPIO_X3),
91};
92
93/* S5PV310 GPIO number definitions */
94#define S5PV310_GPA0(_nr) (S5PV310_GPIO_A0_START + (_nr))
95#define S5PV310_GPA1(_nr) (S5PV310_GPIO_A1_START + (_nr))
96#define S5PV310_GPB(_nr) (S5PV310_GPIO_B_START + (_nr))
97#define S5PV310_GPC0(_nr) (S5PV310_GPIO_C0_START + (_nr))
98#define S5PV310_GPC1(_nr) (S5PV310_GPIO_C1_START + (_nr))
99#define S5PV310_GPD0(_nr) (S5PV310_GPIO_D0_START + (_nr))
100#define S5PV310_GPD1(_nr) (S5PV310_GPIO_D1_START + (_nr))
101#define S5PV310_GPE0(_nr) (S5PV310_GPIO_E0_START + (_nr))
102#define S5PV310_GPE1(_nr) (S5PV310_GPIO_E1_START + (_nr))
103#define S5PV310_GPE2(_nr) (S5PV310_GPIO_E2_START + (_nr))
104#define S5PV310_GPE3(_nr) (S5PV310_GPIO_E3_START + (_nr))
105#define S5PV310_GPE4(_nr) (S5PV310_GPIO_E4_START + (_nr))
106#define S5PV310_GPF0(_nr) (S5PV310_GPIO_F0_START + (_nr))
107#define S5PV310_GPF1(_nr) (S5PV310_GPIO_F1_START + (_nr))
108#define S5PV310_GPF2(_nr) (S5PV310_GPIO_F2_START + (_nr))
109#define S5PV310_GPF3(_nr) (S5PV310_GPIO_F3_START + (_nr))
110#define S5PV310_GPJ0(_nr) (S5PV310_GPIO_J0_START + (_nr))
111#define S5PV310_GPJ1(_nr) (S5PV310_GPIO_J1_START + (_nr))
112#define S5PV310_GPK0(_nr) (S5PV310_GPIO_K0_START + (_nr))
113#define S5PV310_GPK1(_nr) (S5PV310_GPIO_K1_START + (_nr))
114#define S5PV310_GPK2(_nr) (S5PV310_GPIO_K2_START + (_nr))
115#define S5PV310_GPK3(_nr) (S5PV310_GPIO_K3_START + (_nr))
116#define S5PV310_GPL0(_nr) (S5PV310_GPIO_L0_START + (_nr))
117#define S5PV310_GPL1(_nr) (S5PV310_GPIO_L1_START + (_nr))
118#define S5PV310_GPL2(_nr) (S5PV310_GPIO_L2_START + (_nr))
119#define S5PV310_GPX0(_nr) (S5PV310_GPIO_X0_START + (_nr))
120#define S5PV310_GPX1(_nr) (S5PV310_GPIO_X1_START + (_nr))
121#define S5PV310_GPX2(_nr) (S5PV310_GPIO_X2_START + (_nr))
122#define S5PV310_GPX3(_nr) (S5PV310_GPIO_X3_START + (_nr))
123#define S5PV310_GPZ(_nr) (S5PV310_GPIO_Z_START + (_nr))
124
125/* the end of the S5PV310 specific gpios */
126#define S5PV310_GPIO_END (S5PV310_GPZ(S5PV310_GPIO_Z_NR) + 1)
127#define S3C_GPIO_END S5PV310_GPIO_END
128
129/* define the number of gpios we need to the one after the GPZ() range */
130#define ARCH_NR_GPIOS (S5PV310_GPZ(S5PV310_GPIO_Z_NR) + \
131 CONFIG_SAMSUNG_GPIO_EXTRA + 1)
132
133#include <asm-generic/gpio.h>
134
135#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-s5pv310/include/mach/map.h b/arch/arm/mach-s5pv310/include/mach/map.h
deleted file mode 100644
index 74d400625a23..000000000000
--- a/arch/arm/mach-s5pv310/include/mach/map.h
+++ /dev/null
@@ -1,149 +0,0 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/map.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5PV310 - Memory map definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_MAP_H
14#define __ASM_ARCH_MAP_H __FILE__
15
16#include <plat/map-base.h>
17
18/*
19 * S5PV310 UART offset is 0x10000 but the older S5P SoCs are 0x400.
20 * So need to define it, and here is to avoid redefinition warning.
21 */
22#define S3C_UART_OFFSET (0x10000)
23
24#include <plat/map-s5p.h>
25
26#define S5PV310_PA_SYSRAM (0x02025000)
27
28#define S5PV310_PA_SROM_BANK(x) (0x04000000 + ((x) * 0x01000000))
29
30#define S5PC210_PA_ONENAND (0x0C000000)
31#define S5P_PA_ONENAND S5PC210_PA_ONENAND
32
33#define S5PC210_PA_ONENAND_DMA (0x0C600000)
34#define S5P_PA_ONENAND_DMA S5PC210_PA_ONENAND_DMA
35
36#define S5PV310_PA_CHIPID (0x10000000)
37#define S5P_PA_CHIPID S5PV310_PA_CHIPID
38
39#define S5PV310_PA_SYSCON (0x10010000)
40#define S5P_PA_SYSCON S5PV310_PA_SYSCON
41
42#define S5PV310_PA_PMU (0x10020000)
43
44#define S5PV310_PA_CMU (0x10030000)
45
46#define S5PV310_PA_WATCHDOG (0x10060000)
47#define S5PV310_PA_RTC (0x10070000)
48
49#define S5PV310_PA_DMC0 (0x10400000)
50
51#define S5PV310_PA_COMBINER (0x10448000)
52
53#define S5PV310_PA_COREPERI (0x10500000)
54#define S5PV310_PA_GIC_CPU (0x10500100)
55#define S5PV310_PA_TWD (0x10500600)
56#define S5PV310_PA_GIC_DIST (0x10501000)
57#define S5PV310_PA_L2CC (0x10502000)
58
59/* DMA */
60#define S5PV310_PA_MDMA 0x10810000
61#define S5PV310_PA_PDMA0 0x12680000
62#define S5PV310_PA_PDMA1 0x12690000
63
64#define S5PV310_PA_GPIO1 (0x11400000)
65#define S5PV310_PA_GPIO2 (0x11000000)
66#define S5PV310_PA_GPIO3 (0x03860000)
67
68#define S5PV310_PA_MIPI_CSIS0 0x11880000
69#define S5PV310_PA_MIPI_CSIS1 0x11890000
70
71#define S5PV310_PA_HSMMC(x) (0x12510000 + ((x) * 0x10000))
72
73#define S5PV310_PA_SROMC (0x12570000)
74#define S5P_PA_SROMC S5PV310_PA_SROMC
75
76/* S/PDIF */
77#define S5PV310_PA_SPDIF 0xE1100000
78
79/* I2S */
80#define S5PV310_PA_I2S0 0x03830000
81#define S5PV310_PA_I2S1 0xE3100000
82#define S5PV310_PA_I2S2 0xE2A00000
83
84/* PCM */
85#define S5PV310_PA_PCM0 0x03840000
86#define S5PV310_PA_PCM1 0x13980000
87#define S5PV310_PA_PCM2 0x13990000
88
89/* AC97 */
90#define S5PV310_PA_AC97 0x139A0000
91
92#define S5PV310_PA_UART (0x13800000)
93
94#define S5P_PA_UART(x) (S5PV310_PA_UART + ((x) * S3C_UART_OFFSET))
95#define S5P_PA_UART0 S5P_PA_UART(0)
96#define S5P_PA_UART1 S5P_PA_UART(1)
97#define S5P_PA_UART2 S5P_PA_UART(2)
98#define S5P_PA_UART3 S5P_PA_UART(3)
99#define S5P_PA_UART4 S5P_PA_UART(4)
100
101#define S5P_SZ_UART SZ_256
102
103#define S5PV310_PA_IIC(x) (0x13860000 + ((x) * 0x10000))
104
105#define S5PV310_PA_TIMER (0x139D0000)
106#define S5P_PA_TIMER S5PV310_PA_TIMER
107
108#define S5PV310_PA_SDRAM (0x40000000)
109#define S5P_PA_SDRAM S5PV310_PA_SDRAM
110
111#define S5PV310_PA_SYSMMU_MDMA 0x10A40000
112#define S5PV310_PA_SYSMMU_SSS 0x10A50000
113#define S5PV310_PA_SYSMMU_FIMC0 0x11A20000
114#define S5PV310_PA_SYSMMU_FIMC1 0x11A30000
115#define S5PV310_PA_SYSMMU_FIMC2 0x11A40000
116#define S5PV310_PA_SYSMMU_FIMC3 0x11A50000
117#define S5PV310_PA_SYSMMU_JPEG 0x11A60000
118#define S5PV310_PA_SYSMMU_FIMD0 0x11E20000
119#define S5PV310_PA_SYSMMU_FIMD1 0x12220000
120#define S5PV310_PA_SYSMMU_PCIe 0x12620000
121#define S5PV310_PA_SYSMMU_G2D 0x12A20000
122#define S5PV310_PA_SYSMMU_ROTATOR 0x12A30000
123#define S5PV310_PA_SYSMMU_MDMA2 0x12A40000
124#define S5PV310_PA_SYSMMU_TV 0x12E20000
125#define S5PV310_PA_SYSMMU_MFC_L 0x13620000
126#define S5PV310_PA_SYSMMU_MFC_R 0x13630000
127#define S5PV310_SYSMMU_TOTAL_IPNUM 16
128#define S5P_SYSMMU_TOTAL_IPNUM S5PV310_SYSMMU_TOTAL_IPNUM
129
130/* compatibiltiy defines. */
131#define S3C_PA_UART S5PV310_PA_UART
132#define S3C_PA_HSMMC0 S5PV310_PA_HSMMC(0)
133#define S3C_PA_HSMMC1 S5PV310_PA_HSMMC(1)
134#define S3C_PA_HSMMC2 S5PV310_PA_HSMMC(2)
135#define S3C_PA_HSMMC3 S5PV310_PA_HSMMC(3)
136#define S3C_PA_IIC S5PV310_PA_IIC(0)
137#define S3C_PA_IIC1 S5PV310_PA_IIC(1)
138#define S3C_PA_IIC2 S5PV310_PA_IIC(2)
139#define S3C_PA_IIC3 S5PV310_PA_IIC(3)
140#define S3C_PA_IIC4 S5PV310_PA_IIC(4)
141#define S3C_PA_IIC5 S5PV310_PA_IIC(5)
142#define S3C_PA_IIC6 S5PV310_PA_IIC(6)
143#define S3C_PA_IIC7 S5PV310_PA_IIC(7)
144#define S3C_PA_RTC S5PV310_PA_RTC
145#define S3C_PA_WDT S5PV310_PA_WATCHDOG
146#define S5P_PA_MIPI_CSIS0 S5PV310_PA_MIPI_CSIS0
147#define S5P_PA_MIPI_CSIS1 S5PV310_PA_MIPI_CSIS1
148
149#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-s5pv310/include/mach/regs-gpio.h b/arch/arm/mach-s5pv310/include/mach/regs-gpio.h
deleted file mode 100644
index 82e9e0c9d452..000000000000
--- a/arch/arm/mach-s5pv310/include/mach/regs-gpio.h
+++ /dev/null
@@ -1,42 +0,0 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/regs-gpio.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * S5PV310 - GPIO (including EINT) register definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_REGS_GPIO_H
14#define __ASM_ARCH_REGS_GPIO_H __FILE__
15
16#include <mach/map.h>
17#include <mach/irqs.h>
18
19#define S5PV310_EINT40CON (S5P_VA_GPIO2 + 0xE00)
20#define S5P_EINT_CON(x) (S5PV310_EINT40CON + ((x) * 0x4))
21
22#define S5PV310_EINT40FLTCON0 (S5P_VA_GPIO2 + 0xE80)
23#define S5P_EINT_FLTCON(x) (S5PV310_EINT40FLTCON0 + ((x) * 0x4))
24
25#define S5PV310_EINT40MASK (S5P_VA_GPIO2 + 0xF00)
26#define S5P_EINT_MASK(x) (S5PV310_EINT40MASK + ((x) * 0x4))
27
28#define S5PV310_EINT40PEND (S5P_VA_GPIO2 + 0xF40)
29#define S5P_EINT_PEND(x) (S5PV310_EINT40PEND + ((x) * 0x4))
30
31#define EINT_REG_NR(x) (EINT_OFFSET(x) >> 3)
32
33#define eint_irq_to_bit(irq) (1 << (EINT_OFFSET(irq) & 0x7))
34
35#define EINT_MODE S3C_GPIO_SFN(0xf)
36
37#define EINT_GPIO_0(x) S5PV310_GPX0(x)
38#define EINT_GPIO_1(x) S5PV310_GPX1(x)
39#define EINT_GPIO_2(x) S5PV310_GPX2(x)
40#define EINT_GPIO_3(x) S5PV310_GPX3(x)
41
42#endif /* __ASM_ARCH_REGS_GPIO_H */
diff --git a/arch/arm/mach-s5pv310/include/mach/regs-pmu.h b/arch/arm/mach-s5pv310/include/mach/regs-pmu.h
deleted file mode 100644
index fb333d0f6073..000000000000
--- a/arch/arm/mach-s5pv310/include/mach/regs-pmu.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/regs-pmu.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * S5PV310 - Power management unit definition
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_REGS_PMU_H
14#define __ASM_ARCH_REGS_PMU_H __FILE__
15
16#include <mach/map.h>
17
18#define S5P_PMUREG(x) (S5P_VA_PMU + (x))
19
20#define S5P_PMU_CAM_CONF S5P_PMUREG(0x3C00)
21#define S5P_PMU_TV_CONF S5P_PMUREG(0x3C20)
22#define S5P_PMU_MFC_CONF S5P_PMUREG(0x3C40)
23#define S5P_PMU_G3D_CONF S5P_PMUREG(0x3C60)
24#define S5P_PMU_LCD0_CONF S5P_PMUREG(0x3C80)
25#define S5P_PMU_LCD1_CONF S5P_PMUREG(0x3CA0)
26#define S5P_PMU_GPS_CONF S5P_PMUREG(0x3CE0)
27
28#define S5P_INT_LOCAL_PWR_EN 0x7
29
30#endif /* __ASM_ARCH_REGS_PMU_H */
diff --git a/arch/arm/mach-s5pv310/include/mach/sysmmu.h b/arch/arm/mach-s5pv310/include/mach/sysmmu.h
deleted file mode 100644
index 662fe85ff4d5..000000000000
--- a/arch/arm/mach-s5pv310/include/mach/sysmmu.h
+++ /dev/null
@@ -1,119 +0,0 @@
1/* linux/arch/arm/mach-s5pv310/include/mach/sysmmu.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Samsung sysmmu driver for S5PV310
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARM_ARCH_SYSMMU_H
14#define __ASM_ARM_ARCH_SYSMMU_H __FILE__
15
16enum s5pv310_sysmmu_ips {
17 SYSMMU_MDMA,
18 SYSMMU_SSS,
19 SYSMMU_FIMC0,
20 SYSMMU_FIMC1,
21 SYSMMU_FIMC2,
22 SYSMMU_FIMC3,
23 SYSMMU_JPEG,
24 SYSMMU_FIMD0,
25 SYSMMU_FIMD1,
26 SYSMMU_PCIe,
27 SYSMMU_G2D,
28 SYSMMU_ROTATOR,
29 SYSMMU_MDMA2,
30 SYSMMU_TV,
31 SYSMMU_MFC_L,
32 SYSMMU_MFC_R,
33};
34
35static char *sysmmu_ips_name[S5P_SYSMMU_TOTAL_IPNUM] = {
36 "SYSMMU_MDMA" ,
37 "SYSMMU_SSS" ,
38 "SYSMMU_FIMC0" ,
39 "SYSMMU_FIMC1" ,
40 "SYSMMU_FIMC2" ,
41 "SYSMMU_FIMC3" ,
42 "SYSMMU_JPEG" ,
43 "SYSMMU_FIMD0" ,
44 "SYSMMU_FIMD1" ,
45 "SYSMMU_PCIe" ,
46 "SYSMMU_G2D" ,
47 "SYSMMU_ROTATOR",
48 "SYSMMU_MDMA2" ,
49 "SYSMMU_TV" ,
50 "SYSMMU_MFC_L" ,
51 "SYSMMU_MFC_R" ,
52};
53
54typedef enum s5pv310_sysmmu_ips sysmmu_ips;
55
56struct sysmmu_tt_info {
57 unsigned long *pgd;
58 unsigned long pgd_paddr;
59 unsigned long *pte;
60};
61
62struct sysmmu_controller {
63 const char *name;
64
65 /* channels registers */
66 void __iomem *regs;
67
68 /* channel irq */
69 unsigned int irq;
70
71 sysmmu_ips ips;
72
73 /* Translation Table Info. */
74 struct sysmmu_tt_info *tt_info;
75
76 struct resource *mem;
77 struct device *dev;
78
79 /* SysMMU controller enable - true : enable */
80 bool enable;
81};
82
83/**
84 * s5p_sysmmu_enable() - enable system mmu of ip
85 * @ips: The ip connected system mmu.
86 *
87 * This function enable system mmu to transfer address
88 * from virtual address to physical address
89 */
90int s5p_sysmmu_enable(sysmmu_ips ips);
91
92/**
93 * s5p_sysmmu_disable() - disable sysmmu mmu of ip
94 * @ips: The ip connected system mmu.
95 *
96 * This function disable system mmu to transfer address
97 * from virtual address to physical address
98 */
99int s5p_sysmmu_disable(sysmmu_ips ips);
100
101/**
102 * s5p_sysmmu_set_tablebase_pgd() - set page table base address to refer page table
103 * @ips: The ip connected system mmu.
104 * @pgd: The page table base address.
105 *
106 * This function set page table base address
107 * When system mmu transfer address from virtaul address to physical address,
108 * system mmu refer address information from page table
109 */
110int s5p_sysmmu_set_tablebase_pgd(sysmmu_ips ips, unsigned long pgd);
111
112/**
113 * s5p_sysmmu_tlb_invalidate() - flush all TLB entry in system mmu
114 * @ips: The ip connected system mmu.
115 *
116 * This function flush all TLB entry in system mmu
117 */
118int s5p_sysmmu_tlb_invalidate(sysmmu_ips ips);
119#endif /* __ASM_ARM_ARCH_SYSMMU_H */
diff --git a/arch/arm/mach-s5pv310/mach-universal_c210.c b/arch/arm/mach-s5pv310/mach-universal_c210.c
deleted file mode 100644
index 36bc3cf825e3..000000000000
--- a/arch/arm/mach-s5pv310/mach-universal_c210.c
+++ /dev/null
@@ -1,237 +0,0 @@
1/* linux/arch/arm/mach-s5pv310/mach-universal_c210.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8*/
9
10#include <linux/platform_device.h>
11#include <linux/serial_core.h>
12#include <linux/input.h>
13#include <linux/i2c.h>
14#include <linux/gpio_keys.h>
15#include <linux/gpio.h>
16#include <linux/regulator/machine.h>
17#include <linux/regulator/fixed.h>
18#include <linux/mmc/host.h>
19
20#include <asm/mach/arch.h>
21#include <asm/mach-types.h>
22
23#include <plat/regs-serial.h>
24#include <plat/s5pv310.h>
25#include <plat/cpu.h>
26#include <plat/devs.h>
27#include <plat/sdhci.h>
28
29#include <mach/map.h>
30
31/* Following are default values for UCON, ULCON and UFCON UART registers */
32#define UNIVERSAL_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
33 S3C2410_UCON_RXILEVEL | \
34 S3C2410_UCON_TXIRQMODE | \
35 S3C2410_UCON_RXIRQMODE | \
36 S3C2410_UCON_RXFIFO_TOI | \
37 S3C2443_UCON_RXERR_IRQEN)
38
39#define UNIVERSAL_ULCON_DEFAULT S3C2410_LCON_CS8
40
41#define UNIVERSAL_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
42 S5PV210_UFCON_TXTRIG256 | \
43 S5PV210_UFCON_RXTRIG256)
44
45static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = {
46 [0] = {
47 .hwport = 0,
48 .ucon = UNIVERSAL_UCON_DEFAULT,
49 .ulcon = UNIVERSAL_ULCON_DEFAULT,
50 .ufcon = UNIVERSAL_UFCON_DEFAULT,
51 },
52 [1] = {
53 .hwport = 1,
54 .ucon = UNIVERSAL_UCON_DEFAULT,
55 .ulcon = UNIVERSAL_ULCON_DEFAULT,
56 .ufcon = UNIVERSAL_UFCON_DEFAULT,
57 },
58 [2] = {
59 .hwport = 2,
60 .ucon = UNIVERSAL_UCON_DEFAULT,
61 .ulcon = UNIVERSAL_ULCON_DEFAULT,
62 .ufcon = UNIVERSAL_UFCON_DEFAULT,
63 },
64 [3] = {
65 .hwport = 3,
66 .ucon = UNIVERSAL_UCON_DEFAULT,
67 .ulcon = UNIVERSAL_ULCON_DEFAULT,
68 .ufcon = UNIVERSAL_UFCON_DEFAULT,
69 },
70};
71
72static struct gpio_keys_button universal_gpio_keys_tables[] = {
73 {
74 .code = KEY_VOLUMEUP,
75 .gpio = S5PV310_GPX2(0), /* XEINT16 */
76 .desc = "gpio-keys: KEY_VOLUMEUP",
77 .type = EV_KEY,
78 .active_low = 1,
79 .debounce_interval = 1,
80 }, {
81 .code = KEY_VOLUMEDOWN,
82 .gpio = S5PV310_GPX2(1), /* XEINT17 */
83 .desc = "gpio-keys: KEY_VOLUMEDOWN",
84 .type = EV_KEY,
85 .active_low = 1,
86 .debounce_interval = 1,
87 }, {
88 .code = KEY_CONFIG,
89 .gpio = S5PV310_GPX2(2), /* XEINT18 */
90 .desc = "gpio-keys: KEY_CONFIG",
91 .type = EV_KEY,
92 .active_low = 1,
93 .debounce_interval = 1,
94 }, {
95 .code = KEY_CAMERA,
96 .gpio = S5PV310_GPX2(3), /* XEINT19 */
97 .desc = "gpio-keys: KEY_CAMERA",
98 .type = EV_KEY,
99 .active_low = 1,
100 .debounce_interval = 1,
101 }, {
102 .code = KEY_OK,
103 .gpio = S5PV310_GPX3(5), /* XEINT29 */
104 .desc = "gpio-keys: KEY_OK",
105 .type = EV_KEY,
106 .active_low = 1,
107 .debounce_interval = 1,
108 },
109};
110
111static struct gpio_keys_platform_data universal_gpio_keys_data = {
112 .buttons = universal_gpio_keys_tables,
113 .nbuttons = ARRAY_SIZE(universal_gpio_keys_tables),
114};
115
116static struct platform_device universal_gpio_keys = {
117 .name = "gpio-keys",
118 .dev = {
119 .platform_data = &universal_gpio_keys_data,
120 },
121};
122
123/* eMMC */
124static struct s3c_sdhci_platdata universal_hsmmc0_data __initdata = {
125 .max_width = 8,
126 .host_caps = (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA |
127 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
128 MMC_CAP_DISABLE),
129 .cd_type = S3C_SDHCI_CD_PERMANENT,
130 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
131};
132
133static struct regulator_consumer_supply mmc0_supplies[] = {
134 REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"),
135};
136
137static struct regulator_init_data mmc0_fixed_voltage_init_data = {
138 .constraints = {
139 .name = "VMEM_VDD_2.8V",
140 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
141 },
142 .num_consumer_supplies = ARRAY_SIZE(mmc0_supplies),
143 .consumer_supplies = mmc0_supplies,
144};
145
146static struct fixed_voltage_config mmc0_fixed_voltage_config = {
147 .supply_name = "MASSMEMORY_EN",
148 .microvolts = 2800000,
149 .gpio = S5PV310_GPE1(3),
150 .enable_high = true,
151 .init_data = &mmc0_fixed_voltage_init_data,
152};
153
154static struct platform_device mmc0_fixed_voltage = {
155 .name = "reg-fixed-voltage",
156 .id = 0,
157 .dev = {
158 .platform_data = &mmc0_fixed_voltage_config,
159 },
160};
161
162/* SD */
163static struct s3c_sdhci_platdata universal_hsmmc2_data __initdata = {
164 .max_width = 4,
165 .host_caps = MMC_CAP_4_BIT_DATA |
166 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
167 MMC_CAP_DISABLE,
168 .ext_cd_gpio = S5PV310_GPX3(4), /* XEINT_28 */
169 .ext_cd_gpio_invert = 1,
170 .cd_type = S3C_SDHCI_CD_GPIO,
171 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
172};
173
174/* WiFi */
175static struct s3c_sdhci_platdata universal_hsmmc3_data __initdata = {
176 .max_width = 4,
177 .host_caps = MMC_CAP_4_BIT_DATA |
178 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
179 MMC_CAP_DISABLE,
180 .cd_type = S3C_SDHCI_CD_EXTERNAL,
181};
182
183static void __init universal_sdhci_init(void)
184{
185 s3c_sdhci0_set_platdata(&universal_hsmmc0_data);
186 s3c_sdhci2_set_platdata(&universal_hsmmc2_data);
187 s3c_sdhci3_set_platdata(&universal_hsmmc3_data);
188}
189
190/* I2C0 */
191static struct i2c_board_info i2c0_devs[] __initdata = {
192 /* Camera, To be updated */
193};
194
195/* I2C1 */
196static struct i2c_board_info i2c1_devs[] __initdata = {
197 /* Gyro, To be updated */
198};
199
200static struct platform_device *universal_devices[] __initdata = {
201 /* Samsung Platform Devices */
202 &mmc0_fixed_voltage,
203 &s3c_device_hsmmc0,
204 &s3c_device_hsmmc2,
205 &s3c_device_hsmmc3,
206
207 /* Universal Devices */
208 &universal_gpio_keys,
209 &s5p_device_onenand,
210};
211
212static void __init universal_map_io(void)
213{
214 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
215 s3c24xx_init_clocks(24000000);
216 s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs));
217}
218
219static void __init universal_machine_init(void)
220{
221 universal_sdhci_init();
222
223 i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs));
224 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
225
226 /* Last */
227 platform_add_devices(universal_devices, ARRAY_SIZE(universal_devices));
228}
229
230MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
231 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
232 .boot_params = S5P_PA_SDRAM + 0x100,
233 .init_irq = s5pv310_init_irq,
234 .map_io = universal_map_io,
235 .init_machine = universal_machine_init,
236 .timer = &s5pv310_timer,
237MACHINE_END
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index d43c5ef58eb6..bd3e1bfdd6aa 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -241,6 +241,9 @@ static struct locomo_platform_data locomo_info = {
241struct platform_device collie_locomo_device = { 241struct platform_device collie_locomo_device = {
242 .name = "locomo", 242 .name = "locomo",
243 .id = 0, 243 .id = 0,
244 .dev = {
245 .platform_data = &locomo_info,
246 },
244 .num_resources = ARRAY_SIZE(locomo_resources), 247 .num_resources = ARRAY_SIZE(locomo_resources),
245 .resource = locomo_resources, 248 .resource = locomo_resources,
246}; 249};
diff --git a/arch/arm/mach-sa1100/include/mach/memory.h b/arch/arm/mach-sa1100/include/mach/memory.h
index 128a1dfa96b9..a44da6a2916c 100644
--- a/arch/arm/mach-sa1100/include/mach/memory.h
+++ b/arch/arm/mach-sa1100/include/mach/memory.h
@@ -12,7 +12,7 @@
12/* 12/*
13 * Physical DRAM offset is 0xc0000000 on the SA1100 13 * Physical DRAM offset is 0xc0000000 on the SA1100
14 */ 14 */
15#define PHYS_OFFSET UL(0xc0000000) 15#define PLAT_PHYS_OFFSET UL(0xc0000000)
16 16
17#ifndef __ASSEMBLY__ 17#ifndef __ASSEMBLY__
18 18
diff --git a/arch/arm/mach-sa1100/pm.c b/arch/arm/mach-sa1100/pm.c
index ab9fc4470d36..c4661aab22fb 100644
--- a/arch/arm/mach-sa1100/pm.c
+++ b/arch/arm/mach-sa1100/pm.c
@@ -32,8 +32,7 @@
32#include <asm/system.h> 32#include <asm/system.h>
33#include <asm/mach/time.h> 33#include <asm/mach/time.h>
34 34
35extern void sa1100_cpu_suspend(void); 35extern void sa1100_cpu_suspend(long);
36extern void sa1100_cpu_resume(void);
37 36
38#define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x 37#define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x
39#define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x] 38#define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x]
@@ -73,10 +72,10 @@ static int sa11x0_pm_enter(suspend_state_t state)
73 RCSR = RCSR_HWR | RCSR_SWR | RCSR_WDR | RCSR_SMR; 72 RCSR = RCSR_HWR | RCSR_SWR | RCSR_WDR | RCSR_SMR;
74 73
75 /* set resume return address */ 74 /* set resume return address */
76 PSPR = virt_to_phys(sa1100_cpu_resume); 75 PSPR = virt_to_phys(cpu_resume);
77 76
78 /* go zzz */ 77 /* go zzz */
79 sa1100_cpu_suspend(); 78 sa1100_cpu_suspend(PLAT_PHYS_OFFSET - PAGE_OFFSET);
80 79
81 cpu_init(); 80 cpu_init();
82 81
@@ -115,11 +114,6 @@ static int sa11x0_pm_enter(suspend_state_t state)
115 return 0; 114 return 0;
116} 115}
117 116
118unsigned long sleep_phys_sp(void *sp)
119{
120 return virt_to_phys(sp);
121}
122
123static const struct platform_suspend_ops sa11x0_pm_ops = { 117static const struct platform_suspend_ops sa11x0_pm_ops = {
124 .enter = sa11x0_pm_enter, 118 .enter = sa11x0_pm_enter,
125 .valid = suspend_valid_only_mem, 119 .valid = suspend_valid_only_mem,
diff --git a/arch/arm/mach-sa1100/sleep.S b/arch/arm/mach-sa1100/sleep.S
index 80f31bad707c..04f2a618d4ef 100644
--- a/arch/arm/mach-sa1100/sleep.S
+++ b/arch/arm/mach-sa1100/sleep.S
@@ -20,12 +20,7 @@
20#include <asm/assembler.h> 20#include <asm/assembler.h>
21#include <mach/hardware.h> 21#include <mach/hardware.h>
22 22
23
24
25 .text 23 .text
26
27
28
29/* 24/*
30 * sa1100_cpu_suspend() 25 * sa1100_cpu_suspend()
31 * 26 *
@@ -34,27 +29,10 @@
34 */ 29 */
35 30
36ENTRY(sa1100_cpu_suspend) 31ENTRY(sa1100_cpu_suspend)
37
38 stmfd sp!, {r4 - r12, lr} @ save registers on stack 32 stmfd sp!, {r4 - r12, lr} @ save registers on stack
39 33 mov r1, r0
40 @ get coprocessor registers 34 ldr r3, =sa1100_cpu_resume @ return function
41 mrc p15, 0, r4, c3, c0, 0 @ domain ID 35 bl cpu_suspend
42 mrc p15, 0, r5, c2, c0, 0 @ translation table base addr
43 mrc p15, 0, r6, c13, c0, 0 @ PID
44 mrc p15, 0, r7, c1, c0, 0 @ control reg
45
46 @ store them plus current virtual stack ptr on stack
47 mov r8, sp
48 stmfd sp!, {r4 - r8}
49
50 @ preserve phys address of stack
51 mov r0, sp
52 bl sleep_phys_sp
53 ldr r1, =sleep_save_sp
54 str r0, [r1]
55
56 @ clean data cache and invalidate WB
57 bl v4wb_flush_kern_cache_all
58 36
59 @ disable clock switching 37 @ disable clock switching
60 mcr p15, 0, r1, c15, c2, 2 38 mcr p15, 0, r1, c15, c2, 2
@@ -166,50 +144,8 @@ sa1110_sdram_controller_fix:
166 * cpu_sa1100_resume() 144 * cpu_sa1100_resume()
167 * 145 *
168 * entry point from bootloader into kernel during resume 146 * entry point from bootloader into kernel during resume
169 *
170 * Note: Yes, part of the following code is located into the .data section.
171 * This is to allow sleep_save_sp to be accessed with a relative load
172 * while we can't rely on any MMU translation. We could have put
173 * sleep_save_sp in the .text section as well, but some setups might
174 * insist on it to be truly read-only.
175 */ 147 */
176
177 .data
178 .align 5
179ENTRY(sa1100_cpu_resume)
180 mov r0, #PSR_F_BIT | PSR_I_BIT | SVC_MODE
181 msr cpsr_c, r0 @ set SVC, irqs off
182
183 ldr r0, sleep_save_sp @ stack phys addr
184 ldr r2, =resume_after_mmu @ its absolute virtual address
185 ldmfd r0, {r4 - r7, sp} @ CP regs + virt stack ptr
186
187 mov r1, #0
188 mcr p15, 0, r1, c8, c7, 0 @ flush I+D TLBs
189 mcr p15, 0, r1, c7, c7, 0 @ flush I&D cache
190 mcr p15, 0, r1, c9, c0, 0 @ invalidate RB
191 mcr p15, 0, r1, c9, c0, 5 @ allow user space to use RB
192
193 mcr p15, 0, r4, c3, c0, 0 @ domain ID
194 mcr p15, 0, r5, c2, c0, 0 @ translation table base addr
195 mcr p15, 0, r6, c13, c0, 0 @ PID
196 b resume_turn_on_mmu @ cache align execution
197
198 .align 5 148 .align 5
199resume_turn_on_mmu: 149sa1100_cpu_resume:
200 mcr p15, 0, r7, c1, c0, 0 @ turn on MMU, caches, etc.
201 nop
202 mov pc, r2 @ jump to virtual addr
203 nop
204 nop
205 nop
206
207sleep_save_sp:
208 .word 0 @ preserve stack phys ptr here
209
210 .text
211resume_after_mmu:
212 mcr p15, 0, r1, c15, c1, 2 @ enable clock switching 150 mcr p15, 0, r1, c15, c1, 2 @ enable clock switching
213 ldmfd sp!, {r4 - r12, pc} @ return to caller 151 ldmfd sp!, {r4 - r12, pc} @ return to caller
214
215
diff --git a/arch/arm/mach-shark/include/mach/memory.h b/arch/arm/mach-shark/include/mach/memory.h
index d9c4812f1c31..9afb17000008 100644
--- a/arch/arm/mach-shark/include/mach/memory.h
+++ b/arch/arm/mach-shark/include/mach/memory.h
@@ -15,7 +15,7 @@
15/* 15/*
16 * Physical DRAM offset. 16 * Physical DRAM offset.
17 */ 17 */
18#define PHYS_OFFSET UL(0x08000000) 18#define PLAT_PHYS_OFFSET UL(0x08000000)
19 19
20#ifndef __ASSEMBLY__ 20#ifndef __ASSEMBLY__
21 21
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 4d1b4c5c9389..0c8f6cf3e948 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -60,6 +60,8 @@ endchoice
60 60
61config MACH_AG5EVM 61config MACH_AG5EVM
62 bool "AG5EVM board" 62 bool "AG5EVM board"
63 select ARCH_REQUIRE_GPIOLIB
64 select SH_LCD_MIPI_DSI
63 depends on ARCH_SH73A0 65 depends on ARCH_SH73A0
64 66
65config MACH_MACKEREL 67config MACH_MACKEREL
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index c18a740a4159..3e6f0aab460b 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -34,9 +34,10 @@
34#include <linux/input/sh_keysc.h> 34#include <linux/input/sh_keysc.h>
35#include <linux/mmc/host.h> 35#include <linux/mmc/host.h>
36#include <linux/mmc/sh_mmcif.h> 36#include <linux/mmc/sh_mmcif.h>
37 37#include <linux/sh_clk.h>
38#include <video/sh_mobile_lcdc.h>
39#include <video/sh_mipi_dsi.h>
38#include <sound/sh_fsi.h> 40#include <sound/sh_fsi.h>
39
40#include <mach/hardware.h> 41#include <mach/hardware.h>
41#include <mach/sh73a0.h> 42#include <mach/sh73a0.h>
42#include <mach/common.h> 43#include <mach/common.h>
@@ -118,13 +119,6 @@ static struct platform_device keysc_device = {
118}; 119};
119 120
120/* FSI A */ 121/* FSI A */
121static struct sh_fsi_platform_info fsi_info = {
122 .porta_flags = SH_FSI_OUT_SLAVE_MODE |
123 SH_FSI_IN_SLAVE_MODE |
124 SH_FSI_OFMT(I2S) |
125 SH_FSI_IFMT(I2S),
126};
127
128static struct resource fsi_resources[] = { 122static struct resource fsi_resources[] = {
129 [0] = { 123 [0] = {
130 .name = "FSI", 124 .name = "FSI",
@@ -143,9 +137,6 @@ static struct platform_device fsi_device = {
143 .id = -1, 137 .id = -1,
144 .num_resources = ARRAY_SIZE(fsi_resources), 138 .num_resources = ARRAY_SIZE(fsi_resources),
145 .resource = fsi_resources, 139 .resource = fsi_resources,
146 .dev = {
147 .platform_data = &fsi_info,
148 },
149}; 140};
150 141
151static struct resource sh_mmcif_resources[] = { 142static struct resource sh_mmcif_resources[] = {
@@ -183,11 +174,165 @@ static struct platform_device mmc_device = {
183 .resource = sh_mmcif_resources, 174 .resource = sh_mmcif_resources,
184}; 175};
185 176
177/* IrDA */
178static struct resource irda_resources[] = {
179 [0] = {
180 .start = 0xE6D00000,
181 .end = 0xE6D01FD4 - 1,
182 .flags = IORESOURCE_MEM,
183 },
184 [1] = {
185 .start = gic_spi(95),
186 .flags = IORESOURCE_IRQ,
187 },
188};
189
190static struct platform_device irda_device = {
191 .name = "sh_irda",
192 .id = 0,
193 .resource = irda_resources,
194 .num_resources = ARRAY_SIZE(irda_resources),
195};
196
197static unsigned char lcd_backlight_seq[3][2] = {
198 { 0x04, 0x07 },
199 { 0x23, 0x80 },
200 { 0x03, 0x01 },
201};
202
203static void lcd_backlight_on(void)
204{
205 struct i2c_adapter *a;
206 struct i2c_msg msg;
207 int k;
208
209 a = i2c_get_adapter(1);
210 for (k = 0; a && k < 3; k++) {
211 msg.addr = 0x6d;
212 msg.buf = &lcd_backlight_seq[k][0];
213 msg.len = 2;
214 msg.flags = 0;
215 if (i2c_transfer(a, &msg, 1) != 1)
216 break;
217 }
218}
219
220static void lcd_backlight_reset(void)
221{
222 gpio_set_value(GPIO_PORT235, 0);
223 mdelay(24);
224 gpio_set_value(GPIO_PORT235, 1);
225}
226
227static void lcd_on(void *board_data, struct fb_info *info)
228{
229 lcd_backlight_on();
230}
231
232static void lcd_off(void *board_data)
233{
234 lcd_backlight_reset();
235}
236
237/* LCDC0 */
238static const struct fb_videomode lcdc0_modes[] = {
239 {
240 .name = "R63302(QHD)",
241 .xres = 544,
242 .yres = 961,
243 .left_margin = 72,
244 .right_margin = 600,
245 .hsync_len = 16,
246 .upper_margin = 8,
247 .lower_margin = 8,
248 .vsync_len = 2,
249 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
250 },
251};
252
253static struct sh_mobile_lcdc_info lcdc0_info = {
254 .clock_source = LCDC_CLK_PERIPHERAL,
255 .ch[0] = {
256 .chan = LCDC_CHAN_MAINLCD,
257 .interface_type = RGB24,
258 .clock_divider = 1,
259 .flags = LCDC_FLAGS_DWPOL,
260 .lcd_size_cfg.width = 44,
261 .lcd_size_cfg.height = 79,
262 .bpp = 16,
263 .lcd_cfg = lcdc0_modes,
264 .num_cfg = ARRAY_SIZE(lcdc0_modes),
265 .board_cfg = {
266 .display_on = lcd_on,
267 .display_off = lcd_off,
268 },
269 }
270};
271
272static struct resource lcdc0_resources[] = {
273 [0] = {
274 .name = "LCDC0",
275 .start = 0xfe940000, /* P4-only space */
276 .end = 0xfe943fff,
277 .flags = IORESOURCE_MEM,
278 },
279 [1] = {
280 .start = intcs_evt2irq(0x580),
281 .flags = IORESOURCE_IRQ,
282 },
283};
284
285static struct platform_device lcdc0_device = {
286 .name = "sh_mobile_lcdc_fb",
287 .num_resources = ARRAY_SIZE(lcdc0_resources),
288 .resource = lcdc0_resources,
289 .id = 0,
290 .dev = {
291 .platform_data = &lcdc0_info,
292 .coherent_dma_mask = ~0,
293 },
294};
295
296/* MIPI-DSI */
297static struct resource mipidsi0_resources[] = {
298 [0] = {
299 .start = 0xfeab0000,
300 .end = 0xfeab3fff,
301 .flags = IORESOURCE_MEM,
302 },
303 [1] = {
304 .start = 0xfeab4000,
305 .end = 0xfeab7fff,
306 .flags = IORESOURCE_MEM,
307 },
308};
309
310static struct sh_mipi_dsi_info mipidsi0_info = {
311 .data_format = MIPI_RGB888,
312 .lcd_chan = &lcdc0_info.ch[0],
313 .vsynw_offset = 20,
314 .clksrc = 1,
315 .flags = SH_MIPI_DSI_HSABM,
316};
317
318static struct platform_device mipidsi0_device = {
319 .name = "sh-mipi-dsi",
320 .num_resources = ARRAY_SIZE(mipidsi0_resources),
321 .resource = mipidsi0_resources,
322 .id = 0,
323 .dev = {
324 .platform_data = &mipidsi0_info,
325 },
326};
327
186static struct platform_device *ag5evm_devices[] __initdata = { 328static struct platform_device *ag5evm_devices[] __initdata = {
187 &eth_device, 329 &eth_device,
188 &keysc_device, 330 &keysc_device,
189 &fsi_device, 331 &fsi_device,
190 &mmc_device, 332 &mmc_device,
333 &irda_device,
334 &lcdc0_device,
335 &mipidsi0_device,
191}; 336};
192 337
193static struct map_desc ag5evm_io_desc[] __initdata = { 338static struct map_desc ag5evm_io_desc[] __initdata = {
@@ -224,6 +369,8 @@ void __init ag5evm_init_irq(void)
224 __raw_writew(__raw_readw(PINTCR0A) | (2<<10), PINTCR0A); 369 __raw_writew(__raw_readw(PINTCR0A) | (2<<10), PINTCR0A);
225} 370}
226 371
372#define DSI0PHYCR 0xe615006c
373
227static void __init ag5evm_init(void) 374static void __init ag5evm_init(void)
228{ 375{
229 sh73a0_pinmux_init(); 376 sh73a0_pinmux_init();
@@ -287,6 +434,26 @@ static void __init ag5evm_init(void)
287 gpio_request(GPIO_FN_FSIAISLD, NULL); 434 gpio_request(GPIO_FN_FSIAISLD, NULL);
288 gpio_request(GPIO_FN_FSIAOSLD, NULL); 435 gpio_request(GPIO_FN_FSIAOSLD, NULL);
289 436
437 /* IrDA */
438 gpio_request(GPIO_FN_PORT241_IRDA_OUT, NULL);
439 gpio_request(GPIO_FN_PORT242_IRDA_IN, NULL);
440 gpio_request(GPIO_FN_PORT243_IRDA_FIRSEL, NULL);
441
442 /* LCD panel */
443 gpio_request(GPIO_PORT217, NULL); /* RESET */
444 gpio_direction_output(GPIO_PORT217, 0);
445 mdelay(1);
446 gpio_set_value(GPIO_PORT217, 1);
447 mdelay(100);
448
449 /* LCD backlight controller */
450 gpio_request(GPIO_PORT235, NULL); /* RESET */
451 gpio_direction_output(GPIO_PORT235, 0);
452 lcd_backlight_reset();
453
454 /* MIPI-DSI clock setup */
455 __raw_writel(0x2a809010, DSI0PHYCR);
456
290#ifdef CONFIG_CACHE_L2X0 457#ifdef CONFIG_CACHE_L2X0
291 /* Shared attribute override enable, 64K*8way */ 458 /* Shared attribute override enable, 64K*8way */
292 l2x0_init(__io(0xf0100000), 0x00460000, 0xc2000fff); 459 l2x0_init(__io(0xf0100000), 0x00460000, 0xc2000fff);
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index 3cf0951caa2d..a94f29da5d30 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -673,16 +673,12 @@ static int fsi_set_rate(struct device *dev, int is_porta, int rate, int enable)
673} 673}
674 674
675static struct sh_fsi_platform_info fsi_info = { 675static struct sh_fsi_platform_info fsi_info = {
676 .porta_flags = SH_FSI_BRS_INV | 676 .porta_flags = SH_FSI_BRS_INV,
677 SH_FSI_OUT_SLAVE_MODE |
678 SH_FSI_IN_SLAVE_MODE |
679 SH_FSI_OFMT(PCM) |
680 SH_FSI_IFMT(PCM),
681 677
682 .portb_flags = SH_FSI_BRS_INV | 678 .portb_flags = SH_FSI_BRS_INV |
683 SH_FSI_BRM_INV | 679 SH_FSI_BRM_INV |
684 SH_FSI_LRS_INV | 680 SH_FSI_LRS_INV |
685 SH_FSI_OFMT(SPDIF), 681 SH_FSI_FMT_SPDIF,
686 .set_rate = fsi_set_rate, 682 .set_rate = fsi_set_rate,
687}; 683};
688 684
@@ -783,6 +779,10 @@ static struct platform_device hdmi_device = {
783 }, 779 },
784}; 780};
785 781
782static struct platform_device fsi_hdmi_device = {
783 .name = "sh_fsi2_b_hdmi",
784};
785
786static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq, 786static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq,
787 unsigned long *parent_freq) 787 unsigned long *parent_freq)
788{ 788{
@@ -923,7 +923,8 @@ static struct platform_device ceu_device = {
923 .num_resources = ARRAY_SIZE(ceu_resources), 923 .num_resources = ARRAY_SIZE(ceu_resources),
924 .resource = ceu_resources, 924 .resource = ceu_resources,
925 .dev = { 925 .dev = {
926 .platform_data = &sh_mobile_ceu_info, 926 .platform_data = &sh_mobile_ceu_info,
927 .coherent_dma_mask = 0xffffffff,
927 }, 928 },
928}; 929};
929 930
@@ -936,6 +937,7 @@ static struct platform_device *ap4evb_devices[] __initdata = {
936 &usb1_host_device, 937 &usb1_host_device,
937 &fsi_device, 938 &fsi_device,
938 &fsi_ak4643_device, 939 &fsi_ak4643_device,
940 &fsi_hdmi_device,
939 &sh_mmcif_device, 941 &sh_mmcif_device,
940 &lcdc1_device, 942 &lcdc1_device,
941 &lcdc_device, 943 &lcdc_device,
@@ -1303,7 +1305,7 @@ static void __init ap4evb_init(void)
1303 1305
1304 lcdc_info.clock_source = LCDC_CLK_BUS; 1306 lcdc_info.clock_source = LCDC_CLK_BUS;
1305 lcdc_info.ch[0].interface_type = RGB18; 1307 lcdc_info.ch[0].interface_type = RGB18;
1306 lcdc_info.ch[0].clock_divider = 2; 1308 lcdc_info.ch[0].clock_divider = 3;
1307 lcdc_info.ch[0].flags = 0; 1309 lcdc_info.ch[0].flags = 0;
1308 lcdc_info.ch[0].lcd_size_cfg.width = 152; 1310 lcdc_info.ch[0].lcd_size_cfg.width = 152;
1309 lcdc_info.ch[0].lcd_size_cfg.height = 91; 1311 lcdc_info.ch[0].lcd_size_cfg.height = 91;
diff --git a/arch/arm/mach-shmobile/board-g3evm.c b/arch/arm/mach-shmobile/board-g3evm.c
index 686b304a7708..ef4613b993a2 100644
--- a/arch/arm/mach-shmobile/board-g3evm.c
+++ b/arch/arm/mach-shmobile/board-g3evm.c
@@ -347,7 +347,6 @@ static void __init g3evm_init(void)
347 gpio_request(GPIO_FN_IRDA_OUT, NULL); 347 gpio_request(GPIO_FN_IRDA_OUT, NULL);
348 gpio_request(GPIO_FN_IRDA_IN, NULL); 348 gpio_request(GPIO_FN_IRDA_IN, NULL);
349 gpio_request(GPIO_FN_IRDA_FIRSEL, NULL); 349 gpio_request(GPIO_FN_IRDA_FIRSEL, NULL);
350 set_irq_type(evt2irq(0x480), IRQ_TYPE_LEVEL_LOW);
351 350
352 sh7367_add_standard_devices(); 351 sh7367_add_standard_devices();
353 352
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 7b15d21f0f68..49bc07482179 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -169,9 +169,8 @@
169 * SW1 | SW33 169 * SW1 | SW33
170 * | bit1 | bit2 | bit3 | bit4 170 * | bit1 | bit2 | bit3 | bit4
171 * -------------+------+------+------+------- 171 * -------------+------+------+------+-------
172 * MMC0 OFF | OFF | ON | ON | X 172 * MMC0 OFF | OFF | X | ON | X (Use MMCIF)
173 * MMC1 ON | OFF | ON | X | ON 173 * SDHI1 OFF | ON | X | OFF | X (Use MFD_SH_MOBILE_SDHI)
174 * SDHI1 OFF | ON | X | OFF | ON
175 * 174 *
176 */ 175 */
177 176
@@ -296,6 +295,18 @@ static struct fb_videomode mackerel_lcdc_modes[] = {
296 }, 295 },
297}; 296};
298 297
298static int mackerel_set_brightness(void *board_data, int brightness)
299{
300 gpio_set_value(GPIO_PORT31, brightness);
301
302 return 0;
303}
304
305static int mackerel_get_brightness(void *board_data)
306{
307 return gpio_get_value(GPIO_PORT31);
308}
309
299static struct sh_mobile_lcdc_info lcdc_info = { 310static struct sh_mobile_lcdc_info lcdc_info = {
300 .clock_source = LCDC_CLK_BUS, 311 .clock_source = LCDC_CLK_BUS,
301 .ch[0] = { 312 .ch[0] = {
@@ -304,10 +315,18 @@ static struct sh_mobile_lcdc_info lcdc_info = {
304 .lcd_cfg = mackerel_lcdc_modes, 315 .lcd_cfg = mackerel_lcdc_modes,
305 .num_cfg = ARRAY_SIZE(mackerel_lcdc_modes), 316 .num_cfg = ARRAY_SIZE(mackerel_lcdc_modes),
306 .interface_type = RGB24, 317 .interface_type = RGB24,
307 .clock_divider = 2, 318 .clock_divider = 3,
308 .flags = 0, 319 .flags = 0,
309 .lcd_size_cfg.width = 152, 320 .lcd_size_cfg.width = 152,
310 .lcd_size_cfg.height = 91, 321 .lcd_size_cfg.height = 91,
322 .board_cfg = {
323 .set_brightness = mackerel_set_brightness,
324 .get_brightness = mackerel_get_brightness,
325 },
326 .bl_info = {
327 .name = "sh_mobile_lcdc_bl",
328 .max_brightness = 1,
329 },
311 } 330 }
312}; 331};
313 332
@@ -400,6 +419,10 @@ static struct platform_device hdmi_device = {
400 }, 419 },
401}; 420};
402 421
422static struct platform_device fsi_hdmi_device = {
423 .name = "sh_fsi2_b_hdmi",
424};
425
403static int __init hdmi_init_pm_clock(void) 426static int __init hdmi_init_pm_clock(void)
404{ 427{
405 struct clk *hdmi_ick = clk_get(&hdmi_device.dev, "ick"); 428 struct clk *hdmi_ick = clk_get(&hdmi_device.dev, "ick");
@@ -610,16 +633,12 @@ fsi_set_rate_end:
610} 633}
611 634
612static struct sh_fsi_platform_info fsi_info = { 635static struct sh_fsi_platform_info fsi_info = {
613 .porta_flags = SH_FSI_BRS_INV | 636 .porta_flags = SH_FSI_BRS_INV,
614 SH_FSI_OUT_SLAVE_MODE |
615 SH_FSI_IN_SLAVE_MODE |
616 SH_FSI_OFMT(PCM) |
617 SH_FSI_IFMT(PCM),
618 637
619 .portb_flags = SH_FSI_BRS_INV | 638 .portb_flags = SH_FSI_BRS_INV |
620 SH_FSI_BRM_INV | 639 SH_FSI_BRM_INV |
621 SH_FSI_LRS_INV | 640 SH_FSI_LRS_INV |
622 SH_FSI_OFMT(SPDIF), 641 SH_FSI_FMT_SPDIF,
623 642
624 .set_rate = fsi_set_rate, 643 .set_rate = fsi_set_rate,
625}; 644};
@@ -902,7 +921,8 @@ static struct platform_device ceu_device = {
902 .num_resources = ARRAY_SIZE(ceu_resources), 921 .num_resources = ARRAY_SIZE(ceu_resources),
903 .resource = ceu_resources, 922 .resource = ceu_resources,
904 .dev = { 923 .dev = {
905 .platform_data = &sh_mobile_ceu_info, 924 .platform_data = &sh_mobile_ceu_info,
925 .coherent_dma_mask = 0xffffffff,
906 }, 926 },
907}; 927};
908 928
@@ -922,6 +942,7 @@ static struct platform_device *mackerel_devices[] __initdata = {
922 &leds_device, 942 &leds_device,
923 &fsi_device, 943 &fsi_device,
924 &fsi_ak4643_device, 944 &fsi_ak4643_device,
945 &fsi_hdmi_device,
925 &sdhi0_device, 946 &sdhi0_device,
926#if !defined(CONFIG_MMC_SH_MMCIF) 947#if !defined(CONFIG_MMC_SH_MMCIF)
927 &sdhi1_device, 948 &sdhi1_device,
@@ -1059,7 +1080,7 @@ static void __init mackerel_init(void)
1059 gpio_request(GPIO_FN_LCDDCK, NULL); 1080 gpio_request(GPIO_FN_LCDDCK, NULL);
1060 1081
1061 gpio_request(GPIO_PORT31, NULL); /* backlight */ 1082 gpio_request(GPIO_PORT31, NULL); /* backlight */
1062 gpio_direction_output(GPIO_PORT31, 1); 1083 gpio_direction_output(GPIO_PORT31, 0); /* off by default */
1063 1084
1064 gpio_request(GPIO_PORT151, NULL); /* LCDDON */ 1085 gpio_request(GPIO_PORT151, NULL); /* LCDDON */
1065 gpio_direction_output(GPIO_PORT151, 1); 1086 gpio_direction_output(GPIO_PORT151, 1);
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
index 9aa8d68d1a9c..e9731b5a73ed 100644
--- a/arch/arm/mach-shmobile/clock-sh7372.c
+++ b/arch/arm/mach-shmobile/clock-sh7372.c
@@ -234,7 +234,9 @@ static int pllc2_set_rate(struct clk *clk, unsigned long rate)
234 234
235 value = __raw_readl(PLLC2CR) & ~(0x3f << 24); 235 value = __raw_readl(PLLC2CR) & ~(0x3f << 24);
236 236
237 __raw_writel((value & ~0x80000000) | ((idx + 19) << 24), PLLC2CR); 237 __raw_writel(value | ((idx + 19) << 24), PLLC2CR);
238
239 clk->rate = clk->freq_table[idx].frequency;
238 240
239 return 0; 241 return 0;
240} 242}
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
index 720a71433be6..7e58904c1c8c 100644
--- a/arch/arm/mach-shmobile/clock-sh73a0.c
+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
@@ -118,8 +118,16 @@ static unsigned long pll_recalc(struct clk *clk)
118{ 118{
119 unsigned long mult = 1; 119 unsigned long mult = 1;
120 120
121 if (__raw_readl(PLLECR) & (1 << clk->enable_bit)) 121 if (__raw_readl(PLLECR) & (1 << clk->enable_bit)) {
122 mult = (((__raw_readl(clk->enable_reg) >> 24) & 0x3f) + 1); 122 mult = (((__raw_readl(clk->enable_reg) >> 24) & 0x3f) + 1);
123 /* handle CFG bit for PLL1 and PLL2 */
124 switch (clk->enable_bit) {
125 case 1:
126 case 2:
127 if (__raw_readl(clk->enable_reg) & (1 << 20))
128 mult *= 2;
129 }
130 }
123 131
124 return clk->parent->rate * mult; 132 return clk->parent->rate * mult;
125} 133}
@@ -212,7 +220,7 @@ enum { DIV4_I, DIV4_ZG, DIV4_M3, DIV4_B, DIV4_M1, DIV4_M2,
212static struct clk div4_clks[DIV4_NR] = { 220static struct clk div4_clks[DIV4_NR] = {
213 [DIV4_I] = DIV4(FRQCRA, 20, 0xfff, CLK_ENABLE_ON_INIT), 221 [DIV4_I] = DIV4(FRQCRA, 20, 0xfff, CLK_ENABLE_ON_INIT),
214 [DIV4_ZG] = DIV4(FRQCRA, 16, 0xbff, CLK_ENABLE_ON_INIT), 222 [DIV4_ZG] = DIV4(FRQCRA, 16, 0xbff, CLK_ENABLE_ON_INIT),
215 [DIV4_M3] = DIV4(FRQCRA, 8, 0xfff, CLK_ENABLE_ON_INIT), 223 [DIV4_M3] = DIV4(FRQCRA, 12, 0xfff, CLK_ENABLE_ON_INIT),
216 [DIV4_B] = DIV4(FRQCRA, 8, 0xfff, CLK_ENABLE_ON_INIT), 224 [DIV4_B] = DIV4(FRQCRA, 8, 0xfff, CLK_ENABLE_ON_INIT),
217 [DIV4_M1] = DIV4(FRQCRA, 4, 0xfff, 0), 225 [DIV4_M1] = DIV4(FRQCRA, 4, 0xfff, 0),
218 [DIV4_M2] = DIV4(FRQCRA, 0, 0xfff, 0), 226 [DIV4_M2] = DIV4(FRQCRA, 0, 0xfff, 0),
@@ -255,10 +263,10 @@ static struct clk div6_clks[DIV6_NR] = {
255}; 263};
256 264
257enum { MSTP001, 265enum { MSTP001,
258 MSTP125, MSTP116, 266 MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100,
259 MSTP219, 267 MSTP219,
260 MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, 268 MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
261 MSTP331, MSTP329, MSTP323, MSTP312, 269 MSTP331, MSTP329, MSTP325, MSTP323, MSTP312,
262 MSTP411, MSTP410, MSTP403, 270 MSTP411, MSTP410, MSTP403,
263 MSTP_NR }; 271 MSTP_NR };
264 272
@@ -267,8 +275,14 @@ enum { MSTP001,
267 275
268static struct clk mstp_clks[MSTP_NR] = { 276static struct clk mstp_clks[MSTP_NR] = {
269 [MSTP001] = MSTP(&div4_clks[DIV4_HP], SMSTPCR0, 1, 0), /* IIC2 */ 277 [MSTP001] = MSTP(&div4_clks[DIV4_HP], SMSTPCR0, 1, 0), /* IIC2 */
278 [MSTP129] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 29, 0), /* CEU1 */
279 [MSTP128] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 28, 0), /* CSI2-RX1 */
280 [MSTP127] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 27, 0), /* CEU0 */
281 [MSTP126] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 26, 0), /* CSI2-RX0 */
270 [MSTP125] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR1, 25, 0), /* TMU0 */ 282 [MSTP125] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR1, 25, 0), /* TMU0 */
283 [MSTP118] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 18, 0), /* DSITX0 */
271 [MSTP116] = MSTP(&div4_clks[DIV4_HP], SMSTPCR1, 16, 0), /* IIC0 */ 284 [MSTP116] = MSTP(&div4_clks[DIV4_HP], SMSTPCR1, 16, 0), /* IIC0 */
285 [MSTP100] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 0, 0), /* LCDC0 */
272 [MSTP219] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 19, 0), /* SCIFA7 */ 286 [MSTP219] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 19, 0), /* SCIFA7 */
273 [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ 287 [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */
274 [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */ 288 [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */
@@ -279,6 +293,7 @@ static struct clk mstp_clks[MSTP_NR] = {
279 [MSTP200] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */ 293 [MSTP200] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */
280 [MSTP331] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 31, 0), /* SCIFA6 */ 294 [MSTP331] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 31, 0), /* SCIFA6 */
281 [MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */ 295 [MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */
296 [MSTP325] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 25, 0), /* IrDA */
282 [MSTP323] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 23, 0), /* IIC1 */ 297 [MSTP323] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 23, 0), /* IIC1 */
283 [MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMCIF0 */ 298 [MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMCIF0 */
284 [MSTP411] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 11, 0), /* IIC3 */ 299 [MSTP411] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 11, 0), /* IIC3 */
@@ -288,16 +303,32 @@ static struct clk mstp_clks[MSTP_NR] = {
288 303
289#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk } 304#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
290#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk } 305#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
306#define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk }
291 307
292static struct clk_lookup lookups[] = { 308static struct clk_lookup lookups[] = {
293 /* main clocks */ 309 /* main clocks */
294 CLKDEV_CON_ID("r_clk", &r_clk), 310 CLKDEV_CON_ID("r_clk", &r_clk),
295 311
312 /* DIV6 clocks */
313 CLKDEV_CON_ID("vck1_clk", &div6_clks[DIV6_VCK1]),
314 CLKDEV_CON_ID("vck2_clk", &div6_clks[DIV6_VCK2]),
315 CLKDEV_CON_ID("vck3_clk", &div6_clks[DIV6_VCK3]),
316 CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSIT]),
317 CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]),
318 CLKDEV_ICK_ID("dsi0p_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]),
319 CLKDEV_ICK_ID("dsi1p_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]),
320
296 /* MSTP32 clocks */ 321 /* MSTP32 clocks */
297 CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */ 322 CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */
323 CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[MSTP129]), /* CEU1 */
324 CLKDEV_DEV_ID("sh-mobile-csi2.1", &mstp_clks[MSTP128]), /* CSI2-RX1 */
325 CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), /* CEU0 */
326 CLKDEV_DEV_ID("sh-mobile-csi2.0", &mstp_clks[MSTP126]), /* CSI2-RX0 */
298 CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]), /* TMU00 */ 327 CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]), /* TMU00 */
299 CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP125]), /* TMU01 */ 328 CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP125]), /* TMU01 */
329 CLKDEV_DEV_ID("sh-mipi-dsi.0", &mstp_clks[MSTP118]), /* DSITX */
300 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */ 330 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */
331 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */
301 CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */ 332 CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */
302 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ 333 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */
303 CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), /* SCIFB */ 334 CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), /* SCIFB */
@@ -308,6 +339,7 @@ static struct clk_lookup lookups[] = {
308 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */ 339 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */
309 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */ 340 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */
310 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */ 341 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */
342 CLKDEV_DEV_ID("sh_irda.0", &mstp_clks[MSTP325]), /* IrDA */
311 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */ 343 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */
312 CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMCIF0 */ 344 CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMCIF0 */
313 CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* I2C3 */ 345 CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* I2C3 */
diff --git a/arch/arm/mach-shmobile/include/mach/head-ap4evb.txt b/arch/arm/mach-shmobile/include/mach/head-ap4evb.txt
index efd3687ba190..3029aba38688 100644
--- a/arch/arm/mach-shmobile/include/mach/head-ap4evb.txt
+++ b/arch/arm/mach-shmobile/include/mach/head-ap4evb.txt
@@ -6,13 +6,10 @@ LIST "RWT Setting"
6EW 0xE6020004, 0xA500 6EW 0xE6020004, 0xA500
7EW 0xE6030004, 0xA500 7EW 0xE6030004, 0xA500
8 8
9DD 0x01001000, 0x01001000
10
11LIST "GPIO Setting" 9LIST "GPIO Setting"
12EB 0xE6051013, 0xA2 10EB 0xE6051013, 0xA2
13 11
14LIST "CPG" 12LIST "CPG"
15ED 0xE6150080, 0x00000180
16ED 0xE61500C0, 0x00000002 13ED 0xE61500C0, 0x00000002
17 14
18WAIT 1, 0xFE40009C 15WAIT 1, 0xFE40009C
@@ -37,6 +34,9 @@ ED 0xE615002C, 0x93000040
37 34
38WAIT 1, 0xFE40009C 35WAIT 1, 0xFE40009C
39 36
37LIST "SUB/USBClk"
38ED 0xE6150080, 0x00000180
39
40LIST "BSC" 40LIST "BSC"
41ED 0xFEC10000, 0x00E0001B 41ED 0xFEC10000, 0x00E0001B
42 42
@@ -53,7 +53,7 @@ ED 0xFE400048, 0x20C18505
53ED 0xFE40004C, 0x00110209 53ED 0xFE40004C, 0x00110209
54ED 0xFE400010, 0x00000087 54ED 0xFE400010, 0x00000087
55 55
56WAIT 10, 0xFE40009C 56WAIT 30, 0xFE40009C
57 57
58ED 0xFE400084, 0x0000003F 58ED 0xFE400084, 0x0000003F
59EB 0xFE500000, 0x00 59EB 0xFE500000, 0x00
@@ -84,7 +84,7 @@ ED 0xE6150004, 0x80331050
84 84
85WAIT 1, 0xFE40009C 85WAIT 1, 0xFE40009C
86 86
87ED 0xE6150354, 0x00000002 87ED 0xFE400354, 0x01AD8002
88 88
89LIST "SCIF0 - Serial port for earlyprintk" 89LIST "SCIF0 - Serial port for earlyprintk"
90EB 0xE6053098, 0x11 90EB 0xE6053098, 0x11
diff --git a/arch/arm/mach-shmobile/include/mach/head-mackerel.txt b/arch/arm/mach-shmobile/include/mach/head-mackerel.txt
index efd3687ba190..3029aba38688 100644
--- a/arch/arm/mach-shmobile/include/mach/head-mackerel.txt
+++ b/arch/arm/mach-shmobile/include/mach/head-mackerel.txt
@@ -6,13 +6,10 @@ LIST "RWT Setting"
6EW 0xE6020004, 0xA500 6EW 0xE6020004, 0xA500
7EW 0xE6030004, 0xA500 7EW 0xE6030004, 0xA500
8 8
9DD 0x01001000, 0x01001000
10
11LIST "GPIO Setting" 9LIST "GPIO Setting"
12EB 0xE6051013, 0xA2 10EB 0xE6051013, 0xA2
13 11
14LIST "CPG" 12LIST "CPG"
15ED 0xE6150080, 0x00000180
16ED 0xE61500C0, 0x00000002 13ED 0xE61500C0, 0x00000002
17 14
18WAIT 1, 0xFE40009C 15WAIT 1, 0xFE40009C
@@ -37,6 +34,9 @@ ED 0xE615002C, 0x93000040
37 34
38WAIT 1, 0xFE40009C 35WAIT 1, 0xFE40009C
39 36
37LIST "SUB/USBClk"
38ED 0xE6150080, 0x00000180
39
40LIST "BSC" 40LIST "BSC"
41ED 0xFEC10000, 0x00E0001B 41ED 0xFEC10000, 0x00E0001B
42 42
@@ -53,7 +53,7 @@ ED 0xFE400048, 0x20C18505
53ED 0xFE40004C, 0x00110209 53ED 0xFE40004C, 0x00110209
54ED 0xFE400010, 0x00000087 54ED 0xFE400010, 0x00000087
55 55
56WAIT 10, 0xFE40009C 56WAIT 30, 0xFE40009C
57 57
58ED 0xFE400084, 0x0000003F 58ED 0xFE400084, 0x0000003F
59EB 0xFE500000, 0x00 59EB 0xFE500000, 0x00
@@ -84,7 +84,7 @@ ED 0xE6150004, 0x80331050
84 84
85WAIT 1, 0xFE40009C 85WAIT 1, 0xFE40009C
86 86
87ED 0xE6150354, 0x00000002 87ED 0xFE400354, 0x01AD8002
88 88
89LIST "SCIF0 - Serial port for earlyprintk" 89LIST "SCIF0 - Serial port for earlyprintk"
90EB 0xE6053098, 0x11 90EB 0xE6053098, 0x11
diff --git a/arch/arm/mach-shmobile/include/mach/memory.h b/arch/arm/mach-shmobile/include/mach/memory.h
index 377584e57e03..ad00c3c258f4 100644
--- a/arch/arm/mach-shmobile/include/mach/memory.h
+++ b/arch/arm/mach-shmobile/include/mach/memory.h
@@ -1,7 +1,7 @@
1#ifndef __ASM_MACH_MEMORY_H 1#ifndef __ASM_MACH_MEMORY_H
2#define __ASM_MACH_MEMORY_H 2#define __ASM_MACH_MEMORY_H
3 3
4#define PHYS_OFFSET UL(CONFIG_MEMORY_START) 4#define PLAT_PHYS_OFFSET UL(CONFIG_MEMORY_START)
5#define MEM_SIZE UL(CONFIG_MEMORY_SIZE) 5#define MEM_SIZE UL(CONFIG_MEMORY_SIZE)
6 6
7/* DMA memory at 0xf6000000 - 0xffdfffff */ 7/* DMA memory at 0xf6000000 - 0xffdfffff */
diff --git a/arch/arm/mach-shmobile/include/mach/mmc-ap4eb.h b/arch/arm/mach-shmobile/include/mach/mmc-ap4eb.h
new file mode 100644
index 000000000000..db59fdbda860
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/mmc-ap4eb.h
@@ -0,0 +1,29 @@
1#ifndef MMC_AP4EB_H
2#define MMC_AP4EB_H
3
4#define PORT185CR (void __iomem *)0xe60520b9
5#define PORT186CR (void __iomem *)0xe60520ba
6#define PORT187CR (void __iomem *)0xe60520bb
7#define PORT188CR (void __iomem *)0xe60520bc
8
9#define PORTR191_160DR (void __iomem *)0xe6056014
10
11static inline void mmc_init_progress(void)
12{
13 /* Initialise LEDS1-4
14 * registers: PORT185CR-PORT188CR (LED1-LED4 Control)
15 * value: 0x10 - enable output
16 */
17 __raw_writeb(0x10, PORT185CR);
18 __raw_writeb(0x10, PORT186CR);
19 __raw_writeb(0x10, PORT187CR);
20 __raw_writeb(0x10, PORT188CR);
21}
22
23static inline void mmc_update_progress(int n)
24{
25 __raw_writel((__raw_readl(PORTR191_160DR) & ~(0xf << 25)) |
26 (1 << (25 + n)), PORTR191_160DR);
27}
28
29#endif /* MMC_AP4EB_H */
diff --git a/arch/arm/mach-shmobile/include/mach/mmc-mackerel.h b/arch/arm/mach-shmobile/include/mach/mmc-mackerel.h
new file mode 100644
index 000000000000..15d3a9efdec2
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/mmc-mackerel.h
@@ -0,0 +1,38 @@
1#ifndef MMC_MACKEREL_H
2#define MMC_MACKEREL_H
3
4#define PORT0CR (void __iomem *)0xe6051000
5#define PORT1CR (void __iomem *)0xe6051001
6#define PORT2CR (void __iomem *)0xe6051002
7#define PORT159CR (void __iomem *)0xe605009f
8
9#define PORTR031_000DR (void __iomem *)0xe6055000
10#define PORTL159_128DR (void __iomem *)0xe6054010
11
12static inline void mmc_init_progress(void)
13{
14 /* Initialise LEDS0-3
15 * registers: PORT0CR-PORT2CR,PORT159CR (LED0-LED3 Control)
16 * value: 0x10 - enable output
17 */
18 __raw_writeb(0x10, PORT0CR);
19 __raw_writeb(0x10, PORT1CR);
20 __raw_writeb(0x10, PORT2CR);
21 __raw_writeb(0x10, PORT159CR);
22}
23
24static inline void mmc_update_progress(int n)
25{
26 unsigned a = 0, b = 0;
27
28 if (n < 3)
29 a = 1 << n;
30 else
31 b = 1 << 31;
32
33 __raw_writel((__raw_readl(PORTR031_000DR) & ~0x7) | a,
34 PORTR031_000DR);
35 __raw_writel((__raw_readl(PORTL159_128DR) & ~(1 << 31)) | b,
36 PORTL159_128DR);
37}
38#endif /* MMC_MACKEREL_H */
diff --git a/arch/arm/mach-shmobile/include/mach/mmc.h b/arch/arm/mach-shmobile/include/mach/mmc.h
new file mode 100644
index 000000000000..e11560a525a1
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/mmc.h
@@ -0,0 +1,18 @@
1#ifndef MMC_H
2#define MMC_H
3
4/**************************************************
5 *
6 * board specific settings
7 *
8 **************************************************/
9
10#ifdef CONFIG_MACH_AP4EVB
11#include "mach/mmc-ap4eb.h"
12#elif CONFIG_MACH_MACKEREL
13#include "mach/mmc-mackerel.h"
14#else
15#error "unsupported board."
16#endif
17
18#endif /* MMC_H */
diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c
index f78a1ead71a5..ca5f9d17b39a 100644
--- a/arch/arm/mach-shmobile/intc-sh7372.c
+++ b/arch/arm/mach-shmobile/intc-sh7372.c
@@ -365,6 +365,7 @@ static struct intc_desc intca_desc __initdata = {
365 365
366enum { 366enum {
367 UNUSED_INTCS = 0, 367 UNUSED_INTCS = 0,
368 ENABLED_INTCS,
368 369
369 INTCS, 370 INTCS,
370 371
@@ -413,7 +414,7 @@ enum {
413 CMT4, 414 CMT4,
414 DSITX1_DSITX1_0, 415 DSITX1_DSITX1_0,
415 DSITX1_DSITX1_1, 416 DSITX1_DSITX1_1,
416 /* MFIS2 */ 417 MFIS2_INTCS, /* Priority always enabled using ENABLED_INTCS */
417 CPORTS2R, 418 CPORTS2R,
418 /* CEC */ 419 /* CEC */
419 JPU6E, 420 JPU6E,
@@ -477,7 +478,7 @@ static struct intc_vect intcs_vectors[] = {
477 INTCS_VECT(CMT4, 0x1980), 478 INTCS_VECT(CMT4, 0x1980),
478 INTCS_VECT(DSITX1_DSITX1_0, 0x19a0), 479 INTCS_VECT(DSITX1_DSITX1_0, 0x19a0),
479 INTCS_VECT(DSITX1_DSITX1_1, 0x19c0), 480 INTCS_VECT(DSITX1_DSITX1_1, 0x19c0),
480 /* MFIS2 */ 481 INTCS_VECT(MFIS2_INTCS, 0x1a00),
481 INTCS_VECT(CPORTS2R, 0x1a20), 482 INTCS_VECT(CPORTS2R, 0x1a20),
482 /* CEC */ 483 /* CEC */
483 INTCS_VECT(JPU6E, 0x1a80), 484 INTCS_VECT(JPU6E, 0x1a80),
@@ -543,7 +544,7 @@ static struct intc_mask_reg intcs_mask_registers[] = {
543 { 0, TMU1_TUNI2, TMU1_TUNI1, TMU1_TUNI0, 544 { 0, TMU1_TUNI2, TMU1_TUNI1, TMU1_TUNI0,
544 CMT4, DSITX1_DSITX1_0, DSITX1_DSITX1_1, 0 } }, 545 CMT4, DSITX1_DSITX1_0, DSITX1_DSITX1_1, 0 } },
545 { 0xffd5019c, 0xffd501dc, 8, /* IMR7SA3 / IMCR7SA3 */ 546 { 0xffd5019c, 0xffd501dc, 8, /* IMR7SA3 / IMCR7SA3 */
546 { 0, CPORTS2R, 0, 0, 547 { MFIS2_INTCS, CPORTS2R, 0, 0,
547 JPU6E, 0, 0, 0 } }, 548 JPU6E, 0, 0, 0 } },
548 { 0xffd20104, 0, 16, /* INTAMASK */ 549 { 0xffd20104, 0, 16, /* INTAMASK */
549 { 0, 0, 0, 0, 0, 0, 0, 0, 550 { 0, 0, 0, 0, 0, 0, 0, 0,
@@ -571,7 +572,8 @@ static struct intc_prio_reg intcs_prio_registers[] = {
571 { 0xffd50030, 0, 16, 4, /* IPRMS3 */ { TMU1, 0, 0, 0 } }, 572 { 0xffd50030, 0, 16, 4, /* IPRMS3 */ { TMU1, 0, 0, 0 } },
572 { 0xffd50034, 0, 16, 4, /* IPRNS3 */ { CMT4, DSITX1_DSITX1_0, 573 { 0xffd50034, 0, 16, 4, /* IPRNS3 */ { CMT4, DSITX1_DSITX1_0,
573 DSITX1_DSITX1_1, 0 } }, 574 DSITX1_DSITX1_1, 0 } },
574 { 0xffd50038, 0, 16, 4, /* IPROS3 */ { 0, CPORTS2R, 0, 0 } }, 575 { 0xffd50038, 0, 16, 4, /* IPROS3 */ { ENABLED_INTCS, CPORTS2R,
576 0, 0 } },
575 { 0xffd5003c, 0, 16, 4, /* IPRPS3 */ { JPU6E, 0, 0, 0 } }, 577 { 0xffd5003c, 0, 16, 4, /* IPRPS3 */ { JPU6E, 0, 0, 0 } },
576}; 578};
577 579
@@ -590,6 +592,7 @@ static struct resource intcs_resources[] __initdata = {
590 592
591static struct intc_desc intcs_desc __initdata = { 593static struct intc_desc intcs_desc __initdata = {
592 .name = "sh7372-intcs", 594 .name = "sh7372-intcs",
595 .force_enable = ENABLED_INTCS,
593 .resource = intcs_resources, 596 .resource = intcs_resources,
594 .num_resources = ARRAY_SIZE(intcs_resources), 597 .num_resources = ARRAY_SIZE(intcs_resources),
595 .hw = INTC_HW_DESC(intcs_vectors, intcs_groups, intcs_mask_registers, 598 .hw = INTC_HW_DESC(intcs_vectors, intcs_groups, intcs_mask_registers,
diff --git a/arch/arm/mach-shmobile/intc-sh73a0.c b/arch/arm/mach-shmobile/intc-sh73a0.c
index 322d8d57cbcf..5d0e1503ece6 100644
--- a/arch/arm/mach-shmobile/intc-sh73a0.c
+++ b/arch/arm/mach-shmobile/intc-sh73a0.c
@@ -252,10 +252,11 @@ static irqreturn_t sh73a0_intcs_demux(int irq, void *dev_id)
252 252
253void __init sh73a0_init_irq(void) 253void __init sh73a0_init_irq(void)
254{ 254{
255 void __iomem *gic_base = __io(0xf0001000); 255 void __iomem *gic_dist_base = __io(0xf0001000);
256 void __iomem *gic_cpu_base = __io(0xf0000100);
256 void __iomem *intevtsa = ioremap_nocache(0xffd20100, PAGE_SIZE); 257 void __iomem *intevtsa = ioremap_nocache(0xffd20100, PAGE_SIZE);
257 258
258 gic_init(0, 29, gic_base, gic_base); 259 gic_init(0, 29, gic_dist_base, gic_cpu_base);
259 260
260 register_intc_controller(&intcs_desc); 261 register_intc_controller(&intcs_desc);
261 262
diff --git a/arch/arm/mach-shmobile/localtimer.c b/arch/arm/mach-shmobile/localtimer.c
index 2111c28b724e..ad9ccc9900c8 100644
--- a/arch/arm/mach-shmobile/localtimer.c
+++ b/arch/arm/mach-shmobile/localtimer.c
@@ -18,8 +18,9 @@
18/* 18/*
19 * Setup the local clock events for a CPU. 19 * Setup the local clock events for a CPU.
20 */ 20 */
21void __cpuinit local_timer_setup(struct clock_event_device *evt) 21int __cpuinit local_timer_setup(struct clock_event_device *evt)
22{ 22{
23 evt->irq = 29; 23 evt->irq = 29;
24 twd_timer_setup(evt); 24 twd_timer_setup(evt);
25 return 0;
25} 26}
diff --git a/arch/arm/mach-spear3xx/clock.c b/arch/arm/mach-spear3xx/clock.c
index 18febf92f20a..98bc7edc95a6 100644
--- a/arch/arm/mach-spear3xx/clock.c
+++ b/arch/arm/mach-spear3xx/clock.c
@@ -13,8 +13,8 @@
13 13
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <mach/misc_regs.h>
17#include <plat/clock.h> 16#include <plat/clock.h>
17#include <mach/misc_regs.h>
18 18
19/* root clks */ 19/* root clks */
20/* 32 KHz oscillator clock */ 20/* 32 KHz oscillator clock */
@@ -39,18 +39,43 @@ static struct clk rtc_clk = {
39}; 39};
40 40
41/* clock derived from 24 MHz osc clk */ 41/* clock derived from 24 MHz osc clk */
42/* pll masks structure */
43static struct pll_clk_masks pll1_masks = {
44 .mode_mask = PLL_MODE_MASK,
45 .mode_shift = PLL_MODE_SHIFT,
46 .norm_fdbk_m_mask = PLL_NORM_FDBK_M_MASK,
47 .norm_fdbk_m_shift = PLL_NORM_FDBK_M_SHIFT,
48 .dith_fdbk_m_mask = PLL_DITH_FDBK_M_MASK,
49 .dith_fdbk_m_shift = PLL_DITH_FDBK_M_SHIFT,
50 .div_p_mask = PLL_DIV_P_MASK,
51 .div_p_shift = PLL_DIV_P_SHIFT,
52 .div_n_mask = PLL_DIV_N_MASK,
53 .div_n_shift = PLL_DIV_N_SHIFT,
54};
55
42/* pll1 configuration structure */ 56/* pll1 configuration structure */
43static struct pll_clk_config pll1_config = { 57static struct pll_clk_config pll1_config = {
44 .mode_reg = PLL1_CTR, 58 .mode_reg = PLL1_CTR,
45 .cfg_reg = PLL1_FRQ, 59 .cfg_reg = PLL1_FRQ,
60 .masks = &pll1_masks,
61};
62
63/* pll rate configuration table, in ascending order of rates */
64struct pll_rate_tbl pll_rtbl[] = {
65 {.mode = 0, .m = 0x85, .n = 0x0C, .p = 0x1}, /* 266 MHz */
66 {.mode = 0, .m = 0xA6, .n = 0x0C, .p = 0x1}, /* 332 MHz */
46}; 67};
47 68
48/* PLL1 clock */ 69/* PLL1 clock */
49static struct clk pll1_clk = { 70static struct clk pll1_clk = {
71 .flags = ENABLED_ON_INIT,
50 .pclk = &osc_24m_clk, 72 .pclk = &osc_24m_clk,
51 .en_reg = PLL1_CTR, 73 .en_reg = PLL1_CTR,
52 .en_reg_bit = PLL_ENABLE, 74 .en_reg_bit = PLL_ENABLE,
53 .recalc = &pll1_clk_recalc, 75 .calc_rate = &pll_calc_rate,
76 .recalc = &pll_clk_recalc,
77 .set_rate = &pll_clk_set_rate,
78 .rate_config = {pll_rtbl, ARRAY_SIZE(pll_rtbl), 1},
54 .private_data = &pll1_config, 79 .private_data = &pll1_config,
55}; 80};
56 81
@@ -76,36 +101,83 @@ static struct clk cpu_clk = {
76 .recalc = &follow_parent, 101 .recalc = &follow_parent,
77}; 102};
78 103
104/* ahb masks structure */
105static struct bus_clk_masks ahb_masks = {
106 .mask = PLL_HCLK_RATIO_MASK,
107 .shift = PLL_HCLK_RATIO_SHIFT,
108};
109
79/* ahb configuration structure */ 110/* ahb configuration structure */
80static struct bus_clk_config ahb_config = { 111static struct bus_clk_config ahb_config = {
81 .reg = CORE_CLK_CFG, 112 .reg = CORE_CLK_CFG,
82 .mask = PLL_HCLK_RATIO_MASK, 113 .masks = &ahb_masks,
83 .shift = PLL_HCLK_RATIO_SHIFT, 114};
115
116/* ahb rate configuration table, in ascending order of rates */
117struct bus_rate_tbl bus_rtbl[] = {
118 {.div = 3}, /* == parent divided by 4 */
119 {.div = 2}, /* == parent divided by 3 */
120 {.div = 1}, /* == parent divided by 2 */
121 {.div = 0}, /* == parent divided by 1 */
84}; 122};
85 123
86/* ahb clock */ 124/* ahb clock */
87static struct clk ahb_clk = { 125static struct clk ahb_clk = {
88 .flags = ALWAYS_ENABLED, 126 .flags = ALWAYS_ENABLED,
89 .pclk = &pll1_clk, 127 .pclk = &pll1_clk,
128 .calc_rate = &bus_calc_rate,
90 .recalc = &bus_clk_recalc, 129 .recalc = &bus_clk_recalc,
130 .set_rate = &bus_clk_set_rate,
131 .rate_config = {bus_rtbl, ARRAY_SIZE(bus_rtbl), 2},
91 .private_data = &ahb_config, 132 .private_data = &ahb_config,
92}; 133};
93 134
94/* uart configurations */ 135/* auxiliary synthesizers masks */
95static struct aux_clk_config uart_config = { 136static struct aux_clk_masks aux_masks = {
137 .eq_sel_mask = AUX_EQ_SEL_MASK,
138 .eq_sel_shift = AUX_EQ_SEL_SHIFT,
139 .eq1_mask = AUX_EQ1_SEL,
140 .eq2_mask = AUX_EQ2_SEL,
141 .xscale_sel_mask = AUX_XSCALE_MASK,
142 .xscale_sel_shift = AUX_XSCALE_SHIFT,
143 .yscale_sel_mask = AUX_YSCALE_MASK,
144 .yscale_sel_shift = AUX_YSCALE_SHIFT,
145};
146
147/* uart synth configurations */
148static struct aux_clk_config uart_synth_config = {
96 .synth_reg = UART_CLK_SYNT, 149 .synth_reg = UART_CLK_SYNT,
150 .masks = &aux_masks,
151};
152
153/* aux rate configuration table, in ascending order of rates */
154struct aux_rate_tbl aux_rtbl[] = {
155 /* For PLL1 = 332 MHz */
156 {.xscale = 1, .yscale = 8, .eq = 1}, /* 41.5 MHz */
157 {.xscale = 1, .yscale = 4, .eq = 1}, /* 83 MHz */
158 {.xscale = 1, .yscale = 2, .eq = 1}, /* 166 MHz */
159};
160
161/* uart synth clock */
162static struct clk uart_synth_clk = {
163 .en_reg = UART_CLK_SYNT,
164 .en_reg_bit = AUX_SYNT_ENB,
165 .pclk = &pll1_clk,
166 .calc_rate = &aux_calc_rate,
167 .recalc = &aux_clk_recalc,
168 .set_rate = &aux_clk_set_rate,
169 .rate_config = {aux_rtbl, ARRAY_SIZE(aux_rtbl), 1},
170 .private_data = &uart_synth_config,
97}; 171};
98 172
99/* uart parents */ 173/* uart parents */
100static struct pclk_info uart_pclk_info[] = { 174static struct pclk_info uart_pclk_info[] = {
101 { 175 {
102 .pclk = &pll1_clk, 176 .pclk = &uart_synth_clk,
103 .pclk_mask = AUX_CLK_PLL1_MASK, 177 .pclk_val = AUX_CLK_PLL1_VAL,
104 .scalable = 1,
105 }, { 178 }, {
106 .pclk = &pll3_48m_clk, 179 .pclk = &pll3_48m_clk,
107 .pclk_mask = AUX_CLK_PLL3_MASK, 180 .pclk_val = AUX_CLK_PLL3_VAL,
108 .scalable = 0,
109 }, 181 },
110}; 182};
111 183
@@ -123,25 +195,35 @@ static struct clk uart_clk = {
123 .en_reg_bit = UART_CLK_ENB, 195 .en_reg_bit = UART_CLK_ENB,
124 .pclk_sel = &uart_pclk_sel, 196 .pclk_sel = &uart_pclk_sel,
125 .pclk_sel_shift = UART_CLK_SHIFT, 197 .pclk_sel_shift = UART_CLK_SHIFT,
126 .recalc = &aux_clk_recalc, 198 .recalc = &follow_parent,
127 .private_data = &uart_config,
128}; 199};
129 200
130/* firda configurations */ 201/* firda configurations */
131static struct aux_clk_config firda_config = { 202static struct aux_clk_config firda_synth_config = {
132 .synth_reg = FIRDA_CLK_SYNT, 203 .synth_reg = FIRDA_CLK_SYNT,
204 .masks = &aux_masks,
205};
206
207/* firda synth clock */
208static struct clk firda_synth_clk = {
209 .en_reg = FIRDA_CLK_SYNT,
210 .en_reg_bit = AUX_SYNT_ENB,
211 .pclk = &pll1_clk,
212 .calc_rate = &aux_calc_rate,
213 .recalc = &aux_clk_recalc,
214 .set_rate = &aux_clk_set_rate,
215 .rate_config = {aux_rtbl, ARRAY_SIZE(aux_rtbl), 1},
216 .private_data = &firda_synth_config,
133}; 217};
134 218
135/* firda parents */ 219/* firda parents */
136static struct pclk_info firda_pclk_info[] = { 220static struct pclk_info firda_pclk_info[] = {
137 { 221 {
138 .pclk = &pll1_clk, 222 .pclk = &firda_synth_clk,
139 .pclk_mask = AUX_CLK_PLL1_MASK, 223 .pclk_val = AUX_CLK_PLL1_VAL,
140 .scalable = 1,
141 }, { 224 }, {
142 .pclk = &pll3_48m_clk, 225 .pclk = &pll3_48m_clk,
143 .pclk_mask = AUX_CLK_PLL3_MASK, 226 .pclk_val = AUX_CLK_PLL3_VAL,
144 .scalable = 0,
145 }, 227 },
146}; 228};
147 229
@@ -159,73 +241,155 @@ static struct clk firda_clk = {
159 .en_reg_bit = FIRDA_CLK_ENB, 241 .en_reg_bit = FIRDA_CLK_ENB,
160 .pclk_sel = &firda_pclk_sel, 242 .pclk_sel = &firda_pclk_sel,
161 .pclk_sel_shift = FIRDA_CLK_SHIFT, 243 .pclk_sel_shift = FIRDA_CLK_SHIFT,
162 .recalc = &aux_clk_recalc, 244 .recalc = &follow_parent,
163 .private_data = &firda_config, 245};
246
247/* gpt synthesizer masks */
248static struct gpt_clk_masks gpt_masks = {
249 .mscale_sel_mask = GPT_MSCALE_MASK,
250 .mscale_sel_shift = GPT_MSCALE_SHIFT,
251 .nscale_sel_mask = GPT_NSCALE_MASK,
252 .nscale_sel_shift = GPT_NSCALE_SHIFT,
253};
254
255/* gpt rate configuration table, in ascending order of rates */
256struct gpt_rate_tbl gpt_rtbl[] = {
257 /* For pll1 = 332 MHz */
258 {.mscale = 4, .nscale = 0}, /* 41.5 MHz */
259 {.mscale = 2, .nscale = 0}, /* 55.3 MHz */
260 {.mscale = 1, .nscale = 0}, /* 83 MHz */
261};
262
263/* gpt0 synth clk config*/
264static struct gpt_clk_config gpt0_synth_config = {
265 .synth_reg = PRSC1_CLK_CFG,
266 .masks = &gpt_masks,
267};
268
269/* gpt synth clock */
270static struct clk gpt0_synth_clk = {
271 .flags = ALWAYS_ENABLED,
272 .pclk = &pll1_clk,
273 .calc_rate = &gpt_calc_rate,
274 .recalc = &gpt_clk_recalc,
275 .set_rate = &gpt_clk_set_rate,
276 .rate_config = {gpt_rtbl, ARRAY_SIZE(gpt_rtbl), 2},
277 .private_data = &gpt0_synth_config,
164}; 278};
165 279
166/* gpt parents */ 280/* gpt parents */
167static struct pclk_info gpt_pclk_info[] = { 281static struct pclk_info gpt0_pclk_info[] = {
168 { 282 {
169 .pclk = &pll1_clk, 283 .pclk = &gpt0_synth_clk,
170 .pclk_mask = AUX_CLK_PLL1_MASK, 284 .pclk_val = AUX_CLK_PLL1_VAL,
171 .scalable = 1,
172 }, { 285 }, {
173 .pclk = &pll3_48m_clk, 286 .pclk = &pll3_48m_clk,
174 .pclk_mask = AUX_CLK_PLL3_MASK, 287 .pclk_val = AUX_CLK_PLL3_VAL,
175 .scalable = 0,
176 }, 288 },
177}; 289};
178 290
179/* gpt parent select structure */ 291/* gpt parent select structure */
180static struct pclk_sel gpt_pclk_sel = { 292static struct pclk_sel gpt0_pclk_sel = {
181 .pclk_info = gpt_pclk_info, 293 .pclk_info = gpt0_pclk_info,
182 .pclk_count = ARRAY_SIZE(gpt_pclk_info), 294 .pclk_count = ARRAY_SIZE(gpt0_pclk_info),
183 .pclk_sel_reg = PERIP_CLK_CFG, 295 .pclk_sel_reg = PERIP_CLK_CFG,
184 .pclk_sel_mask = GPT_CLK_MASK, 296 .pclk_sel_mask = GPT_CLK_MASK,
185}; 297};
186 298
187/* gpt0 configurations */
188static struct aux_clk_config gpt0_config = {
189 .synth_reg = PRSC1_CLK_CFG,
190};
191
192/* gpt0 timer clock */ 299/* gpt0 timer clock */
193static struct clk gpt0_clk = { 300static struct clk gpt0_clk = {
194 .flags = ALWAYS_ENABLED, 301 .flags = ALWAYS_ENABLED,
195 .pclk_sel = &gpt_pclk_sel, 302 .pclk_sel = &gpt0_pclk_sel,
196 .pclk_sel_shift = GPT0_CLK_SHIFT, 303 .pclk_sel_shift = GPT0_CLK_SHIFT,
197 .recalc = &gpt_clk_recalc, 304 .recalc = &follow_parent,
198 .private_data = &gpt0_config,
199}; 305};
200 306
201/* gpt1 configurations */ 307/* gpt1 synth clk configurations */
202static struct aux_clk_config gpt1_config = { 308static struct gpt_clk_config gpt1_synth_config = {
203 .synth_reg = PRSC2_CLK_CFG, 309 .synth_reg = PRSC2_CLK_CFG,
310 .masks = &gpt_masks,
311};
312
313/* gpt1 synth clock */
314static struct clk gpt1_synth_clk = {
315 .flags = ALWAYS_ENABLED,
316 .pclk = &pll1_clk,
317 .calc_rate = &gpt_calc_rate,
318 .recalc = &gpt_clk_recalc,
319 .set_rate = &gpt_clk_set_rate,
320 .rate_config = {gpt_rtbl, ARRAY_SIZE(gpt_rtbl), 2},
321 .private_data = &gpt1_synth_config,
322};
323
324static struct pclk_info gpt1_pclk_info[] = {
325 {
326 .pclk = &gpt1_synth_clk,
327 .pclk_val = AUX_CLK_PLL1_VAL,
328 }, {
329 .pclk = &pll3_48m_clk,
330 .pclk_val = AUX_CLK_PLL3_VAL,
331 },
332};
333
334/* gpt parent select structure */
335static struct pclk_sel gpt1_pclk_sel = {
336 .pclk_info = gpt1_pclk_info,
337 .pclk_count = ARRAY_SIZE(gpt1_pclk_info),
338 .pclk_sel_reg = PERIP_CLK_CFG,
339 .pclk_sel_mask = GPT_CLK_MASK,
204}; 340};
205 341
206/* gpt1 timer clock */ 342/* gpt1 timer clock */
207static struct clk gpt1_clk = { 343static struct clk gpt1_clk = {
208 .en_reg = PERIP1_CLK_ENB, 344 .en_reg = PERIP1_CLK_ENB,
209 .en_reg_bit = GPT1_CLK_ENB, 345 .en_reg_bit = GPT1_CLK_ENB,
210 .pclk_sel = &gpt_pclk_sel, 346 .pclk_sel = &gpt1_pclk_sel,
211 .pclk_sel_shift = GPT1_CLK_SHIFT, 347 .pclk_sel_shift = GPT1_CLK_SHIFT,
212 .recalc = &gpt_clk_recalc, 348 .recalc = &follow_parent,
213 .private_data = &gpt1_config,
214}; 349};
215 350
216/* gpt2 configurations */ 351/* gpt2 synth clk configurations */
217static struct aux_clk_config gpt2_config = { 352static struct gpt_clk_config gpt2_synth_config = {
218 .synth_reg = PRSC3_CLK_CFG, 353 .synth_reg = PRSC3_CLK_CFG,
354 .masks = &gpt_masks,
355};
356
357/* gpt1 synth clock */
358static struct clk gpt2_synth_clk = {
359 .flags = ALWAYS_ENABLED,
360 .pclk = &pll1_clk,
361 .calc_rate = &gpt_calc_rate,
362 .recalc = &gpt_clk_recalc,
363 .set_rate = &gpt_clk_set_rate,
364 .rate_config = {gpt_rtbl, ARRAY_SIZE(gpt_rtbl), 2},
365 .private_data = &gpt2_synth_config,
366};
367
368static struct pclk_info gpt2_pclk_info[] = {
369 {
370 .pclk = &gpt2_synth_clk,
371 .pclk_val = AUX_CLK_PLL1_VAL,
372 }, {
373 .pclk = &pll3_48m_clk,
374 .pclk_val = AUX_CLK_PLL3_VAL,
375 },
376};
377
378/* gpt parent select structure */
379static struct pclk_sel gpt2_pclk_sel = {
380 .pclk_info = gpt2_pclk_info,
381 .pclk_count = ARRAY_SIZE(gpt2_pclk_info),
382 .pclk_sel_reg = PERIP_CLK_CFG,
383 .pclk_sel_mask = GPT_CLK_MASK,
219}; 384};
220 385
221/* gpt2 timer clock */ 386/* gpt2 timer clock */
222static struct clk gpt2_clk = { 387static struct clk gpt2_clk = {
223 .en_reg = PERIP1_CLK_ENB, 388 .en_reg = PERIP1_CLK_ENB,
224 .en_reg_bit = GPT2_CLK_ENB, 389 .en_reg_bit = GPT2_CLK_ENB,
225 .pclk_sel = &gpt_pclk_sel, 390 .pclk_sel = &gpt2_pclk_sel,
226 .pclk_sel_shift = GPT2_CLK_SHIFT, 391 .pclk_sel_shift = GPT2_CLK_SHIFT,
227 .recalc = &gpt_clk_recalc, 392 .recalc = &follow_parent,
228 .private_data = &gpt2_config,
229}; 393};
230 394
231/* clock derived from pll3 clk */ 395/* clock derived from pll3 clk */
@@ -245,26 +409,27 @@ static struct clk usbd_clk = {
245 .recalc = &follow_parent, 409 .recalc = &follow_parent,
246}; 410};
247 411
248/* clcd clock */ 412/* clock derived from ahb clk */
249static struct clk clcd_clk = { 413/* apb masks structure */
250 .flags = ALWAYS_ENABLED, 414static struct bus_clk_masks apb_masks = {
251 .pclk = &pll3_48m_clk, 415 .mask = HCLK_PCLK_RATIO_MASK,
252 .recalc = &follow_parent, 416 .shift = HCLK_PCLK_RATIO_SHIFT,
253}; 417};
254 418
255/* clock derived from ahb clk */
256/* apb configuration structure */ 419/* apb configuration structure */
257static struct bus_clk_config apb_config = { 420static struct bus_clk_config apb_config = {
258 .reg = CORE_CLK_CFG, 421 .reg = CORE_CLK_CFG,
259 .mask = HCLK_PCLK_RATIO_MASK, 422 .masks = &apb_masks,
260 .shift = HCLK_PCLK_RATIO_SHIFT,
261}; 423};
262 424
263/* apb clock */ 425/* apb clock */
264static struct clk apb_clk = { 426static struct clk apb_clk = {
265 .flags = ALWAYS_ENABLED, 427 .flags = ALWAYS_ENABLED,
266 .pclk = &ahb_clk, 428 .pclk = &ahb_clk,
429 .calc_rate = &bus_calc_rate,
267 .recalc = &bus_clk_recalc, 430 .recalc = &bus_clk_recalc,
431 .set_rate = &bus_clk_set_rate,
432 .rate_config = {bus_rtbl, ARRAY_SIZE(bus_rtbl), 2},
268 .private_data = &apb_config, 433 .private_data = &apb_config,
269}; 434};
270 435
@@ -325,8 +490,17 @@ static struct clk adc_clk = {
325 .recalc = &follow_parent, 490 .recalc = &follow_parent,
326}; 491};
327 492
493#if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320)
494/* emi clock */
495static struct clk emi_clk = {
496 .flags = ALWAYS_ENABLED,
497 .pclk = &ahb_clk,
498 .recalc = &follow_parent,
499};
500#endif
501
328/* ssp clock */ 502/* ssp clock */
329static struct clk ssp_clk = { 503static struct clk ssp0_clk = {
330 .pclk = &apb_clk, 504 .pclk = &apb_clk,
331 .en_reg = PERIP1_CLK_ENB, 505 .en_reg = PERIP1_CLK_ENB,
332 .en_reg_bit = SSP_CLK_ENB, 506 .en_reg_bit = SSP_CLK_ENB,
@@ -343,14 +517,145 @@ static struct clk gpio_clk = {
343 517
344static struct clk dummy_apb_pclk; 518static struct clk dummy_apb_pclk;
345 519
520#if defined(CONFIG_MACH_SPEAR300) || defined(CONFIG_MACH_SPEAR310) || \
521 defined(CONFIG_MACH_SPEAR320)
522/* fsmc clock */
523static struct clk fsmc_clk = {
524 .flags = ALWAYS_ENABLED,
525 .pclk = &ahb_clk,
526 .recalc = &follow_parent,
527};
528#endif
529
530/* common clocks to spear310 and spear320 */
531#if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320)
532/* uart1 clock */
533static struct clk uart1_clk = {
534 .flags = ALWAYS_ENABLED,
535 .pclk = &apb_clk,
536 .recalc = &follow_parent,
537};
538
539/* uart2 clock */
540static struct clk uart2_clk = {
541 .flags = ALWAYS_ENABLED,
542 .pclk = &apb_clk,
543 .recalc = &follow_parent,
544};
545#endif /* CONFIG_MACH_SPEAR310 || CONFIG_MACH_SPEAR320 */
546
547/* common clocks to spear300 and spear320 */
548#if defined(CONFIG_MACH_SPEAR300) || defined(CONFIG_MACH_SPEAR320)
549/* clcd clock */
550static struct clk clcd_clk = {
551 .flags = ALWAYS_ENABLED,
552 .pclk = &pll3_48m_clk,
553 .recalc = &follow_parent,
554};
555
556/* sdhci clock */
557static struct clk sdhci_clk = {
558 .flags = ALWAYS_ENABLED,
559 .pclk = &ahb_clk,
560 .recalc = &follow_parent,
561};
562#endif /* CONFIG_MACH_SPEAR300 || CONFIG_MACH_SPEAR320 */
563
564/* spear300 machine specific clock structures */
565#ifdef CONFIG_MACH_SPEAR300
566/* gpio1 clock */
567static struct clk gpio1_clk = {
568 .flags = ALWAYS_ENABLED,
569 .pclk = &apb_clk,
570 .recalc = &follow_parent,
571};
572
573/* keyboard clock */
574static struct clk kbd_clk = {
575 .flags = ALWAYS_ENABLED,
576 .pclk = &apb_clk,
577 .recalc = &follow_parent,
578};
579
580#endif
581
582/* spear310 machine specific clock structures */
583#ifdef CONFIG_MACH_SPEAR310
584/* uart3 clock */
585static struct clk uart3_clk = {
586 .flags = ALWAYS_ENABLED,
587 .pclk = &apb_clk,
588 .recalc = &follow_parent,
589};
590
591/* uart4 clock */
592static struct clk uart4_clk = {
593 .flags = ALWAYS_ENABLED,
594 .pclk = &apb_clk,
595 .recalc = &follow_parent,
596};
597
598/* uart5 clock */
599static struct clk uart5_clk = {
600 .flags = ALWAYS_ENABLED,
601 .pclk = &apb_clk,
602 .recalc = &follow_parent,
603};
604#endif
605
606/* spear320 machine specific clock structures */
607#ifdef CONFIG_MACH_SPEAR320
608/* can0 clock */
609static struct clk can0_clk = {
610 .flags = ALWAYS_ENABLED,
611 .pclk = &apb_clk,
612 .recalc = &follow_parent,
613};
614
615/* can1 clock */
616static struct clk can1_clk = {
617 .flags = ALWAYS_ENABLED,
618 .pclk = &apb_clk,
619 .recalc = &follow_parent,
620};
621
622/* i2c1 clock */
623static struct clk i2c1_clk = {
624 .flags = ALWAYS_ENABLED,
625 .pclk = &ahb_clk,
626 .recalc = &follow_parent,
627};
628
629/* ssp1 clock */
630static struct clk ssp1_clk = {
631 .flags = ALWAYS_ENABLED,
632 .pclk = &apb_clk,
633 .recalc = &follow_parent,
634};
635
636/* ssp2 clock */
637static struct clk ssp2_clk = {
638 .flags = ALWAYS_ENABLED,
639 .pclk = &apb_clk,
640 .recalc = &follow_parent,
641};
642
643/* pwm clock */
644static struct clk pwm_clk = {
645 .flags = ALWAYS_ENABLED,
646 .pclk = &apb_clk,
647 .recalc = &follow_parent,
648};
649#endif
650
346/* array of all spear 3xx clock lookups */ 651/* array of all spear 3xx clock lookups */
347static struct clk_lookup spear_clk_lookups[] = { 652static struct clk_lookup spear_clk_lookups[] = {
348 { .con_id = "apb_pclk", .clk = &dummy_apb_pclk}, 653 { .con_id = "apb_pclk", .clk = &dummy_apb_pclk},
349 /* root clks */ 654 /* root clks */
350 { .con_id = "osc_32k_clk", .clk = &osc_32k_clk}, 655 { .con_id = "osc_32k_clk", .clk = &osc_32k_clk},
351 { .con_id = "osc_24m_clk", .clk = &osc_24m_clk}, 656 { .con_id = "osc_24m_clk", .clk = &osc_24m_clk},
352 /* clock derived from 32 KHz osc clk */ 657 /* clock derived from 32 KHz osc clk */
353 { .dev_id = "rtc", .clk = &rtc_clk}, 658 { .dev_id = "rtc-spear", .clk = &rtc_clk},
354 /* clock derived from 24 MHz osc clk */ 659 /* clock derived from 24 MHz osc clk */
355 { .con_id = "pll1_clk", .clk = &pll1_clk}, 660 { .con_id = "pll1_clk", .clk = &pll1_clk},
356 { .con_id = "pll3_48m_clk", .clk = &pll3_48m_clk}, 661 { .con_id = "pll3_48m_clk", .clk = &pll3_48m_clk},
@@ -358,18 +663,22 @@ static struct clk_lookup spear_clk_lookups[] = {
358 /* clock derived from pll1 clk */ 663 /* clock derived from pll1 clk */
359 { .con_id = "cpu_clk", .clk = &cpu_clk}, 664 { .con_id = "cpu_clk", .clk = &cpu_clk},
360 { .con_id = "ahb_clk", .clk = &ahb_clk}, 665 { .con_id = "ahb_clk", .clk = &ahb_clk},
666 { .con_id = "uart_synth_clk", .clk = &uart_synth_clk},
667 { .con_id = "firda_synth_clk", .clk = &firda_synth_clk},
668 { .con_id = "gpt0_synth_clk", .clk = &gpt0_synth_clk},
669 { .con_id = "gpt1_synth_clk", .clk = &gpt1_synth_clk},
670 { .con_id = "gpt2_synth_clk", .clk = &gpt2_synth_clk},
361 { .dev_id = "uart", .clk = &uart_clk}, 671 { .dev_id = "uart", .clk = &uart_clk},
362 { .dev_id = "firda", .clk = &firda_clk}, 672 { .dev_id = "firda", .clk = &firda_clk},
363 { .dev_id = "gpt0", .clk = &gpt0_clk}, 673 { .dev_id = "gpt0", .clk = &gpt0_clk},
364 { .dev_id = "gpt1", .clk = &gpt1_clk}, 674 { .dev_id = "gpt1", .clk = &gpt1_clk},
365 { .dev_id = "gpt2", .clk = &gpt2_clk}, 675 { .dev_id = "gpt2", .clk = &gpt2_clk},
366 /* clock derived from pll3 clk */ 676 /* clock derived from pll3 clk */
367 { .dev_id = "usbh", .clk = &usbh_clk}, 677 { .dev_id = "designware_udc", .clk = &usbd_clk},
368 { .dev_id = "usbd", .clk = &usbd_clk}, 678 { .con_id = "usbh_clk", .clk = &usbh_clk},
369 { .dev_id = "clcd", .clk = &clcd_clk},
370 /* clock derived from ahb clk */ 679 /* clock derived from ahb clk */
371 { .con_id = "apb_clk", .clk = &apb_clk}, 680 { .con_id = "apb_clk", .clk = &apb_clk},
372 { .dev_id = "i2c", .clk = &i2c_clk}, 681 { .dev_id = "i2c_designware.0", .clk = &i2c_clk},
373 { .dev_id = "dma", .clk = &dma_clk}, 682 { .dev_id = "dma", .clk = &dma_clk},
374 { .dev_id = "jpeg", .clk = &jpeg_clk}, 683 { .dev_id = "jpeg", .clk = &jpeg_clk},
375 { .dev_id = "gmac", .clk = &gmac_clk}, 684 { .dev_id = "gmac", .clk = &gmac_clk},
@@ -377,8 +686,50 @@ static struct clk_lookup spear_clk_lookups[] = {
377 { .dev_id = "c3", .clk = &c3_clk}, 686 { .dev_id = "c3", .clk = &c3_clk},
378 /* clock derived from apb clk */ 687 /* clock derived from apb clk */
379 { .dev_id = "adc", .clk = &adc_clk}, 688 { .dev_id = "adc", .clk = &adc_clk},
380 { .dev_id = "ssp", .clk = &ssp_clk}, 689 { .dev_id = "ssp-pl022.0", .clk = &ssp0_clk},
381 { .dev_id = "gpio", .clk = &gpio_clk}, 690 { .dev_id = "gpio", .clk = &gpio_clk},
691#if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320)
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
711 /* spear300 machine specific clock structures */
712#ifdef CONFIG_MACH_SPEAR300
713 { .dev_id = "gpio1", .clk = &gpio1_clk},
714 { .dev_id = "keyboard", .clk = &kbd_clk},
715#endif
716
717 /* spear310 machine specific clock structures */
718#ifdef CONFIG_MACH_SPEAR310
719 { .dev_id = "uart3", .clk = &uart3_clk},
720 { .dev_id = "uart4", .clk = &uart4_clk},
721 { .dev_id = "uart5", .clk = &uart5_clk},
722
723#endif
724 /* spear320 machine specific clock structures */
725#ifdef CONFIG_MACH_SPEAR320
726 { .dev_id = "c_can_platform.0", .clk = &can0_clk},
727 { .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},
730 { .dev_id = "ssp-pl022.2", .clk = &ssp2_clk},
731 { .dev_id = "pwm", .clk = &pwm_clk},
732#endif
382}; 733};
383 734
384void __init clk_init(void) 735void __init clk_init(void)
diff --git a/arch/arm/mach-spear3xx/include/mach/entry-macro.S b/arch/arm/mach-spear3xx/include/mach/entry-macro.S
index 947625d6b48d..53da4224ba3d 100644
--- a/arch/arm/mach-spear3xx/include/mach/entry-macro.S
+++ b/arch/arm/mach-spear3xx/include/mach/entry-macro.S
@@ -11,9 +11,8 @@
11 * warranty of any kind, whether express or implied. 11 * warranty of any kind, whether express or implied.
12 */ 12 */
13 13
14#include <mach/hardware.h>
15#include <mach/spear.h>
16#include <asm/hardware/vic.h> 14#include <asm/hardware/vic.h>
15#include <mach/hardware.h>
17 16
18 .macro disable_fiq 17 .macro disable_fiq
19 .endm 18 .endm
diff --git a/arch/arm/mach-spear3xx/include/mach/generic.h b/arch/arm/mach-spear3xx/include/mach/generic.h
index af7e02c909a3..8e30636909ef 100644
--- a/arch/arm/mach-spear3xx/include/mach/generic.h
+++ b/arch/arm/mach-spear3xx/include/mach/generic.h
@@ -14,11 +14,11 @@
14#ifndef __MACH_GENERIC_H 14#ifndef __MACH_GENERIC_H
15#define __MACH_GENERIC_H 15#define __MACH_GENERIC_H
16 16
17#include <asm/mach/time.h>
18#include <asm/mach/map.h>
19#include <linux/init.h> 17#include <linux/init.h>
20#include <linux/platform_device.h> 18#include <linux/platform_device.h>
21#include <linux/amba/bus.h> 19#include <linux/amba/bus.h>
20#include <asm/mach/time.h>
21#include <asm/mach/map.h>
22#include <plat/padmux.h> 22#include <plat/padmux.h>
23 23
24/* spear3xx declarations */ 24/* spear3xx declarations */
@@ -33,14 +33,14 @@
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 gpio_device;
35extern struct amba_device uart_device; 35extern struct amba_device uart_device;
36extern struct sys_timer spear_sys_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 clk_init(void);
40void __init spear_setup_timer(void);
40void __init spear3xx_map_io(void); 41void __init spear3xx_map_io(void);
41void __init spear3xx_init_irq(void); 42void __init spear3xx_init_irq(void);
42void __init spear3xx_init(void); 43void __init spear3xx_init(void);
43void spear_pmx_init(struct pmx_driver *pmx_driver, uint base, uint size);
44 44
45/* pad mux declarations */ 45/* pad mux declarations */
46#define PMX_FIRDA_MASK (1 << 14) 46#define PMX_FIRDA_MASK (1 << 14)
@@ -129,12 +129,10 @@ extern struct pmx_dev pmx_telecom_camera;
129extern struct pmx_dev pmx_telecom_dac; 129extern struct pmx_dev pmx_telecom_dac;
130extern struct pmx_dev pmx_telecom_i2s; 130extern struct pmx_dev pmx_telecom_i2s;
131extern struct pmx_dev pmx_telecom_boot_pins; 131extern struct pmx_dev pmx_telecom_boot_pins;
132extern struct pmx_dev pmx_telecom_sdio_4bit; 132extern struct pmx_dev pmx_telecom_sdhci_4bit;
133extern struct pmx_dev pmx_telecom_sdio_8bit; 133extern struct pmx_dev pmx_telecom_sdhci_8bit;
134extern struct pmx_dev pmx_gpio1; 134extern struct pmx_dev pmx_gpio1;
135 135
136void spear300_pmx_init(void);
137
138/* Add spear300 machine function declarations here */ 136/* Add spear300 machine function declarations here */
139void __init spear300_init(void); 137void __init spear300_init(void);
140 138
@@ -154,8 +152,6 @@ extern struct pmx_dev pmx_fsmc;
154extern struct pmx_dev pmx_rs485_0_1; 152extern struct pmx_dev pmx_rs485_0_1;
155extern struct pmx_dev pmx_tdm0; 153extern struct pmx_dev pmx_tdm0;
156 154
157void spear310_pmx_init(void);
158
159/* Add spear310 machine function declarations here */ 155/* Add spear310 machine function declarations here */
160void __init spear310_init(void); 156void __init spear310_init(void);
161 157
@@ -176,14 +172,14 @@ extern struct pmx_dev pmx_clcd;
176extern struct pmx_dev pmx_emi; 172extern struct pmx_dev pmx_emi;
177extern struct pmx_dev pmx_fsmc; 173extern struct pmx_dev pmx_fsmc;
178extern struct pmx_dev pmx_spp; 174extern struct pmx_dev pmx_spp;
179extern struct pmx_dev pmx_sdio; 175extern struct pmx_dev pmx_sdhci;
180extern struct pmx_dev pmx_i2s; 176extern struct pmx_dev pmx_i2s;
181extern struct pmx_dev pmx_uart1; 177extern struct pmx_dev pmx_uart1;
182extern struct pmx_dev pmx_uart1_modem; 178extern struct pmx_dev pmx_uart1_modem;
183extern struct pmx_dev pmx_uart2; 179extern struct pmx_dev pmx_uart2;
184extern struct pmx_dev pmx_touchscreen; 180extern struct pmx_dev pmx_touchscreen;
185extern struct pmx_dev pmx_can; 181extern struct pmx_dev pmx_can;
186extern struct pmx_dev pmx_sdio_led; 182extern struct pmx_dev pmx_sdhci_led;
187extern struct pmx_dev pmx_pwm0; 183extern struct pmx_dev pmx_pwm0;
188extern struct pmx_dev pmx_pwm1; 184extern struct pmx_dev pmx_pwm1;
189extern struct pmx_dev pmx_pwm2; 185extern struct pmx_dev pmx_pwm2;
@@ -195,8 +191,6 @@ extern struct pmx_dev pmx_smii0;
195extern struct pmx_dev pmx_smii1; 191extern struct pmx_dev pmx_smii1;
196extern struct pmx_dev pmx_i2c1; 192extern struct pmx_dev pmx_i2c1;
197 193
198void spear320_pmx_init(void);
199
200/* Add spear320 machine function declarations here */ 194/* Add spear320 machine function declarations here */
201void __init spear320_init(void); 195void __init spear320_init(void);
202 196
diff --git a/arch/arm/mach-spear3xx/include/mach/hardware.h b/arch/arm/mach-spear3xx/include/mach/hardware.h
index 4a86e6a3c444..4660c0d8ec0d 100644
--- a/arch/arm/mach-spear3xx/include/mach/hardware.h
+++ b/arch/arm/mach-spear3xx/include/mach/hardware.h
@@ -14,6 +14,9 @@
14#ifndef __MACH_HARDWARE_H 14#ifndef __MACH_HARDWARE_H
15#define __MACH_HARDWARE_H 15#define __MACH_HARDWARE_H
16 16
17#include <plat/hardware.h>
18#include <mach/spear.h>
19
17/* Vitual to physical translation of statically mapped space */ 20/* Vitual to physical translation of statically mapped space */
18#define IO_ADDRESS(x) (x | 0xF0000000) 21#define IO_ADDRESS(x) (x | 0xF0000000)
19 22
diff --git a/arch/arm/mach-spear3xx/include/mach/irqs.h b/arch/arm/mach-spear3xx/include/mach/irqs.h
index 7f940b818473..a1a7f481866d 100644
--- a/arch/arm/mach-spear3xx/include/mach/irqs.h
+++ b/arch/arm/mach-spear3xx/include/mach/irqs.h
@@ -69,7 +69,7 @@
69#define IRQ_CLCD IRQ_GEN_RAS_3 69#define IRQ_CLCD IRQ_GEN_RAS_3
70 70
71/* IRQs sharing IRQ_INTRCOMM_RAS_ARM */ 71/* IRQs sharing IRQ_INTRCOMM_RAS_ARM */
72#define IRQ_SDIO IRQ_INTRCOMM_RAS_ARM 72#define IRQ_SDHCI IRQ_INTRCOMM_RAS_ARM
73 73
74/* GPIO pins virtual irqs */ 74/* GPIO pins virtual irqs */
75#define SPEAR_GPIO_INT_BASE (VIRQ_START + 9) 75#define SPEAR_GPIO_INT_BASE (VIRQ_START + 9)
@@ -115,7 +115,7 @@
115#define VIRQ_SPP (VIRQ_START + 2) 115#define VIRQ_SPP (VIRQ_START + 2)
116 116
117/* IRQs sharing IRQ_GEN_RAS_2 */ 117/* IRQs sharing IRQ_GEN_RAS_2 */
118#define IRQ_SDIO IRQ_GEN_RAS_2 118#define IRQ_SDHCI IRQ_GEN_RAS_2
119 119
120/* IRQs sharing IRQ_GEN_RAS_3 */ 120/* IRQs sharing IRQ_GEN_RAS_3 */
121#define VIRQ_PLGPIO (VIRQ_START + 3) 121#define VIRQ_PLGPIO (VIRQ_START + 3)
diff --git a/arch/arm/mach-spear3xx/include/mach/misc_regs.h b/arch/arm/mach-spear3xx/include/mach/misc_regs.h
index 38d767a1aba0..5bd8cd8d4852 100644
--- a/arch/arm/mach-spear3xx/include/mach/misc_regs.h
+++ b/arch/arm/mach-spear3xx/include/mach/misc_regs.h
@@ -14,16 +14,16 @@
14#ifndef __MACH_MISC_REGS_H 14#ifndef __MACH_MISC_REGS_H
15#define __MACH_MISC_REGS_H 15#define __MACH_MISC_REGS_H
16 16
17#include <mach/spear.h> 17#include <mach/hardware.h>
18 18
19#define MISC_BASE VA_SPEAR3XX_ICM3_MISC_REG_BASE 19#define MISC_BASE IOMEM(VA_SPEAR3XX_ICM3_MISC_REG_BASE)
20 20
21#define SOC_CFG_CTR ((unsigned int *)(MISC_BASE + 0x000)) 21#define SOC_CFG_CTR (MISC_BASE + 0x000)
22#define DIAG_CFG_CTR ((unsigned int *)(MISC_BASE + 0x004)) 22#define DIAG_CFG_CTR (MISC_BASE + 0x004)
23#define PLL1_CTR ((unsigned int *)(MISC_BASE + 0x008)) 23#define PLL1_CTR (MISC_BASE + 0x008)
24#define PLL1_FRQ ((unsigned int *)(MISC_BASE + 0x00C)) 24#define PLL1_FRQ (MISC_BASE + 0x00C)
25#define PLL1_MOD ((unsigned int *)(MISC_BASE + 0x010)) 25#define PLL1_MOD (MISC_BASE + 0x010)
26#define PLL2_CTR ((unsigned int *)(MISC_BASE + 0x014)) 26#define PLL2_CTR (MISC_BASE + 0x014)
27/* PLL_CTR register masks */ 27/* PLL_CTR register masks */
28#define PLL_ENABLE 2 28#define PLL_ENABLE 2
29#define PLL_MODE_SHIFT 4 29#define PLL_MODE_SHIFT 4
@@ -33,7 +33,7 @@
33#define PLL_MODE_DITH_DSB 2 33#define PLL_MODE_DITH_DSB 2
34#define PLL_MODE_DITH_SSB 3 34#define PLL_MODE_DITH_SSB 3
35 35
36#define PLL2_FRQ ((unsigned int *)(MISC_BASE + 0x018)) 36#define PLL2_FRQ (MISC_BASE + 0x018)
37/* PLL FRQ register masks */ 37/* PLL FRQ register masks */
38#define PLL_DIV_N_SHIFT 0 38#define PLL_DIV_N_SHIFT 0
39#define PLL_DIV_N_MASK 0xFF 39#define PLL_DIV_N_MASK 0xFF
@@ -44,16 +44,16 @@
44#define PLL_DITH_FDBK_M_SHIFT 16 44#define PLL_DITH_FDBK_M_SHIFT 16
45#define PLL_DITH_FDBK_M_MASK 0xFFFF 45#define PLL_DITH_FDBK_M_MASK 0xFFFF
46 46
47#define PLL2_MOD ((unsigned int *)(MISC_BASE + 0x01C)) 47#define PLL2_MOD (MISC_BASE + 0x01C)
48#define PLL_CLK_CFG ((unsigned int *)(MISC_BASE + 0x020)) 48#define PLL_CLK_CFG (MISC_BASE + 0x020)
49#define CORE_CLK_CFG ((unsigned int *)(MISC_BASE + 0x024)) 49#define CORE_CLK_CFG (MISC_BASE + 0x024)
50/* CORE CLK CFG register masks */ 50/* CORE CLK CFG register masks */
51#define PLL_HCLK_RATIO_SHIFT 10 51#define PLL_HCLK_RATIO_SHIFT 10
52#define PLL_HCLK_RATIO_MASK 0x3 52#define PLL_HCLK_RATIO_MASK 0x3
53#define HCLK_PCLK_RATIO_SHIFT 8 53#define HCLK_PCLK_RATIO_SHIFT 8
54#define HCLK_PCLK_RATIO_MASK 0x3 54#define HCLK_PCLK_RATIO_MASK 0x3
55 55
56#define PERIP_CLK_CFG ((unsigned int *)(MISC_BASE + 0x028)) 56#define PERIP_CLK_CFG (MISC_BASE + 0x028)
57/* PERIP_CLK_CFG register masks */ 57/* PERIP_CLK_CFG register masks */
58#define UART_CLK_SHIFT 4 58#define UART_CLK_SHIFT 4
59#define UART_CLK_MASK 0x1 59#define UART_CLK_MASK 0x1
@@ -63,10 +63,10 @@
63#define GPT1_CLK_SHIFT 11 63#define GPT1_CLK_SHIFT 11
64#define GPT2_CLK_SHIFT 12 64#define GPT2_CLK_SHIFT 12
65#define GPT_CLK_MASK 0x1 65#define GPT_CLK_MASK 0x1
66#define AUX_CLK_PLL3_MASK 0 66#define AUX_CLK_PLL3_VAL 0
67#define AUX_CLK_PLL1_MASK 1 67#define AUX_CLK_PLL1_VAL 1
68 68
69#define PERIP1_CLK_ENB ((unsigned int *)(MISC_BASE + 0x02C)) 69#define PERIP1_CLK_ENB (MISC_BASE + 0x02C)
70/* PERIP1_CLK_ENB register masks */ 70/* PERIP1_CLK_ENB register masks */
71#define UART_CLK_ENB 3 71#define UART_CLK_ENB 3
72#define SSP_CLK_ENB 5 72#define SSP_CLK_ENB 5
@@ -85,34 +85,35 @@
85#define USBH_CLK_ENB 25 85#define USBH_CLK_ENB 25
86#define C3_CLK_ENB 31 86#define C3_CLK_ENB 31
87 87
88#define SOC_CORE_ID ((unsigned int *)(MISC_BASE + 0x030)) 88#define SOC_CORE_ID (MISC_BASE + 0x030)
89#define RAS_CLK_ENB ((unsigned int *)(MISC_BASE + 0x034)) 89#define RAS_CLK_ENB (MISC_BASE + 0x034)
90#define PERIP1_SOF_RST ((unsigned int *)(MISC_BASE + 0x038)) 90#define PERIP1_SOF_RST (MISC_BASE + 0x038)
91/* PERIP1_SOF_RST register masks */ 91/* PERIP1_SOF_RST register masks */
92#define JPEG_SOF_RST 8 92#define JPEG_SOF_RST 8
93 93
94#define SOC_USER_ID ((unsigned int *)(MISC_BASE + 0x03C)) 94#define SOC_USER_ID (MISC_BASE + 0x03C)
95#define RAS_SOF_RST ((unsigned int *)(MISC_BASE + 0x040)) 95#define RAS_SOF_RST (MISC_BASE + 0x040)
96#define PRSC1_CLK_CFG ((unsigned int *)(MISC_BASE + 0x044)) 96#define PRSC1_CLK_CFG (MISC_BASE + 0x044)
97#define PRSC2_CLK_CFG ((unsigned int *)(MISC_BASE + 0x048)) 97#define PRSC2_CLK_CFG (MISC_BASE + 0x048)
98#define PRSC3_CLK_CFG ((unsigned int *)(MISC_BASE + 0x04C)) 98#define PRSC3_CLK_CFG (MISC_BASE + 0x04C)
99/* gpt synthesizer register masks */ 99/* gpt synthesizer register masks */
100#define GPT_MSCALE_SHIFT 0 100#define GPT_MSCALE_SHIFT 0
101#define GPT_MSCALE_MASK 0xFFF 101#define GPT_MSCALE_MASK 0xFFF
102#define GPT_NSCALE_SHIFT 12 102#define GPT_NSCALE_SHIFT 12
103#define GPT_NSCALE_MASK 0xF 103#define GPT_NSCALE_MASK 0xF
104 104
105#define AMEM_CLK_CFG ((unsigned int *)(MISC_BASE + 0x050)) 105#define AMEM_CLK_CFG (MISC_BASE + 0x050)
106#define EXPI_CLK_CFG ((unsigned int *)(MISC_BASE + 0x054)) 106#define EXPI_CLK_CFG (MISC_BASE + 0x054)
107#define CLCD_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x05C)) 107#define CLCD_CLK_SYNT (MISC_BASE + 0x05C)
108#define FIRDA_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x060)) 108#define FIRDA_CLK_SYNT (MISC_BASE + 0x060)
109#define UART_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x064)) 109#define UART_CLK_SYNT (MISC_BASE + 0x064)
110#define GMAC_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x068)) 110#define GMAC_CLK_SYNT (MISC_BASE + 0x068)
111#define RAS1_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x06C)) 111#define RAS1_CLK_SYNT (MISC_BASE + 0x06C)
112#define RAS2_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x070)) 112#define RAS2_CLK_SYNT (MISC_BASE + 0x070)
113#define RAS3_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x074)) 113#define RAS3_CLK_SYNT (MISC_BASE + 0x074)
114#define RAS4_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x078)) 114#define RAS4_CLK_SYNT (MISC_BASE + 0x078)
115/* aux clk synthesiser register masks for irda to ras4 */ 115/* aux clk synthesiser register masks for irda to ras4 */
116#define AUX_SYNT_ENB 31
116#define AUX_EQ_SEL_SHIFT 30 117#define AUX_EQ_SEL_SHIFT 30
117#define AUX_EQ_SEL_MASK 1 118#define AUX_EQ_SEL_MASK 1
118#define AUX_EQ1_SEL 0 119#define AUX_EQ1_SEL 0
@@ -122,42 +123,42 @@
122#define AUX_YSCALE_SHIFT 0 123#define AUX_YSCALE_SHIFT 0
123#define AUX_YSCALE_MASK 0xFFF 124#define AUX_YSCALE_MASK 0xFFF
124 125
125#define ICM1_ARB_CFG ((unsigned int *)(MISC_BASE + 0x07C)) 126#define ICM1_ARB_CFG (MISC_BASE + 0x07C)
126#define ICM2_ARB_CFG ((unsigned int *)(MISC_BASE + 0x080)) 127#define ICM2_ARB_CFG (MISC_BASE + 0x080)
127#define ICM3_ARB_CFG ((unsigned int *)(MISC_BASE + 0x084)) 128#define ICM3_ARB_CFG (MISC_BASE + 0x084)
128#define ICM4_ARB_CFG ((unsigned int *)(MISC_BASE + 0x088)) 129#define ICM4_ARB_CFG (MISC_BASE + 0x088)
129#define ICM5_ARB_CFG ((unsigned int *)(MISC_BASE + 0x08C)) 130#define ICM5_ARB_CFG (MISC_BASE + 0x08C)
130#define ICM6_ARB_CFG ((unsigned int *)(MISC_BASE + 0x090)) 131#define ICM6_ARB_CFG (MISC_BASE + 0x090)
131#define ICM7_ARB_CFG ((unsigned int *)(MISC_BASE + 0x094)) 132#define ICM7_ARB_CFG (MISC_BASE + 0x094)
132#define ICM8_ARB_CFG ((unsigned int *)(MISC_BASE + 0x098)) 133#define ICM8_ARB_CFG (MISC_BASE + 0x098)
133#define ICM9_ARB_CFG ((unsigned int *)(MISC_BASE + 0x09C)) 134#define ICM9_ARB_CFG (MISC_BASE + 0x09C)
134#define DMA_CHN_CFG ((unsigned int *)(MISC_BASE + 0x0A0)) 135#define DMA_CHN_CFG (MISC_BASE + 0x0A0)
135#define USB2_PHY_CFG ((unsigned int *)(MISC_BASE + 0x0A4)) 136#define USB2_PHY_CFG (MISC_BASE + 0x0A4)
136#define GMAC_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0A8)) 137#define GMAC_CFG_CTR (MISC_BASE + 0x0A8)
137#define EXPI_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0AC)) 138#define EXPI_CFG_CTR (MISC_BASE + 0x0AC)
138#define PRC1_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C0)) 139#define PRC1_LOCK_CTR (MISC_BASE + 0x0C0)
139#define PRC2_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C4)) 140#define PRC2_LOCK_CTR (MISC_BASE + 0x0C4)
140#define PRC3_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C8)) 141#define PRC3_LOCK_CTR (MISC_BASE + 0x0C8)
141#define PRC4_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0CC)) 142#define PRC4_LOCK_CTR (MISC_BASE + 0x0CC)
142#define PRC1_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D0)) 143#define PRC1_IRQ_CTR (MISC_BASE + 0x0D0)
143#define PRC2_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D4)) 144#define PRC2_IRQ_CTR (MISC_BASE + 0x0D4)
144#define PRC3_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D8)) 145#define PRC3_IRQ_CTR (MISC_BASE + 0x0D8)
145#define PRC4_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0DC)) 146#define PRC4_IRQ_CTR (MISC_BASE + 0x0DC)
146#define PWRDOWN_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0E0)) 147#define PWRDOWN_CFG_CTR (MISC_BASE + 0x0E0)
147#define COMPSSTL_1V8_CFG ((unsigned int *)(MISC_BASE + 0x0E4)) 148#define COMPSSTL_1V8_CFG (MISC_BASE + 0x0E4)
148#define COMPSSTL_2V5_CFG ((unsigned int *)(MISC_BASE + 0x0E8)) 149#define COMPSSTL_2V5_CFG (MISC_BASE + 0x0E8)
149#define COMPCOR_3V3_CFG ((unsigned int *)(MISC_BASE + 0x0EC)) 150#define COMPCOR_3V3_CFG (MISC_BASE + 0x0EC)
150#define SSTLPAD_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F0)) 151#define SSTLPAD_CFG_CTR (MISC_BASE + 0x0F0)
151#define BIST1_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F4)) 152#define BIST1_CFG_CTR (MISC_BASE + 0x0F4)
152#define BIST2_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F8)) 153#define BIST2_CFG_CTR (MISC_BASE + 0x0F8)
153#define BIST3_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0FC)) 154#define BIST3_CFG_CTR (MISC_BASE + 0x0FC)
154#define BIST4_CFG_CTR ((unsigned int *)(MISC_BASE + 0x100)) 155#define BIST4_CFG_CTR (MISC_BASE + 0x100)
155#define BIST5_CFG_CTR ((unsigned int *)(MISC_BASE + 0x104)) 156#define BIST5_CFG_CTR (MISC_BASE + 0x104)
156#define BIST1_STS_RES ((unsigned int *)(MISC_BASE + 0x108)) 157#define BIST1_STS_RES (MISC_BASE + 0x108)
157#define BIST2_STS_RES ((unsigned int *)(MISC_BASE + 0x10C)) 158#define BIST2_STS_RES (MISC_BASE + 0x10C)
158#define BIST3_STS_RES ((unsigned int *)(MISC_BASE + 0x110)) 159#define BIST3_STS_RES (MISC_BASE + 0x110)
159#define BIST4_STS_RES ((unsigned int *)(MISC_BASE + 0x114)) 160#define BIST4_STS_RES (MISC_BASE + 0x114)
160#define BIST5_STS_RES ((unsigned int *)(MISC_BASE + 0x118)) 161#define BIST5_STS_RES (MISC_BASE + 0x118)
161#define SYSERR_CFG_CTR ((unsigned int *)(MISC_BASE + 0x11C)) 162#define SYSERR_CFG_CTR (MISC_BASE + 0x11C)
162 163
163#endif /* __MACH_MISC_REGS_H */ 164#endif /* __MACH_MISC_REGS_H */
diff --git a/arch/arm/mach-spear3xx/include/mach/spear.h b/arch/arm/mach-spear3xx/include/mach/spear.h
index dcca8568a486..63fd98356919 100644
--- a/arch/arm/mach-spear3xx/include/mach/spear.h
+++ b/arch/arm/mach-spear3xx/include/mach/spear.h
@@ -14,124 +14,61 @@
14#ifndef __MACH_SPEAR3XX_H 14#ifndef __MACH_SPEAR3XX_H
15#define __MACH_SPEAR3XX_H 15#define __MACH_SPEAR3XX_H
16 16
17#include <mach/hardware.h> 17#include <asm/memory.h>
18#include <mach/spear300.h> 18#include <mach/spear300.h>
19#include <mach/spear310.h> 19#include <mach/spear310.h>
20#include <mach/spear320.h> 20#include <mach/spear320.h>
21 21
22#define SPEAR3XX_ML_SDRAM_BASE 0x00000000 22#define SPEAR3XX_ML_SDRAM_BASE UL(0x00000000)
23#define SPEAR3XX_ML_SDRAM_SIZE 0x40000000
24 23
25#define SPEAR3XX_ICM9_BASE 0xC0000000 24#define SPEAR3XX_ICM9_BASE UL(0xC0000000)
26#define SPEAR3XX_ICM9_SIZE 0x10000000
27 25
28/* ICM1 - Low speed connection */ 26/* ICM1 - Low speed connection */
29#define SPEAR3XX_ICM1_2_BASE 0xD0000000 27#define SPEAR3XX_ICM1_2_BASE UL(0xD0000000)
30#define SPEAR3XX_ICM1_2_SIZE 0x10000000 28#define SPEAR3XX_ICM1_UART_BASE UL(0xD0000000)
31
32#define SPEAR3XX_ICM1_UART_BASE 0xD0000000
33#define VA_SPEAR3XX_ICM1_UART_BASE IO_ADDRESS(SPEAR3XX_ICM1_UART_BASE) 29#define VA_SPEAR3XX_ICM1_UART_BASE IO_ADDRESS(SPEAR3XX_ICM1_UART_BASE)
34#define SPEAR3XX_ICM1_UART_SIZE 0x00080000 30#define SPEAR3XX_ICM1_ADC_BASE UL(0xD0080000)
35 31#define SPEAR3XX_ICM1_SSP_BASE UL(0xD0100000)
36#define SPEAR3XX_ICM1_ADC_BASE 0xD0080000 32#define SPEAR3XX_ICM1_I2C_BASE UL(0xD0180000)
37#define SPEAR3XX_ICM1_ADC_SIZE 0x00080000 33#define SPEAR3XX_ICM1_JPEG_BASE UL(0xD0800000)
38 34#define SPEAR3XX_ICM1_IRDA_BASE UL(0xD1000000)
39#define SPEAR3XX_ICM1_SSP_BASE 0xD0100000 35#define SPEAR3XX_ICM1_SRAM_BASE UL(0xD2800000)
40#define SPEAR3XX_ICM1_SSP_SIZE 0x00080000
41
42#define SPEAR3XX_ICM1_I2C_BASE 0xD0180000
43#define SPEAR3XX_ICM1_I2C_SIZE 0x00080000
44
45#define SPEAR3XX_ICM1_JPEG_BASE 0xD0800000
46#define SPEAR3XX_ICM1_JPEG_SIZE 0x00800000
47
48#define SPEAR3XX_ICM1_IRDA_BASE 0xD1000000
49#define SPEAR3XX_ICM1_IRDA_SIZE 0x00080000
50
51#define SPEAR3XX_ICM1_SRAM_BASE 0xD2800000
52#define SPEAR3XX_ICM1_SRAM_SIZE 0x05800000
53 36
54/* ICM2 - Application Subsystem */ 37/* ICM2 - Application Subsystem */
55#define SPEAR3XX_ICM2_HWACCEL0_BASE 0xD8800000 38#define SPEAR3XX_ICM2_HWACCEL0_BASE UL(0xD8800000)
56#define SPEAR3XX_ICM2_HWACCEL0_SIZE 0x00800000 39#define SPEAR3XX_ICM2_HWACCEL1_BASE UL(0xD9000000)
57
58#define SPEAR3XX_ICM2_HWACCEL1_BASE 0xD9000000
59#define SPEAR3XX_ICM2_HWACCEL1_SIZE 0x00800000
60 40
61/* ICM4 - High Speed Connection */ 41/* ICM4 - High Speed Connection */
62#define SPEAR3XX_ICM4_BASE 0xE0000000 42#define SPEAR3XX_ICM4_BASE UL(0xE0000000)
63#define SPEAR3XX_ICM4_SIZE 0x08000000 43#define SPEAR3XX_ICM4_MII_BASE UL(0xE0800000)
64 44#define SPEAR3XX_ICM4_USBD_FIFO_BASE UL(0xE1000000)
65#define SPEAR3XX_ICM4_MII_BASE 0xE0800000 45#define SPEAR3XX_ICM4_USBD_CSR_BASE UL(0xE1100000)
66#define SPEAR3XX_ICM4_MII_SIZE 0x00800000 46#define SPEAR3XX_ICM4_USBD_PLDT_BASE UL(0xE1200000)
67 47#define SPEAR3XX_ICM4_USB_EHCI0_1_BASE UL(0xE1800000)
68#define SPEAR3XX_ICM4_USBD_FIFO_BASE 0xE1000000 48#define SPEAR3XX_ICM4_USB_OHCI0_BASE UL(0xE1900000)
69#define SPEAR3XX_ICM4_USBD_FIFO_SIZE 0x00100000 49#define SPEAR3XX_ICM4_USB_OHCI1_BASE UL(0xE2100000)
70 50#define SPEAR3XX_ICM4_USB_ARB_BASE UL(0xE2800000)
71#define SPEAR3XX_ICM4_USBD_CSR_BASE 0xE1100000
72#define SPEAR3XX_ICM4_USBD_CSR_SIZE 0x00100000
73
74#define SPEAR3XX_ICM4_USBD_PLDT_BASE 0xE1200000
75#define SPEAR3XX_ICM4_USBD_PLDT_SIZE 0x00100000
76
77#define SPEAR3XX_ICM4_USB_EHCI0_1_BASE 0xE1800000
78#define SPEAR3XX_ICM4_USB_EHCI0_1_SIZE 0x00100000
79
80#define SPEAR3XX_ICM4_USB_OHCI0_BASE 0xE1900000
81#define SPEAR3XX_ICM4_USB_OHCI0_SIZE 0x00100000
82
83#define SPEAR3XX_ICM4_USB_OHCI1_BASE 0xE2100000
84#define SPEAR3XX_ICM4_USB_OHCI1_SIZE 0x00100000
85
86#define SPEAR3XX_ICM4_USB_ARB_BASE 0xE2800000
87#define SPEAR3XX_ICM4_USB_ARB_SIZE 0x00010000
88 51
89/* ML1 - Multi Layer CPU Subsystem */ 52/* ML1 - Multi Layer CPU Subsystem */
90#define SPEAR3XX_ICM3_ML1_2_BASE 0xF0000000 53#define SPEAR3XX_ICM3_ML1_2_BASE UL(0xF0000000)
91#define SPEAR3XX_ICM3_ML1_2_SIZE 0x0F000000 54#define SPEAR3XX_ML1_TMR_BASE UL(0xF0000000)
92 55#define SPEAR3XX_ML1_VIC_BASE UL(0xF1100000)
93#define SPEAR3XX_ML1_TMR_BASE 0xF0000000
94#define SPEAR3XX_ML1_TMR_SIZE 0x00100000
95
96#define SPEAR3XX_ML1_VIC_BASE 0xF1100000
97#define VA_SPEAR3XX_ML1_VIC_BASE IO_ADDRESS(SPEAR3XX_ML1_VIC_BASE) 56#define VA_SPEAR3XX_ML1_VIC_BASE IO_ADDRESS(SPEAR3XX_ML1_VIC_BASE)
98#define SPEAR3XX_ML1_VIC_SIZE 0x00100000
99 57
100/* ICM3 - Basic Subsystem */ 58/* ICM3 - Basic Subsystem */
101#define SPEAR3XX_ICM3_SMEM_BASE 0xF8000000 59#define SPEAR3XX_ICM3_SMEM_BASE UL(0xF8000000)
102#define SPEAR3XX_ICM3_SMEM_SIZE 0x04000000 60#define SPEAR3XX_ICM3_SMI_CTRL_BASE UL(0xFC000000)
103 61#define SPEAR3XX_ICM3_DMA_BASE UL(0xFC400000)
104#define SPEAR3XX_ICM3_SMI_CTRL_BASE 0xFC000000 62#define SPEAR3XX_ICM3_SDRAM_CTRL_BASE UL(0xFC600000)
105#define SPEAR3XX_ICM3_SMI_CTRL_SIZE 0x00200000 63#define SPEAR3XX_ICM3_TMR0_BASE UL(0xFC800000)
106 64#define SPEAR3XX_ICM3_WDT_BASE UL(0xFC880000)
107#define SPEAR3XX_ICM3_DMA_BASE 0xFC400000 65#define SPEAR3XX_ICM3_RTC_BASE UL(0xFC900000)
108#define SPEAR3XX_ICM3_DMA_SIZE 0x00200000 66#define SPEAR3XX_ICM3_GPIO_BASE UL(0xFC980000)
109 67#define SPEAR3XX_ICM3_SYS_CTRL_BASE UL(0xFCA00000)
110#define SPEAR3XX_ICM3_SDRAM_CTRL_BASE 0xFC600000
111#define SPEAR3XX_ICM3_SDRAM_CTRL_SIZE 0x00200000
112
113#define SPEAR3XX_ICM3_TMR0_BASE 0xFC800000
114#define SPEAR3XX_ICM3_TMR0_SIZE 0x00080000
115
116#define SPEAR3XX_ICM3_WDT_BASE 0xFC880000
117#define SPEAR3XX_ICM3_WDT_SIZE 0x00080000
118
119#define SPEAR3XX_ICM3_RTC_BASE 0xFC900000
120#define SPEAR3XX_ICM3_RTC_SIZE 0x00080000
121
122#define SPEAR3XX_ICM3_GPIO_BASE 0xFC980000
123#define SPEAR3XX_ICM3_GPIO_SIZE 0x00080000
124
125#define SPEAR3XX_ICM3_SYS_CTRL_BASE 0xFCA00000
126#define VA_SPEAR3XX_ICM3_SYS_CTRL_BASE IO_ADDRESS(SPEAR3XX_ICM3_SYS_CTRL_BASE) 68#define VA_SPEAR3XX_ICM3_SYS_CTRL_BASE IO_ADDRESS(SPEAR3XX_ICM3_SYS_CTRL_BASE)
127#define SPEAR3XX_ICM3_SYS_CTRL_SIZE 0x00080000 69#define SPEAR3XX_ICM3_MISC_REG_BASE UL(0xFCA80000)
128
129#define SPEAR3XX_ICM3_MISC_REG_BASE 0xFCA80000
130#define VA_SPEAR3XX_ICM3_MISC_REG_BASE IO_ADDRESS(SPEAR3XX_ICM3_MISC_REG_BASE) 70#define VA_SPEAR3XX_ICM3_MISC_REG_BASE IO_ADDRESS(SPEAR3XX_ICM3_MISC_REG_BASE)
131#define SPEAR3XX_ICM3_MISC_REG_SIZE 0x00080000 71#define SPEAR3XX_ICM3_TMR1_BASE UL(0xFCB00000)
132
133#define SPEAR3XX_ICM3_TMR1_BASE 0xFCB00000
134#define SPEAR3XX_ICM3_TMR1_SIZE 0x00080000
135 72
136/* Debug uart for linux, will be used for debug and uncompress messages */ 73/* Debug uart for linux, will be used for debug and uncompress messages */
137#define SPEAR_DBG_UART_BASE SPEAR3XX_ICM1_UART_BASE 74#define SPEAR_DBG_UART_BASE SPEAR3XX_ICM1_UART_BASE
diff --git a/arch/arm/mach-spear3xx/include/mach/spear300.h b/arch/arm/mach-spear3xx/include/mach/spear300.h
index ccaa76522ee2..c723515f8853 100644
--- a/arch/arm/mach-spear3xx/include/mach/spear300.h
+++ b/arch/arm/mach-spear3xx/include/mach/spear300.h
@@ -17,11 +17,9 @@
17#define __MACH_SPEAR300_H 17#define __MACH_SPEAR300_H
18 18
19/* Base address of various IPs */ 19/* Base address of various IPs */
20#define SPEAR300_TELECOM_BASE 0x50000000 20#define SPEAR300_TELECOM_BASE UL(0x50000000)
21#define SPEAR300_TELECOM_SIZE 0x10000000
22 21
23/* Interrupt registers offsets and masks */ 22/* Interrupt registers offsets and masks */
24#define SPEAR300_TELECOM_REG_SIZE 0x00010000
25#define INT_ENB_MASK_REG 0x54 23#define INT_ENB_MASK_REG 0x54
26#define INT_STS_MASK_REG 0x58 24#define INT_STS_MASK_REG 0x58
27#define IT_PERS_S_IRQ_MASK (1 << 0) 25#define IT_PERS_S_IRQ_MASK (1 << 0)
@@ -36,47 +34,20 @@
36 34
37#define SHIRQ_RAS1_MASK 0x1FF 35#define SHIRQ_RAS1_MASK 0x1FF
38 36
39#define SPEAR300_CLCD_BASE 0x60000000 37#define SPEAR300_CLCD_BASE UL(0x60000000)
40#define SPEAR300_CLCD_SIZE 0x10000000 38#define SPEAR300_SDHCI_BASE UL(0x70000000)
41 39#define SPEAR300_NAND_0_BASE UL(0x80000000)
42#define SPEAR300_SDIO_BASE 0x70000000 40#define SPEAR300_NAND_1_BASE UL(0x84000000)
43#define SPEAR300_SDIO_SIZE 0x10000000 41#define SPEAR300_NAND_2_BASE UL(0x88000000)
44 42#define SPEAR300_NAND_3_BASE UL(0x8c000000)
45#define SPEAR300_NAND_0_BASE 0x80000000 43#define SPEAR300_NOR_0_BASE UL(0x90000000)
46#define SPEAR300_NAND_0_SIZE 0x04000000 44#define SPEAR300_NOR_1_BASE UL(0x91000000)
47 45#define SPEAR300_NOR_2_BASE UL(0x92000000)
48#define SPEAR300_NAND_1_BASE 0x84000000 46#define SPEAR300_NOR_3_BASE UL(0x93000000)
49#define SPEAR300_NAND_1_SIZE 0x04000000 47#define SPEAR300_FSMC_BASE UL(0x94000000)
50 48#define SPEAR300_SOC_CONFIG_BASE UL(0x99000000)
51#define SPEAR300_NAND_2_BASE 0x88000000 49#define SPEAR300_KEYBOARD_BASE UL(0xA0000000)
52#define SPEAR300_NAND_2_SIZE 0x04000000 50#define SPEAR300_GPIO_BASE UL(0xA9000000)
53
54#define SPEAR300_NAND_3_BASE 0x8c000000
55#define SPEAR300_NAND_3_SIZE 0x04000000
56
57#define SPEAR300_NOR_0_BASE 0x90000000
58#define SPEAR300_NOR_0_SIZE 0x01000000
59
60#define SPEAR300_NOR_1_BASE 0x91000000
61#define SPEAR300_NOR_1_SIZE 0x01000000
62
63#define SPEAR300_NOR_2_BASE 0x92000000
64#define SPEAR300_NOR_2_SIZE 0x01000000
65
66#define SPEAR300_NOR_3_BASE 0x93000000
67#define SPEAR300_NOR_3_SIZE 0x01000000
68
69#define SPEAR300_FSMC_BASE 0x94000000
70#define SPEAR300_FSMC_SIZE 0x05000000
71
72#define SPEAR300_SOC_CONFIG_BASE 0x99000000
73#define SPEAR300_SOC_CONFIG_SIZE 0x00000008
74
75#define SPEAR300_KEYBOARD_BASE 0xA0000000
76#define SPEAR300_KEYBOARD_SIZE 0x09000000
77
78#define SPEAR300_GPIO_BASE 0xA9000000
79#define SPEAR300_GPIO_SIZE 0x07000000
80 51
81#endif /* __MACH_SPEAR300_H */ 52#endif /* __MACH_SPEAR300_H */
82 53
diff --git a/arch/arm/mach-spear3xx/include/mach/spear310.h b/arch/arm/mach-spear3xx/include/mach/spear310.h
index b27bb8af3309..1e853479b8cd 100644
--- a/arch/arm/mach-spear3xx/include/mach/spear310.h
+++ b/arch/arm/mach-spear3xx/include/mach/spear310.h
@@ -16,30 +16,18 @@
16#ifndef __MACH_SPEAR310_H 16#ifndef __MACH_SPEAR310_H
17#define __MACH_SPEAR310_H 17#define __MACH_SPEAR310_H
18 18
19#define SPEAR310_NAND_BASE 0x40000000 19#define SPEAR310_NAND_BASE UL(0x40000000)
20#define SPEAR310_NAND_SIZE 0x04000000 20#define SPEAR310_FSMC_BASE UL(0x44000000)
21#define SPEAR310_UART1_BASE UL(0xB2000000)
22#define SPEAR310_UART2_BASE UL(0xB2080000)
23#define SPEAR310_UART3_BASE UL(0xB2100000)
24#define SPEAR310_UART4_BASE UL(0xB2180000)
25#define SPEAR310_UART5_BASE UL(0xB2200000)
26#define SPEAR310_HDLC_BASE UL(0xB2800000)
27#define SPEAR310_RS485_0_BASE UL(0xB3000000)
28#define SPEAR310_RS485_1_BASE UL(0xB3800000)
29#define SPEAR310_SOC_CONFIG_BASE UL(0xB4000000)
21 30
22#define SPEAR310_FSMC_BASE 0x44000000
23#define SPEAR310_FSMC_SIZE 0x01000000
24
25#define SPEAR310_UART1_BASE 0xB2000000
26#define SPEAR310_UART2_BASE 0xB2080000
27#define SPEAR310_UART3_BASE 0xB2100000
28#define SPEAR310_UART4_BASE 0xB2180000
29#define SPEAR310_UART5_BASE 0xB2200000
30#define SPEAR310_UART_SIZE 0x00080000
31
32#define SPEAR310_HDLC_BASE 0xB2800000
33#define SPEAR310_HDLC_SIZE 0x00800000
34
35#define SPEAR310_RS485_0_BASE 0xB3000000
36#define SPEAR310_RS485_0_SIZE 0x00800000
37
38#define SPEAR310_RS485_1_BASE 0xB3800000
39#define SPEAR310_RS485_1_SIZE 0x00800000
40
41#define SPEAR310_SOC_CONFIG_BASE 0xB4000000
42#define SPEAR310_SOC_CONFIG_SIZE 0x00000070
43/* Interrupt registers offsets and masks */ 31/* Interrupt registers offsets and masks */
44#define INT_STS_MASK_REG 0x04 32#define INT_STS_MASK_REG 0x04
45#define SMII0_IRQ_MASK (1 << 0) 33#define SMII0_IRQ_MASK (1 << 0)
diff --git a/arch/arm/mach-spear3xx/include/mach/spear320.h b/arch/arm/mach-spear3xx/include/mach/spear320.h
index cacf17a958cd..940f0d85d959 100644
--- a/arch/arm/mach-spear3xx/include/mach/spear320.h
+++ b/arch/arm/mach-spear3xx/include/mach/spear320.h
@@ -16,54 +16,25 @@
16#ifndef __MACH_SPEAR320_H 16#ifndef __MACH_SPEAR320_H
17#define __MACH_SPEAR320_H 17#define __MACH_SPEAR320_H
18 18
19#define SPEAR320_EMI_CTRL_BASE 0x40000000 19#define SPEAR320_EMI_CTRL_BASE UL(0x40000000)
20#define SPEAR320_EMI_CTRL_SIZE 0x08000000 20#define SPEAR320_FSMC_BASE UL(0x4C000000)
21#define SPEAR320_NAND_BASE UL(0x50000000)
22#define SPEAR320_I2S_BASE UL(0x60000000)
23#define SPEAR320_SDHCI_BASE UL(0x70000000)
24#define SPEAR320_CLCD_BASE UL(0x90000000)
25#define SPEAR320_PAR_PORT_BASE UL(0xA0000000)
26#define SPEAR320_CAN0_BASE UL(0xA1000000)
27#define SPEAR320_CAN1_BASE UL(0xA2000000)
28#define SPEAR320_UART1_BASE UL(0xA3000000)
29#define SPEAR320_UART2_BASE UL(0xA4000000)
30#define SPEAR320_SSP0_BASE UL(0xA5000000)
31#define SPEAR320_SSP1_BASE UL(0xA6000000)
32#define SPEAR320_I2C_BASE UL(0xA7000000)
33#define SPEAR320_PWM_BASE UL(0xA8000000)
34#define SPEAR320_SMII0_BASE UL(0xAA000000)
35#define SPEAR320_SMII1_BASE UL(0xAB000000)
36#define SPEAR320_SOC_CONFIG_BASE UL(0xB3000000)
21 37
22#define SPEAR320_FSMC_BASE 0x4C000000
23#define SPEAR320_FSMC_SIZE 0x01000000
24
25#define SPEAR320_I2S_BASE 0x60000000
26#define SPEAR320_I2S_SIZE 0x10000000
27
28#define SPEAR320_SDIO_BASE 0x70000000
29#define SPEAR320_SDIO_SIZE 0x10000000
30
31#define SPEAR320_CLCD_BASE 0x90000000
32#define SPEAR320_CLCD_SIZE 0x10000000
33
34#define SPEAR320_PAR_PORT_BASE 0xA0000000
35#define SPEAR320_PAR_PORT_SIZE 0x01000000
36
37#define SPEAR320_CAN0_BASE 0xA1000000
38#define SPEAR320_CAN0_SIZE 0x01000000
39
40#define SPEAR320_CAN1_BASE 0xA2000000
41#define SPEAR320_CAN1_SIZE 0x01000000
42
43#define SPEAR320_UART1_BASE 0xA3000000
44#define SPEAR320_UART2_BASE 0xA4000000
45#define SPEAR320_UART_SIZE 0x01000000
46
47#define SPEAR320_SSP0_BASE 0xA5000000
48#define SPEAR320_SSP0_SIZE 0x01000000
49
50#define SPEAR320_SSP1_BASE 0xA6000000
51#define SPEAR320_SSP1_SIZE 0x01000000
52
53#define SPEAR320_I2C_BASE 0xA7000000
54#define SPEAR320_I2C_SIZE 0x01000000
55
56#define SPEAR320_PWM_BASE 0xA8000000
57#define SPEAR320_PWM_SIZE 0x01000000
58
59#define SPEAR320_SMII0_BASE 0xAA000000
60#define SPEAR320_SMII0_SIZE 0x01000000
61
62#define SPEAR320_SMII1_BASE 0xAB000000
63#define SPEAR320_SMII1_SIZE 0x01000000
64
65#define SPEAR320_SOC_CONFIG_BASE 0xB4000000
66#define SPEAR320_SOC_CONFIG_SIZE 0x00000070
67/* Interrupt registers offsets and masks */ 38/* Interrupt registers offsets and masks */
68#define INT_STS_MASK_REG 0x04 39#define INT_STS_MASK_REG 0x04
69#define INT_CLR_MASK_REG 0x04 40#define INT_CLR_MASK_REG 0x04
@@ -74,7 +45,7 @@
74#define EMI_IRQ_MASK (1 << 7) 45#define EMI_IRQ_MASK (1 << 7)
75#define CLCD_IRQ_MASK (1 << 8) 46#define CLCD_IRQ_MASK (1 << 8)
76#define SPP_IRQ_MASK (1 << 9) 47#define SPP_IRQ_MASK (1 << 9)
77#define SDIO_IRQ_MASK (1 << 10) 48#define SDHCI_IRQ_MASK (1 << 10)
78#define CAN_U_IRQ_MASK (1 << 11) 49#define CAN_U_IRQ_MASK (1 << 11)
79#define CAN_L_IRQ_MASK (1 << 12) 50#define CAN_L_IRQ_MASK (1 << 12)
80#define UART1_IRQ_MASK (1 << 13) 51#define UART1_IRQ_MASK (1 << 13)
diff --git a/arch/arm/mach-spear3xx/spear300.c b/arch/arm/mach-spear3xx/spear300.c
index 5aa2d54ebfaa..2697e65adf86 100644
--- a/arch/arm/mach-spear3xx/spear300.c
+++ b/arch/arm/mach-spear3xx/spear300.c
@@ -15,9 +15,9 @@
15#include <linux/amba/pl061.h> 15#include <linux/amba/pl061.h>
16#include <linux/ptrace.h> 16#include <linux/ptrace.h>
17#include <asm/irq.h> 17#include <asm/irq.h>
18#include <mach/generic.h>
19#include <mach/spear.h>
20#include <plat/shirq.h> 18#include <plat/shirq.h>
19#include <mach/generic.h>
20#include <mach/hardware.h>
21 21
22/* pad multiplexing support */ 22/* pad multiplexing support */
23/* muxing registers */ 23/* muxing registers */
@@ -310,7 +310,7 @@ struct pmx_dev pmx_telecom_boot_pins = {
310 .enb_on_reset = 1, 310 .enb_on_reset = 1,
311}; 311};
312 312
313struct pmx_dev_mode pmx_telecom_sdio_4bit_modes[] = { 313struct 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_sdio_4bit_modes[] = {
323 }, 323 },
324}; 324};
325 325
326struct pmx_dev pmx_telecom_sdio_4bit = { 326struct pmx_dev pmx_telecom_sdhci_4bit = {
327 .name = "telecom_sdio_4bit", 327 .name = "telecom_sdhci_4bit",
328 .modes = pmx_telecom_sdio_4bit_modes, 328 .modes = pmx_telecom_sdhci_4bit_modes,
329 .mode_count = ARRAY_SIZE(pmx_telecom_sdio_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_sdio_8bit_modes[] = { 333struct 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,10 +342,10 @@ struct pmx_dev_mode pmx_telecom_sdio_8bit_modes[] = {
342 }, 342 },
343}; 343};
344 344
345struct pmx_dev pmx_telecom_sdio_8bit = { 345struct pmx_dev pmx_telecom_sdhci_8bit = {
346 .name = "telecom_sdio_8bit", 346 .name = "telecom_sdhci_8bit",
347 .modes = pmx_telecom_sdio_8bit_modes, 347 .modes = pmx_telecom_sdhci_8bit_modes,
348 .mode_count = ARRAY_SIZE(pmx_telecom_sdio_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
@@ -370,26 +370,6 @@ struct pmx_driver pmx_driver = {
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/* Add spear300 specific devices here */
374/* arm gpio1 device registration */
375static struct pl061_platform_data gpio1_plat_data = {
376 .gpio_base = 8,
377 .irq_base = SPEAR_GPIO1_INT_BASE,
378};
379
380struct amba_device gpio1_device = {
381 .dev = {
382 .init_name = "gpio1",
383 .platform_data = &gpio1_plat_data,
384 },
385 .res = {
386 .start = SPEAR300_GPIO_BASE,
387 .end = SPEAR300_GPIO_BASE + SPEAR300_GPIO_SIZE - 1,
388 .flags = IORESOURCE_MEM,
389 },
390 .irq = {VIRQ_GPIO1, NO_IRQ},
391};
392
393/* spear3xx shared irq */ 373/* spear3xx shared irq */
394struct shirq_dev_config shirq_ras1_config[] = { 374struct shirq_dev_config shirq_ras1_config[] = {
395 { 375 {
@@ -443,6 +423,26 @@ struct spear_shirq shirq_ras1 = {
443 }, 423 },
444}; 424};
445 425
426/* Add spear300 specific devices here */
427/* arm gpio1 device registration */
428static struct pl061_platform_data gpio1_plat_data = {
429 .gpio_base = 8,
430 .irq_base = SPEAR_GPIO1_INT_BASE,
431};
432
433struct amba_device gpio1_device = {
434 .dev = {
435 .init_name = "gpio1",
436 .platform_data = &gpio1_plat_data,
437 },
438 .res = {
439 .start = SPEAR300_GPIO_BASE,
440 .end = SPEAR300_GPIO_BASE + SZ_4K - 1,
441 .flags = IORESOURCE_MEM,
442 },
443 .irq = {VIRQ_GPIO1, NO_IRQ},
444};
445
446/* spear300 routines */ 446/* spear300 routines */
447void __init spear300_init(void) 447void __init spear300_init(void)
448{ 448{
@@ -452,17 +452,21 @@ void __init spear300_init(void)
452 spear3xx_init(); 452 spear3xx_init();
453 453
454 /* shared irq registration */ 454 /* shared irq registration */
455 shirq_ras1.regs.base = 455 shirq_ras1.regs.base = ioremap(SPEAR300_TELECOM_BASE, SZ_4K);
456 ioremap(SPEAR300_TELECOM_BASE, SPEAR300_TELECOM_REG_SIZE);
457 if (shirq_ras1.regs.base) { 456 if (shirq_ras1.regs.base) {
458 ret = spear_shirq_register(&shirq_ras1); 457 ret = spear_shirq_register(&shirq_ras1);
459 if (ret) 458 if (ret)
460 printk(KERN_ERR "Error registering Shared IRQ\n"); 459 printk(KERN_ERR "Error registering Shared IRQ\n");
461 } 460 }
462}
463 461
464void spear300_pmx_init(void) 462 /* pmx initialization */
465{ 463 pmx_driver.base = ioremap(SPEAR300_SOC_CONFIG_BASE, SZ_4K);
466 spear_pmx_init(&pmx_driver, SPEAR300_SOC_CONFIG_BASE, 464 if (pmx_driver.base) {
467 SPEAR300_SOC_CONFIG_SIZE); 465 ret = pmx_register(&pmx_driver);
466 if (ret)
467 printk(KERN_ERR "padmux: registeration failed. err no"
468 ": %d\n", ret);
469 /* Free Mapping, device selection already done */
470 iounmap(pmx_driver.base);
471 }
468} 472}
diff --git a/arch/arm/mach-spear3xx/spear300_evb.c b/arch/arm/mach-spear3xx/spear300_evb.c
index bb21db152a23..42d2253ef540 100644
--- a/arch/arm/mach-spear3xx/spear300_evb.c
+++ b/arch/arm/mach-spear3xx/spear300_evb.c
@@ -14,7 +14,7 @@
14#include <asm/mach/arch.h> 14#include <asm/mach/arch.h>
15#include <asm/mach-types.h> 15#include <asm/mach-types.h>
16#include <mach/generic.h> 16#include <mach/generic.h>
17#include <mach/spear.h> 17#include <mach/hardware.h>
18 18
19/* padmux devices to enable */ 19/* padmux devices to enable */
20static struct pmx_dev *pmx_devs[] = { 20static struct pmx_dev *pmx_devs[] = {
@@ -28,7 +28,7 @@ static struct pmx_dev *pmx_devs[] = {
28 /* spear300 specific devices */ 28 /* spear300 specific devices */
29 &pmx_fsmc_2_chips, 29 &pmx_fsmc_2_chips,
30 &pmx_clcd, 30 &pmx_clcd,
31 &pmx_telecom_sdio_4bit, 31 &pmx_telecom_sdhci_4bit,
32 &pmx_gpio1, 32 &pmx_gpio1,
33}; 33};
34 34
@@ -51,14 +51,13 @@ static void __init spear300_evb_init(void)
51{ 51{
52 unsigned int i; 52 unsigned int i;
53 53
54 /* call spear300 machine init function */ 54 /* padmux initialization, must be done before spear300_init */
55 spear300_init();
56
57 /* padmux initialization */
58 pmx_driver.mode = &photo_frame_mode; 55 pmx_driver.mode = &photo_frame_mode;
59 pmx_driver.devs = pmx_devs; 56 pmx_driver.devs = pmx_devs;
60 pmx_driver.devs_count = ARRAY_SIZE(pmx_devs); 57 pmx_driver.devs_count = ARRAY_SIZE(pmx_devs);
61 spear300_pmx_init(); 58
59 /* call spear300 machine init function */
60 spear300_init();
62 61
63 /* Add Platform Devices */ 62 /* Add Platform Devices */
64 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs)); 63 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
@@ -72,6 +71,6 @@ MACHINE_START(SPEAR300, "ST-SPEAR300-EVB")
72 .boot_params = 0x00000100, 71 .boot_params = 0x00000100,
73 .map_io = spear3xx_map_io, 72 .map_io = spear3xx_map_io,
74 .init_irq = spear3xx_init_irq, 73 .init_irq = spear3xx_init_irq,
75 .timer = &spear_sys_timer, 74 .timer = &spear3xx_timer,
76 .init_machine = spear300_evb_init, 75 .init_machine = spear300_evb_init,
77MACHINE_END 76MACHINE_END
diff --git a/arch/arm/mach-spear3xx/spear310.c b/arch/arm/mach-spear3xx/spear310.c
index 53b41b52d7ee..5c0a67b60c2a 100644
--- a/arch/arm/mach-spear3xx/spear310.c
+++ b/arch/arm/mach-spear3xx/spear310.c
@@ -13,9 +13,9 @@
13 13
14#include <linux/ptrace.h> 14#include <linux/ptrace.h>
15#include <asm/irq.h> 15#include <asm/irq.h>
16#include <mach/generic.h>
17#include <mach/spear.h>
18#include <plat/shirq.h> 16#include <plat/shirq.h>
17#include <mach/generic.h>
18#include <mach/hardware.h>
19 19
20/* pad multiplexing support */ 20/* pad multiplexing support */
21/* muxing registers */ 21/* muxing registers */
@@ -139,8 +139,6 @@ 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/* Add spear310 specific devices here */
143
144/* spear3xx shared irq */ 142/* spear3xx shared irq */
145struct shirq_dev_config shirq_ras1_config[] = { 143struct shirq_dev_config shirq_ras1_config[] = {
146 { 144 {
@@ -257,6 +255,8 @@ struct spear_shirq shirq_intrcomm_ras = {
257 }, 255 },
258}; 256};
259 257
258/* Add spear310 specific devices here */
259
260/* spear310 routines */ 260/* spear310 routines */
261void __init spear310_init(void) 261void __init spear310_init(void)
262{ 262{
@@ -267,7 +267,7 @@ void __init spear310_init(void)
267 spear3xx_init(); 267 spear3xx_init();
268 268
269 /* shared irq registration */ 269 /* shared irq registration */
270 base = ioremap(SPEAR310_SOC_CONFIG_BASE, SPEAR310_SOC_CONFIG_SIZE); 270 base = ioremap(SPEAR310_SOC_CONFIG_BASE, SZ_4K);
271 if (base) { 271 if (base) {
272 /* shirq 1 */ 272 /* shirq 1 */
273 shirq_ras1.regs.base = base; 273 shirq_ras1.regs.base = base;
@@ -293,10 +293,11 @@ void __init spear310_init(void)
293 if (ret) 293 if (ret)
294 printk(KERN_ERR "Error registering Shared IRQ 4\n"); 294 printk(KERN_ERR "Error registering Shared IRQ 4\n");
295 } 295 }
296}
297 296
298void spear310_pmx_init(void) 297 /* pmx initialization */
299{ 298 pmx_driver.base = base;
300 spear_pmx_init(&pmx_driver, SPEAR310_SOC_CONFIG_BASE, 299 ret = pmx_register(&pmx_driver);
301 SPEAR310_SOC_CONFIG_SIZE); 300 if (ret)
301 printk(KERN_ERR "padmux: registeration failed. err no: %d\n",
302 ret);
302} 303}
diff --git a/arch/arm/mach-spear3xx/spear310_evb.c b/arch/arm/mach-spear3xx/spear310_evb.c
index 7facf6643199..2d7f333bd67b 100644
--- a/arch/arm/mach-spear3xx/spear310_evb.c
+++ b/arch/arm/mach-spear3xx/spear310_evb.c
@@ -14,7 +14,7 @@
14#include <asm/mach/arch.h> 14#include <asm/mach/arch.h>
15#include <asm/mach-types.h> 15#include <asm/mach-types.h>
16#include <mach/generic.h> 16#include <mach/generic.h>
17#include <mach/spear.h> 17#include <mach/hardware.h>
18 18
19/* padmux devices to enable */ 19/* padmux devices to enable */
20static struct pmx_dev *pmx_devs[] = { 20static struct pmx_dev *pmx_devs[] = {
@@ -58,14 +58,13 @@ static void __init spear310_evb_init(void)
58{ 58{
59 unsigned int i; 59 unsigned int i;
60 60
61 /* call spear310 machine init function */ 61 /* padmux initialization, must be done before spear310_init */
62 spear310_init();
63
64 /* padmux initialization */
65 pmx_driver.mode = NULL; 62 pmx_driver.mode = NULL;
66 pmx_driver.devs = pmx_devs; 63 pmx_driver.devs = pmx_devs;
67 pmx_driver.devs_count = ARRAY_SIZE(pmx_devs); 64 pmx_driver.devs_count = ARRAY_SIZE(pmx_devs);
68 spear310_pmx_init(); 65
66 /* call spear310 machine init function */
67 spear310_init();
69 68
70 /* Add Platform Devices */ 69 /* Add Platform Devices */
71 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs)); 70 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
@@ -79,6 +78,6 @@ MACHINE_START(SPEAR310, "ST-SPEAR310-EVB")
79 .boot_params = 0x00000100, 78 .boot_params = 0x00000100,
80 .map_io = spear3xx_map_io, 79 .map_io = spear3xx_map_io,
81 .init_irq = spear3xx_init_irq, 80 .init_irq = spear3xx_init_irq,
82 .timer = &spear_sys_timer, 81 .timer = &spear3xx_timer,
83 .init_machine = spear310_evb_init, 82 .init_machine = spear310_evb_init,
84MACHINE_END 83MACHINE_END
diff --git a/arch/arm/mach-spear3xx/spear320.c b/arch/arm/mach-spear3xx/spear320.c
index 88b465284c36..741c1f414cbd 100644
--- a/arch/arm/mach-spear3xx/spear320.c
+++ b/arch/arm/mach-spear3xx/spear320.c
@@ -13,9 +13,9 @@
13 13
14#include <linux/ptrace.h> 14#include <linux/ptrace.h>
15#include <asm/irq.h> 15#include <asm/irq.h>
16#include <mach/generic.h>
17#include <mach/spear.h>
18#include <plat/shirq.h> 16#include <plat/shirq.h>
17#include <mach/generic.h>
18#include <mach/hardware.h>
19 19
20/* pad multiplexing support */ 20/* pad multiplexing support */
21/* muxing registers */ 21/* muxing registers */
@@ -110,7 +110,7 @@ struct pmx_dev pmx_spp = {
110 .enb_on_reset = 1, 110 .enb_on_reset = 1,
111}; 111};
112 112
113struct pmx_dev_mode pmx_sdio_modes[] = { 113struct 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,10 +118,10 @@ struct pmx_dev_mode pmx_sdio_modes[] = {
118 }, 118 },
119}; 119};
120 120
121struct pmx_dev pmx_sdio = { 121struct pmx_dev pmx_sdhci = {
122 .name = "sdio", 122 .name = "sdhci",
123 .modes = pmx_sdio_modes, 123 .modes = pmx_sdhci_modes,
124 .mode_count = ARRAY_SIZE(pmx_sdio_modes), 124 .mode_count = ARRAY_SIZE(pmx_sdhci_modes),
125 .enb_on_reset = 1, 125 .enb_on_reset = 1,
126}; 126};
127 127
@@ -215,17 +215,17 @@ struct pmx_dev pmx_can = {
215 .enb_on_reset = 1, 215 .enb_on_reset = 1,
216}; 216};
217 217
218struct pmx_dev_mode pmx_sdio_led_modes[] = { 218struct 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_sdio_led = { 225struct pmx_dev pmx_sdhci_led = {
226 .name = "sdio_led", 226 .name = "sdhci_led",
227 .modes = pmx_sdio_led_modes, 227 .modes = pmx_sdhci_led_modes,
228 .mode_count = ARRAY_SIZE(pmx_sdio_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
@@ -384,8 +384,6 @@ struct pmx_driver pmx_driver = {
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/* Add spear320 specific devices here */
388
389/* spear3xx shared irq */ 387/* spear3xx shared irq */
390struct shirq_dev_config shirq_ras1_config[] = { 388struct shirq_dev_config shirq_ras1_config[] = {
391 { 389 {
@@ -510,6 +508,8 @@ struct spear_shirq shirq_intrcomm_ras = {
510 }, 508 },
511}; 509};
512 510
511/* Add spear320 specific devices here */
512
513/* spear320 routines */ 513/* spear320 routines */
514void __init spear320_init(void) 514void __init spear320_init(void)
515{ 515{
@@ -520,7 +520,7 @@ void __init spear320_init(void)
520 spear3xx_init(); 520 spear3xx_init();
521 521
522 /* shared irq registration */ 522 /* shared irq registration */
523 base = ioremap(SPEAR320_SOC_CONFIG_BASE, SPEAR320_SOC_CONFIG_SIZE); 523 base = ioremap(SPEAR320_SOC_CONFIG_BASE, SZ_4K);
524 if (base) { 524 if (base) {
525 /* shirq 1 */ 525 /* shirq 1 */
526 shirq_ras1.regs.base = base; 526 shirq_ras1.regs.base = base;
@@ -540,10 +540,11 @@ void __init spear320_init(void)
540 if (ret) 540 if (ret)
541 printk(KERN_ERR "Error registering Shared IRQ 4\n"); 541 printk(KERN_ERR "Error registering Shared IRQ 4\n");
542 } 542 }
543}
544 543
545void spear320_pmx_init(void) 544 /* pmx initialization */
546{ 545 pmx_driver.base = base;
547 spear_pmx_init(&pmx_driver, SPEAR320_SOC_CONFIG_BASE, 546 ret = pmx_register(&pmx_driver);
548 SPEAR320_SOC_CONFIG_SIZE); 547 if (ret)
548 printk(KERN_ERR "padmux: registeration failed. err no: %d\n",
549 ret);
549} 550}
diff --git a/arch/arm/mach-spear3xx/spear320_evb.c b/arch/arm/mach-spear3xx/spear320_evb.c
index 62ac685a4135..8213e4b66c14 100644
--- a/arch/arm/mach-spear3xx/spear320_evb.c
+++ b/arch/arm/mach-spear3xx/spear320_evb.c
@@ -14,7 +14,7 @@
14#include <asm/mach/arch.h> 14#include <asm/mach/arch.h>
15#include <asm/mach-types.h> 15#include <asm/mach-types.h>
16#include <mach/generic.h> 16#include <mach/generic.h>
17#include <mach/spear.h> 17#include <mach/hardware.h>
18 18
19/* padmux devices to enable */ 19/* padmux devices to enable */
20static struct pmx_dev *pmx_devs[] = { 20static struct pmx_dev *pmx_devs[] = {
@@ -26,7 +26,7 @@ static struct pmx_dev *pmx_devs[] = {
26 26
27 /* spear320 specific devices */ 27 /* spear320 specific devices */
28 &pmx_fsmc, 28 &pmx_fsmc,
29 &pmx_sdio, 29 &pmx_sdhci,
30 &pmx_i2s, 30 &pmx_i2s,
31 &pmx_uart1, 31 &pmx_uart1,
32 &pmx_uart2, 32 &pmx_uart2,
@@ -55,14 +55,13 @@ static void __init spear320_evb_init(void)
55{ 55{
56 unsigned int i; 56 unsigned int i;
57 57
58 /* call spear320 machine init function */ 58 /* padmux initialization, must be done before spear320_init */
59 spear320_init();
60
61 /* padmux initialization */
62 pmx_driver.mode = &auto_net_mii_mode; 59 pmx_driver.mode = &auto_net_mii_mode;
63 pmx_driver.devs = pmx_devs; 60 pmx_driver.devs = pmx_devs;
64 pmx_driver.devs_count = ARRAY_SIZE(pmx_devs); 61 pmx_driver.devs_count = ARRAY_SIZE(pmx_devs);
65 spear320_pmx_init(); 62
63 /* call spear320 machine init function */
64 spear320_init();
66 65
67 /* Add Platform Devices */ 66 /* Add Platform Devices */
68 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs)); 67 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
@@ -76,6 +75,6 @@ MACHINE_START(SPEAR320, "ST-SPEAR320-EVB")
76 .boot_params = 0x00000100, 75 .boot_params = 0x00000100,
77 .map_io = spear3xx_map_io, 76 .map_io = spear3xx_map_io,
78 .init_irq = spear3xx_init_irq, 77 .init_irq = spear3xx_init_irq,
79 .timer = &spear_sys_timer, 78 .timer = &spear3xx_timer,
80 .init_machine = spear320_evb_init, 79 .init_machine = spear320_evb_init,
81MACHINE_END 80MACHINE_END
diff --git a/arch/arm/mach-spear3xx/spear3xx.c b/arch/arm/mach-spear3xx/spear3xx.c
index 52f553c8c46d..d3ba8ca1bc59 100644
--- a/arch/arm/mach-spear3xx/spear3xx.c
+++ b/arch/arm/mach-spear3xx/spear3xx.c
@@ -19,7 +19,7 @@
19#include <asm/irq.h> 19#include <asm/irq.h>
20#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
21#include <mach/generic.h> 21#include <mach/generic.h>
22#include <mach/spear.h> 22#include <mach/hardware.h>
23 23
24/* Add spear3xx machines common devices here */ 24/* Add spear3xx machines common devices here */
25/* gpio device registration */ 25/* gpio device registration */
@@ -35,7 +35,7 @@ struct amba_device gpio_device = {
35 }, 35 },
36 .res = { 36 .res = {
37 .start = SPEAR3XX_ICM3_GPIO_BASE, 37 .start = SPEAR3XX_ICM3_GPIO_BASE,
38 .end = SPEAR3XX_ICM3_GPIO_BASE + SPEAR3XX_ICM3_GPIO_SIZE - 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 = {IRQ_BASIC_GPIO, NO_IRQ},
@@ -48,7 +48,7 @@ struct amba_device uart_device = {
48 }, 48 },
49 .res = { 49 .res = {
50 .start = SPEAR3XX_ICM1_UART_BASE, 50 .start = SPEAR3XX_ICM1_UART_BASE,
51 .end = SPEAR3XX_ICM1_UART_BASE + SPEAR3XX_ICM1_UART_SIZE - 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 = {IRQ_UART, NO_IRQ},
@@ -71,22 +71,22 @@ struct map_desc spear3xx_io_desc[] __initdata = {
71 { 71 {
72 .virtual = VA_SPEAR3XX_ICM1_UART_BASE, 72 .virtual = VA_SPEAR3XX_ICM1_UART_BASE,
73 .pfn = __phys_to_pfn(SPEAR3XX_ICM1_UART_BASE), 73 .pfn = __phys_to_pfn(SPEAR3XX_ICM1_UART_BASE),
74 .length = SPEAR3XX_ICM1_UART_SIZE, 74 .length = SZ_4K,
75 .type = MT_DEVICE 75 .type = MT_DEVICE
76 }, { 76 }, {
77 .virtual = VA_SPEAR3XX_ML1_VIC_BASE, 77 .virtual = VA_SPEAR3XX_ML1_VIC_BASE,
78 .pfn = __phys_to_pfn(SPEAR3XX_ML1_VIC_BASE), 78 .pfn = __phys_to_pfn(SPEAR3XX_ML1_VIC_BASE),
79 .length = SPEAR3XX_ML1_VIC_SIZE, 79 .length = SZ_4K,
80 .type = MT_DEVICE 80 .type = MT_DEVICE
81 }, { 81 }, {
82 .virtual = VA_SPEAR3XX_ICM3_SYS_CTRL_BASE, 82 .virtual = VA_SPEAR3XX_ICM3_SYS_CTRL_BASE,
83 .pfn = __phys_to_pfn(SPEAR3XX_ICM3_SYS_CTRL_BASE), 83 .pfn = __phys_to_pfn(SPEAR3XX_ICM3_SYS_CTRL_BASE),
84 .length = SPEAR3XX_ICM3_SYS_CTRL_SIZE, 84 .length = SZ_4K,
85 .type = MT_DEVICE 85 .type = MT_DEVICE
86 }, { 86 }, {
87 .virtual = VA_SPEAR3XX_ICM3_MISC_REG_BASE, 87 .virtual = VA_SPEAR3XX_ICM3_MISC_REG_BASE,
88 .pfn = __phys_to_pfn(SPEAR3XX_ICM3_MISC_REG_BASE), 88 .pfn = __phys_to_pfn(SPEAR3XX_ICM3_MISC_REG_BASE),
89 .length = SPEAR3XX_ICM3_MISC_REG_SIZE, 89 .length = SZ_4K,
90 .type = MT_DEVICE 90 .type = MT_DEVICE
91 }, 91 },
92}; 92};
@@ -523,26 +523,35 @@ struct pmx_dev pmx_plgpio_45_46_49_50 = {
523 .mode_count = ARRAY_SIZE(pmx_plgpio_45_46_49_50_modes), 523 .mode_count = ARRAY_SIZE(pmx_plgpio_45_46_49_50_modes),
524 .enb_on_reset = 1, 524 .enb_on_reset = 1,
525}; 525};
526#endif /* CONFIG_MACH_SPEAR310 || CONFIG_MACH_SPEAR320 */
526 527
527#endif 528static void __init spear3xx_timer_init(void)
528
529/* spear padmux initialization function */
530void spear_pmx_init(struct pmx_driver *pmx_driver, uint base, uint size)
531{ 529{
532 int ret = 0; 530 char pclk_name[] = "pll3_48m_clk";
531 struct clk *gpt_clk, *pclk;
532
533 /* get the system timer clock */
534 gpt_clk = clk_get_sys("gpt0", NULL);
535 if (IS_ERR(gpt_clk)) {
536 pr_err("%s:couldn't get clk for gpt\n", __func__);
537 BUG();
538 }
533 539
534 /* pad mux initialization */ 540 /* get the suitable parent clock for timer*/
535 pmx_driver->base = ioremap(base, size); 541 pclk = clk_get(NULL, pclk_name);
536 if (!pmx_driver->base) { 542 if (IS_ERR(pclk)) {
537 ret = -ENOMEM; 543 pr_err("%s:couldn't get %s as parent for gpt\n",
538 goto pmx_fail; 544 __func__, pclk_name);
545 BUG();
539 } 546 }
540 547
541 ret = pmx_register(pmx_driver); 548 clk_set_parent(gpt_clk, pclk);
542 iounmap(pmx_driver->base); 549 clk_put(gpt_clk);
550 clk_put(pclk);
543 551
544pmx_fail: 552 spear_setup_timer();
545 if (ret)
546 printk(KERN_ERR "padmux: registration failed. err no: %d\n",
547 ret);
548} 553}
554
555struct sys_timer spear3xx_timer = {
556 .init = spear3xx_timer_init,
557};
diff --git a/arch/arm/mach-spear6xx/clock.c b/arch/arm/mach-spear6xx/clock.c
index 36ff056b7321..88b748b5be80 100644
--- a/arch/arm/mach-spear6xx/clock.c
+++ b/arch/arm/mach-spear6xx/clock.c
@@ -13,8 +13,8 @@
13 13
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <mach/misc_regs.h>
17#include <plat/clock.h> 16#include <plat/clock.h>
17#include <mach/misc_regs.h>
18 18
19/* root clks */ 19/* root clks */
20/* 32 KHz oscillator clock */ 20/* 32 KHz oscillator clock */
@@ -39,18 +39,43 @@ static struct clk rtc_clk = {
39}; 39};
40 40
41/* clock derived from 30 MHz osc clk */ 41/* clock derived from 30 MHz osc clk */
42/* pll masks structure */
43static struct pll_clk_masks pll1_masks = {
44 .mode_mask = PLL_MODE_MASK,
45 .mode_shift = PLL_MODE_SHIFT,
46 .norm_fdbk_m_mask = PLL_NORM_FDBK_M_MASK,
47 .norm_fdbk_m_shift = PLL_NORM_FDBK_M_SHIFT,
48 .dith_fdbk_m_mask = PLL_DITH_FDBK_M_MASK,
49 .dith_fdbk_m_shift = PLL_DITH_FDBK_M_SHIFT,
50 .div_p_mask = PLL_DIV_P_MASK,
51 .div_p_shift = PLL_DIV_P_SHIFT,
52 .div_n_mask = PLL_DIV_N_MASK,
53 .div_n_shift = PLL_DIV_N_SHIFT,
54};
55
42/* pll1 configuration structure */ 56/* pll1 configuration structure */
43static struct pll_clk_config pll1_config = { 57static struct pll_clk_config pll1_config = {
44 .mode_reg = PLL1_CTR, 58 .mode_reg = PLL1_CTR,
45 .cfg_reg = PLL1_FRQ, 59 .cfg_reg = PLL1_FRQ,
60 .masks = &pll1_masks,
61};
62
63/* pll rate configuration table, in ascending order of rates */
64struct pll_rate_tbl pll_rtbl[] = {
65 {.mode = 0, .m = 0x85, .n = 0x0C, .p = 0x1}, /* 266 MHz */
66 {.mode = 0, .m = 0xA6, .n = 0x0C, .p = 0x1}, /* 332 MHz */
46}; 67};
47 68
48/* PLL1 clock */ 69/* PLL1 clock */
49static struct clk pll1_clk = { 70static struct clk pll1_clk = {
71 .flags = ENABLED_ON_INIT,
50 .pclk = &osc_30m_clk, 72 .pclk = &osc_30m_clk,
51 .en_reg = PLL1_CTR, 73 .en_reg = PLL1_CTR,
52 .en_reg_bit = PLL_ENABLE, 74 .en_reg_bit = PLL_ENABLE,
53 .recalc = &pll1_clk_recalc, 75 .calc_rate = &pll_calc_rate,
76 .recalc = &pll_clk_recalc,
77 .set_rate = &pll_clk_set_rate,
78 .rate_config = {pll_rtbl, ARRAY_SIZE(pll_rtbl), 1},
54 .private_data = &pll1_config, 79 .private_data = &pll1_config,
55}; 80};
56 81
@@ -76,31 +101,83 @@ static struct clk cpu_clk = {
76 .recalc = &follow_parent, 101 .recalc = &follow_parent,
77}; 102};
78 103
104/* ahb masks structure */
105static struct bus_clk_masks ahb_masks = {
106 .mask = PLL_HCLK_RATIO_MASK,
107 .shift = PLL_HCLK_RATIO_SHIFT,
108};
109
79/* ahb configuration structure */ 110/* ahb configuration structure */
80static struct bus_clk_config ahb_config = { 111static struct bus_clk_config ahb_config = {
81 .reg = CORE_CLK_CFG, 112 .reg = CORE_CLK_CFG,
82 .mask = PLL_HCLK_RATIO_MASK, 113 .masks = &ahb_masks,
83 .shift = PLL_HCLK_RATIO_SHIFT, 114};
115
116/* ahb rate configuration table, in ascending order of rates */
117struct bus_rate_tbl bus_rtbl[] = {
118 {.div = 3}, /* == parent divided by 4 */
119 {.div = 2}, /* == parent divided by 3 */
120 {.div = 1}, /* == parent divided by 2 */
121 {.div = 0}, /* == parent divided by 1 */
84}; 122};
85 123
86/* ahb clock */ 124/* ahb clock */
87static struct clk ahb_clk = { 125static struct clk ahb_clk = {
88 .flags = ALWAYS_ENABLED, 126 .flags = ALWAYS_ENABLED,
89 .pclk = &pll1_clk, 127 .pclk = &pll1_clk,
128 .calc_rate = &bus_calc_rate,
90 .recalc = &bus_clk_recalc, 129 .recalc = &bus_clk_recalc,
130 .set_rate = &bus_clk_set_rate,
131 .rate_config = {bus_rtbl, ARRAY_SIZE(bus_rtbl), 2},
91 .private_data = &ahb_config, 132 .private_data = &ahb_config,
92}; 133};
93 134
135/* auxiliary synthesizers masks */
136static struct aux_clk_masks aux_masks = {
137 .eq_sel_mask = AUX_EQ_SEL_MASK,
138 .eq_sel_shift = AUX_EQ_SEL_SHIFT,
139 .eq1_mask = AUX_EQ1_SEL,
140 .eq2_mask = AUX_EQ2_SEL,
141 .xscale_sel_mask = AUX_XSCALE_MASK,
142 .xscale_sel_shift = AUX_XSCALE_SHIFT,
143 .yscale_sel_mask = AUX_YSCALE_MASK,
144 .yscale_sel_shift = AUX_YSCALE_SHIFT,
145};
146
147/* uart configurations */
148static struct aux_clk_config uart_synth_config = {
149 .synth_reg = UART_CLK_SYNT,
150 .masks = &aux_masks,
151};
152
153/* aux rate configuration table, in ascending order of rates */
154struct aux_rate_tbl aux_rtbl[] = {
155 /* For PLL1 = 332 MHz */
156 {.xscale = 1, .yscale = 8, .eq = 1}, /* 41.5 MHz */
157 {.xscale = 1, .yscale = 4, .eq = 1}, /* 83 MHz */
158 {.xscale = 1, .yscale = 2, .eq = 1}, /* 166 MHz */
159};
160
161/* uart synth clock */
162static struct clk uart_synth_clk = {
163 .en_reg = UART_CLK_SYNT,
164 .en_reg_bit = AUX_SYNT_ENB,
165 .pclk = &pll1_clk,
166 .calc_rate = &aux_calc_rate,
167 .recalc = &aux_clk_recalc,
168 .set_rate = &aux_clk_set_rate,
169 .rate_config = {aux_rtbl, ARRAY_SIZE(aux_rtbl), 2},
170 .private_data = &uart_synth_config,
171};
172
94/* uart parents */ 173/* uart parents */
95static struct pclk_info uart_pclk_info[] = { 174static struct pclk_info uart_pclk_info[] = {
96 { 175 {
97 .pclk = &pll1_clk, 176 .pclk = &uart_synth_clk,
98 .pclk_mask = AUX_CLK_PLL1_MASK, 177 .pclk_val = AUX_CLK_PLL1_VAL,
99 .scalable = 1,
100 }, { 178 }, {
101 .pclk = &pll3_48m_clk, 179 .pclk = &pll3_48m_clk,
102 .pclk_mask = AUX_CLK_PLL3_MASK, 180 .pclk_val = AUX_CLK_PLL3_VAL,
103 .scalable = 0,
104 }, 181 },
105}; 182};
106 183
@@ -112,19 +189,13 @@ static struct pclk_sel uart_pclk_sel = {
112 .pclk_sel_mask = UART_CLK_MASK, 189 .pclk_sel_mask = UART_CLK_MASK,
113}; 190};
114 191
115/* uart configurations */
116static struct aux_clk_config uart_config = {
117 .synth_reg = UART_CLK_SYNT,
118};
119
120/* uart0 clock */ 192/* uart0 clock */
121static struct clk uart0_clk = { 193static struct clk uart0_clk = {
122 .en_reg = PERIP1_CLK_ENB, 194 .en_reg = PERIP1_CLK_ENB,
123 .en_reg_bit = UART0_CLK_ENB, 195 .en_reg_bit = UART0_CLK_ENB,
124 .pclk_sel = &uart_pclk_sel, 196 .pclk_sel = &uart_pclk_sel,
125 .pclk_sel_shift = UART_CLK_SHIFT, 197 .pclk_sel_shift = UART_CLK_SHIFT,
126 .recalc = &aux_clk_recalc, 198 .recalc = &follow_parent,
127 .private_data = &uart_config,
128}; 199};
129 200
130/* uart1 clock */ 201/* uart1 clock */
@@ -133,25 +204,35 @@ static struct clk uart1_clk = {
133 .en_reg_bit = UART1_CLK_ENB, 204 .en_reg_bit = UART1_CLK_ENB,
134 .pclk_sel = &uart_pclk_sel, 205 .pclk_sel = &uart_pclk_sel,
135 .pclk_sel_shift = UART_CLK_SHIFT, 206 .pclk_sel_shift = UART_CLK_SHIFT,
136 .recalc = &aux_clk_recalc, 207 .recalc = &follow_parent,
137 .private_data = &uart_config,
138}; 208};
139 209
140/* firda configurations */ 210/* firda configurations */
141static struct aux_clk_config firda_config = { 211static struct aux_clk_config firda_synth_config = {
142 .synth_reg = FIRDA_CLK_SYNT, 212 .synth_reg = FIRDA_CLK_SYNT,
213 .masks = &aux_masks,
214};
215
216/* firda synth clock */
217static struct clk firda_synth_clk = {
218 .en_reg = FIRDA_CLK_SYNT,
219 .en_reg_bit = AUX_SYNT_ENB,
220 .pclk = &pll1_clk,
221 .calc_rate = &aux_calc_rate,
222 .recalc = &aux_clk_recalc,
223 .set_rate = &aux_clk_set_rate,
224 .rate_config = {aux_rtbl, ARRAY_SIZE(aux_rtbl), 2},
225 .private_data = &firda_synth_config,
143}; 226};
144 227
145/* firda parents */ 228/* firda parents */
146static struct pclk_info firda_pclk_info[] = { 229static struct pclk_info firda_pclk_info[] = {
147 { 230 {
148 .pclk = &pll1_clk, 231 .pclk = &firda_synth_clk,
149 .pclk_mask = AUX_CLK_PLL1_MASK, 232 .pclk_val = AUX_CLK_PLL1_VAL,
150 .scalable = 1,
151 }, { 233 }, {
152 .pclk = &pll3_48m_clk, 234 .pclk = &pll3_48m_clk,
153 .pclk_mask = AUX_CLK_PLL3_MASK, 235 .pclk_val = AUX_CLK_PLL3_VAL,
154 .scalable = 0,
155 }, 236 },
156}; 237};
157 238
@@ -169,25 +250,35 @@ static struct clk firda_clk = {
169 .en_reg_bit = FIRDA_CLK_ENB, 250 .en_reg_bit = FIRDA_CLK_ENB,
170 .pclk_sel = &firda_pclk_sel, 251 .pclk_sel = &firda_pclk_sel,
171 .pclk_sel_shift = FIRDA_CLK_SHIFT, 252 .pclk_sel_shift = FIRDA_CLK_SHIFT,
172 .recalc = &aux_clk_recalc, 253 .recalc = &follow_parent,
173 .private_data = &firda_config,
174}; 254};
175 255
176/* clcd configurations */ 256/* clcd configurations */
177static struct aux_clk_config clcd_config = { 257static struct aux_clk_config clcd_synth_config = {
178 .synth_reg = CLCD_CLK_SYNT, 258 .synth_reg = CLCD_CLK_SYNT,
259 .masks = &aux_masks,
260};
261
262/* firda synth clock */
263static struct clk clcd_synth_clk = {
264 .en_reg = CLCD_CLK_SYNT,
265 .en_reg_bit = AUX_SYNT_ENB,
266 .pclk = &pll1_clk,
267 .calc_rate = &aux_calc_rate,
268 .recalc = &aux_clk_recalc,
269 .set_rate = &aux_clk_set_rate,
270 .rate_config = {aux_rtbl, ARRAY_SIZE(aux_rtbl), 2},
271 .private_data = &clcd_synth_config,
179}; 272};
180 273
181/* clcd parents */ 274/* clcd parents */
182static struct pclk_info clcd_pclk_info[] = { 275static struct pclk_info clcd_pclk_info[] = {
183 { 276 {
184 .pclk = &pll1_clk, 277 .pclk = &clcd_synth_clk,
185 .pclk_mask = AUX_CLK_PLL1_MASK, 278 .pclk_val = AUX_CLK_PLL1_VAL,
186 .scalable = 1,
187 }, { 279 }, {
188 .pclk = &pll3_48m_clk, 280 .pclk = &pll3_48m_clk,
189 .pclk_mask = AUX_CLK_PLL3_MASK, 281 .pclk_val = AUX_CLK_PLL3_VAL,
190 .scalable = 0,
191 }, 282 },
192}; 283};
193 284
@@ -205,82 +296,173 @@ static struct clk clcd_clk = {
205 .en_reg_bit = CLCD_CLK_ENB, 296 .en_reg_bit = CLCD_CLK_ENB,
206 .pclk_sel = &clcd_pclk_sel, 297 .pclk_sel = &clcd_pclk_sel,
207 .pclk_sel_shift = CLCD_CLK_SHIFT, 298 .pclk_sel_shift = CLCD_CLK_SHIFT,
208 .recalc = &aux_clk_recalc, 299 .recalc = &follow_parent,
209 .private_data = &clcd_config, 300};
301
302/* gpt synthesizer masks */
303static struct gpt_clk_masks gpt_masks = {
304 .mscale_sel_mask = GPT_MSCALE_MASK,
305 .mscale_sel_shift = GPT_MSCALE_SHIFT,
306 .nscale_sel_mask = GPT_NSCALE_MASK,
307 .nscale_sel_shift = GPT_NSCALE_SHIFT,
308};
309
310/* gpt rate configuration table, in ascending order of rates */
311struct gpt_rate_tbl gpt_rtbl[] = {
312 /* For pll1 = 332 MHz */
313 {.mscale = 4, .nscale = 0}, /* 41.5 MHz */
314 {.mscale = 2, .nscale = 0}, /* 55.3 MHz */
315 {.mscale = 1, .nscale = 0}, /* 83 MHz */
316};
317
318/* gpt0 synth clk config*/
319static struct gpt_clk_config gpt0_synth_config = {
320 .synth_reg = PRSC1_CLK_CFG,
321 .masks = &gpt_masks,
322};
323
324/* gpt synth clock */
325static struct clk gpt0_synth_clk = {
326 .flags = ALWAYS_ENABLED,
327 .pclk = &pll1_clk,
328 .calc_rate = &gpt_calc_rate,
329 .recalc = &gpt_clk_recalc,
330 .set_rate = &gpt_clk_set_rate,
331 .rate_config = {gpt_rtbl, ARRAY_SIZE(gpt_rtbl), 2},
332 .private_data = &gpt0_synth_config,
210}; 333};
211 334
212/* gpt parents */ 335/* gpt parents */
213static struct pclk_info gpt_pclk_info[] = { 336static struct pclk_info gpt0_pclk_info[] = {
214 { 337 {
215 .pclk = &pll1_clk, 338 .pclk = &gpt0_synth_clk,
216 .pclk_mask = AUX_CLK_PLL1_MASK, 339 .pclk_val = AUX_CLK_PLL1_VAL,
217 .scalable = 1,
218 }, { 340 }, {
219 .pclk = &pll3_48m_clk, 341 .pclk = &pll3_48m_clk,
220 .pclk_mask = AUX_CLK_PLL3_MASK, 342 .pclk_val = AUX_CLK_PLL3_VAL,
221 .scalable = 0,
222 }, 343 },
223}; 344};
224 345
225/* gpt parent select structure */ 346/* gpt parent select structure */
226static struct pclk_sel gpt_pclk_sel = { 347static struct pclk_sel gpt0_pclk_sel = {
227 .pclk_info = gpt_pclk_info, 348 .pclk_info = gpt0_pclk_info,
228 .pclk_count = ARRAY_SIZE(gpt_pclk_info), 349 .pclk_count = ARRAY_SIZE(gpt0_pclk_info),
229 .pclk_sel_reg = PERIP_CLK_CFG, 350 .pclk_sel_reg = PERIP_CLK_CFG,
230 .pclk_sel_mask = GPT_CLK_MASK, 351 .pclk_sel_mask = GPT_CLK_MASK,
231}; 352};
232 353
233/* gpt0_1 configurations */
234static struct aux_clk_config gpt0_1_config = {
235 .synth_reg = PRSC1_CLK_CFG,
236};
237
238/* gpt0 ARM1 subsystem timer clock */ 354/* gpt0 ARM1 subsystem timer clock */
239static struct clk gpt0_clk = { 355static struct clk gpt0_clk = {
240 .flags = ALWAYS_ENABLED, 356 .flags = ALWAYS_ENABLED,
241 .pclk_sel = &gpt_pclk_sel, 357 .pclk_sel = &gpt0_pclk_sel,
242 .pclk_sel_shift = GPT0_CLK_SHIFT, 358 .pclk_sel_shift = GPT0_CLK_SHIFT,
243 .recalc = &gpt_clk_recalc, 359 .recalc = &follow_parent,
244 .private_data = &gpt0_1_config, 360};
361
362
363/* Note: gpt0 and gpt1 share same parent clocks */
364/* gpt parent select structure */
365static struct pclk_sel gpt1_pclk_sel = {
366 .pclk_info = gpt0_pclk_info,
367 .pclk_count = ARRAY_SIZE(gpt0_pclk_info),
368 .pclk_sel_reg = PERIP_CLK_CFG,
369 .pclk_sel_mask = GPT_CLK_MASK,
245}; 370};
246 371
247/* gpt1 timer clock */ 372/* gpt1 timer clock */
248static struct clk gpt1_clk = { 373static struct clk gpt1_clk = {
249 .flags = ALWAYS_ENABLED, 374 .flags = ALWAYS_ENABLED,
250 .pclk_sel = &gpt_pclk_sel, 375 .pclk_sel = &gpt1_pclk_sel,
251 .pclk_sel_shift = GPT1_CLK_SHIFT, 376 .pclk_sel_shift = GPT1_CLK_SHIFT,
252 .recalc = &gpt_clk_recalc, 377 .recalc = &follow_parent,
253 .private_data = &gpt0_1_config,
254}; 378};
255 379
256/* gpt2 configurations */ 380/* gpt2 synth clk config*/
257static struct aux_clk_config gpt2_config = { 381static struct gpt_clk_config gpt2_synth_config = {
258 .synth_reg = PRSC2_CLK_CFG, 382 .synth_reg = PRSC2_CLK_CFG,
383 .masks = &gpt_masks,
384};
385
386/* gpt synth clock */
387static struct clk gpt2_synth_clk = {
388 .flags = ALWAYS_ENABLED,
389 .pclk = &pll1_clk,
390 .calc_rate = &gpt_calc_rate,
391 .recalc = &gpt_clk_recalc,
392 .set_rate = &gpt_clk_set_rate,
393 .rate_config = {gpt_rtbl, ARRAY_SIZE(gpt_rtbl), 2},
394 .private_data = &gpt2_synth_config,
395};
396
397/* gpt parents */
398static struct pclk_info gpt2_pclk_info[] = {
399 {
400 .pclk = &gpt2_synth_clk,
401 .pclk_val = AUX_CLK_PLL1_VAL,
402 }, {
403 .pclk = &pll3_48m_clk,
404 .pclk_val = AUX_CLK_PLL3_VAL,
405 },
406};
407
408/* gpt parent select structure */
409static struct pclk_sel gpt2_pclk_sel = {
410 .pclk_info = gpt2_pclk_info,
411 .pclk_count = ARRAY_SIZE(gpt2_pclk_info),
412 .pclk_sel_reg = PERIP_CLK_CFG,
413 .pclk_sel_mask = GPT_CLK_MASK,
259}; 414};
260 415
261/* gpt2 timer clock */ 416/* gpt2 timer clock */
262static struct clk gpt2_clk = { 417static struct clk gpt2_clk = {
263 .en_reg = PERIP1_CLK_ENB, 418 .flags = ALWAYS_ENABLED,
264 .en_reg_bit = GPT2_CLK_ENB, 419 .pclk_sel = &gpt2_pclk_sel,
265 .pclk_sel = &gpt_pclk_sel,
266 .pclk_sel_shift = GPT2_CLK_SHIFT, 420 .pclk_sel_shift = GPT2_CLK_SHIFT,
267 .recalc = &gpt_clk_recalc, 421 .recalc = &follow_parent,
268 .private_data = &gpt2_config,
269}; 422};
270 423
271/* gpt3 configurations */ 424/* gpt3 synth clk config*/
272static struct aux_clk_config gpt3_config = { 425static struct gpt_clk_config gpt3_synth_config = {
273 .synth_reg = PRSC3_CLK_CFG, 426 .synth_reg = PRSC3_CLK_CFG,
427 .masks = &gpt_masks,
428};
429
430/* gpt synth clock */
431static struct clk gpt3_synth_clk = {
432 .flags = ALWAYS_ENABLED,
433 .pclk = &pll1_clk,
434 .calc_rate = &gpt_calc_rate,
435 .recalc = &gpt_clk_recalc,
436 .set_rate = &gpt_clk_set_rate,
437 .rate_config = {gpt_rtbl, ARRAY_SIZE(gpt_rtbl), 2},
438 .private_data = &gpt3_synth_config,
439};
440
441/* gpt parents */
442static struct pclk_info gpt3_pclk_info[] = {
443 {
444 .pclk = &gpt3_synth_clk,
445 .pclk_val = AUX_CLK_PLL1_VAL,
446 }, {
447 .pclk = &pll3_48m_clk,
448 .pclk_val = AUX_CLK_PLL3_VAL,
449 },
450};
451
452/* gpt parent select structure */
453static struct pclk_sel gpt3_pclk_sel = {
454 .pclk_info = gpt3_pclk_info,
455 .pclk_count = ARRAY_SIZE(gpt3_pclk_info),
456 .pclk_sel_reg = PERIP_CLK_CFG,
457 .pclk_sel_mask = GPT_CLK_MASK,
274}; 458};
275 459
276/* gpt3 timer clock */ 460/* gpt3 timer clock */
277static struct clk gpt3_clk = { 461static struct clk gpt3_clk = {
278 .en_reg = PERIP1_CLK_ENB, 462 .flags = ALWAYS_ENABLED,
279 .en_reg_bit = GPT3_CLK_ENB, 463 .pclk_sel = &gpt3_pclk_sel,
280 .pclk_sel = &gpt_pclk_sel,
281 .pclk_sel_shift = GPT3_CLK_SHIFT, 464 .pclk_sel_shift = GPT3_CLK_SHIFT,
282 .recalc = &gpt_clk_recalc, 465 .recalc = &follow_parent,
283 .private_data = &gpt3_config,
284}; 466};
285 467
286/* clock derived from pll3 clk */ 468/* clock derived from pll3 clk */
@@ -309,18 +491,26 @@ static struct clk usbd_clk = {
309}; 491};
310 492
311/* clock derived from ahb clk */ 493/* clock derived from ahb clk */
494/* apb masks structure */
495static struct bus_clk_masks apb_masks = {
496 .mask = HCLK_PCLK_RATIO_MASK,
497 .shift = HCLK_PCLK_RATIO_SHIFT,
498};
499
312/* apb configuration structure */ 500/* apb configuration structure */
313static struct bus_clk_config apb_config = { 501static struct bus_clk_config apb_config = {
314 .reg = CORE_CLK_CFG, 502 .reg = CORE_CLK_CFG,
315 .mask = HCLK_PCLK_RATIO_MASK, 503 .masks = &apb_masks,
316 .shift = HCLK_PCLK_RATIO_SHIFT,
317}; 504};
318 505
319/* apb clock */ 506/* apb clock */
320static struct clk apb_clk = { 507static struct clk apb_clk = {
321 .flags = ALWAYS_ENABLED, 508 .flags = ALWAYS_ENABLED,
322 .pclk = &ahb_clk, 509 .pclk = &ahb_clk,
510 .calc_rate = &bus_calc_rate,
323 .recalc = &bus_clk_recalc, 511 .recalc = &bus_clk_recalc,
512 .set_rate = &bus_clk_set_rate,
513 .rate_config = {bus_rtbl, ARRAY_SIZE(bus_rtbl), 2},
324 .private_data = &apb_config, 514 .private_data = &apb_config,
325}; 515};
326 516
@@ -432,12 +622,12 @@ static struct clk dummy_apb_pclk;
432 622
433/* array of all spear 6xx clock lookups */ 623/* array of all spear 6xx clock lookups */
434static struct clk_lookup spear_clk_lookups[] = { 624static struct clk_lookup spear_clk_lookups[] = {
435 { .con_id = "apb_pclk", .clk = &dummy_apb_pclk}, 625 { .con_id = "apb_pclk", .clk = &dummy_apb_pclk},
436 /* root clks */ 626 /* root clks */
437 { .con_id = "osc_32k_clk", .clk = &osc_32k_clk}, 627 { .con_id = "osc_32k_clk", .clk = &osc_32k_clk},
438 { .con_id = "osc_30m_clk", .clk = &osc_30m_clk}, 628 { .con_id = "osc_30m_clk", .clk = &osc_30m_clk},
439 /* clock derived from 32 KHz os clk */ 629 /* clock derived from 32 KHz os clk */
440 { .dev_id = "rtc", .clk = &rtc_clk}, 630 { .dev_id = "rtc-spear", .clk = &rtc_clk},
441 /* clock derived from 30 MHz os clk */ 631 /* clock derived from 30 MHz os clk */
442 { .con_id = "pll1_clk", .clk = &pll1_clk}, 632 { .con_id = "pll1_clk", .clk = &pll1_clk},
443 { .con_id = "pll3_48m_clk", .clk = &pll3_48m_clk}, 633 { .con_id = "pll3_48m_clk", .clk = &pll3_48m_clk},
@@ -445,6 +635,12 @@ static struct clk_lookup spear_clk_lookups[] = {
445 /* clock derived from pll1 clk */ 635 /* clock derived from pll1 clk */
446 { .con_id = "cpu_clk", .clk = &cpu_clk}, 636 { .con_id = "cpu_clk", .clk = &cpu_clk},
447 { .con_id = "ahb_clk", .clk = &ahb_clk}, 637 { .con_id = "ahb_clk", .clk = &ahb_clk},
638 { .con_id = "uart_synth_clk", .clk = &uart_synth_clk},
639 { .con_id = "firda_synth_clk", .clk = &firda_synth_clk},
640 { .con_id = "clcd_synth_clk", .clk = &clcd_synth_clk},
641 { .con_id = "gpt0_synth_clk", .clk = &gpt0_synth_clk},
642 { .con_id = "gpt2_synth_clk", .clk = &gpt2_synth_clk},
643 { .con_id = "gpt3_synth_clk", .clk = &gpt3_synth_clk},
448 { .dev_id = "uart0", .clk = &uart0_clk}, 644 { .dev_id = "uart0", .clk = &uart0_clk},
449 { .dev_id = "uart1", .clk = &uart1_clk}, 645 { .dev_id = "uart1", .clk = &uart1_clk},
450 { .dev_id = "firda", .clk = &firda_clk}, 646 { .dev_id = "firda", .clk = &firda_clk},
@@ -454,22 +650,22 @@ static struct clk_lookup spear_clk_lookups[] = {
454 { .dev_id = "gpt2", .clk = &gpt2_clk}, 650 { .dev_id = "gpt2", .clk = &gpt2_clk},
455 { .dev_id = "gpt3", .clk = &gpt3_clk}, 651 { .dev_id = "gpt3", .clk = &gpt3_clk},
456 /* clock derived from pll3 clk */ 652 /* clock derived from pll3 clk */
457 { .dev_id = "usbh0", .clk = &usbh0_clk}, 653 { .dev_id = "designware_udc", .clk = &usbd_clk},
458 { .dev_id = "usbh1", .clk = &usbh1_clk}, 654 { .con_id = "usbh.0_clk", .clk = &usbh0_clk},
459 { .dev_id = "usbd", .clk = &usbd_clk}, 655 { .con_id = "usbh.1_clk", .clk = &usbh1_clk},
460 /* clock derived from ahb clk */ 656 /* clock derived from ahb clk */
461 { .con_id = "apb_clk", .clk = &apb_clk}, 657 { .con_id = "apb_clk", .clk = &apb_clk},
462 { .dev_id = "i2c", .clk = &i2c_clk}, 658 { .dev_id = "i2c_designware.0", .clk = &i2c_clk},
463 { .dev_id = "dma", .clk = &dma_clk}, 659 { .dev_id = "dma", .clk = &dma_clk},
464 { .dev_id = "jpeg", .clk = &jpeg_clk}, 660 { .dev_id = "jpeg", .clk = &jpeg_clk},
465 { .dev_id = "gmac", .clk = &gmac_clk}, 661 { .dev_id = "gmac", .clk = &gmac_clk},
466 { .dev_id = "smi", .clk = &smi_clk}, 662 { .dev_id = "smi", .clk = &smi_clk},
467 { .dev_id = "fsmc", .clk = &fsmc_clk}, 663 { .con_id = "fsmc", .clk = &fsmc_clk},
468 /* clock derived from apb clk */ 664 /* clock derived from apb clk */
469 { .dev_id = "adc", .clk = &adc_clk}, 665 { .dev_id = "adc", .clk = &adc_clk},
470 { .dev_id = "ssp0", .clk = &ssp0_clk}, 666 { .dev_id = "ssp-pl022.0", .clk = &ssp0_clk},
471 { .dev_id = "ssp1", .clk = &ssp1_clk}, 667 { .dev_id = "ssp-pl022.1", .clk = &ssp1_clk},
472 { .dev_id = "ssp2", .clk = &ssp2_clk}, 668 { .dev_id = "ssp-pl022.2", .clk = &ssp2_clk},
473 { .dev_id = "gpio0", .clk = &gpio0_clk}, 669 { .dev_id = "gpio0", .clk = &gpio0_clk},
474 { .dev_id = "gpio1", .clk = &gpio1_clk}, 670 { .dev_id = "gpio1", .clk = &gpio1_clk},
475 { .dev_id = "gpio2", .clk = &gpio2_clk}, 671 { .dev_id = "gpio2", .clk = &gpio2_clk},
diff --git a/arch/arm/mach-spear6xx/include/mach/entry-macro.S b/arch/arm/mach-spear6xx/include/mach/entry-macro.S
index 9eaecaeafcf0..8a0b0ed7b203 100644
--- a/arch/arm/mach-spear6xx/include/mach/entry-macro.S
+++ b/arch/arm/mach-spear6xx/include/mach/entry-macro.S
@@ -11,9 +11,8 @@
11 * warranty of any kind, whether express or implied. 11 * warranty of any kind, whether express or implied.
12 */ 12 */
13 13
14#include <mach/hardware.h>
15#include <mach/spear.h>
16#include <asm/hardware/vic.h> 14#include <asm/hardware/vic.h>
15#include <mach/hardware.h>
17 16
18 .macro disable_fiq 17 .macro disable_fiq
19 .endm 18 .endm
diff --git a/arch/arm/mach-spear6xx/include/mach/generic.h b/arch/arm/mach-spear6xx/include/mach/generic.h
index 16205a538756..94cf4a648b57 100644
--- a/arch/arm/mach-spear6xx/include/mach/generic.h
+++ b/arch/arm/mach-spear6xx/include/mach/generic.h
@@ -14,11 +14,11 @@
14#ifndef __MACH_GENERIC_H 14#ifndef __MACH_GENERIC_H
15#define __MACH_GENERIC_H 15#define __MACH_GENERIC_H
16 16
17#include <asm/mach/time.h>
18#include <asm/mach/map.h>
19#include <linux/init.h> 17#include <linux/init.h>
20#include <linux/platform_device.h> 18#include <linux/platform_device.h>
21#include <linux/amba/bus.h> 19#include <linux/amba/bus.h>
20#include <asm/mach/time.h>
21#include <asm/mach/map.h>
22 22
23/* 23/*
24 * Each GPT has 2 timer channels 24 * Each GPT has 2 timer channels
@@ -31,9 +31,10 @@
31/* Add spear6xx family device structure declarations here */ 31/* Add spear6xx family device structure declarations here */
32extern struct amba_device gpio_device[]; 32extern struct amba_device gpio_device[];
33extern struct amba_device uart_device[]; 33extern struct amba_device uart_device[];
34extern struct sys_timer spear_sys_timer; 34extern struct sys_timer spear6xx_timer;
35 35
36/* Add spear6xx family function declarations here */ 36/* Add spear6xx family function declarations here */
37void __init spear_setup_timer(void);
37void __init spear6xx_map_io(void); 38void __init spear6xx_map_io(void);
38void __init spear6xx_init_irq(void); 39void __init spear6xx_init_irq(void);
39void __init spear6xx_init(void); 40void __init spear6xx_init(void);
diff --git a/arch/arm/mach-spear6xx/include/mach/hardware.h b/arch/arm/mach-spear6xx/include/mach/hardware.h
index 7545116deca9..0b3f96ae2848 100644
--- a/arch/arm/mach-spear6xx/include/mach/hardware.h
+++ b/arch/arm/mach-spear6xx/include/mach/hardware.h
@@ -14,8 +14,10 @@
14#ifndef __MACH_HARDWARE_H 14#ifndef __MACH_HARDWARE_H
15#define __MACH_HARDWARE_H 15#define __MACH_HARDWARE_H
16 16
17#include <plat/hardware.h>
18#include <mach/spear.h>
19
17/* Vitual to physical translation of statically mapped space */ 20/* Vitual to physical translation of statically mapped space */
18#define IO_ADDRESS(x) (x | 0xF0000000) 21#define IO_ADDRESS(x) (x | 0xF0000000)
19 22
20#endif /* __MACH_HARDWARE_H */ 23#endif /* __MACH_HARDWARE_H */
21
diff --git a/arch/arm/mach-spear6xx/include/mach/misc_regs.h b/arch/arm/mach-spear6xx/include/mach/misc_regs.h
index 03908036b0d0..68c20a007b0d 100644
--- a/arch/arm/mach-spear6xx/include/mach/misc_regs.h
+++ b/arch/arm/mach-spear6xx/include/mach/misc_regs.h
@@ -14,16 +14,16 @@
14#ifndef __MACH_MISC_REGS_H 14#ifndef __MACH_MISC_REGS_H
15#define __MACH_MISC_REGS_H 15#define __MACH_MISC_REGS_H
16 16
17#include <mach/spear.h> 17#include <mach/hardware.h>
18 18
19#define MISC_BASE VA_SPEAR6XX_ICM3_MISC_REG_BASE 19#define MISC_BASE IOMEM(VA_SPEAR6XX_ICM3_MISC_REG_BASE)
20 20
21#define SOC_CFG_CTR ((unsigned int *)(MISC_BASE + 0x000)) 21#define SOC_CFG_CTR (MISC_BASE + 0x000)
22#define DIAG_CFG_CTR ((unsigned int *)(MISC_BASE + 0x004)) 22#define DIAG_CFG_CTR (MISC_BASE + 0x004)
23#define PLL1_CTR ((unsigned int *)(MISC_BASE + 0x008)) 23#define PLL1_CTR (MISC_BASE + 0x008)
24#define PLL1_FRQ ((unsigned int *)(MISC_BASE + 0x00C)) 24#define PLL1_FRQ (MISC_BASE + 0x00C)
25#define PLL1_MOD ((unsigned int *)(MISC_BASE + 0x010)) 25#define PLL1_MOD (MISC_BASE + 0x010)
26#define PLL2_CTR ((unsigned int *)(MISC_BASE + 0x014)) 26#define PLL2_CTR (MISC_BASE + 0x014)
27/* PLL_CTR register masks */ 27/* PLL_CTR register masks */
28#define PLL_ENABLE 2 28#define PLL_ENABLE 2
29#define PLL_MODE_SHIFT 4 29#define PLL_MODE_SHIFT 4
@@ -33,7 +33,7 @@
33#define PLL_MODE_DITH_DSB 2 33#define PLL_MODE_DITH_DSB 2
34#define PLL_MODE_DITH_SSB 3 34#define PLL_MODE_DITH_SSB 3
35 35
36#define PLL2_FRQ ((unsigned int *)(MISC_BASE + 0x018)) 36#define PLL2_FRQ (MISC_BASE + 0x018)
37/* PLL FRQ register masks */ 37/* PLL FRQ register masks */
38#define PLL_DIV_N_SHIFT 0 38#define PLL_DIV_N_SHIFT 0
39#define PLL_DIV_N_MASK 0xFF 39#define PLL_DIV_N_MASK 0xFF
@@ -44,16 +44,16 @@
44#define PLL_DITH_FDBK_M_SHIFT 16 44#define PLL_DITH_FDBK_M_SHIFT 16
45#define PLL_DITH_FDBK_M_MASK 0xFFFF 45#define PLL_DITH_FDBK_M_MASK 0xFFFF
46 46
47#define PLL2_MOD ((unsigned int *)(MISC_BASE + 0x01C)) 47#define PLL2_MOD (MISC_BASE + 0x01C)
48#define PLL_CLK_CFG ((unsigned int *)(MISC_BASE + 0x020)) 48#define PLL_CLK_CFG (MISC_BASE + 0x020)
49#define CORE_CLK_CFG ((unsigned int *)(MISC_BASE + 0x024)) 49#define CORE_CLK_CFG (MISC_BASE + 0x024)
50/* CORE CLK CFG register masks */ 50/* CORE CLK CFG register masks */
51#define PLL_HCLK_RATIO_SHIFT 10 51#define PLL_HCLK_RATIO_SHIFT 10
52#define PLL_HCLK_RATIO_MASK 0x3 52#define PLL_HCLK_RATIO_MASK 0x3
53#define HCLK_PCLK_RATIO_SHIFT 8 53#define HCLK_PCLK_RATIO_SHIFT 8
54#define HCLK_PCLK_RATIO_MASK 0x3 54#define HCLK_PCLK_RATIO_MASK 0x3
55 55
56#define PERIP_CLK_CFG ((unsigned int *)(MISC_BASE + 0x028)) 56#define PERIP_CLK_CFG (MISC_BASE + 0x028)
57/* PERIP_CLK_CFG register masks */ 57/* PERIP_CLK_CFG register masks */
58#define CLCD_CLK_SHIFT 2 58#define CLCD_CLK_SHIFT 2
59#define CLCD_CLK_MASK 0x3 59#define CLCD_CLK_MASK 0x3
@@ -66,10 +66,10 @@
66#define GPT2_CLK_SHIFT 11 66#define GPT2_CLK_SHIFT 11
67#define GPT3_CLK_SHIFT 12 67#define GPT3_CLK_SHIFT 12
68#define GPT_CLK_MASK 0x1 68#define GPT_CLK_MASK 0x1
69#define AUX_CLK_PLL3_MASK 0 69#define AUX_CLK_PLL3_VAL 0
70#define AUX_CLK_PLL1_MASK 1 70#define AUX_CLK_PLL1_VAL 1
71 71
72#define PERIP1_CLK_ENB ((unsigned int *)(MISC_BASE + 0x02C)) 72#define PERIP1_CLK_ENB (MISC_BASE + 0x02C)
73/* PERIP1_CLK_ENB register masks */ 73/* PERIP1_CLK_ENB register masks */
74#define UART0_CLK_ENB 3 74#define UART0_CLK_ENB 3
75#define UART1_CLK_ENB 4 75#define UART1_CLK_ENB 4
@@ -95,34 +95,35 @@
95#define USBH0_CLK_ENB 25 95#define USBH0_CLK_ENB 25
96#define USBH1_CLK_ENB 26 96#define USBH1_CLK_ENB 26
97 97
98#define SOC_CORE_ID ((unsigned int *)(MISC_BASE + 0x030)) 98#define SOC_CORE_ID (MISC_BASE + 0x030)
99#define RAS_CLK_ENB ((unsigned int *)(MISC_BASE + 0x034)) 99#define RAS_CLK_ENB (MISC_BASE + 0x034)
100#define PERIP1_SOF_RST ((unsigned int *)(MISC_BASE + 0x038)) 100#define PERIP1_SOF_RST (MISC_BASE + 0x038)
101/* PERIP1_SOF_RST register masks */ 101/* PERIP1_SOF_RST register masks */
102#define JPEG_SOF_RST 8 102#define JPEG_SOF_RST 8
103 103
104#define SOC_USER_ID ((unsigned int *)(MISC_BASE + 0x03C)) 104#define SOC_USER_ID (MISC_BASE + 0x03C)
105#define RAS_SOF_RST ((unsigned int *)(MISC_BASE + 0x040)) 105#define RAS_SOF_RST (MISC_BASE + 0x040)
106#define PRSC1_CLK_CFG ((unsigned int *)(MISC_BASE + 0x044)) 106#define PRSC1_CLK_CFG (MISC_BASE + 0x044)
107#define PRSC2_CLK_CFG ((unsigned int *)(MISC_BASE + 0x048)) 107#define PRSC2_CLK_CFG (MISC_BASE + 0x048)
108#define PRSC3_CLK_CFG ((unsigned int *)(MISC_BASE + 0x04C)) 108#define PRSC3_CLK_CFG (MISC_BASE + 0x04C)
109/* gpt synthesizer register masks */ 109/* gpt synthesizer register masks */
110#define GPT_MSCALE_SHIFT 0 110#define GPT_MSCALE_SHIFT 0
111#define GPT_MSCALE_MASK 0xFFF 111#define GPT_MSCALE_MASK 0xFFF
112#define GPT_NSCALE_SHIFT 12 112#define GPT_NSCALE_SHIFT 12
113#define GPT_NSCALE_MASK 0xF 113#define GPT_NSCALE_MASK 0xF
114 114
115#define AMEM_CLK_CFG ((unsigned int *)(MISC_BASE + 0x050)) 115#define AMEM_CLK_CFG (MISC_BASE + 0x050)
116#define EXPI_CLK_CFG ((unsigned int *)(MISC_BASE + 0x054)) 116#define EXPI_CLK_CFG (MISC_BASE + 0x054)
117#define CLCD_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x05C)) 117#define CLCD_CLK_SYNT (MISC_BASE + 0x05C)
118#define FIRDA_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x060)) 118#define FIRDA_CLK_SYNT (MISC_BASE + 0x060)
119#define UART_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x064)) 119#define UART_CLK_SYNT (MISC_BASE + 0x064)
120#define GMAC_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x068)) 120#define GMAC_CLK_SYNT (MISC_BASE + 0x068)
121#define RAS1_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x06C)) 121#define RAS1_CLK_SYNT (MISC_BASE + 0x06C)
122#define RAS2_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x070)) 122#define RAS2_CLK_SYNT (MISC_BASE + 0x070)
123#define RAS3_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x074)) 123#define RAS3_CLK_SYNT (MISC_BASE + 0x074)
124#define RAS4_CLK_SYNT ((unsigned int *)(MISC_BASE + 0x078)) 124#define RAS4_CLK_SYNT (MISC_BASE + 0x078)
125/* aux clk synthesiser register masks for irda to ras4 */ 125/* aux clk synthesiser register masks for irda to ras4 */
126#define AUX_SYNT_ENB 31
126#define AUX_EQ_SEL_SHIFT 30 127#define AUX_EQ_SEL_SHIFT 30
127#define AUX_EQ_SEL_MASK 1 128#define AUX_EQ_SEL_MASK 1
128#define AUX_EQ1_SEL 0 129#define AUX_EQ1_SEL 0
@@ -132,42 +133,42 @@
132#define AUX_YSCALE_SHIFT 0 133#define AUX_YSCALE_SHIFT 0
133#define AUX_YSCALE_MASK 0xFFF 134#define AUX_YSCALE_MASK 0xFFF
134 135
135#define ICM1_ARB_CFG ((unsigned int *)(MISC_BASE + 0x07C)) 136#define ICM1_ARB_CFG (MISC_BASE + 0x07C)
136#define ICM2_ARB_CFG ((unsigned int *)(MISC_BASE + 0x080)) 137#define ICM2_ARB_CFG (MISC_BASE + 0x080)
137#define ICM3_ARB_CFG ((unsigned int *)(MISC_BASE + 0x084)) 138#define ICM3_ARB_CFG (MISC_BASE + 0x084)
138#define ICM4_ARB_CFG ((unsigned int *)(MISC_BASE + 0x088)) 139#define ICM4_ARB_CFG (MISC_BASE + 0x088)
139#define ICM5_ARB_CFG ((unsigned int *)(MISC_BASE + 0x08C)) 140#define ICM5_ARB_CFG (MISC_BASE + 0x08C)
140#define ICM6_ARB_CFG ((unsigned int *)(MISC_BASE + 0x090)) 141#define ICM6_ARB_CFG (MISC_BASE + 0x090)
141#define ICM7_ARB_CFG ((unsigned int *)(MISC_BASE + 0x094)) 142#define ICM7_ARB_CFG (MISC_BASE + 0x094)
142#define ICM8_ARB_CFG ((unsigned int *)(MISC_BASE + 0x098)) 143#define ICM8_ARB_CFG (MISC_BASE + 0x098)
143#define ICM9_ARB_CFG ((unsigned int *)(MISC_BASE + 0x09C)) 144#define ICM9_ARB_CFG (MISC_BASE + 0x09C)
144#define DMA_CHN_CFG ((unsigned int *)(MISC_BASE + 0x0A0)) 145#define DMA_CHN_CFG (MISC_BASE + 0x0A0)
145#define USB2_PHY_CFG ((unsigned int *)(MISC_BASE + 0x0A4)) 146#define USB2_PHY_CFG (MISC_BASE + 0x0A4)
146#define GMAC_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0A8)) 147#define GMAC_CFG_CTR (MISC_BASE + 0x0A8)
147#define EXPI_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0AC)) 148#define EXPI_CFG_CTR (MISC_BASE + 0x0AC)
148#define PRC1_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C0)) 149#define PRC1_LOCK_CTR (MISC_BASE + 0x0C0)
149#define PRC2_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C4)) 150#define PRC2_LOCK_CTR (MISC_BASE + 0x0C4)
150#define PRC3_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0C8)) 151#define PRC3_LOCK_CTR (MISC_BASE + 0x0C8)
151#define PRC4_LOCK_CTR ((unsigned int *)(MISC_BASE + 0x0CC)) 152#define PRC4_LOCK_CTR (MISC_BASE + 0x0CC)
152#define PRC1_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D0)) 153#define PRC1_IRQ_CTR (MISC_BASE + 0x0D0)
153#define PRC2_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D4)) 154#define PRC2_IRQ_CTR (MISC_BASE + 0x0D4)
154#define PRC3_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0D8)) 155#define PRC3_IRQ_CTR (MISC_BASE + 0x0D8)
155#define PRC4_IRQ_CTR ((unsigned int *)(MISC_BASE + 0x0DC)) 156#define PRC4_IRQ_CTR (MISC_BASE + 0x0DC)
156#define PWRDOWN_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0E0)) 157#define PWRDOWN_CFG_CTR (MISC_BASE + 0x0E0)
157#define COMPSSTL_1V8_CFG ((unsigned int *)(MISC_BASE + 0x0E4)) 158#define COMPSSTL_1V8_CFG (MISC_BASE + 0x0E4)
158#define COMPSSTL_2V5_CFG ((unsigned int *)(MISC_BASE + 0x0E8)) 159#define COMPSSTL_2V5_CFG (MISC_BASE + 0x0E8)
159#define COMPCOR_3V3_CFG ((unsigned int *)(MISC_BASE + 0x0EC)) 160#define COMPCOR_3V3_CFG (MISC_BASE + 0x0EC)
160#define SSTLPAD_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F0)) 161#define SSTLPAD_CFG_CTR (MISC_BASE + 0x0F0)
161#define BIST1_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F4)) 162#define BIST1_CFG_CTR (MISC_BASE + 0x0F4)
162#define BIST2_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0F8)) 163#define BIST2_CFG_CTR (MISC_BASE + 0x0F8)
163#define BIST3_CFG_CTR ((unsigned int *)(MISC_BASE + 0x0FC)) 164#define BIST3_CFG_CTR (MISC_BASE + 0x0FC)
164#define BIST4_CFG_CTR ((unsigned int *)(MISC_BASE + 0x100)) 165#define BIST4_CFG_CTR (MISC_BASE + 0x100)
165#define BIST5_CFG_CTR ((unsigned int *)(MISC_BASE + 0x104)) 166#define BIST5_CFG_CTR (MISC_BASE + 0x104)
166#define BIST1_STS_RES ((unsigned int *)(MISC_BASE + 0x108)) 167#define BIST1_STS_RES (MISC_BASE + 0x108)
167#define BIST2_STS_RES ((unsigned int *)(MISC_BASE + 0x10C)) 168#define BIST2_STS_RES (MISC_BASE + 0x10C)
168#define BIST3_STS_RES ((unsigned int *)(MISC_BASE + 0x110)) 169#define BIST3_STS_RES (MISC_BASE + 0x110)
169#define BIST4_STS_RES ((unsigned int *)(MISC_BASE + 0x114)) 170#define BIST4_STS_RES (MISC_BASE + 0x114)
170#define BIST5_STS_RES ((unsigned int *)(MISC_BASE + 0x118)) 171#define BIST5_STS_RES (MISC_BASE + 0x118)
171#define SYSERR_CFG_CTR ((unsigned int *)(MISC_BASE + 0x11C)) 172#define SYSERR_CFG_CTR (MISC_BASE + 0x11C)
172 173
173#endif /* __MACH_MISC_REGS_H */ 174#endif /* __MACH_MISC_REGS_H */
diff --git a/arch/arm/mach-spear6xx/include/mach/spear.h b/arch/arm/mach-spear6xx/include/mach/spear.h
index a835f5b6b182..7fd621532def 100644
--- a/arch/arm/mach-spear6xx/include/mach/spear.h
+++ b/arch/arm/mach-spear6xx/include/mach/spear.h
@@ -14,153 +14,70 @@
14#ifndef __MACH_SPEAR6XX_H 14#ifndef __MACH_SPEAR6XX_H
15#define __MACH_SPEAR6XX_H 15#define __MACH_SPEAR6XX_H
16 16
17#include <mach/hardware.h> 17#include <asm/memory.h>
18#include <mach/spear600.h> 18#include <mach/spear600.h>
19 19
20#define SPEAR6XX_ML_SDRAM_BASE 0x00000000 20#define SPEAR6XX_ML_SDRAM_BASE UL(0x00000000)
21#define SPEAR6XX_ML_SDRAM_SIZE 0x40000000
22
23/* ICM1 - Low speed connection */ 21/* ICM1 - Low speed connection */
24#define SPEAR6XX_ICM1_BASE 0xD0000000 22#define SPEAR6XX_ICM1_BASE UL(0xD0000000)
25#define SPEAR6XX_ICM1_SIZE 0x08000000
26 23
27#define SPEAR6XX_ICM1_UART0_BASE 0xD0000000 24#define SPEAR6XX_ICM1_UART0_BASE UL(0xD0000000)
28#define VA_SPEAR6XX_ICM1_UART0_BASE IO_ADDRESS(SPEAR6XX_ICM1_UART0_BASE) 25#define VA_SPEAR6XX_ICM1_UART0_BASE IO_ADDRESS(SPEAR6XX_ICM1_UART0_BASE)
29#define SPEAR6XX_ICM1_UART0_SIZE 0x00080000
30
31#define SPEAR6XX_ICM1_UART1_BASE 0xD0080000
32#define SPEAR6XX_ICM1_UART1_SIZE 0x00080000
33
34#define SPEAR6XX_ICM1_SSP0_BASE 0xD0100000
35#define SPEAR6XX_ICM1_SSP0_SIZE 0x00080000
36
37#define SPEAR6XX_ICM1_SSP1_BASE 0xD0180000
38#define SPEAR6XX_ICM1_SSP1_SIZE 0x00080000
39
40#define SPEAR6XX_ICM1_I2C_BASE 0xD0200000
41#define SPEAR6XX_ICM1_I2C_SIZE 0x00080000
42 26
43#define SPEAR6XX_ICM1_JPEG_BASE 0xD0800000 27#define SPEAR6XX_ICM1_UART1_BASE UL(0xD0080000)
44#define SPEAR6XX_ICM1_JPEG_SIZE 0x00800000 28#define SPEAR6XX_ICM1_SSP0_BASE UL(0xD0100000)
45 29#define SPEAR6XX_ICM1_SSP1_BASE UL(0xD0180000)
46#define SPEAR6XX_ICM1_IRDA_BASE 0xD1000000 30#define SPEAR6XX_ICM1_I2C_BASE UL(0xD0200000)
47#define SPEAR6XX_ICM1_IRDA_SIZE 0x00800000 31#define SPEAR6XX_ICM1_JPEG_BASE UL(0xD0800000)
48 32#define SPEAR6XX_ICM1_IRDA_BASE UL(0xD1000000)
49#define SPEAR6XX_ICM1_FSMC_BASE 0xD1800000 33#define SPEAR6XX_ICM1_FSMC_BASE UL(0xD1800000)
50#define SPEAR6XX_ICM1_FSMC_SIZE 0x00800000 34#define SPEAR6XX_ICM1_NAND_BASE UL(0xD2000000)
51 35#define SPEAR6XX_ICM1_SRAM_BASE UL(0xD2800000)
52#define SPEAR6XX_ICM1_NAND_BASE 0xD2000000
53#define SPEAR6XX_ICM1_NAND_SIZE 0x00800000
54
55#define SPEAR6XX_ICM1_SRAM_BASE 0xD2800000
56#define SPEAR6XX_ICM1_SRAM_SIZE 0x00800000
57 36
58/* ICM2 - Application Subsystem */ 37/* ICM2 - Application Subsystem */
59#define SPEAR6XX_ICM2_BASE 0xD8000000 38#define SPEAR6XX_ICM2_BASE UL(0xD8000000)
60#define SPEAR6XX_ICM2_SIZE 0x08000000 39#define SPEAR6XX_ICM2_TMR0_BASE UL(0xD8000000)
61 40#define SPEAR6XX_ICM2_TMR1_BASE UL(0xD8080000)
62#define SPEAR6XX_ICM2_TMR0_BASE 0xD8000000 41#define SPEAR6XX_ICM2_GPIO_BASE UL(0xD8100000)
63#define SPEAR6XX_ICM2_TMR0_SIZE 0x00080000 42#define SPEAR6XX_ICM2_SSP2_BASE UL(0xD8180000)
64 43#define SPEAR6XX_ICM2_ADC_BASE UL(0xD8200000)
65#define SPEAR6XX_ICM2_TMR1_BASE 0xD8080000
66#define SPEAR6XX_ICM2_TMR1_SIZE 0x00080000
67
68#define SPEAR6XX_ICM2_GPIO_BASE 0xD8100000
69#define SPEAR6XX_ICM2_GPIO_SIZE 0x00080000
70
71#define SPEAR6XX_ICM2_SPI2_BASE 0xD8180000
72#define SPEAR6XX_ICM2_SPI2_SIZE 0x00080000
73
74#define SPEAR6XX_ICM2_ADC_BASE 0xD8200000
75#define SPEAR6XX_ICM2_ADC_SIZE 0x00080000
76 44
77/* ML-1, 2 - Multi Layer CPU Subsystem */ 45/* ML-1, 2 - Multi Layer CPU Subsystem */
78#define SPEAR6XX_ML_CPU_BASE 0xF0000000 46#define SPEAR6XX_ML_CPU_BASE UL(0xF0000000)
79#define SPEAR6XX_ML_CPU_SIZE 0x08000000 47#define SPEAR6XX_CPU_TMR_BASE UL(0xF0000000)
80 48#define SPEAR6XX_CPU_GPIO_BASE UL(0xF0100000)
81#define SPEAR6XX_CPU_TMR_BASE 0xF0000000 49#define SPEAR6XX_CPU_VIC_SEC_BASE UL(0xF1000000)
82#define SPEAR6XX_CPU_TMR_SIZE 0x00100000
83
84#define SPEAR6XX_CPU_GPIO_BASE 0xF0100000
85#define SPEAR6XX_CPU_GPIO_SIZE 0x00100000
86
87#define SPEAR6XX_CPU_VIC_SEC_BASE 0xF1000000
88#define VA_SPEAR6XX_CPU_VIC_SEC_BASE IO_ADDRESS(SPEAR6XX_CPU_VIC_SEC_BASE) 50#define VA_SPEAR6XX_CPU_VIC_SEC_BASE IO_ADDRESS(SPEAR6XX_CPU_VIC_SEC_BASE)
89#define SPEAR6XX_CPU_VIC_SEC_SIZE 0x00100000 51#define SPEAR6XX_CPU_VIC_PRI_BASE UL(0xF1100000)
90
91#define SPEAR6XX_CPU_VIC_PRI_BASE 0xF1100000
92#define VA_SPEAR6XX_CPU_VIC_PRI_BASE IO_ADDRESS(SPEAR6XX_CPU_VIC_PRI_BASE) 52#define VA_SPEAR6XX_CPU_VIC_PRI_BASE IO_ADDRESS(SPEAR6XX_CPU_VIC_PRI_BASE)
93#define SPEAR6XX_CPU_VIC_PRI_SIZE 0x00100000
94 53
95/* ICM3 - Basic Subsystem */ 54/* ICM3 - Basic Subsystem */
96#define SPEAR6XX_ICM3_BASE 0xF8000000 55#define SPEAR6XX_ICM3_BASE UL(0xF8000000)
97#define SPEAR6XX_ICM3_SIZE 0x08000000 56#define SPEAR6XX_ICM3_SMEM_BASE UL(0xF8000000)
98 57#define SPEAR6XX_ICM3_SMI_CTRL_BASE UL(0xFC000000)
99#define SPEAR6XX_ICM3_SMEM_BASE 0xF8000000 58#define SPEAR6XX_ICM3_CLCD_BASE UL(0xFC200000)
100#define SPEAR6XX_ICM3_SMEM_SIZE 0x04000000 59#define SPEAR6XX_ICM3_DMA_BASE UL(0xFC400000)
101 60#define SPEAR6XX_ICM3_SDRAM_CTRL_BASE UL(0xFC600000)
102#define SPEAR6XX_ICM3_SMI_CTRL_BASE 0xFC000000 61#define SPEAR6XX_ICM3_TMR_BASE UL(0xFC800000)
103#define SPEAR6XX_ICM3_SMI_CTRL_SIZE 0x00200000 62#define SPEAR6XX_ICM3_WDT_BASE UL(0xFC880000)
104 63#define SPEAR6XX_ICM3_RTC_BASE UL(0xFC900000)
105#define SPEAR6XX_ICM3_CLCD_BASE 0xFC200000 64#define SPEAR6XX_ICM3_GPIO_BASE UL(0xFC980000)
106#define SPEAR6XX_ICM3_CLCD_SIZE 0x00200000 65#define SPEAR6XX_ICM3_SYS_CTRL_BASE UL(0xFCA00000)
107
108#define SPEAR6XX_ICM3_DMA_BASE 0xFC400000
109#define SPEAR6XX_ICM3_DMA_SIZE 0x00200000
110
111#define SPEAR6XX_ICM3_SDRAM_CTRL_BASE 0xFC600000
112#define SPEAR6XX_ICM3_SDRAM_CTRL_SIZE 0x00200000
113
114#define SPEAR6XX_ICM3_TMR_BASE 0xFC800000
115#define SPEAR6XX_ICM3_TMR_SIZE 0x00080000
116
117#define SPEAR6XX_ICM3_WDT_BASE 0xFC880000
118#define SPEAR6XX_ICM3_WDT_SIZE 0x00080000
119
120#define SPEAR6XX_ICM3_RTC_BASE 0xFC900000
121#define SPEAR6XX_ICM3_RTC_SIZE 0x00080000
122
123#define SPEAR6XX_ICM3_GPIO_BASE 0xFC980000
124#define SPEAR6XX_ICM3_GPIO_SIZE 0x00080000
125
126#define SPEAR6XX_ICM3_SYS_CTRL_BASE 0xFCA00000
127#define VA_SPEAR6XX_ICM3_SYS_CTRL_BASE IO_ADDRESS(SPEAR6XX_ICM3_SYS_CTRL_BASE) 66#define VA_SPEAR6XX_ICM3_SYS_CTRL_BASE IO_ADDRESS(SPEAR6XX_ICM3_SYS_CTRL_BASE)
128#define SPEAR6XX_ICM3_SYS_CTRL_SIZE 0x00080000 67#define SPEAR6XX_ICM3_MISC_REG_BASE UL(0xFCA80000)
129
130#define SPEAR6XX_ICM3_MISC_REG_BASE 0xFCA80000
131#define VA_SPEAR6XX_ICM3_MISC_REG_BASE IO_ADDRESS(SPEAR6XX_ICM3_MISC_REG_BASE) 68#define VA_SPEAR6XX_ICM3_MISC_REG_BASE IO_ADDRESS(SPEAR6XX_ICM3_MISC_REG_BASE)
132#define SPEAR6XX_ICM3_MISC_REG_SIZE 0x00080000
133 69
134/* ICM4 - High Speed Connection */ 70/* ICM4 - High Speed Connection */
135#define SPEAR6XX_ICM4_BASE 0xE0000000 71#define SPEAR6XX_ICM4_BASE UL(0xE0000000)
136#define SPEAR6XX_ICM4_SIZE 0x08000000 72#define SPEAR6XX_ICM4_GMAC_BASE UL(0xE0800000)
137 73#define SPEAR6XX_ICM4_USBD_FIFO_BASE UL(0xE1000000)
138#define SPEAR6XX_ICM4_GMAC_BASE 0xE0800000 74#define SPEAR6XX_ICM4_USBD_CSR_BASE UL(0xE1100000)
139#define SPEAR6XX_ICM4_GMAC_SIZE 0x00800000 75#define SPEAR6XX_ICM4_USBD_PLDT_BASE UL(0xE1200000)
140 76#define SPEAR6XX_ICM4_USB_EHCI0_BASE UL(0xE1800000)
141#define SPEAR6XX_ICM4_USBD_FIFO_BASE 0xE1000000 77#define SPEAR6XX_ICM4_USB_OHCI0_BASE UL(0xE1900000)
142#define SPEAR6XX_ICM4_USBD_FIFO_SIZE 0x00100000 78#define SPEAR6XX_ICM4_USB_EHCI1_BASE UL(0xE2000000)
143 79#define SPEAR6XX_ICM4_USB_OHCI1_BASE UL(0xE2100000)
144#define SPEAR6XX_ICM4_USBD_CSR_BASE 0xE1100000 80#define SPEAR6XX_ICM4_USB_ARB_BASE UL(0xE2800000)
145#define SPEAR6XX_ICM4_USBD_CSR_SIZE 0x00100000
146
147#define SPEAR6XX_ICM4_USBD_PLDT_BASE 0xE1200000
148#define SPEAR6XX_ICM4_USBD_PLDT_SIZE 0x00100000
149
150#define SPEAR6XX_ICM4_USB_EHCI0_BASE 0xE1800000
151#define SPEAR6XX_ICM4_USB_EHCI0_SIZE 0x00100000
152
153#define SPEAR6XX_ICM4_USB_OHCI0_BASE 0xE1900000
154#define SPEAR6XX_ICM4_USB_OHCI0_SIZE 0x00100000
155
156#define SPEAR6XX_ICM4_USB_EHCI1_BASE 0xE2000000
157#define SPEAR6XX_ICM4_USB_EHCI1_SIZE 0x00100000
158
159#define SPEAR6XX_ICM4_USB_OHCI1_BASE 0xE2100000
160#define SPEAR6XX_ICM4_USB_OHCI1_SIZE 0x00100000
161
162#define SPEAR6XX_ICM4_USB_ARB_BASE 0xE2800000
163#define SPEAR6XX_ICM4_USB_ARB_SIZE 0x00010000
164 81
165/* Debug uart for linux, will be used for debug and uncompress messages */ 82/* Debug uart for linux, will be used for debug and uncompress messages */
166#define SPEAR_DBG_UART_BASE SPEAR6XX_ICM1_UART0_BASE 83#define SPEAR_DBG_UART_BASE SPEAR6XX_ICM1_UART0_BASE
diff --git a/arch/arm/mach-spear6xx/spear600.c b/arch/arm/mach-spear6xx/spear600.c
index 5c484c433dc1..d0e6eeae9b04 100644
--- a/arch/arm/mach-spear6xx/spear600.c
+++ b/arch/arm/mach-spear6xx/spear600.c
@@ -14,7 +14,7 @@
14#include <linux/ptrace.h> 14#include <linux/ptrace.h>
15#include <asm/irq.h> 15#include <asm/irq.h>
16#include <mach/generic.h> 16#include <mach/generic.h>
17#include <mach/spear.h> 17#include <mach/hardware.h>
18 18
19/* Add spear600 specific devices here */ 19/* Add spear600 specific devices here */
20 20
diff --git a/arch/arm/mach-spear6xx/spear600_evb.c b/arch/arm/mach-spear6xx/spear600_evb.c
index daff8d04f7b6..f19cefe91a2b 100644
--- a/arch/arm/mach-spear6xx/spear600_evb.c
+++ b/arch/arm/mach-spear6xx/spear600_evb.c
@@ -14,7 +14,7 @@
14#include <asm/mach/arch.h> 14#include <asm/mach/arch.h>
15#include <asm/mach-types.h> 15#include <asm/mach-types.h>
16#include <mach/generic.h> 16#include <mach/generic.h>
17#include <mach/spear.h> 17#include <mach/hardware.h>
18 18
19static struct amba_device *amba_devs[] __initdata = { 19static struct amba_device *amba_devs[] __initdata = {
20 &gpio_device[0], 20 &gpio_device[0],
@@ -46,6 +46,6 @@ MACHINE_START(SPEAR600, "ST-SPEAR600-EVB")
46 .boot_params = 0x00000100, 46 .boot_params = 0x00000100,
47 .map_io = spear6xx_map_io, 47 .map_io = spear6xx_map_io,
48 .init_irq = spear6xx_init_irq, 48 .init_irq = spear6xx_init_irq,
49 .timer = &spear_sys_timer, 49 .timer = &spear6xx_timer,
50 .init_machine = spear600_evb_init, 50 .init_machine = spear600_evb_init,
51MACHINE_END 51MACHINE_END
diff --git a/arch/arm/mach-spear6xx/spear6xx.c b/arch/arm/mach-spear6xx/spear6xx.c
index f2fe14e8471d..981812961ac7 100644
--- a/arch/arm/mach-spear6xx/spear6xx.c
+++ b/arch/arm/mach-spear6xx/spear6xx.c
@@ -18,9 +18,9 @@
18#include <asm/hardware/vic.h> 18#include <asm/hardware/vic.h>
19#include <asm/irq.h> 19#include <asm/irq.h>
20#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
21#include <mach/irqs.h>
22#include <mach/generic.h> 21#include <mach/generic.h>
23#include <mach/spear.h> 22#include <mach/hardware.h>
23#include <mach/irqs.h>
24 24
25/* Add spear6xx machines common devices here */ 25/* Add spear6xx machines common devices here */
26/* uart device registration */ 26/* uart device registration */
@@ -31,8 +31,7 @@ struct amba_device uart_device[] = {
31 }, 31 },
32 .res = { 32 .res = {
33 .start = SPEAR6XX_ICM1_UART0_BASE, 33 .start = SPEAR6XX_ICM1_UART0_BASE,
34 .end = SPEAR6XX_ICM1_UART0_BASE + 34 .end = SPEAR6XX_ICM1_UART0_BASE + SZ_4K - 1,
35 SPEAR6XX_ICM1_UART0_SIZE - 1,
36 .flags = IORESOURCE_MEM, 35 .flags = IORESOURCE_MEM,
37 }, 36 },
38 .irq = {IRQ_UART_0, NO_IRQ}, 37 .irq = {IRQ_UART_0, NO_IRQ},
@@ -42,8 +41,7 @@ struct amba_device uart_device[] = {
42 }, 41 },
43 .res = { 42 .res = {
44 .start = SPEAR6XX_ICM1_UART1_BASE, 43 .start = SPEAR6XX_ICM1_UART1_BASE,
45 .end = SPEAR6XX_ICM1_UART1_BASE + 44 .end = SPEAR6XX_ICM1_UART1_BASE + SZ_4K - 1,
46 SPEAR6XX_ICM1_UART1_SIZE - 1,
47 .flags = IORESOURCE_MEM, 45 .flags = IORESOURCE_MEM,
48 }, 46 },
49 .irq = {IRQ_UART_1, NO_IRQ}, 47 .irq = {IRQ_UART_1, NO_IRQ},
@@ -72,8 +70,7 @@ struct amba_device gpio_device[] = {
72 }, 70 },
73 .res = { 71 .res = {
74 .start = SPEAR6XX_CPU_GPIO_BASE, 72 .start = SPEAR6XX_CPU_GPIO_BASE,
75 .end = SPEAR6XX_CPU_GPIO_BASE + 73 .end = SPEAR6XX_CPU_GPIO_BASE + SZ_4K - 1,
76 SPEAR6XX_CPU_GPIO_SIZE - 1,
77 .flags = IORESOURCE_MEM, 74 .flags = IORESOURCE_MEM,
78 }, 75 },
79 .irq = {IRQ_LOCAL_GPIO, NO_IRQ}, 76 .irq = {IRQ_LOCAL_GPIO, NO_IRQ},
@@ -84,8 +81,7 @@ struct amba_device gpio_device[] = {
84 }, 81 },
85 .res = { 82 .res = {
86 .start = SPEAR6XX_ICM3_GPIO_BASE, 83 .start = SPEAR6XX_ICM3_GPIO_BASE,
87 .end = SPEAR6XX_ICM3_GPIO_BASE + 84 .end = SPEAR6XX_ICM3_GPIO_BASE + SZ_4K - 1,
88 SPEAR6XX_ICM3_GPIO_SIZE - 1,
89 .flags = IORESOURCE_MEM, 85 .flags = IORESOURCE_MEM,
90 }, 86 },
91 .irq = {IRQ_BASIC_GPIO, NO_IRQ}, 87 .irq = {IRQ_BASIC_GPIO, NO_IRQ},
@@ -96,8 +92,7 @@ struct amba_device gpio_device[] = {
96 }, 92 },
97 .res = { 93 .res = {
98 .start = SPEAR6XX_ICM2_GPIO_BASE, 94 .start = SPEAR6XX_ICM2_GPIO_BASE,
99 .end = SPEAR6XX_ICM2_GPIO_BASE + 95 .end = SPEAR6XX_ICM2_GPIO_BASE + SZ_4K - 1,
100 SPEAR6XX_ICM2_GPIO_SIZE - 1,
101 .flags = IORESOURCE_MEM, 96 .flags = IORESOURCE_MEM,
102 }, 97 },
103 .irq = {IRQ_APPL_GPIO, NO_IRQ}, 98 .irq = {IRQ_APPL_GPIO, NO_IRQ},
@@ -122,27 +117,27 @@ static struct map_desc spear6xx_io_desc[] __initdata = {
122 { 117 {
123 .virtual = VA_SPEAR6XX_ICM1_UART0_BASE, 118 .virtual = VA_SPEAR6XX_ICM1_UART0_BASE,
124 .pfn = __phys_to_pfn(SPEAR6XX_ICM1_UART0_BASE), 119 .pfn = __phys_to_pfn(SPEAR6XX_ICM1_UART0_BASE),
125 .length = SPEAR6XX_ICM1_UART0_SIZE, 120 .length = SZ_4K,
126 .type = MT_DEVICE 121 .type = MT_DEVICE
127 }, { 122 }, {
128 .virtual = VA_SPEAR6XX_CPU_VIC_PRI_BASE, 123 .virtual = VA_SPEAR6XX_CPU_VIC_PRI_BASE,
129 .pfn = __phys_to_pfn(SPEAR6XX_CPU_VIC_PRI_BASE), 124 .pfn = __phys_to_pfn(SPEAR6XX_CPU_VIC_PRI_BASE),
130 .length = SPEAR6XX_CPU_VIC_PRI_SIZE, 125 .length = SZ_4K,
131 .type = MT_DEVICE 126 .type = MT_DEVICE
132 }, { 127 }, {
133 .virtual = VA_SPEAR6XX_CPU_VIC_SEC_BASE, 128 .virtual = VA_SPEAR6XX_CPU_VIC_SEC_BASE,
134 .pfn = __phys_to_pfn(SPEAR6XX_CPU_VIC_SEC_BASE), 129 .pfn = __phys_to_pfn(SPEAR6XX_CPU_VIC_SEC_BASE),
135 .length = SPEAR6XX_CPU_VIC_SEC_SIZE, 130 .length = SZ_4K,
136 .type = MT_DEVICE 131 .type = MT_DEVICE
137 }, { 132 }, {
138 .virtual = VA_SPEAR6XX_ICM3_SYS_CTRL_BASE, 133 .virtual = VA_SPEAR6XX_ICM3_SYS_CTRL_BASE,
139 .pfn = __phys_to_pfn(SPEAR6XX_ICM3_SYS_CTRL_BASE), 134 .pfn = __phys_to_pfn(SPEAR6XX_ICM3_SYS_CTRL_BASE),
140 .length = SPEAR6XX_ICM3_MISC_REG_BASE, 135 .length = SZ_4K,
141 .type = MT_DEVICE 136 .type = MT_DEVICE
142 }, { 137 }, {
143 .virtual = VA_SPEAR6XX_ICM3_MISC_REG_BASE, 138 .virtual = VA_SPEAR6XX_ICM3_MISC_REG_BASE,
144 .pfn = __phys_to_pfn(SPEAR6XX_ICM3_MISC_REG_BASE), 139 .pfn = __phys_to_pfn(SPEAR6XX_ICM3_MISC_REG_BASE),
145 .length = SPEAR6XX_ICM3_MISC_REG_SIZE, 140 .length = SZ_4K,
146 .type = MT_DEVICE 141 .type = MT_DEVICE
147 }, 142 },
148}; 143};
@@ -155,3 +150,34 @@ void __init spear6xx_map_io(void)
155 /* This will initialize clock framework */ 150 /* This will initialize clock framework */
156 clk_init(); 151 clk_init();
157} 152}
153
154static void __init spear6xx_timer_init(void)
155{
156 char pclk_name[] = "pll3_48m_clk";
157 struct clk *gpt_clk, *pclk;
158
159 /* get the system timer clock */
160 gpt_clk = clk_get_sys("gpt0", NULL);
161 if (IS_ERR(gpt_clk)) {
162 pr_err("%s:couldn't get clk for gpt\n", __func__);
163 BUG();
164 }
165
166 /* get the suitable parent clock for timer*/
167 pclk = clk_get(NULL, pclk_name);
168 if (IS_ERR(pclk)) {
169 pr_err("%s:couldn't get %s as parent for gpt\n",
170 __func__, pclk_name);
171 BUG();
172 }
173
174 clk_set_parent(gpt_clk, pclk);
175 clk_put(gpt_clk);
176 clk_put(pclk);
177
178 spear_setup_timer();
179}
180
181struct sys_timer spear6xx_timer = {
182 .init = spear6xx_timer_init,
183};
diff --git a/arch/arm/mach-tcc8k/board-tcc8000-sdk.c b/arch/arm/mach-tcc8k/board-tcc8000-sdk.c
index 7991415e666b..4cb3c2dd905c 100644
--- a/arch/arm/mach-tcc8k/board-tcc8000-sdk.c
+++ b/arch/arm/mach-tcc8k/board-tcc8000-sdk.c
@@ -6,6 +6,7 @@
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8 8
9#include <linux/delay.h>
9#include <linux/init.h> 10#include <linux/init.h>
10#include <linux/kernel.h> 11#include <linux/kernel.h>
11#include <linux/platform_device.h> 12#include <linux/platform_device.h>
@@ -17,6 +18,8 @@
17#include <asm/mach/time.h> 18#include <asm/mach/time.h>
18 19
19#include <mach/clock.h> 20#include <mach/clock.h>
21#include <mach/tcc-nand.h>
22#include <mach/tcc8k-regs.h>
20 23
21#include "common.h" 24#include "common.h"
22 25
@@ -51,10 +54,26 @@ static struct sys_timer tcc8k_timer = {
51static void __init tcc8k_map_io(void) 54static void __init tcc8k_map_io(void)
52{ 55{
53 tcc8k_map_common_io(); 56 tcc8k_map_common_io();
57
58 /* set PLL0 clock to 96MHz, adapt UART0 divisor */
59 __raw_writel(0x00026003, CKC_BASE + PLL0CFG_OFFS);
60 __raw_writel(0x10000001, CKC_BASE + ACLKUART0_OFFS);
61
62 /* set PLL1 clock to 192MHz */
63 __raw_writel(0x00016003, CKC_BASE + PLL1CFG_OFFS);
64
65 /* set PLL2 clock to 48MHz */
66 __raw_writel(0x00036003, CKC_BASE + PLL2CFG_OFFS);
67
68 /* with CPU freq higher than 150 MHz, need extra DTCM wait */
69 __raw_writel(0x00000001, SCFG_BASE + DTCMWAIT_OFFS);
70
71 /* PLL locking time as specified */
72 udelay(300);
54} 73}
55 74
56MACHINE_START(TCC8000_SDK, "Telechips TCC8000-SDK Demo Board") 75MACHINE_START(TCC8000_SDK, "Telechips TCC8000-SDK Demo Board")
57 .boot_params = PHYS_OFFSET + 0x00000100, 76 .boot_params = PLAT_PHYS_OFFSET + 0x00000100,
58 .map_io = tcc8k_map_io, 77 .map_io = tcc8k_map_io,
59 .init_irq = tcc8k_init_irq, 78 .init_irq = tcc8k_init_irq,
60 .init_machine = tcc8k_init, 79 .init_machine = tcc8k_init,
diff --git a/arch/arm/mach-tcc8k/clock.c b/arch/arm/mach-tcc8k/clock.c
index 3970a9cdce26..e7cdae5c77a4 100644
--- a/arch/arm/mach-tcc8k/clock.c
+++ b/arch/arm/mach-tcc8k/clock.c
@@ -45,11 +45,12 @@
45#define ACLKGSB1 (CKC_BASE + ACLKGSB1_OFFS) 45#define ACLKGSB1 (CKC_BASE + ACLKGSB1_OFFS)
46#define ACLKGSB2 (CKC_BASE + ACLKGSB2_OFFS) 46#define ACLKGSB2 (CKC_BASE + ACLKGSB2_OFFS)
47#define ACLKGSB3 (CKC_BASE + ACLKGSB3_OFFS) 47#define ACLKGSB3 (CKC_BASE + ACLKGSB3_OFFS)
48#define ACLKUSBH (CKC_BASE + ACLKUSBH_OFFS)
49#define ACLKTCT (CKC_BASE + ACLKTCT_OFFS) 48#define ACLKTCT (CKC_BASE + ACLKTCT_OFFS)
50#define ACLKTCX (CKC_BASE + ACLKTCX_OFFS) 49#define ACLKTCX (CKC_BASE + ACLKTCX_OFFS)
51#define ACLKTCZ (CKC_BASE + ACLKTCZ_OFFS) 50#define ACLKTCZ (CKC_BASE + ACLKTCZ_OFFS)
52 51
52#define ACLK_MAX_DIV (0xfff + 1)
53
53/* Crystal frequencies */ 54/* Crystal frequencies */
54static unsigned long xi_rate, xti_rate; 55static unsigned long xi_rate, xti_rate;
55 56
@@ -106,9 +107,9 @@ static int root_clk_enable(enum root_clks src)
106 return 0; 107 return 0;
107} 108}
108 109
109static int root_clk_disable(enum root_clks root_src) 110static int root_clk_disable(enum root_clks src)
110{ 111{
111 switch (root_src) { 112 switch (src) {
112 case CLK_SRC_PLL0: return pll_enable(0, 0); 113 case CLK_SRC_PLL0: return pll_enable(0, 0);
113 case CLK_SRC_PLL1: return pll_enable(1, 0); 114 case CLK_SRC_PLL1: return pll_enable(1, 0);
114 case CLK_SRC_PLL2: return pll_enable(2, 0); 115 case CLK_SRC_PLL2: return pll_enable(2, 0);
@@ -197,7 +198,7 @@ static unsigned long get_rate_pll_div(int pll)
197 addr = CKC_BASE + CLKDIVC1_OFFS; 198 addr = CKC_BASE + CLKDIVC1_OFFS;
198 reg = __raw_readl(addr); 199 reg = __raw_readl(addr);
199 if (reg & CLKDIVC1_P2E) 200 if (reg & CLKDIVC1_P2E)
200 div = __raw_readl(addr) & 0x3f; 201 div = reg & 0x3f;
201 break; 202 break;
202 } 203 }
203 return get_rate_pll(pll) / (div + 1); 204 return get_rate_pll(pll) / (div + 1);
@@ -258,14 +259,19 @@ static unsigned long aclk_best_div(struct clk *clk, unsigned long rate)
258{ 259{
259 unsigned long div, src, freq, r1, r2; 260 unsigned long div, src, freq, r1, r2;
260 261
262 if (!rate)
263 return ACLK_MAX_DIV;
264
261 src = __raw_readl(clk->aclkreg) >> ACLK_SEL_SHIFT; 265 src = __raw_readl(clk->aclkreg) >> ACLK_SEL_SHIFT;
262 src &= CLK_SRC_MASK; 266 src &= CLK_SRC_MASK;
263 freq = root_clk_get_rate(src); 267 freq = root_clk_get_rate(src);
264 div = freq / rate + 1; 268 div = freq / rate;
269 if (!div)
270 return 1;
271 if (div >= ACLK_MAX_DIV)
272 return ACLK_MAX_DIV;
265 r1 = freq / div; 273 r1 = freq / div;
266 r2 = freq / (div + 1); 274 r2 = freq / (div + 1);
267 if (r2 >= rate)
268 return div + 1;
269 if ((rate - r2) < (r1 - rate)) 275 if ((rate - r2) < (r1 - rate))
270 return div + 1; 276 return div + 1;
271 277
@@ -287,7 +293,8 @@ static int aclk_set_rate(struct clk *clk, unsigned long rate)
287 u32 reg; 293 u32 reg;
288 294
289 reg = __raw_readl(clk->aclkreg) & ~ACLK_DIV_MASK; 295 reg = __raw_readl(clk->aclkreg) & ~ACLK_DIV_MASK;
290 reg |= aclk_best_div(clk, rate); 296 reg |= aclk_best_div(clk, rate) - 1;
297 __raw_writel(reg, clk->aclkreg);
291 return 0; 298 return 0;
292} 299}
293 300
@@ -296,15 +303,22 @@ static unsigned long get_rate_sys(struct clk *clk)
296 unsigned int src; 303 unsigned int src;
297 304
298 src = __raw_readl(CKC_BASE + CLKCTRL_OFFS) & CLK_SRC_MASK; 305 src = __raw_readl(CKC_BASE + CLKCTRL_OFFS) & CLK_SRC_MASK;
299 return root_clk_get_rate(src); 306 return root_clk_get_rate(src);
300} 307}
301 308
302static unsigned long get_rate_bus(struct clk *clk) 309static unsigned long get_rate_bus(struct clk *clk)
303{ 310{
304 unsigned int div; 311 unsigned int reg, sdiv, bdiv, rate;
305 312
306 div = (__raw_readl(CKC_BASE + CLKCTRL_OFFS) >> 4) & 0xff; 313 reg = __raw_readl(CKC_BASE + CLKCTRL_OFFS);
307 return get_rate_sys(clk) / (div + 1); 314 rate = get_rate_sys(clk);
315 sdiv = (reg >> 20) & 3;
316 if (sdiv)
317 rate /= sdiv + 1;
318 bdiv = (reg >> 4) & 0xff;
319 if (bdiv)
320 rate /= bdiv + 1;
321 return rate;
308} 322}
309 323
310static unsigned long get_rate_cpu(struct clk *clk) 324static unsigned long get_rate_cpu(struct clk *clk)
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index acd9552f8ada..3cdeffc97b44 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -10,6 +10,9 @@ config ARCH_TEGRA_2x_SOC
10 select CPU_V7 10 select CPU_V7
11 select ARM_GIC 11 select ARM_GIC
12 select ARCH_REQUIRE_GPIOLIB 12 select ARCH_REQUIRE_GPIOLIB
13 select USB_ARCH_HAS_EHCI if USB_SUPPORT
14 select USB_ULPI if USB_SUPPORT
15 select USB_ULPI_VIEWPORT if USB_SUPPORT
13 help 16 help
14 Support for NVIDIA Tegra AP20 and T20 processors, based on the 17 Support for NVIDIA Tegra AP20 and T20 processors, based on the
15 ARM CortexA9MP CPU and the ARM PL310 L2 cache controller 18 ARM CortexA9MP CPU and the ARM PL310 L2 cache controller
@@ -27,6 +30,36 @@ config MACH_HARMONY
27 help 30 help
28 Support for nVidia Harmony development platform 31 Support for nVidia Harmony development platform
29 32
33config MACH_KAEN
34 bool "Kaen board"
35 select MACH_SEABOARD
36 help
37 Support for the Kaen version of Seaboard
38
39config MACH_PAZ00
40 bool "Paz00 board"
41 help
42 Support for the Toshiba AC100/Dynabook AZ netbook
43
44config MACH_SEABOARD
45 bool "Seaboard board"
46 help
47 Support for nVidia Seaboard development platform. It will
48 also be included for some of the derivative boards that
49 have large similarities with the seaboard design.
50
51config MACH_TRIMSLICE
52 bool "TrimSlice board"
53 select TEGRA_PCI
54 help
55 Support for CompuLab TrimSlice platform
56
57config MACH_WARIO
58 bool "Wario board"
59 select MACH_SEABOARD
60 help
61 Support for the Wario version of Seaboard
62
30choice 63choice
31 prompt "Low-level debug console UART" 64 prompt "Low-level debug console UART"
32 default TEGRA_DEBUG_UART_NONE 65 default TEGRA_DEBUG_UART_NONE
@@ -58,4 +91,7 @@ config TEGRA_SYSTEM_DMA
58 Adds system DMA functionality for NVIDIA Tegra SoCs, used by 91 Adds system DMA functionality for NVIDIA Tegra SoCs, used by
59 several Tegra device drivers 92 several Tegra device drivers
60 93
94config TEGRA_EMC_SCALING_ENABLE
95 bool "Enable scaling the memory frequency"
96
61endif 97endif
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index cdbc68e4c0ca..1afe05038c27 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -1,21 +1,34 @@
1obj-y += common.o 1obj-y += common.o
2obj-y += devices.o
2obj-y += io.o 3obj-y += io.o
3obj-y += irq.o legacy_irq.o 4obj-y += irq.o legacy_irq.o
4obj-y += clock.o 5obj-y += clock.o
5obj-y += timer.o 6obj-y += timer.o
6obj-y += gpio.o 7obj-y += gpio.o
7obj-y += pinmux.o 8obj-y += pinmux.o
9obj-y += powergate.o
8obj-y += fuse.o 10obj-y += fuse.o
9obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += clock.o 11obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += clock.o
10obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_clocks.o 12obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_clocks.o
11obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_dvfs.o 13obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_emc.o
12obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += pinmux-t2-tables.o 14obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += pinmux-t2-tables.o
13obj-$(CONFIG_SMP) += platsmp.o localtimer.o headsmp.o 15obj-$(CONFIG_SMP) += platsmp.o localtimer.o headsmp.o
14obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 16obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
15obj-$(CONFIG_TEGRA_SYSTEM_DMA) += dma.o 17obj-$(CONFIG_TEGRA_SYSTEM_DMA) += dma.o
16obj-$(CONFIG_CPU_FREQ) += cpu-tegra.o 18obj-$(CONFIG_CPU_FREQ) += cpu-tegra.o
17obj-$(CONFIG_TEGRA_PCI) += pcie.o 19obj-$(CONFIG_TEGRA_PCI) += pcie.o
20obj-$(CONFIG_USB_SUPPORT) += usb_phy.o
18 21
19obj-${CONFIG_MACH_HARMONY} += board-harmony.o 22obj-${CONFIG_MACH_HARMONY} += board-harmony.o
20obj-${CONFIG_MACH_HARMONY} += board-harmony-pinmux.o 23obj-${CONFIG_MACH_HARMONY} += board-harmony-pinmux.o
21obj-${CONFIG_MACH_HARMONY} += board-harmony-pcie.o 24obj-${CONFIG_MACH_HARMONY} += board-harmony-pcie.o
25obj-${CONFIG_MACH_HARMONY} += board-harmony-power.o
26
27obj-${CONFIG_MACH_PAZ00} += board-paz00.o
28obj-${CONFIG_MACH_PAZ00} += board-paz00-pinmux.o
29
30obj-${CONFIG_MACH_SEABOARD} += board-seaboard.o
31obj-${CONFIG_MACH_SEABOARD} += board-seaboard-pinmux.o
32
33obj-${CONFIG_MACH_TRIMSLICE} += board-trimslice.o
34obj-${CONFIG_MACH_TRIMSLICE} += board-trimslice-pinmux.o
diff --git a/arch/arm/mach-tegra/board-harmony-pcie.c b/arch/arm/mach-tegra/board-harmony-pcie.c
index f7e7d4514b6a..9c27b95b8d86 100644
--- a/arch/arm/mach-tegra/board-harmony-pcie.c
+++ b/arch/arm/mach-tegra/board-harmony-pcie.c
@@ -27,13 +27,29 @@
27 27
28#ifdef CONFIG_TEGRA_PCI 28#ifdef CONFIG_TEGRA_PCI
29 29
30/* GPIO 3 of the PMIC */
31#define EN_VDD_1V05_GPIO (TEGRA_NR_GPIOS + 2)
32
30static int __init harmony_pcie_init(void) 33static int __init harmony_pcie_init(void)
31{ 34{
35 struct regulator *regulator = NULL;
32 int err; 36 int err;
33 37
34 if (!machine_is_harmony()) 38 if (!machine_is_harmony())
35 return 0; 39 return 0;
36 40
41 err = gpio_request(EN_VDD_1V05_GPIO, "EN_VDD_1V05");
42 if (err)
43 return err;
44
45 gpio_direction_output(EN_VDD_1V05_GPIO, 1);
46
47 regulator = regulator_get(NULL, "pex_clk");
48 if (IS_ERR_OR_NULL(regulator))
49 goto err_reg;
50
51 regulator_enable(regulator);
52
37 tegra_pinmux_set_tristate(TEGRA_PINGROUP_GPV, TEGRA_TRI_NORMAL); 53 tegra_pinmux_set_tristate(TEGRA_PINGROUP_GPV, TEGRA_TRI_NORMAL);
38 tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXA, TEGRA_TRI_NORMAL); 54 tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXA, TEGRA_TRI_NORMAL);
39 tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXK, TEGRA_TRI_NORMAL); 55 tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXK, TEGRA_TRI_NORMAL);
@@ -49,9 +65,15 @@ err_pcie:
49 tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXA, TEGRA_TRI_TRISTATE); 65 tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXA, TEGRA_TRI_TRISTATE);
50 tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXK, TEGRA_TRI_TRISTATE); 66 tegra_pinmux_set_tristate(TEGRA_PINGROUP_SLXK, TEGRA_TRI_TRISTATE);
51 67
68 regulator_disable(regulator);
69 regulator_put(regulator);
70err_reg:
71 gpio_free(EN_VDD_1V05_GPIO);
72
52 return err; 73 return err;
53} 74}
54 75
55subsys_initcall(harmony_pcie_init); 76/* PCI should be initialized after I2C, mfd and regulators */
77subsys_initcall_sync(harmony_pcie_init);
56 78
57#endif 79#endif
diff --git a/arch/arm/mach-tegra/board-harmony-pinmux.c b/arch/arm/mach-tegra/board-harmony-pinmux.c
index 50b15d500cac..4d63e2e97a8d 100644
--- a/arch/arm/mach-tegra/board-harmony-pinmux.c
+++ b/arch/arm/mach-tegra/board-harmony-pinmux.c
@@ -15,8 +15,10 @@
15 */ 15 */
16 16
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/gpio.h>
18#include <mach/pinmux.h> 19#include <mach/pinmux.h>
19 20
21#include "gpio-names.h"
20#include "board-harmony.h" 22#include "board-harmony.h"
21 23
22static struct tegra_pingroup_config harmony_pinmux[] = { 24static struct tegra_pingroup_config harmony_pinmux[] = {
@@ -25,19 +27,19 @@ static struct tegra_pingroup_config harmony_pinmux[] = {
25 {TEGRA_PINGROUP_ATC, TEGRA_MUX_NAND, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, 27 {TEGRA_PINGROUP_ATC, TEGRA_MUX_NAND, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
26 {TEGRA_PINGROUP_ATD, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, 28 {TEGRA_PINGROUP_ATD, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
27 {TEGRA_PINGROUP_ATE, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, 29 {TEGRA_PINGROUP_ATE, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
28 {TEGRA_PINGROUP_CDEV1, TEGRA_MUX_OSC, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, 30 {TEGRA_PINGROUP_CDEV1, TEGRA_MUX_PLLA_OUT, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
29 {TEGRA_PINGROUP_CDEV2, TEGRA_MUX_PLLP_OUT4, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, 31 {TEGRA_PINGROUP_CDEV2, TEGRA_MUX_PLLP_OUT4, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
30 {TEGRA_PINGROUP_CRTP, TEGRA_MUX_CRT, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, 32 {TEGRA_PINGROUP_CRTP, TEGRA_MUX_CRT, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
31 {TEGRA_PINGROUP_CSUS, TEGRA_MUX_VI_SENSOR_CLK, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, 33 {TEGRA_PINGROUP_CSUS, TEGRA_MUX_VI_SENSOR_CLK, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
32 {TEGRA_PINGROUP_DAP1, TEGRA_MUX_DAP1, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, 34 {TEGRA_PINGROUP_DAP1, TEGRA_MUX_DAP1, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
33 {TEGRA_PINGROUP_DAP2, TEGRA_MUX_DAP2, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, 35 {TEGRA_PINGROUP_DAP2, TEGRA_MUX_DAP2, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
34 {TEGRA_PINGROUP_DAP3, TEGRA_MUX_DAP3, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, 36 {TEGRA_PINGROUP_DAP3, TEGRA_MUX_DAP3, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
35 {TEGRA_PINGROUP_DAP4, TEGRA_MUX_DAP4, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, 37 {TEGRA_PINGROUP_DAP4, TEGRA_MUX_DAP4, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
36 {TEGRA_PINGROUP_DDC, TEGRA_MUX_I2C2, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL}, 38 {TEGRA_PINGROUP_DDC, TEGRA_MUX_I2C2, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
37 {TEGRA_PINGROUP_DTA, TEGRA_MUX_SDIO2, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, 39 {TEGRA_PINGROUP_DTA, TEGRA_MUX_SDIO2, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
38 {TEGRA_PINGROUP_DTB, TEGRA_MUX_RSVD1, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, 40 {TEGRA_PINGROUP_DTB, TEGRA_MUX_RSVD1, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
39 {TEGRA_PINGROUP_DTC, TEGRA_MUX_RSVD1, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, 41 {TEGRA_PINGROUP_DTC, TEGRA_MUX_RSVD1, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
40 {TEGRA_PINGROUP_DTD, TEGRA_MUX_SDIO2, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, 42 {TEGRA_PINGROUP_DTD, TEGRA_MUX_SDIO2, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
41 {TEGRA_PINGROUP_DTE, TEGRA_MUX_RSVD1, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, 43 {TEGRA_PINGROUP_DTE, TEGRA_MUX_RSVD1, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
42 {TEGRA_PINGROUP_DTF, TEGRA_MUX_I2C3, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, 44 {TEGRA_PINGROUP_DTF, TEGRA_MUX_I2C3, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
43 {TEGRA_PINGROUP_GMA, TEGRA_MUX_SDIO4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, 45 {TEGRA_PINGROUP_GMA, TEGRA_MUX_SDIO4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
@@ -112,13 +114,13 @@ static struct tegra_pingroup_config harmony_pinmux[] = {
112 {TEGRA_PINGROUP_SLXK, TEGRA_MUX_PCIE, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, 114 {TEGRA_PINGROUP_SLXK, TEGRA_MUX_PCIE, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
113 {TEGRA_PINGROUP_SPDI, TEGRA_MUX_RSVD2, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, 115 {TEGRA_PINGROUP_SPDI, TEGRA_MUX_RSVD2, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
114 {TEGRA_PINGROUP_SPDO, TEGRA_MUX_RSVD2, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, 116 {TEGRA_PINGROUP_SPDO, TEGRA_MUX_RSVD2, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
115 {TEGRA_PINGROUP_SPIA, TEGRA_MUX_GMI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, 117 {TEGRA_PINGROUP_SPIA, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
116 {TEGRA_PINGROUP_SPIB, TEGRA_MUX_GMI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, 118 {TEGRA_PINGROUP_SPIB, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
117 {TEGRA_PINGROUP_SPIC, TEGRA_MUX_GMI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL}, 119 {TEGRA_PINGROUP_SPIC, TEGRA_MUX_GMI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
118 {TEGRA_PINGROUP_SPID, TEGRA_MUX_SPI1, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, 120 {TEGRA_PINGROUP_SPID, TEGRA_MUX_SPI1, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
119 {TEGRA_PINGROUP_SPIE, TEGRA_MUX_SPI1, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, 121 {TEGRA_PINGROUP_SPIE, TEGRA_MUX_SPI1, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
120 {TEGRA_PINGROUP_SPIF, TEGRA_MUX_SPI1, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, 122 {TEGRA_PINGROUP_SPIF, TEGRA_MUX_SPI1, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
121 {TEGRA_PINGROUP_SPIG, TEGRA_MUX_SPI2_ALT, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, 123 {TEGRA_PINGROUP_SPIG, TEGRA_MUX_SPI2_ALT, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
122 {TEGRA_PINGROUP_SPIH, TEGRA_MUX_SPI2_ALT, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, 124 {TEGRA_PINGROUP_SPIH, TEGRA_MUX_SPI2_ALT, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
123 {TEGRA_PINGROUP_UAA, TEGRA_MUX_ULPI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, 125 {TEGRA_PINGROUP_UAA, TEGRA_MUX_ULPI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
124 {TEGRA_PINGROUP_UAB, TEGRA_MUX_ULPI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, 126 {TEGRA_PINGROUP_UAB, TEGRA_MUX_ULPI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
@@ -138,7 +140,22 @@ static struct tegra_pingroup_config harmony_pinmux[] = {
138 {TEGRA_PINGROUP_XM2D, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, 140 {TEGRA_PINGROUP_XM2D, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
139}; 141};
140 142
143static struct tegra_gpio_table gpio_table[] = {
144 { .gpio = TEGRA_GPIO_SD2_CD, .enable = true },
145 { .gpio = TEGRA_GPIO_SD2_WP, .enable = true },
146 { .gpio = TEGRA_GPIO_SD2_POWER, .enable = true },
147 { .gpio = TEGRA_GPIO_SD4_CD, .enable = true },
148 { .gpio = TEGRA_GPIO_SD4_WP, .enable = true },
149 { .gpio = TEGRA_GPIO_SD4_POWER, .enable = true },
150 { .gpio = TEGRA_GPIO_CDC_IRQ, .enable = true },
151 { .gpio = TEGRA_GPIO_HP_DET, .enable = true },
152 { .gpio = TEGRA_GPIO_INT_MIC_EN, .enable = true },
153 { .gpio = TEGRA_GPIO_EXT_MIC_EN, .enable = true },
154};
155
141void harmony_pinmux_init(void) 156void harmony_pinmux_init(void)
142{ 157{
143 tegra_pinmux_config_table(harmony_pinmux, ARRAY_SIZE(harmony_pinmux)); 158 tegra_pinmux_config_table(harmony_pinmux, ARRAY_SIZE(harmony_pinmux));
159
160 tegra_gpio_config(gpio_table, ARRAY_SIZE(gpio_table));
144} 161}
diff --git a/arch/arm/mach-tegra/board-harmony-power.c b/arch/arm/mach-tegra/board-harmony-power.c
new file mode 100644
index 000000000000..c84442cabe07
--- /dev/null
+++ b/arch/arm/mach-tegra/board-harmony-power.c
@@ -0,0 +1,117 @@
1/*
2 * Copyright (C) 2010 NVIDIA, Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
16 * 02111-1307, USA
17 */
18#include <linux/i2c.h>
19#include <linux/platform_device.h>
20#include <linux/gpio.h>
21
22#include <linux/regulator/machine.h>
23#include <linux/mfd/tps6586x.h>
24
25#include <mach/irqs.h>
26
27#define PMC_CTRL 0x0
28#define PMC_CTRL_INTR_LOW (1 << 17)
29
30static struct regulator_consumer_supply tps658621_ldo0_supply[] = {
31 REGULATOR_SUPPLY("pex_clk", NULL),
32};
33
34static struct regulator_init_data ldo0_data = {
35 .constraints = {
36 .min_uV = 1250 * 1000,
37 .max_uV = 3300 * 1000,
38 .valid_modes_mask = (REGULATOR_MODE_NORMAL |
39 REGULATOR_MODE_STANDBY),
40 .valid_ops_mask = (REGULATOR_CHANGE_MODE |
41 REGULATOR_CHANGE_STATUS |
42 REGULATOR_CHANGE_VOLTAGE),
43 },
44 .num_consumer_supplies = ARRAY_SIZE(tps658621_ldo0_supply),
45 .consumer_supplies = tps658621_ldo0_supply,
46};
47
48#define HARMONY_REGULATOR_INIT(_id, _minmv, _maxmv) \
49 static struct regulator_init_data _id##_data = { \
50 .constraints = { \
51 .min_uV = (_minmv)*1000, \
52 .max_uV = (_maxmv)*1000, \
53 .valid_modes_mask = (REGULATOR_MODE_NORMAL | \
54 REGULATOR_MODE_STANDBY), \
55 .valid_ops_mask = (REGULATOR_CHANGE_MODE | \
56 REGULATOR_CHANGE_STATUS | \
57 REGULATOR_CHANGE_VOLTAGE), \
58 }, \
59 }
60
61HARMONY_REGULATOR_INIT(sm0, 725, 1500);
62HARMONY_REGULATOR_INIT(sm1, 725, 1500);
63HARMONY_REGULATOR_INIT(sm2, 3000, 4550);
64HARMONY_REGULATOR_INIT(ldo1, 725, 1500);
65HARMONY_REGULATOR_INIT(ldo2, 725, 1500);
66HARMONY_REGULATOR_INIT(ldo3, 1250, 3300);
67HARMONY_REGULATOR_INIT(ldo4, 1700, 2475);
68HARMONY_REGULATOR_INIT(ldo5, 1250, 3300);
69HARMONY_REGULATOR_INIT(ldo6, 1250, 3300);
70HARMONY_REGULATOR_INIT(ldo7, 1250, 3300);
71HARMONY_REGULATOR_INIT(ldo8, 1250, 3300);
72HARMONY_REGULATOR_INIT(ldo9, 1250, 3300);
73
74#define TPS_REG(_id, _data) \
75 { \
76 .id = TPS6586X_ID_##_id, \
77 .name = "tps6586x-regulator", \
78 .platform_data = _data, \
79 }
80
81static struct tps6586x_subdev_info tps_devs[] = {
82 TPS_REG(SM_0, &sm0_data),
83 TPS_REG(SM_1, &sm1_data),
84 TPS_REG(SM_2, &sm2_data),
85 TPS_REG(LDO_0, &ldo0_data),
86 TPS_REG(LDO_1, &ldo1_data),
87 TPS_REG(LDO_2, &ldo2_data),
88 TPS_REG(LDO_3, &ldo3_data),
89 TPS_REG(LDO_4, &ldo4_data),
90 TPS_REG(LDO_5, &ldo5_data),
91 TPS_REG(LDO_6, &ldo6_data),
92 TPS_REG(LDO_7, &ldo7_data),
93 TPS_REG(LDO_8, &ldo8_data),
94 TPS_REG(LDO_9, &ldo9_data),
95};
96
97static struct tps6586x_platform_data tps_platform = {
98 .irq_base = TEGRA_NR_IRQS,
99 .num_subdevs = ARRAY_SIZE(tps_devs),
100 .subdevs = tps_devs,
101 .gpio_base = TEGRA_NR_GPIOS,
102};
103
104static struct i2c_board_info __initdata harmony_regulators[] = {
105 {
106 I2C_BOARD_INFO("tps6586x", 0x34),
107 .irq = INT_EXTERNAL_PMU,
108 .platform_data = &tps_platform,
109 },
110};
111
112int __init harmony_regulator_init(void)
113{
114 i2c_register_board_info(3, harmony_regulators, 1);
115
116 return 0;
117}
diff --git a/arch/arm/mach-tegra/board-harmony.c b/arch/arm/mach-tegra/board-harmony.c
index b9dbdb1289d0..75c918a86a31 100644
--- a/arch/arm/mach-tegra/board-harmony.c
+++ b/arch/arm/mach-tegra/board-harmony.c
@@ -2,6 +2,7 @@
2 * arch/arm/mach-tegra/board-harmony.c 2 * arch/arm/mach-tegra/board-harmony.c
3 * 3 *
4 * Copyright (C) 2010 Google, Inc. 4 * Copyright (C) 2010 Google, Inc.
5 * Copyright (C) 2011 NVIDIA, Inc.
5 * 6 *
6 * This software is licensed under the terms of the GNU General Public 7 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and 8 * License version 2, as published by the Free Software Foundation, and
@@ -22,43 +23,27 @@
22#include <linux/dma-mapping.h> 23#include <linux/dma-mapping.h>
23#include <linux/pda_power.h> 24#include <linux/pda_power.h>
24#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/gpio.h>
27#include <linux/i2c.h>
28#include <linux/i2c-tegra.h>
29
30#include <sound/wm8903.h>
25 31
26#include <asm/mach-types.h> 32#include <asm/mach-types.h>
27#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
28#include <asm/mach/time.h> 34#include <asm/mach/time.h>
29#include <asm/setup.h> 35#include <asm/setup.h>
30 36
37#include <mach/harmony_audio.h>
31#include <mach/iomap.h> 38#include <mach/iomap.h>
32#include <mach/irqs.h> 39#include <mach/irqs.h>
40#include <mach/sdhci.h>
33 41
34#include "board.h" 42#include "board.h"
35#include "board-harmony.h" 43#include "board-harmony.h"
36#include "clock.h" 44#include "clock.h"
37 45#include "devices.h"
38/* NVidia bootloader tags */ 46#include "gpio-names.h"
39#define ATAG_NVIDIA 0x41000801
40
41#define ATAG_NVIDIA_RM 0x1
42#define ATAG_NVIDIA_DISPLAY 0x2
43#define ATAG_NVIDIA_FRAMEBUFFER 0x3
44#define ATAG_NVIDIA_CHIPSHMOO 0x4
45#define ATAG_NVIDIA_CHIPSHMOOPHYS 0x5
46#define ATAG_NVIDIA_PRESERVED_MEM_0 0x10000
47#define ATAG_NVIDIA_PRESERVED_MEM_N 2
48#define ATAG_NVIDIA_FORCE_32 0x7fffffff
49
50struct tag_tegra {
51 __u32 bootarg_key;
52 __u32 bootarg_len;
53 char bootarg[1];
54};
55
56static int __init parse_tag_nvidia(const struct tag *tag)
57{
58
59 return 0;
60}
61__tagtable(ATAG_NVIDIA, parse_tag_nvidia);
62 47
63static struct plat_serial8250_port debug_uart_platform_data[] = { 48static struct plat_serial8250_port debug_uart_platform_data[] = {
64 { 49 {
@@ -82,8 +67,81 @@ static struct platform_device debug_uart = {
82 }, 67 },
83}; 68};
84 69
70static struct harmony_audio_platform_data harmony_audio_pdata = {
71 .gpio_spkr_en = TEGRA_GPIO_SPKR_EN,
72 .gpio_hp_det = TEGRA_GPIO_HP_DET,
73 .gpio_int_mic_en = TEGRA_GPIO_INT_MIC_EN,
74 .gpio_ext_mic_en = TEGRA_GPIO_EXT_MIC_EN,
75};
76
77static struct platform_device harmony_audio_device = {
78 .name = "tegra-snd-harmony",
79 .id = 0,
80 .dev = {
81 .platform_data = &harmony_audio_pdata,
82 },
83};
84
85static struct tegra_i2c_platform_data harmony_i2c1_platform_data = {
86 .bus_clk_rate = 400000,
87};
88
89static struct tegra_i2c_platform_data harmony_i2c2_platform_data = {
90 .bus_clk_rate = 400000,
91};
92
93static struct tegra_i2c_platform_data harmony_i2c3_platform_data = {
94 .bus_clk_rate = 400000,
95};
96
97static struct tegra_i2c_platform_data harmony_dvc_platform_data = {
98 .bus_clk_rate = 400000,
99};
100
101static struct wm8903_platform_data harmony_wm8903_pdata = {
102 .irq_active_low = 0,
103 .micdet_cfg = 0,
104 .micdet_delay = 100,
105 .gpio_base = HARMONY_GPIO_WM8903(0),
106 .gpio_cfg = {
107 WM8903_GPIO_NO_CONFIG,
108 WM8903_GPIO_NO_CONFIG,
109 0,
110 WM8903_GPIO_NO_CONFIG,
111 WM8903_GPIO_NO_CONFIG,
112 },
113};
114
115static struct i2c_board_info __initdata wm8903_board_info = {
116 I2C_BOARD_INFO("wm8903", 0x1a),
117 .platform_data = &harmony_wm8903_pdata,
118 .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_CDC_IRQ),
119};
120
121static void __init harmony_i2c_init(void)
122{
123 tegra_i2c_device1.dev.platform_data = &harmony_i2c1_platform_data;
124 tegra_i2c_device2.dev.platform_data = &harmony_i2c2_platform_data;
125 tegra_i2c_device3.dev.platform_data = &harmony_i2c3_platform_data;
126 tegra_i2c_device4.dev.platform_data = &harmony_dvc_platform_data;
127
128 platform_device_register(&tegra_i2c_device1);
129 platform_device_register(&tegra_i2c_device2);
130 platform_device_register(&tegra_i2c_device3);
131 platform_device_register(&tegra_i2c_device4);
132
133 i2c_register_board_info(0, &wm8903_board_info, 1);
134}
135
85static struct platform_device *harmony_devices[] __initdata = { 136static struct platform_device *harmony_devices[] __initdata = {
86 &debug_uart, 137 &debug_uart,
138 &tegra_sdhci_device1,
139 &tegra_sdhci_device2,
140 &tegra_sdhci_device4,
141 &tegra_i2s_device1,
142 &tegra_das_device,
143 &tegra_pcm_device,
144 &harmony_audio_device,
87}; 145};
88 146
89static void __init tegra_harmony_fixup(struct machine_desc *desc, 147static void __init tegra_harmony_fixup(struct machine_desc *desc,
@@ -99,25 +157,54 @@ static void __init tegra_harmony_fixup(struct machine_desc *desc,
99static __initdata struct tegra_clk_init_table harmony_clk_init_table[] = { 157static __initdata struct tegra_clk_init_table harmony_clk_init_table[] = {
100 /* name parent rate enabled */ 158 /* name parent rate enabled */
101 { "uartd", "pll_p", 216000000, true }, 159 { "uartd", "pll_p", 216000000, true },
160 { "pll_a", "pll_p_out1", 56448000, true },
161 { "pll_a_out0", "pll_a", 11289600, true },
162 { "cdev1", NULL, 0, true },
163 { "i2s1", "pll_a_out0", 11289600, false},
102 { NULL, NULL, 0, 0}, 164 { NULL, NULL, 0, 0},
103}; 165};
104 166
167
168static struct tegra_sdhci_platform_data sdhci_pdata1 = {
169 .cd_gpio = -1,
170 .wp_gpio = -1,
171 .power_gpio = -1,
172};
173
174static struct tegra_sdhci_platform_data sdhci_pdata2 = {
175 .cd_gpio = TEGRA_GPIO_SD2_CD,
176 .wp_gpio = TEGRA_GPIO_SD2_WP,
177 .power_gpio = TEGRA_GPIO_SD2_POWER,
178};
179
180static struct tegra_sdhci_platform_data sdhci_pdata4 = {
181 .cd_gpio = TEGRA_GPIO_SD4_CD,
182 .wp_gpio = TEGRA_GPIO_SD4_WP,
183 .power_gpio = TEGRA_GPIO_SD4_POWER,
184 .is_8bit = 1,
185};
186
105static void __init tegra_harmony_init(void) 187static void __init tegra_harmony_init(void)
106{ 188{
107 tegra_common_init();
108
109 tegra_clk_init_from_table(harmony_clk_init_table); 189 tegra_clk_init_from_table(harmony_clk_init_table);
110 190
111 harmony_pinmux_init(); 191 harmony_pinmux_init();
112 192
193 tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
194 tegra_sdhci_device2.dev.platform_data = &sdhci_pdata2;
195 tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
196
113 platform_add_devices(harmony_devices, ARRAY_SIZE(harmony_devices)); 197 platform_add_devices(harmony_devices, ARRAY_SIZE(harmony_devices));
198 harmony_i2c_init();
199 harmony_regulator_init();
114} 200}
115 201
116MACHINE_START(HARMONY, "harmony") 202MACHINE_START(HARMONY, "harmony")
117 .boot_params = 0x00000100, 203 .boot_params = 0x00000100,
118 .fixup = tegra_harmony_fixup, 204 .fixup = tegra_harmony_fixup,
119 .init_irq = tegra_init_irq,
120 .init_machine = tegra_harmony_init,
121 .map_io = tegra_map_common_io, 205 .map_io = tegra_map_common_io,
206 .init_early = tegra_init_early,
207 .init_irq = tegra_init_irq,
122 .timer = &tegra_timer, 208 .timer = &tegra_timer,
209 .init_machine = tegra_harmony_init,
123MACHINE_END 210MACHINE_END
diff --git a/arch/arm/mach-tegra/board-harmony.h b/arch/arm/mach-tegra/board-harmony.h
index 09ca7755dd55..1e57b071f52d 100644
--- a/arch/arm/mach-tegra/board-harmony.h
+++ b/arch/arm/mach-tegra/board-harmony.h
@@ -17,6 +17,21 @@
17#ifndef _MACH_TEGRA_BOARD_HARMONY_H 17#ifndef _MACH_TEGRA_BOARD_HARMONY_H
18#define _MACH_TEGRA_BOARD_HARMONY_H 18#define _MACH_TEGRA_BOARD_HARMONY_H
19 19
20#define HARMONY_GPIO_WM8903(_x_) (TEGRA_NR_GPIOS + (_x_))
21
22#define TEGRA_GPIO_SD2_CD TEGRA_GPIO_PI5
23#define TEGRA_GPIO_SD2_WP TEGRA_GPIO_PH1
24#define TEGRA_GPIO_SD2_POWER TEGRA_GPIO_PT3
25#define TEGRA_GPIO_SD4_CD TEGRA_GPIO_PH2
26#define TEGRA_GPIO_SD4_WP TEGRA_GPIO_PH3
27#define TEGRA_GPIO_SD4_POWER TEGRA_GPIO_PI6
28#define TEGRA_GPIO_CDC_IRQ TEGRA_GPIO_PX3
29#define TEGRA_GPIO_SPKR_EN HARMONY_GPIO_WM8903(2)
30#define TEGRA_GPIO_HP_DET TEGRA_GPIO_PW2
31#define TEGRA_GPIO_INT_MIC_EN TEGRA_GPIO_PX0
32#define TEGRA_GPIO_EXT_MIC_EN TEGRA_GPIO_PX1
33
20void harmony_pinmux_init(void); 34void harmony_pinmux_init(void);
35int harmony_regulator_init(void);
21 36
22#endif 37#endif
diff --git a/arch/arm/mach-tegra/board-paz00-pinmux.c b/arch/arm/mach-tegra/board-paz00-pinmux.c
new file mode 100644
index 000000000000..2643d1bd568b
--- /dev/null
+++ b/arch/arm/mach-tegra/board-paz00-pinmux.c
@@ -0,0 +1,157 @@
1/*
2 * arch/arm/mach-tegra/board-paz00-pinmux.c
3 *
4 * Copyright (C) 2010 Marc Dietrich <marvin24@gmx.de>
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17#include <linux/kernel.h>
18#include <linux/gpio.h>
19#include <mach/pinmux.h>
20
21#include "gpio-names.h"
22#include "board-paz00.h"
23
24static struct tegra_pingroup_config paz00_pinmux[] = {
25 {TEGRA_PINGROUP_ATA, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
26 {TEGRA_PINGROUP_ATB, TEGRA_MUX_SDIO4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
27 {TEGRA_PINGROUP_ATC, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
28 {TEGRA_PINGROUP_ATD, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
29 {TEGRA_PINGROUP_ATE, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
30 {TEGRA_PINGROUP_CDEV1, TEGRA_MUX_PLLA_OUT, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
31 {TEGRA_PINGROUP_CDEV2, TEGRA_MUX_PLLP_OUT4, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
32 {TEGRA_PINGROUP_CRTP, TEGRA_MUX_CRT, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
33 {TEGRA_PINGROUP_CSUS, TEGRA_MUX_PLLC_OUT1, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
34 {TEGRA_PINGROUP_DAP1, TEGRA_MUX_DAP1, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
35 {TEGRA_PINGROUP_DAP2, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
36 {TEGRA_PINGROUP_DAP3, TEGRA_MUX_DAP3, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
37 {TEGRA_PINGROUP_DAP4, TEGRA_MUX_DAP4, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
38 {TEGRA_PINGROUP_DDC, TEGRA_MUX_I2C2, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
39 {TEGRA_PINGROUP_DTA, TEGRA_MUX_RSVD1, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
40 {TEGRA_PINGROUP_DTB, TEGRA_MUX_RSVD1, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
41 {TEGRA_PINGROUP_DTC, TEGRA_MUX_RSVD1, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
42 {TEGRA_PINGROUP_DTD, TEGRA_MUX_RSVD1, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
43 {TEGRA_PINGROUP_DTE, TEGRA_MUX_RSVD1, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
44 {TEGRA_PINGROUP_DTF, TEGRA_MUX_I2C3, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
45 {TEGRA_PINGROUP_GMA, TEGRA_MUX_SDIO4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
46 {TEGRA_PINGROUP_GMB, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
47 {TEGRA_PINGROUP_GMC, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
48 {TEGRA_PINGROUP_GMD, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
49 {TEGRA_PINGROUP_GME, TEGRA_MUX_SDIO4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
50 {TEGRA_PINGROUP_GPU, TEGRA_MUX_PWM, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
51 {TEGRA_PINGROUP_GPU7, TEGRA_MUX_RTCK, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
52 {TEGRA_PINGROUP_GPV, TEGRA_MUX_PCIE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
53 {TEGRA_PINGROUP_HDINT, TEGRA_MUX_HDMI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
54 {TEGRA_PINGROUP_I2CP, TEGRA_MUX_I2C, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
55 {TEGRA_PINGROUP_IRRX, TEGRA_MUX_UARTA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
56 {TEGRA_PINGROUP_IRTX, TEGRA_MUX_UARTA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
57 {TEGRA_PINGROUP_KBCA, TEGRA_MUX_KBC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
58 {TEGRA_PINGROUP_KBCB, TEGRA_MUX_SDIO2, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
59 {TEGRA_PINGROUP_KBCC, TEGRA_MUX_KBC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
60 {TEGRA_PINGROUP_KBCD, TEGRA_MUX_SDIO2, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
61 {TEGRA_PINGROUP_KBCE, TEGRA_MUX_KBC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
62 {TEGRA_PINGROUP_KBCF, TEGRA_MUX_KBC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
63 {TEGRA_PINGROUP_LCSN, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
64 {TEGRA_PINGROUP_LD0, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
65 {TEGRA_PINGROUP_LD1, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
66 {TEGRA_PINGROUP_LD10, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
67 {TEGRA_PINGROUP_LD11, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
68 {TEGRA_PINGROUP_LD12, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
69 {TEGRA_PINGROUP_LD13, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
70 {TEGRA_PINGROUP_LD14, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
71 {TEGRA_PINGROUP_LD15, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
72 {TEGRA_PINGROUP_LD16, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
73 {TEGRA_PINGROUP_LD17, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
74 {TEGRA_PINGROUP_LD2, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
75 {TEGRA_PINGROUP_LD3, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
76 {TEGRA_PINGROUP_LD4, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
77 {TEGRA_PINGROUP_LD5, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
78 {TEGRA_PINGROUP_LD6, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
79 {TEGRA_PINGROUP_LD7, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
80 {TEGRA_PINGROUP_LD8, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
81 {TEGRA_PINGROUP_LD9, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
82 {TEGRA_PINGROUP_LDC, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
83 {TEGRA_PINGROUP_LDI, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
84 {TEGRA_PINGROUP_LHP0, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
85 {TEGRA_PINGROUP_LHP1, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
86 {TEGRA_PINGROUP_LHP2, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
87 {TEGRA_PINGROUP_LHS, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
88 {TEGRA_PINGROUP_LM0, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
89 {TEGRA_PINGROUP_LM1, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
90 {TEGRA_PINGROUP_LPP, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
91 {TEGRA_PINGROUP_LPW0, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
92 {TEGRA_PINGROUP_LPW1, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
93 {TEGRA_PINGROUP_LPW2, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
94 {TEGRA_PINGROUP_LSC0, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
95 {TEGRA_PINGROUP_LSC1, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
96 {TEGRA_PINGROUP_LSCK, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
97 {TEGRA_PINGROUP_LSDA, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
98 {TEGRA_PINGROUP_LSDI, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
99 {TEGRA_PINGROUP_LSPI, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
100 {TEGRA_PINGROUP_LVP0, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
101 {TEGRA_PINGROUP_LVP1, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
102 {TEGRA_PINGROUP_LVS, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
103 {TEGRA_PINGROUP_OWC, TEGRA_MUX_OWR, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
104 {TEGRA_PINGROUP_PMC, TEGRA_MUX_PWR_ON, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
105 {TEGRA_PINGROUP_PTA, TEGRA_MUX_HDMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
106 {TEGRA_PINGROUP_RM, TEGRA_MUX_I2C, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
107 {TEGRA_PINGROUP_SDB, TEGRA_MUX_PWM, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
108 {TEGRA_PINGROUP_SDC, TEGRA_MUX_TWC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
109 {TEGRA_PINGROUP_SDD, TEGRA_MUX_PWM, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
110 {TEGRA_PINGROUP_SDIO1, TEGRA_MUX_SDIO1, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
111 {TEGRA_PINGROUP_SLXA, TEGRA_MUX_PCIE, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
112 {TEGRA_PINGROUP_SLXC, TEGRA_MUX_SPI4, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
113 {TEGRA_PINGROUP_SLXD, TEGRA_MUX_SPI4, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
114 {TEGRA_PINGROUP_SLXK, TEGRA_MUX_PCIE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
115 {TEGRA_PINGROUP_SPDI, TEGRA_MUX_RSVD2, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
116 {TEGRA_PINGROUP_SPDO, TEGRA_MUX_RSVD2, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
117 {TEGRA_PINGROUP_SPIA, TEGRA_MUX_GMI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
118 {TEGRA_PINGROUP_SPIB, TEGRA_MUX_GMI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
119 {TEGRA_PINGROUP_SPIC, TEGRA_MUX_GMI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
120 {TEGRA_PINGROUP_SPID, TEGRA_MUX_GMI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
121 {TEGRA_PINGROUP_SPIE, TEGRA_MUX_GMI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
122 {TEGRA_PINGROUP_SPIF, TEGRA_MUX_RSVD4, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
123 {TEGRA_PINGROUP_SPIG, TEGRA_MUX_SPI2_ALT, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
124 {TEGRA_PINGROUP_SPIH, TEGRA_MUX_SPI2_ALT, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
125 {TEGRA_PINGROUP_UAA, TEGRA_MUX_ULPI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
126 {TEGRA_PINGROUP_UAB, TEGRA_MUX_ULPI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
127 {TEGRA_PINGROUP_UAC, TEGRA_MUX_RSVD4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
128 {TEGRA_PINGROUP_UAD, TEGRA_MUX_SPDIF, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
129 {TEGRA_PINGROUP_UCA, TEGRA_MUX_UARTC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
130 {TEGRA_PINGROUP_UCB, TEGRA_MUX_UARTC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
131 {TEGRA_PINGROUP_UDA, TEGRA_MUX_ULPI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
132 {TEGRA_PINGROUP_CK32, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
133 {TEGRA_PINGROUP_DDRC, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
134 {TEGRA_PINGROUP_PMCA, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
135 {TEGRA_PINGROUP_PMCB, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
136 {TEGRA_PINGROUP_PMCC, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
137 {TEGRA_PINGROUP_PMCD, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
138 {TEGRA_PINGROUP_PMCE, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
139 {TEGRA_PINGROUP_XM2C, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
140 {TEGRA_PINGROUP_XM2D, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
141};
142
143static struct tegra_gpio_table gpio_table[] = {
144 { .gpio = TEGRA_GPIO_SD1_CD, .enable = true },
145 { .gpio = TEGRA_GPIO_SD1_WP, .enable = true },
146 { .gpio = TEGRA_GPIO_SD1_POWER, .enable = true },
147 { .gpio = TEGRA_GPIO_SD4_CD, .enable = true },
148 { .gpio = TEGRA_GPIO_SD4_WP, .enable = true },
149 { .gpio = TEGRA_GPIO_SD4_POWER, .enable = true },
150};
151
152void paz00_pinmux_init(void)
153{
154 tegra_pinmux_config_table(paz00_pinmux, ARRAY_SIZE(paz00_pinmux));
155
156 tegra_gpio_config(gpio_table, ARRAY_SIZE(gpio_table));
157}
diff --git a/arch/arm/mach-tegra/board-paz00.c b/arch/arm/mach-tegra/board-paz00.c
new file mode 100644
index 000000000000..57e50a823eec
--- /dev/null
+++ b/arch/arm/mach-tegra/board-paz00.c
@@ -0,0 +1,128 @@
1/*
2 * arch/arm/mach-tegra/board-paz00.c
3 *
4 * Copyright (C) 2011 Marc Dietrich <marvin24@gmx.de>
5 *
6 * Based on board-harmony.c
7 * Copyright (C) 2010 Google, Inc.
8 *
9 * This software is licensed under the terms of the GNU General Public
10 * License version 2, as published by the Free Software Foundation, and
11 * may be copied, distributed, and modified under those terms.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 */
19
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/platform_device.h>
23#include <linux/serial_8250.h>
24#include <linux/clk.h>
25#include <linux/dma-mapping.h>
26#include <linux/pda_power.h>
27#include <linux/io.h>
28
29#include <asm/mach-types.h>
30#include <asm/mach/arch.h>
31#include <asm/mach/time.h>
32#include <asm/setup.h>
33
34#include <mach/iomap.h>
35#include <mach/irqs.h>
36#include <mach/sdhci.h>
37
38#include "board.h"
39#include "board-paz00.h"
40#include "clock.h"
41#include "devices.h"
42#include "gpio-names.h"
43
44static struct plat_serial8250_port debug_uart_platform_data[] = {
45 {
46 .membase = IO_ADDRESS(TEGRA_UARTD_BASE),
47 .mapbase = TEGRA_UARTD_BASE,
48 .irq = INT_UARTD,
49 .flags = UPF_BOOT_AUTOCONF,
50 .iotype = UPIO_MEM,
51 .regshift = 2,
52 .uartclk = 216000000,
53 }, {
54 .flags = 0
55 }
56};
57
58static struct platform_device debug_uart = {
59 .name = "serial8250",
60 .id = PLAT8250_DEV_PLATFORM,
61 .dev = {
62 .platform_data = debug_uart_platform_data,
63 },
64};
65
66static struct platform_device *paz00_devices[] __initdata = {
67 &debug_uart,
68 &tegra_sdhci_device1,
69 &tegra_sdhci_device2,
70 &tegra_sdhci_device4,
71};
72
73static void __init tegra_paz00_fixup(struct machine_desc *desc,
74 struct tag *tags, char **cmdline, struct meminfo *mi)
75{
76 mi->nr_banks = 1;
77 mi->bank[0].start = PHYS_OFFSET;
78 mi->bank[0].size = 448 * SZ_1M;
79}
80
81static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {
82 /* name parent rate enabled */
83 { "uartd", "pll_p", 216000000, true },
84 { NULL, NULL, 0, 0},
85};
86
87
88static struct tegra_sdhci_platform_data sdhci_pdata1 = {
89 .cd_gpio = TEGRA_GPIO_SD1_CD,
90 .wp_gpio = TEGRA_GPIO_SD1_WP,
91 .power_gpio = TEGRA_GPIO_SD1_POWER,
92};
93
94static struct tegra_sdhci_platform_data sdhci_pdata2 = {
95 .cd_gpio = -1,
96 .wp_gpio = -1,
97 .power_gpio = -1,
98};
99
100static struct tegra_sdhci_platform_data sdhci_pdata4 = {
101 .cd_gpio = TEGRA_GPIO_SD4_CD,
102 .wp_gpio = TEGRA_GPIO_SD4_WP,
103 .power_gpio = TEGRA_GPIO_SD4_POWER,
104 .is_8bit = 1,
105};
106
107static void __init tegra_paz00_init(void)
108{
109 tegra_clk_init_from_table(paz00_clk_init_table);
110
111 paz00_pinmux_init();
112
113 tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
114 tegra_sdhci_device2.dev.platform_data = &sdhci_pdata2;
115 tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
116
117 platform_add_devices(paz00_devices, ARRAY_SIZE(paz00_devices));
118}
119
120MACHINE_START(PAZ00, "paz00")
121 .boot_params = 0x00000100,
122 .fixup = tegra_paz00_fixup,
123 .map_io = tegra_map_common_io,
124 .init_early = tegra_init_early,
125 .init_irq = tegra_init_irq,
126 .timer = &tegra_timer,
127 .init_machine = tegra_paz00_init,
128MACHINE_END
diff --git a/arch/arm/mach-tegra/board-paz00.h b/arch/arm/mach-tegra/board-paz00.h
new file mode 100644
index 000000000000..da193ca76d3b
--- /dev/null
+++ b/arch/arm/mach-tegra/board-paz00.h
@@ -0,0 +1,29 @@
1/*
2 * arch/arm/mach-tegra/board-paz00.h
3 *
4 * Copyright (C) 2010 Marc Dietrich <marvin24@gmx.de>
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17#ifndef _MACH_TEGRA_BOARD_PAZ00_H
18#define _MACH_TEGRA_BOARD_PAZ00_H
19
20#define TEGRA_GPIO_SD1_CD TEGRA_GPIO_PV5
21#define TEGRA_GPIO_SD1_WP TEGRA_GPIO_PH1
22#define TEGRA_GPIO_SD1_POWER TEGRA_GPIO_PT3
23#define TEGRA_GPIO_SD4_CD TEGRA_GPIO_PH2
24#define TEGRA_GPIO_SD4_WP TEGRA_GPIO_PH3
25#define TEGRA_GPIO_SD4_POWER TEGRA_GPIO_PI6
26
27void paz00_pinmux_init(void);
28
29#endif
diff --git a/arch/arm/mach-tegra/board-seaboard-pinmux.c b/arch/arm/mach-tegra/board-seaboard-pinmux.c
new file mode 100644
index 000000000000..0bda495e9742
--- /dev/null
+++ b/arch/arm/mach-tegra/board-seaboard-pinmux.c
@@ -0,0 +1,180 @@
1/*
2 * Copyright (C) 2010 NVIDIA Corporation
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/gpio.h>
18
19#include <mach/pinmux.h>
20#include <mach/pinmux-t2.h>
21
22#include "gpio-names.h"
23#include "board-seaboard.h"
24
25#define DEFAULT_DRIVE(_name) \
26 { \
27 .pingroup = TEGRA_DRIVE_PINGROUP_##_name, \
28 .hsm = TEGRA_HSM_DISABLE, \
29 .schmitt = TEGRA_SCHMITT_ENABLE, \
30 .drive = TEGRA_DRIVE_DIV_1, \
31 .pull_down = TEGRA_PULL_31, \
32 .pull_up = TEGRA_PULL_31, \
33 .slew_rising = TEGRA_SLEW_SLOWEST, \
34 .slew_falling = TEGRA_SLEW_SLOWEST, \
35 }
36
37static __initdata struct tegra_drive_pingroup_config seaboard_drive_pinmux[] = {
38 DEFAULT_DRIVE(SDIO1),
39};
40
41static __initdata struct tegra_pingroup_config seaboard_pinmux[] = {
42 {TEGRA_PINGROUP_ATA, TEGRA_MUX_IDE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
43 {TEGRA_PINGROUP_ATB, TEGRA_MUX_SDIO4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
44 {TEGRA_PINGROUP_ATC, TEGRA_MUX_NAND, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
45 {TEGRA_PINGROUP_ATD, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
46 {TEGRA_PINGROUP_ATE, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
47 {TEGRA_PINGROUP_CDEV1, TEGRA_MUX_PLLA_OUT, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
48 {TEGRA_PINGROUP_CDEV2, TEGRA_MUX_PLLP_OUT4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
49 {TEGRA_PINGROUP_CRTP, TEGRA_MUX_CRT, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
50 {TEGRA_PINGROUP_CSUS, TEGRA_MUX_VI_SENSOR_CLK, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
51 {TEGRA_PINGROUP_DAP1, TEGRA_MUX_DAP1, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
52 {TEGRA_PINGROUP_DAP2, TEGRA_MUX_DAP2, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
53 {TEGRA_PINGROUP_DAP3, TEGRA_MUX_DAP3, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
54 {TEGRA_PINGROUP_DAP4, TEGRA_MUX_DAP4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
55 {TEGRA_PINGROUP_DDC, TEGRA_MUX_RSVD2, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
56 {TEGRA_PINGROUP_DTA, TEGRA_MUX_VI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
57 {TEGRA_PINGROUP_DTB, TEGRA_MUX_VI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
58 {TEGRA_PINGROUP_DTC, TEGRA_MUX_VI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
59 {TEGRA_PINGROUP_DTD, TEGRA_MUX_VI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
60 {TEGRA_PINGROUP_DTE, TEGRA_MUX_VI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
61 {TEGRA_PINGROUP_DTF, TEGRA_MUX_I2C3, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
62 {TEGRA_PINGROUP_GMA, TEGRA_MUX_SDIO4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
63 {TEGRA_PINGROUP_GMB, TEGRA_MUX_GMI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
64 {TEGRA_PINGROUP_GMC, TEGRA_MUX_UARTD, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
65 {TEGRA_PINGROUP_GMD, TEGRA_MUX_SFLASH, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
66 {TEGRA_PINGROUP_GME, TEGRA_MUX_SDIO4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
67 {TEGRA_PINGROUP_GPU, TEGRA_MUX_PWM, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
68 {TEGRA_PINGROUP_GPU7, TEGRA_MUX_RTCK, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
69 {TEGRA_PINGROUP_GPV, TEGRA_MUX_PCIE, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
70 {TEGRA_PINGROUP_HDINT, TEGRA_MUX_HDMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
71 {TEGRA_PINGROUP_I2CP, TEGRA_MUX_I2C, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
72 {TEGRA_PINGROUP_IRRX, TEGRA_MUX_UARTB, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
73 {TEGRA_PINGROUP_IRTX, TEGRA_MUX_UARTB, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
74 {TEGRA_PINGROUP_KBCA, TEGRA_MUX_KBC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
75 {TEGRA_PINGROUP_KBCB, TEGRA_MUX_KBC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
76 {TEGRA_PINGROUP_KBCC, TEGRA_MUX_KBC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
77 {TEGRA_PINGROUP_KBCD, TEGRA_MUX_KBC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
78 {TEGRA_PINGROUP_KBCE, TEGRA_MUX_KBC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
79 {TEGRA_PINGROUP_KBCF, TEGRA_MUX_KBC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
80 {TEGRA_PINGROUP_LCSN, TEGRA_MUX_RSVD4, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
81 {TEGRA_PINGROUP_LD0, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
82 {TEGRA_PINGROUP_LD1, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
83 {TEGRA_PINGROUP_LD10, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
84 {TEGRA_PINGROUP_LD11, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
85 {TEGRA_PINGROUP_LD12, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
86 {TEGRA_PINGROUP_LD13, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
87 {TEGRA_PINGROUP_LD14, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
88 {TEGRA_PINGROUP_LD15, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
89 {TEGRA_PINGROUP_LD16, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
90 {TEGRA_PINGROUP_LD17, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
91 {TEGRA_PINGROUP_LD2, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
92 {TEGRA_PINGROUP_LD3, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
93 {TEGRA_PINGROUP_LD4, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
94 {TEGRA_PINGROUP_LD5, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
95 {TEGRA_PINGROUP_LD6, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
96 {TEGRA_PINGROUP_LD7, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
97 {TEGRA_PINGROUP_LD8, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
98 {TEGRA_PINGROUP_LD9, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
99 {TEGRA_PINGROUP_LDC, TEGRA_MUX_RSVD4, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
100 {TEGRA_PINGROUP_LDI, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
101 {TEGRA_PINGROUP_LHP0, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
102 {TEGRA_PINGROUP_LHP1, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
103 {TEGRA_PINGROUP_LHP2, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
104 {TEGRA_PINGROUP_LHS, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
105 {TEGRA_PINGROUP_LM0, TEGRA_MUX_RSVD4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
106 {TEGRA_PINGROUP_LM1, TEGRA_MUX_CRT, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
107 {TEGRA_PINGROUP_LPP, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
108 {TEGRA_PINGROUP_LPW0, TEGRA_MUX_HDMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
109 {TEGRA_PINGROUP_LPW1, TEGRA_MUX_RSVD4, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
110 {TEGRA_PINGROUP_LPW2, TEGRA_MUX_HDMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
111 {TEGRA_PINGROUP_LSC0, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
112 {TEGRA_PINGROUP_LSC1, TEGRA_MUX_HDMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
113 {TEGRA_PINGROUP_LSCK, TEGRA_MUX_HDMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
114 {TEGRA_PINGROUP_LSDA, TEGRA_MUX_HDMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
115 {TEGRA_PINGROUP_LSDI, TEGRA_MUX_RSVD4, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
116 {TEGRA_PINGROUP_LSPI, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
117 {TEGRA_PINGROUP_LVP0, TEGRA_MUX_RSVD4, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
118 {TEGRA_PINGROUP_LVP1, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
119 {TEGRA_PINGROUP_LVS, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
120 {TEGRA_PINGROUP_OWC, TEGRA_MUX_RSVD2, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
121 {TEGRA_PINGROUP_PMC, TEGRA_MUX_PWR_ON, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
122 {TEGRA_PINGROUP_PTA, TEGRA_MUX_HDMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
123 {TEGRA_PINGROUP_RM, TEGRA_MUX_I2C, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
124 {TEGRA_PINGROUP_SDB, TEGRA_MUX_SDIO3, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
125 {TEGRA_PINGROUP_SDC, TEGRA_MUX_SDIO3, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
126 {TEGRA_PINGROUP_SDD, TEGRA_MUX_SDIO3, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
127 {TEGRA_PINGROUP_SDIO1, TEGRA_MUX_SDIO1, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
128 {TEGRA_PINGROUP_SLXA, TEGRA_MUX_PCIE, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
129 {TEGRA_PINGROUP_SLXC, TEGRA_MUX_SPDIF, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
130 {TEGRA_PINGROUP_SLXD, TEGRA_MUX_SPDIF, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
131 {TEGRA_PINGROUP_SLXK, TEGRA_MUX_PCIE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
132 {TEGRA_PINGROUP_SPDI, TEGRA_MUX_RSVD2, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
133 {TEGRA_PINGROUP_SPDO, TEGRA_MUX_RSVD2, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
134 {TEGRA_PINGROUP_SPIA, TEGRA_MUX_GMI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
135 {TEGRA_PINGROUP_SPIB, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
136 {TEGRA_PINGROUP_SPIC, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
137 {TEGRA_PINGROUP_SPID, TEGRA_MUX_SPI1, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
138 {TEGRA_PINGROUP_SPIE, TEGRA_MUX_SPI1, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
139 {TEGRA_PINGROUP_SPIF, TEGRA_MUX_SPI1, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
140 {TEGRA_PINGROUP_SPIG, TEGRA_MUX_SPI2_ALT, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
141 {TEGRA_PINGROUP_SPIH, TEGRA_MUX_SPI2_ALT, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
142 {TEGRA_PINGROUP_UAA, TEGRA_MUX_ULPI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
143 {TEGRA_PINGROUP_UAB, TEGRA_MUX_ULPI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
144 {TEGRA_PINGROUP_UAC, TEGRA_MUX_RSVD2, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
145 {TEGRA_PINGROUP_UAD, TEGRA_MUX_IRDA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
146 {TEGRA_PINGROUP_UCA, TEGRA_MUX_UARTC, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
147 {TEGRA_PINGROUP_UCB, TEGRA_MUX_UARTC, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
148 {TEGRA_PINGROUP_UDA, TEGRA_MUX_ULPI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
149 {TEGRA_PINGROUP_CK32, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
150 {TEGRA_PINGROUP_DDRC, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
151 {TEGRA_PINGROUP_PMCA, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
152 {TEGRA_PINGROUP_PMCB, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
153 {TEGRA_PINGROUP_PMCC, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
154 {TEGRA_PINGROUP_PMCD, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
155 {TEGRA_PINGROUP_PMCE, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
156 {TEGRA_PINGROUP_XM2C, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
157 {TEGRA_PINGROUP_XM2D, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
158};
159
160
161
162
163static struct tegra_gpio_table gpio_table[] = {
164 { .gpio = TEGRA_GPIO_SD2_CD, .enable = true },
165 { .gpio = TEGRA_GPIO_SD2_WP, .enable = true },
166 { .gpio = TEGRA_GPIO_SD2_POWER, .enable = true },
167 { .gpio = TEGRA_GPIO_LIDSWITCH, .enable = true },
168 { .gpio = TEGRA_GPIO_POWERKEY, .enable = true },
169 { .gpio = TEGRA_GPIO_ISL29018_IRQ, .enable = true },
170};
171
172void __init seaboard_pinmux_init(void)
173{
174 tegra_pinmux_config_table(seaboard_pinmux, ARRAY_SIZE(seaboard_pinmux));
175
176 tegra_drive_pinmux_config_table(seaboard_drive_pinmux,
177 ARRAY_SIZE(seaboard_drive_pinmux));
178
179 tegra_gpio_config(gpio_table, ARRAY_SIZE(gpio_table));
180}
diff --git a/arch/arm/mach-tegra/board-seaboard.c b/arch/arm/mach-tegra/board-seaboard.c
new file mode 100644
index 000000000000..a8d7ace9f958
--- /dev/null
+++ b/arch/arm/mach-tegra/board-seaboard.c
@@ -0,0 +1,250 @@
1/*
2 * Copyright (c) 2010, 2011 NVIDIA Corporation.
3 * Copyright (C) 2010, 2011 Google, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 */
16
17#include <linux/kernel.h>
18#include <linux/init.h>
19#include <linux/platform_device.h>
20#include <linux/serial_8250.h>
21#include <linux/i2c.h>
22#include <linux/i2c-tegra.h>
23#include <linux/delay.h>
24#include <linux/input.h>
25#include <linux/io.h>
26#include <linux/gpio.h>
27#include <linux/gpio_keys.h>
28
29#include <mach/iomap.h>
30#include <mach/irqs.h>
31#include <mach/sdhci.h>
32
33#include <asm/mach-types.h>
34#include <asm/mach/arch.h>
35
36#include "board.h"
37#include "board-seaboard.h"
38#include "clock.h"
39#include "devices.h"
40#include "gpio-names.h"
41
42static struct plat_serial8250_port debug_uart_platform_data[] = {
43 {
44 /* Memory and IRQ filled in before registration */
45 .flags = UPF_BOOT_AUTOCONF,
46 .iotype = UPIO_MEM,
47 .regshift = 2,
48 .uartclk = 216000000,
49 }, {
50 .flags = 0,
51 }
52};
53
54static struct platform_device debug_uart = {
55 .name = "serial8250",
56 .id = PLAT8250_DEV_PLATFORM,
57 .dev = {
58 .platform_data = debug_uart_platform_data,
59 },
60};
61
62static __initdata struct tegra_clk_init_table seaboard_clk_init_table[] = {
63 /* name parent rate enabled */
64 { "uartb", "pll_p", 216000000, true},
65 { "uartd", "pll_p", 216000000, true},
66 { NULL, NULL, 0, 0},
67};
68
69static struct tegra_i2c_platform_data seaboard_i2c1_platform_data = {
70 .bus_clk_rate = 400000.
71};
72
73static struct tegra_i2c_platform_data seaboard_i2c2_platform_data = {
74 .bus_clk_rate = 400000,
75};
76
77static struct tegra_i2c_platform_data seaboard_i2c3_platform_data = {
78 .bus_clk_rate = 400000,
79};
80
81static struct tegra_i2c_platform_data seaboard_dvc_platform_data = {
82 .bus_clk_rate = 400000,
83};
84
85static struct gpio_keys_button seaboard_gpio_keys_buttons[] = {
86 {
87 .code = SW_LID,
88 .gpio = TEGRA_GPIO_LIDSWITCH,
89 .active_low = 0,
90 .desc = "Lid",
91 .type = EV_SW,
92 .wakeup = 1,
93 .debounce_interval = 1,
94 },
95 {
96 .code = KEY_POWER,
97 .gpio = TEGRA_GPIO_POWERKEY,
98 .active_low = 1,
99 .desc = "Power",
100 .type = EV_KEY,
101 .wakeup = 1,
102 },
103};
104
105static struct gpio_keys_platform_data seaboard_gpio_keys = {
106 .buttons = seaboard_gpio_keys_buttons,
107 .nbuttons = ARRAY_SIZE(seaboard_gpio_keys_buttons),
108};
109
110static struct platform_device seaboard_gpio_keys_device = {
111 .name = "gpio-keys",
112 .id = -1,
113 .dev = {
114 .platform_data = &seaboard_gpio_keys,
115 }
116};
117
118static struct tegra_sdhci_platform_data sdhci_pdata1 = {
119 .cd_gpio = -1,
120 .wp_gpio = -1,
121 .power_gpio = -1,
122};
123
124static struct tegra_sdhci_platform_data sdhci_pdata3 = {
125 .cd_gpio = TEGRA_GPIO_SD2_CD,
126 .wp_gpio = TEGRA_GPIO_SD2_WP,
127 .power_gpio = TEGRA_GPIO_SD2_POWER,
128};
129
130static struct tegra_sdhci_platform_data sdhci_pdata4 = {
131 .cd_gpio = -1,
132 .wp_gpio = -1,
133 .power_gpio = -1,
134 .is_8bit = 1,
135};
136
137static struct platform_device *seaboard_devices[] __initdata = {
138 &debug_uart,
139 &tegra_pmu_device,
140 &tegra_sdhci_device1,
141 &tegra_sdhci_device3,
142 &tegra_sdhci_device4,
143 &seaboard_gpio_keys_device,
144};
145
146static struct i2c_board_info __initdata isl29018_device = {
147 I2C_BOARD_INFO("isl29018", 0x44),
148 .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_ISL29018_IRQ),
149};
150
151static struct i2c_board_info __initdata adt7461_device = {
152 I2C_BOARD_INFO("adt7461", 0x4c),
153};
154
155static void __init seaboard_i2c_init(void)
156{
157 gpio_request(TEGRA_GPIO_ISL29018_IRQ, "isl29018");
158 gpio_direction_input(TEGRA_GPIO_ISL29018_IRQ);
159
160 i2c_register_board_info(0, &isl29018_device, 1);
161
162 i2c_register_board_info(4, &adt7461_device, 1);
163
164 tegra_i2c_device1.dev.platform_data = &seaboard_i2c1_platform_data;
165 tegra_i2c_device2.dev.platform_data = &seaboard_i2c2_platform_data;
166 tegra_i2c_device3.dev.platform_data = &seaboard_i2c3_platform_data;
167 tegra_i2c_device4.dev.platform_data = &seaboard_dvc_platform_data;
168
169 platform_device_register(&tegra_i2c_device1);
170 platform_device_register(&tegra_i2c_device2);
171 platform_device_register(&tegra_i2c_device3);
172 platform_device_register(&tegra_i2c_device4);
173}
174
175static void __init seaboard_common_init(void)
176{
177 seaboard_pinmux_init();
178
179 tegra_clk_init_from_table(seaboard_clk_init_table);
180
181 tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
182 tegra_sdhci_device3.dev.platform_data = &sdhci_pdata3;
183 tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
184
185 platform_add_devices(seaboard_devices, ARRAY_SIZE(seaboard_devices));
186}
187
188static void __init tegra_seaboard_init(void)
189{
190 /* Seaboard uses UARTD for the debug port. */
191 debug_uart_platform_data[0].membase = IO_ADDRESS(TEGRA_UARTD_BASE);
192 debug_uart_platform_data[0].mapbase = TEGRA_UARTD_BASE;
193 debug_uart_platform_data[0].irq = INT_UARTD;
194
195 seaboard_common_init();
196
197 seaboard_i2c_init();
198}
199
200static void __init tegra_kaen_init(void)
201{
202 /* Kaen uses UARTB for the debug port. */
203 debug_uart_platform_data[0].membase = IO_ADDRESS(TEGRA_UARTB_BASE);
204 debug_uart_platform_data[0].mapbase = TEGRA_UARTB_BASE;
205 debug_uart_platform_data[0].irq = INT_UARTB;
206
207 seaboard_common_init();
208
209 seaboard_i2c_init();
210}
211
212static void __init tegra_wario_init(void)
213{
214 /* Wario uses UARTB for the debug port. */
215 debug_uart_platform_data[0].membase = IO_ADDRESS(TEGRA_UARTB_BASE);
216 debug_uart_platform_data[0].mapbase = TEGRA_UARTB_BASE;
217 debug_uart_platform_data[0].irq = INT_UARTB;
218
219 seaboard_common_init();
220
221 seaboard_i2c_init();
222}
223
224
225MACHINE_START(SEABOARD, "seaboard")
226 .boot_params = 0x00000100,
227 .map_io = tegra_map_common_io,
228 .init_early = tegra_init_early,
229 .init_irq = tegra_init_irq,
230 .timer = &tegra_timer,
231 .init_machine = tegra_seaboard_init,
232MACHINE_END
233
234MACHINE_START(KAEN, "kaen")
235 .boot_params = 0x00000100,
236 .map_io = tegra_map_common_io,
237 .init_early = tegra_init_early,
238 .init_irq = tegra_init_irq,
239 .timer = &tegra_timer,
240 .init_machine = tegra_kaen_init,
241MACHINE_END
242
243MACHINE_START(WARIO, "wario")
244 .boot_params = 0x00000100,
245 .map_io = tegra_map_common_io,
246 .init_early = tegra_init_early,
247 .init_irq = tegra_init_irq,
248 .timer = &tegra_timer,
249 .init_machine = tegra_wario_init,
250MACHINE_END
diff --git a/arch/arm/mach-tegra/board-seaboard.h b/arch/arm/mach-tegra/board-seaboard.h
new file mode 100644
index 000000000000..d8415e1a8434
--- /dev/null
+++ b/arch/arm/mach-tegra/board-seaboard.h
@@ -0,0 +1,41 @@
1/*
2 * arch/arm/mach-tegra/board-seaboard.h
3 *
4 * Copyright (C) 2010 Google, Inc.
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17#ifndef _MACH_TEGRA_BOARD_SEABOARD_H
18#define _MACH_TEGRA_BOARD_SEABOARD_H
19
20#define TEGRA_GPIO_SD2_CD TEGRA_GPIO_PI5
21#define TEGRA_GPIO_SD2_WP TEGRA_GPIO_PH1
22#define TEGRA_GPIO_SD2_POWER TEGRA_GPIO_PI6
23#define TEGRA_GPIO_LIDSWITCH TEGRA_GPIO_PC7
24#define TEGRA_GPIO_USB1 TEGRA_GPIO_PD0
25#define TEGRA_GPIO_POWERKEY TEGRA_GPIO_PV2
26#define TEGRA_GPIO_BACKLIGHT TEGRA_GPIO_PD4
27#define TEGRA_GPIO_LVDS_SHUTDOWN TEGRA_GPIO_PB2
28#define TEGRA_GPIO_BACKLIGHT_PWM TEGRA_GPIO_PU5
29#define TEGRA_GPIO_BACKLIGHT_VDD TEGRA_GPIO_PW0
30#define TEGRA_GPIO_EN_VDD_PNL TEGRA_GPIO_PC6
31#define TEGRA_GPIO_MAGNETOMETER TEGRA_GPIO_PN5
32#define TEGRA_GPIO_ISL29018_IRQ TEGRA_GPIO_PZ2
33#define TEGRA_GPIO_AC_ONLINE TEGRA_GPIO_PV3
34
35#define TPS_GPIO_BASE TEGRA_NR_GPIOS
36
37#define TPS_GPIO_WWAN_PWR (TPS_GPIO_BASE + 2)
38
39void seaboard_pinmux_init(void);
40
41#endif
diff --git a/arch/arm/mach-tegra/board-trimslice-pinmux.c b/arch/arm/mach-tegra/board-trimslice-pinmux.c
new file mode 100644
index 000000000000..13534fa08abf
--- /dev/null
+++ b/arch/arm/mach-tegra/board-trimslice-pinmux.c
@@ -0,0 +1,154 @@
1/*
2 * arch/arm/mach-tegra/board-trimslice-pinmux.c
3 *
4 * Copyright (C) 2011 CompuLab, Ltd.
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17#include <linux/kernel.h>
18#include <linux/init.h>
19
20#include <mach/pinmux.h>
21#include <mach/gpio.h>
22
23#include "gpio-names.h"
24#include "board-trimslice.h"
25
26static __initdata struct tegra_pingroup_config trimslice_pinmux[] = {
27 {TEGRA_PINGROUP_ATA, TEGRA_MUX_IDE, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
28 {TEGRA_PINGROUP_ATB, TEGRA_MUX_SDIO4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
29 {TEGRA_PINGROUP_ATC, TEGRA_MUX_NAND, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
30 {TEGRA_PINGROUP_ATD, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
31 {TEGRA_PINGROUP_ATE, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
32 {TEGRA_PINGROUP_CDEV1, TEGRA_MUX_OSC, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
33 {TEGRA_PINGROUP_CDEV2, TEGRA_MUX_PLLP_OUT4, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
34 {TEGRA_PINGROUP_CRTP, TEGRA_MUX_CRT, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
35 {TEGRA_PINGROUP_CSUS, TEGRA_MUX_VI_SENSOR_CLK, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
36 {TEGRA_PINGROUP_DAP1, TEGRA_MUX_DAP1, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
37 {TEGRA_PINGROUP_DAP2, TEGRA_MUX_DAP2, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
38 {TEGRA_PINGROUP_DAP3, TEGRA_MUX_DAP3, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
39 {TEGRA_PINGROUP_DAP4, TEGRA_MUX_DAP4, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
40 {TEGRA_PINGROUP_DDC, TEGRA_MUX_I2C2, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
41 {TEGRA_PINGROUP_DTA, TEGRA_MUX_VI, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
42 {TEGRA_PINGROUP_DTB, TEGRA_MUX_VI, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
43 {TEGRA_PINGROUP_DTC, TEGRA_MUX_VI, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
44 {TEGRA_PINGROUP_DTD, TEGRA_MUX_VI, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
45 {TEGRA_PINGROUP_DTE, TEGRA_MUX_VI, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
46 {TEGRA_PINGROUP_DTF, TEGRA_MUX_I2C3, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
47 {TEGRA_PINGROUP_GMA, TEGRA_MUX_SDIO4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
48 {TEGRA_PINGROUP_GMB, TEGRA_MUX_NAND, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
49 {TEGRA_PINGROUP_GMC, TEGRA_MUX_SFLASH, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
50 {TEGRA_PINGROUP_GMD, TEGRA_MUX_SFLASH, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
51 {TEGRA_PINGROUP_GME, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
52 {TEGRA_PINGROUP_GPU, TEGRA_MUX_UARTA, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
53 {TEGRA_PINGROUP_GPU7, TEGRA_MUX_RTCK, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
54 {TEGRA_PINGROUP_GPV, TEGRA_MUX_PCIE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
55 {TEGRA_PINGROUP_HDINT, TEGRA_MUX_HDMI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
56 {TEGRA_PINGROUP_I2CP, TEGRA_MUX_I2C, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
57 {TEGRA_PINGROUP_IRRX, TEGRA_MUX_UARTB, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
58 {TEGRA_PINGROUP_IRTX, TEGRA_MUX_UARTB, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
59 {TEGRA_PINGROUP_KBCA, TEGRA_MUX_KBC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
60 {TEGRA_PINGROUP_KBCB, TEGRA_MUX_KBC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
61 {TEGRA_PINGROUP_KBCC, TEGRA_MUX_KBC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
62 {TEGRA_PINGROUP_KBCD, TEGRA_MUX_KBC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
63 {TEGRA_PINGROUP_KBCE, TEGRA_MUX_KBC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
64 {TEGRA_PINGROUP_KBCF, TEGRA_MUX_KBC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
65 {TEGRA_PINGROUP_LCSN, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
66 {TEGRA_PINGROUP_LD0, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
67 {TEGRA_PINGROUP_LD1, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
68 {TEGRA_PINGROUP_LD2, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
69 {TEGRA_PINGROUP_LD3, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
70 {TEGRA_PINGROUP_LD4, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
71 {TEGRA_PINGROUP_LD5, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
72 {TEGRA_PINGROUP_LD6, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
73 {TEGRA_PINGROUP_LD7, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
74 {TEGRA_PINGROUP_LD8, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
75 {TEGRA_PINGROUP_LD9, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
76 {TEGRA_PINGROUP_LD10, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
77 {TEGRA_PINGROUP_LD11, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
78 {TEGRA_PINGROUP_LD12, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
79 {TEGRA_PINGROUP_LD13, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
80 {TEGRA_PINGROUP_LD14, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
81 {TEGRA_PINGROUP_LD15, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
82 {TEGRA_PINGROUP_LD16, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
83 {TEGRA_PINGROUP_LD17, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
84 {TEGRA_PINGROUP_LDC, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
85 {TEGRA_PINGROUP_LDI, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
86 {TEGRA_PINGROUP_LHP0, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
87 {TEGRA_PINGROUP_LHP1, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
88 {TEGRA_PINGROUP_LHP2, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
89 {TEGRA_PINGROUP_LHS, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
90 {TEGRA_PINGROUP_LM0, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
91 {TEGRA_PINGROUP_LM1, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
92 {TEGRA_PINGROUP_LPP, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
93 {TEGRA_PINGROUP_LPW0, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
94 {TEGRA_PINGROUP_LPW1, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
95 {TEGRA_PINGROUP_LPW2, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
96 {TEGRA_PINGROUP_LSC0, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
97 {TEGRA_PINGROUP_LSC1, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
98 {TEGRA_PINGROUP_LSCK, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
99 {TEGRA_PINGROUP_LSDA, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
100 {TEGRA_PINGROUP_LSDI, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
101 {TEGRA_PINGROUP_LSPI, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
102 {TEGRA_PINGROUP_LVP0, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
103 {TEGRA_PINGROUP_LVP1, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
104 {TEGRA_PINGROUP_LVS, TEGRA_MUX_DISPLAYA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
105 {TEGRA_PINGROUP_OWC, TEGRA_MUX_RSVD2, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
106 {TEGRA_PINGROUP_PMC, TEGRA_MUX_PWR_ON, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
107 {TEGRA_PINGROUP_PTA, TEGRA_MUX_RSVD3, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
108 {TEGRA_PINGROUP_RM, TEGRA_MUX_I2C, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
109 {TEGRA_PINGROUP_SDB, TEGRA_MUX_PWM, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
110 {TEGRA_PINGROUP_SDC, TEGRA_MUX_PWM, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
111 {TEGRA_PINGROUP_SDD, TEGRA_MUX_PWM, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
112 {TEGRA_PINGROUP_SDIO1, TEGRA_MUX_SDIO1, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
113 {TEGRA_PINGROUP_SLXA, TEGRA_MUX_PCIE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
114 {TEGRA_PINGROUP_SLXC, TEGRA_MUX_SDIO3, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
115 {TEGRA_PINGROUP_SLXD, TEGRA_MUX_SDIO3, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
116 {TEGRA_PINGROUP_SLXK, TEGRA_MUX_PCIE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
117 {TEGRA_PINGROUP_SPDI, TEGRA_MUX_SPDIF, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
118 {TEGRA_PINGROUP_SPDO, TEGRA_MUX_SPDIF, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
119 {TEGRA_PINGROUP_SPIA, TEGRA_MUX_SPI2, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
120 {TEGRA_PINGROUP_SPIB, TEGRA_MUX_SPI2, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
121 {TEGRA_PINGROUP_SPIC, TEGRA_MUX_SPI2, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
122 {TEGRA_PINGROUP_SPID, TEGRA_MUX_SPI1, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
123 {TEGRA_PINGROUP_SPIE, TEGRA_MUX_SPI1, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
124 {TEGRA_PINGROUP_SPIF, TEGRA_MUX_SPI1, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
125 {TEGRA_PINGROUP_SPIG, TEGRA_MUX_SPI2_ALT, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
126 {TEGRA_PINGROUP_SPIH, TEGRA_MUX_SPI2_ALT, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
127 {TEGRA_PINGROUP_UAA, TEGRA_MUX_ULPI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
128 {TEGRA_PINGROUP_UAB, TEGRA_MUX_ULPI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
129 {TEGRA_PINGROUP_UAC, TEGRA_MUX_RSVD2, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
130 {TEGRA_PINGROUP_UAD, TEGRA_MUX_IRDA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
131 {TEGRA_PINGROUP_UCA, TEGRA_MUX_UARTC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
132 {TEGRA_PINGROUP_UCB, TEGRA_MUX_UARTC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE},
133 {TEGRA_PINGROUP_UDA, TEGRA_MUX_ULPI, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE},
134 {TEGRA_PINGROUP_CK32, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
135 {TEGRA_PINGROUP_DDRC, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
136 {TEGRA_PINGROUP_PMCA, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
137 {TEGRA_PINGROUP_PMCB, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
138 {TEGRA_PINGROUP_PMCC, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
139 {TEGRA_PINGROUP_PMCD, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
140 {TEGRA_PINGROUP_PMCE, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
141 {TEGRA_PINGROUP_XM2C, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
142 {TEGRA_PINGROUP_XM2D, TEGRA_MUX_NONE, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
143};
144
145static struct tegra_gpio_table gpio_table[] = {
146 { .gpio = TRIMSLICE_GPIO_SD4_CD, .enable = true }, /* mmc4 cd */
147 { .gpio = TRIMSLICE_GPIO_SD4_WP, .enable = true }, /* mmc4 wp */
148};
149
150void __init trimslice_pinmux_init(void)
151{
152 tegra_pinmux_config_table(trimslice_pinmux, ARRAY_SIZE(trimslice_pinmux));
153 tegra_gpio_config(gpio_table, ARRAY_SIZE(gpio_table));
154}
diff --git a/arch/arm/mach-tegra/board-trimslice.c b/arch/arm/mach-tegra/board-trimslice.c
new file mode 100644
index 000000000000..cda4cfd78e84
--- /dev/null
+++ b/arch/arm/mach-tegra/board-trimslice.c
@@ -0,0 +1,125 @@
1/*
2 * arch/arm/mach-tegra/board-trimslice.c
3 *
4 * Copyright (C) 2011 CompuLab, Ltd.
5 * Author: Mike Rapoport <mike@compulab.co.il>
6 *
7 * Based on board-harmony.c
8 * Copyright (C) 2010 Google, Inc.
9 *
10 * This software is licensed under the terms of the GNU General Public
11 * License version 2, as published by the Free Software Foundation, and
12 * may be copied, distributed, and modified under those terms.
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
21#include <linux/kernel.h>
22#include <linux/init.h>
23#include <linux/platform_device.h>
24#include <linux/serial_8250.h>
25#include <linux/io.h>
26
27#include <asm/mach-types.h>
28#include <asm/mach/arch.h>
29#include <asm/setup.h>
30
31#include <mach/iomap.h>
32#include <mach/sdhci.h>
33
34#include "board.h"
35#include "clock.h"
36#include "devices.h"
37#include "gpio-names.h"
38
39#include "board-trimslice.h"
40
41static struct plat_serial8250_port debug_uart_platform_data[] = {
42 {
43 .membase = IO_ADDRESS(TEGRA_UARTA_BASE),
44 .mapbase = TEGRA_UARTA_BASE,
45 .irq = INT_UARTA,
46 .flags = UPF_BOOT_AUTOCONF,
47 .iotype = UPIO_MEM,
48 .regshift = 2,
49 .uartclk = 216000000,
50 }, {
51 .flags = 0
52 }
53};
54
55static struct platform_device debug_uart = {
56 .name = "serial8250",
57 .id = PLAT8250_DEV_PLATFORM,
58 .dev = {
59 .platform_data = debug_uart_platform_data,
60 },
61};
62static struct tegra_sdhci_platform_data sdhci_pdata1 = {
63 .cd_gpio = -1,
64 .wp_gpio = -1,
65 .power_gpio = -1,
66};
67
68static struct tegra_sdhci_platform_data sdhci_pdata4 = {
69 .cd_gpio = TRIMSLICE_GPIO_SD4_CD,
70 .wp_gpio = TRIMSLICE_GPIO_SD4_WP,
71 .power_gpio = -1,
72};
73
74static struct platform_device *trimslice_devices[] __initdata = {
75 &debug_uart,
76 &tegra_sdhci_device1,
77 &tegra_sdhci_device4,
78};
79
80static void __init tegra_trimslice_fixup(struct machine_desc *desc,
81 struct tag *tags, char **cmdline, struct meminfo *mi)
82{
83 mi->nr_banks = 2;
84 mi->bank[0].start = PHYS_OFFSET;
85 mi->bank[0].size = 448 * SZ_1M;
86 mi->bank[1].start = SZ_512M;
87 mi->bank[1].size = SZ_512M;
88}
89
90static __initdata struct tegra_clk_init_table trimslice_clk_init_table[] = {
91 /* name parent rate enabled */
92 { "uarta", "pll_p", 216000000, true },
93 { NULL, NULL, 0, 0},
94};
95
96static int __init tegra_trimslice_pci_init(void)
97{
98 if (!machine_is_trimslice())
99 return 0;
100
101 return tegra_pcie_init(true, true);
102}
103subsys_initcall(tegra_trimslice_pci_init);
104
105static void __init tegra_trimslice_init(void)
106{
107 tegra_clk_init_from_table(trimslice_clk_init_table);
108
109 trimslice_pinmux_init();
110
111 tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
112 tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
113
114 platform_add_devices(trimslice_devices, ARRAY_SIZE(trimslice_devices));
115}
116
117MACHINE_START(TRIMSLICE, "trimslice")
118 .boot_params = 0x00000100,
119 .fixup = tegra_trimslice_fixup,
120 .map_io = tegra_map_common_io,
121 .init_early = tegra_init_early,
122 .init_irq = tegra_init_irq,
123 .timer = &tegra_timer,
124 .init_machine = tegra_trimslice_init,
125MACHINE_END
diff --git a/arch/arm/mach-tegra/board-trimslice.h b/arch/arm/mach-tegra/board-trimslice.h
new file mode 100644
index 000000000000..e8ef6291c6f1
--- /dev/null
+++ b/arch/arm/mach-tegra/board-trimslice.h
@@ -0,0 +1,25 @@
1/*
2 * arch/arm/mach-tegra/board-trimslice.h
3 *
4 * Copyright (C) 2011 CompuLab, Ltd.
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17#ifndef _MACH_TEGRA_BOARD_TRIMSLICE_H
18#define _MACH_TEGRA_BOARD_TRIMSLICE_H
19
20#define TRIMSLICE_GPIO_SD4_CD TEGRA_GPIO_PP1 /* mmc4 cd */
21#define TRIMSLICE_GPIO_SD4_WP TEGRA_GPIO_PP2 /* mmc4 wp */
22
23void trimslice_pinmux_init(void);
24
25#endif
diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h
index 0de565ca37c5..1d14df7eb7de 100644
--- a/arch/arm/mach-tegra/board.h
+++ b/arch/arm/mach-tegra/board.h
@@ -23,7 +23,9 @@
23 23
24#include <linux/types.h> 24#include <linux/types.h>
25 25
26void __init tegra_common_init(void); 26void tegra_assert_system_reset(char mode, const char *cmd);
27
28void __init tegra_init_early(void);
27void __init tegra_map_common_io(void); 29void __init tegra_map_common_io(void);
28void __init tegra_init_irq(void); 30void __init tegra_init_irq(void);
29void __init tegra_init_clock(void); 31void __init tegra_init_clock(void);
diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
index 77948e0f4909..e028320ab423 100644
--- a/arch/arm/mach-tegra/clock.c
+++ b/arch/arm/mach-tegra/clock.c
@@ -18,238 +18,177 @@
18 18
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/clk.h> 20#include <linux/clk.h>
21#include <linux/list.h> 21#include <linux/clkdev.h>
22#include <linux/debugfs.h>
23#include <linux/delay.h>
22#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/list.h>
23#include <linux/module.h> 26#include <linux/module.h>
24#include <linux/debugfs.h> 27#include <linux/sched.h>
25#include <linux/slab.h>
26#include <linux/seq_file.h> 28#include <linux/seq_file.h>
27#include <linux/regulator/consumer.h> 29#include <linux/slab.h>
28#include <linux/clkdev.h> 30
31#include <mach/clk.h>
29 32
30#include "clock.h"
31#include "board.h" 33#include "board.h"
32#include "fuse.h" 34#include "clock.h"
33 35
36/*
37 * Locking:
38 *
39 * Each struct clk has a spinlock.
40 *
41 * To avoid AB-BA locking problems, locks must always be traversed from child
42 * clock to parent clock. For example, when enabling a clock, the clock's lock
43 * is taken, and then clk_enable is called on the parent, which take's the
44 * parent clock's lock. There is one exceptions to this ordering: When dumping
45 * the clock tree through debugfs. In this case, clk_lock_all is called,
46 * which attemps to iterate through the entire list of clocks and take every
47 * clock lock. If any call to spin_trylock fails, all locked clocks are
48 * unlocked, and the process is retried. When all the locks are held,
49 * the only clock operation that can be called is clk_get_rate_all_locked.
50 *
51 * Within a single clock, no clock operation can call another clock operation
52 * on itself, except for clk_get_rate_locked and clk_set_rate_locked. Any
53 * clock operation can call any other clock operation on any of it's possible
54 * parents.
55 *
56 * An additional mutex, clock_list_lock, is used to protect the list of all
57 * clocks.
58 *
59 * The clock operations must lock internally to protect against
60 * read-modify-write on registers that are shared by multiple clocks
61 */
62static DEFINE_MUTEX(clock_list_lock);
34static LIST_HEAD(clocks); 63static LIST_HEAD(clocks);
35 64
36static DEFINE_SPINLOCK(clock_lock);
37static DEFINE_MUTEX(dvfs_lock);
38
39static int clk_is_dvfs(struct clk *c)
40{
41 return (c->dvfs != NULL);
42};
43
44static int dvfs_set_rate(struct dvfs *d, unsigned long rate)
45{
46 struct dvfs_table *t;
47
48 if (d->table == NULL)
49 return -ENODEV;
50
51 for (t = d->table; t->rate != 0; t++) {
52 if (rate <= t->rate) {
53 if (!d->reg)
54 return 0;
55
56 return regulator_set_voltage(d->reg,
57 t->millivolts * 1000,
58 d->max_millivolts * 1000);
59 }
60 }
61
62 return -EINVAL;
63}
64
65static void dvfs_init(struct clk *c)
66{
67 int process_id;
68 int i;
69 struct dvfs_table *table;
70
71 process_id = c->dvfs->cpu ? tegra_core_process_id() :
72 tegra_cpu_process_id();
73
74 for (i = 0; i < c->dvfs->process_id_table_length; i++)
75 if (process_id == c->dvfs->process_id_table[i].process_id)
76 c->dvfs->table = c->dvfs->process_id_table[i].table;
77
78 if (c->dvfs->table == NULL) {
79 pr_err("Failed to find dvfs table for clock %s process %d\n",
80 c->name, process_id);
81 return;
82 }
83
84 c->dvfs->max_millivolts = 0;
85 for (table = c->dvfs->table; table->rate != 0; table++)
86 if (c->dvfs->max_millivolts < table->millivolts)
87 c->dvfs->max_millivolts = table->millivolts;
88
89 c->dvfs->reg = regulator_get(NULL, c->dvfs->reg_id);
90
91 if (IS_ERR(c->dvfs->reg)) {
92 pr_err("Failed to get regulator %s for clock %s\n",
93 c->dvfs->reg_id, c->name);
94 c->dvfs->reg = NULL;
95 return;
96 }
97
98 if (c->refcnt > 0)
99 dvfs_set_rate(c->dvfs, c->rate);
100}
101
102struct clk *tegra_get_clock_by_name(const char *name) 65struct clk *tegra_get_clock_by_name(const char *name)
103{ 66{
104 struct clk *c; 67 struct clk *c;
105 struct clk *ret = NULL; 68 struct clk *ret = NULL;
106 unsigned long flags; 69 mutex_lock(&clock_list_lock);
107 spin_lock_irqsave(&clock_lock, flags);
108 list_for_each_entry(c, &clocks, node) { 70 list_for_each_entry(c, &clocks, node) {
109 if (strcmp(c->name, name) == 0) { 71 if (strcmp(c->name, name) == 0) {
110 ret = c; 72 ret = c;
111 break; 73 break;
112 } 74 }
113 } 75 }
114 spin_unlock_irqrestore(&clock_lock, flags); 76 mutex_unlock(&clock_list_lock);
115 return ret; 77 return ret;
116} 78}
117 79
118static void clk_recalculate_rate(struct clk *c) 80/* Must be called with c->spinlock held */
81static unsigned long clk_predict_rate_from_parent(struct clk *c, struct clk *p)
119{ 82{
120 u64 rate; 83 u64 rate;
121 84
122 if (!c->parent) 85 rate = clk_get_rate(p);
123 return;
124
125 rate = c->parent->rate;
126 86
127 if (c->mul != 0 && c->div != 0) { 87 if (c->mul != 0 && c->div != 0) {
128 rate = rate * c->mul; 88 rate *= c->mul;
89 rate += c->div - 1; /* round up */
129 do_div(rate, c->div); 90 do_div(rate, c->div);
130 } 91 }
131 92
132 if (rate > c->max_rate) 93 return rate;
133 pr_warn("clocks: Set clock %s to rate %llu, max is %lu\n",
134 c->name, rate, c->max_rate);
135
136 c->rate = rate;
137} 94}
138 95
139int clk_reparent(struct clk *c, struct clk *parent) 96/* Must be called with c->spinlock held */
97unsigned long clk_get_rate_locked(struct clk *c)
140{ 98{
141 pr_debug("%s: %s\n", __func__, c->name); 99 unsigned long rate;
142 c->parent = parent;
143 list_del(&c->sibling);
144 list_add_tail(&c->sibling, &parent->children);
145 return 0;
146}
147 100
148static void propagate_rate(struct clk *c) 101 if (c->parent)
149{ 102 rate = clk_predict_rate_from_parent(c, c->parent);
150 struct clk *clkp; 103 else
151 pr_debug("%s: %s\n", __func__, c->name); 104 rate = c->rate;
152 list_for_each_entry(clkp, &c->children, sibling) { 105
153 pr_debug(" %s\n", clkp->name); 106 return rate;
154 clk_recalculate_rate(clkp);
155 propagate_rate(clkp);
156 }
157} 107}
158 108
159void clk_init(struct clk *c) 109unsigned long clk_get_rate(struct clk *c)
160{ 110{
161 unsigned long flags; 111 unsigned long flags;
112 unsigned long rate;
113
114 spin_lock_irqsave(&c->spinlock, flags);
162 115
163 pr_debug("%s: %s\n", __func__, c->name); 116 rate = clk_get_rate_locked(c);
164 117
165 spin_lock_irqsave(&clock_lock, flags); 118 spin_unlock_irqrestore(&c->spinlock, flags);
166 119
167 INIT_LIST_HEAD(&c->children); 120 return rate;
168 INIT_LIST_HEAD(&c->sibling); 121}
122EXPORT_SYMBOL(clk_get_rate);
123
124int clk_reparent(struct clk *c, struct clk *parent)
125{
126 c->parent = parent;
127 return 0;
128}
129
130void clk_init(struct clk *c)
131{
132 spin_lock_init(&c->spinlock);
169 133
170 if (c->ops && c->ops->init) 134 if (c->ops && c->ops->init)
171 c->ops->init(c); 135 c->ops->init(c);
172 136
173 clk_recalculate_rate(c); 137 if (!c->ops || !c->ops->enable) {
138 c->refcnt++;
139 c->set = true;
140 if (c->parent)
141 c->state = c->parent->state;
142 else
143 c->state = ON;
144 }
174 145
146 mutex_lock(&clock_list_lock);
175 list_add(&c->node, &clocks); 147 list_add(&c->node, &clocks);
176 148 mutex_unlock(&clock_list_lock);
177 if (c->parent)
178 list_add_tail(&c->sibling, &c->parent->children);
179
180 spin_unlock_irqrestore(&clock_lock, flags);
181} 149}
182 150
183int clk_enable_locked(struct clk *c) 151int clk_enable(struct clk *c)
184{ 152{
185 int ret; 153 int ret = 0;
186 pr_debug("%s: %s\n", __func__, c->name); 154 unsigned long flags;
155
156 spin_lock_irqsave(&c->spinlock, flags);
157
187 if (c->refcnt == 0) { 158 if (c->refcnt == 0) {
188 if (c->parent) { 159 if (c->parent) {
189 ret = clk_enable_locked(c->parent); 160 ret = clk_enable(c->parent);
190 if (ret) 161 if (ret)
191 return ret; 162 goto out;
192 } 163 }
193 164
194 if (c->ops && c->ops->enable) { 165 if (c->ops && c->ops->enable) {
195 ret = c->ops->enable(c); 166 ret = c->ops->enable(c);
196 if (ret) { 167 if (ret) {
197 if (c->parent) 168 if (c->parent)
198 clk_disable_locked(c->parent); 169 clk_disable(c->parent);
199 return ret; 170 goto out;
200 } 171 }
201 c->state = ON; 172 c->state = ON;
202#ifdef CONFIG_DEBUG_FS 173 c->set = true;
203 c->set = 1;
204#endif
205 } 174 }
206 } 175 }
207 c->refcnt++; 176 c->refcnt++;
208 177out:
209 return 0; 178 spin_unlock_irqrestore(&c->spinlock, flags);
210}
211
212int clk_enable_cansleep(struct clk *c)
213{
214 int ret;
215 unsigned long flags;
216
217 mutex_lock(&dvfs_lock);
218
219 if (clk_is_dvfs(c) && c->refcnt > 0)
220 dvfs_set_rate(c->dvfs, c->rate);
221
222 spin_lock_irqsave(&clock_lock, flags);
223 ret = clk_enable_locked(c);
224 spin_unlock_irqrestore(&clock_lock, flags);
225
226 mutex_unlock(&dvfs_lock);
227
228 return ret; 179 return ret;
229} 180}
230EXPORT_SYMBOL(clk_enable_cansleep); 181EXPORT_SYMBOL(clk_enable);
231 182
232int clk_enable(struct clk *c) 183void clk_disable(struct clk *c)
233{ 184{
234 int ret;
235 unsigned long flags; 185 unsigned long flags;
236 186
237 if (clk_is_dvfs(c)) 187 spin_lock_irqsave(&c->spinlock, flags);
238 BUG();
239
240 spin_lock_irqsave(&clock_lock, flags);
241 ret = clk_enable_locked(c);
242 spin_unlock_irqrestore(&clock_lock, flags);
243
244 return ret;
245}
246EXPORT_SYMBOL(clk_enable);
247 188
248void clk_disable_locked(struct clk *c)
249{
250 pr_debug("%s: %s\n", __func__, c->name);
251 if (c->refcnt == 0) { 189 if (c->refcnt == 0) {
252 WARN(1, "Attempting to disable clock %s with refcnt 0", c->name); 190 WARN(1, "Attempting to disable clock %s with refcnt 0", c->name);
191 spin_unlock_irqrestore(&c->spinlock, flags);
253 return; 192 return;
254 } 193 }
255 if (c->refcnt == 1) { 194 if (c->refcnt == 1) {
@@ -257,71 +196,39 @@ void clk_disable_locked(struct clk *c)
257 c->ops->disable(c); 196 c->ops->disable(c);
258 197
259 if (c->parent) 198 if (c->parent)
260 clk_disable_locked(c->parent); 199 clk_disable(c->parent);
261 200
262 c->state = OFF; 201 c->state = OFF;
263 } 202 }
264 c->refcnt--; 203 c->refcnt--;
265}
266
267void clk_disable_cansleep(struct clk *c)
268{
269 unsigned long flags;
270
271 mutex_lock(&dvfs_lock);
272
273 spin_lock_irqsave(&clock_lock, flags);
274 clk_disable_locked(c);
275 spin_unlock_irqrestore(&clock_lock, flags);
276 204
277 if (clk_is_dvfs(c) && c->refcnt == 0) 205 spin_unlock_irqrestore(&c->spinlock, flags);
278 dvfs_set_rate(c->dvfs, c->rate);
279
280 mutex_unlock(&dvfs_lock);
281}
282EXPORT_SYMBOL(clk_disable_cansleep);
283
284void clk_disable(struct clk *c)
285{
286 unsigned long flags;
287
288 if (clk_is_dvfs(c))
289 BUG();
290
291 spin_lock_irqsave(&clock_lock, flags);
292 clk_disable_locked(c);
293 spin_unlock_irqrestore(&clock_lock, flags);
294} 206}
295EXPORT_SYMBOL(clk_disable); 207EXPORT_SYMBOL(clk_disable);
296 208
297int clk_set_parent_locked(struct clk *c, struct clk *parent) 209int clk_set_parent(struct clk *c, struct clk *parent)
298{ 210{
299 int ret; 211 int ret;
212 unsigned long flags;
213 unsigned long new_rate;
214 unsigned long old_rate;
300 215
301 pr_debug("%s: %s\n", __func__, c->name); 216 spin_lock_irqsave(&c->spinlock, flags);
302 217
303 if (!c->ops || !c->ops->set_parent) 218 if (!c->ops || !c->ops->set_parent) {
304 return -ENOSYS; 219 ret = -ENOSYS;
220 goto out;
221 }
305 222
306 ret = c->ops->set_parent(c, parent); 223 new_rate = clk_predict_rate_from_parent(c, parent);
224 old_rate = clk_get_rate_locked(c);
307 225
226 ret = c->ops->set_parent(c, parent);
308 if (ret) 227 if (ret)
309 return ret; 228 goto out;
310
311 clk_recalculate_rate(c);
312
313 propagate_rate(c);
314
315 return 0;
316}
317 229
318int clk_set_parent(struct clk *c, struct clk *parent) 230out:
319{ 231 spin_unlock_irqrestore(&c->spinlock, flags);
320 int ret;
321 unsigned long flags;
322 spin_lock_irqsave(&clock_lock, flags);
323 ret = clk_set_parent_locked(c, parent);
324 spin_unlock_irqrestore(&clock_lock, flags);
325 return ret; 232 return ret;
326} 233}
327EXPORT_SYMBOL(clk_set_parent); 234EXPORT_SYMBOL(clk_set_parent);
@@ -334,100 +241,86 @@ EXPORT_SYMBOL(clk_get_parent);
334 241
335int clk_set_rate_locked(struct clk *c, unsigned long rate) 242int clk_set_rate_locked(struct clk *c, unsigned long rate)
336{ 243{
337 int ret; 244 long new_rate;
338
339 if (rate > c->max_rate)
340 rate = c->max_rate;
341 245
342 if (!c->ops || !c->ops->set_rate) 246 if (!c->ops || !c->ops->set_rate)
343 return -ENOSYS; 247 return -ENOSYS;
344 248
345 ret = c->ops->set_rate(c, rate); 249 if (rate > c->max_rate)
346 250 rate = c->max_rate;
347 if (ret)
348 return ret;
349
350 clk_recalculate_rate(c);
351
352 propagate_rate(c);
353
354 return 0;
355}
356
357int clk_set_rate_cansleep(struct clk *c, unsigned long rate)
358{
359 int ret = 0;
360 unsigned long flags;
361
362 pr_debug("%s: %s\n", __func__, c->name);
363
364 mutex_lock(&dvfs_lock);
365
366 if (rate > c->rate)
367 ret = dvfs_set_rate(c->dvfs, rate);
368 if (ret)
369 goto out;
370 251
371 spin_lock_irqsave(&clock_lock, flags); 252 if (c->ops && c->ops->round_rate) {
372 ret = clk_set_rate_locked(c, rate); 253 new_rate = c->ops->round_rate(c, rate);
373 spin_unlock_irqrestore(&clock_lock, flags);
374 254
375 if (ret) 255 if (new_rate < 0)
376 goto out; 256 return new_rate;
377 257
378 ret = dvfs_set_rate(c->dvfs, rate); 258 rate = new_rate;
259 }
379 260
380out: 261 return c->ops->set_rate(c, rate);
381 mutex_unlock(&dvfs_lock);
382 return ret;
383} 262}
384EXPORT_SYMBOL(clk_set_rate_cansleep);
385 263
386int clk_set_rate(struct clk *c, unsigned long rate) 264int clk_set_rate(struct clk *c, unsigned long rate)
387{ 265{
388 int ret = 0; 266 int ret;
389 unsigned long flags; 267 unsigned long flags;
390 268
391 pr_debug("%s: %s\n", __func__, c->name); 269 spin_lock_irqsave(&c->spinlock, flags);
392
393 if (clk_is_dvfs(c))
394 BUG();
395 270
396 spin_lock_irqsave(&clock_lock, flags);
397 ret = clk_set_rate_locked(c, rate); 271 ret = clk_set_rate_locked(c, rate);
398 spin_unlock_irqrestore(&clock_lock, flags); 272
273 spin_unlock_irqrestore(&c->spinlock, flags);
399 274
400 return ret; 275 return ret;
401} 276}
402EXPORT_SYMBOL(clk_set_rate); 277EXPORT_SYMBOL(clk_set_rate);
403 278
404unsigned long clk_get_rate(struct clk *c)
405{
406 unsigned long flags;
407 unsigned long ret;
408
409 spin_lock_irqsave(&clock_lock, flags);
410 279
411 pr_debug("%s: %s\n", __func__, c->name); 280/* Must be called with clocks lock and all indvidual clock locks held */
281unsigned long clk_get_rate_all_locked(struct clk *c)
282{
283 u64 rate;
284 int mul = 1;
285 int div = 1;
286 struct clk *p = c;
287
288 while (p) {
289 c = p;
290 if (c->mul != 0 && c->div != 0) {
291 mul *= c->mul;
292 div *= c->div;
293 }
294 p = c->parent;
295 }
412 296
413 ret = c->rate; 297 rate = c->rate;
298 rate *= mul;
299 do_div(rate, div);
414 300
415 spin_unlock_irqrestore(&clock_lock, flags); 301 return rate;
416 return ret;
417} 302}
418EXPORT_SYMBOL(clk_get_rate);
419 303
420long clk_round_rate(struct clk *c, unsigned long rate) 304long clk_round_rate(struct clk *c, unsigned long rate)
421{ 305{
422 pr_debug("%s: %s\n", __func__, c->name); 306 unsigned long flags;
307 long ret;
423 308
424 if (!c->ops || !c->ops->round_rate) 309 spin_lock_irqsave(&c->spinlock, flags);
425 return -ENOSYS; 310
311 if (!c->ops || !c->ops->round_rate) {
312 ret = -ENOSYS;
313 goto out;
314 }
426 315
427 if (rate > c->max_rate) 316 if (rate > c->max_rate)
428 rate = c->max_rate; 317 rate = c->max_rate;
429 318
430 return c->ops->round_rate(c, rate); 319 ret = c->ops->round_rate(c, rate);
320
321out:
322 spin_unlock_irqrestore(&c->spinlock, flags);
323 return ret;
431} 324}
432EXPORT_SYMBOL(clk_round_rate); 325EXPORT_SYMBOL(clk_round_rate);
433 326
@@ -509,31 +402,90 @@ void __init tegra_init_clock(void)
509 tegra2_init_clocks(); 402 tegra2_init_clocks();
510} 403}
511 404
512int __init tegra_init_dvfs(void) 405/*
406 * The SDMMC controllers have extra bits in the clock source register that
407 * adjust the delay between the clock and data to compenstate for delays
408 * on the PCB.
409 */
410void tegra_sdmmc_tap_delay(struct clk *c, int delay)
513{ 411{
514 struct clk *c, *safe; 412 unsigned long flags;
413
414 spin_lock_irqsave(&c->spinlock, flags);
415 tegra2_sdmmc_tap_delay(c, delay);
416 spin_unlock_irqrestore(&c->spinlock, flags);
417}
515 418
516 mutex_lock(&dvfs_lock); 419#ifdef CONFIG_DEBUG_FS
517 420
518 list_for_each_entry_safe(c, safe, &clocks, node) 421static int __clk_lock_all_spinlocks(void)
519 if (c->dvfs) 422{
520 dvfs_init(c); 423 struct clk *c;
521 424
522 mutex_unlock(&dvfs_lock); 425 list_for_each_entry(c, &clocks, node)
426 if (!spin_trylock(&c->spinlock))
427 goto unlock_spinlocks;
523 428
524 return 0; 429 return 0;
430
431unlock_spinlocks:
432 list_for_each_entry_continue_reverse(c, &clocks, node)
433 spin_unlock(&c->spinlock);
434
435 return -EAGAIN;
525} 436}
526 437
527late_initcall(tegra_init_dvfs); 438static void __clk_unlock_all_spinlocks(void)
439{
440 struct clk *c;
441
442 list_for_each_entry_reverse(c, &clocks, node)
443 spin_unlock(&c->spinlock);
444}
445
446/*
447 * This function retries until it can take all locks, and may take
448 * an arbitrarily long time to complete.
449 * Must be called with irqs enabled, returns with irqs disabled
450 * Must be called with clock_list_lock held
451 */
452static void clk_lock_all(void)
453{
454 int ret;
455retry:
456 local_irq_disable();
457
458 ret = __clk_lock_all_spinlocks();
459 if (ret)
460 goto failed_spinlocks;
461
462 /* All locks taken successfully, return */
463 return;
464
465failed_spinlocks:
466 local_irq_enable();
467 yield();
468 goto retry;
469}
470
471/*
472 * Unlocks all clocks after a clk_lock_all
473 * Must be called with irqs disabled, returns with irqs enabled
474 * Must be called with clock_list_lock held
475 */
476static void clk_unlock_all(void)
477{
478 __clk_unlock_all_spinlocks();
479
480 local_irq_enable();
481}
528 482
529#ifdef CONFIG_DEBUG_FS
530static struct dentry *clk_debugfs_root; 483static struct dentry *clk_debugfs_root;
531 484
532 485
533static void clock_tree_show_one(struct seq_file *s, struct clk *c, int level) 486static void clock_tree_show_one(struct seq_file *s, struct clk *c, int level)
534{ 487{
535 struct clk *child; 488 struct clk *child;
536 struct clk *safe;
537 const char *state = "uninit"; 489 const char *state = "uninit";
538 char div[8] = {0}; 490 char div[8] = {0};
539 491
@@ -564,8 +516,12 @@ static void clock_tree_show_one(struct seq_file *s, struct clk *c, int level)
564 c->rate > c->max_rate ? '!' : ' ', 516 c->rate > c->max_rate ? '!' : ' ',
565 !c->set ? '*' : ' ', 517 !c->set ? '*' : ' ',
566 30 - level * 3, c->name, 518 30 - level * 3, c->name,
567 state, c->refcnt, div, c->rate); 519 state, c->refcnt, div, clk_get_rate_all_locked(c));
568 list_for_each_entry_safe(child, safe, &c->children, sibling) { 520
521 list_for_each_entry(child, &clocks, node) {
522 if (child->parent != c)
523 continue;
524
569 clock_tree_show_one(s, child, level + 1); 525 clock_tree_show_one(s, child, level + 1);
570 } 526 }
571} 527}
@@ -573,14 +529,20 @@ static void clock_tree_show_one(struct seq_file *s, struct clk *c, int level)
573static int clock_tree_show(struct seq_file *s, void *data) 529static int clock_tree_show(struct seq_file *s, void *data)
574{ 530{
575 struct clk *c; 531 struct clk *c;
576 unsigned long flags;
577 seq_printf(s, " clock state ref div rate\n"); 532 seq_printf(s, " clock state ref div rate\n");
578 seq_printf(s, "--------------------------------------------------------------\n"); 533 seq_printf(s, "--------------------------------------------------------------\n");
579 spin_lock_irqsave(&clock_lock, flags); 534
535 mutex_lock(&clock_list_lock);
536
537 clk_lock_all();
538
580 list_for_each_entry(c, &clocks, node) 539 list_for_each_entry(c, &clocks, node)
581 if (c->parent == NULL) 540 if (c->parent == NULL)
582 clock_tree_show_one(s, c, 0); 541 clock_tree_show_one(s, c, 0);
583 spin_unlock_irqrestore(&clock_lock, flags); 542
543 clk_unlock_all();
544
545 mutex_unlock(&clock_list_lock);
584 return 0; 546 return 0;
585} 547}
586 548
diff --git a/arch/arm/mach-tegra/clock.h b/arch/arm/mach-tegra/clock.h
index 083a4cfc6cf0..688316abc64e 100644
--- a/arch/arm/mach-tegra/clock.h
+++ b/arch/arm/mach-tegra/clock.h
@@ -20,8 +20,9 @@
20#ifndef __MACH_TEGRA_CLOCK_H 20#ifndef __MACH_TEGRA_CLOCK_H
21#define __MACH_TEGRA_CLOCK_H 21#define __MACH_TEGRA_CLOCK_H
22 22
23#include <linux/list.h>
24#include <linux/clkdev.h> 23#include <linux/clkdev.h>
24#include <linux/list.h>
25#include <linux/spinlock.h>
25 26
26#define DIV_BUS (1 << 0) 27#define DIV_BUS (1 << 0)
27#define DIV_U71 (1 << 1) 28#define DIV_U71 (1 << 1)
@@ -41,36 +42,13 @@
41#define ENABLE_ON_INIT (1 << 28) 42#define ENABLE_ON_INIT (1 << 28)
42 43
43struct clk; 44struct clk;
44struct regulator;
45
46struct dvfs_table {
47 unsigned long rate;
48 int millivolts;
49};
50
51struct dvfs_process_id_table {
52 int process_id;
53 struct dvfs_table *table;
54};
55
56
57struct dvfs {
58 struct regulator *reg;
59 struct dvfs_table *table;
60 int max_millivolts;
61
62 int process_id_table_length;
63 const char *reg_id;
64 bool cpu;
65 struct dvfs_process_id_table process_id_table[];
66};
67 45
68struct clk_mux_sel { 46struct clk_mux_sel {
69 struct clk *input; 47 struct clk *input;
70 u32 value; 48 u32 value;
71}; 49};
72 50
73struct clk_pll_table { 51struct clk_pll_freq_table {
74 unsigned long input_rate; 52 unsigned long input_rate;
75 unsigned long output_rate; 53 unsigned long output_rate;
76 u16 n; 54 u16 n;
@@ -86,6 +64,7 @@ struct clk_ops {
86 int (*set_parent)(struct clk *, struct clk *); 64 int (*set_parent)(struct clk *, struct clk *);
87 int (*set_rate)(struct clk *, unsigned long); 65 int (*set_rate)(struct clk *, unsigned long);
88 long (*round_rate)(struct clk *, unsigned long); 66 long (*round_rate)(struct clk *, unsigned long);
67 void (*reset)(struct clk *, bool);
89}; 68};
90 69
91enum clk_state { 70enum clk_state {
@@ -96,55 +75,64 @@ enum clk_state {
96 75
97struct clk { 76struct clk {
98 /* node for master clocks list */ 77 /* node for master clocks list */
99 struct list_head node; 78 struct list_head node; /* node for list of all clocks */
100 struct list_head children; /* list of children */ 79 struct clk_lookup lookup;
101 struct list_head sibling; /* node for children */ 80
102#ifdef CONFIG_DEBUG_FS
103 struct dentry *dent;
104 struct dentry *parent_dent;
105#endif
106 struct clk_ops *ops;
107 struct clk *parent;
108 struct clk_lookup lookup;
109 unsigned long rate;
110 unsigned long max_rate;
111 u32 flags;
112 u32 refcnt;
113 const char *name;
114 u32 reg;
115 u32 reg_shift;
116 unsigned int clk_num;
117 enum clk_state state;
118#ifdef CONFIG_DEBUG_FS 81#ifdef CONFIG_DEBUG_FS
119 bool set; 82 struct dentry *dent;
120#endif 83#endif
84 bool set;
85 struct clk_ops *ops;
86 unsigned long rate;
87 unsigned long max_rate;
88 unsigned long min_rate;
89 u32 flags;
90 const char *name;
91
92 u32 refcnt;
93 enum clk_state state;
94 struct clk *parent;
95 u32 div;
96 u32 mul;
121 97
122 /* PLL */
123 unsigned long input_min;
124 unsigned long input_max;
125 unsigned long cf_min;
126 unsigned long cf_max;
127 unsigned long vco_min;
128 unsigned long vco_max;
129 const struct clk_pll_table *pll_table;
130
131 /* DIV */
132 u32 div;
133 u32 mul;
134
135 /* MUX */
136 const struct clk_mux_sel *inputs; 98 const struct clk_mux_sel *inputs;
137 u32 sel; 99 u32 reg;
138 u32 reg_mask; 100 u32 reg_shift;
139
140 /* Virtual cpu clock */
141 struct clk *main;
142 struct clk *backup;
143 101
144 struct dvfs *dvfs; 102 struct list_head shared_bus_list;
103
104 union {
105 struct {
106 unsigned int clk_num;
107 } periph;
108 struct {
109 unsigned long input_min;
110 unsigned long input_max;
111 unsigned long cf_min;
112 unsigned long cf_max;
113 unsigned long vco_min;
114 unsigned long vco_max;
115 const struct clk_pll_freq_table *freq_table;
116 int lock_delay;
117 } pll;
118 struct {
119 u32 sel;
120 u32 reg_mask;
121 } mux;
122 struct {
123 struct clk *main;
124 struct clk *backup;
125 } cpu;
126 struct {
127 struct list_head node;
128 bool enabled;
129 unsigned long rate;
130 } shared_bus_user;
131 } u;
132
133 spinlock_t spinlock;
145}; 134};
146 135
147
148struct clk_duplicate { 136struct clk_duplicate {
149 const char *name; 137 const char *name;
150 struct clk_lookup lookup; 138 struct clk_lookup lookup;
@@ -163,11 +151,10 @@ void tegra2_periph_reset_assert(struct clk *c);
163void clk_init(struct clk *clk); 151void clk_init(struct clk *clk);
164struct clk *tegra_get_clock_by_name(const char *name); 152struct clk *tegra_get_clock_by_name(const char *name);
165unsigned long clk_measure_input_freq(void); 153unsigned long clk_measure_input_freq(void);
166void clk_disable_locked(struct clk *c);
167int clk_enable_locked(struct clk *c);
168int clk_set_parent_locked(struct clk *c, struct clk *parent);
169int clk_set_rate_locked(struct clk *c, unsigned long rate);
170int clk_reparent(struct clk *c, struct clk *parent); 154int clk_reparent(struct clk *c, struct clk *parent);
171void tegra_clk_init_from_table(struct tegra_clk_init_table *table); 155void tegra_clk_init_from_table(struct tegra_clk_init_table *table);
156unsigned long clk_get_rate_locked(struct clk *c);
157int clk_set_rate_locked(struct clk *c, unsigned long rate);
158void tegra2_sdmmc_tap_delay(struct clk *c, int delay);
172 159
173#endif 160#endif
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 7c91e2b9d643..d5e3f89b05af 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -25,12 +25,25 @@
25#include <asm/hardware/cache-l2x0.h> 25#include <asm/hardware/cache-l2x0.h>
26 26
27#include <mach/iomap.h> 27#include <mach/iomap.h>
28#include <mach/dma.h> 28#include <mach/system.h>
29 29
30#include "board.h" 30#include "board.h"
31#include "clock.h" 31#include "clock.h"
32#include "fuse.h" 32#include "fuse.h"
33 33
34void (*arch_reset)(char mode, const char *cmd) = tegra_assert_system_reset;
35
36void tegra_assert_system_reset(char mode, const char *cmd)
37{
38 void __iomem *reset = IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x04);
39 u32 reg;
40
41 /* use *_related to avoid spinlock since caches are off */
42 reg = readl_relaxed(reset);
43 reg |= 0x04;
44 writel_relaxed(reg, reset);
45}
46
34static __initdata struct tegra_clk_init_table common_clk_init_table[] = { 47static __initdata struct tegra_clk_init_table common_clk_init_table[] = {
35 /* name parent rate enabled */ 48 /* name parent rate enabled */
36 { "clk_m", NULL, 0, true }, 49 { "clk_m", NULL, 0, true },
@@ -42,6 +55,9 @@ static __initdata struct tegra_clk_init_table common_clk_init_table[] = {
42 { "sclk", "pll_p_out4", 108000000, true }, 55 { "sclk", "pll_p_out4", 108000000, true },
43 { "hclk", "sclk", 108000000, true }, 56 { "hclk", "sclk", 108000000, true },
44 { "pclk", "hclk", 54000000, true }, 57 { "pclk", "hclk", 54000000, true },
58 { "csite", NULL, 0, true },
59 { "emc", NULL, 0, true },
60 { "cpu", NULL, 0, true },
45 { NULL, NULL, 0, 0}, 61 { NULL, NULL, 0, 0},
46}; 62};
47 63
@@ -50,21 +66,18 @@ void __init tegra_init_cache(void)
50#ifdef CONFIG_CACHE_L2X0 66#ifdef CONFIG_CACHE_L2X0
51 void __iomem *p = IO_ADDRESS(TEGRA_ARM_PERIF_BASE) + 0x3000; 67 void __iomem *p = IO_ADDRESS(TEGRA_ARM_PERIF_BASE) + 0x3000;
52 68
53 writel(0x331, p + L2X0_TAG_LATENCY_CTRL); 69 writel_relaxed(0x331, p + L2X0_TAG_LATENCY_CTRL);
54 writel(0x441, p + L2X0_DATA_LATENCY_CTRL); 70 writel_relaxed(0x441, p + L2X0_DATA_LATENCY_CTRL);
55 71
56 l2x0_init(p, 0x6C080001, 0x8200c3fe); 72 l2x0_init(p, 0x6C080001, 0x8200c3fe);
57#endif 73#endif
58 74
59} 75}
60 76
61void __init tegra_common_init(void) 77void __init tegra_init_early(void)
62{ 78{
63 tegra_init_fuse(); 79 tegra_init_fuse();
64 tegra_init_clock(); 80 tegra_init_clock();
65 tegra_clk_init_from_table(common_clk_init_table); 81 tegra_clk_init_from_table(common_clk_init_table);
66 tegra_init_cache(); 82 tegra_init_cache();
67#ifdef CONFIG_TEGRA_SYSTEM_DMA
68 tegra_dma_init();
69#endif
70} 83}
diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c
index fea5719c7072..0e1016a827ac 100644
--- a/arch/arm/mach-tegra/cpu-tegra.c
+++ b/arch/arm/mach-tegra/cpu-tegra.c
@@ -28,6 +28,7 @@
28#include <linux/err.h> 28#include <linux/err.h>
29#include <linux/clk.h> 29#include <linux/clk.h>
30#include <linux/io.h> 30#include <linux/io.h>
31#include <linux/suspend.h>
31 32
32#include <asm/system.h> 33#include <asm/system.h>
33 34
@@ -36,21 +37,25 @@
36 37
37/* Frequency table index must be sequential starting at 0 */ 38/* Frequency table index must be sequential starting at 0 */
38static struct cpufreq_frequency_table freq_table[] = { 39static struct cpufreq_frequency_table freq_table[] = {
39 { 0, 312000 }, 40 { 0, 216000 },
40 { 1, 456000 }, 41 { 1, 312000 },
41 { 2, 608000 }, 42 { 2, 456000 },
42 { 3, 760000 }, 43 { 3, 608000 },
43 { 4, 816000 }, 44 { 4, 760000 },
44 { 5, 912000 }, 45 { 5, 816000 },
45 { 6, 1000000 }, 46 { 6, 912000 },
46 { 7, CPUFREQ_TABLE_END }, 47 { 7, 1000000 },
48 { 8, CPUFREQ_TABLE_END },
47}; 49};
48 50
49#define NUM_CPUS 2 51#define NUM_CPUS 2
50 52
51static struct clk *cpu_clk; 53static struct clk *cpu_clk;
54static struct clk *emc_clk;
52 55
53static unsigned long target_cpu_speed[NUM_CPUS]; 56static unsigned long target_cpu_speed[NUM_CPUS];
57static DEFINE_MUTEX(tegra_cpu_lock);
58static bool is_suspended;
54 59
55int tegra_verify_speed(struct cpufreq_policy *policy) 60int tegra_verify_speed(struct cpufreq_policy *policy)
56{ 61{
@@ -68,22 +73,28 @@ unsigned int tegra_getspeed(unsigned int cpu)
68 return rate; 73 return rate;
69} 74}
70 75
71static int tegra_update_cpu_speed(void) 76static int tegra_update_cpu_speed(unsigned long rate)
72{ 77{
73 int i;
74 unsigned long rate = 0;
75 int ret = 0; 78 int ret = 0;
76 struct cpufreq_freqs freqs; 79 struct cpufreq_freqs freqs;
77 80
78 for_each_online_cpu(i)
79 rate = max(rate, target_cpu_speed[i]);
80
81 freqs.old = tegra_getspeed(0); 81 freqs.old = tegra_getspeed(0);
82 freqs.new = rate; 82 freqs.new = rate;
83 83
84 if (freqs.old == freqs.new) 84 if (freqs.old == freqs.new)
85 return ret; 85 return ret;
86 86
87 /*
88 * Vote on memory bus frequency based on cpu frequency
89 * This sets the minimum frequency, display or avp may request higher
90 */
91 if (rate >= 816000)
92 clk_set_rate(emc_clk, 600000000); /* cpu 816 MHz, emc max */
93 else if (rate >= 456000)
94 clk_set_rate(emc_clk, 300000000); /* cpu 456 MHz, emc 150Mhz */
95 else
96 clk_set_rate(emc_clk, 100000000); /* emc 50Mhz */
97
87 for_each_online_cpu(freqs.cpu) 98 for_each_online_cpu(freqs.cpu)
88 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 99 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
89 100
@@ -92,7 +103,7 @@ static int tegra_update_cpu_speed(void)
92 freqs.old, freqs.new); 103 freqs.old, freqs.new);
93#endif 104#endif
94 105
95 ret = clk_set_rate_cansleep(cpu_clk, freqs.new * 1000); 106 ret = clk_set_rate(cpu_clk, freqs.new * 1000);
96 if (ret) { 107 if (ret) {
97 pr_err("cpu-tegra: Failed to set cpu frequency to %d kHz\n", 108 pr_err("cpu-tegra: Failed to set cpu frequency to %d kHz\n",
98 freqs.new); 109 freqs.new);
@@ -105,12 +116,30 @@ static int tegra_update_cpu_speed(void)
105 return 0; 116 return 0;
106} 117}
107 118
119static unsigned long tegra_cpu_highest_speed(void)
120{
121 unsigned long rate = 0;
122 int i;
123
124 for_each_online_cpu(i)
125 rate = max(rate, target_cpu_speed[i]);
126 return rate;
127}
128
108static int tegra_target(struct cpufreq_policy *policy, 129static int tegra_target(struct cpufreq_policy *policy,
109 unsigned int target_freq, 130 unsigned int target_freq,
110 unsigned int relation) 131 unsigned int relation)
111{ 132{
112 int idx; 133 int idx;
113 unsigned int freq; 134 unsigned int freq;
135 int ret = 0;
136
137 mutex_lock(&tegra_cpu_lock);
138
139 if (is_suspended) {
140 ret = -EBUSY;
141 goto out;
142 }
114 143
115 cpufreq_frequency_table_target(policy, freq_table, target_freq, 144 cpufreq_frequency_table_target(policy, freq_table, target_freq,
116 relation, &idx); 145 relation, &idx);
@@ -119,9 +148,34 @@ static int tegra_target(struct cpufreq_policy *policy,
119 148
120 target_cpu_speed[policy->cpu] = freq; 149 target_cpu_speed[policy->cpu] = freq;
121 150
122 return tegra_update_cpu_speed(); 151 ret = tegra_update_cpu_speed(tegra_cpu_highest_speed());
152
153out:
154 mutex_unlock(&tegra_cpu_lock);
155 return ret;
123} 156}
124 157
158static int tegra_pm_notify(struct notifier_block *nb, unsigned long event,
159 void *dummy)
160{
161 mutex_lock(&tegra_cpu_lock);
162 if (event == PM_SUSPEND_PREPARE) {
163 is_suspended = true;
164 pr_info("Tegra cpufreq suspend: setting frequency to %d kHz\n",
165 freq_table[0].frequency);
166 tegra_update_cpu_speed(freq_table[0].frequency);
167 } else if (event == PM_POST_SUSPEND) {
168 is_suspended = false;
169 }
170 mutex_unlock(&tegra_cpu_lock);
171
172 return NOTIFY_OK;
173}
174
175static struct notifier_block tegra_cpu_pm_notifier = {
176 .notifier_call = tegra_pm_notify,
177};
178
125static int tegra_cpu_init(struct cpufreq_policy *policy) 179static int tegra_cpu_init(struct cpufreq_policy *policy)
126{ 180{
127 if (policy->cpu >= NUM_CPUS) 181 if (policy->cpu >= NUM_CPUS)
@@ -131,6 +185,15 @@ static int tegra_cpu_init(struct cpufreq_policy *policy)
131 if (IS_ERR(cpu_clk)) 185 if (IS_ERR(cpu_clk))
132 return PTR_ERR(cpu_clk); 186 return PTR_ERR(cpu_clk);
133 187
188 emc_clk = clk_get_sys("cpu", "emc");
189 if (IS_ERR(emc_clk)) {
190 clk_put(cpu_clk);
191 return PTR_ERR(emc_clk);
192 }
193
194 clk_enable(emc_clk);
195 clk_enable(cpu_clk);
196
134 cpufreq_frequency_table_cpuinfo(policy, freq_table); 197 cpufreq_frequency_table_cpuinfo(policy, freq_table);
135 cpufreq_frequency_table_get_attr(freq_table, policy->cpu); 198 cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
136 policy->cur = tegra_getspeed(policy->cpu); 199 policy->cur = tegra_getspeed(policy->cpu);
@@ -142,12 +205,17 @@ static int tegra_cpu_init(struct cpufreq_policy *policy)
142 policy->shared_type = CPUFREQ_SHARED_TYPE_ALL; 205 policy->shared_type = CPUFREQ_SHARED_TYPE_ALL;
143 cpumask_copy(policy->related_cpus, cpu_possible_mask); 206 cpumask_copy(policy->related_cpus, cpu_possible_mask);
144 207
208 if (policy->cpu == 0)
209 register_pm_notifier(&tegra_cpu_pm_notifier);
210
145 return 0; 211 return 0;
146} 212}
147 213
148static int tegra_cpu_exit(struct cpufreq_policy *policy) 214static int tegra_cpu_exit(struct cpufreq_policy *policy)
149{ 215{
150 cpufreq_frequency_table_cpuinfo(policy, freq_table); 216 cpufreq_frequency_table_cpuinfo(policy, freq_table);
217 clk_disable(emc_clk);
218 clk_put(emc_clk);
151 clk_put(cpu_clk); 219 clk_put(cpu_clk);
152 return 0; 220 return 0;
153} 221}
diff --git a/arch/arm/mach-tegra/devices.c b/arch/arm/mach-tegra/devices.c
new file mode 100644
index 000000000000..1528f9daef1f
--- /dev/null
+++ b/arch/arm/mach-tegra/devices.c
@@ -0,0 +1,575 @@
1/*
2 * Copyright (C) 2010,2011 Google, Inc.
3 *
4 * Author:
5 * Colin Cross <ccross@android.com>
6 * Erik Gilling <ccross@android.com>
7 *
8 * This software is licensed under the terms of the GNU General Public
9 * License version 2, as published by the Free Software Foundation, and
10 * may be copied, distributed, and modified under those terms.
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 */
18
19
20#include <linux/resource.h>
21#include <linux/platform_device.h>
22#include <linux/dma-mapping.h>
23#include <linux/fsl_devices.h>
24#include <linux/serial_8250.h>
25#include <asm/pmu.h>
26#include <mach/irqs.h>
27#include <mach/iomap.h>
28#include <mach/dma.h>
29
30static struct resource i2c_resource1[] = {
31 [0] = {
32 .start = INT_I2C,
33 .end = INT_I2C,
34 .flags = IORESOURCE_IRQ,
35 },
36 [1] = {
37 .start = TEGRA_I2C_BASE,
38 .end = TEGRA_I2C_BASE + TEGRA_I2C_SIZE-1,
39 .flags = IORESOURCE_MEM,
40 },
41};
42
43static struct resource i2c_resource2[] = {
44 [0] = {
45 .start = INT_I2C2,
46 .end = INT_I2C2,
47 .flags = IORESOURCE_IRQ,
48 },
49 [1] = {
50 .start = TEGRA_I2C2_BASE,
51 .end = TEGRA_I2C2_BASE + TEGRA_I2C2_SIZE-1,
52 .flags = IORESOURCE_MEM,
53 },
54};
55
56static struct resource i2c_resource3[] = {
57 [0] = {
58 .start = INT_I2C3,
59 .end = INT_I2C3,
60 .flags = IORESOURCE_IRQ,
61 },
62 [1] = {
63 .start = TEGRA_I2C3_BASE,
64 .end = TEGRA_I2C3_BASE + TEGRA_I2C3_SIZE-1,
65 .flags = IORESOURCE_MEM,
66 },
67};
68
69static struct resource i2c_resource4[] = {
70 [0] = {
71 .start = INT_DVC,
72 .end = INT_DVC,
73 .flags = IORESOURCE_IRQ,
74 },
75 [1] = {
76 .start = TEGRA_DVC_BASE,
77 .end = TEGRA_DVC_BASE + TEGRA_DVC_SIZE-1,
78 .flags = IORESOURCE_MEM,
79 },
80};
81
82struct platform_device tegra_i2c_device1 = {
83 .name = "tegra-i2c",
84 .id = 0,
85 .resource = i2c_resource1,
86 .num_resources = ARRAY_SIZE(i2c_resource1),
87 .dev = {
88 .platform_data = 0,
89 },
90};
91
92struct platform_device tegra_i2c_device2 = {
93 .name = "tegra-i2c",
94 .id = 1,
95 .resource = i2c_resource2,
96 .num_resources = ARRAY_SIZE(i2c_resource2),
97 .dev = {
98 .platform_data = 0,
99 },
100};
101
102struct platform_device tegra_i2c_device3 = {
103 .name = "tegra-i2c",
104 .id = 2,
105 .resource = i2c_resource3,
106 .num_resources = ARRAY_SIZE(i2c_resource3),
107 .dev = {
108 .platform_data = 0,
109 },
110};
111
112struct platform_device tegra_i2c_device4 = {
113 .name = "tegra-i2c",
114 .id = 3,
115 .resource = i2c_resource4,
116 .num_resources = ARRAY_SIZE(i2c_resource4),
117 .dev = {
118 .platform_data = 0,
119 },
120};
121
122static struct resource spi_resource1[] = {
123 [0] = {
124 .start = INT_S_LINK1,
125 .end = INT_S_LINK1,
126 .flags = IORESOURCE_IRQ,
127 },
128 [1] = {
129 .start = TEGRA_SPI1_BASE,
130 .end = TEGRA_SPI1_BASE + TEGRA_SPI1_SIZE-1,
131 .flags = IORESOURCE_MEM,
132 },
133};
134
135static struct resource spi_resource2[] = {
136 [0] = {
137 .start = INT_SPI_2,
138 .end = INT_SPI_2,
139 .flags = IORESOURCE_IRQ,
140 },
141 [1] = {
142 .start = TEGRA_SPI2_BASE,
143 .end = TEGRA_SPI2_BASE + TEGRA_SPI2_SIZE-1,
144 .flags = IORESOURCE_MEM,
145 },
146};
147
148static struct resource spi_resource3[] = {
149 [0] = {
150 .start = INT_SPI_3,
151 .end = INT_SPI_3,
152 .flags = IORESOURCE_IRQ,
153 },
154 [1] = {
155 .start = TEGRA_SPI3_BASE,
156 .end = TEGRA_SPI3_BASE + TEGRA_SPI3_SIZE-1,
157 .flags = IORESOURCE_MEM,
158 },
159};
160
161static struct resource spi_resource4[] = {
162 [0] = {
163 .start = INT_SPI_4,
164 .end = INT_SPI_4,
165 .flags = IORESOURCE_IRQ,
166 },
167 [1] = {
168 .start = TEGRA_SPI4_BASE,
169 .end = TEGRA_SPI4_BASE + TEGRA_SPI4_SIZE-1,
170 .flags = IORESOURCE_MEM,
171 },
172};
173
174struct platform_device tegra_spi_device1 = {
175 .name = "spi_tegra",
176 .id = 0,
177 .resource = spi_resource1,
178 .num_resources = ARRAY_SIZE(spi_resource1),
179 .dev = {
180 .coherent_dma_mask = 0xffffffff,
181 },
182};
183
184struct platform_device tegra_spi_device2 = {
185 .name = "spi_tegra",
186 .id = 1,
187 .resource = spi_resource2,
188 .num_resources = ARRAY_SIZE(spi_resource2),
189 .dev = {
190 .coherent_dma_mask = 0xffffffff,
191 },
192};
193
194struct platform_device tegra_spi_device3 = {
195 .name = "spi_tegra",
196 .id = 2,
197 .resource = spi_resource3,
198 .num_resources = ARRAY_SIZE(spi_resource3),
199 .dev = {
200 .coherent_dma_mask = 0xffffffff,
201 },
202};
203
204struct platform_device tegra_spi_device4 = {
205 .name = "spi_tegra",
206 .id = 3,
207 .resource = spi_resource4,
208 .num_resources = ARRAY_SIZE(spi_resource4),
209 .dev = {
210 .coherent_dma_mask = 0xffffffff,
211 },
212};
213
214
215static struct resource sdhci_resource1[] = {
216 [0] = {
217 .start = INT_SDMMC1,
218 .end = INT_SDMMC1,
219 .flags = IORESOURCE_IRQ,
220 },
221 [1] = {
222 .start = TEGRA_SDMMC1_BASE,
223 .end = TEGRA_SDMMC1_BASE + TEGRA_SDMMC1_SIZE-1,
224 .flags = IORESOURCE_MEM,
225 },
226};
227
228static struct resource sdhci_resource2[] = {
229 [0] = {
230 .start = INT_SDMMC2,
231 .end = INT_SDMMC2,
232 .flags = IORESOURCE_IRQ,
233 },
234 [1] = {
235 .start = TEGRA_SDMMC2_BASE,
236 .end = TEGRA_SDMMC2_BASE + TEGRA_SDMMC2_SIZE-1,
237 .flags = IORESOURCE_MEM,
238 },
239};
240
241static struct resource sdhci_resource3[] = {
242 [0] = {
243 .start = INT_SDMMC3,
244 .end = INT_SDMMC3,
245 .flags = IORESOURCE_IRQ,
246 },
247 [1] = {
248 .start = TEGRA_SDMMC3_BASE,
249 .end = TEGRA_SDMMC3_BASE + TEGRA_SDMMC3_SIZE-1,
250 .flags = IORESOURCE_MEM,
251 },
252};
253
254static struct resource sdhci_resource4[] = {
255 [0] = {
256 .start = INT_SDMMC4,
257 .end = INT_SDMMC4,
258 .flags = IORESOURCE_IRQ,
259 },
260 [1] = {
261 .start = TEGRA_SDMMC4_BASE,
262 .end = TEGRA_SDMMC4_BASE + TEGRA_SDMMC4_SIZE-1,
263 .flags = IORESOURCE_MEM,
264 },
265};
266
267/* board files should fill in platform_data register the devices themselvs.
268 * See board-harmony.c for an example
269 */
270struct platform_device tegra_sdhci_device1 = {
271 .name = "sdhci-tegra",
272 .id = 0,
273 .resource = sdhci_resource1,
274 .num_resources = ARRAY_SIZE(sdhci_resource1),
275};
276
277struct platform_device tegra_sdhci_device2 = {
278 .name = "sdhci-tegra",
279 .id = 1,
280 .resource = sdhci_resource2,
281 .num_resources = ARRAY_SIZE(sdhci_resource2),
282};
283
284struct platform_device tegra_sdhci_device3 = {
285 .name = "sdhci-tegra",
286 .id = 2,
287 .resource = sdhci_resource3,
288 .num_resources = ARRAY_SIZE(sdhci_resource3),
289};
290
291struct platform_device tegra_sdhci_device4 = {
292 .name = "sdhci-tegra",
293 .id = 3,
294 .resource = sdhci_resource4,
295 .num_resources = ARRAY_SIZE(sdhci_resource4),
296};
297
298static struct resource tegra_usb1_resources[] = {
299 [0] = {
300 .start = TEGRA_USB_BASE,
301 .end = TEGRA_USB_BASE + TEGRA_USB_SIZE - 1,
302 .flags = IORESOURCE_MEM,
303 },
304 [1] = {
305 .start = INT_USB,
306 .end = INT_USB,
307 .flags = IORESOURCE_IRQ,
308 },
309};
310
311static struct resource tegra_usb2_resources[] = {
312 [0] = {
313 .start = TEGRA_USB2_BASE,
314 .end = TEGRA_USB2_BASE + TEGRA_USB2_SIZE - 1,
315 .flags = IORESOURCE_MEM,
316 },
317 [1] = {
318 .start = INT_USB2,
319 .end = INT_USB2,
320 .flags = IORESOURCE_IRQ,
321 },
322};
323
324static struct resource tegra_usb3_resources[] = {
325 [0] = {
326 .start = TEGRA_USB3_BASE,
327 .end = TEGRA_USB3_BASE + TEGRA_USB3_SIZE - 1,
328 .flags = IORESOURCE_MEM,
329 },
330 [1] = {
331 .start = INT_USB3,
332 .end = INT_USB3,
333 .flags = IORESOURCE_IRQ,
334 },
335};
336
337static u64 tegra_ehci_dmamask = DMA_BIT_MASK(32);
338
339struct platform_device tegra_ehci1_device = {
340 .name = "tegra-ehci",
341 .id = 0,
342 .dev = {
343 .dma_mask = &tegra_ehci_dmamask,
344 .coherent_dma_mask = DMA_BIT_MASK(32),
345 },
346 .resource = tegra_usb1_resources,
347 .num_resources = ARRAY_SIZE(tegra_usb1_resources),
348};
349
350struct platform_device tegra_ehci2_device = {
351 .name = "tegra-ehci",
352 .id = 1,
353 .dev = {
354 .dma_mask = &tegra_ehci_dmamask,
355 .coherent_dma_mask = DMA_BIT_MASK(32),
356 },
357 .resource = tegra_usb2_resources,
358 .num_resources = ARRAY_SIZE(tegra_usb2_resources),
359};
360
361struct platform_device tegra_ehci3_device = {
362 .name = "tegra-ehci",
363 .id = 2,
364 .dev = {
365 .dma_mask = &tegra_ehci_dmamask,
366 .coherent_dma_mask = DMA_BIT_MASK(32),
367 },
368 .resource = tegra_usb3_resources,
369 .num_resources = ARRAY_SIZE(tegra_usb3_resources),
370};
371
372static struct resource tegra_pmu_resources[] = {
373 [0] = {
374 .start = INT_CPU0_PMU_INTR,
375 .end = INT_CPU0_PMU_INTR,
376 .flags = IORESOURCE_IRQ,
377 },
378 [1] = {
379 .start = INT_CPU1_PMU_INTR,
380 .end = INT_CPU1_PMU_INTR,
381 .flags = IORESOURCE_IRQ,
382 },
383};
384
385struct platform_device tegra_pmu_device = {
386 .name = "arm-pmu",
387 .id = ARM_PMU_DEVICE_CPU,
388 .num_resources = ARRAY_SIZE(tegra_pmu_resources),
389 .resource = tegra_pmu_resources,
390};
391
392static struct resource tegra_uarta_resources[] = {
393 [0] = {
394 .start = TEGRA_UARTA_BASE,
395 .end = TEGRA_UARTA_BASE + TEGRA_UARTA_SIZE - 1,
396 .flags = IORESOURCE_MEM,
397 },
398 [1] = {
399 .start = INT_UARTA,
400 .end = INT_UARTA,
401 .flags = IORESOURCE_IRQ,
402 },
403};
404
405static struct resource tegra_uartb_resources[] = {
406 [0] = {
407 .start = TEGRA_UARTB_BASE,
408 .end = TEGRA_UARTB_BASE + TEGRA_UARTB_SIZE - 1,
409 .flags = IORESOURCE_MEM,
410 },
411 [1] = {
412 .start = INT_UARTB,
413 .end = INT_UARTB,
414 .flags = IORESOURCE_IRQ,
415 },
416};
417
418static struct resource tegra_uartc_resources[] = {
419 [0] = {
420 .start = TEGRA_UARTC_BASE,
421 .end = TEGRA_UARTC_BASE + TEGRA_UARTC_SIZE - 1,
422 .flags = IORESOURCE_MEM,
423 },
424 [1] = {
425 .start = INT_UARTC,
426 .end = INT_UARTC,
427 .flags = IORESOURCE_IRQ,
428 },
429};
430
431static struct resource tegra_uartd_resources[] = {
432 [0] = {
433 .start = TEGRA_UARTD_BASE,
434 .end = TEGRA_UARTD_BASE + TEGRA_UARTD_SIZE - 1,
435 .flags = IORESOURCE_MEM,
436 },
437 [1] = {
438 .start = INT_UARTD,
439 .end = INT_UARTD,
440 .flags = IORESOURCE_IRQ,
441 },
442};
443
444static struct resource tegra_uarte_resources[] = {
445 [0] = {
446 .start = TEGRA_UARTE_BASE,
447 .end = TEGRA_UARTE_BASE + TEGRA_UARTE_SIZE - 1,
448 .flags = IORESOURCE_MEM,
449 },
450 [1] = {
451 .start = INT_UARTE,
452 .end = INT_UARTE,
453 .flags = IORESOURCE_IRQ,
454 },
455};
456
457struct platform_device tegra_uarta_device = {
458 .name = "tegra_uart",
459 .id = 0,
460 .num_resources = ARRAY_SIZE(tegra_uarta_resources),
461 .resource = tegra_uarta_resources,
462 .dev = {
463 .coherent_dma_mask = DMA_BIT_MASK(32),
464 },
465};
466
467struct platform_device tegra_uartb_device = {
468 .name = "tegra_uart",
469 .id = 1,
470 .num_resources = ARRAY_SIZE(tegra_uartb_resources),
471 .resource = tegra_uartb_resources,
472 .dev = {
473 .coherent_dma_mask = DMA_BIT_MASK(32),
474 },
475};
476
477struct platform_device tegra_uartc_device = {
478 .name = "tegra_uart",
479 .id = 2,
480 .num_resources = ARRAY_SIZE(tegra_uartc_resources),
481 .resource = tegra_uartc_resources,
482 .dev = {
483 .coherent_dma_mask = DMA_BIT_MASK(32),
484 },
485};
486
487struct platform_device tegra_uartd_device = {
488 .name = "tegra_uart",
489 .id = 3,
490 .num_resources = ARRAY_SIZE(tegra_uartd_resources),
491 .resource = tegra_uartd_resources,
492 .dev = {
493 .coherent_dma_mask = DMA_BIT_MASK(32),
494 },
495};
496
497struct platform_device tegra_uarte_device = {
498 .name = "tegra_uart",
499 .id = 4,
500 .num_resources = ARRAY_SIZE(tegra_uarte_resources),
501 .resource = tegra_uarte_resources,
502 .dev = {
503 .coherent_dma_mask = DMA_BIT_MASK(32),
504 },
505};
506
507static struct resource i2s_resource1[] = {
508 [0] = {
509 .start = INT_I2S1,
510 .end = INT_I2S1,
511 .flags = IORESOURCE_IRQ
512 },
513 [1] = {
514 .start = TEGRA_DMA_REQ_SEL_I2S_1,
515 .end = TEGRA_DMA_REQ_SEL_I2S_1,
516 .flags = IORESOURCE_DMA
517 },
518 [2] = {
519 .start = TEGRA_I2S1_BASE,
520 .end = TEGRA_I2S1_BASE + TEGRA_I2S1_SIZE - 1,
521 .flags = IORESOURCE_MEM
522 }
523};
524
525static struct resource i2s_resource2[] = {
526 [0] = {
527 .start = INT_I2S2,
528 .end = INT_I2S2,
529 .flags = IORESOURCE_IRQ
530 },
531 [1] = {
532 .start = TEGRA_DMA_REQ_SEL_I2S2_1,
533 .end = TEGRA_DMA_REQ_SEL_I2S2_1,
534 .flags = IORESOURCE_DMA
535 },
536 [2] = {
537 .start = TEGRA_I2S2_BASE,
538 .end = TEGRA_I2S2_BASE + TEGRA_I2S2_SIZE - 1,
539 .flags = IORESOURCE_MEM
540 }
541};
542
543struct platform_device tegra_i2s_device1 = {
544 .name = "tegra-i2s",
545 .id = 0,
546 .resource = i2s_resource1,
547 .num_resources = ARRAY_SIZE(i2s_resource1),
548};
549
550struct platform_device tegra_i2s_device2 = {
551 .name = "tegra-i2s",
552 .id = 1,
553 .resource = i2s_resource2,
554 .num_resources = ARRAY_SIZE(i2s_resource2),
555};
556
557static struct resource tegra_das_resources[] = {
558 [0] = {
559 .start = TEGRA_APB_MISC_DAS_BASE,
560 .end = TEGRA_APB_MISC_DAS_BASE + TEGRA_APB_MISC_DAS_SIZE - 1,
561 .flags = IORESOURCE_MEM,
562 },
563};
564
565struct platform_device tegra_das_device = {
566 .name = "tegra-das",
567 .id = -1,
568 .num_resources = ARRAY_SIZE(tegra_das_resources),
569 .resource = tegra_das_resources,
570};
571
572struct platform_device tegra_pcm_device = {
573 .name = "tegra-pcm-audio",
574 .id = -1,
575};
diff --git a/arch/arm/mach-tegra/devices.h b/arch/arm/mach-tegra/devices.h
new file mode 100644
index 000000000000..4a7dc0a097d6
--- /dev/null
+++ b/arch/arm/mach-tegra/devices.h
@@ -0,0 +1,50 @@
1/*
2 * Copyright (C) 2010,2011 Google, Inc.
3 *
4 * Author:
5 * Colin Cross <ccross@android.com>
6 * Erik Gilling <ccross@android.com>
7 *
8 * This software is licensed under the terms of the GNU General Public
9 * License version 2, as published by the Free Software Foundation, and
10 * may be copied, distributed, and modified under those terms.
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 */
18
19#ifndef __MACH_TEGRA_DEVICES_H
20#define __MACH_TEGRA_DEVICES_H
21
22#include <linux/platform_device.h>
23
24extern struct platform_device tegra_sdhci_device1;
25extern struct platform_device tegra_sdhci_device2;
26extern struct platform_device tegra_sdhci_device3;
27extern struct platform_device tegra_sdhci_device4;
28extern struct platform_device tegra_i2c_device1;
29extern struct platform_device tegra_i2c_device2;
30extern struct platform_device tegra_i2c_device3;
31extern struct platform_device tegra_i2c_device4;
32extern struct platform_device tegra_spi_device1;
33extern struct platform_device tegra_spi_device2;
34extern struct platform_device tegra_spi_device3;
35extern struct platform_device tegra_spi_device4;
36extern struct platform_device tegra_ehci1_device;
37extern struct platform_device tegra_ehci2_device;
38extern struct platform_device tegra_ehci3_device;
39extern struct platform_device tegra_uarta_device;
40extern struct platform_device tegra_uartb_device;
41extern struct platform_device tegra_uartc_device;
42extern struct platform_device tegra_uartd_device;
43extern struct platform_device tegra_uarte_device;
44extern struct platform_device tegra_pmu_device;
45extern struct platform_device tegra_i2s_device1;
46extern struct platform_device tegra_i2s_device2;
47extern struct platform_device tegra_das_device;
48extern struct platform_device tegra_pcm_device;
49
50#endif
diff --git a/arch/arm/mach-tegra/dma.c b/arch/arm/mach-tegra/dma.c
index edda6ec5e925..e945ae28ee77 100644
--- a/arch/arm/mach-tegra/dma.c
+++ b/arch/arm/mach-tegra/dma.c
@@ -27,9 +27,11 @@
27#include <linux/err.h> 27#include <linux/err.h>
28#include <linux/irq.h> 28#include <linux/irq.h>
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/clk.h>
30#include <mach/dma.h> 31#include <mach/dma.h>
31#include <mach/irqs.h> 32#include <mach/irqs.h>
32#include <mach/iomap.h> 33#include <mach/iomap.h>
34#include <mach/suspend.h>
33 35
34#define APB_DMA_GEN 0x000 36#define APB_DMA_GEN 0x000
35#define GEN_ENABLE (1<<31) 37#define GEN_ENABLE (1<<31)
@@ -120,17 +122,14 @@ struct tegra_dma_channel {
120 void __iomem *addr; 122 void __iomem *addr;
121 int mode; 123 int mode;
122 int irq; 124 int irq;
123 125 int req_transfer_count;
124 /* Register shadow */
125 u32 csr;
126 u32 ahb_seq;
127 u32 ahb_ptr;
128 u32 apb_seq;
129 u32 apb_ptr;
130}; 126};
131 127
132#define NV_DMA_MAX_CHANNELS 32 128#define NV_DMA_MAX_CHANNELS 32
133 129
130static bool tegra_dma_initialized;
131static DEFINE_MUTEX(tegra_dma_lock);
132
134static DECLARE_BITMAP(channel_usage, NV_DMA_MAX_CHANNELS); 133static DECLARE_BITMAP(channel_usage, NV_DMA_MAX_CHANNELS);
135static struct tegra_dma_channel dma_channels[NV_DMA_MAX_CHANNELS]; 134static struct tegra_dma_channel dma_channels[NV_DMA_MAX_CHANNELS];
136 135
@@ -138,7 +137,6 @@ static void tegra_dma_update_hw(struct tegra_dma_channel *ch,
138 struct tegra_dma_req *req); 137 struct tegra_dma_req *req);
139static void tegra_dma_update_hw_partial(struct tegra_dma_channel *ch, 138static void tegra_dma_update_hw_partial(struct tegra_dma_channel *ch,
140 struct tegra_dma_req *req); 139 struct tegra_dma_req *req);
141static void tegra_dma_init_hw(struct tegra_dma_channel *ch);
142static void tegra_dma_stop(struct tegra_dma_channel *ch); 140static void tegra_dma_stop(struct tegra_dma_channel *ch);
143 141
144void tegra_dma_flush(struct tegra_dma_channel *ch) 142void tegra_dma_flush(struct tegra_dma_channel *ch)
@@ -150,6 +148,9 @@ void tegra_dma_dequeue(struct tegra_dma_channel *ch)
150{ 148{
151 struct tegra_dma_req *req; 149 struct tegra_dma_req *req;
152 150
151 if (tegra_dma_is_empty(ch))
152 return;
153
153 req = list_entry(ch->list.next, typeof(*req), node); 154 req = list_entry(ch->list.next, typeof(*req), node);
154 155
155 tegra_dma_dequeue_req(ch, req); 156 tegra_dma_dequeue_req(ch, req);
@@ -158,10 +159,10 @@ void tegra_dma_dequeue(struct tegra_dma_channel *ch)
158 159
159void tegra_dma_stop(struct tegra_dma_channel *ch) 160void tegra_dma_stop(struct tegra_dma_channel *ch)
160{ 161{
161 unsigned int csr; 162 u32 csr;
162 unsigned int status; 163 u32 status;
163 164
164 csr = ch->csr; 165 csr = readl(ch->addr + APB_DMA_CHAN_CSR);
165 csr &= ~CSR_IE_EOC; 166 csr &= ~CSR_IE_EOC;
166 writel(csr, ch->addr + APB_DMA_CHAN_CSR); 167 writel(csr, ch->addr + APB_DMA_CHAN_CSR);
167 168
@@ -175,19 +176,16 @@ void tegra_dma_stop(struct tegra_dma_channel *ch)
175 176
176int tegra_dma_cancel(struct tegra_dma_channel *ch) 177int tegra_dma_cancel(struct tegra_dma_channel *ch)
177{ 178{
178 unsigned int csr; 179 u32 csr;
179 unsigned long irq_flags; 180 unsigned long irq_flags;
180 181
181 spin_lock_irqsave(&ch->lock, irq_flags); 182 spin_lock_irqsave(&ch->lock, irq_flags);
182 while (!list_empty(&ch->list)) 183 while (!list_empty(&ch->list))
183 list_del(ch->list.next); 184 list_del(ch->list.next);
184 185
185 csr = ch->csr; 186 csr = readl(ch->addr + APB_DMA_CHAN_CSR);
186 csr &= ~CSR_REQ_SEL_MASK; 187 csr &= ~CSR_REQ_SEL_MASK;
187 csr |= CSR_REQ_SEL_INVALID; 188 csr |= CSR_REQ_SEL_INVALID;
188
189 /* Set the enable as that is not shadowed */
190 csr |= CSR_ENB;
191 writel(csr, ch->addr + APB_DMA_CHAN_CSR); 189 writel(csr, ch->addr + APB_DMA_CHAN_CSR);
192 190
193 tegra_dma_stop(ch); 191 tegra_dma_stop(ch);
@@ -229,18 +227,15 @@ int tegra_dma_dequeue_req(struct tegra_dma_channel *ch,
229 * - Finally stop or program the DMA to the next buffer in the 227 * - Finally stop or program the DMA to the next buffer in the
230 * list. 228 * list.
231 */ 229 */
232 csr = ch->csr; 230 csr = readl(ch->addr + APB_DMA_CHAN_CSR);
233 csr &= ~CSR_REQ_SEL_MASK; 231 csr &= ~CSR_REQ_SEL_MASK;
234 csr |= CSR_REQ_SEL_INVALID; 232 csr |= CSR_REQ_SEL_INVALID;
235
236 /* Set the enable as that is not shadowed */
237 csr |= CSR_ENB;
238 writel(csr, ch->addr + APB_DMA_CHAN_CSR); 233 writel(csr, ch->addr + APB_DMA_CHAN_CSR);
239 234
240 /* Get the transfer count */ 235 /* Get the transfer count */
241 status = readl(ch->addr + APB_DMA_CHAN_STA); 236 status = readl(ch->addr + APB_DMA_CHAN_STA);
242 to_transfer = (status & STA_COUNT_MASK) >> STA_COUNT_SHIFT; 237 to_transfer = (status & STA_COUNT_MASK) >> STA_COUNT_SHIFT;
243 req_transfer_count = (ch->csr & CSR_WCOUNT_MASK) >> CSR_WCOUNT_SHIFT; 238 req_transfer_count = ch->req_transfer_count;
244 req_transfer_count += 1; 239 req_transfer_count += 1;
245 to_transfer += 1; 240 to_transfer += 1;
246 241
@@ -318,6 +313,7 @@ int tegra_dma_enqueue_req(struct tegra_dma_channel *ch,
318 struct tegra_dma_req *req) 313 struct tegra_dma_req *req)
319{ 314{
320 unsigned long irq_flags; 315 unsigned long irq_flags;
316 struct tegra_dma_req *_req;
321 int start_dma = 0; 317 int start_dma = 0;
322 318
323 if (req->size > NV_DMA_MAX_TRASFER_SIZE || 319 if (req->size > NV_DMA_MAX_TRASFER_SIZE ||
@@ -328,6 +324,13 @@ int tegra_dma_enqueue_req(struct tegra_dma_channel *ch,
328 324
329 spin_lock_irqsave(&ch->lock, irq_flags); 325 spin_lock_irqsave(&ch->lock, irq_flags);
330 326
327 list_for_each_entry(_req, &ch->list, node) {
328 if (req == _req) {
329 spin_unlock_irqrestore(&ch->lock, irq_flags);
330 return -EEXIST;
331 }
332 }
333
331 req->bytes_transferred = 0; 334 req->bytes_transferred = 0;
332 req->status = 0; 335 req->status = 0;
333 req->buffer_status = 0; 336 req->buffer_status = 0;
@@ -348,7 +351,12 @@ EXPORT_SYMBOL(tegra_dma_enqueue_req);
348struct tegra_dma_channel *tegra_dma_allocate_channel(int mode) 351struct tegra_dma_channel *tegra_dma_allocate_channel(int mode)
349{ 352{
350 int channel; 353 int channel;
351 struct tegra_dma_channel *ch; 354 struct tegra_dma_channel *ch = NULL;
355
356 if (WARN_ON(!tegra_dma_initialized))
357 return NULL;
358
359 mutex_lock(&tegra_dma_lock);
352 360
353 /* first channel is the shared channel */ 361 /* first channel is the shared channel */
354 if (mode & TEGRA_DMA_SHARED) { 362 if (mode & TEGRA_DMA_SHARED) {
@@ -357,11 +365,14 @@ struct tegra_dma_channel *tegra_dma_allocate_channel(int mode)
357 channel = find_first_zero_bit(channel_usage, 365 channel = find_first_zero_bit(channel_usage,
358 ARRAY_SIZE(dma_channels)); 366 ARRAY_SIZE(dma_channels));
359 if (channel >= ARRAY_SIZE(dma_channels)) 367 if (channel >= ARRAY_SIZE(dma_channels))
360 return NULL; 368 goto out;
361 } 369 }
362 __set_bit(channel, channel_usage); 370 __set_bit(channel, channel_usage);
363 ch = &dma_channels[channel]; 371 ch = &dma_channels[channel];
364 ch->mode = mode; 372 ch->mode = mode;
373
374out:
375 mutex_unlock(&tegra_dma_lock);
365 return ch; 376 return ch;
366} 377}
367EXPORT_SYMBOL(tegra_dma_allocate_channel); 378EXPORT_SYMBOL(tegra_dma_allocate_channel);
@@ -371,22 +382,27 @@ void tegra_dma_free_channel(struct tegra_dma_channel *ch)
371 if (ch->mode & TEGRA_DMA_SHARED) 382 if (ch->mode & TEGRA_DMA_SHARED)
372 return; 383 return;
373 tegra_dma_cancel(ch); 384 tegra_dma_cancel(ch);
385 mutex_lock(&tegra_dma_lock);
374 __clear_bit(ch->id, channel_usage); 386 __clear_bit(ch->id, channel_usage);
387 mutex_unlock(&tegra_dma_lock);
375} 388}
376EXPORT_SYMBOL(tegra_dma_free_channel); 389EXPORT_SYMBOL(tegra_dma_free_channel);
377 390
378static void tegra_dma_update_hw_partial(struct tegra_dma_channel *ch, 391static void tegra_dma_update_hw_partial(struct tegra_dma_channel *ch,
379 struct tegra_dma_req *req) 392 struct tegra_dma_req *req)
380{ 393{
394 u32 apb_ptr;
395 u32 ahb_ptr;
396
381 if (req->to_memory) { 397 if (req->to_memory) {
382 ch->apb_ptr = req->source_addr; 398 apb_ptr = req->source_addr;
383 ch->ahb_ptr = req->dest_addr; 399 ahb_ptr = req->dest_addr;
384 } else { 400 } else {
385 ch->apb_ptr = req->dest_addr; 401 apb_ptr = req->dest_addr;
386 ch->ahb_ptr = req->source_addr; 402 ahb_ptr = req->source_addr;
387 } 403 }
388 writel(ch->apb_ptr, ch->addr + APB_DMA_CHAN_APB_PTR); 404 writel(apb_ptr, ch->addr + APB_DMA_CHAN_APB_PTR);
389 writel(ch->ahb_ptr, ch->addr + APB_DMA_CHAN_AHB_PTR); 405 writel(ahb_ptr, ch->addr + APB_DMA_CHAN_AHB_PTR);
390 406
391 req->status = TEGRA_DMA_REQ_INFLIGHT; 407 req->status = TEGRA_DMA_REQ_INFLIGHT;
392 return; 408 return;
@@ -400,38 +416,39 @@ static void tegra_dma_update_hw(struct tegra_dma_channel *ch,
400 int ahb_bus_width; 416 int ahb_bus_width;
401 int apb_bus_width; 417 int apb_bus_width;
402 int index; 418 int index;
403 unsigned long csr;
404 419
420 u32 ahb_seq;
421 u32 apb_seq;
422 u32 ahb_ptr;
423 u32 apb_ptr;
424 u32 csr;
425
426 csr = CSR_IE_EOC | CSR_FLOW;
427 ahb_seq = AHB_SEQ_INTR_ENB | AHB_SEQ_BURST_1;
428 apb_seq = 0;
405 429
406 ch->csr |= CSR_FLOW; 430 csr |= req->req_sel << CSR_REQ_SEL_SHIFT;
407 ch->csr &= ~CSR_REQ_SEL_MASK;
408 ch->csr |= req->req_sel << CSR_REQ_SEL_SHIFT;
409 ch->ahb_seq &= ~AHB_SEQ_BURST_MASK;
410 ch->ahb_seq |= AHB_SEQ_BURST_1;
411 431
412 /* One shot mode is always single buffered, 432 /* One shot mode is always single buffered,
413 * continuous mode is always double buffered 433 * continuous mode is always double buffered
414 * */ 434 * */
415 if (ch->mode & TEGRA_DMA_MODE_ONESHOT) { 435 if (ch->mode & TEGRA_DMA_MODE_ONESHOT) {
416 ch->csr |= CSR_ONCE; 436 csr |= CSR_ONCE;
417 ch->ahb_seq &= ~AHB_SEQ_DBL_BUF; 437 ch->req_transfer_count = (req->size >> 2) - 1;
418 ch->csr &= ~CSR_WCOUNT_MASK;
419 ch->csr |= ((req->size>>2) - 1) << CSR_WCOUNT_SHIFT;
420 } else { 438 } else {
421 ch->csr &= ~CSR_ONCE; 439 ahb_seq |= AHB_SEQ_DBL_BUF;
422 ch->ahb_seq |= AHB_SEQ_DBL_BUF;
423 440
424 /* In double buffered mode, we set the size to half the 441 /* In double buffered mode, we set the size to half the
425 * requested size and interrupt when half the buffer 442 * requested size and interrupt when half the buffer
426 * is full */ 443 * is full */
427 ch->csr &= ~CSR_WCOUNT_MASK; 444 ch->req_transfer_count = (req->size >> 3) - 1;
428 ch->csr |= ((req->size>>3) - 1) << CSR_WCOUNT_SHIFT;
429 } 445 }
430 446
447 csr |= ch->req_transfer_count << CSR_WCOUNT_SHIFT;
448
431 if (req->to_memory) { 449 if (req->to_memory) {
432 ch->csr &= ~CSR_DIR; 450 apb_ptr = req->source_addr;
433 ch->apb_ptr = req->source_addr; 451 ahb_ptr = req->dest_addr;
434 ch->ahb_ptr = req->dest_addr;
435 452
436 apb_addr_wrap = req->source_wrap; 453 apb_addr_wrap = req->source_wrap;
437 ahb_addr_wrap = req->dest_wrap; 454 ahb_addr_wrap = req->dest_wrap;
@@ -439,9 +456,9 @@ static void tegra_dma_update_hw(struct tegra_dma_channel *ch,
439 ahb_bus_width = req->dest_bus_width; 456 ahb_bus_width = req->dest_bus_width;
440 457
441 } else { 458 } else {
442 ch->csr |= CSR_DIR; 459 csr |= CSR_DIR;
443 ch->apb_ptr = req->dest_addr; 460 apb_ptr = req->dest_addr;
444 ch->ahb_ptr = req->source_addr; 461 ahb_ptr = req->source_addr;
445 462
446 apb_addr_wrap = req->dest_wrap; 463 apb_addr_wrap = req->dest_wrap;
447 ahb_addr_wrap = req->source_wrap; 464 ahb_addr_wrap = req->source_wrap;
@@ -460,8 +477,7 @@ static void tegra_dma_update_hw(struct tegra_dma_channel *ch,
460 index++; 477 index++;
461 } while (index < ARRAY_SIZE(apb_addr_wrap_table)); 478 } while (index < ARRAY_SIZE(apb_addr_wrap_table));
462 BUG_ON(index == ARRAY_SIZE(apb_addr_wrap_table)); 479 BUG_ON(index == ARRAY_SIZE(apb_addr_wrap_table));
463 ch->apb_seq &= ~APB_SEQ_WRAP_MASK; 480 apb_seq |= index << APB_SEQ_WRAP_SHIFT;
464 ch->apb_seq |= index << APB_SEQ_WRAP_SHIFT;
465 481
466 /* set address wrap for AHB size */ 482 /* set address wrap for AHB size */
467 index = 0; 483 index = 0;
@@ -471,55 +487,42 @@ static void tegra_dma_update_hw(struct tegra_dma_channel *ch,
471 index++; 487 index++;
472 } while (index < ARRAY_SIZE(ahb_addr_wrap_table)); 488 } while (index < ARRAY_SIZE(ahb_addr_wrap_table));
473 BUG_ON(index == ARRAY_SIZE(ahb_addr_wrap_table)); 489 BUG_ON(index == ARRAY_SIZE(ahb_addr_wrap_table));
474 ch->ahb_seq &= ~AHB_SEQ_WRAP_MASK; 490 ahb_seq |= index << AHB_SEQ_WRAP_SHIFT;
475 ch->ahb_seq |= index << AHB_SEQ_WRAP_SHIFT;
476 491
477 for (index = 0; index < ARRAY_SIZE(bus_width_table); index++) { 492 for (index = 0; index < ARRAY_SIZE(bus_width_table); index++) {
478 if (bus_width_table[index] == ahb_bus_width) 493 if (bus_width_table[index] == ahb_bus_width)
479 break; 494 break;
480 } 495 }
481 BUG_ON(index == ARRAY_SIZE(bus_width_table)); 496 BUG_ON(index == ARRAY_SIZE(bus_width_table));
482 ch->ahb_seq &= ~AHB_SEQ_BUS_WIDTH_MASK; 497 ahb_seq |= index << AHB_SEQ_BUS_WIDTH_SHIFT;
483 ch->ahb_seq |= index << AHB_SEQ_BUS_WIDTH_SHIFT;
484 498
485 for (index = 0; index < ARRAY_SIZE(bus_width_table); index++) { 499 for (index = 0; index < ARRAY_SIZE(bus_width_table); index++) {
486 if (bus_width_table[index] == apb_bus_width) 500 if (bus_width_table[index] == apb_bus_width)
487 break; 501 break;
488 } 502 }
489 BUG_ON(index == ARRAY_SIZE(bus_width_table)); 503 BUG_ON(index == ARRAY_SIZE(bus_width_table));
490 ch->apb_seq &= ~APB_SEQ_BUS_WIDTH_MASK; 504 apb_seq |= index << APB_SEQ_BUS_WIDTH_SHIFT;
491 ch->apb_seq |= index << APB_SEQ_BUS_WIDTH_SHIFT;
492
493 ch->csr |= CSR_IE_EOC;
494 505
495 /* update hw registers with the shadow */ 506 writel(csr, ch->addr + APB_DMA_CHAN_CSR);
496 writel(ch->csr, ch->addr + APB_DMA_CHAN_CSR); 507 writel(apb_seq, ch->addr + APB_DMA_CHAN_APB_SEQ);
497 writel(ch->apb_seq, ch->addr + APB_DMA_CHAN_APB_SEQ); 508 writel(apb_ptr, ch->addr + APB_DMA_CHAN_APB_PTR);
498 writel(ch->apb_ptr, ch->addr + APB_DMA_CHAN_APB_PTR); 509 writel(ahb_seq, ch->addr + APB_DMA_CHAN_AHB_SEQ);
499 writel(ch->ahb_seq, ch->addr + APB_DMA_CHAN_AHB_SEQ); 510 writel(ahb_ptr, ch->addr + APB_DMA_CHAN_AHB_PTR);
500 writel(ch->ahb_ptr, ch->addr + APB_DMA_CHAN_AHB_PTR);
501 511
502 csr = ch->csr | CSR_ENB; 512 csr |= CSR_ENB;
503 writel(csr, ch->addr + APB_DMA_CHAN_CSR); 513 writel(csr, ch->addr + APB_DMA_CHAN_CSR);
504 514
505 req->status = TEGRA_DMA_REQ_INFLIGHT; 515 req->status = TEGRA_DMA_REQ_INFLIGHT;
506} 516}
507 517
508static void tegra_dma_init_hw(struct tegra_dma_channel *ch)
509{
510 /* One shot with an interrupt to CPU after transfer */
511 ch->csr = CSR_ONCE | CSR_IE_EOC;
512 ch->ahb_seq = AHB_SEQ_BUS_WIDTH_32 | AHB_SEQ_INTR_ENB;
513 ch->apb_seq = APB_SEQ_BUS_WIDTH_32 | 1 << APB_SEQ_WRAP_SHIFT;
514}
515
516static void handle_oneshot_dma(struct tegra_dma_channel *ch) 518static void handle_oneshot_dma(struct tegra_dma_channel *ch)
517{ 519{
518 struct tegra_dma_req *req; 520 struct tegra_dma_req *req;
521 unsigned long irq_flags;
519 522
520 spin_lock(&ch->lock); 523 spin_lock_irqsave(&ch->lock, irq_flags);
521 if (list_empty(&ch->list)) { 524 if (list_empty(&ch->list)) {
522 spin_unlock(&ch->lock); 525 spin_unlock_irqrestore(&ch->lock, irq_flags);
523 return; 526 return;
524 } 527 }
525 528
@@ -527,8 +530,7 @@ static void handle_oneshot_dma(struct tegra_dma_channel *ch)
527 if (req) { 530 if (req) {
528 int bytes_transferred; 531 int bytes_transferred;
529 532
530 bytes_transferred = 533 bytes_transferred = ch->req_transfer_count;
531 (ch->csr & CSR_WCOUNT_MASK) >> CSR_WCOUNT_SHIFT;
532 bytes_transferred += 1; 534 bytes_transferred += 1;
533 bytes_transferred <<= 2; 535 bytes_transferred <<= 2;
534 536
@@ -536,12 +538,12 @@ static void handle_oneshot_dma(struct tegra_dma_channel *ch)
536 req->bytes_transferred = bytes_transferred; 538 req->bytes_transferred = bytes_transferred;
537 req->status = TEGRA_DMA_REQ_SUCCESS; 539 req->status = TEGRA_DMA_REQ_SUCCESS;
538 540
539 spin_unlock(&ch->lock); 541 spin_unlock_irqrestore(&ch->lock, irq_flags);
540 /* Callback should be called without any lock */ 542 /* Callback should be called without any lock */
541 pr_debug("%s: transferred %d bytes\n", __func__, 543 pr_debug("%s: transferred %d bytes\n", __func__,
542 req->bytes_transferred); 544 req->bytes_transferred);
543 req->complete(req); 545 req->complete(req);
544 spin_lock(&ch->lock); 546 spin_lock_irqsave(&ch->lock, irq_flags);
545 } 547 }
546 548
547 if (!list_empty(&ch->list)) { 549 if (!list_empty(&ch->list)) {
@@ -551,22 +553,55 @@ static void handle_oneshot_dma(struct tegra_dma_channel *ch)
551 if (req->status != TEGRA_DMA_REQ_INFLIGHT) 553 if (req->status != TEGRA_DMA_REQ_INFLIGHT)
552 tegra_dma_update_hw(ch, req); 554 tegra_dma_update_hw(ch, req);
553 } 555 }
554 spin_unlock(&ch->lock); 556 spin_unlock_irqrestore(&ch->lock, irq_flags);
555} 557}
556 558
557static void handle_continuous_dma(struct tegra_dma_channel *ch) 559static void handle_continuous_dma(struct tegra_dma_channel *ch)
558{ 560{
559 struct tegra_dma_req *req; 561 struct tegra_dma_req *req;
562 unsigned long irq_flags;
560 563
561 spin_lock(&ch->lock); 564 spin_lock_irqsave(&ch->lock, irq_flags);
562 if (list_empty(&ch->list)) { 565 if (list_empty(&ch->list)) {
563 spin_unlock(&ch->lock); 566 spin_unlock_irqrestore(&ch->lock, irq_flags);
564 return; 567 return;
565 } 568 }
566 569
567 req = list_entry(ch->list.next, typeof(*req), node); 570 req = list_entry(ch->list.next, typeof(*req), node);
568 if (req) { 571 if (req) {
569 if (req->buffer_status == TEGRA_DMA_REQ_BUF_STATUS_EMPTY) { 572 if (req->buffer_status == TEGRA_DMA_REQ_BUF_STATUS_EMPTY) {
573 bool is_dma_ping_complete;
574 is_dma_ping_complete = (readl(ch->addr + APB_DMA_CHAN_STA)
575 & STA_PING_PONG) ? true : false;
576 if (req->to_memory)
577 is_dma_ping_complete = !is_dma_ping_complete;
578 /* Out of sync - Release current buffer */
579 if (!is_dma_ping_complete) {
580 int bytes_transferred;
581
582 bytes_transferred = ch->req_transfer_count;
583 bytes_transferred += 1;
584 bytes_transferred <<= 3;
585 req->buffer_status = TEGRA_DMA_REQ_BUF_STATUS_FULL;
586 req->bytes_transferred = bytes_transferred;
587 req->status = TEGRA_DMA_REQ_SUCCESS;
588 tegra_dma_stop(ch);
589
590 if (!list_is_last(&req->node, &ch->list)) {
591 struct tegra_dma_req *next_req;
592
593 next_req = list_entry(req->node.next,
594 typeof(*next_req), node);
595 tegra_dma_update_hw(ch, next_req);
596 }
597
598 list_del(&req->node);
599
600 /* DMA lock is NOT held when callbak is called */
601 spin_unlock_irqrestore(&ch->lock, irq_flags);
602 req->complete(req);
603 return;
604 }
570 /* Load the next request into the hardware, if available 605 /* Load the next request into the hardware, if available
571 * */ 606 * */
572 if (!list_is_last(&req->node, &ch->list)) { 607 if (!list_is_last(&req->node, &ch->list)) {
@@ -579,7 +614,7 @@ static void handle_continuous_dma(struct tegra_dma_channel *ch)
579 req->buffer_status = TEGRA_DMA_REQ_BUF_STATUS_HALF_FULL; 614 req->buffer_status = TEGRA_DMA_REQ_BUF_STATUS_HALF_FULL;
580 req->status = TEGRA_DMA_REQ_SUCCESS; 615 req->status = TEGRA_DMA_REQ_SUCCESS;
581 /* DMA lock is NOT held when callback is called */ 616 /* DMA lock is NOT held when callback is called */
582 spin_unlock(&ch->lock); 617 spin_unlock_irqrestore(&ch->lock, irq_flags);
583 if (likely(req->threshold)) 618 if (likely(req->threshold))
584 req->threshold(req); 619 req->threshold(req);
585 return; 620 return;
@@ -590,8 +625,7 @@ static void handle_continuous_dma(struct tegra_dma_channel *ch)
590 * the second interrupt */ 625 * the second interrupt */
591 int bytes_transferred; 626 int bytes_transferred;
592 627
593 bytes_transferred = 628 bytes_transferred = ch->req_transfer_count;
594 (ch->csr & CSR_WCOUNT_MASK) >> CSR_WCOUNT_SHIFT;
595 bytes_transferred += 1; 629 bytes_transferred += 1;
596 bytes_transferred <<= 3; 630 bytes_transferred <<= 3;
597 631
@@ -601,7 +635,7 @@ static void handle_continuous_dma(struct tegra_dma_channel *ch)
601 list_del(&req->node); 635 list_del(&req->node);
602 636
603 /* DMA lock is NOT held when callbak is called */ 637 /* DMA lock is NOT held when callbak is called */
604 spin_unlock(&ch->lock); 638 spin_unlock_irqrestore(&ch->lock, irq_flags);
605 req->complete(req); 639 req->complete(req);
606 return; 640 return;
607 641
@@ -609,7 +643,7 @@ static void handle_continuous_dma(struct tegra_dma_channel *ch)
609 BUG(); 643 BUG();
610 } 644 }
611 } 645 }
612 spin_unlock(&ch->lock); 646 spin_unlock_irqrestore(&ch->lock, irq_flags);
613} 647}
614 648
615static irqreturn_t dma_isr(int irq, void *data) 649static irqreturn_t dma_isr(int irq, void *data)
@@ -646,6 +680,21 @@ int __init tegra_dma_init(void)
646 int i; 680 int i;
647 unsigned int irq; 681 unsigned int irq;
648 void __iomem *addr; 682 void __iomem *addr;
683 struct clk *c;
684
685 bitmap_fill(channel_usage, NV_DMA_MAX_CHANNELS);
686
687 c = clk_get_sys("tegra-dma", NULL);
688 if (IS_ERR(c)) {
689 pr_err("Unable to get clock for APB DMA\n");
690 ret = PTR_ERR(c);
691 goto fail;
692 }
693 ret = clk_enable(c);
694 if (ret != 0) {
695 pr_err("Unable to enable clock for APB DMA\n");
696 goto fail;
697 }
649 698
650 addr = IO_ADDRESS(TEGRA_APB_DMA_BASE); 699 addr = IO_ADDRESS(TEGRA_APB_DMA_BASE);
651 writel(GEN_ENABLE, addr + APB_DMA_GEN); 700 writel(GEN_ENABLE, addr + APB_DMA_GEN);
@@ -653,18 +702,9 @@ int __init tegra_dma_init(void)
653 writel(0xFFFFFFFFul >> (31 - TEGRA_SYSTEM_DMA_CH_MAX), 702 writel(0xFFFFFFFFul >> (31 - TEGRA_SYSTEM_DMA_CH_MAX),
654 addr + APB_DMA_IRQ_MASK_SET); 703 addr + APB_DMA_IRQ_MASK_SET);
655 704
656 memset(channel_usage, 0, sizeof(channel_usage));
657 memset(dma_channels, 0, sizeof(dma_channels));
658
659 /* Reserve all the channels we are not supposed to touch */
660 for (i = 0; i < TEGRA_SYSTEM_DMA_CH_MIN; i++)
661 __set_bit(i, channel_usage);
662
663 for (i = TEGRA_SYSTEM_DMA_CH_MIN; i <= TEGRA_SYSTEM_DMA_CH_MAX; i++) { 705 for (i = TEGRA_SYSTEM_DMA_CH_MIN; i <= TEGRA_SYSTEM_DMA_CH_MAX; i++) {
664 struct tegra_dma_channel *ch = &dma_channels[i]; 706 struct tegra_dma_channel *ch = &dma_channels[i];
665 707
666 __clear_bit(i, channel_usage);
667
668 ch->id = i; 708 ch->id = i;
669 snprintf(ch->name, TEGRA_DMA_NAME_SIZE, "dma_channel_%d", i); 709 snprintf(ch->name, TEGRA_DMA_NAME_SIZE, "dma_channel_%d", i);
670 710
@@ -673,7 +713,6 @@ int __init tegra_dma_init(void)
673 713
674 spin_lock_init(&ch->lock); 714 spin_lock_init(&ch->lock);
675 INIT_LIST_HEAD(&ch->list); 715 INIT_LIST_HEAD(&ch->list);
676 tegra_dma_init_hw(ch);
677 716
678 irq = INT_APB_DMA_CH0 + i; 717 irq = INT_APB_DMA_CH0 + i;
679 ret = request_threaded_irq(irq, dma_isr, dma_thread_fn, 0, 718 ret = request_threaded_irq(irq, dma_isr, dma_thread_fn, 0,
@@ -684,14 +723,15 @@ int __init tegra_dma_init(void)
684 goto fail; 723 goto fail;
685 } 724 }
686 ch->irq = irq; 725 ch->irq = irq;
726
727 __clear_bit(i, channel_usage);
687 } 728 }
688 /* mark the shared channel allocated */ 729 /* mark the shared channel allocated */
689 __set_bit(TEGRA_SYSTEM_DMA_CH_MIN, channel_usage); 730 __set_bit(TEGRA_SYSTEM_DMA_CH_MIN, channel_usage);
690 731
691 for (i = TEGRA_SYSTEM_DMA_CH_MAX+1; i < NV_DMA_MAX_CHANNELS; i++) 732 tegra_dma_initialized = true;
692 __set_bit(i, channel_usage);
693 733
694 return ret; 734 return 0;
695fail: 735fail:
696 writel(0, addr + APB_DMA_GEN); 736 writel(0, addr + APB_DMA_GEN);
697 for (i = TEGRA_SYSTEM_DMA_CH_MIN; i <= TEGRA_SYSTEM_DMA_CH_MAX; i++) { 737 for (i = TEGRA_SYSTEM_DMA_CH_MIN; i <= TEGRA_SYSTEM_DMA_CH_MAX; i++) {
@@ -701,6 +741,7 @@ fail:
701 } 741 }
702 return ret; 742 return ret;
703} 743}
744postcore_initcall(tegra_dma_init);
704 745
705#ifdef CONFIG_PM 746#ifdef CONFIG_PM
706static u32 apb_dma[5*TEGRA_SYSTEM_DMA_CH_NR + 3]; 747static u32 apb_dma[5*TEGRA_SYSTEM_DMA_CH_NR + 3];
diff --git a/arch/arm/mach-tegra/gpio.c b/arch/arm/mach-tegra/gpio.c
index bd066206e110..12090a2cf3e0 100644
--- a/arch/arm/mach-tegra/gpio.c
+++ b/arch/arm/mach-tegra/gpio.c
@@ -25,6 +25,7 @@
25#include <linux/gpio.h> 25#include <linux/gpio.h>
26 26
27#include <mach/iomap.h> 27#include <mach/iomap.h>
28#include <mach/suspend.h>
28 29
29#define GPIO_BANK(x) ((x) >> 5) 30#define GPIO_BANK(x) ((x) >> 5)
30#define GPIO_PORT(x) (((x) >> 3) & 0x3) 31#define GPIO_PORT(x) (((x) >> 3) & 0x3)
@@ -207,9 +208,9 @@ static int tegra_gpio_irq_set_type(struct irq_data *d, unsigned int type)
207 spin_unlock_irqrestore(&bank->lvl_lock[port], flags); 208 spin_unlock_irqrestore(&bank->lvl_lock[port], flags);
208 209
209 if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH)) 210 if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
210 __set_irq_handler_unlocked(irq, handle_level_irq); 211 __set_irq_handler_unlocked(d->irq, handle_level_irq);
211 else if (type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) 212 else if (type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING))
212 __set_irq_handler_unlocked(irq, handle_edge_irq); 213 __set_irq_handler_unlocked(d->irq, handle_edge_irq);
213 214
214 return 0; 215 return 0;
215} 216}
@@ -380,6 +381,20 @@ static int __init tegra_gpio_init(void)
380 381
381postcore_initcall(tegra_gpio_init); 382postcore_initcall(tegra_gpio_init);
382 383
384void __init tegra_gpio_config(struct tegra_gpio_table *table, int num)
385{
386 int i;
387
388 for (i = 0; i < num; i++) {
389 int gpio = table[i].gpio;
390
391 if (table[i].enable)
392 tegra_gpio_enable(gpio);
393 else
394 tegra_gpio_disable(gpio);
395 }
396}
397
383#ifdef CONFIG_DEBUG_FS 398#ifdef CONFIG_DEBUG_FS
384 399
385#include <linux/debugfs.h> 400#include <linux/debugfs.h>
diff --git a/arch/arm/mach-tegra/include/mach/clk.h b/arch/arm/mach-tegra/include/mach/clk.h
index d7723955dac7..c8baf8f80d23 100644
--- a/arch/arm/mach-tegra/include/mach/clk.h
+++ b/arch/arm/mach-tegra/include/mach/clk.h
@@ -20,12 +20,12 @@
20#ifndef __MACH_CLK_H 20#ifndef __MACH_CLK_H
21#define __MACH_CLK_H 21#define __MACH_CLK_H
22 22
23struct clk;
24
23void tegra_periph_reset_deassert(struct clk *c); 25void tegra_periph_reset_deassert(struct clk *c);
24void tegra_periph_reset_assert(struct clk *c); 26void tegra_periph_reset_assert(struct clk *c);
25 27
26int clk_enable_cansleep(struct clk *clk); 28unsigned long clk_get_rate_all_locked(struct clk *c);
27void clk_disable_cansleep(struct clk *clk); 29void tegra_sdmmc_tap_delay(struct clk *c, int delay);
28int clk_set_rate_cansleep(struct clk *clk, unsigned long rate);
29int clk_set_parent_cansleep(struct clk *clk, struct clk *parent);
30 30
31#endif 31#endif
diff --git a/arch/arm/mach-tegra/include/mach/clkdev.h b/arch/arm/mach-tegra/include/mach/clkdev.h
index 412f5c63e65a..66cd3f4fc896 100644
--- a/arch/arm/mach-tegra/include/mach/clkdev.h
+++ b/arch/arm/mach-tegra/include/mach/clkdev.h
@@ -20,6 +20,8 @@
20#ifndef __MACH_CLKDEV_H 20#ifndef __MACH_CLKDEV_H
21#define __MACH_CLKDEV_H 21#define __MACH_CLKDEV_H
22 22
23struct clk;
24
23static inline int __clk_get(struct clk *clk) 25static inline int __clk_get(struct clk *clk)
24{ 26{
25 return 1; 27 return 1;
diff --git a/arch/arm/mach-tegra/include/mach/debug-macro.S b/arch/arm/mach-tegra/include/mach/debug-macro.S
index a0e7c12868bd..e0ebe65c1657 100644
--- a/arch/arm/mach-tegra/include/mach/debug-macro.S
+++ b/arch/arm/mach-tegra/include/mach/debug-macro.S
@@ -19,30 +19,15 @@
19 */ 19 */
20 20
21#include <mach/io.h> 21#include <mach/io.h>
22#include <mach/iomap.h>
22 23
23 .macro addruart, rp, rv 24 .macro addruart, rp, rv
24 ldr \rp, =IO_APB_PHYS @ physical 25 ldr \rp, =IO_APB_PHYS @ physical
25 ldr \rv, =IO_APB_VIRT @ virtual 26 ldr \rv, =IO_APB_VIRT @ virtual
26#if defined(CONFIG_TEGRA_DEBUG_UART_NONE) 27 orr \rp, \rp, #(TEGRA_DEBUG_UART_BASE & 0xFF)
27#error "A debug UART must be selected in the kernel config to use DEBUG_LL" 28 orr \rp, \rp, #(TEGRA_DEBUG_UART_BASE & 0xFF00)
28#elif defined(CONFIG_TEGRA_DEBUG_UARTA) 29 orr \rv, \rv, #(TEGRA_DEBUG_UART_BASE & 0xFF)
29 orr \rp, \rp, #0x6000 30 orr \rv, \rv, #(TEGRA_DEBUG_UART_BASE & 0xFF00)
30 orr \rv, \rv, #0x6000
31#elif defined(CONFIG_TEGRA_DEBUG_UARTB)
32 orr \rp, \rp, #0x6000
33 orr \rp, \rp, #0x40
34 orr \rv, \rv, #0x6000
35 orr \rv, \rv, #0x40
36#elif defined(CONFIG_TEGRA_DEBUG_UARTC)
37 orr \rp, \rp, #0x6200
38 orr \rv, \rv, #0x6200
39#elif defined(CONFIG_TEGRA_DEBUG_UARTD)
40 orr \rp, \rp, #0x6300
41 orr \rv, \rv, #0x6300
42#elif defined(CONFIG_TEGRA_DEBUG_UARTE)
43 orr \rp, \rp, #0x6400
44 orr \rv, \rv, #0x6400
45#endif
46 .endm 31 .endm
47 32
48#define UART_SHIFT 2 33#define UART_SHIFT 2
diff --git a/arch/arm/mach-tegra/include/mach/gpio.h b/arch/arm/mach-tegra/include/mach/gpio.h
index e31f486d69a2..196f114dc241 100644
--- a/arch/arm/mach-tegra/include/mach/gpio.h
+++ b/arch/arm/mach-tegra/include/mach/gpio.h
@@ -20,6 +20,7 @@
20#ifndef __MACH_TEGRA_GPIO_H 20#ifndef __MACH_TEGRA_GPIO_H
21#define __MACH_TEGRA_GPIO_H 21#define __MACH_TEGRA_GPIO_H
22 22
23#include <linux/init.h>
23#include <mach/irqs.h> 24#include <mach/irqs.h>
24 25
25#define TEGRA_NR_GPIOS INT_GPIO_NR 26#define TEGRA_NR_GPIOS INT_GPIO_NR
@@ -31,7 +32,7 @@
31#define gpio_cansleep __gpio_cansleep 32#define gpio_cansleep __gpio_cansleep
32 33
33#define TEGRA_GPIO_TO_IRQ(gpio) (INT_GPIO_BASE + (gpio)) 34#define TEGRA_GPIO_TO_IRQ(gpio) (INT_GPIO_BASE + (gpio))
34#define TEGRA_IRQ_TO_GPIO(irq) ((gpio) - INT_GPIO_BASE) 35#define TEGRA_IRQ_TO_GPIO(irq) ((irq) - INT_GPIO_BASE)
35 36
36static inline int gpio_to_irq(unsigned int gpio) 37static inline int gpio_to_irq(unsigned int gpio)
37{ 38{
@@ -47,6 +48,12 @@ static inline int irq_to_gpio(unsigned int irq)
47 return -EINVAL; 48 return -EINVAL;
48} 49}
49 50
51struct tegra_gpio_table {
52 int gpio; /* GPIO number */
53 bool enable; /* Enable for GPIO at init? */
54};
55
56void tegra_gpio_config(struct tegra_gpio_table *table, int num);
50void tegra_gpio_enable(int gpio); 57void tegra_gpio_enable(int gpio);
51void tegra_gpio_disable(int gpio); 58void tegra_gpio_disable(int gpio);
52 59
diff --git a/arch/arm/mach-tegra/include/mach/harmony_audio.h b/arch/arm/mach-tegra/include/mach/harmony_audio.h
new file mode 100644
index 000000000000..af086500ab7d
--- /dev/null
+++ b/arch/arm/mach-tegra/include/mach/harmony_audio.h
@@ -0,0 +1,22 @@
1/*
2 * arch/arm/mach-tegra/include/mach/harmony_audio.h
3 *
4 * Copyright 2011 NVIDIA, Inc.
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17struct harmony_audio_platform_data {
18 int gpio_spkr_en;
19 int gpio_hp_det;
20 int gpio_int_mic_en;
21 int gpio_ext_mic_en;
22};
diff --git a/arch/arm/mach-tegra/include/mach/iomap.h b/arch/arm/mach-tegra/include/mach/iomap.h
index 44a4f4bcf91f..19dec3ac0854 100644
--- a/arch/arm/mach-tegra/include/mach/iomap.h
+++ b/arch/arm/mach-tegra/include/mach/iomap.h
@@ -26,6 +26,9 @@
26#define TEGRA_IRAM_BASE 0x40000000 26#define TEGRA_IRAM_BASE 0x40000000
27#define TEGRA_IRAM_SIZE SZ_256K 27#define TEGRA_IRAM_SIZE SZ_256K
28 28
29#define TEGRA_HOST1X_BASE 0x50000000
30#define TEGRA_HOST1X_SIZE 0x24000
31
29#define TEGRA_ARM_PERIF_BASE 0x50040000 32#define TEGRA_ARM_PERIF_BASE 0x50040000
30#define TEGRA_ARM_PERIF_SIZE SZ_8K 33#define TEGRA_ARM_PERIF_SIZE SZ_8K
31 34
@@ -35,12 +38,30 @@
35#define TEGRA_ARM_INT_DIST_BASE 0x50041000 38#define TEGRA_ARM_INT_DIST_BASE 0x50041000
36#define TEGRA_ARM_INT_DIST_SIZE SZ_4K 39#define TEGRA_ARM_INT_DIST_SIZE SZ_4K
37 40
41#define TEGRA_MPE_BASE 0x54040000
42#define TEGRA_MPE_SIZE SZ_256K
43
44#define TEGRA_VI_BASE 0x54080000
45#define TEGRA_VI_SIZE SZ_256K
46
47#define TEGRA_ISP_BASE 0x54100000
48#define TEGRA_ISP_SIZE SZ_256K
49
38#define TEGRA_DISPLAY_BASE 0x54200000 50#define TEGRA_DISPLAY_BASE 0x54200000
39#define TEGRA_DISPLAY_SIZE SZ_256K 51#define TEGRA_DISPLAY_SIZE SZ_256K
40 52
41#define TEGRA_DISPLAY2_BASE 0x54240000 53#define TEGRA_DISPLAY2_BASE 0x54240000
42#define TEGRA_DISPLAY2_SIZE SZ_256K 54#define TEGRA_DISPLAY2_SIZE SZ_256K
43 55
56#define TEGRA_HDMI_BASE 0x54280000
57#define TEGRA_HDMI_SIZE SZ_256K
58
59#define TEGRA_GART_BASE 0x58000000
60#define TEGRA_GART_SIZE SZ_32M
61
62#define TEGRA_RES_SEMA_BASE 0x60001000
63#define TEGRA_RES_SEMA_SIZE SZ_4K
64
44#define TEGRA_PRIMARY_ICTLR_BASE 0x60004000 65#define TEGRA_PRIMARY_ICTLR_BASE 0x60004000
45#define TEGRA_PRIMARY_ICTLR_SIZE SZ_64 66#define TEGRA_PRIMARY_ICTLR_SIZE SZ_64
46 67
@@ -101,6 +122,9 @@
101#define TEGRA_APB_MISC_BASE 0x70000000 122#define TEGRA_APB_MISC_BASE 0x70000000
102#define TEGRA_APB_MISC_SIZE SZ_4K 123#define TEGRA_APB_MISC_SIZE SZ_4K
103 124
125#define TEGRA_APB_MISC_DAS_BASE 0x70000c00
126#define TEGRA_APB_MISC_DAS_SIZE SZ_128
127
104#define TEGRA_AC97_BASE 0x70002000 128#define TEGRA_AC97_BASE 0x70002000
105#define TEGRA_AC97_SIZE SZ_512 129#define TEGRA_AC97_SIZE SZ_512
106 130
@@ -140,6 +164,18 @@
140#define TEGRA_PWFM_BASE 0x7000A000 164#define TEGRA_PWFM_BASE 0x7000A000
141#define TEGRA_PWFM_SIZE SZ_256 165#define TEGRA_PWFM_SIZE SZ_256
142 166
167#define TEGRA_PWFM0_BASE 0x7000A000
168#define TEGRA_PWFM0_SIZE 4
169
170#define TEGRA_PWFM1_BASE 0x7000A010
171#define TEGRA_PWFM1_SIZE 4
172
173#define TEGRA_PWFM2_BASE 0x7000A020
174#define TEGRA_PWFM2_SIZE 4
175
176#define TEGRA_PWFM3_BASE 0x7000A030
177#define TEGRA_PWFM3_SIZE 4
178
143#define TEGRA_MIPI_BASE 0x7000B000 179#define TEGRA_MIPI_BASE 0x7000B000
144#define TEGRA_MIPI_SIZE SZ_256 180#define TEGRA_MIPI_SIZE SZ_256
145 181
@@ -221,4 +257,18 @@
221#define TEGRA_SDMMC4_BASE 0xC8000600 257#define TEGRA_SDMMC4_BASE 0xC8000600
222#define TEGRA_SDMMC4_SIZE SZ_512 258#define TEGRA_SDMMC4_SIZE SZ_512
223 259
260#if defined(CONFIG_TEGRA_DEBUG_UART_NONE)
261# define TEGRA_DEBUG_UART_BASE 0
262#elif defined(CONFIG_TEGRA_DEBUG_UARTA)
263# define TEGRA_DEBUG_UART_BASE TEGRA_UARTA_BASE
264#elif defined(CONFIG_TEGRA_DEBUG_UARTB)
265# define TEGRA_DEBUG_UART_BASE TEGRA_UARTB_BASE
266#elif defined(CONFIG_TEGRA_DEBUG_UARTC)
267# define TEGRA_DEBUG_UART_BASE TEGRA_UARTC_BASE
268#elif defined(CONFIG_TEGRA_DEBUG_UARTD)
269# define TEGRA_DEBUG_UART_BASE TEGRA_UARTD_BASE
270#elif defined(CONFIG_TEGRA_DEBUG_UARTE)
271# define TEGRA_DEBUG_UART_BASE TEGRA_UARTE_BASE
272#endif
273
224#endif 274#endif
diff --git a/arch/arm/mach-tegra/include/mach/irqs.h b/arch/arm/mach-tegra/include/mach/irqs.h
index 71bbf3422953..73265af4dda3 100644
--- a/arch/arm/mach-tegra/include/mach/irqs.h
+++ b/arch/arm/mach-tegra/include/mach/irqs.h
@@ -88,7 +88,7 @@
88#define INT_SYS_STATS_MON (INT_SEC_BASE + 22) 88#define INT_SYS_STATS_MON (INT_SEC_BASE + 22)
89#define INT_GPIO5 (INT_SEC_BASE + 23) 89#define INT_GPIO5 (INT_SEC_BASE + 23)
90#define INT_CPU0_PMU_INTR (INT_SEC_BASE + 24) 90#define INT_CPU0_PMU_INTR (INT_SEC_BASE + 24)
91#define INT_CPU2_PMU_INTR (INT_SEC_BASE + 25) 91#define INT_CPU1_PMU_INTR (INT_SEC_BASE + 25)
92#define INT_SEC_RES_26 (INT_SEC_BASE + 26) 92#define INT_SEC_RES_26 (INT_SEC_BASE + 26)
93#define INT_S_LINK1 (INT_SEC_BASE + 27) 93#define INT_S_LINK1 (INT_SEC_BASE + 27)
94#define INT_APB_DMA_COP (INT_SEC_BASE + 28) 94#define INT_APB_DMA_COP (INT_SEC_BASE + 28)
@@ -166,10 +166,18 @@
166#define INT_QUAD_RES_30 (INT_QUAD_BASE + 30) 166#define INT_QUAD_RES_30 (INT_QUAD_BASE + 30)
167#define INT_QUAD_RES_31 (INT_QUAD_BASE + 31) 167#define INT_QUAD_RES_31 (INT_QUAD_BASE + 31)
168 168
169#define INT_GPIO_BASE (INT_QUAD_BASE + 32) 169#define INT_MAIN_NR (INT_QUAD_BASE + 32 - INT_PRI_BASE)
170
171#define INT_GPIO_BASE (INT_PRI_BASE + INT_MAIN_NR)
172
170#define INT_GPIO_NR (28 * 8) 173#define INT_GPIO_NR (28 * 8)
171 174
172#define NR_IRQS (INT_GPIO_BASE + INT_GPIO_NR) 175#define TEGRA_NR_IRQS (INT_GPIO_BASE + INT_GPIO_NR)
176
177#define INT_BOARD_BASE TEGRA_NR_IRQS
178#define NR_BOARD_IRQS 32
179
180#define NR_IRQS (INT_BOARD_BASE + NR_BOARD_IRQS)
173#endif 181#endif
174 182
175#endif 183#endif
diff --git a/arch/arm/mach-tegra/include/mach/kbc.h b/arch/arm/mach-tegra/include/mach/kbc.h
new file mode 100644
index 000000000000..04c779832c78
--- /dev/null
+++ b/arch/arm/mach-tegra/include/mach/kbc.h
@@ -0,0 +1,62 @@
1/*
2 * Platform definitions for tegra-kbc keyboard input driver
3 *
4 * Copyright (c) 2010-2011, NVIDIA Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef ASMARM_ARCH_TEGRA_KBC_H
22#define ASMARM_ARCH_TEGRA_KBC_H
23
24#include <linux/types.h>
25#include <linux/input/matrix_keypad.h>
26
27#ifdef CONFIG_ARCH_TEGRA_2x_SOC
28#define KBC_MAX_GPIO 24
29#define KBC_MAX_KPENT 8
30#else
31#define KBC_MAX_GPIO 20
32#define KBC_MAX_KPENT 7
33#endif
34
35#define KBC_MAX_ROW 16
36#define KBC_MAX_COL 8
37#define KBC_MAX_KEY (KBC_MAX_ROW * KBC_MAX_COL)
38
39struct tegra_kbc_pin_cfg {
40 bool is_row;
41 unsigned char num;
42};
43
44struct tegra_kbc_wake_key {
45 u8 row:4;
46 u8 col:4;
47};
48
49struct tegra_kbc_platform_data {
50 unsigned int debounce_cnt;
51 unsigned int repeat_cnt;
52
53 unsigned int wake_cnt; /* 0:wake on any key >1:wake on wake_cfg */
54 const struct tegra_kbc_wake_key *wake_cfg;
55
56 struct tegra_kbc_pin_cfg pin_cfg[KBC_MAX_GPIO];
57 const struct matrix_keymap_data *keymap_data;
58
59 bool wakeup;
60 bool use_fn_map;
61};
62#endif
diff --git a/arch/arm/mach-tegra/include/mach/legacy_irq.h b/arch/arm/mach-tegra/include/mach/legacy_irq.h
index db1eb3dd04c8..d898c0e3d905 100644
--- a/arch/arm/mach-tegra/include/mach/legacy_irq.h
+++ b/arch/arm/mach-tegra/include/mach/legacy_irq.h
@@ -27,5 +27,9 @@ int tegra_legacy_force_irq_status(unsigned int irq);
27void tegra_legacy_select_fiq(unsigned int irq, bool fiq); 27void tegra_legacy_select_fiq(unsigned int irq, bool fiq);
28unsigned long tegra_legacy_vfiq(int nr); 28unsigned long tegra_legacy_vfiq(int nr);
29unsigned long tegra_legacy_class(int nr); 29unsigned long tegra_legacy_class(int nr);
30int tegra_legacy_irq_set_wake(int irq, int enable);
31void tegra_legacy_irq_set_lp1_wake_mask(void);
32void tegra_legacy_irq_restore_mask(void);
33void tegra_init_legacy_irq(void);
30 34
31#endif 35#endif
diff --git a/arch/arm/mach-tegra/include/mach/memory.h b/arch/arm/mach-tegra/include/mach/memory.h
index 6151bab62af2..537db3aa81a7 100644
--- a/arch/arm/mach-tegra/include/mach/memory.h
+++ b/arch/arm/mach-tegra/include/mach/memory.h
@@ -22,7 +22,7 @@
22#define __MACH_TEGRA_MEMORY_H 22#define __MACH_TEGRA_MEMORY_H
23 23
24/* physical offset of RAM */ 24/* physical offset of RAM */
25#define PHYS_OFFSET UL(0) 25#define PLAT_PHYS_OFFSET UL(0)
26 26
27#endif 27#endif
28 28
diff --git a/arch/arm/mach-tegra/include/mach/pinmux-t2.h b/arch/arm/mach-tegra/include/mach/pinmux-t2.h
index e5b9d740f973..4c2626347263 100644
--- a/arch/arm/mach-tegra/include/mach/pinmux-t2.h
+++ b/arch/arm/mach-tegra/include/mach/pinmux-t2.h
@@ -167,6 +167,16 @@ enum tegra_drive_pingroup {
167 TEGRA_DRIVE_PINGROUP_XM2D, 167 TEGRA_DRIVE_PINGROUP_XM2D,
168 TEGRA_DRIVE_PINGROUP_XM2CLK, 168 TEGRA_DRIVE_PINGROUP_XM2CLK,
169 TEGRA_DRIVE_PINGROUP_MEMCOMP, 169 TEGRA_DRIVE_PINGROUP_MEMCOMP,
170 TEGRA_DRIVE_PINGROUP_SDIO1,
171 TEGRA_DRIVE_PINGROUP_CRT,
172 TEGRA_DRIVE_PINGROUP_DDC,
173 TEGRA_DRIVE_PINGROUP_GMA,
174 TEGRA_DRIVE_PINGROUP_GMB,
175 TEGRA_DRIVE_PINGROUP_GMC,
176 TEGRA_DRIVE_PINGROUP_GMD,
177 TEGRA_DRIVE_PINGROUP_GME,
178 TEGRA_DRIVE_PINGROUP_OWR,
179 TEGRA_DRIVE_PINGROUP_UAD,
170 TEGRA_MAX_DRIVE_PINGROUP, 180 TEGRA_MAX_DRIVE_PINGROUP,
171}; 181};
172 182
diff --git a/arch/arm/mach-tegra/include/mach/powergate.h b/arch/arm/mach-tegra/include/mach/powergate.h
new file mode 100644
index 000000000000..401d1b725291
--- /dev/null
+++ b/arch/arm/mach-tegra/include/mach/powergate.h
@@ -0,0 +1,40 @@
1/*
2 * drivers/regulator/tegra-regulator.c
3 *
4 * Copyright (c) 2010 Google, Inc
5 *
6 * Author:
7 * Colin Cross <ccross@google.com>
8 *
9 * This software is licensed under the terms of the GNU General Public
10 * License version 2, as published by the Free Software Foundation, and
11 * may be copied, distributed, and modified under those terms.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 */
19
20#ifndef _MACH_TEGRA_POWERGATE_H_
21#define _MACH_TEGRA_POWERGATE_H_
22
23#define TEGRA_POWERGATE_CPU 0
24#define TEGRA_POWERGATE_3D 1
25#define TEGRA_POWERGATE_VENC 2
26#define TEGRA_POWERGATE_PCIE 3
27#define TEGRA_POWERGATE_VDEC 4
28#define TEGRA_POWERGATE_L2 5
29#define TEGRA_POWERGATE_MPE 6
30#define TEGRA_NUM_POWERGATE 7
31
32int tegra_powergate_power_on(int id);
33int tegra_powergate_power_off(int id);
34bool tegra_powergate_is_powered(int id);
35int tegra_powergate_remove_clamping(int id);
36
37/* Must be called with clk disabled, and returns with clk enabled */
38int tegra_powergate_sequence_power_up(int id, struct clk *clk);
39
40#endif /* _MACH_TEGRA_POWERGATE_H_ */
diff --git a/arch/arm/mach-tegra/include/mach/suspend.h b/arch/arm/mach-tegra/include/mach/suspend.h
new file mode 100644
index 000000000000..5af8715d2e1e
--- /dev/null
+++ b/arch/arm/mach-tegra/include/mach/suspend.h
@@ -0,0 +1,38 @@
1/*
2 * arch/arm/mach-tegra/include/mach/suspend.h
3 *
4 * Copyright (C) 2010 Google, Inc.
5 *
6 * Author:
7 * Colin Cross <ccross@google.com>
8 *
9 * This software is licensed under the terms of the GNU General Public
10 * License version 2, as published by the Free Software Foundation, and
11 * may be copied, distributed, and modified under those terms.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 */
19
20
21#ifndef _MACH_TEGRA_SUSPEND_H_
22#define _MACH_TEGRA_SUSPEND_H_
23
24void tegra_pinmux_suspend(void);
25void tegra_irq_suspend(void);
26void tegra_gpio_suspend(void);
27void tegra_clk_suspend(void);
28void tegra_dma_suspend(void);
29void tegra_timer_suspend(void);
30
31void tegra_pinmux_resume(void);
32void tegra_irq_resume(void);
33void tegra_gpio_resume(void);
34void tegra_clk_resume(void);
35void tegra_dma_resume(void);
36void tegra_timer_resume(void);
37
38#endif /* _MACH_TEGRA_SUSPEND_H_ */
diff --git a/arch/arm/mach-tegra/include/mach/system.h b/arch/arm/mach-tegra/include/mach/system.h
index 84d5d46113f7..d0183d876c3b 100644
--- a/arch/arm/mach-tegra/include/mach/system.h
+++ b/arch/arm/mach-tegra/include/mach/system.h
@@ -24,16 +24,10 @@
24#include <mach/hardware.h> 24#include <mach/hardware.h>
25#include <mach/iomap.h> 25#include <mach/iomap.h>
26 26
27static inline void arch_idle(void) 27extern void (*arch_reset)(char mode, const char *cmd);
28{
29}
30 28
31static inline void arch_reset(char mode, const char *cmd) 29static inline void arch_idle(void)
32{ 30{
33 void __iomem *reset = IO_ADDRESS(TEGRA_CLK_RESET_BASE + 0x04);
34 u32 reg = readl(reset);
35 reg |= 0x04;
36 writel(reg, reset);
37} 31}
38 32
39#endif 33#endif
diff --git a/arch/arm/mach-tegra/include/mach/uncompress.h b/arch/arm/mach-tegra/include/mach/uncompress.h
index 6c4dd815abd7..4e8323770c79 100644
--- a/arch/arm/mach-tegra/include/mach/uncompress.h
+++ b/arch/arm/mach-tegra/include/mach/uncompress.h
@@ -26,23 +26,9 @@
26 26
27#include <mach/iomap.h> 27#include <mach/iomap.h>
28 28
29#if defined(CONFIG_TEGRA_DEBUG_UARTA)
30#define DEBUG_UART_BASE TEGRA_UARTA_BASE
31#elif defined(CONFIG_TEGRA_DEBUG_UARTB)
32#define DEBUG_UART_BASE TEGRA_UARTB_BASE
33#elif defined(CONFIG_TEGRA_DEBUG_UARTC)
34#define DEBUG_UART_BASE TEGRA_UARTC_BASE
35#elif defined(CONFIG_TEGRA_DEBUG_UARTD)
36#define DEBUG_UART_BASE TEGRA_UARTD_BASE
37#elif defined(CONFIG_TEGRA_DEBUG_UARTE)
38#define DEBUG_UART_BASE TEGRA_UARTE_BASE
39#else
40#define DEBUG_UART_BASE NULL
41#endif
42
43static void putc(int c) 29static void putc(int c)
44{ 30{
45 volatile u8 *uart = (volatile u8 *)DEBUG_UART_BASE; 31 volatile u8 *uart = (volatile u8 *)TEGRA_DEBUG_UART_BASE;
46 int shift = 2; 32 int shift = 2;
47 33
48 if (uart == NULL) 34 if (uart == NULL)
@@ -59,7 +45,7 @@ static inline void flush(void)
59 45
60static inline void arch_decomp_setup(void) 46static inline void arch_decomp_setup(void)
61{ 47{
62 volatile u8 *uart = (volatile u8 *)DEBUG_UART_BASE; 48 volatile u8 *uart = (volatile u8 *)TEGRA_DEBUG_UART_BASE;
63 int shift = 2; 49 int shift = 2;
64 50
65 if (uart == NULL) 51 if (uart == NULL)
diff --git a/arch/arm/mach-tegra/include/mach/usb_phy.h b/arch/arm/mach-tegra/include/mach/usb_phy.h
new file mode 100644
index 000000000000..d4b8f9e298a8
--- /dev/null
+++ b/arch/arm/mach-tegra/include/mach/usb_phy.h
@@ -0,0 +1,86 @@
1/*
2 * arch/arm/mach-tegra/include/mach/usb_phy.h
3 *
4 * Copyright (C) 2010 Google, Inc.
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17#ifndef __MACH_USB_PHY_H
18#define __MACH_USB_PHY_H
19
20#include <linux/clk.h>
21#include <linux/usb/otg.h>
22
23struct tegra_utmip_config {
24 u8 hssync_start_delay;
25 u8 elastic_limit;
26 u8 idle_wait_delay;
27 u8 term_range_adj;
28 u8 xcvr_setup;
29 u8 xcvr_lsfslew;
30 u8 xcvr_lsrslew;
31};
32
33struct tegra_ulpi_config {
34 int reset_gpio;
35 const char *clk;
36};
37
38enum tegra_usb_phy_port_speed {
39 TEGRA_USB_PHY_PORT_SPEED_FULL = 0,
40 TEGRA_USB_PHY_PORT_SPEED_LOW,
41 TEGRA_USB_PHY_PORT_SPEED_HIGH,
42};
43
44enum tegra_usb_phy_mode {
45 TEGRA_USB_PHY_MODE_DEVICE,
46 TEGRA_USB_PHY_MODE_HOST,
47};
48
49struct tegra_xtal_freq;
50
51struct tegra_usb_phy {
52 int instance;
53 const struct tegra_xtal_freq *freq;
54 void __iomem *regs;
55 void __iomem *pad_regs;
56 struct clk *clk;
57 struct clk *pll_u;
58 struct clk *pad_clk;
59 enum tegra_usb_phy_mode mode;
60 void *config;
61 struct otg_transceiver *ulpi;
62};
63
64struct tegra_usb_phy *tegra_usb_phy_open(int instance, void __iomem *regs,
65 void *config, enum tegra_usb_phy_mode phy_mode);
66
67int tegra_usb_phy_power_on(struct tegra_usb_phy *phy);
68
69void tegra_usb_phy_clk_disable(struct tegra_usb_phy *phy);
70
71void tegra_usb_phy_clk_enable(struct tegra_usb_phy *phy);
72
73void tegra_usb_phy_power_off(struct tegra_usb_phy *phy);
74
75void tegra_usb_phy_preresume(struct tegra_usb_phy *phy);
76
77void tegra_usb_phy_postresume(struct tegra_usb_phy *phy);
78
79void tegra_ehci_phy_restore_start(struct tegra_usb_phy *phy,
80 enum tegra_usb_phy_port_speed port_speed);
81
82void tegra_ehci_phy_restore_end(struct tegra_usb_phy *phy);
83
84void tegra_usb_phy_close(struct tegra_usb_phy *phy);
85
86#endif /* __MACH_USB_PHY_H */
diff --git a/arch/arm/mach-tegra/irq.c b/arch/arm/mach-tegra/irq.c
index de7dfad6f769..dfbc219ea492 100644
--- a/arch/arm/mach-tegra/irq.c
+++ b/arch/arm/mach-tegra/irq.c
@@ -18,6 +18,7 @@
18 */ 18 */
19 19
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/delay.h>
21#include <linux/init.h> 22#include <linux/init.h>
22#include <linux/interrupt.h> 23#include <linux/interrupt.h>
23#include <linux/irq.h> 24#include <linux/irq.h>
@@ -26,146 +27,135 @@
26#include <asm/hardware/gic.h> 27#include <asm/hardware/gic.h>
27 28
28#include <mach/iomap.h> 29#include <mach/iomap.h>
30#include <mach/legacy_irq.h>
31#include <mach/suspend.h>
29 32
30#include "board.h" 33#include "board.h"
31 34
32#define INT_SYS_NR (INT_GPIO_BASE - INT_PRI_BASE) 35#define PMC_CTRL 0x0
33#define INT_SYS_SZ (INT_SEC_BASE - INT_PRI_BASE) 36#define PMC_CTRL_LATCH_WAKEUPS (1 << 5)
34#define PPI_NR ((INT_SYS_NR+INT_SYS_SZ-1)/INT_SYS_SZ) 37#define PMC_WAKE_MASK 0xc
38#define PMC_WAKE_LEVEL 0x10
39#define PMC_WAKE_STATUS 0x14
40#define PMC_SW_WAKE_STATUS 0x18
41#define PMC_DPD_SAMPLE 0x20
35 42
36#define APBDMA_IRQ_STA_CPU 0x14 43static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
37#define APBDMA_IRQ_MASK_SET 0x20
38#define APBDMA_IRQ_MASK_CLR 0x24
39 44
40#define ICTLR_CPU_IER 0x20 45static u32 tegra_lp0_wake_enb;
41#define ICTLR_CPU_IER_SET 0x24 46static u32 tegra_lp0_wake_level;
42#define ICTLR_CPU_IER_CLR 0x28 47static u32 tegra_lp0_wake_level_any;
43#define ICTLR_CPU_IEP_CLASS 0x2c
44#define ICTLR_COP_IER 0x30
45#define ICTLR_COP_IER_SET 0x34
46#define ICTLR_COP_IER_CLR 0x38
47#define ICTLR_COP_IEP_CLASS 0x3c
48 48
49static void (*gic_mask_irq)(struct irq_data *d); 49static void (*tegra_gic_mask_irq)(struct irq_data *d);
50static void (*gic_unmask_irq)(struct irq_data *d); 50static void (*tegra_gic_unmask_irq)(struct irq_data *d);
51static void (*tegra_gic_ack_irq)(struct irq_data *d);
51 52
52#define irq_to_ictlr(irq) (((irq)-32) >> 5) 53/* ensures that sufficient time is passed for a register write to
53static void __iomem *tegra_ictlr_base = IO_ADDRESS(TEGRA_PRIMARY_ICTLR_BASE); 54 * serialize into the 32KHz domain */
54#define ictlr_to_virt(ictlr) (tegra_ictlr_base + (ictlr)*0x100) 55static void pmc_32kwritel(u32 val, unsigned long offs)
56{
57 writel(val, pmc + offs);
58 udelay(130);
59}
60
61int tegra_set_lp1_wake(int irq, int enable)
62{
63 return tegra_legacy_irq_set_wake(irq, enable);
64}
65
66void tegra_set_lp0_wake_pads(u32 wake_enb, u32 wake_level, u32 wake_any)
67{
68 u32 temp;
69 u32 status;
70 u32 lvl;
71
72 wake_level &= wake_enb;
73 wake_any &= wake_enb;
74
75 wake_level |= (tegra_lp0_wake_level & tegra_lp0_wake_enb);
76 wake_any |= (tegra_lp0_wake_level_any & tegra_lp0_wake_enb);
77
78 wake_enb |= tegra_lp0_wake_enb;
79
80 pmc_32kwritel(0, PMC_SW_WAKE_STATUS);
81 temp = readl(pmc + PMC_CTRL);
82 temp |= PMC_CTRL_LATCH_WAKEUPS;
83 pmc_32kwritel(temp, PMC_CTRL);
84 temp &= ~PMC_CTRL_LATCH_WAKEUPS;
85 pmc_32kwritel(temp, PMC_CTRL);
86 status = readl(pmc + PMC_SW_WAKE_STATUS);
87 lvl = readl(pmc + PMC_WAKE_LEVEL);
88
89 /* flip the wakeup trigger for any-edge triggered pads
90 * which are currently asserting as wakeups */
91 lvl ^= status;
92 lvl &= wake_any;
93
94 wake_level |= lvl;
95
96 writel(wake_level, pmc + PMC_WAKE_LEVEL);
97 /* Enable DPD sample to trigger sampling pads data and direction
98 * in which pad will be driven during lp0 mode*/
99 writel(0x1, pmc + PMC_DPD_SAMPLE);
100
101 writel(wake_enb, pmc + PMC_WAKE_MASK);
102}
55 103
56static void tegra_mask(struct irq_data *d) 104static void tegra_mask(struct irq_data *d)
57{ 105{
58 void __iomem *addr = ictlr_to_virt(irq_to_ictlr(d->irq)); 106 tegra_gic_mask_irq(d);
59 gic_mask_irq(d); 107 tegra_legacy_mask_irq(d->irq);
60 writel(1<<(d->irq&31), addr+ICTLR_CPU_IER_CLR);
61} 108}
62 109
63static void tegra_unmask(struct irq_data *d) 110static void tegra_unmask(struct irq_data *d)
64{ 111{
65 void __iomem *addr = ictlr_to_virt(irq_to_ictlr(d->irq)); 112 tegra_gic_unmask_irq(d);
66 gic_unmask_irq(d); 113 tegra_legacy_unmask_irq(d->irq);
67 writel(1<<(d->irq&31), addr+ICTLR_CPU_IER_SET);
68} 114}
69 115
70#ifdef CONFIG_PM 116static void tegra_ack(struct irq_data *d)
117{
118 tegra_legacy_force_irq_clr(d->irq);
119 tegra_gic_ack_irq(d);
120}
71 121
72static int tegra_set_wake(struct irq_data *d, unsigned int on) 122static int tegra_retrigger(struct irq_data *d)
73{ 123{
74 return 0; 124 tegra_legacy_force_irq_set(d->irq);
125 return 1;
75} 126}
76#endif
77 127
78static struct irq_chip tegra_irq = { 128static struct irq_chip tegra_irq = {
79 .name = "PPI", 129 .name = "PPI",
80 .irq_mask = tegra_mask, 130 .irq_ack = tegra_ack,
81 .irq_unmask = tegra_unmask, 131 .irq_mask = tegra_mask,
82#ifdef CONFIG_PM 132 .irq_unmask = tegra_unmask,
83 .irq_set_wake = tegra_set_wake, 133 .irq_retrigger = tegra_retrigger,
84#endif
85}; 134};
86 135
87void __init tegra_init_irq(void) 136void __init tegra_init_irq(void)
88{ 137{
89 struct irq_chip *gic; 138 struct irq_chip *gic;
90 unsigned int i; 139 unsigned int i;
140 int irq;
91 141
92 for (i = 0; i < PPI_NR; i++) { 142 tegra_init_legacy_irq();
93 writel(~0, ictlr_to_virt(i) + ICTLR_CPU_IER_CLR);
94 writel(0, ictlr_to_virt(i) + ICTLR_CPU_IEP_CLASS);
95 }
96 143
97 gic_init(0, 29, IO_ADDRESS(TEGRA_ARM_INT_DIST_BASE), 144 gic_init(0, 29, IO_ADDRESS(TEGRA_ARM_INT_DIST_BASE),
98 IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100)); 145 IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100));
99 146
100 gic = get_irq_chip(29); 147 gic = get_irq_chip(29);
101 gic_unmask_irq = gic->irq_unmask; 148 tegra_gic_unmask_irq = gic->irq_unmask;
102 gic_mask_irq = gic->irq_mask; 149 tegra_gic_mask_irq = gic->irq_mask;
103 tegra_irq.irq_ack = gic->irq_ack; 150 tegra_gic_ack_irq = gic->irq_ack;
104#ifdef CONFIG_SMP 151#ifdef CONFIG_SMP
105 tegra_irq.irq_set_affinity = gic->irq_set_affinity; 152 tegra_irq.irq_set_affinity = gic->irq_set_affinity;
106#endif 153#endif
107 154
108 for (i = INT_PRI_BASE; i < INT_GPIO_BASE; i++) { 155 for (i = 0; i < INT_MAIN_NR; i++) {
109 set_irq_chip(i, &tegra_irq); 156 irq = INT_PRI_BASE + i;
110 set_irq_handler(i, handle_level_irq); 157 set_irq_chip(irq, &tegra_irq);
111 set_irq_flags(i, IRQF_VALID); 158 set_irq_handler(irq, handle_level_irq);
159 set_irq_flags(irq, IRQF_VALID);
112 } 160 }
113} 161}
114
115#ifdef CONFIG_PM
116static u32 cop_ier[PPI_NR];
117static u32 cpu_ier[PPI_NR];
118static u32 cpu_iep[PPI_NR];
119
120void tegra_irq_suspend(void)
121{
122 unsigned long flags;
123 int i;
124
125 for (i = INT_PRI_BASE; i < INT_GPIO_BASE; i++) {
126 struct irq_desc *desc = irq_to_desc(i);
127 if (!desc)
128 continue;
129 if (desc->status & IRQ_WAKEUP) {
130 pr_debug("irq %d is wakeup\n", i);
131 continue;
132 }
133 disable_irq(i);
134 }
135
136 local_irq_save(flags);
137 for (i = 0; i < PPI_NR; i++) {
138 void __iomem *ictlr = ictlr_to_virt(i);
139 cpu_ier[i] = readl(ictlr + ICTLR_CPU_IER);
140 cpu_iep[i] = readl(ictlr + ICTLR_CPU_IEP_CLASS);
141 cop_ier[i] = readl(ictlr + ICTLR_COP_IER);
142 writel(~0, ictlr + ICTLR_COP_IER_CLR);
143 }
144 local_irq_restore(flags);
145}
146
147void tegra_irq_resume(void)
148{
149 unsigned long flags;
150 int i;
151
152 local_irq_save(flags);
153 for (i = 0; i < PPI_NR; i++) {
154 void __iomem *ictlr = ictlr_to_virt(i);
155 writel(cpu_iep[i], ictlr + ICTLR_CPU_IEP_CLASS);
156 writel(~0ul, ictlr + ICTLR_CPU_IER_CLR);
157 writel(cpu_ier[i], ictlr + ICTLR_CPU_IER_SET);
158 writel(0, ictlr + ICTLR_COP_IEP_CLASS);
159 writel(~0ul, ictlr + ICTLR_COP_IER_CLR);
160 writel(cop_ier[i], ictlr + ICTLR_COP_IER_SET);
161 }
162 local_irq_restore(flags);
163
164 for (i = INT_PRI_BASE; i < INT_GPIO_BASE; i++) {
165 struct irq_desc *desc = irq_to_desc(i);
166 if (!desc || (desc->status & IRQ_WAKEUP))
167 continue;
168 enable_irq(i);
169 }
170}
171#endif
diff --git a/arch/arm/mach-tegra/legacy_irq.c b/arch/arm/mach-tegra/legacy_irq.c
index 7cc8601c19ff..38eb719a4f53 100644
--- a/arch/arm/mach-tegra/legacy_irq.c
+++ b/arch/arm/mach-tegra/legacy_irq.c
@@ -18,17 +18,30 @@
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <mach/iomap.h> 20#include <mach/iomap.h>
21#include <mach/irqs.h>
21#include <mach/legacy_irq.h> 22#include <mach/legacy_irq.h>
22 23
23#define ICTLR_CPU_IER 0x20 24#define INT_SYS_NR (INT_GPIO_BASE - INT_PRI_BASE)
24#define ICTLR_CPU_IER_SET 0x24 25#define INT_SYS_SZ (INT_SEC_BASE - INT_PRI_BASE)
25#define ICTLR_CPU_IER_CLR 0x28 26#define PPI_NR ((INT_SYS_NR+INT_SYS_SZ-1)/INT_SYS_SZ)
26#define ICTLR_CPU_IEP_CLASS 0x2C 27
27#define ICTLR_CPU_IEP_VFIQ 0x08 28#define ICTLR_CPU_IEP_VFIQ 0x08
28#define ICTLR_CPU_IEP_FIR 0x14 29#define ICTLR_CPU_IEP_FIR 0x14
29#define ICTLR_CPU_IEP_FIR_SET 0x18 30#define ICTLR_CPU_IEP_FIR_SET 0x18
30#define ICTLR_CPU_IEP_FIR_CLR 0x1c 31#define ICTLR_CPU_IEP_FIR_CLR 0x1c
31 32
33#define ICTLR_CPU_IER 0x20
34#define ICTLR_CPU_IER_SET 0x24
35#define ICTLR_CPU_IER_CLR 0x28
36#define ICTLR_CPU_IEP_CLASS 0x2C
37
38#define ICTLR_COP_IER 0x30
39#define ICTLR_COP_IER_SET 0x34
40#define ICTLR_COP_IER_CLR 0x38
41#define ICTLR_COP_IEP_CLASS 0x3c
42
43#define NUM_ICTLRS 4
44
32static void __iomem *ictlr_reg_base[] = { 45static void __iomem *ictlr_reg_base[] = {
33 IO_ADDRESS(TEGRA_PRIMARY_ICTLR_BASE), 46 IO_ADDRESS(TEGRA_PRIMARY_ICTLR_BASE),
34 IO_ADDRESS(TEGRA_SECONDARY_ICTLR_BASE), 47 IO_ADDRESS(TEGRA_SECONDARY_ICTLR_BASE),
@@ -36,6 +49,9 @@ static void __iomem *ictlr_reg_base[] = {
36 IO_ADDRESS(TEGRA_QUATERNARY_ICTLR_BASE), 49 IO_ADDRESS(TEGRA_QUATERNARY_ICTLR_BASE),
37}; 50};
38 51
52static u32 tegra_legacy_wake_mask[4];
53static u32 tegra_legacy_saved_mask[4];
54
39/* When going into deep sleep, the CPU is powered down, taking the GIC with it 55/* When going into deep sleep, the CPU is powered down, taking the GIC with it
40 In order to wake, the wake interrupts need to be enabled in the legacy 56 In order to wake, the wake interrupts need to be enabled in the legacy
41 interrupt controller. */ 57 interrupt controller. */
@@ -112,3 +128,88 @@ unsigned long tegra_legacy_class(int nr)
112 base = ictlr_reg_base[nr]; 128 base = ictlr_reg_base[nr];
113 return readl(base + ICTLR_CPU_IEP_CLASS); 129 return readl(base + ICTLR_CPU_IEP_CLASS);
114} 130}
131
132int tegra_legacy_irq_set_wake(int irq, int enable)
133{
134 irq -= 32;
135 if (enable)
136 tegra_legacy_wake_mask[irq >> 5] |= 1 << (irq & 31);
137 else
138 tegra_legacy_wake_mask[irq >> 5] &= ~(1 << (irq & 31));
139
140 return 0;
141}
142
143void tegra_legacy_irq_set_lp1_wake_mask(void)
144{
145 void __iomem *base;
146 int i;
147
148 for (i = 0; i < NUM_ICTLRS; i++) {
149 base = ictlr_reg_base[i];
150 tegra_legacy_saved_mask[i] = readl(base + ICTLR_CPU_IER);
151 writel(tegra_legacy_wake_mask[i], base + ICTLR_CPU_IER);
152 }
153}
154
155void tegra_legacy_irq_restore_mask(void)
156{
157 void __iomem *base;
158 int i;
159
160 for (i = 0; i < NUM_ICTLRS; i++) {
161 base = ictlr_reg_base[i];
162 writel(tegra_legacy_saved_mask[i], base + ICTLR_CPU_IER);
163 }
164}
165
166void tegra_init_legacy_irq(void)
167{
168 int i;
169
170 for (i = 0; i < NUM_ICTLRS; i++) {
171 void __iomem *ictlr = ictlr_reg_base[i];
172 writel(~0, ictlr + ICTLR_CPU_IER_CLR);
173 writel(0, ictlr + ICTLR_CPU_IEP_CLASS);
174 }
175}
176
177#ifdef CONFIG_PM
178static u32 cop_ier[NUM_ICTLRS];
179static u32 cpu_ier[NUM_ICTLRS];
180static u32 cpu_iep[NUM_ICTLRS];
181
182void tegra_irq_suspend(void)
183{
184 unsigned long flags;
185 int i;
186
187 local_irq_save(flags);
188 for (i = 0; i < NUM_ICTLRS; i++) {
189 void __iomem *ictlr = ictlr_reg_base[i];
190 cpu_ier[i] = readl(ictlr + ICTLR_CPU_IER);
191 cpu_iep[i] = readl(ictlr + ICTLR_CPU_IEP_CLASS);
192 cop_ier[i] = readl(ictlr + ICTLR_COP_IER);
193 writel(~0, ictlr + ICTLR_COP_IER_CLR);
194 }
195 local_irq_restore(flags);
196}
197
198void tegra_irq_resume(void)
199{
200 unsigned long flags;
201 int i;
202
203 local_irq_save(flags);
204 for (i = 0; i < NUM_ICTLRS; i++) {
205 void __iomem *ictlr = ictlr_reg_base[i];
206 writel(cpu_iep[i], ictlr + ICTLR_CPU_IEP_CLASS);
207 writel(~0ul, ictlr + ICTLR_CPU_IER_CLR);
208 writel(cpu_ier[i], ictlr + ICTLR_CPU_IER_SET);
209 writel(0, ictlr + ICTLR_COP_IEP_CLASS);
210 writel(~0ul, ictlr + ICTLR_COP_IER_CLR);
211 writel(cop_ier[i], ictlr + ICTLR_COP_IER_SET);
212 }
213 local_irq_restore(flags);
214}
215#endif
diff --git a/arch/arm/mach-tegra/localtimer.c b/arch/arm/mach-tegra/localtimer.c
index f81ca7cbbc1f..e91d681d45a2 100644
--- a/arch/arm/mach-tegra/localtimer.c
+++ b/arch/arm/mach-tegra/localtimer.c
@@ -18,8 +18,9 @@
18/* 18/*
19 * Setup the local clock events for a CPU. 19 * Setup the local clock events for a CPU.
20 */ 20 */
21void __cpuinit local_timer_setup(struct clock_event_device *evt) 21int __cpuinit local_timer_setup(struct clock_event_device *evt)
22{ 22{
23 evt->irq = IRQ_LOCALTIMER; 23 evt->irq = IRQ_LOCALTIMER;
24 twd_timer_setup(evt); 24 twd_timer_setup(evt);
25 return 0;
25} 26}
diff --git a/arch/arm/mach-tegra/pcie.c b/arch/arm/mach-tegra/pcie.c
index 53f5fa37014a..2941212b853c 100644
--- a/arch/arm/mach-tegra/pcie.c
+++ b/arch/arm/mach-tegra/pcie.c
@@ -39,6 +39,7 @@
39#include <mach/pinmux.h> 39#include <mach/pinmux.h>
40#include <mach/iomap.h> 40#include <mach/iomap.h>
41#include <mach/clk.h> 41#include <mach/clk.h>
42#include <mach/powergate.h>
42 43
43/* register definitions */ 44/* register definitions */
44#define AFI_OFFSET 0x3800 45#define AFI_OFFSET 0x3800
@@ -682,24 +683,41 @@ static void tegra_pcie_xclk_clamp(bool clamp)
682 pmc_writel(reg, PMC_SCRATCH42); 683 pmc_writel(reg, PMC_SCRATCH42);
683} 684}
684 685
685static int tegra_pcie_power_on(void) 686static void tegra_pcie_power_off(void)
686{ 687{
687 tegra_pcie_xclk_clamp(true);
688 tegra_periph_reset_assert(tegra_pcie.pcie_xclk); 688 tegra_periph_reset_assert(tegra_pcie.pcie_xclk);
689 tegra_pcie_xclk_clamp(false); 689 tegra_periph_reset_assert(tegra_pcie.afi_clk);
690 tegra_periph_reset_assert(tegra_pcie.pex_clk);
690 691
691 clk_enable(tegra_pcie.afi_clk); 692 tegra_powergate_power_off(TEGRA_POWERGATE_PCIE);
692 clk_enable(tegra_pcie.pex_clk); 693 tegra_pcie_xclk_clamp(true);
693 return clk_enable(tegra_pcie.pll_e);
694} 694}
695 695
696static void tegra_pcie_power_off(void) 696static int tegra_pcie_power_regate(void)
697{ 697{
698 int err;
699
700 tegra_pcie_power_off();
701
702 tegra_pcie_xclk_clamp(true);
703
698 tegra_periph_reset_assert(tegra_pcie.pcie_xclk); 704 tegra_periph_reset_assert(tegra_pcie.pcie_xclk);
699 tegra_periph_reset_assert(tegra_pcie.afi_clk); 705 tegra_periph_reset_assert(tegra_pcie.afi_clk);
700 tegra_periph_reset_assert(tegra_pcie.pex_clk);
701 706
702 tegra_pcie_xclk_clamp(true); 707 err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_PCIE,
708 tegra_pcie.pex_clk);
709 if (err) {
710 pr_err("PCIE: powerup sequence failed: %d\n", err);
711 return err;
712 }
713
714 tegra_periph_reset_deassert(tegra_pcie.afi_clk);
715
716 tegra_pcie_xclk_clamp(false);
717
718 clk_enable(tegra_pcie.afi_clk);
719 clk_enable(tegra_pcie.pex_clk);
720 return clk_enable(tegra_pcie.pll_e);
703} 721}
704 722
705static int tegra_pcie_clocks_get(void) 723static int tegra_pcie_clocks_get(void)
@@ -759,7 +777,7 @@ static int __init tegra_pcie_get_resources(void)
759 return err; 777 return err;
760 } 778 }
761 779
762 err = tegra_pcie_power_on(); 780 err = tegra_pcie_power_regate();
763 if (err) { 781 if (err) {
764 pr_err("PCIE: failed to power up: %d\n", err); 782 pr_err("PCIE: failed to power up: %d\n", err);
765 goto err_pwr_on; 783 goto err_pwr_on;
diff --git a/arch/arm/mach-tegra/pinmux-t2-tables.c b/arch/arm/mach-tegra/pinmux-t2-tables.c
index a6ea34e782dc..a475367befa3 100644
--- a/arch/arm/mach-tegra/pinmux-t2-tables.c
+++ b/arch/arm/mach-tegra/pinmux-t2-tables.c
@@ -29,6 +29,7 @@
29 29
30#include <mach/iomap.h> 30#include <mach/iomap.h>
31#include <mach/pinmux.h> 31#include <mach/pinmux.h>
32#include <mach/suspend.h>
32 33
33#define DRIVE_PINGROUP(pg_name, r) \ 34#define DRIVE_PINGROUP(pg_name, r) \
34 [TEGRA_DRIVE_PINGROUP_ ## pg_name] = { \ 35 [TEGRA_DRIVE_PINGROUP_ ## pg_name] = { \
@@ -65,6 +66,16 @@ const struct tegra_drive_pingroup_desc tegra_soc_drive_pingroups[TEGRA_MAX_DRIVE
65 DRIVE_PINGROUP(XM2D, 0x8cc), 66 DRIVE_PINGROUP(XM2D, 0x8cc),
66 DRIVE_PINGROUP(XM2CLK, 0x8d0), 67 DRIVE_PINGROUP(XM2CLK, 0x8d0),
67 DRIVE_PINGROUP(MEMCOMP, 0x8d4), 68 DRIVE_PINGROUP(MEMCOMP, 0x8d4),
69 DRIVE_PINGROUP(SDIO1, 0x8e0),
70 DRIVE_PINGROUP(CRT, 0x8ec),
71 DRIVE_PINGROUP(DDC, 0x8f0),
72 DRIVE_PINGROUP(GMA, 0x8f4),
73 DRIVE_PINGROUP(GMB, 0x8f8),
74 DRIVE_PINGROUP(GMC, 0x8fc),
75 DRIVE_PINGROUP(GMD, 0x900),
76 DRIVE_PINGROUP(GME, 0x904),
77 DRIVE_PINGROUP(OWR, 0x908),
78 DRIVE_PINGROUP(UAD, 0x90c),
68}; 79};
69 80
70#define PINGROUP(pg_name, vdd, f0, f1, f2, f3, f_safe, \ 81#define PINGROUP(pg_name, vdd, f0, f1, f2, f3, f_safe, \
@@ -216,7 +227,8 @@ const struct tegra_pingroup_desc tegra_soc_pingroups[TEGRA_MAX_PINGROUP] = {
216#define PULLUPDOWN_REG_NUM 5 227#define PULLUPDOWN_REG_NUM 5
217 228
218static u32 pinmux_reg[TRISTATE_REG_NUM + PIN_MUX_CTL_REG_NUM + 229static u32 pinmux_reg[TRISTATE_REG_NUM + PIN_MUX_CTL_REG_NUM +
219 PULLUPDOWN_REG_NUM]; 230 PULLUPDOWN_REG_NUM +
231 ARRAY_SIZE(tegra_soc_drive_pingroups)];
220 232
221static inline unsigned long pg_readl(unsigned long offset) 233static inline unsigned long pg_readl(unsigned long offset)
222{ 234{
@@ -233,14 +245,17 @@ void tegra_pinmux_suspend(void)
233 unsigned int i; 245 unsigned int i;
234 u32 *ctx = pinmux_reg; 246 u32 *ctx = pinmux_reg;
235 247
236 for (i = 0; i < TRISTATE_REG_NUM; i++)
237 *ctx++ = pg_readl(TRISTATE_REG_A + i*4);
238
239 for (i = 0; i < PIN_MUX_CTL_REG_NUM; i++) 248 for (i = 0; i < PIN_MUX_CTL_REG_NUM; i++)
240 *ctx++ = pg_readl(PIN_MUX_CTL_REG_A + i*4); 249 *ctx++ = pg_readl(PIN_MUX_CTL_REG_A + i*4);
241 250
242 for (i = 0; i < PULLUPDOWN_REG_NUM; i++) 251 for (i = 0; i < PULLUPDOWN_REG_NUM; i++)
243 *ctx++ = pg_readl(PULLUPDOWN_REG_A + i*4); 252 *ctx++ = pg_readl(PULLUPDOWN_REG_A + i*4);
253
254 for (i = 0; i < TRISTATE_REG_NUM; i++)
255 *ctx++ = pg_readl(TRISTATE_REG_A + i*4);
256
257 for (i = 0; i < ARRAY_SIZE(tegra_soc_drive_pingroups); i++)
258 *ctx++ = pg_readl(tegra_soc_drive_pingroups[i].reg);
244} 259}
245 260
246void tegra_pinmux_resume(void) 261void tegra_pinmux_resume(void)
@@ -256,5 +271,8 @@ void tegra_pinmux_resume(void)
256 271
257 for (i = 0; i < TRISTATE_REG_NUM; i++) 272 for (i = 0; i < TRISTATE_REG_NUM; i++)
258 pg_writel(*ctx++, TRISTATE_REG_A + i*4); 273 pg_writel(*ctx++, TRISTATE_REG_A + i*4);
274
275 for (i = 0; i < ARRAY_SIZE(tegra_soc_drive_pingroups); i++)
276 pg_writel(*ctx++, tegra_soc_drive_pingroups[i].reg);
259} 277}
260#endif 278#endif
diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c
new file mode 100644
index 000000000000..3cee9aa1f2c8
--- /dev/null
+++ b/arch/arm/mach-tegra/powergate.c
@@ -0,0 +1,212 @@
1/*
2 * drivers/powergate/tegra-powergate.c
3 *
4 * Copyright (c) 2010 Google, Inc
5 *
6 * Author:
7 * Colin Cross <ccross@google.com>
8 *
9 * This software is licensed under the terms of the GNU General Public
10 * License version 2, as published by the Free Software Foundation, and
11 * may be copied, distributed, and modified under those terms.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 */
19
20#include <linux/kernel.h>
21#include <linux/clk.h>
22#include <linux/debugfs.h>
23#include <linux/delay.h>
24#include <linux/err.h>
25#include <linux/init.h>
26#include <linux/io.h>
27#include <linux/seq_file.h>
28#include <linux/spinlock.h>
29
30#include <mach/clk.h>
31#include <mach/iomap.h>
32#include <mach/powergate.h>
33
34#define PWRGATE_TOGGLE 0x30
35#define PWRGATE_TOGGLE_START (1 << 8)
36
37#define REMOVE_CLAMPING 0x34
38
39#define PWRGATE_STATUS 0x38
40
41static DEFINE_SPINLOCK(tegra_powergate_lock);
42
43static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
44
45static u32 pmc_read(unsigned long reg)
46{
47 return readl(pmc + reg);
48}
49
50static void pmc_write(u32 val, unsigned long reg)
51{
52 writel(val, pmc + reg);
53}
54
55static int tegra_powergate_set(int id, bool new_state)
56{
57 bool status;
58 unsigned long flags;
59
60 spin_lock_irqsave(&tegra_powergate_lock, flags);
61
62 status = pmc_read(PWRGATE_STATUS) & (1 << id);
63
64 if (status == new_state) {
65 spin_unlock_irqrestore(&tegra_powergate_lock, flags);
66 return -EINVAL;
67 }
68
69 pmc_write(PWRGATE_TOGGLE_START | id, PWRGATE_TOGGLE);
70
71 spin_unlock_irqrestore(&tegra_powergate_lock, flags);
72
73 return 0;
74}
75
76int tegra_powergate_power_on(int id)
77{
78 if (id < 0 || id >= TEGRA_NUM_POWERGATE)
79 return -EINVAL;
80
81 return tegra_powergate_set(id, true);
82}
83
84int tegra_powergate_power_off(int id)
85{
86 if (id < 0 || id >= TEGRA_NUM_POWERGATE)
87 return -EINVAL;
88
89 return tegra_powergate_set(id, false);
90}
91
92bool tegra_powergate_is_powered(int id)
93{
94 u32 status;
95
96 if (id < 0 || id >= TEGRA_NUM_POWERGATE)
97 return -EINVAL;
98
99 status = pmc_read(PWRGATE_STATUS) & (1 << id);
100 return !!status;
101}
102
103int tegra_powergate_remove_clamping(int id)
104{
105 u32 mask;
106
107 if (id < 0 || id >= TEGRA_NUM_POWERGATE)
108 return -EINVAL;
109
110 /*
111 * Tegra 2 has a bug where PCIE and VDE clamping masks are
112 * swapped relatively to the partition ids
113 */
114 if (id == TEGRA_POWERGATE_VDEC)
115 mask = (1 << TEGRA_POWERGATE_PCIE);
116 else if (id == TEGRA_POWERGATE_PCIE)
117 mask = (1 << TEGRA_POWERGATE_VDEC);
118 else
119 mask = (1 << id);
120
121 pmc_write(mask, REMOVE_CLAMPING);
122
123 return 0;
124}
125
126/* Must be called with clk disabled, and returns with clk enabled */
127int tegra_powergate_sequence_power_up(int id, struct clk *clk)
128{
129 int ret;
130
131 tegra_periph_reset_assert(clk);
132
133 ret = tegra_powergate_power_on(id);
134 if (ret)
135 goto err_power;
136
137 ret = clk_enable(clk);
138 if (ret)
139 goto err_clk;
140
141 udelay(10);
142
143 ret = tegra_powergate_remove_clamping(id);
144 if (ret)
145 goto err_clamp;
146
147 udelay(10);
148 tegra_periph_reset_deassert(clk);
149
150 return 0;
151
152err_clamp:
153 clk_disable(clk);
154err_clk:
155 tegra_powergate_power_off(id);
156err_power:
157 return ret;
158}
159
160#ifdef CONFIG_DEBUG_FS
161
162static const char * const powergate_name[] = {
163 [TEGRA_POWERGATE_CPU] = "cpu",
164 [TEGRA_POWERGATE_3D] = "3d",
165 [TEGRA_POWERGATE_VENC] = "venc",
166 [TEGRA_POWERGATE_VDEC] = "vdec",
167 [TEGRA_POWERGATE_PCIE] = "pcie",
168 [TEGRA_POWERGATE_L2] = "l2",
169 [TEGRA_POWERGATE_MPE] = "mpe",
170};
171
172static int powergate_show(struct seq_file *s, void *data)
173{
174 int i;
175
176 seq_printf(s, " powergate powered\n");
177 seq_printf(s, "------------------\n");
178
179 for (i = 0; i < TEGRA_NUM_POWERGATE; i++)
180 seq_printf(s, " %9s %7s\n", powergate_name[i],
181 tegra_powergate_is_powered(i) ? "yes" : "no");
182 return 0;
183}
184
185static int powergate_open(struct inode *inode, struct file *file)
186{
187 return single_open(file, powergate_show, inode->i_private);
188}
189
190static const struct file_operations powergate_fops = {
191 .open = powergate_open,
192 .read = seq_read,
193 .llseek = seq_lseek,
194 .release = single_release,
195};
196
197static int __init powergate_debugfs_init(void)
198{
199 struct dentry *d;
200 int err = -ENOMEM;
201
202 d = debugfs_create_file("powergate", S_IRUGO, NULL, NULL,
203 &powergate_fops);
204 if (!d)
205 return -ENOMEM;
206
207 return err;
208}
209
210late_initcall(powergate_debugfs_init);
211
212#endif
diff --git a/arch/arm/mach-tegra/tegra2_clocks.c b/arch/arm/mach-tegra/tegra2_clocks.c
index f0dae6d8ba52..6d7c4eea4dcb 100644
--- a/arch/arm/mach-tegra/tegra2_clocks.c
+++ b/arch/arm/mach-tegra/tegra2_clocks.c
@@ -23,14 +23,15 @@
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <linux/delay.h> 24#include <linux/delay.h>
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/hrtimer.h>
27#include <linux/clkdev.h> 26#include <linux/clkdev.h>
27#include <linux/clk.h>
28 28
29#include <mach/iomap.h> 29#include <mach/iomap.h>
30#include <mach/suspend.h>
30 31
31#include "clock.h" 32#include "clock.h"
32#include "fuse.h" 33#include "fuse.h"
33#include "tegra2_dvfs.h" 34#include "tegra2_emc.h"
34 35
35#define RST_DEVICES 0x004 36#define RST_DEVICES 0x004
36#define RST_DEVICES_SET 0x300 37#define RST_DEVICES_SET 0x300
@@ -51,7 +52,7 @@
51#define OSC_CTRL_OSC_FREQ_19_2MHZ (1<<30) 52#define OSC_CTRL_OSC_FREQ_19_2MHZ (1<<30)
52#define OSC_CTRL_OSC_FREQ_12MHZ (2<<30) 53#define OSC_CTRL_OSC_FREQ_12MHZ (2<<30)
53#define OSC_CTRL_OSC_FREQ_26MHZ (3<<30) 54#define OSC_CTRL_OSC_FREQ_26MHZ (3<<30)
54#define OSC_CTRL_MASK 0x3f2 55#define OSC_CTRL_MASK (0x3f2 | OSC_CTRL_OSC_FREQ_MASK)
55 56
56#define OSC_FREQ_DET 0x58 57#define OSC_FREQ_DET 0x58
57#define OSC_FREQ_DET_TRIG (1<<31) 58#define OSC_FREQ_DET_TRIG (1<<31)
@@ -73,12 +74,15 @@
73#define PERIPH_CLK_SOURCE_DIVU16_MASK 0xFFFF 74#define PERIPH_CLK_SOURCE_DIVU16_MASK 0xFFFF
74#define PERIPH_CLK_SOURCE_DIV_SHIFT 0 75#define PERIPH_CLK_SOURCE_DIV_SHIFT 0
75 76
77#define SDMMC_CLK_INT_FB_SEL (1 << 23)
78#define SDMMC_CLK_INT_FB_DLY_SHIFT 16
79#define SDMMC_CLK_INT_FB_DLY_MASK (0xF << SDMMC_CLK_INT_FB_DLY_SHIFT)
80
76#define PLL_BASE 0x0 81#define PLL_BASE 0x0
77#define PLL_BASE_BYPASS (1<<31) 82#define PLL_BASE_BYPASS (1<<31)
78#define PLL_BASE_ENABLE (1<<30) 83#define PLL_BASE_ENABLE (1<<30)
79#define PLL_BASE_REF_ENABLE (1<<29) 84#define PLL_BASE_REF_ENABLE (1<<29)
80#define PLL_BASE_OVERRIDE (1<<28) 85#define PLL_BASE_OVERRIDE (1<<28)
81#define PLL_BASE_LOCK (1<<27)
82#define PLL_BASE_DIVP_MASK (0x7<<20) 86#define PLL_BASE_DIVP_MASK (0x7<<20)
83#define PLL_BASE_DIVP_SHIFT 20 87#define PLL_BASE_DIVP_SHIFT 20
84#define PLL_BASE_DIVN_MASK (0x3FF<<8) 88#define PLL_BASE_DIVN_MASK (0x3FF<<8)
@@ -93,7 +97,6 @@
93#define PLL_OUT_RESET_DISABLE (1<<0) 97#define PLL_OUT_RESET_DISABLE (1<<0)
94 98
95#define PLL_MISC(c) (((c)->flags & PLL_ALT_MISC_REG) ? 0x4 : 0xc) 99#define PLL_MISC(c) (((c)->flags & PLL_ALT_MISC_REG) ? 0x4 : 0xc)
96#define PLL_MISC_LOCK_ENABLE(c) (((c)->flags & PLLU) ? (1<<22) : (1<<18))
97 100
98#define PLL_MISC_DCCON_SHIFT 20 101#define PLL_MISC_DCCON_SHIFT 20
99#define PLL_MISC_CPCON_SHIFT 8 102#define PLL_MISC_CPCON_SHIFT 8
@@ -111,9 +114,9 @@
111 114
112#define PLLE_MISC_READY (1 << 15) 115#define PLLE_MISC_READY (1 << 15)
113 116
114#define PERIPH_CLK_TO_ENB_REG(c) ((c->clk_num / 32) * 4) 117#define PERIPH_CLK_TO_ENB_REG(c) ((c->u.periph.clk_num / 32) * 4)
115#define PERIPH_CLK_TO_ENB_SET_REG(c) ((c->clk_num / 32) * 8) 118#define PERIPH_CLK_TO_ENB_SET_REG(c) ((c->u.periph.clk_num / 32) * 8)
116#define PERIPH_CLK_TO_ENB_BIT(c) (1 << (c->clk_num % 32)) 119#define PERIPH_CLK_TO_ENB_BIT(c) (1 << (c->u.periph.clk_num % 32))
117 120
118#define SUPER_CLK_MUX 0x00 121#define SUPER_CLK_MUX 0x00
119#define SUPER_STATE_SHIFT 28 122#define SUPER_STATE_SHIFT 28
@@ -134,12 +137,42 @@
134#define BUS_CLK_DISABLE (1<<3) 137#define BUS_CLK_DISABLE (1<<3)
135#define BUS_CLK_DIV_MASK 0x3 138#define BUS_CLK_DIV_MASK 0x3
136 139
140#define PMC_CTRL 0x0
141 #define PMC_CTRL_BLINK_ENB (1 << 7)
142
143#define PMC_DPD_PADS_ORIDE 0x1c
144 #define PMC_DPD_PADS_ORIDE_BLINK_ENB (1 << 20)
145
146#define PMC_BLINK_TIMER_DATA_ON_SHIFT 0
147#define PMC_BLINK_TIMER_DATA_ON_MASK 0x7fff
148#define PMC_BLINK_TIMER_ENB (1 << 15)
149#define PMC_BLINK_TIMER_DATA_OFF_SHIFT 16
150#define PMC_BLINK_TIMER_DATA_OFF_MASK 0xffff
151
137static void __iomem *reg_clk_base = IO_ADDRESS(TEGRA_CLK_RESET_BASE); 152static void __iomem *reg_clk_base = IO_ADDRESS(TEGRA_CLK_RESET_BASE);
153static void __iomem *reg_pmc_base = IO_ADDRESS(TEGRA_PMC_BASE);
154
155/*
156 * Some clocks share a register with other clocks. Any clock op that
157 * non-atomically modifies a register used by another clock must lock
158 * clock_register_lock first.
159 */
160static DEFINE_SPINLOCK(clock_register_lock);
161
162/*
163 * Some peripheral clocks share an enable bit, so refcount the enable bits
164 * in registers CLK_ENABLE_L, CLK_ENABLE_H, and CLK_ENABLE_U
165 */
166static int tegra_periph_clk_enable_refcount[3 * 32];
138 167
139#define clk_writel(value, reg) \ 168#define clk_writel(value, reg) \
140 __raw_writel(value, (u32)reg_clk_base + (reg)) 169 __raw_writel(value, (u32)reg_clk_base + (reg))
141#define clk_readl(reg) \ 170#define clk_readl(reg) \
142 __raw_readl((u32)reg_clk_base + (reg)) 171 __raw_readl((u32)reg_clk_base + (reg))
172#define pmc_writel(value, reg) \
173 __raw_writel(value, (u32)reg_pmc_base + (reg))
174#define pmc_readl(reg) \
175 __raw_readl((u32)reg_pmc_base + (reg))
143 176
144unsigned long clk_measure_input_freq(void) 177unsigned long clk_measure_input_freq(void)
145{ 178{
@@ -245,6 +278,18 @@ static struct clk_ops tegra_clk_m_ops = {
245 .disable = tegra2_clk_m_disable, 278 .disable = tegra2_clk_m_disable,
246}; 279};
247 280
281void tegra2_periph_reset_assert(struct clk *c)
282{
283 BUG_ON(!c->ops->reset);
284 c->ops->reset(c, true);
285}
286
287void tegra2_periph_reset_deassert(struct clk *c)
288{
289 BUG_ON(!c->ops->reset);
290 c->ops->reset(c, false);
291}
292
248/* super clock functions */ 293/* super clock functions */
249/* "super clocks" on tegra have two-stage muxes and a clock skipping 294/* "super clocks" on tegra have two-stage muxes and a clock skipping
250 * super divider. We will ignore the clock skipping divider, since we 295 * super divider. We will ignore the clock skipping divider, since we
@@ -303,12 +348,12 @@ static int tegra2_super_clk_set_parent(struct clk *c, struct clk *p)
303 val |= sel->value << shift; 348 val |= sel->value << shift;
304 349
305 if (c->refcnt) 350 if (c->refcnt)
306 clk_enable_locked(p); 351 clk_enable(p);
307 352
308 clk_writel(val, c->reg); 353 clk_writel(val, c->reg);
309 354
310 if (c->refcnt && c->parent) 355 if (c->refcnt && c->parent)
311 clk_disable_locked(c->parent); 356 clk_disable(c->parent);
312 357
313 clk_reparent(c, p); 358 clk_reparent(c, p);
314 return 0; 359 return 0;
@@ -317,11 +362,24 @@ static int tegra2_super_clk_set_parent(struct clk *c, struct clk *p)
317 return -EINVAL; 362 return -EINVAL;
318} 363}
319 364
365/*
366 * Super clocks have "clock skippers" instead of dividers. Dividing using
367 * a clock skipper does not allow the voltage to be scaled down, so instead
368 * adjust the rate of the parent clock. This requires that the parent of a
369 * super clock have no other children, otherwise the rate will change
370 * underneath the other children.
371 */
372static int tegra2_super_clk_set_rate(struct clk *c, unsigned long rate)
373{
374 return clk_set_rate(c->parent, rate);
375}
376
320static struct clk_ops tegra_super_ops = { 377static struct clk_ops tegra_super_ops = {
321 .init = tegra2_super_clk_init, 378 .init = tegra2_super_clk_init,
322 .enable = tegra2_super_clk_enable, 379 .enable = tegra2_super_clk_enable,
323 .disable = tegra2_super_clk_disable, 380 .disable = tegra2_super_clk_disable,
324 .set_parent = tegra2_super_clk_set_parent, 381 .set_parent = tegra2_super_clk_set_parent,
382 .set_rate = tegra2_super_clk_set_rate,
325}; 383};
326 384
327/* virtual cpu clock functions */ 385/* virtual cpu clock functions */
@@ -351,25 +409,36 @@ static void tegra2_cpu_clk_disable(struct clk *c)
351static int tegra2_cpu_clk_set_rate(struct clk *c, unsigned long rate) 409static int tegra2_cpu_clk_set_rate(struct clk *c, unsigned long rate)
352{ 410{
353 int ret; 411 int ret;
354 ret = clk_set_parent_locked(c->parent, c->backup); 412 /*
413 * Take an extra reference to the main pll so it doesn't turn
414 * off when we move the cpu off of it
415 */
416 clk_enable(c->u.cpu.main);
417
418 ret = clk_set_parent(c->parent, c->u.cpu.backup);
355 if (ret) { 419 if (ret) {
356 pr_err("Failed to switch cpu to clock %s\n", c->backup->name); 420 pr_err("Failed to switch cpu to clock %s\n", c->u.cpu.backup->name);
357 return ret; 421 goto out;
358 } 422 }
359 423
360 ret = clk_set_rate_locked(c->main, rate); 424 if (rate == clk_get_rate(c->u.cpu.backup))
425 goto out;
426
427 ret = clk_set_rate(c->u.cpu.main, rate);
361 if (ret) { 428 if (ret) {
362 pr_err("Failed to change cpu pll to %lu\n", rate); 429 pr_err("Failed to change cpu pll to %lu\n", rate);
363 return ret; 430 goto out;
364 } 431 }
365 432
366 ret = clk_set_parent_locked(c->parent, c->main); 433 ret = clk_set_parent(c->parent, c->u.cpu.main);
367 if (ret) { 434 if (ret) {
368 pr_err("Failed to switch cpu to clock %s\n", c->main->name); 435 pr_err("Failed to switch cpu to clock %s\n", c->u.cpu.main->name);
369 return ret; 436 goto out;
370 } 437 }
371 438
372 return 0; 439out:
440 clk_disable(c->u.cpu.main);
441 return ret;
373} 442}
374 443
375static struct clk_ops tegra_cpu_ops = { 444static struct clk_ops tegra_cpu_ops = {
@@ -379,6 +448,20 @@ static struct clk_ops tegra_cpu_ops = {
379 .set_rate = tegra2_cpu_clk_set_rate, 448 .set_rate = tegra2_cpu_clk_set_rate,
380}; 449};
381 450
451/* virtual cop clock functions. Used to acquire the fake 'cop' clock to
452 * reset the COP block (i.e. AVP) */
453static void tegra2_cop_clk_reset(struct clk *c, bool assert)
454{
455 unsigned long reg = assert ? RST_DEVICES_SET : RST_DEVICES_CLR;
456
457 pr_debug("%s %s\n", __func__, assert ? "assert" : "deassert");
458 clk_writel(1 << 1, reg);
459}
460
461static struct clk_ops tegra_cop_ops = {
462 .reset = tegra2_cop_clk_reset,
463};
464
382/* bus clock functions */ 465/* bus clock functions */
383static void tegra2_bus_clk_init(struct clk *c) 466static void tegra2_bus_clk_init(struct clk *c)
384{ 467{
@@ -390,24 +473,45 @@ static void tegra2_bus_clk_init(struct clk *c)
390 473
391static int tegra2_bus_clk_enable(struct clk *c) 474static int tegra2_bus_clk_enable(struct clk *c)
392{ 475{
393 u32 val = clk_readl(c->reg); 476 u32 val;
477 unsigned long flags;
478
479 spin_lock_irqsave(&clock_register_lock, flags);
480
481 val = clk_readl(c->reg);
394 val &= ~(BUS_CLK_DISABLE << c->reg_shift); 482 val &= ~(BUS_CLK_DISABLE << c->reg_shift);
395 clk_writel(val, c->reg); 483 clk_writel(val, c->reg);
484
485 spin_unlock_irqrestore(&clock_register_lock, flags);
486
396 return 0; 487 return 0;
397} 488}
398 489
399static void tegra2_bus_clk_disable(struct clk *c) 490static void tegra2_bus_clk_disable(struct clk *c)
400{ 491{
401 u32 val = clk_readl(c->reg); 492 u32 val;
493 unsigned long flags;
494
495 spin_lock_irqsave(&clock_register_lock, flags);
496
497 val = clk_readl(c->reg);
402 val |= BUS_CLK_DISABLE << c->reg_shift; 498 val |= BUS_CLK_DISABLE << c->reg_shift;
403 clk_writel(val, c->reg); 499 clk_writel(val, c->reg);
500
501 spin_unlock_irqrestore(&clock_register_lock, flags);
404} 502}
405 503
406static int tegra2_bus_clk_set_rate(struct clk *c, unsigned long rate) 504static int tegra2_bus_clk_set_rate(struct clk *c, unsigned long rate)
407{ 505{
408 u32 val = clk_readl(c->reg); 506 u32 val;
409 unsigned long parent_rate = c->parent->rate; 507 unsigned long parent_rate = clk_get_rate(c->parent);
508 unsigned long flags;
509 int ret = -EINVAL;
410 int i; 510 int i;
511
512 spin_lock_irqsave(&clock_register_lock, flags);
513
514 val = clk_readl(c->reg);
411 for (i = 1; i <= 4; i++) { 515 for (i = 1; i <= 4; i++) {
412 if (rate == parent_rate / i) { 516 if (rate == parent_rate / i) {
413 val &= ~(BUS_CLK_DIV_MASK << c->reg_shift); 517 val &= ~(BUS_CLK_DIV_MASK << c->reg_shift);
@@ -415,10 +519,14 @@ static int tegra2_bus_clk_set_rate(struct clk *c, unsigned long rate)
415 clk_writel(val, c->reg); 519 clk_writel(val, c->reg);
416 c->div = i; 520 c->div = i;
417 c->mul = 1; 521 c->mul = 1;
418 return 0; 522 ret = 0;
523 break;
419 } 524 }
420 } 525 }
421 return -EINVAL; 526
527 spin_unlock_irqrestore(&clock_register_lock, flags);
528
529 return ret;
422} 530}
423 531
424static struct clk_ops tegra_bus_ops = { 532static struct clk_ops tegra_bus_ops = {
@@ -428,24 +536,96 @@ static struct clk_ops tegra_bus_ops = {
428 .set_rate = tegra2_bus_clk_set_rate, 536 .set_rate = tegra2_bus_clk_set_rate,
429}; 537};
430 538
431/* PLL Functions */ 539/* Blink output functions */
432static int tegra2_pll_clk_wait_for_lock(struct clk *c) 540
541static void tegra2_blink_clk_init(struct clk *c)
433{ 542{
434 ktime_t before; 543 u32 val;
435 544
436 before = ktime_get(); 545 val = pmc_readl(PMC_CTRL);
546 c->state = (val & PMC_CTRL_BLINK_ENB) ? ON : OFF;
547 c->mul = 1;
548 val = pmc_readl(c->reg);
549
550 if (val & PMC_BLINK_TIMER_ENB) {
551 unsigned int on_off;
552
553 on_off = (val >> PMC_BLINK_TIMER_DATA_ON_SHIFT) &
554 PMC_BLINK_TIMER_DATA_ON_MASK;
555 val >>= PMC_BLINK_TIMER_DATA_OFF_SHIFT;
556 val &= PMC_BLINK_TIMER_DATA_OFF_MASK;
557 on_off += val;
558 /* each tick in the blink timer is 4 32KHz clocks */
559 c->div = on_off * 4;
560 } else {
561 c->div = 1;
562 }
563}
437 564
438 while (!(clk_readl(c->reg + PLL_BASE) & PLL_BASE_LOCK)) { 565static int tegra2_blink_clk_enable(struct clk *c)
439 if (ktime_us_delta(ktime_get(), before) > 5000) { 566{
440 pr_err("Timed out waiting for lock bit on pll %s", 567 u32 val;
441 c->name); 568
442 return -1; 569 val = pmc_readl(PMC_DPD_PADS_ORIDE);
443 } 570 pmc_writel(val | PMC_DPD_PADS_ORIDE_BLINK_ENB, PMC_DPD_PADS_ORIDE);
571
572 val = pmc_readl(PMC_CTRL);
573 pmc_writel(val | PMC_CTRL_BLINK_ENB, PMC_CTRL);
574
575 return 0;
576}
577
578static void tegra2_blink_clk_disable(struct clk *c)
579{
580 u32 val;
581
582 val = pmc_readl(PMC_CTRL);
583 pmc_writel(val & ~PMC_CTRL_BLINK_ENB, PMC_CTRL);
584
585 val = pmc_readl(PMC_DPD_PADS_ORIDE);
586 pmc_writel(val & ~PMC_DPD_PADS_ORIDE_BLINK_ENB, PMC_DPD_PADS_ORIDE);
587}
588
589static int tegra2_blink_clk_set_rate(struct clk *c, unsigned long rate)
590{
591 unsigned long parent_rate = clk_get_rate(c->parent);
592 if (rate >= parent_rate) {
593 c->div = 1;
594 pmc_writel(0, c->reg);
595 } else {
596 unsigned int on_off;
597 u32 val;
598
599 on_off = DIV_ROUND_UP(parent_rate / 8, rate);
600 c->div = on_off * 8;
601
602 val = (on_off & PMC_BLINK_TIMER_DATA_ON_MASK) <<
603 PMC_BLINK_TIMER_DATA_ON_SHIFT;
604 on_off &= PMC_BLINK_TIMER_DATA_OFF_MASK;
605 on_off <<= PMC_BLINK_TIMER_DATA_OFF_SHIFT;
606 val |= on_off;
607 val |= PMC_BLINK_TIMER_ENB;
608 pmc_writel(val, c->reg);
444 } 609 }
445 610
446 return 0; 611 return 0;
447} 612}
448 613
614static struct clk_ops tegra_blink_clk_ops = {
615 .init = &tegra2_blink_clk_init,
616 .enable = &tegra2_blink_clk_enable,
617 .disable = &tegra2_blink_clk_disable,
618 .set_rate = &tegra2_blink_clk_set_rate,
619};
620
621/* PLL Functions */
622static int tegra2_pll_clk_wait_for_lock(struct clk *c)
623{
624 udelay(c->u.pll.lock_delay);
625
626 return 0;
627}
628
449static void tegra2_pll_clk_init(struct clk *c) 629static void tegra2_pll_clk_init(struct clk *c)
450{ 630{
451 u32 val = clk_readl(c->reg + PLL_BASE); 631 u32 val = clk_readl(c->reg + PLL_BASE);
@@ -479,10 +659,6 @@ static int tegra2_pll_clk_enable(struct clk *c)
479 val |= PLL_BASE_ENABLE; 659 val |= PLL_BASE_ENABLE;
480 clk_writel(val, c->reg + PLL_BASE); 660 clk_writel(val, c->reg + PLL_BASE);
481 661
482 val = clk_readl(c->reg + PLL_MISC(c));
483 val |= PLL_MISC_LOCK_ENABLE(c);
484 clk_writel(val, c->reg + PLL_MISC(c));
485
486 tegra2_pll_clk_wait_for_lock(c); 662 tegra2_pll_clk_wait_for_lock(c);
487 663
488 return 0; 664 return 0;
@@ -502,13 +678,12 @@ static int tegra2_pll_clk_set_rate(struct clk *c, unsigned long rate)
502{ 678{
503 u32 val; 679 u32 val;
504 unsigned long input_rate; 680 unsigned long input_rate;
505 const struct clk_pll_table *sel; 681 const struct clk_pll_freq_table *sel;
506 682
507 pr_debug("%s: %s %lu\n", __func__, c->name, rate); 683 pr_debug("%s: %s %lu\n", __func__, c->name, rate);
508 BUG_ON(c->refcnt != 0);
509 684
510 input_rate = c->parent->rate; 685 input_rate = clk_get_rate(c->parent);
511 for (sel = c->pll_table; sel->input_rate != 0; sel++) { 686 for (sel = c->u.pll.freq_table; sel->input_rate != 0; sel++) {
512 if (sel->input_rate == input_rate && sel->output_rate == rate) { 687 if (sel->input_rate == input_rate && sel->output_rate == rate) {
513 c->mul = sel->n; 688 c->mul = sel->n;
514 c->div = sel->m * sel->p; 689 c->div = sel->m * sel->p;
@@ -620,9 +795,11 @@ static int tegra2_pll_div_clk_enable(struct clk *c)
620{ 795{
621 u32 val; 796 u32 val;
622 u32 new_val; 797 u32 new_val;
798 unsigned long flags;
623 799
624 pr_debug("%s: %s\n", __func__, c->name); 800 pr_debug("%s: %s\n", __func__, c->name);
625 if (c->flags & DIV_U71) { 801 if (c->flags & DIV_U71) {
802 spin_lock_irqsave(&clock_register_lock, flags);
626 val = clk_readl(c->reg); 803 val = clk_readl(c->reg);
627 new_val = val >> c->reg_shift; 804 new_val = val >> c->reg_shift;
628 new_val &= 0xFFFF; 805 new_val &= 0xFFFF;
@@ -632,12 +809,15 @@ static int tegra2_pll_div_clk_enable(struct clk *c)
632 val &= ~(0xFFFF << c->reg_shift); 809 val &= ~(0xFFFF << c->reg_shift);
633 val |= new_val << c->reg_shift; 810 val |= new_val << c->reg_shift;
634 clk_writel(val, c->reg); 811 clk_writel(val, c->reg);
812 spin_unlock_irqrestore(&clock_register_lock, flags);
635 return 0; 813 return 0;
636 } else if (c->flags & DIV_2) { 814 } else if (c->flags & DIV_2) {
637 BUG_ON(!(c->flags & PLLD)); 815 BUG_ON(!(c->flags & PLLD));
816 spin_lock_irqsave(&clock_register_lock, flags);
638 val = clk_readl(c->reg); 817 val = clk_readl(c->reg);
639 val &= ~PLLD_MISC_DIV_RST; 818 val &= ~PLLD_MISC_DIV_RST;
640 clk_writel(val, c->reg); 819 clk_writel(val, c->reg);
820 spin_unlock_irqrestore(&clock_register_lock, flags);
641 return 0; 821 return 0;
642 } 822 }
643 return -EINVAL; 823 return -EINVAL;
@@ -647,9 +827,11 @@ static void tegra2_pll_div_clk_disable(struct clk *c)
647{ 827{
648 u32 val; 828 u32 val;
649 u32 new_val; 829 u32 new_val;
830 unsigned long flags;
650 831
651 pr_debug("%s: %s\n", __func__, c->name); 832 pr_debug("%s: %s\n", __func__, c->name);
652 if (c->flags & DIV_U71) { 833 if (c->flags & DIV_U71) {
834 spin_lock_irqsave(&clock_register_lock, flags);
653 val = clk_readl(c->reg); 835 val = clk_readl(c->reg);
654 new_val = val >> c->reg_shift; 836 new_val = val >> c->reg_shift;
655 new_val &= 0xFFFF; 837 new_val &= 0xFFFF;
@@ -659,11 +841,14 @@ static void tegra2_pll_div_clk_disable(struct clk *c)
659 val &= ~(0xFFFF << c->reg_shift); 841 val &= ~(0xFFFF << c->reg_shift);
660 val |= new_val << c->reg_shift; 842 val |= new_val << c->reg_shift;
661 clk_writel(val, c->reg); 843 clk_writel(val, c->reg);
844 spin_unlock_irqrestore(&clock_register_lock, flags);
662 } else if (c->flags & DIV_2) { 845 } else if (c->flags & DIV_2) {
663 BUG_ON(!(c->flags & PLLD)); 846 BUG_ON(!(c->flags & PLLD));
847 spin_lock_irqsave(&clock_register_lock, flags);
664 val = clk_readl(c->reg); 848 val = clk_readl(c->reg);
665 val |= PLLD_MISC_DIV_RST; 849 val |= PLLD_MISC_DIV_RST;
666 clk_writel(val, c->reg); 850 clk_writel(val, c->reg);
851 spin_unlock_irqrestore(&clock_register_lock, flags);
667 } 852 }
668} 853}
669 854
@@ -672,10 +857,14 @@ static int tegra2_pll_div_clk_set_rate(struct clk *c, unsigned long rate)
672 u32 val; 857 u32 val;
673 u32 new_val; 858 u32 new_val;
674 int divider_u71; 859 int divider_u71;
860 unsigned long parent_rate = clk_get_rate(c->parent);
861 unsigned long flags;
862
675 pr_debug("%s: %s %lu\n", __func__, c->name, rate); 863 pr_debug("%s: %s %lu\n", __func__, c->name, rate);
676 if (c->flags & DIV_U71) { 864 if (c->flags & DIV_U71) {
677 divider_u71 = clk_div71_get_divider(c->parent->rate, rate); 865 divider_u71 = clk_div71_get_divider(parent_rate, rate);
678 if (divider_u71 >= 0) { 866 if (divider_u71 >= 0) {
867 spin_lock_irqsave(&clock_register_lock, flags);
679 val = clk_readl(c->reg); 868 val = clk_readl(c->reg);
680 new_val = val >> c->reg_shift; 869 new_val = val >> c->reg_shift;
681 new_val &= 0xFFFF; 870 new_val &= 0xFFFF;
@@ -689,10 +878,11 @@ static int tegra2_pll_div_clk_set_rate(struct clk *c, unsigned long rate)
689 clk_writel(val, c->reg); 878 clk_writel(val, c->reg);
690 c->div = divider_u71 + 2; 879 c->div = divider_u71 + 2;
691 c->mul = 2; 880 c->mul = 2;
881 spin_unlock_irqrestore(&clock_register_lock, flags);
692 return 0; 882 return 0;
693 } 883 }
694 } else if (c->flags & DIV_2) { 884 } else if (c->flags & DIV_2) {
695 if (c->parent->rate == rate * 2) 885 if (parent_rate == rate * 2)
696 return 0; 886 return 0;
697 } 887 }
698 return -EINVAL; 888 return -EINVAL;
@@ -701,15 +891,16 @@ static int tegra2_pll_div_clk_set_rate(struct clk *c, unsigned long rate)
701static long tegra2_pll_div_clk_round_rate(struct clk *c, unsigned long rate) 891static long tegra2_pll_div_clk_round_rate(struct clk *c, unsigned long rate)
702{ 892{
703 int divider; 893 int divider;
894 unsigned long parent_rate = clk_get_rate(c->parent);
704 pr_debug("%s: %s %lu\n", __func__, c->name, rate); 895 pr_debug("%s: %s %lu\n", __func__, c->name, rate);
705 896
706 if (c->flags & DIV_U71) { 897 if (c->flags & DIV_U71) {
707 divider = clk_div71_get_divider(c->parent->rate, rate); 898 divider = clk_div71_get_divider(parent_rate, rate);
708 if (divider < 0) 899 if (divider < 0)
709 return divider; 900 return divider;
710 return c->parent->rate * 2 / (divider + 2); 901 return DIV_ROUND_UP(parent_rate * 2, divider + 2);
711 } else if (c->flags & DIV_2) { 902 } else if (c->flags & DIV_2) {
712 return c->parent->rate / 2; 903 return DIV_ROUND_UP(parent_rate, 2);
713 } 904 }
714 return -EINVAL; 905 return -EINVAL;
715} 906}
@@ -755,9 +946,14 @@ static void tegra2_periph_clk_init(struct clk *c)
755 } 946 }
756 947
757 c->state = ON; 948 c->state = ON;
949
950 if (!c->u.periph.clk_num)
951 return;
952
758 if (!(clk_readl(CLK_OUT_ENB + PERIPH_CLK_TO_ENB_REG(c)) & 953 if (!(clk_readl(CLK_OUT_ENB + PERIPH_CLK_TO_ENB_REG(c)) &
759 PERIPH_CLK_TO_ENB_BIT(c))) 954 PERIPH_CLK_TO_ENB_BIT(c)))
760 c->state = OFF; 955 c->state = OFF;
956
761 if (!(c->flags & PERIPH_NO_RESET)) 957 if (!(c->flags & PERIPH_NO_RESET))
762 if (clk_readl(RST_DEVICES + PERIPH_CLK_TO_ENB_REG(c)) & 958 if (clk_readl(RST_DEVICES + PERIPH_CLK_TO_ENB_REG(c)) &
763 PERIPH_CLK_TO_ENB_BIT(c)) 959 PERIPH_CLK_TO_ENB_BIT(c))
@@ -767,8 +963,20 @@ static void tegra2_periph_clk_init(struct clk *c)
767static int tegra2_periph_clk_enable(struct clk *c) 963static int tegra2_periph_clk_enable(struct clk *c)
768{ 964{
769 u32 val; 965 u32 val;
966 unsigned long flags;
967 int refcount;
770 pr_debug("%s on clock %s\n", __func__, c->name); 968 pr_debug("%s on clock %s\n", __func__, c->name);
771 969
970 if (!c->u.periph.clk_num)
971 return 0;
972
973 spin_lock_irqsave(&clock_register_lock, flags);
974
975 refcount = tegra_periph_clk_enable_refcount[c->u.periph.clk_num]++;
976
977 if (refcount > 1)
978 goto out;
979
772 clk_writel(PERIPH_CLK_TO_ENB_BIT(c), 980 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
773 CLK_OUT_ENB_SET + PERIPH_CLK_TO_ENB_SET_REG(c)); 981 CLK_OUT_ENB_SET + PERIPH_CLK_TO_ENB_SET_REG(c));
774 if (!(c->flags & PERIPH_NO_RESET) && !(c->flags & PERIPH_MANUAL_RESET)) 982 if (!(c->flags & PERIPH_NO_RESET) && !(c->flags & PERIPH_MANUAL_RESET))
@@ -781,34 +989,48 @@ static int tegra2_periph_clk_enable(struct clk *c)
781 val |= 0x3 << 24; 989 val |= 0x3 << 24;
782 clk_writel(val, c->reg); 990 clk_writel(val, c->reg);
783 } 991 }
992
993out:
994 spin_unlock_irqrestore(&clock_register_lock, flags);
995
784 return 0; 996 return 0;
785} 997}
786 998
787static void tegra2_periph_clk_disable(struct clk *c) 999static void tegra2_periph_clk_disable(struct clk *c)
788{ 1000{
1001 unsigned long flags;
1002
789 pr_debug("%s on clock %s\n", __func__, c->name); 1003 pr_debug("%s on clock %s\n", __func__, c->name);
790 1004
791 clk_writel(PERIPH_CLK_TO_ENB_BIT(c), 1005 if (!c->u.periph.clk_num)
792 CLK_OUT_ENB_CLR + PERIPH_CLK_TO_ENB_SET_REG(c)); 1006 return;
793}
794 1007
795void tegra2_periph_reset_deassert(struct clk *c) 1008 spin_lock_irqsave(&clock_register_lock, flags);
796{ 1009
797 pr_debug("%s on clock %s\n", __func__, c->name); 1010 if (c->refcnt)
798 if (!(c->flags & PERIPH_NO_RESET)) 1011 tegra_periph_clk_enable_refcount[c->u.periph.clk_num]--;
1012
1013 if (tegra_periph_clk_enable_refcount[c->u.periph.clk_num] == 0)
799 clk_writel(PERIPH_CLK_TO_ENB_BIT(c), 1014 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
800 RST_DEVICES_CLR + PERIPH_CLK_TO_ENB_SET_REG(c)); 1015 CLK_OUT_ENB_CLR + PERIPH_CLK_TO_ENB_SET_REG(c));
1016
1017 spin_unlock_irqrestore(&clock_register_lock, flags);
801} 1018}
802 1019
803void tegra2_periph_reset_assert(struct clk *c) 1020static void tegra2_periph_clk_reset(struct clk *c, bool assert)
804{ 1021{
805 pr_debug("%s on clock %s\n", __func__, c->name); 1022 unsigned long base = assert ? RST_DEVICES_SET : RST_DEVICES_CLR;
1023
1024 pr_debug("%s %s on clock %s\n", __func__,
1025 assert ? "assert" : "deassert", c->name);
1026
1027 BUG_ON(!c->u.periph.clk_num);
1028
806 if (!(c->flags & PERIPH_NO_RESET)) 1029 if (!(c->flags & PERIPH_NO_RESET))
807 clk_writel(PERIPH_CLK_TO_ENB_BIT(c), 1030 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
808 RST_DEVICES_SET + PERIPH_CLK_TO_ENB_SET_REG(c)); 1031 base + PERIPH_CLK_TO_ENB_SET_REG(c));
809} 1032}
810 1033
811
812static int tegra2_periph_clk_set_parent(struct clk *c, struct clk *p) 1034static int tegra2_periph_clk_set_parent(struct clk *c, struct clk *p)
813{ 1035{
814 u32 val; 1036 u32 val;
@@ -821,12 +1043,12 @@ static int tegra2_periph_clk_set_parent(struct clk *c, struct clk *p)
821 val |= (sel->value) << PERIPH_CLK_SOURCE_SHIFT; 1043 val |= (sel->value) << PERIPH_CLK_SOURCE_SHIFT;
822 1044
823 if (c->refcnt) 1045 if (c->refcnt)
824 clk_enable_locked(p); 1046 clk_enable(p);
825 1047
826 clk_writel(val, c->reg); 1048 clk_writel(val, c->reg);
827 1049
828 if (c->refcnt && c->parent) 1050 if (c->refcnt && c->parent)
829 clk_disable_locked(c->parent); 1051 clk_disable(c->parent);
830 1052
831 clk_reparent(c, p); 1053 clk_reparent(c, p);
832 return 0; 1054 return 0;
@@ -840,9 +1062,10 @@ static int tegra2_periph_clk_set_rate(struct clk *c, unsigned long rate)
840{ 1062{
841 u32 val; 1063 u32 val;
842 int divider; 1064 int divider;
843 pr_debug("%s: %lu\n", __func__, rate); 1065 unsigned long parent_rate = clk_get_rate(c->parent);
1066
844 if (c->flags & DIV_U71) { 1067 if (c->flags & DIV_U71) {
845 divider = clk_div71_get_divider(c->parent->rate, rate); 1068 divider = clk_div71_get_divider(parent_rate, rate);
846 if (divider >= 0) { 1069 if (divider >= 0) {
847 val = clk_readl(c->reg); 1070 val = clk_readl(c->reg);
848 val &= ~PERIPH_CLK_SOURCE_DIVU71_MASK; 1071 val &= ~PERIPH_CLK_SOURCE_DIVU71_MASK;
@@ -853,7 +1076,7 @@ static int tegra2_periph_clk_set_rate(struct clk *c, unsigned long rate)
853 return 0; 1076 return 0;
854 } 1077 }
855 } else if (c->flags & DIV_U16) { 1078 } else if (c->flags & DIV_U16) {
856 divider = clk_div16_get_divider(c->parent->rate, rate); 1079 divider = clk_div16_get_divider(parent_rate, rate);
857 if (divider >= 0) { 1080 if (divider >= 0) {
858 val = clk_readl(c->reg); 1081 val = clk_readl(c->reg);
859 val &= ~PERIPH_CLK_SOURCE_DIVU16_MASK; 1082 val &= ~PERIPH_CLK_SOURCE_DIVU16_MASK;
@@ -863,7 +1086,7 @@ static int tegra2_periph_clk_set_rate(struct clk *c, unsigned long rate)
863 c->mul = 1; 1086 c->mul = 1;
864 return 0; 1087 return 0;
865 } 1088 }
866 } else if (c->parent->rate <= rate) { 1089 } else if (parent_rate <= rate) {
867 c->div = 1; 1090 c->div = 1;
868 c->mul = 1; 1091 c->mul = 1;
869 return 0; 1092 return 0;
@@ -875,19 +1098,20 @@ static long tegra2_periph_clk_round_rate(struct clk *c,
875 unsigned long rate) 1098 unsigned long rate)
876{ 1099{
877 int divider; 1100 int divider;
1101 unsigned long parent_rate = clk_get_rate(c->parent);
878 pr_debug("%s: %s %lu\n", __func__, c->name, rate); 1102 pr_debug("%s: %s %lu\n", __func__, c->name, rate);
879 1103
880 if (c->flags & DIV_U71) { 1104 if (c->flags & DIV_U71) {
881 divider = clk_div71_get_divider(c->parent->rate, rate); 1105 divider = clk_div71_get_divider(parent_rate, rate);
882 if (divider < 0) 1106 if (divider < 0)
883 return divider; 1107 return divider;
884 1108
885 return c->parent->rate * 2 / (divider + 2); 1109 return DIV_ROUND_UP(parent_rate * 2, divider + 2);
886 } else if (c->flags & DIV_U16) { 1110 } else if (c->flags & DIV_U16) {
887 divider = clk_div16_get_divider(c->parent->rate, rate); 1111 divider = clk_div16_get_divider(parent_rate, rate);
888 if (divider < 0) 1112 if (divider < 0)
889 return divider; 1113 return divider;
890 return c->parent->rate / (divider + 1); 1114 return DIV_ROUND_UP(parent_rate, divider + 1);
891 } 1115 }
892 return -EINVAL; 1116 return -EINVAL;
893} 1117}
@@ -899,6 +1123,71 @@ static struct clk_ops tegra_periph_clk_ops = {
899 .set_parent = &tegra2_periph_clk_set_parent, 1123 .set_parent = &tegra2_periph_clk_set_parent,
900 .set_rate = &tegra2_periph_clk_set_rate, 1124 .set_rate = &tegra2_periph_clk_set_rate,
901 .round_rate = &tegra2_periph_clk_round_rate, 1125 .round_rate = &tegra2_periph_clk_round_rate,
1126 .reset = &tegra2_periph_clk_reset,
1127};
1128
1129/* The SDMMC controllers have extra bits in the clock source register that
1130 * adjust the delay between the clock and data to compenstate for delays
1131 * on the PCB. */
1132void tegra2_sdmmc_tap_delay(struct clk *c, int delay)
1133{
1134 u32 reg;
1135
1136 delay = clamp(delay, 0, 15);
1137 reg = clk_readl(c->reg);
1138 reg &= ~SDMMC_CLK_INT_FB_DLY_MASK;
1139 reg |= SDMMC_CLK_INT_FB_SEL;
1140 reg |= delay << SDMMC_CLK_INT_FB_DLY_SHIFT;
1141 clk_writel(reg, c->reg);
1142}
1143
1144/* External memory controller clock ops */
1145static void tegra2_emc_clk_init(struct clk *c)
1146{
1147 tegra2_periph_clk_init(c);
1148 c->max_rate = clk_get_rate_locked(c);
1149}
1150
1151static long tegra2_emc_clk_round_rate(struct clk *c, unsigned long rate)
1152{
1153 long new_rate = rate;
1154
1155 new_rate = tegra_emc_round_rate(new_rate);
1156 if (new_rate < 0)
1157 return c->max_rate;
1158
1159 BUG_ON(new_rate != tegra2_periph_clk_round_rate(c, new_rate));
1160
1161 return new_rate;
1162}
1163
1164static int tegra2_emc_clk_set_rate(struct clk *c, unsigned long rate)
1165{
1166 int ret;
1167 /*
1168 * The Tegra2 memory controller has an interlock with the clock
1169 * block that allows memory shadowed registers to be updated,
1170 * and then transfer them to the main registers at the same
1171 * time as the clock update without glitches.
1172 */
1173 ret = tegra_emc_set_rate(rate);
1174 if (ret < 0)
1175 return ret;
1176
1177 ret = tegra2_periph_clk_set_rate(c, rate);
1178 udelay(1);
1179
1180 return ret;
1181}
1182
1183static struct clk_ops tegra_emc_clk_ops = {
1184 .init = &tegra2_emc_clk_init,
1185 .enable = &tegra2_periph_clk_enable,
1186 .disable = &tegra2_periph_clk_disable,
1187 .set_parent = &tegra2_periph_clk_set_parent,
1188 .set_rate = &tegra2_emc_clk_set_rate,
1189 .round_rate = &tegra2_emc_clk_round_rate,
1190 .reset = &tegra2_periph_clk_reset,
902}; 1191};
903 1192
904/* Clock doubler ops */ 1193/* Clock doubler ops */
@@ -907,6 +1196,10 @@ static void tegra2_clk_double_init(struct clk *c)
907 c->mul = 2; 1196 c->mul = 2;
908 c->div = 1; 1197 c->div = 1;
909 c->state = ON; 1198 c->state = ON;
1199
1200 if (!c->u.periph.clk_num)
1201 return;
1202
910 if (!(clk_readl(CLK_OUT_ENB + PERIPH_CLK_TO_ENB_REG(c)) & 1203 if (!(clk_readl(CLK_OUT_ENB + PERIPH_CLK_TO_ENB_REG(c)) &
911 PERIPH_CLK_TO_ENB_BIT(c))) 1204 PERIPH_CLK_TO_ENB_BIT(c)))
912 c->state = OFF; 1205 c->state = OFF;
@@ -914,7 +1207,7 @@ static void tegra2_clk_double_init(struct clk *c)
914 1207
915static int tegra2_clk_double_set_rate(struct clk *c, unsigned long rate) 1208static int tegra2_clk_double_set_rate(struct clk *c, unsigned long rate)
916{ 1209{
917 if (rate != 2 * c->parent->rate) 1210 if (rate != 2 * clk_get_rate(c->parent))
918 return -EINVAL; 1211 return -EINVAL;
919 c->mul = 2; 1212 c->mul = 2;
920 c->div = 1; 1213 c->div = 1;
@@ -928,6 +1221,7 @@ static struct clk_ops tegra_clk_double_ops = {
928 .set_rate = &tegra2_clk_double_set_rate, 1221 .set_rate = &tegra2_clk_double_set_rate,
929}; 1222};
930 1223
1224/* Audio sync clock ops */
931static void tegra2_audio_sync_clk_init(struct clk *c) 1225static void tegra2_audio_sync_clk_init(struct clk *c)
932{ 1226{
933 int source; 1227 int source;
@@ -964,12 +1258,12 @@ static int tegra2_audio_sync_clk_set_parent(struct clk *c, struct clk *p)
964 val |= sel->value; 1258 val |= sel->value;
965 1259
966 if (c->refcnt) 1260 if (c->refcnt)
967 clk_enable_locked(p); 1261 clk_enable(p);
968 1262
969 clk_writel(val, c->reg); 1263 clk_writel(val, c->reg);
970 1264
971 if (c->refcnt && c->parent) 1265 if (c->refcnt && c->parent)
972 clk_disable_locked(c->parent); 1266 clk_disable(c->parent);
973 1267
974 clk_reparent(c, p); 1268 clk_reparent(c, p);
975 return 0; 1269 return 0;
@@ -979,33 +1273,153 @@ static int tegra2_audio_sync_clk_set_parent(struct clk *c, struct clk *p)
979 return -EINVAL; 1273 return -EINVAL;
980} 1274}
981 1275
982static int tegra2_audio_sync_clk_set_rate(struct clk *c, unsigned long rate)
983{
984 unsigned long parent_rate;
985 if (!c->parent) {
986 pr_err("%s: clock has no parent\n", __func__);
987 return -EINVAL;
988 }
989 parent_rate = c->parent->rate;
990 if (rate != parent_rate) {
991 pr_err("%s: %s/%ld differs from parent %s/%ld\n",
992 __func__,
993 c->name, rate,
994 c->parent->name, parent_rate);
995 return -EINVAL;
996 }
997 c->rate = parent_rate;
998 return 0;
999}
1000
1001static struct clk_ops tegra_audio_sync_clk_ops = { 1276static struct clk_ops tegra_audio_sync_clk_ops = {
1002 .init = tegra2_audio_sync_clk_init, 1277 .init = tegra2_audio_sync_clk_init,
1003 .enable = tegra2_audio_sync_clk_enable, 1278 .enable = tegra2_audio_sync_clk_enable,
1004 .disable = tegra2_audio_sync_clk_disable, 1279 .disable = tegra2_audio_sync_clk_disable,
1005 .set_rate = tegra2_audio_sync_clk_set_rate,
1006 .set_parent = tegra2_audio_sync_clk_set_parent, 1280 .set_parent = tegra2_audio_sync_clk_set_parent,
1007}; 1281};
1008 1282
1283/* cdev1 and cdev2 (dap_mclk1 and dap_mclk2) ops */
1284
1285static void tegra2_cdev_clk_init(struct clk *c)
1286{
1287 /* We could un-tristate the cdev1 or cdev2 pingroup here; this is
1288 * currently done in the pinmux code. */
1289 c->state = ON;
1290
1291 BUG_ON(!c->u.periph.clk_num);
1292
1293 if (!(clk_readl(CLK_OUT_ENB + PERIPH_CLK_TO_ENB_REG(c)) &
1294 PERIPH_CLK_TO_ENB_BIT(c)))
1295 c->state = OFF;
1296}
1297
1298static int tegra2_cdev_clk_enable(struct clk *c)
1299{
1300 BUG_ON(!c->u.periph.clk_num);
1301
1302 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1303 CLK_OUT_ENB_SET + PERIPH_CLK_TO_ENB_SET_REG(c));
1304 return 0;
1305}
1306
1307static void tegra2_cdev_clk_disable(struct clk *c)
1308{
1309 BUG_ON(!c->u.periph.clk_num);
1310
1311 clk_writel(PERIPH_CLK_TO_ENB_BIT(c),
1312 CLK_OUT_ENB_CLR + PERIPH_CLK_TO_ENB_SET_REG(c));
1313}
1314
1315static struct clk_ops tegra_cdev_clk_ops = {
1316 .init = &tegra2_cdev_clk_init,
1317 .enable = &tegra2_cdev_clk_enable,
1318 .disable = &tegra2_cdev_clk_disable,
1319};
1320
1321/* shared bus ops */
1322/*
1323 * Some clocks may have multiple downstream users that need to request a
1324 * higher clock rate. Shared bus clocks provide a unique shared_bus_user
1325 * clock to each user. The frequency of the bus is set to the highest
1326 * enabled shared_bus_user clock, with a minimum value set by the
1327 * shared bus.
1328 */
1329static int tegra_clk_shared_bus_update(struct clk *bus)
1330{
1331 struct clk *c;
1332 unsigned long rate = bus->min_rate;
1333
1334 list_for_each_entry(c, &bus->shared_bus_list, u.shared_bus_user.node)
1335 if (c->u.shared_bus_user.enabled)
1336 rate = max(c->u.shared_bus_user.rate, rate);
1337
1338 if (rate == clk_get_rate_locked(bus))
1339 return 0;
1340
1341 return clk_set_rate_locked(bus, rate);
1342};
1343
1344static void tegra_clk_shared_bus_init(struct clk *c)
1345{
1346 unsigned long flags;
1347
1348 c->max_rate = c->parent->max_rate;
1349 c->u.shared_bus_user.rate = c->parent->max_rate;
1350 c->state = OFF;
1351 c->set = true;
1352
1353 spin_lock_irqsave(&c->parent->spinlock, flags);
1354
1355 list_add_tail(&c->u.shared_bus_user.node,
1356 &c->parent->shared_bus_list);
1357
1358 spin_unlock_irqrestore(&c->parent->spinlock, flags);
1359}
1360
1361static int tegra_clk_shared_bus_set_rate(struct clk *c, unsigned long rate)
1362{
1363 unsigned long flags;
1364 int ret;
1365
1366 rate = clk_round_rate(c->parent, rate);
1367 if (rate < 0)
1368 return rate;
1369
1370 spin_lock_irqsave(&c->parent->spinlock, flags);
1371
1372 c->u.shared_bus_user.rate = rate;
1373 ret = tegra_clk_shared_bus_update(c->parent);
1374
1375 spin_unlock_irqrestore(&c->parent->spinlock, flags);
1376
1377 return ret;
1378}
1379
1380static long tegra_clk_shared_bus_round_rate(struct clk *c, unsigned long rate)
1381{
1382 return clk_round_rate(c->parent, rate);
1383}
1384
1385static int tegra_clk_shared_bus_enable(struct clk *c)
1386{
1387 unsigned long flags;
1388 int ret;
1389
1390 spin_lock_irqsave(&c->parent->spinlock, flags);
1391
1392 c->u.shared_bus_user.enabled = true;
1393 ret = tegra_clk_shared_bus_update(c->parent);
1394
1395 spin_unlock_irqrestore(&c->parent->spinlock, flags);
1396
1397 return ret;
1398}
1399
1400static void tegra_clk_shared_bus_disable(struct clk *c)
1401{
1402 unsigned long flags;
1403 int ret;
1404
1405 spin_lock_irqsave(&c->parent->spinlock, flags);
1406
1407 c->u.shared_bus_user.enabled = false;
1408 ret = tegra_clk_shared_bus_update(c->parent);
1409 WARN_ON_ONCE(ret);
1410
1411 spin_unlock_irqrestore(&c->parent->spinlock, flags);
1412}
1413
1414static struct clk_ops tegra_clk_shared_bus_ops = {
1415 .init = tegra_clk_shared_bus_init,
1416 .enable = tegra_clk_shared_bus_enable,
1417 .disable = tegra_clk_shared_bus_disable,
1418 .set_rate = tegra_clk_shared_bus_set_rate,
1419 .round_rate = tegra_clk_shared_bus_round_rate,
1420};
1421
1422
1009/* Clock definitions */ 1423/* Clock definitions */
1010static struct clk tegra_clk_32k = { 1424static struct clk tegra_clk_32k = {
1011 .name = "clk_32k", 1425 .name = "clk_32k",
@@ -1014,7 +1428,7 @@ static struct clk tegra_clk_32k = {
1014 .max_rate = 32768, 1428 .max_rate = 32768,
1015}; 1429};
1016 1430
1017static struct clk_pll_table tegra_pll_s_table[] = { 1431static struct clk_pll_freq_table tegra_pll_s_freq_table[] = {
1018 {32768, 12000000, 366, 1, 1, 0}, 1432 {32768, 12000000, 366, 1, 1, 0},
1019 {32768, 13000000, 397, 1, 1, 0}, 1433 {32768, 13000000, 397, 1, 1, 0},
1020 {32768, 19200000, 586, 1, 1, 0}, 1434 {32768, 19200000, 586, 1, 1, 0},
@@ -1026,16 +1440,19 @@ static struct clk tegra_pll_s = {
1026 .name = "pll_s", 1440 .name = "pll_s",
1027 .flags = PLL_ALT_MISC_REG, 1441 .flags = PLL_ALT_MISC_REG,
1028 .ops = &tegra_pll_ops, 1442 .ops = &tegra_pll_ops,
1029 .reg = 0xf0,
1030 .input_min = 32768,
1031 .input_max = 32768,
1032 .parent = &tegra_clk_32k, 1443 .parent = &tegra_clk_32k,
1033 .cf_min = 0, /* FIXME */
1034 .cf_max = 0, /* FIXME */
1035 .vco_min = 12000000,
1036 .vco_max = 26000000,
1037 .pll_table = tegra_pll_s_table,
1038 .max_rate = 26000000, 1444 .max_rate = 26000000,
1445 .reg = 0xf0,
1446 .u.pll = {
1447 .input_min = 32768,
1448 .input_max = 32768,
1449 .cf_min = 0, /* FIXME */
1450 .cf_max = 0, /* FIXME */
1451 .vco_min = 12000000,
1452 .vco_max = 26000000,
1453 .freq_table = tegra_pll_s_freq_table,
1454 .lock_delay = 300,
1455 },
1039}; 1456};
1040 1457
1041static struct clk_mux_sel tegra_clk_m_sel[] = { 1458static struct clk_mux_sel tegra_clk_m_sel[] = {
@@ -1043,18 +1460,18 @@ static struct clk_mux_sel tegra_clk_m_sel[] = {
1043 { .input = &tegra_pll_s, .value = 1}, 1460 { .input = &tegra_pll_s, .value = 1},
1044 { 0, 0}, 1461 { 0, 0},
1045}; 1462};
1463
1046static struct clk tegra_clk_m = { 1464static struct clk tegra_clk_m = {
1047 .name = "clk_m", 1465 .name = "clk_m",
1048 .flags = ENABLE_ON_INIT, 1466 .flags = ENABLE_ON_INIT,
1049 .ops = &tegra_clk_m_ops, 1467 .ops = &tegra_clk_m_ops,
1050 .inputs = tegra_clk_m_sel, 1468 .inputs = tegra_clk_m_sel,
1051 .reg = 0x1fc, 1469 .reg = 0x1fc,
1052 .reg_mask = (1<<28),
1053 .reg_shift = 28, 1470 .reg_shift = 28,
1054 .max_rate = 26000000, 1471 .max_rate = 26000000,
1055}; 1472};
1056 1473
1057static struct clk_pll_table tegra_pll_c_table[] = { 1474static struct clk_pll_freq_table tegra_pll_c_freq_table[] = {
1058 { 0, 0, 0, 0, 0, 0 }, 1475 { 0, 0, 0, 0, 0, 0 },
1059}; 1476};
1060 1477
@@ -1063,15 +1480,18 @@ static struct clk tegra_pll_c = {
1063 .flags = PLL_HAS_CPCON, 1480 .flags = PLL_HAS_CPCON,
1064 .ops = &tegra_pll_ops, 1481 .ops = &tegra_pll_ops,
1065 .reg = 0x80, 1482 .reg = 0x80,
1066 .input_min = 2000000,
1067 .input_max = 31000000,
1068 .parent = &tegra_clk_m, 1483 .parent = &tegra_clk_m,
1069 .cf_min = 1000000,
1070 .cf_max = 6000000,
1071 .vco_min = 20000000,
1072 .vco_max = 1400000000,
1073 .pll_table = tegra_pll_c_table,
1074 .max_rate = 600000000, 1484 .max_rate = 600000000,
1485 .u.pll = {
1486 .input_min = 2000000,
1487 .input_max = 31000000,
1488 .cf_min = 1000000,
1489 .cf_max = 6000000,
1490 .vco_min = 20000000,
1491 .vco_max = 1400000000,
1492 .freq_table = tegra_pll_c_freq_table,
1493 .lock_delay = 300,
1494 },
1075}; 1495};
1076 1496
1077static struct clk tegra_pll_c_out1 = { 1497static struct clk tegra_pll_c_out1 = {
@@ -1084,7 +1504,7 @@ static struct clk tegra_pll_c_out1 = {
1084 .max_rate = 600000000, 1504 .max_rate = 600000000,
1085}; 1505};
1086 1506
1087static struct clk_pll_table tegra_pll_m_table[] = { 1507static struct clk_pll_freq_table tegra_pll_m_freq_table[] = {
1088 { 12000000, 666000000, 666, 12, 1, 8}, 1508 { 12000000, 666000000, 666, 12, 1, 8},
1089 { 13000000, 666000000, 666, 13, 1, 8}, 1509 { 13000000, 666000000, 666, 13, 1, 8},
1090 { 19200000, 666000000, 555, 16, 1, 8}, 1510 { 19200000, 666000000, 555, 16, 1, 8},
@@ -1101,15 +1521,18 @@ static struct clk tegra_pll_m = {
1101 .flags = PLL_HAS_CPCON, 1521 .flags = PLL_HAS_CPCON,
1102 .ops = &tegra_pll_ops, 1522 .ops = &tegra_pll_ops,
1103 .reg = 0x90, 1523 .reg = 0x90,
1104 .input_min = 2000000,
1105 .input_max = 31000000,
1106 .parent = &tegra_clk_m, 1524 .parent = &tegra_clk_m,
1107 .cf_min = 1000000,
1108 .cf_max = 6000000,
1109 .vco_min = 20000000,
1110 .vco_max = 1200000000,
1111 .pll_table = tegra_pll_m_table,
1112 .max_rate = 800000000, 1525 .max_rate = 800000000,
1526 .u.pll = {
1527 .input_min = 2000000,
1528 .input_max = 31000000,
1529 .cf_min = 1000000,
1530 .cf_max = 6000000,
1531 .vco_min = 20000000,
1532 .vco_max = 1200000000,
1533 .freq_table = tegra_pll_m_freq_table,
1534 .lock_delay = 300,
1535 },
1113}; 1536};
1114 1537
1115static struct clk tegra_pll_m_out1 = { 1538static struct clk tegra_pll_m_out1 = {
@@ -1122,7 +1545,7 @@ static struct clk tegra_pll_m_out1 = {
1122 .max_rate = 600000000, 1545 .max_rate = 600000000,
1123}; 1546};
1124 1547
1125static struct clk_pll_table tegra_pll_p_table[] = { 1548static struct clk_pll_freq_table tegra_pll_p_freq_table[] = {
1126 { 12000000, 216000000, 432, 12, 2, 8}, 1549 { 12000000, 216000000, 432, 12, 2, 8},
1127 { 13000000, 216000000, 432, 13, 2, 8}, 1550 { 13000000, 216000000, 432, 13, 2, 8},
1128 { 19200000, 216000000, 90, 4, 2, 1}, 1551 { 19200000, 216000000, 90, 4, 2, 1},
@@ -1139,15 +1562,18 @@ static struct clk tegra_pll_p = {
1139 .flags = ENABLE_ON_INIT | PLL_FIXED | PLL_HAS_CPCON, 1562 .flags = ENABLE_ON_INIT | PLL_FIXED | PLL_HAS_CPCON,
1140 .ops = &tegra_pll_ops, 1563 .ops = &tegra_pll_ops,
1141 .reg = 0xa0, 1564 .reg = 0xa0,
1142 .input_min = 2000000,
1143 .input_max = 31000000,
1144 .parent = &tegra_clk_m, 1565 .parent = &tegra_clk_m,
1145 .cf_min = 1000000,
1146 .cf_max = 6000000,
1147 .vco_min = 20000000,
1148 .vco_max = 1400000000,
1149 .pll_table = tegra_pll_p_table,
1150 .max_rate = 432000000, 1566 .max_rate = 432000000,
1567 .u.pll = {
1568 .input_min = 2000000,
1569 .input_max = 31000000,
1570 .cf_min = 1000000,
1571 .cf_max = 6000000,
1572 .vco_min = 20000000,
1573 .vco_max = 1400000000,
1574 .freq_table = tegra_pll_p_freq_table,
1575 .lock_delay = 300,
1576 },
1151}; 1577};
1152 1578
1153static struct clk tegra_pll_p_out1 = { 1579static struct clk tegra_pll_p_out1 = {
@@ -1190,11 +1616,9 @@ static struct clk tegra_pll_p_out4 = {
1190 .max_rate = 432000000, 1616 .max_rate = 432000000,
1191}; 1617};
1192 1618
1193static struct clk_pll_table tegra_pll_a_table[] = { 1619static struct clk_pll_freq_table tegra_pll_a_freq_table[] = {
1194 { 28800000, 56448000, 49, 25, 1, 1}, 1620 { 28800000, 56448000, 49, 25, 1, 1},
1195 { 28800000, 73728000, 64, 25, 1, 1}, 1621 { 28800000, 73728000, 64, 25, 1, 1},
1196 { 28800000, 11289600, 49, 25, 1, 1},
1197 { 28800000, 12288000, 64, 25, 1, 1},
1198 { 28800000, 24000000, 5, 6, 1, 1}, 1622 { 28800000, 24000000, 5, 6, 1, 1},
1199 { 0, 0, 0, 0, 0, 0 }, 1623 { 0, 0, 0, 0, 0, 0 },
1200}; 1624};
@@ -1204,15 +1628,18 @@ static struct clk tegra_pll_a = {
1204 .flags = PLL_HAS_CPCON, 1628 .flags = PLL_HAS_CPCON,
1205 .ops = &tegra_pll_ops, 1629 .ops = &tegra_pll_ops,
1206 .reg = 0xb0, 1630 .reg = 0xb0,
1207 .input_min = 2000000,
1208 .input_max = 31000000,
1209 .parent = &tegra_pll_p_out1, 1631 .parent = &tegra_pll_p_out1,
1210 .cf_min = 1000000, 1632 .max_rate = 73728000,
1211 .cf_max = 6000000, 1633 .u.pll = {
1212 .vco_min = 20000000, 1634 .input_min = 2000000,
1213 .vco_max = 1400000000, 1635 .input_max = 31000000,
1214 .pll_table = tegra_pll_a_table, 1636 .cf_min = 1000000,
1215 .max_rate = 56448000, 1637 .cf_max = 6000000,
1638 .vco_min = 20000000,
1639 .vco_max = 1400000000,
1640 .freq_table = tegra_pll_a_freq_table,
1641 .lock_delay = 300,
1642 },
1216}; 1643};
1217 1644
1218static struct clk tegra_pll_a_out0 = { 1645static struct clk tegra_pll_a_out0 = {
@@ -1222,14 +1649,25 @@ static struct clk tegra_pll_a_out0 = {
1222 .parent = &tegra_pll_a, 1649 .parent = &tegra_pll_a,
1223 .reg = 0xb4, 1650 .reg = 0xb4,
1224 .reg_shift = 0, 1651 .reg_shift = 0,
1225 .max_rate = 56448000, 1652 .max_rate = 73728000,
1226}; 1653};
1227 1654
1228static struct clk_pll_table tegra_pll_d_table[] = { 1655static struct clk_pll_freq_table tegra_pll_d_freq_table[] = {
1656 { 12000000, 216000000, 216, 12, 1, 4},
1657 { 13000000, 216000000, 216, 13, 1, 4},
1658 { 19200000, 216000000, 135, 12, 1, 3},
1659 { 26000000, 216000000, 216, 26, 1, 4},
1660
1661 { 12000000, 594000000, 594, 12, 1, 8},
1662 { 13000000, 594000000, 594, 13, 1, 8},
1663 { 19200000, 594000000, 495, 16, 1, 8},
1664 { 26000000, 594000000, 594, 26, 1, 8},
1665
1229 { 12000000, 1000000000, 1000, 12, 1, 12}, 1666 { 12000000, 1000000000, 1000, 12, 1, 12},
1230 { 13000000, 1000000000, 1000, 13, 1, 12}, 1667 { 13000000, 1000000000, 1000, 13, 1, 12},
1231 { 19200000, 1000000000, 625, 12, 1, 8}, 1668 { 19200000, 1000000000, 625, 12, 1, 8},
1232 { 26000000, 1000000000, 1000, 26, 1, 12}, 1669 { 26000000, 1000000000, 1000, 26, 1, 12},
1670
1233 { 0, 0, 0, 0, 0, 0 }, 1671 { 0, 0, 0, 0, 0, 0 },
1234}; 1672};
1235 1673
@@ -1238,15 +1676,18 @@ static struct clk tegra_pll_d = {
1238 .flags = PLL_HAS_CPCON | PLLD, 1676 .flags = PLL_HAS_CPCON | PLLD,
1239 .ops = &tegra_pll_ops, 1677 .ops = &tegra_pll_ops,
1240 .reg = 0xd0, 1678 .reg = 0xd0,
1241 .input_min = 2000000,
1242 .input_max = 40000000,
1243 .parent = &tegra_clk_m, 1679 .parent = &tegra_clk_m,
1244 .cf_min = 1000000,
1245 .cf_max = 6000000,
1246 .vco_min = 40000000,
1247 .vco_max = 1000000000,
1248 .pll_table = tegra_pll_d_table,
1249 .max_rate = 1000000000, 1680 .max_rate = 1000000000,
1681 .u.pll = {
1682 .input_min = 2000000,
1683 .input_max = 40000000,
1684 .cf_min = 1000000,
1685 .cf_max = 6000000,
1686 .vco_min = 40000000,
1687 .vco_max = 1000000000,
1688 .freq_table = tegra_pll_d_freq_table,
1689 .lock_delay = 1000,
1690 },
1250}; 1691};
1251 1692
1252static struct clk tegra_pll_d_out0 = { 1693static struct clk tegra_pll_d_out0 = {
@@ -1257,7 +1698,7 @@ static struct clk tegra_pll_d_out0 = {
1257 .max_rate = 500000000, 1698 .max_rate = 500000000,
1258}; 1699};
1259 1700
1260static struct clk_pll_table tegra_pll_u_table[] = { 1701static struct clk_pll_freq_table tegra_pll_u_freq_table[] = {
1261 { 12000000, 480000000, 960, 12, 2, 0}, 1702 { 12000000, 480000000, 960, 12, 2, 0},
1262 { 13000000, 480000000, 960, 13, 2, 0}, 1703 { 13000000, 480000000, 960, 13, 2, 0},
1263 { 19200000, 480000000, 200, 4, 2, 0}, 1704 { 19200000, 480000000, 200, 4, 2, 0},
@@ -1270,18 +1711,21 @@ static struct clk tegra_pll_u = {
1270 .flags = PLLU, 1711 .flags = PLLU,
1271 .ops = &tegra_pll_ops, 1712 .ops = &tegra_pll_ops,
1272 .reg = 0xc0, 1713 .reg = 0xc0,
1273 .input_min = 2000000,
1274 .input_max = 40000000,
1275 .parent = &tegra_clk_m, 1714 .parent = &tegra_clk_m,
1276 .cf_min = 1000000,
1277 .cf_max = 6000000,
1278 .vco_min = 480000000,
1279 .vco_max = 960000000,
1280 .pll_table = tegra_pll_u_table,
1281 .max_rate = 480000000, 1715 .max_rate = 480000000,
1282}; 1716 .u.pll = {
1283 1717 .input_min = 2000000,
1284static struct clk_pll_table tegra_pll_x_table[] = { 1718 .input_max = 40000000,
1719 .cf_min = 1000000,
1720 .cf_max = 6000000,
1721 .vco_min = 480000000,
1722 .vco_max = 960000000,
1723 .freq_table = tegra_pll_u_freq_table,
1724 .lock_delay = 1000,
1725 },
1726};
1727
1728static struct clk_pll_freq_table tegra_pll_x_freq_table[] = {
1285 /* 1 GHz */ 1729 /* 1 GHz */
1286 { 12000000, 1000000000, 1000, 12, 1, 12}, 1730 { 12000000, 1000000000, 1000, 12, 1, 12},
1287 { 13000000, 1000000000, 1000, 13, 1, 12}, 1731 { 13000000, 1000000000, 1000, 13, 1, 12},
@@ -1307,10 +1751,10 @@ static struct clk_pll_table tegra_pll_x_table[] = {
1307 { 26000000, 760000000, 760, 26, 1, 12}, 1751 { 26000000, 760000000, 760, 26, 1, 12},
1308 1752
1309 /* 608 MHz */ 1753 /* 608 MHz */
1310 { 12000000, 608000000, 760, 12, 1, 12}, 1754 { 12000000, 608000000, 608, 12, 1, 12},
1311 { 13000000, 608000000, 760, 13, 1, 12}, 1755 { 13000000, 608000000, 608, 13, 1, 12},
1312 { 19200000, 608000000, 380, 12, 1, 8}, 1756 { 19200000, 608000000, 380, 12, 1, 8},
1313 { 26000000, 608000000, 760, 26, 1, 12}, 1757 { 26000000, 608000000, 608, 26, 1, 12},
1314 1758
1315 /* 456 MHz */ 1759 /* 456 MHz */
1316 { 12000000, 456000000, 456, 12, 1, 12}, 1760 { 12000000, 456000000, 456, 12, 1, 12},
@@ -1332,18 +1776,21 @@ static struct clk tegra_pll_x = {
1332 .flags = PLL_HAS_CPCON | PLL_ALT_MISC_REG, 1776 .flags = PLL_HAS_CPCON | PLL_ALT_MISC_REG,
1333 .ops = &tegra_pllx_ops, 1777 .ops = &tegra_pllx_ops,
1334 .reg = 0xe0, 1778 .reg = 0xe0,
1335 .input_min = 2000000,
1336 .input_max = 31000000,
1337 .parent = &tegra_clk_m, 1779 .parent = &tegra_clk_m,
1338 .cf_min = 1000000,
1339 .cf_max = 6000000,
1340 .vco_min = 20000000,
1341 .vco_max = 1200000000,
1342 .pll_table = tegra_pll_x_table,
1343 .max_rate = 1000000000, 1780 .max_rate = 1000000000,
1344}; 1781 .u.pll = {
1345 1782 .input_min = 2000000,
1346static struct clk_pll_table tegra_pll_e_table[] = { 1783 .input_max = 31000000,
1784 .cf_min = 1000000,
1785 .cf_max = 6000000,
1786 .vco_min = 20000000,
1787 .vco_max = 1200000000,
1788 .freq_table = tegra_pll_x_freq_table,
1789 .lock_delay = 300,
1790 },
1791};
1792
1793static struct clk_pll_freq_table tegra_pll_e_freq_table[] = {
1347 { 12000000, 100000000, 200, 24, 1, 0 }, 1794 { 12000000, 100000000, 200, 24, 1, 0 },
1348 { 0, 0, 0, 0, 0, 0 }, 1795 { 0, 0, 0, 0, 0, 0 },
1349}; 1796};
@@ -1352,23 +1799,49 @@ static struct clk tegra_pll_e = {
1352 .name = "pll_e", 1799 .name = "pll_e",
1353 .flags = PLL_ALT_MISC_REG, 1800 .flags = PLL_ALT_MISC_REG,
1354 .ops = &tegra_plle_ops, 1801 .ops = &tegra_plle_ops,
1355 .input_min = 12000000,
1356 .input_max = 12000000,
1357 .max_rate = 100000000,
1358 .parent = &tegra_clk_m, 1802 .parent = &tegra_clk_m,
1359 .reg = 0xe8, 1803 .reg = 0xe8,
1360 .pll_table = tegra_pll_e_table, 1804 .max_rate = 100000000,
1805 .u.pll = {
1806 .input_min = 12000000,
1807 .input_max = 12000000,
1808 .freq_table = tegra_pll_e_freq_table,
1809 },
1361}; 1810};
1362 1811
1363static struct clk tegra_clk_d = { 1812static struct clk tegra_clk_d = {
1364 .name = "clk_d", 1813 .name = "clk_d",
1365 .flags = PERIPH_NO_RESET, 1814 .flags = PERIPH_NO_RESET,
1366 .ops = &tegra_clk_double_ops, 1815 .ops = &tegra_clk_double_ops,
1367 .clk_num = 90,
1368 .reg = 0x34, 1816 .reg = 0x34,
1369 .reg_shift = 12, 1817 .reg_shift = 12,
1370 .parent = &tegra_clk_m, 1818 .parent = &tegra_clk_m,
1371 .max_rate = 52000000, 1819 .max_rate = 52000000,
1820 .u.periph = {
1821 .clk_num = 90,
1822 },
1823};
1824
1825/* dap_mclk1, belongs to the cdev1 pingroup. */
1826static struct clk tegra_clk_cdev1 = {
1827 .name = "cdev1",
1828 .ops = &tegra_cdev_clk_ops,
1829 .rate = 26000000,
1830 .max_rate = 26000000,
1831 .u.periph = {
1832 .clk_num = 94,
1833 },
1834};
1835
1836/* dap_mclk2, belongs to the cdev2 pingroup. */
1837static struct clk tegra_clk_cdev2 = {
1838 .name = "cdev2",
1839 .ops = &tegra_cdev_clk_ops,
1840 .rate = 26000000,
1841 .max_rate = 26000000,
1842 .u.periph = {
1843 .clk_num = 93,
1844 },
1372}; 1845};
1373 1846
1374/* initialized before peripheral clocks */ 1847/* initialized before peripheral clocks */
@@ -1394,7 +1867,7 @@ static struct clk tegra_clk_audio = {
1394 .name = "audio", 1867 .name = "audio",
1395 .inputs = mux_audio_sync_clk, 1868 .inputs = mux_audio_sync_clk,
1396 .reg = 0x38, 1869 .reg = 0x38,
1397 .max_rate = 24000000, 1870 .max_rate = 73728000,
1398 .ops = &tegra_audio_sync_clk_ops 1871 .ops = &tegra_audio_sync_clk_ops
1399}; 1872};
1400 1873
@@ -1403,10 +1876,12 @@ static struct clk tegra_clk_audio_2x = {
1403 .flags = PERIPH_NO_RESET, 1876 .flags = PERIPH_NO_RESET,
1404 .max_rate = 48000000, 1877 .max_rate = 48000000,
1405 .ops = &tegra_clk_double_ops, 1878 .ops = &tegra_clk_double_ops,
1406 .clk_num = 89,
1407 .reg = 0x34, 1879 .reg = 0x34,
1408 .reg_shift = 8, 1880 .reg_shift = 8,
1409 .parent = &tegra_clk_audio, 1881 .parent = &tegra_clk_audio,
1882 .u.periph = {
1883 .clk_num = 89,
1884 },
1410}; 1885};
1411 1886
1412struct clk_lookup tegra_audio_clk_lookups[] = { 1887struct clk_lookup tegra_audio_clk_lookups[] = {
@@ -1478,17 +1953,26 @@ static struct clk tegra_clk_sclk = {
1478 .inputs = mux_sclk, 1953 .inputs = mux_sclk,
1479 .reg = 0x28, 1954 .reg = 0x28,
1480 .ops = &tegra_super_ops, 1955 .ops = &tegra_super_ops,
1481 .max_rate = 600000000, 1956 .max_rate = 240000000,
1957 .min_rate = 120000000,
1482}; 1958};
1483 1959
1484static struct clk tegra_clk_virtual_cpu = { 1960static struct clk tegra_clk_virtual_cpu = {
1485 .name = "cpu", 1961 .name = "cpu",
1486 .parent = &tegra_clk_cclk, 1962 .parent = &tegra_clk_cclk,
1487 .main = &tegra_pll_x,
1488 .backup = &tegra_clk_m,
1489 .ops = &tegra_cpu_ops, 1963 .ops = &tegra_cpu_ops,
1490 .max_rate = 1000000000, 1964 .max_rate = 1000000000,
1491 .dvfs = &tegra_dvfs_virtual_cpu_dvfs, 1965 .u.cpu = {
1966 .main = &tegra_pll_x,
1967 .backup = &tegra_pll_p,
1968 },
1969};
1970
1971static struct clk tegra_clk_cop = {
1972 .name = "cop",
1973 .parent = &tegra_clk_sclk,
1974 .ops = &tegra_cop_ops,
1975 .max_rate = 240000000,
1492}; 1976};
1493 1977
1494static struct clk tegra_clk_hclk = { 1978static struct clk tegra_clk_hclk = {
@@ -1508,7 +1992,15 @@ static struct clk tegra_clk_pclk = {
1508 .reg = 0x30, 1992 .reg = 0x30,
1509 .reg_shift = 0, 1993 .reg_shift = 0,
1510 .ops = &tegra_bus_ops, 1994 .ops = &tegra_bus_ops,
1511 .max_rate = 108000000, 1995 .max_rate = 120000000,
1996};
1997
1998static struct clk tegra_clk_blink = {
1999 .name = "blink",
2000 .parent = &tegra_clk_32k,
2001 .reg = 0x40,
2002 .ops = &tegra_blink_clk_ops,
2003 .max_rate = 32768,
1512}; 2004};
1513 2005
1514static struct clk_mux_sel mux_pllm_pllc_pllp_plla[] = { 2006static struct clk_mux_sel mux_pllm_pllc_pllp_plla[] = {
@@ -1587,6 +2079,23 @@ static struct clk_mux_sel mux_clk_32k[] = {
1587 { 0, 0}, 2079 { 0, 0},
1588}; 2080};
1589 2081
2082static struct clk_mux_sel mux_pclk[] = {
2083 { .input = &tegra_clk_pclk, .value = 0},
2084 { 0, 0},
2085};
2086
2087static struct clk tegra_clk_emc = {
2088 .name = "emc",
2089 .ops = &tegra_emc_clk_ops,
2090 .reg = 0x19c,
2091 .max_rate = 800000000,
2092 .inputs = mux_pllm_pllc_pllp_clkm,
2093 .flags = MUX | DIV_U71 | PERIPH_EMC_ENB,
2094 .u.periph = {
2095 .clk_num = 57,
2096 },
2097};
2098
1590#define PERIPH_CLK(_name, _dev, _con, _clk_num, _reg, _max, _inputs, _flags) \ 2099#define PERIPH_CLK(_name, _dev, _con, _clk_num, _reg, _max, _inputs, _flags) \
1591 { \ 2100 { \
1592 .name = _name, \ 2101 .name = _name, \
@@ -1595,19 +2104,32 @@ static struct clk_mux_sel mux_clk_32k[] = {
1595 .con_id = _con, \ 2104 .con_id = _con, \
1596 }, \ 2105 }, \
1597 .ops = &tegra_periph_clk_ops, \ 2106 .ops = &tegra_periph_clk_ops, \
1598 .clk_num = _clk_num, \
1599 .reg = _reg, \ 2107 .reg = _reg, \
1600 .inputs = _inputs, \ 2108 .inputs = _inputs, \
1601 .flags = _flags, \ 2109 .flags = _flags, \
1602 .max_rate = _max, \ 2110 .max_rate = _max, \
2111 .u.periph = { \
2112 .clk_num = _clk_num, \
2113 }, \
2114 }
2115
2116#define SHARED_CLK(_name, _dev, _con, _parent) \
2117 { \
2118 .name = _name, \
2119 .lookup = { \
2120 .dev_id = _dev, \
2121 .con_id = _con, \
2122 }, \
2123 .ops = &tegra_clk_shared_bus_ops, \
2124 .parent = _parent, \
1603 } 2125 }
1604 2126
1605struct clk tegra_periph_clks[] = { 2127struct clk tegra_list_clks[] = {
2128 PERIPH_CLK("apbdma", "tegra-dma", NULL, 34, 0, 108000000, mux_pclk, 0),
1606 PERIPH_CLK("rtc", "rtc-tegra", NULL, 4, 0, 32768, mux_clk_32k, PERIPH_NO_RESET), 2129 PERIPH_CLK("rtc", "rtc-tegra", NULL, 4, 0, 32768, mux_clk_32k, PERIPH_NO_RESET),
1607 PERIPH_CLK("timer", "timer", NULL, 5, 0, 26000000, mux_clk_m, 0), 2130 PERIPH_CLK("timer", "timer", NULL, 5, 0, 26000000, mux_clk_m, 0),
1608 PERIPH_CLK("i2s1", "i2s.0", NULL, 11, 0x100, 26000000, mux_pllaout0_audio2x_pllp_clkm, MUX | DIV_U71), 2131 PERIPH_CLK("i2s1", "tegra-i2s.0", NULL, 11, 0x100, 26000000, mux_pllaout0_audio2x_pllp_clkm, MUX | DIV_U71),
1609 PERIPH_CLK("i2s2", "i2s.1", NULL, 18, 0x104, 26000000, mux_pllaout0_audio2x_pllp_clkm, MUX | DIV_U71), 2132 PERIPH_CLK("i2s2", "tegra-i2s.1", NULL, 18, 0x104, 26000000, mux_pllaout0_audio2x_pllp_clkm, MUX | DIV_U71),
1610 /* FIXME: spdif has 2 clocks but 1 enable */
1611 PERIPH_CLK("spdif_out", "spdif_out", NULL, 10, 0x108, 100000000, mux_pllaout0_audio2x_pllp_clkm, MUX | DIV_U71), 2133 PERIPH_CLK("spdif_out", "spdif_out", NULL, 10, 0x108, 100000000, mux_pllaout0_audio2x_pllp_clkm, MUX | DIV_U71),
1612 PERIPH_CLK("spdif_in", "spdif_in", NULL, 10, 0x10c, 100000000, mux_pllp_pllc_pllm, MUX | DIV_U71), 2134 PERIPH_CLK("spdif_in", "spdif_in", NULL, 10, 0x10c, 100000000, mux_pllp_pllc_pllm, MUX | DIV_U71),
1613 PERIPH_CLK("pwm", "pwm", NULL, 17, 0x110, 432000000, mux_pllp_pllc_audio_clkm_clk32, MUX | DIV_U71), 2135 PERIPH_CLK("pwm", "pwm", NULL, 17, 0x110, 432000000, mux_pllp_pllc_audio_clkm_clk32, MUX | DIV_U71),
@@ -1620,13 +2142,15 @@ struct clk tegra_periph_clks[] = {
1620 PERIPH_CLK("sbc4", "spi_tegra.3", NULL, 68, 0x1b4, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), 2142 PERIPH_CLK("sbc4", "spi_tegra.3", NULL, 68, 0x1b4, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
1621 PERIPH_CLK("ide", "ide", NULL, 25, 0x144, 100000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* requires min voltage */ 2143 PERIPH_CLK("ide", "ide", NULL, 25, 0x144, 100000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* requires min voltage */
1622 PERIPH_CLK("ndflash", "tegra_nand", NULL, 13, 0x160, 164000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage */ 2144 PERIPH_CLK("ndflash", "tegra_nand", NULL, 13, 0x160, 164000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage */
1623 /* FIXME: vfir shares an enable with uartb */
1624 PERIPH_CLK("vfir", "vfir", NULL, 7, 0x168, 72000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), 2145 PERIPH_CLK("vfir", "vfir", NULL, 7, 0x168, 72000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
1625 PERIPH_CLK("sdmmc1", "sdhci-tegra.0", NULL, 14, 0x150, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage */ 2146 PERIPH_CLK("sdmmc1", "sdhci-tegra.0", NULL, 14, 0x150, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage */
1626 PERIPH_CLK("sdmmc2", "sdhci-tegra.1", NULL, 9, 0x154, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage */ 2147 PERIPH_CLK("sdmmc2", "sdhci-tegra.1", NULL, 9, 0x154, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage */
1627 PERIPH_CLK("sdmmc3", "sdhci-tegra.2", NULL, 69, 0x1bc, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage */ 2148 PERIPH_CLK("sdmmc3", "sdhci-tegra.2", NULL, 69, 0x1bc, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage */
1628 PERIPH_CLK("sdmmc4", "sdhci-tegra.3", NULL, 15, 0x160, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage */ 2149 PERIPH_CLK("sdmmc4", "sdhci-tegra.3", NULL, 15, 0x164, 52000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage */
1629 PERIPH_CLK("vde", "vde", NULL, 61, 0x1c8, 250000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage and process_id */ 2150 PERIPH_CLK("vcp", "tegra-avp", "vcp", 29, 0, 250000000, mux_clk_m, 0),
2151 PERIPH_CLK("bsea", "tegra-avp", "bsea", 62, 0, 250000000, mux_clk_m, 0),
2152 PERIPH_CLK("bsev", "tegra-aes", "bsev", 63, 0, 250000000, mux_clk_m, 0),
2153 PERIPH_CLK("vde", "tegra-avp", "vde", 61, 0x1c8, 250000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* scales with voltage and process_id */
1630 PERIPH_CLK("csite", "csite", NULL, 73, 0x1d4, 144000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* max rate ??? */ 2154 PERIPH_CLK("csite", "csite", NULL, 73, 0x1d4, 144000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), /* max rate ??? */
1631 /* FIXME: what is la? */ 2155 /* FIXME: what is la? */
1632 PERIPH_CLK("la", "la", NULL, 76, 0x1f8, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71), 2156 PERIPH_CLK("la", "la", NULL, 76, 0x1f8, 26000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
@@ -1641,37 +2165,46 @@ struct clk tegra_periph_clks[] = {
1641 PERIPH_CLK("i2c2_i2c", "tegra-i2c.1", "i2c", 0, 0, 72000000, mux_pllp_out3, 0), 2165 PERIPH_CLK("i2c2_i2c", "tegra-i2c.1", "i2c", 0, 0, 72000000, mux_pllp_out3, 0),
1642 PERIPH_CLK("i2c3_i2c", "tegra-i2c.2", "i2c", 0, 0, 72000000, mux_pllp_out3, 0), 2166 PERIPH_CLK("i2c3_i2c", "tegra-i2c.2", "i2c", 0, 0, 72000000, mux_pllp_out3, 0),
1643 PERIPH_CLK("dvc_i2c", "tegra-i2c.3", "i2c", 0, 0, 72000000, mux_pllp_out3, 0), 2167 PERIPH_CLK("dvc_i2c", "tegra-i2c.3", "i2c", 0, 0, 72000000, mux_pllp_out3, 0),
1644 PERIPH_CLK("uarta", "uart.0", NULL, 6, 0x178, 216000000, mux_pllp_pllc_pllm_clkm, MUX), 2168 PERIPH_CLK("uarta", "uart.0", NULL, 6, 0x178, 600000000, mux_pllp_pllc_pllm_clkm, MUX),
1645 PERIPH_CLK("uartb", "uart.1", NULL, 7, 0x17c, 216000000, mux_pllp_pllc_pllm_clkm, MUX), 2169 PERIPH_CLK("uartb", "uart.1", NULL, 7, 0x17c, 600000000, mux_pllp_pllc_pllm_clkm, MUX),
1646 PERIPH_CLK("uartc", "uart.2", NULL, 55, 0x1a0, 216000000, mux_pllp_pllc_pllm_clkm, MUX), 2170 PERIPH_CLK("uartc", "uart.2", NULL, 55, 0x1a0, 600000000, mux_pllp_pllc_pllm_clkm, MUX),
1647 PERIPH_CLK("uartd", "uart.3", NULL, 65, 0x1c0, 216000000, mux_pllp_pllc_pllm_clkm, MUX), 2171 PERIPH_CLK("uartd", "uart.3", NULL, 65, 0x1c0, 600000000, mux_pllp_pllc_pllm_clkm, MUX),
1648 PERIPH_CLK("uarte", "uart.4", NULL, 66, 0x1c4, 216000000, mux_pllp_pllc_pllm_clkm, MUX), 2172 PERIPH_CLK("uarte", "uart.4", NULL, 66, 0x1c4, 600000000, mux_pllp_pllc_pllm_clkm, MUX),
1649 PERIPH_CLK("3d", "3d", NULL, 24, 0x158, 300000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | PERIPH_MANUAL_RESET), /* scales with voltage and process_id */ 2173 PERIPH_CLK("3d", "3d", NULL, 24, 0x158, 300000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | PERIPH_MANUAL_RESET), /* scales with voltage and process_id */
1650 PERIPH_CLK("2d", "2d", NULL, 21, 0x15c, 300000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71), /* scales with voltage and process_id */ 2174 PERIPH_CLK("2d", "2d", NULL, 21, 0x15c, 300000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71), /* scales with voltage and process_id */
1651 /* FIXME: vi and vi_sensor share an enable */ 2175 PERIPH_CLK("vi", "tegra_camera", "vi", 20, 0x148, 150000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71), /* scales with voltage and process_id */
1652 PERIPH_CLK("vi", "vi", NULL, 20, 0x148, 150000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71), /* scales with voltage and process_id */ 2176 PERIPH_CLK("vi_sensor", "tegra_camera", "vi_sensor", 20, 0x1a8, 150000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | PERIPH_NO_RESET), /* scales with voltage and process_id */
1653 PERIPH_CLK("vi_sensor", "vi_sensor", NULL, 20, 0x1a8, 150000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71 | PERIPH_NO_RESET), /* scales with voltage and process_id */
1654 PERIPH_CLK("epp", "epp", NULL, 19, 0x16c, 300000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71), /* scales with voltage and process_id */ 2177 PERIPH_CLK("epp", "epp", NULL, 19, 0x16c, 300000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71), /* scales with voltage and process_id */
1655 PERIPH_CLK("mpe", "mpe", NULL, 60, 0x170, 250000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71), /* scales with voltage and process_id */ 2178 PERIPH_CLK("mpe", "mpe", NULL, 60, 0x170, 250000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71), /* scales with voltage and process_id */
1656 PERIPH_CLK("host1x", "host1x", NULL, 28, 0x180, 166000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71), /* scales with voltage and process_id */ 2179 PERIPH_CLK("host1x", "host1x", NULL, 28, 0x180, 166000000, mux_pllm_pllc_pllp_plla, MUX | DIV_U71), /* scales with voltage and process_id */
1657 /* FIXME: cve and tvo share an enable */
1658 PERIPH_CLK("cve", "cve", NULL, 49, 0x140, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71), /* requires min voltage */ 2180 PERIPH_CLK("cve", "cve", NULL, 49, 0x140, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71), /* requires min voltage */
1659 PERIPH_CLK("tvo", "tvo", NULL, 49, 0x188, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71), /* requires min voltage */ 2181 PERIPH_CLK("tvo", "tvo", NULL, 49, 0x188, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71), /* requires min voltage */
1660 PERIPH_CLK("hdmi", "hdmi", NULL, 51, 0x18c, 148500000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71), /* requires min voltage */ 2182 PERIPH_CLK("hdmi", "hdmi", NULL, 51, 0x18c, 600000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71), /* requires min voltage */
1661 PERIPH_CLK("tvdac", "tvdac", NULL, 53, 0x194, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71), /* requires min voltage */ 2183 PERIPH_CLK("tvdac", "tvdac", NULL, 53, 0x194, 250000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71), /* requires min voltage */
1662 PERIPH_CLK("disp1", "tegrafb.0", NULL, 27, 0x138, 190000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71), /* scales with voltage and process_id */ 2184 PERIPH_CLK("disp1", "tegradc.0", NULL, 27, 0x138, 600000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71), /* scales with voltage and process_id */
1663 PERIPH_CLK("disp2", "tegrafb.1", NULL, 26, 0x13c, 190000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71), /* scales with voltage and process_id */ 2185 PERIPH_CLK("disp2", "tegradc.1", NULL, 26, 0x13c, 600000000, mux_pllp_plld_pllc_clkm, MUX | DIV_U71), /* scales with voltage and process_id */
1664 PERIPH_CLK("usbd", "fsl-tegra-udc", NULL, 22, 0, 480000000, mux_clk_m, 0), /* requires min voltage */ 2186 PERIPH_CLK("usbd", "fsl-tegra-udc", NULL, 22, 0, 480000000, mux_clk_m, 0), /* requires min voltage */
1665 PERIPH_CLK("usb2", "tegra-ehci.1", NULL, 58, 0, 480000000, mux_clk_m, 0), /* requires min voltage */ 2187 PERIPH_CLK("usb2", "tegra-ehci.1", NULL, 58, 0, 480000000, mux_clk_m, 0), /* requires min voltage */
1666 PERIPH_CLK("usb3", "tegra-ehci.2", NULL, 59, 0, 480000000, mux_clk_m, 0), /* requires min voltage */ 2188 PERIPH_CLK("usb3", "tegra-ehci.2", NULL, 59, 0, 480000000, mux_clk_m, 0), /* requires min voltage */
1667 PERIPH_CLK("emc", "emc", NULL, 57, 0x19c, 800000000, mux_pllm_pllc_pllp_clkm, MUX | DIV_U71 | PERIPH_EMC_ENB),
1668 PERIPH_CLK("dsi", "dsi", NULL, 48, 0, 500000000, mux_plld, 0), /* scales with voltage */ 2189 PERIPH_CLK("dsi", "dsi", NULL, 48, 0, 500000000, mux_plld, 0), /* scales with voltage */
1669 PERIPH_CLK("csi", "csi", NULL, 52, 0, 72000000, mux_pllp_out3, 0), 2190 PERIPH_CLK("csi", "tegra_camera", "csi", 52, 0, 72000000, mux_pllp_out3, 0),
1670 PERIPH_CLK("isp", "isp", NULL, 23, 0, 150000000, mux_clk_m, 0), /* same frequency as VI */ 2191 PERIPH_CLK("isp", "tegra_camera", "isp", 23, 0, 150000000, mux_clk_m, 0), /* same frequency as VI */
1671 PERIPH_CLK("csus", "csus", NULL, 92, 0, 150000000, mux_clk_m, PERIPH_NO_RESET), 2192 PERIPH_CLK("csus", "tegra_camera", "csus", 92, 0, 150000000, mux_clk_m, PERIPH_NO_RESET),
1672 PERIPH_CLK("pex", NULL, "pex", 70, 0, 26000000, mux_clk_m, PERIPH_MANUAL_RESET), 2193 PERIPH_CLK("pex", NULL, "pex", 70, 0, 26000000, mux_clk_m, PERIPH_MANUAL_RESET),
1673 PERIPH_CLK("afi", NULL, "afi", 72, 0, 26000000, mux_clk_m, PERIPH_MANUAL_RESET), 2194 PERIPH_CLK("afi", NULL, "afi", 72, 0, 26000000, mux_clk_m, PERIPH_MANUAL_RESET),
1674 PERIPH_CLK("pcie_xclk", NULL, "pcie_xclk", 74, 0, 26000000, mux_clk_m, PERIPH_MANUAL_RESET), 2195 PERIPH_CLK("pcie_xclk", NULL, "pcie_xclk", 74, 0, 26000000, mux_clk_m, PERIPH_MANUAL_RESET),
2196
2197 SHARED_CLK("avp.sclk", "tegra-avp", "sclk", &tegra_clk_sclk),
2198 SHARED_CLK("avp.emc", "tegra-avp", "emc", &tegra_clk_emc),
2199 SHARED_CLK("cpu.emc", "cpu", "emc", &tegra_clk_emc),
2200 SHARED_CLK("disp1.emc", "tegradc.0", "emc", &tegra_clk_emc),
2201 SHARED_CLK("disp2.emc", "tegradc.1", "emc", &tegra_clk_emc),
2202 SHARED_CLK("hdmi.emc", "hdmi", "emc", &tegra_clk_emc),
2203 SHARED_CLK("host.emc", "tegra_grhost", "emc", &tegra_clk_emc),
2204 SHARED_CLK("usbd.emc", "fsl-tegra-udc", "emc", &tegra_clk_emc),
2205 SHARED_CLK("usb1.emc", "tegra-ehci.0", "emc", &tegra_clk_emc),
2206 SHARED_CLK("usb2.emc", "tegra-ehci.1", "emc", &tegra_clk_emc),
2207 SHARED_CLK("usb3.emc", "tegra-ehci.2", "emc", &tegra_clk_emc),
1675}; 2208};
1676 2209
1677#define CLK_DUPLICATE(_name, _dev, _con) \ 2210#define CLK_DUPLICATE(_name, _dev, _con) \
@@ -1693,9 +2226,22 @@ struct clk_duplicate tegra_clk_duplicates[] = {
1693 CLK_DUPLICATE("uartc", "tegra_uart.2", NULL), 2226 CLK_DUPLICATE("uartc", "tegra_uart.2", NULL),
1694 CLK_DUPLICATE("uartd", "tegra_uart.3", NULL), 2227 CLK_DUPLICATE("uartd", "tegra_uart.3", NULL),
1695 CLK_DUPLICATE("uarte", "tegra_uart.4", NULL), 2228 CLK_DUPLICATE("uarte", "tegra_uart.4", NULL),
1696 CLK_DUPLICATE("host1x", "tegrafb.0", "host1x"), 2229 CLK_DUPLICATE("usbd", "utmip-pad", NULL),
1697 CLK_DUPLICATE("host1x", "tegrafb.1", "host1x"),
1698 CLK_DUPLICATE("usbd", "tegra-ehci.0", NULL), 2230 CLK_DUPLICATE("usbd", "tegra-ehci.0", NULL),
2231 CLK_DUPLICATE("usbd", "tegra-otg", NULL),
2232 CLK_DUPLICATE("hdmi", "tegradc.0", "hdmi"),
2233 CLK_DUPLICATE("hdmi", "tegradc.1", "hdmi"),
2234 CLK_DUPLICATE("pwm", "tegra_pwm.0", NULL),
2235 CLK_DUPLICATE("pwm", "tegra_pwm.1", NULL),
2236 CLK_DUPLICATE("pwm", "tegra_pwm.2", NULL),
2237 CLK_DUPLICATE("pwm", "tegra_pwm.3", NULL),
2238 CLK_DUPLICATE("host1x", "tegra_grhost", "host1x"),
2239 CLK_DUPLICATE("2d", "tegra_grhost", "gr2d"),
2240 CLK_DUPLICATE("3d", "tegra_grhost", "gr3d"),
2241 CLK_DUPLICATE("epp", "tegra_grhost", "epp"),
2242 CLK_DUPLICATE("mpe", "tegra_grhost", "mpe"),
2243 CLK_DUPLICATE("cop", "tegra-avp", "cop"),
2244 CLK_DUPLICATE("vde", "tegra-aes", "vde"),
1699}; 2245};
1700 2246
1701#define CLK(dev, con, ck) \ 2247#define CLK(dev, con, ck) \
@@ -1705,68 +2251,70 @@ struct clk_duplicate tegra_clk_duplicates[] = {
1705 .clk = ck, \ 2251 .clk = ck, \
1706 } 2252 }
1707 2253
1708struct clk_lookup tegra_clk_lookups[] = { 2254struct clk *tegra_ptr_clks[] = {
1709 /* external root sources */ 2255 &tegra_clk_32k,
1710 CLK(NULL, "32k_clk", &tegra_clk_32k), 2256 &tegra_pll_s,
1711 CLK(NULL, "pll_s", &tegra_pll_s), 2257 &tegra_clk_m,
1712 CLK(NULL, "clk_m", &tegra_clk_m), 2258 &tegra_pll_m,
1713 CLK(NULL, "pll_m", &tegra_pll_m), 2259 &tegra_pll_m_out1,
1714 CLK(NULL, "pll_m_out1", &tegra_pll_m_out1), 2260 &tegra_pll_c,
1715 CLK(NULL, "pll_c", &tegra_pll_c), 2261 &tegra_pll_c_out1,
1716 CLK(NULL, "pll_c_out1", &tegra_pll_c_out1), 2262 &tegra_pll_p,
1717 CLK(NULL, "pll_p", &tegra_pll_p), 2263 &tegra_pll_p_out1,
1718 CLK(NULL, "pll_p_out1", &tegra_pll_p_out1), 2264 &tegra_pll_p_out2,
1719 CLK(NULL, "pll_p_out2", &tegra_pll_p_out2), 2265 &tegra_pll_p_out3,
1720 CLK(NULL, "pll_p_out3", &tegra_pll_p_out3), 2266 &tegra_pll_p_out4,
1721 CLK(NULL, "pll_p_out4", &tegra_pll_p_out4), 2267 &tegra_pll_a,
1722 CLK(NULL, "pll_a", &tegra_pll_a), 2268 &tegra_pll_a_out0,
1723 CLK(NULL, "pll_a_out0", &tegra_pll_a_out0), 2269 &tegra_pll_d,
1724 CLK(NULL, "pll_d", &tegra_pll_d), 2270 &tegra_pll_d_out0,
1725 CLK(NULL, "pll_d_out0", &tegra_pll_d_out0), 2271 &tegra_pll_u,
1726 CLK(NULL, "pll_u", &tegra_pll_u), 2272 &tegra_pll_x,
1727 CLK(NULL, "pll_x", &tegra_pll_x), 2273 &tegra_pll_e,
1728 CLK(NULL, "pll_e", &tegra_pll_e), 2274 &tegra_clk_cclk,
1729 CLK(NULL, "cclk", &tegra_clk_cclk), 2275 &tegra_clk_sclk,
1730 CLK(NULL, "sclk", &tegra_clk_sclk), 2276 &tegra_clk_hclk,
1731 CLK(NULL, "hclk", &tegra_clk_hclk), 2277 &tegra_clk_pclk,
1732 CLK(NULL, "pclk", &tegra_clk_pclk), 2278 &tegra_clk_d,
1733 CLK(NULL, "clk_d", &tegra_clk_d), 2279 &tegra_clk_cdev1,
1734 CLK(NULL, "cpu", &tegra_clk_virtual_cpu), 2280 &tegra_clk_cdev2,
1735}; 2281 &tegra_clk_virtual_cpu,
2282 &tegra_clk_blink,
2283 &tegra_clk_cop,
2284 &tegra_clk_emc,
2285};
2286
2287static void tegra2_init_one_clock(struct clk *c)
2288{
2289 clk_init(c);
2290 INIT_LIST_HEAD(&c->shared_bus_list);
2291 if (!c->lookup.dev_id && !c->lookup.con_id)
2292 c->lookup.con_id = c->name;
2293 c->lookup.clk = c;
2294 clkdev_add(&c->lookup);
2295}
1736 2296
1737void __init tegra2_init_clocks(void) 2297void __init tegra2_init_clocks(void)
1738{ 2298{
1739 int i; 2299 int i;
1740 struct clk_lookup *cl;
1741 struct clk *c; 2300 struct clk *c;
1742 struct clk_duplicate *cd;
1743
1744 for (i = 0; i < ARRAY_SIZE(tegra_clk_lookups); i++) {
1745 cl = &tegra_clk_lookups[i];
1746 clk_init(cl->clk);
1747 clkdev_add(cl);
1748 }
1749 2301
1750 for (i = 0; i < ARRAY_SIZE(tegra_periph_clks); i++) { 2302 for (i = 0; i < ARRAY_SIZE(tegra_ptr_clks); i++)
1751 c = &tegra_periph_clks[i]; 2303 tegra2_init_one_clock(tegra_ptr_clks[i]);
1752 cl = &c->lookup;
1753 cl->clk = c;
1754 2304
1755 clk_init(cl->clk); 2305 for (i = 0; i < ARRAY_SIZE(tegra_list_clks); i++)
1756 clkdev_add(cl); 2306 tegra2_init_one_clock(&tegra_list_clks[i]);
1757 }
1758 2307
1759 for (i = 0; i < ARRAY_SIZE(tegra_clk_duplicates); i++) { 2308 for (i = 0; i < ARRAY_SIZE(tegra_clk_duplicates); i++) {
1760 cd = &tegra_clk_duplicates[i]; 2309 c = tegra_get_clock_by_name(tegra_clk_duplicates[i].name);
1761 c = tegra_get_clock_by_name(cd->name); 2310 if (!c) {
1762 if (c) {
1763 cl = &cd->lookup;
1764 cl->clk = c;
1765 clkdev_add(cl);
1766 } else {
1767 pr_err("%s: Unknown duplicate clock %s\n", __func__, 2311 pr_err("%s: Unknown duplicate clock %s\n", __func__,
1768 cd->name); 2312 tegra_clk_duplicates[i].name);
2313 continue;
1769 } 2314 }
2315
2316 tegra_clk_duplicates[i].lookup.clk = c;
2317 clkdev_add(&tegra_clk_duplicates[i].lookup);
1770 } 2318 }
1771 2319
1772 init_audio_sync_clock_mux(); 2320 init_audio_sync_clock_mux();
@@ -1774,7 +2322,7 @@ void __init tegra2_init_clocks(void)
1774 2322
1775#ifdef CONFIG_PM 2323#ifdef CONFIG_PM
1776static u32 clk_rst_suspend[RST_DEVICES_NUM + CLK_OUT_ENB_NUM + 2324static u32 clk_rst_suspend[RST_DEVICES_NUM + CLK_OUT_ENB_NUM +
1777 PERIPH_CLK_SOURCE_NUM + 3]; 2325 PERIPH_CLK_SOURCE_NUM + 22];
1778 2326
1779void tegra_clk_suspend(void) 2327void tegra_clk_suspend(void)
1780{ 2328{
@@ -1782,6 +2330,29 @@ void tegra_clk_suspend(void)
1782 u32 *ctx = clk_rst_suspend; 2330 u32 *ctx = clk_rst_suspend;
1783 2331
1784 *ctx++ = clk_readl(OSC_CTRL) & OSC_CTRL_MASK; 2332 *ctx++ = clk_readl(OSC_CTRL) & OSC_CTRL_MASK;
2333 *ctx++ = clk_readl(tegra_pll_c.reg + PLL_BASE);
2334 *ctx++ = clk_readl(tegra_pll_c.reg + PLL_MISC(&tegra_pll_c));
2335 *ctx++ = clk_readl(tegra_pll_a.reg + PLL_BASE);
2336 *ctx++ = clk_readl(tegra_pll_a.reg + PLL_MISC(&tegra_pll_a));
2337 *ctx++ = clk_readl(tegra_pll_s.reg + PLL_BASE);
2338 *ctx++ = clk_readl(tegra_pll_s.reg + PLL_MISC(&tegra_pll_s));
2339 *ctx++ = clk_readl(tegra_pll_d.reg + PLL_BASE);
2340 *ctx++ = clk_readl(tegra_pll_d.reg + PLL_MISC(&tegra_pll_d));
2341 *ctx++ = clk_readl(tegra_pll_u.reg + PLL_BASE);
2342 *ctx++ = clk_readl(tegra_pll_u.reg + PLL_MISC(&tegra_pll_u));
2343
2344 *ctx++ = clk_readl(tegra_pll_m_out1.reg);
2345 *ctx++ = clk_readl(tegra_pll_a_out0.reg);
2346 *ctx++ = clk_readl(tegra_pll_c_out1.reg);
2347
2348 *ctx++ = clk_readl(tegra_clk_cclk.reg);
2349 *ctx++ = clk_readl(tegra_clk_cclk.reg + SUPER_CLK_DIVIDER);
2350
2351 *ctx++ = clk_readl(tegra_clk_sclk.reg);
2352 *ctx++ = clk_readl(tegra_clk_sclk.reg + SUPER_CLK_DIVIDER);
2353 *ctx++ = clk_readl(tegra_clk_pclk.reg);
2354
2355 *ctx++ = clk_readl(tegra_clk_audio.reg);
1785 2356
1786 for (off = PERIPH_CLK_SOURCE_I2S1; off <= PERIPH_CLK_SOURCE_OSC; 2357 for (off = PERIPH_CLK_SOURCE_I2S1; off <= PERIPH_CLK_SOURCE_OSC;
1787 off += 4) { 2358 off += 4) {
@@ -1800,6 +2371,8 @@ void tegra_clk_suspend(void)
1800 2371
1801 *ctx++ = clk_readl(MISC_CLK_ENB); 2372 *ctx++ = clk_readl(MISC_CLK_ENB);
1802 *ctx++ = clk_readl(CLK_MASK_ARM); 2373 *ctx++ = clk_readl(CLK_MASK_ARM);
2374
2375 BUG_ON(ctx - clk_rst_suspend != ARRAY_SIZE(clk_rst_suspend));
1803} 2376}
1804 2377
1805void tegra_clk_resume(void) 2378void tegra_clk_resume(void)
@@ -1812,6 +2385,31 @@ void tegra_clk_resume(void)
1812 val |= *ctx++; 2385 val |= *ctx++;
1813 clk_writel(val, OSC_CTRL); 2386 clk_writel(val, OSC_CTRL);
1814 2387
2388 clk_writel(*ctx++, tegra_pll_c.reg + PLL_BASE);
2389 clk_writel(*ctx++, tegra_pll_c.reg + PLL_MISC(&tegra_pll_c));
2390 clk_writel(*ctx++, tegra_pll_a.reg + PLL_BASE);
2391 clk_writel(*ctx++, tegra_pll_a.reg + PLL_MISC(&tegra_pll_a));
2392 clk_writel(*ctx++, tegra_pll_s.reg + PLL_BASE);
2393 clk_writel(*ctx++, tegra_pll_s.reg + PLL_MISC(&tegra_pll_s));
2394 clk_writel(*ctx++, tegra_pll_d.reg + PLL_BASE);
2395 clk_writel(*ctx++, tegra_pll_d.reg + PLL_MISC(&tegra_pll_d));
2396 clk_writel(*ctx++, tegra_pll_u.reg + PLL_BASE);
2397 clk_writel(*ctx++, tegra_pll_u.reg + PLL_MISC(&tegra_pll_u));
2398 udelay(1000);
2399
2400 clk_writel(*ctx++, tegra_pll_m_out1.reg);
2401 clk_writel(*ctx++, tegra_pll_a_out0.reg);
2402 clk_writel(*ctx++, tegra_pll_c_out1.reg);
2403
2404 clk_writel(*ctx++, tegra_clk_cclk.reg);
2405 clk_writel(*ctx++, tegra_clk_cclk.reg + SUPER_CLK_DIVIDER);
2406
2407 clk_writel(*ctx++, tegra_clk_sclk.reg);
2408 clk_writel(*ctx++, tegra_clk_sclk.reg + SUPER_CLK_DIVIDER);
2409 clk_writel(*ctx++, tegra_clk_pclk.reg);
2410
2411 clk_writel(*ctx++, tegra_clk_audio.reg);
2412
1815 /* enable all clocks before configuring clock sources */ 2413 /* enable all clocks before configuring clock sources */
1816 clk_writel(0xbffffff9ul, CLK_OUT_ENB); 2414 clk_writel(0xbffffff9ul, CLK_OUT_ENB);
1817 clk_writel(0xfefffff7ul, CLK_OUT_ENB + 4); 2415 clk_writel(0xfefffff7ul, CLK_OUT_ENB + 4);
diff --git a/arch/arm/mach-tegra/tegra2_dvfs.c b/arch/arm/mach-tegra/tegra2_dvfs.c
deleted file mode 100644
index 5529c238dd77..000000000000
--- a/arch/arm/mach-tegra/tegra2_dvfs.c
+++ /dev/null
@@ -1,86 +0,0 @@
1/*
2 * arch/arm/mach-tegra/tegra2_dvfs.c
3 *
4 * Copyright (C) 2010 Google, Inc.
5 *
6 * Author:
7 * Colin Cross <ccross@google.com>
8 *
9 * This software is licensed under the terms of the GNU General Public
10 * License version 2, as published by the Free Software Foundation, and
11 * may be copied, distributed, and modified under those terms.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 */
19
20#include <linux/kernel.h>
21
22#include "clock.h"
23#include "tegra2_dvfs.h"
24
25static struct dvfs_table virtual_cpu_process_0[] = {
26 {314000000, 750},
27 {456000000, 825},
28 {608000000, 900},
29 {760000000, 975},
30 {817000000, 1000},
31 {912000000, 1050},
32 {1000000000, 1100},
33 {0, 0},
34};
35
36static struct dvfs_table virtual_cpu_process_1[] = {
37 {314000000, 750},
38 {456000000, 825},
39 {618000000, 900},
40 {770000000, 975},
41 {827000000, 1000},
42 {922000000, 1050},
43 {1000000000, 1100},
44 {0, 0},
45};
46
47static struct dvfs_table virtual_cpu_process_2[] = {
48 {494000000, 750},
49 {675000000, 825},
50 {817000000, 875},
51 {922000000, 925},
52 {1000000000, 975},
53 {0, 0},
54};
55
56static struct dvfs_table virtual_cpu_process_3[] = {
57 {730000000, 750},
58 {760000000, 775},
59 {845000000, 800},
60 {1000000000, 875},
61 {0, 0},
62};
63
64struct dvfs tegra_dvfs_virtual_cpu_dvfs = {
65 .reg_id = "vdd_cpu",
66 .process_id_table = {
67 {
68 .process_id = 0,
69 .table = virtual_cpu_process_0,
70 },
71 {
72 .process_id = 1,
73 .table = virtual_cpu_process_1,
74 },
75 {
76 .process_id = 2,
77 .table = virtual_cpu_process_2,
78 },
79 {
80 .process_id = 3,
81 .table = virtual_cpu_process_3,
82 },
83 },
84 .process_id_table_length = 4,
85 .cpu = 1,
86};
diff --git a/arch/arm/mach-tegra/tegra2_emc.c b/arch/arm/mach-tegra/tegra2_emc.c
new file mode 100644
index 000000000000..0f7ae6e90b55
--- /dev/null
+++ b/arch/arm/mach-tegra/tegra2_emc.c
@@ -0,0 +1,178 @@
1/*
2 * Copyright (C) 2011 Google, Inc.
3 *
4 * Author:
5 * Colin Cross <ccross@android.com>
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17
18#include <linux/kernel.h>
19#include <linux/clk.h>
20#include <linux/err.h>
21#include <linux/io.h>
22#include <linux/module.h>
23
24#include <mach/iomap.h>
25
26#include "tegra2_emc.h"
27
28#ifdef CONFIG_TEGRA_EMC_SCALING_ENABLE
29static bool emc_enable = true;
30#else
31static bool emc_enable;
32#endif
33module_param(emc_enable, bool, 0644);
34
35static void __iomem *emc = IO_ADDRESS(TEGRA_EMC_BASE);
36static const struct tegra_emc_table *tegra_emc_table;
37static int tegra_emc_table_size;
38
39static inline void emc_writel(u32 val, unsigned long addr)
40{
41 writel(val, emc + addr);
42}
43
44static inline u32 emc_readl(unsigned long addr)
45{
46 return readl(emc + addr);
47}
48
49static const unsigned long emc_reg_addr[TEGRA_EMC_NUM_REGS] = {
50 0x2c, /* RC */
51 0x30, /* RFC */
52 0x34, /* RAS */
53 0x38, /* RP */
54 0x3c, /* R2W */
55 0x40, /* W2R */
56 0x44, /* R2P */
57 0x48, /* W2P */
58 0x4c, /* RD_RCD */
59 0x50, /* WR_RCD */
60 0x54, /* RRD */
61 0x58, /* REXT */
62 0x5c, /* WDV */
63 0x60, /* QUSE */
64 0x64, /* QRST */
65 0x68, /* QSAFE */
66 0x6c, /* RDV */
67 0x70, /* REFRESH */
68 0x74, /* BURST_REFRESH_NUM */
69 0x78, /* PDEX2WR */
70 0x7c, /* PDEX2RD */
71 0x80, /* PCHG2PDEN */
72 0x84, /* ACT2PDEN */
73 0x88, /* AR2PDEN */
74 0x8c, /* RW2PDEN */
75 0x90, /* TXSR */
76 0x94, /* TCKE */
77 0x98, /* TFAW */
78 0x9c, /* TRPAB */
79 0xa0, /* TCLKSTABLE */
80 0xa4, /* TCLKSTOP */
81 0xa8, /* TREFBW */
82 0xac, /* QUSE_EXTRA */
83 0x114, /* FBIO_CFG6 */
84 0xb0, /* ODT_WRITE */
85 0xb4, /* ODT_READ */
86 0x104, /* FBIO_CFG5 */
87 0x2bc, /* CFG_DIG_DLL */
88 0x2c0, /* DLL_XFORM_DQS */
89 0x2c4, /* DLL_XFORM_QUSE */
90 0x2e0, /* ZCAL_REF_CNT */
91 0x2e4, /* ZCAL_WAIT_CNT */
92 0x2a8, /* AUTO_CAL_INTERVAL */
93 0x2d0, /* CFG_CLKTRIM_0 */
94 0x2d4, /* CFG_CLKTRIM_1 */
95 0x2d8, /* CFG_CLKTRIM_2 */
96};
97
98/* Select the closest EMC rate that is higher than the requested rate */
99long tegra_emc_round_rate(unsigned long rate)
100{
101 int i;
102 int best = -1;
103 unsigned long distance = ULONG_MAX;
104
105 if (!tegra_emc_table)
106 return -EINVAL;
107
108 if (!emc_enable)
109 return -EINVAL;
110
111 pr_debug("%s: %lu\n", __func__, rate);
112
113 /*
114 * The EMC clock rate is twice the bus rate, and the bus rate is
115 * measured in kHz
116 */
117 rate = rate / 2 / 1000;
118
119 for (i = 0; i < tegra_emc_table_size; i++) {
120 if (tegra_emc_table[i].rate >= rate &&
121 (tegra_emc_table[i].rate - rate) < distance) {
122 distance = tegra_emc_table[i].rate - rate;
123 best = i;
124 }
125 }
126
127 if (best < 0)
128 return -EINVAL;
129
130 pr_debug("%s: using %lu\n", __func__, tegra_emc_table[best].rate);
131
132 return tegra_emc_table[best].rate * 2 * 1000;
133}
134
135/*
136 * The EMC registers have shadow registers. When the EMC clock is updated
137 * in the clock controller, the shadow registers are copied to the active
138 * registers, allowing glitchless memory bus frequency changes.
139 * This function updates the shadow registers for a new clock frequency,
140 * and relies on the clock lock on the emc clock to avoid races between
141 * multiple frequency changes
142 */
143int tegra_emc_set_rate(unsigned long rate)
144{
145 int i;
146 int j;
147
148 if (!tegra_emc_table)
149 return -EINVAL;
150
151 /*
152 * The EMC clock rate is twice the bus rate, and the bus rate is
153 * measured in kHz
154 */
155 rate = rate / 2 / 1000;
156
157 for (i = 0; i < tegra_emc_table_size; i++)
158 if (tegra_emc_table[i].rate == rate)
159 break;
160
161 if (i >= tegra_emc_table_size)
162 return -EINVAL;
163
164 pr_debug("%s: setting to %lu\n", __func__, rate);
165
166 for (j = 0; j < TEGRA_EMC_NUM_REGS; j++)
167 emc_writel(tegra_emc_table[i].regs[j], emc_reg_addr[j]);
168
169 emc_readl(tegra_emc_table[i].regs[TEGRA_EMC_NUM_REGS - 1]);
170
171 return 0;
172}
173
174void tegra_init_emc(const struct tegra_emc_table *table, int table_size)
175{
176 tegra_emc_table = table;
177 tegra_emc_table_size = table_size;
178}
diff --git a/arch/arm/mach-tegra/tegra2_emc.h b/arch/arm/mach-tegra/tegra2_emc.h
new file mode 100644
index 000000000000..19f08cb31603
--- /dev/null
+++ b/arch/arm/mach-tegra/tegra2_emc.h
@@ -0,0 +1,27 @@
1/*
2 * Copyright (C) 2011 Google, Inc.
3 *
4 * Author:
5 * Colin Cross <ccross@android.com>
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17
18#define TEGRA_EMC_NUM_REGS 46
19
20struct tegra_emc_table {
21 unsigned long rate;
22 u32 regs[TEGRA_EMC_NUM_REGS];
23};
24
25int tegra_emc_set_rate(unsigned long rate);
26long tegra_emc_round_rate(unsigned long rate);
27void tegra_init_emc(const struct tegra_emc_table *table, int table_size);
diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
index 7b8ad1f98f44..0fcb1eb4214d 100644
--- a/arch/arm/mach-tegra/timer.c
+++ b/arch/arm/mach-tegra/timer.c
@@ -18,6 +18,7 @@
18 */ 18 */
19 19
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/err.h>
21#include <linux/sched.h> 22#include <linux/sched.h>
22#include <linux/time.h> 23#include <linux/time.h>
23#include <linux/interrupt.h> 24#include <linux/interrupt.h>
@@ -33,10 +34,15 @@
33 34
34#include <mach/iomap.h> 35#include <mach/iomap.h>
35#include <mach/irqs.h> 36#include <mach/irqs.h>
37#include <mach/suspend.h>
36 38
37#include "board.h" 39#include "board.h"
38#include "clock.h" 40#include "clock.h"
39 41
42#define RTC_SECONDS 0x08
43#define RTC_SHADOW_SECONDS 0x0c
44#define RTC_MILLISECONDS 0x10
45
40#define TIMERUS_CNTR_1US 0x10 46#define TIMERUS_CNTR_1US 0x10
41#define TIMERUS_USEC_CFG 0x14 47#define TIMERUS_USEC_CFG 0x14
42#define TIMERUS_CNTR_FREEZE 0x4c 48#define TIMERUS_CNTR_FREEZE 0x4c
@@ -49,9 +55,11 @@
49#define TIMER_PTV 0x0 55#define TIMER_PTV 0x0
50#define TIMER_PCR 0x4 56#define TIMER_PCR 0x4
51 57
52struct tegra_timer;
53
54static void __iomem *timer_reg_base = IO_ADDRESS(TEGRA_TMR1_BASE); 58static void __iomem *timer_reg_base = IO_ADDRESS(TEGRA_TMR1_BASE);
59static void __iomem *rtc_base = IO_ADDRESS(TEGRA_RTC_BASE);
60
61static struct timespec persistent_ts;
62static u64 persistent_ms, last_persistent_ms;
55 63
56#define timer_writel(value, reg) \ 64#define timer_writel(value, reg) \
57 __raw_writel(value, (u32)timer_reg_base + (reg)) 65 __raw_writel(value, (u32)timer_reg_base + (reg))
@@ -132,6 +140,42 @@ static void notrace tegra_update_sched_clock(void)
132 update_sched_clock(&cd, cyc, (u32)~0); 140 update_sched_clock(&cd, cyc, (u32)~0);
133} 141}
134 142
143/*
144 * tegra_rtc_read - Reads the Tegra RTC registers
145 * Care must be taken that this funciton is not called while the
146 * tegra_rtc driver could be executing to avoid race conditions
147 * on the RTC shadow register
148 */
149u64 tegra_rtc_read_ms(void)
150{
151 u32 ms = readl(rtc_base + RTC_MILLISECONDS);
152 u32 s = readl(rtc_base + RTC_SHADOW_SECONDS);
153 return (u64)s * MSEC_PER_SEC + ms;
154}
155
156/*
157 * read_persistent_clock - Return time from a persistent clock.
158 *
159 * Reads the time from a source which isn't disabled during PM, the
160 * 32k sync timer. Convert the cycles elapsed since last read into
161 * nsecs and adds to a monotonically increasing timespec.
162 * Care must be taken that this funciton is not called while the
163 * tegra_rtc driver could be executing to avoid race conditions
164 * on the RTC shadow register
165 */
166void read_persistent_clock(struct timespec *ts)
167{
168 u64 delta;
169 struct timespec *tsp = &persistent_ts;
170
171 last_persistent_ms = persistent_ms;
172 persistent_ms = tegra_rtc_read_ms();
173 delta = persistent_ms - last_persistent_ms;
174
175 timespec_add_ns(tsp, delta * NSEC_PER_MSEC);
176 *ts = *tsp;
177}
178
135static irqreturn_t tegra_timer_interrupt(int irq, void *dev_id) 179static irqreturn_t tegra_timer_interrupt(int irq, void *dev_id)
136{ 180{
137 struct clock_event_device *evt = (struct clock_event_device *)dev_id; 181 struct clock_event_device *evt = (struct clock_event_device *)dev_id;
@@ -150,9 +194,22 @@ static struct irqaction tegra_timer_irq = {
150 194
151static void __init tegra_init_timer(void) 195static void __init tegra_init_timer(void)
152{ 196{
197 struct clk *clk;
153 unsigned long rate = clk_measure_input_freq(); 198 unsigned long rate = clk_measure_input_freq();
154 int ret; 199 int ret;
155 200
201 clk = clk_get_sys("timer", NULL);
202 BUG_ON(IS_ERR(clk));
203 clk_enable(clk);
204
205 /*
206 * rtc registers are used by read_persistent_clock, keep the rtc clock
207 * enabled
208 */
209 clk = clk_get_sys("rtc-tegra", NULL);
210 BUG_ON(IS_ERR(clk));
211 clk_enable(clk);
212
156#ifdef CONFIG_HAVE_ARM_TWD 213#ifdef CONFIG_HAVE_ARM_TWD
157 twd_base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x600); 214 twd_base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x600);
158#endif 215#endif
@@ -196,10 +253,22 @@ static void __init tegra_init_timer(void)
196 tegra_clockevent.cpumask = cpu_all_mask; 253 tegra_clockevent.cpumask = cpu_all_mask;
197 tegra_clockevent.irq = tegra_timer_irq.irq; 254 tegra_clockevent.irq = tegra_timer_irq.irq;
198 clockevents_register_device(&tegra_clockevent); 255 clockevents_register_device(&tegra_clockevent);
199
200 return;
201} 256}
202 257
203struct sys_timer tegra_timer = { 258struct sys_timer tegra_timer = {
204 .init = tegra_init_timer, 259 .init = tegra_init_timer,
205}; 260};
261
262#ifdef CONFIG_PM
263static u32 usec_config;
264
265void tegra_timer_suspend(void)
266{
267 usec_config = timer_readl(TIMERUS_USEC_CFG);
268}
269
270void tegra_timer_resume(void)
271{
272 timer_writel(usec_config, TIMERUS_USEC_CFG);
273}
274#endif
diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c
new file mode 100644
index 000000000000..88081bb3ec52
--- /dev/null
+++ b/arch/arm/mach-tegra/usb_phy.c
@@ -0,0 +1,795 @@
1/*
2 * arch/arm/mach-tegra/usb_phy.c
3 *
4 * Copyright (C) 2010 Google, Inc.
5 *
6 * Author:
7 * Erik Gilling <konkers@google.com>
8 * Benoit Goby <benoit@android.com>
9 *
10 * This software is licensed under the terms of the GNU General Public
11 * License version 2, as published by the Free Software Foundation, and
12 * may be copied, distributed, and modified under those terms.
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
21#include <linux/resource.h>
22#include <linux/delay.h>
23#include <linux/slab.h>
24#include <linux/err.h>
25#include <linux/platform_device.h>
26#include <linux/io.h>
27#include <linux/gpio.h>
28#include <linux/usb/otg.h>
29#include <linux/usb/ulpi.h>
30#include <asm/mach-types.h>
31#include <mach/usb_phy.h>
32#include <mach/iomap.h>
33
34#define ULPI_VIEWPORT 0x170
35
36#define USB_PORTSC1 0x184
37#define USB_PORTSC1_PTS(x) (((x) & 0x3) << 30)
38#define USB_PORTSC1_PSPD(x) (((x) & 0x3) << 26)
39#define USB_PORTSC1_PHCD (1 << 23)
40#define USB_PORTSC1_WKOC (1 << 22)
41#define USB_PORTSC1_WKDS (1 << 21)
42#define USB_PORTSC1_WKCN (1 << 20)
43#define USB_PORTSC1_PTC(x) (((x) & 0xf) << 16)
44#define USB_PORTSC1_PP (1 << 12)
45#define USB_PORTSC1_SUSP (1 << 7)
46#define USB_PORTSC1_PE (1 << 2)
47#define USB_PORTSC1_CCS (1 << 0)
48
49#define USB_SUSP_CTRL 0x400
50#define USB_WAKE_ON_CNNT_EN_DEV (1 << 3)
51#define USB_WAKE_ON_DISCON_EN_DEV (1 << 4)
52#define USB_SUSP_CLR (1 << 5)
53#define USB_PHY_CLK_VALID (1 << 7)
54#define UTMIP_RESET (1 << 11)
55#define UHSIC_RESET (1 << 11)
56#define UTMIP_PHY_ENABLE (1 << 12)
57#define ULPI_PHY_ENABLE (1 << 13)
58#define USB_SUSP_SET (1 << 14)
59#define USB_WAKEUP_DEBOUNCE_COUNT(x) (((x) & 0x7) << 16)
60
61#define USB1_LEGACY_CTRL 0x410
62#define USB1_NO_LEGACY_MODE (1 << 0)
63#define USB1_VBUS_SENSE_CTL_MASK (3 << 1)
64#define USB1_VBUS_SENSE_CTL_VBUS_WAKEUP (0 << 1)
65#define USB1_VBUS_SENSE_CTL_AB_SESS_VLD_OR_VBUS_WAKEUP \
66 (1 << 1)
67#define USB1_VBUS_SENSE_CTL_AB_SESS_VLD (2 << 1)
68#define USB1_VBUS_SENSE_CTL_A_SESS_VLD (3 << 1)
69
70#define ULPI_TIMING_CTRL_0 0x424
71#define ULPI_OUTPUT_PINMUX_BYP (1 << 10)
72#define ULPI_CLKOUT_PINMUX_BYP (1 << 11)
73
74#define ULPI_TIMING_CTRL_1 0x428
75#define ULPI_DATA_TRIMMER_LOAD (1 << 0)
76#define ULPI_DATA_TRIMMER_SEL(x) (((x) & 0x7) << 1)
77#define ULPI_STPDIRNXT_TRIMMER_LOAD (1 << 16)
78#define ULPI_STPDIRNXT_TRIMMER_SEL(x) (((x) & 0x7) << 17)
79#define ULPI_DIR_TRIMMER_LOAD (1 << 24)
80#define ULPI_DIR_TRIMMER_SEL(x) (((x) & 0x7) << 25)
81
82#define UTMIP_PLL_CFG1 0x804
83#define UTMIP_XTAL_FREQ_COUNT(x) (((x) & 0xfff) << 0)
84#define UTMIP_PLLU_ENABLE_DLY_COUNT(x) (((x) & 0x1f) << 27)
85
86#define UTMIP_XCVR_CFG0 0x808
87#define UTMIP_XCVR_SETUP(x) (((x) & 0xf) << 0)
88#define UTMIP_XCVR_LSRSLEW(x) (((x) & 0x3) << 8)
89#define UTMIP_XCVR_LSFSLEW(x) (((x) & 0x3) << 10)
90#define UTMIP_FORCE_PD_POWERDOWN (1 << 14)
91#define UTMIP_FORCE_PD2_POWERDOWN (1 << 16)
92#define UTMIP_FORCE_PDZI_POWERDOWN (1 << 18)
93#define UTMIP_XCVR_HSSLEW_MSB(x) (((x) & 0x7f) << 25)
94
95#define UTMIP_BIAS_CFG0 0x80c
96#define UTMIP_OTGPD (1 << 11)
97#define UTMIP_BIASPD (1 << 10)
98
99#define UTMIP_HSRX_CFG0 0x810
100#define UTMIP_ELASTIC_LIMIT(x) (((x) & 0x1f) << 10)
101#define UTMIP_IDLE_WAIT(x) (((x) & 0x1f) << 15)
102
103#define UTMIP_HSRX_CFG1 0x814
104#define UTMIP_HS_SYNC_START_DLY(x) (((x) & 0x1f) << 1)
105
106#define UTMIP_TX_CFG0 0x820
107#define UTMIP_FS_PREABMLE_J (1 << 19)
108#define UTMIP_HS_DISCON_DISABLE (1 << 8)
109
110#define UTMIP_MISC_CFG0 0x824
111#define UTMIP_DPDM_OBSERVE (1 << 26)
112#define UTMIP_DPDM_OBSERVE_SEL(x) (((x) & 0xf) << 27)
113#define UTMIP_DPDM_OBSERVE_SEL_FS_J UTMIP_DPDM_OBSERVE_SEL(0xf)
114#define UTMIP_DPDM_OBSERVE_SEL_FS_K UTMIP_DPDM_OBSERVE_SEL(0xe)
115#define UTMIP_DPDM_OBSERVE_SEL_FS_SE1 UTMIP_DPDM_OBSERVE_SEL(0xd)
116#define UTMIP_DPDM_OBSERVE_SEL_FS_SE0 UTMIP_DPDM_OBSERVE_SEL(0xc)
117#define UTMIP_SUSPEND_EXIT_ON_EDGE (1 << 22)
118
119#define UTMIP_MISC_CFG1 0x828
120#define UTMIP_PLL_ACTIVE_DLY_COUNT(x) (((x) & 0x1f) << 18)
121#define UTMIP_PLLU_STABLE_COUNT(x) (((x) & 0xfff) << 6)
122
123#define UTMIP_DEBOUNCE_CFG0 0x82c
124#define UTMIP_BIAS_DEBOUNCE_A(x) (((x) & 0xffff) << 0)
125
126#define UTMIP_BAT_CHRG_CFG0 0x830
127#define UTMIP_PD_CHRG (1 << 0)
128
129#define UTMIP_SPARE_CFG0 0x834
130#define FUSE_SETUP_SEL (1 << 3)
131
132#define UTMIP_XCVR_CFG1 0x838
133#define UTMIP_FORCE_PDDISC_POWERDOWN (1 << 0)
134#define UTMIP_FORCE_PDCHRP_POWERDOWN (1 << 2)
135#define UTMIP_FORCE_PDDR_POWERDOWN (1 << 4)
136#define UTMIP_XCVR_TERM_RANGE_ADJ(x) (((x) & 0xf) << 18)
137
138#define UTMIP_BIAS_CFG1 0x83c
139#define UTMIP_BIAS_PDTRK_COUNT(x) (((x) & 0x1f) << 3)
140
141static DEFINE_SPINLOCK(utmip_pad_lock);
142static int utmip_pad_count;
143
144struct tegra_xtal_freq {
145 int freq;
146 u8 enable_delay;
147 u8 stable_count;
148 u8 active_delay;
149 u8 xtal_freq_count;
150 u16 debounce;
151};
152
153static const struct tegra_xtal_freq tegra_freq_table[] = {
154 {
155 .freq = 12000000,
156 .enable_delay = 0x02,
157 .stable_count = 0x2F,
158 .active_delay = 0x04,
159 .xtal_freq_count = 0x76,
160 .debounce = 0x7530,
161 },
162 {
163 .freq = 13000000,
164 .enable_delay = 0x02,
165 .stable_count = 0x33,
166 .active_delay = 0x05,
167 .xtal_freq_count = 0x7F,
168 .debounce = 0x7EF4,
169 },
170 {
171 .freq = 19200000,
172 .enable_delay = 0x03,
173 .stable_count = 0x4B,
174 .active_delay = 0x06,
175 .xtal_freq_count = 0xBB,
176 .debounce = 0xBB80,
177 },
178 {
179 .freq = 26000000,
180 .enable_delay = 0x04,
181 .stable_count = 0x66,
182 .active_delay = 0x09,
183 .xtal_freq_count = 0xFE,
184 .debounce = 0xFDE8,
185 },
186};
187
188static struct tegra_utmip_config utmip_default[] = {
189 [0] = {
190 .hssync_start_delay = 9,
191 .idle_wait_delay = 17,
192 .elastic_limit = 16,
193 .term_range_adj = 6,
194 .xcvr_setup = 9,
195 .xcvr_lsfslew = 1,
196 .xcvr_lsrslew = 1,
197 },
198 [2] = {
199 .hssync_start_delay = 9,
200 .idle_wait_delay = 17,
201 .elastic_limit = 16,
202 .term_range_adj = 6,
203 .xcvr_setup = 9,
204 .xcvr_lsfslew = 2,
205 .xcvr_lsrslew = 2,
206 },
207};
208
209static inline bool phy_is_ulpi(struct tegra_usb_phy *phy)
210{
211 return (phy->instance == 1);
212}
213
214static int utmip_pad_open(struct tegra_usb_phy *phy)
215{
216 phy->pad_clk = clk_get_sys("utmip-pad", NULL);
217 if (IS_ERR(phy->pad_clk)) {
218 pr_err("%s: can't get utmip pad clock\n", __func__);
219 return PTR_ERR(phy->pad_clk);
220 }
221
222 if (phy->instance == 0) {
223 phy->pad_regs = phy->regs;
224 } else {
225 phy->pad_regs = ioremap(TEGRA_USB_BASE, TEGRA_USB_SIZE);
226 if (!phy->pad_regs) {
227 pr_err("%s: can't remap usb registers\n", __func__);
228 clk_put(phy->pad_clk);
229 return -ENOMEM;
230 }
231 }
232 return 0;
233}
234
235static void utmip_pad_close(struct tegra_usb_phy *phy)
236{
237 if (phy->instance != 0)
238 iounmap(phy->pad_regs);
239 clk_put(phy->pad_clk);
240}
241
242static void utmip_pad_power_on(struct tegra_usb_phy *phy)
243{
244 unsigned long val, flags;
245 void __iomem *base = phy->pad_regs;
246
247 clk_enable(phy->pad_clk);
248
249 spin_lock_irqsave(&utmip_pad_lock, flags);
250
251 if (utmip_pad_count++ == 0) {
252 val = readl(base + UTMIP_BIAS_CFG0);
253 val &= ~(UTMIP_OTGPD | UTMIP_BIASPD);
254 writel(val, base + UTMIP_BIAS_CFG0);
255 }
256
257 spin_unlock_irqrestore(&utmip_pad_lock, flags);
258
259 clk_disable(phy->pad_clk);
260}
261
262static int utmip_pad_power_off(struct tegra_usb_phy *phy)
263{
264 unsigned long val, flags;
265 void __iomem *base = phy->pad_regs;
266
267 if (!utmip_pad_count) {
268 pr_err("%s: utmip pad already powered off\n", __func__);
269 return -EINVAL;
270 }
271
272 clk_enable(phy->pad_clk);
273
274 spin_lock_irqsave(&utmip_pad_lock, flags);
275
276 if (--utmip_pad_count == 0) {
277 val = readl(base + UTMIP_BIAS_CFG0);
278 val |= UTMIP_OTGPD | UTMIP_BIASPD;
279 writel(val, base + UTMIP_BIAS_CFG0);
280 }
281
282 spin_unlock_irqrestore(&utmip_pad_lock, flags);
283
284 clk_disable(phy->pad_clk);
285
286 return 0;
287}
288
289static int utmi_wait_register(void __iomem *reg, u32 mask, u32 result)
290{
291 unsigned long timeout = 2000;
292 do {
293 if ((readl(reg) & mask) == result)
294 return 0;
295 udelay(1);
296 timeout--;
297 } while (timeout);
298 return -1;
299}
300
301static void utmi_phy_clk_disable(struct tegra_usb_phy *phy)
302{
303 unsigned long val;
304 void __iomem *base = phy->regs;
305
306 if (phy->instance == 0) {
307 val = readl(base + USB_SUSP_CTRL);
308 val |= USB_SUSP_SET;
309 writel(val, base + USB_SUSP_CTRL);
310
311 udelay(10);
312
313 val = readl(base + USB_SUSP_CTRL);
314 val &= ~USB_SUSP_SET;
315 writel(val, base + USB_SUSP_CTRL);
316 }
317
318 if (phy->instance == 2) {
319 val = readl(base + USB_PORTSC1);
320 val |= USB_PORTSC1_PHCD;
321 writel(val, base + USB_PORTSC1);
322 }
323
324 if (utmi_wait_register(base + USB_SUSP_CTRL, USB_PHY_CLK_VALID, 0) < 0)
325 pr_err("%s: timeout waiting for phy to stabilize\n", __func__);
326}
327
328static void utmi_phy_clk_enable(struct tegra_usb_phy *phy)
329{
330 unsigned long val;
331 void __iomem *base = phy->regs;
332
333 if (phy->instance == 0) {
334 val = readl(base + USB_SUSP_CTRL);
335 val |= USB_SUSP_CLR;
336 writel(val, base + USB_SUSP_CTRL);
337
338 udelay(10);
339
340 val = readl(base + USB_SUSP_CTRL);
341 val &= ~USB_SUSP_CLR;
342 writel(val, base + USB_SUSP_CTRL);
343 }
344
345 if (phy->instance == 2) {
346 val = readl(base + USB_PORTSC1);
347 val &= ~USB_PORTSC1_PHCD;
348 writel(val, base + USB_PORTSC1);
349 }
350
351 if (utmi_wait_register(base + USB_SUSP_CTRL, USB_PHY_CLK_VALID,
352 USB_PHY_CLK_VALID))
353 pr_err("%s: timeout waiting for phy to stabilize\n", __func__);
354}
355
356static int utmi_phy_power_on(struct tegra_usb_phy *phy)
357{
358 unsigned long val;
359 void __iomem *base = phy->regs;
360 struct tegra_utmip_config *config = phy->config;
361
362 val = readl(base + USB_SUSP_CTRL);
363 val |= UTMIP_RESET;
364 writel(val, base + USB_SUSP_CTRL);
365
366 if (phy->instance == 0) {
367 val = readl(base + USB1_LEGACY_CTRL);
368 val |= USB1_NO_LEGACY_MODE;
369 writel(val, base + USB1_LEGACY_CTRL);
370 }
371
372 val = readl(base + UTMIP_TX_CFG0);
373 val &= ~UTMIP_FS_PREABMLE_J;
374 writel(val, base + UTMIP_TX_CFG0);
375
376 val = readl(base + UTMIP_HSRX_CFG0);
377 val &= ~(UTMIP_IDLE_WAIT(~0) | UTMIP_ELASTIC_LIMIT(~0));
378 val |= UTMIP_IDLE_WAIT(config->idle_wait_delay);
379 val |= UTMIP_ELASTIC_LIMIT(config->elastic_limit);
380 writel(val, base + UTMIP_HSRX_CFG0);
381
382 val = readl(base + UTMIP_HSRX_CFG1);
383 val &= ~UTMIP_HS_SYNC_START_DLY(~0);
384 val |= UTMIP_HS_SYNC_START_DLY(config->hssync_start_delay);
385 writel(val, base + UTMIP_HSRX_CFG1);
386
387 val = readl(base + UTMIP_DEBOUNCE_CFG0);
388 val &= ~UTMIP_BIAS_DEBOUNCE_A(~0);
389 val |= UTMIP_BIAS_DEBOUNCE_A(phy->freq->debounce);
390 writel(val, base + UTMIP_DEBOUNCE_CFG0);
391
392 val = readl(base + UTMIP_MISC_CFG0);
393 val &= ~UTMIP_SUSPEND_EXIT_ON_EDGE;
394 writel(val, base + UTMIP_MISC_CFG0);
395
396 val = readl(base + UTMIP_MISC_CFG1);
397 val &= ~(UTMIP_PLL_ACTIVE_DLY_COUNT(~0) | UTMIP_PLLU_STABLE_COUNT(~0));
398 val |= UTMIP_PLL_ACTIVE_DLY_COUNT(phy->freq->active_delay) |
399 UTMIP_PLLU_STABLE_COUNT(phy->freq->stable_count);
400 writel(val, base + UTMIP_MISC_CFG1);
401
402 val = readl(base + UTMIP_PLL_CFG1);
403 val &= ~(UTMIP_XTAL_FREQ_COUNT(~0) | UTMIP_PLLU_ENABLE_DLY_COUNT(~0));
404 val |= UTMIP_XTAL_FREQ_COUNT(phy->freq->xtal_freq_count) |
405 UTMIP_PLLU_ENABLE_DLY_COUNT(phy->freq->enable_delay);
406 writel(val, base + UTMIP_PLL_CFG1);
407
408 if (phy->mode == TEGRA_USB_PHY_MODE_DEVICE) {
409 val = readl(base + USB_SUSP_CTRL);
410 val &= ~(USB_WAKE_ON_CNNT_EN_DEV | USB_WAKE_ON_DISCON_EN_DEV);
411 writel(val, base + USB_SUSP_CTRL);
412 }
413
414 utmip_pad_power_on(phy);
415
416 val = readl(base + UTMIP_XCVR_CFG0);
417 val &= ~(UTMIP_FORCE_PD_POWERDOWN | UTMIP_FORCE_PD2_POWERDOWN |
418 UTMIP_FORCE_PDZI_POWERDOWN | UTMIP_XCVR_SETUP(~0) |
419 UTMIP_XCVR_LSFSLEW(~0) | UTMIP_XCVR_LSRSLEW(~0) |
420 UTMIP_XCVR_HSSLEW_MSB(~0));
421 val |= UTMIP_XCVR_SETUP(config->xcvr_setup);
422 val |= UTMIP_XCVR_LSFSLEW(config->xcvr_lsfslew);
423 val |= UTMIP_XCVR_LSRSLEW(config->xcvr_lsrslew);
424 writel(val, base + UTMIP_XCVR_CFG0);
425
426 val = readl(base + UTMIP_XCVR_CFG1);
427 val &= ~(UTMIP_FORCE_PDDISC_POWERDOWN | UTMIP_FORCE_PDCHRP_POWERDOWN |
428 UTMIP_FORCE_PDDR_POWERDOWN | UTMIP_XCVR_TERM_RANGE_ADJ(~0));
429 val |= UTMIP_XCVR_TERM_RANGE_ADJ(config->term_range_adj);
430 writel(val, base + UTMIP_XCVR_CFG1);
431
432 val = readl(base + UTMIP_BAT_CHRG_CFG0);
433 val &= ~UTMIP_PD_CHRG;
434 writel(val, base + UTMIP_BAT_CHRG_CFG0);
435
436 val = readl(base + UTMIP_BIAS_CFG1);
437 val &= ~UTMIP_BIAS_PDTRK_COUNT(~0);
438 val |= UTMIP_BIAS_PDTRK_COUNT(0x5);
439 writel(val, base + UTMIP_BIAS_CFG1);
440
441 if (phy->instance == 0) {
442 val = readl(base + UTMIP_SPARE_CFG0);
443 if (phy->mode == TEGRA_USB_PHY_MODE_DEVICE)
444 val &= ~FUSE_SETUP_SEL;
445 else
446 val |= FUSE_SETUP_SEL;
447 writel(val, base + UTMIP_SPARE_CFG0);
448 }
449
450 if (phy->instance == 2) {
451 val = readl(base + USB_SUSP_CTRL);
452 val |= UTMIP_PHY_ENABLE;
453 writel(val, base + USB_SUSP_CTRL);
454 }
455
456 val = readl(base + USB_SUSP_CTRL);
457 val &= ~UTMIP_RESET;
458 writel(val, base + USB_SUSP_CTRL);
459
460 if (phy->instance == 0) {
461 val = readl(base + USB1_LEGACY_CTRL);
462 val &= ~USB1_VBUS_SENSE_CTL_MASK;
463 val |= USB1_VBUS_SENSE_CTL_A_SESS_VLD;
464 writel(val, base + USB1_LEGACY_CTRL);
465
466 val = readl(base + USB_SUSP_CTRL);
467 val &= ~USB_SUSP_SET;
468 writel(val, base + USB_SUSP_CTRL);
469 }
470
471 utmi_phy_clk_enable(phy);
472
473 if (phy->instance == 2) {
474 val = readl(base + USB_PORTSC1);
475 val &= ~USB_PORTSC1_PTS(~0);
476 writel(val, base + USB_PORTSC1);
477 }
478
479 return 0;
480}
481
482static void utmi_phy_power_off(struct tegra_usb_phy *phy)
483{
484 unsigned long val;
485 void __iomem *base = phy->regs;
486
487 utmi_phy_clk_disable(phy);
488
489 if (phy->mode == TEGRA_USB_PHY_MODE_DEVICE) {
490 val = readl(base + USB_SUSP_CTRL);
491 val &= ~USB_WAKEUP_DEBOUNCE_COUNT(~0);
492 val |= USB_WAKE_ON_CNNT_EN_DEV | USB_WAKEUP_DEBOUNCE_COUNT(5);
493 writel(val, base + USB_SUSP_CTRL);
494 }
495
496 val = readl(base + USB_SUSP_CTRL);
497 val |= UTMIP_RESET;
498 writel(val, base + USB_SUSP_CTRL);
499
500 val = readl(base + UTMIP_BAT_CHRG_CFG0);
501 val |= UTMIP_PD_CHRG;
502 writel(val, base + UTMIP_BAT_CHRG_CFG0);
503
504 val = readl(base + UTMIP_XCVR_CFG0);
505 val |= UTMIP_FORCE_PD_POWERDOWN | UTMIP_FORCE_PD2_POWERDOWN |
506 UTMIP_FORCE_PDZI_POWERDOWN;
507 writel(val, base + UTMIP_XCVR_CFG0);
508
509 val = readl(base + UTMIP_XCVR_CFG1);
510 val |= UTMIP_FORCE_PDDISC_POWERDOWN | UTMIP_FORCE_PDCHRP_POWERDOWN |
511 UTMIP_FORCE_PDDR_POWERDOWN;
512 writel(val, base + UTMIP_XCVR_CFG1);
513
514 utmip_pad_power_off(phy);
515}
516
517static void utmi_phy_preresume(struct tegra_usb_phy *phy)
518{
519 unsigned long val;
520 void __iomem *base = phy->regs;
521
522 val = readl(base + UTMIP_TX_CFG0);
523 val |= UTMIP_HS_DISCON_DISABLE;
524 writel(val, base + UTMIP_TX_CFG0);
525}
526
527static void utmi_phy_postresume(struct tegra_usb_phy *phy)
528{
529 unsigned long val;
530 void __iomem *base = phy->regs;
531
532 val = readl(base + UTMIP_TX_CFG0);
533 val &= ~UTMIP_HS_DISCON_DISABLE;
534 writel(val, base + UTMIP_TX_CFG0);
535}
536
537static void utmi_phy_restore_start(struct tegra_usb_phy *phy,
538 enum tegra_usb_phy_port_speed port_speed)
539{
540 unsigned long val;
541 void __iomem *base = phy->regs;
542
543 val = readl(base + UTMIP_MISC_CFG0);
544 val &= ~UTMIP_DPDM_OBSERVE_SEL(~0);
545 if (port_speed == TEGRA_USB_PHY_PORT_SPEED_LOW)
546 val |= UTMIP_DPDM_OBSERVE_SEL_FS_K;
547 else
548 val |= UTMIP_DPDM_OBSERVE_SEL_FS_J;
549 writel(val, base + UTMIP_MISC_CFG0);
550 udelay(1);
551
552 val = readl(base + UTMIP_MISC_CFG0);
553 val |= UTMIP_DPDM_OBSERVE;
554 writel(val, base + UTMIP_MISC_CFG0);
555 udelay(10);
556}
557
558static void utmi_phy_restore_end(struct tegra_usb_phy *phy)
559{
560 unsigned long val;
561 void __iomem *base = phy->regs;
562
563 val = readl(base + UTMIP_MISC_CFG0);
564 val &= ~UTMIP_DPDM_OBSERVE;
565 writel(val, base + UTMIP_MISC_CFG0);
566 udelay(10);
567}
568
569static int ulpi_phy_power_on(struct tegra_usb_phy *phy)
570{
571 int ret;
572 unsigned long val;
573 void __iomem *base = phy->regs;
574 struct tegra_ulpi_config *config = phy->config;
575
576 gpio_direction_output(config->reset_gpio, 0);
577 msleep(5);
578 gpio_direction_output(config->reset_gpio, 1);
579
580 clk_enable(phy->clk);
581 msleep(1);
582
583 val = readl(base + USB_SUSP_CTRL);
584 val |= UHSIC_RESET;
585 writel(val, base + USB_SUSP_CTRL);
586
587 val = readl(base + ULPI_TIMING_CTRL_0);
588 val |= ULPI_OUTPUT_PINMUX_BYP | ULPI_CLKOUT_PINMUX_BYP;
589 writel(val, base + ULPI_TIMING_CTRL_0);
590
591 val = readl(base + USB_SUSP_CTRL);
592 val |= ULPI_PHY_ENABLE;
593 writel(val, base + USB_SUSP_CTRL);
594
595 val = 0;
596 writel(val, base + ULPI_TIMING_CTRL_1);
597
598 val |= ULPI_DATA_TRIMMER_SEL(4);
599 val |= ULPI_STPDIRNXT_TRIMMER_SEL(4);
600 val |= ULPI_DIR_TRIMMER_SEL(4);
601 writel(val, base + ULPI_TIMING_CTRL_1);
602 udelay(10);
603
604 val |= ULPI_DATA_TRIMMER_LOAD;
605 val |= ULPI_STPDIRNXT_TRIMMER_LOAD;
606 val |= ULPI_DIR_TRIMMER_LOAD;
607 writel(val, base + ULPI_TIMING_CTRL_1);
608
609 /* Fix VbusInvalid due to floating VBUS */
610 ret = otg_io_write(phy->ulpi, 0x40, 0x08);
611 if (ret) {
612 pr_err("%s: ulpi write failed\n", __func__);
613 return ret;
614 }
615
616 ret = otg_io_write(phy->ulpi, 0x80, 0x0B);
617 if (ret) {
618 pr_err("%s: ulpi write failed\n", __func__);
619 return ret;
620 }
621
622 val = readl(base + USB_PORTSC1);
623 val |= USB_PORTSC1_WKOC | USB_PORTSC1_WKDS | USB_PORTSC1_WKCN;
624 writel(val, base + USB_PORTSC1);
625
626 val = readl(base + USB_SUSP_CTRL);
627 val |= USB_SUSP_CLR;
628 writel(val, base + USB_SUSP_CTRL);
629 udelay(100);
630
631 val = readl(base + USB_SUSP_CTRL);
632 val &= ~USB_SUSP_CLR;
633 writel(val, base + USB_SUSP_CTRL);
634
635 return 0;
636}
637
638static void ulpi_phy_power_off(struct tegra_usb_phy *phy)
639{
640 unsigned long val;
641 void __iomem *base = phy->regs;
642 struct tegra_ulpi_config *config = phy->config;
643
644 /* Clear WKCN/WKDS/WKOC wake-on events that can cause the USB
645 * Controller to immediately bring the ULPI PHY out of low power
646 */
647 val = readl(base + USB_PORTSC1);
648 val &= ~(USB_PORTSC1_WKOC | USB_PORTSC1_WKDS | USB_PORTSC1_WKCN);
649 writel(val, base + USB_PORTSC1);
650
651 gpio_direction_output(config->reset_gpio, 0);
652 clk_disable(phy->clk);
653}
654
655struct tegra_usb_phy *tegra_usb_phy_open(int instance, void __iomem *regs,
656 void *config, enum tegra_usb_phy_mode phy_mode)
657{
658 struct tegra_usb_phy *phy;
659 struct tegra_ulpi_config *ulpi_config;
660 unsigned long parent_rate;
661 int i;
662 int err;
663
664 phy = kmalloc(sizeof(struct tegra_usb_phy), GFP_KERNEL);
665 if (!phy)
666 return ERR_PTR(-ENOMEM);
667
668 phy->instance = instance;
669 phy->regs = regs;
670 phy->config = config;
671 phy->mode = phy_mode;
672
673 if (!phy->config) {
674 if (phy_is_ulpi(phy)) {
675 pr_err("%s: ulpi phy configuration missing", __func__);
676 err = -EINVAL;
677 goto err0;
678 } else {
679 phy->config = &utmip_default[instance];
680 }
681 }
682
683 phy->pll_u = clk_get_sys(NULL, "pll_u");
684 if (IS_ERR(phy->pll_u)) {
685 pr_err("Can't get pll_u clock\n");
686 err = PTR_ERR(phy->pll_u);
687 goto err0;
688 }
689 clk_enable(phy->pll_u);
690
691 parent_rate = clk_get_rate(clk_get_parent(phy->pll_u));
692 for (i = 0; i < ARRAY_SIZE(tegra_freq_table); i++) {
693 if (tegra_freq_table[i].freq == parent_rate) {
694 phy->freq = &tegra_freq_table[i];
695 break;
696 }
697 }
698 if (!phy->freq) {
699 pr_err("invalid pll_u parent rate %ld\n", parent_rate);
700 err = -EINVAL;
701 goto err1;
702 }
703
704 if (phy_is_ulpi(phy)) {
705 ulpi_config = config;
706 phy->clk = clk_get_sys(NULL, ulpi_config->clk);
707 if (IS_ERR(phy->clk)) {
708 pr_err("%s: can't get ulpi clock\n", __func__);
709 err = -ENXIO;
710 goto err1;
711 }
712 tegra_gpio_enable(ulpi_config->reset_gpio);
713 gpio_request(ulpi_config->reset_gpio, "ulpi_phy_reset_b");
714 gpio_direction_output(ulpi_config->reset_gpio, 0);
715 phy->ulpi = otg_ulpi_create(&ulpi_viewport_access_ops, 0);
716 phy->ulpi->io_priv = regs + ULPI_VIEWPORT;
717 } else {
718 err = utmip_pad_open(phy);
719 if (err < 0)
720 goto err1;
721 }
722
723 return phy;
724
725err1:
726 clk_disable(phy->pll_u);
727 clk_put(phy->pll_u);
728err0:
729 kfree(phy);
730 return ERR_PTR(err);
731}
732
733int tegra_usb_phy_power_on(struct tegra_usb_phy *phy)
734{
735 if (phy_is_ulpi(phy))
736 return ulpi_phy_power_on(phy);
737 else
738 return utmi_phy_power_on(phy);
739}
740
741void tegra_usb_phy_power_off(struct tegra_usb_phy *phy)
742{
743 if (phy_is_ulpi(phy))
744 ulpi_phy_power_off(phy);
745 else
746 utmi_phy_power_off(phy);
747}
748
749void tegra_usb_phy_preresume(struct tegra_usb_phy *phy)
750{
751 if (!phy_is_ulpi(phy))
752 utmi_phy_preresume(phy);
753}
754
755void tegra_usb_phy_postresume(struct tegra_usb_phy *phy)
756{
757 if (!phy_is_ulpi(phy))
758 utmi_phy_postresume(phy);
759}
760
761void tegra_ehci_phy_restore_start(struct tegra_usb_phy *phy,
762 enum tegra_usb_phy_port_speed port_speed)
763{
764 if (!phy_is_ulpi(phy))
765 utmi_phy_restore_start(phy, port_speed);
766}
767
768void tegra_ehci_phy_restore_end(struct tegra_usb_phy *phy)
769{
770 if (!phy_is_ulpi(phy))
771 utmi_phy_restore_end(phy);
772}
773
774void tegra_usb_phy_clk_disable(struct tegra_usb_phy *phy)
775{
776 if (!phy_is_ulpi(phy))
777 utmi_phy_clk_disable(phy);
778}
779
780void tegra_usb_phy_clk_enable(struct tegra_usb_phy *phy)
781{
782 if (!phy_is_ulpi(phy))
783 utmi_phy_clk_enable(phy);
784}
785
786void tegra_usb_phy_close(struct tegra_usb_phy *phy)
787{
788 if (phy_is_ulpi(phy))
789 clk_put(phy->clk);
790 else
791 utmip_pad_close(phy);
792 clk_disable(phy->pll_u);
793 clk_put(phy->pll_u);
794 kfree(phy);
795}
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c
index aa53ee22438f..513d6abec1f5 100644
--- a/arch/arm/mach-u300/core.c
+++ b/arch/arm/mach-u300/core.c
@@ -3,7 +3,7 @@
3 * arch/arm/mach-u300/core.c 3 * arch/arm/mach-u300/core.c
4 * 4 *
5 * 5 *
6 * Copyright (C) 2007-2010 ST-Ericsson AB 6 * Copyright (C) 2007-2010 ST-Ericsson SA
7 * License terms: GNU General Public License (GPL) version 2 7 * License terms: GNU General Public License (GPL) version 2
8 * Core platform support, IRQ handling and device definitions. 8 * Core platform support, IRQ handling and device definitions.
9 * Author: Linus Walleij <linus.walleij@stericsson.com> 9 * Author: Linus Walleij <linus.walleij@stericsson.com>
@@ -16,7 +16,9 @@
16#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/mm.h> 17#include <linux/mm.h>
18#include <linux/termios.h> 18#include <linux/termios.h>
19#include <linux/dmaengine.h>
19#include <linux/amba/bus.h> 20#include <linux/amba/bus.h>
21#include <linux/amba/serial.h>
20#include <linux/platform_device.h> 22#include <linux/platform_device.h>
21#include <linux/gpio.h> 23#include <linux/gpio.h>
22#include <linux/clk.h> 24#include <linux/clk.h>
@@ -96,10 +98,20 @@ void __init u300_map_io(void)
96 * Declaration of devices found on the U300 board and 98 * Declaration of devices found on the U300 board and
97 * their respective memory locations. 99 * their respective memory locations.
98 */ 100 */
101
102static struct amba_pl011_data uart0_plat_data = {
103#ifdef CONFIG_COH901318
104 .dma_filter = coh901318_filter_id,
105 .dma_rx_param = (void *) U300_DMA_UART0_RX,
106 .dma_tx_param = (void *) U300_DMA_UART0_TX,
107#endif
108};
109
99static struct amba_device uart0_device = { 110static struct amba_device uart0_device = {
100 .dev = { 111 .dev = {
112 .coherent_dma_mask = ~0,
101 .init_name = "uart0", /* Slow device at 0x3000 offset */ 113 .init_name = "uart0", /* Slow device at 0x3000 offset */
102 .platform_data = NULL, 114 .platform_data = &uart0_plat_data,
103 }, 115 },
104 .res = { 116 .res = {
105 .start = U300_UART0_BASE, 117 .start = U300_UART0_BASE,
@@ -111,10 +123,19 @@ static struct amba_device uart0_device = {
111 123
112/* The U335 have an additional UART1 on the APP CPU */ 124/* The U335 have an additional UART1 on the APP CPU */
113#ifdef CONFIG_MACH_U300_BS335 125#ifdef CONFIG_MACH_U300_BS335
126static struct amba_pl011_data uart1_plat_data = {
127#ifdef CONFIG_COH901318
128 .dma_filter = coh901318_filter_id,
129 .dma_rx_param = (void *) U300_DMA_UART1_RX,
130 .dma_tx_param = (void *) U300_DMA_UART1_TX,
131#endif
132};
133
114static struct amba_device uart1_device = { 134static struct amba_device uart1_device = {
115 .dev = { 135 .dev = {
136 .coherent_dma_mask = ~0,
116 .init_name = "uart1", /* Fast device at 0x7000 offset */ 137 .init_name = "uart1", /* Fast device at 0x7000 offset */
117 .platform_data = NULL, 138 .platform_data = &uart1_plat_data,
118 }, 139 },
119 .res = { 140 .res = {
120 .start = U300_UART1_BASE, 141 .start = U300_UART1_BASE,
@@ -960,42 +981,37 @@ const struct coh_dma_channel chan_config[U300_DMA_CHANNELS] = {
960 .priority_high = 0, 981 .priority_high = 0,
961 .dev_addr = U300_MSL_BASE + 6 * 0x40 + 0x220, 982 .dev_addr = U300_MSL_BASE + 6 * 0x40 + 0x220,
962 }, 983 },
984 /*
985 * Don't set up device address, burst count or size of src
986 * or dst bus for this peripheral - handled by PrimeCell
987 * DMA extension.
988 */
963 { 989 {
964 .number = U300_DMA_MMCSD_RX_TX, 990 .number = U300_DMA_MMCSD_RX_TX,
965 .name = "MMCSD RX TX", 991 .name = "MMCSD RX TX",
966 .priority_high = 0, 992 .priority_high = 0,
967 .dev_addr = U300_MMCSD_BASE + 0x080,
968 .param.config = COH901318_CX_CFG_CH_DISABLE | 993 .param.config = COH901318_CX_CFG_CH_DISABLE |
969 COH901318_CX_CFG_LCR_DISABLE | 994 COH901318_CX_CFG_LCR_DISABLE |
970 COH901318_CX_CFG_TC_IRQ_ENABLE | 995 COH901318_CX_CFG_TC_IRQ_ENABLE |
971 COH901318_CX_CFG_BE_IRQ_ENABLE, 996 COH901318_CX_CFG_BE_IRQ_ENABLE,
972 .param.ctrl_lli_chained = 0 | 997 .param.ctrl_lli_chained = 0 |
973 COH901318_CX_CTRL_TC_ENABLE | 998 COH901318_CX_CTRL_TC_ENABLE |
974 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
975 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
976 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
977 COH901318_CX_CTRL_MASTER_MODE_M1RW | 999 COH901318_CX_CTRL_MASTER_MODE_M1RW |
978 COH901318_CX_CTRL_TCP_ENABLE | 1000 COH901318_CX_CTRL_TCP_ENABLE |
979 COH901318_CX_CTRL_TC_IRQ_ENABLE | 1001 COH901318_CX_CTRL_TC_IRQ_DISABLE |
980 COH901318_CX_CTRL_HSP_ENABLE | 1002 COH901318_CX_CTRL_HSP_ENABLE |
981 COH901318_CX_CTRL_HSS_DISABLE | 1003 COH901318_CX_CTRL_HSS_DISABLE |
982 COH901318_CX_CTRL_DDMA_LEGACY, 1004 COH901318_CX_CTRL_DDMA_LEGACY,
983 .param.ctrl_lli = 0 | 1005 .param.ctrl_lli = 0 |
984 COH901318_CX_CTRL_TC_ENABLE | 1006 COH901318_CX_CTRL_TC_ENABLE |
985 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
986 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
987 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
988 COH901318_CX_CTRL_MASTER_MODE_M1RW | 1007 COH901318_CX_CTRL_MASTER_MODE_M1RW |
989 COH901318_CX_CTRL_TCP_ENABLE | 1008 COH901318_CX_CTRL_TCP_ENABLE |
990 COH901318_CX_CTRL_TC_IRQ_ENABLE | 1009 COH901318_CX_CTRL_TC_IRQ_DISABLE |
991 COH901318_CX_CTRL_HSP_ENABLE | 1010 COH901318_CX_CTRL_HSP_ENABLE |
992 COH901318_CX_CTRL_HSS_DISABLE | 1011 COH901318_CX_CTRL_HSS_DISABLE |
993 COH901318_CX_CTRL_DDMA_LEGACY, 1012 COH901318_CX_CTRL_DDMA_LEGACY,
994 .param.ctrl_lli_last = 0 | 1013 .param.ctrl_lli_last = 0 |
995 COH901318_CX_CTRL_TC_ENABLE | 1014 COH901318_CX_CTRL_TC_ENABLE |
996 COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
997 COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
998 COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
999 COH901318_CX_CTRL_MASTER_MODE_M1RW | 1015 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1000 COH901318_CX_CTRL_TCP_DISABLE | 1016 COH901318_CX_CTRL_TCP_DISABLE |
1001 COH901318_CX_CTRL_TC_IRQ_ENABLE | 1017 COH901318_CX_CTRL_TC_IRQ_ENABLE |
@@ -1014,15 +1030,76 @@ const struct coh_dma_channel chan_config[U300_DMA_CHANNELS] = {
1014 .name = "MSPRO RX", 1030 .name = "MSPRO RX",
1015 .priority_high = 0, 1031 .priority_high = 0,
1016 }, 1032 },
1033 /*
1034 * Don't set up device address, burst count or size of src
1035 * or dst bus for this peripheral - handled by PrimeCell
1036 * DMA extension.
1037 */
1017 { 1038 {
1018 .number = U300_DMA_UART0_TX, 1039 .number = U300_DMA_UART0_TX,
1019 .name = "UART0 TX", 1040 .name = "UART0 TX",
1020 .priority_high = 0, 1041 .priority_high = 0,
1042 .param.config = COH901318_CX_CFG_CH_DISABLE |
1043 COH901318_CX_CFG_LCR_DISABLE |
1044 COH901318_CX_CFG_TC_IRQ_ENABLE |
1045 COH901318_CX_CFG_BE_IRQ_ENABLE,
1046 .param.ctrl_lli_chained = 0 |
1047 COH901318_CX_CTRL_TC_ENABLE |
1048 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1049 COH901318_CX_CTRL_TCP_ENABLE |
1050 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1051 COH901318_CX_CTRL_HSP_ENABLE |
1052 COH901318_CX_CTRL_HSS_DISABLE |
1053 COH901318_CX_CTRL_DDMA_LEGACY,
1054 .param.ctrl_lli = 0 |
1055 COH901318_CX_CTRL_TC_ENABLE |
1056 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1057 COH901318_CX_CTRL_TCP_ENABLE |
1058 COH901318_CX_CTRL_TC_IRQ_ENABLE |
1059 COH901318_CX_CTRL_HSP_ENABLE |
1060 COH901318_CX_CTRL_HSS_DISABLE |
1061 COH901318_CX_CTRL_DDMA_LEGACY,
1062 .param.ctrl_lli_last = 0 |
1063 COH901318_CX_CTRL_TC_ENABLE |
1064 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1065 COH901318_CX_CTRL_TCP_ENABLE |
1066 COH901318_CX_CTRL_TC_IRQ_ENABLE |
1067 COH901318_CX_CTRL_HSP_ENABLE |
1068 COH901318_CX_CTRL_HSS_DISABLE |
1069 COH901318_CX_CTRL_DDMA_LEGACY,
1021 }, 1070 },
1022 { 1071 {
1023 .number = U300_DMA_UART0_RX, 1072 .number = U300_DMA_UART0_RX,
1024 .name = "UART0 RX", 1073 .name = "UART0 RX",
1025 .priority_high = 0, 1074 .priority_high = 0,
1075 .param.config = COH901318_CX_CFG_CH_DISABLE |
1076 COH901318_CX_CFG_LCR_DISABLE |
1077 COH901318_CX_CFG_TC_IRQ_ENABLE |
1078 COH901318_CX_CFG_BE_IRQ_ENABLE,
1079 .param.ctrl_lli_chained = 0 |
1080 COH901318_CX_CTRL_TC_ENABLE |
1081 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1082 COH901318_CX_CTRL_TCP_ENABLE |
1083 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1084 COH901318_CX_CTRL_HSP_ENABLE |
1085 COH901318_CX_CTRL_HSS_DISABLE |
1086 COH901318_CX_CTRL_DDMA_LEGACY,
1087 .param.ctrl_lli = 0 |
1088 COH901318_CX_CTRL_TC_ENABLE |
1089 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1090 COH901318_CX_CTRL_TCP_ENABLE |
1091 COH901318_CX_CTRL_TC_IRQ_ENABLE |
1092 COH901318_CX_CTRL_HSP_ENABLE |
1093 COH901318_CX_CTRL_HSS_DISABLE |
1094 COH901318_CX_CTRL_DDMA_LEGACY,
1095 .param.ctrl_lli_last = 0 |
1096 COH901318_CX_CTRL_TC_ENABLE |
1097 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1098 COH901318_CX_CTRL_TCP_ENABLE |
1099 COH901318_CX_CTRL_TC_IRQ_ENABLE |
1100 COH901318_CX_CTRL_HSP_ENABLE |
1101 COH901318_CX_CTRL_HSS_DISABLE |
1102 COH901318_CX_CTRL_DDMA_LEGACY,
1026 }, 1103 },
1027 { 1104 {
1028 .number = U300_DMA_APEX_TX, 1105 .number = U300_DMA_APEX_TX,
@@ -1080,7 +1157,7 @@ const struct coh_dma_channel chan_config[U300_DMA_CHANNELS] = {
1080 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE | 1157 COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
1081 COH901318_CX_CTRL_MASTER_MODE_M1RW | 1158 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1082 COH901318_CX_CTRL_TCP_ENABLE | 1159 COH901318_CX_CTRL_TCP_ENABLE |
1083 COH901318_CX_CTRL_TC_IRQ_ENABLE | 1160 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1084 COH901318_CX_CTRL_HSP_ENABLE | 1161 COH901318_CX_CTRL_HSP_ENABLE |
1085 COH901318_CX_CTRL_HSS_DISABLE | 1162 COH901318_CX_CTRL_HSS_DISABLE |
1086 COH901318_CX_CTRL_DDMA_LEGACY | 1163 COH901318_CX_CTRL_DDMA_LEGACY |
@@ -1252,15 +1329,77 @@ const struct coh_dma_channel chan_config[U300_DMA_CHANNELS] = {
1252 .name = "XGAM PDI", 1329 .name = "XGAM PDI",
1253 .priority_high = 0, 1330 .priority_high = 0,
1254 }, 1331 },
1332 /*
1333 * Don't set up device address, burst count or size of src
1334 * or dst bus for this peripheral - handled by PrimeCell
1335 * DMA extension.
1336 */
1255 { 1337 {
1256 .number = U300_DMA_SPI_TX, 1338 .number = U300_DMA_SPI_TX,
1257 .name = "SPI TX", 1339 .name = "SPI TX",
1258 .priority_high = 0, 1340 .priority_high = 0,
1341 .param.config = COH901318_CX_CFG_CH_DISABLE |
1342 COH901318_CX_CFG_LCR_DISABLE |
1343 COH901318_CX_CFG_TC_IRQ_ENABLE |
1344 COH901318_CX_CFG_BE_IRQ_ENABLE,
1345 .param.ctrl_lli_chained = 0 |
1346 COH901318_CX_CTRL_TC_ENABLE |
1347 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1348 COH901318_CX_CTRL_TCP_DISABLE |
1349 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1350 COH901318_CX_CTRL_HSP_ENABLE |
1351 COH901318_CX_CTRL_HSS_DISABLE |
1352 COH901318_CX_CTRL_DDMA_LEGACY,
1353 .param.ctrl_lli = 0 |
1354 COH901318_CX_CTRL_TC_ENABLE |
1355 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1356 COH901318_CX_CTRL_TCP_DISABLE |
1357 COH901318_CX_CTRL_TC_IRQ_ENABLE |
1358 COH901318_CX_CTRL_HSP_ENABLE |
1359 COH901318_CX_CTRL_HSS_DISABLE |
1360 COH901318_CX_CTRL_DDMA_LEGACY,
1361 .param.ctrl_lli_last = 0 |
1362 COH901318_CX_CTRL_TC_ENABLE |
1363 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1364 COH901318_CX_CTRL_TCP_DISABLE |
1365 COH901318_CX_CTRL_TC_IRQ_ENABLE |
1366 COH901318_CX_CTRL_HSP_ENABLE |
1367 COH901318_CX_CTRL_HSS_DISABLE |
1368 COH901318_CX_CTRL_DDMA_LEGACY,
1259 }, 1369 },
1260 { 1370 {
1261 .number = U300_DMA_SPI_RX, 1371 .number = U300_DMA_SPI_RX,
1262 .name = "SPI RX", 1372 .name = "SPI RX",
1263 .priority_high = 0, 1373 .priority_high = 0,
1374 .param.config = COH901318_CX_CFG_CH_DISABLE |
1375 COH901318_CX_CFG_LCR_DISABLE |
1376 COH901318_CX_CFG_TC_IRQ_ENABLE |
1377 COH901318_CX_CFG_BE_IRQ_ENABLE,
1378 .param.ctrl_lli_chained = 0 |
1379 COH901318_CX_CTRL_TC_ENABLE |
1380 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1381 COH901318_CX_CTRL_TCP_DISABLE |
1382 COH901318_CX_CTRL_TC_IRQ_DISABLE |
1383 COH901318_CX_CTRL_HSP_ENABLE |
1384 COH901318_CX_CTRL_HSS_DISABLE |
1385 COH901318_CX_CTRL_DDMA_LEGACY,
1386 .param.ctrl_lli = 0 |
1387 COH901318_CX_CTRL_TC_ENABLE |
1388 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1389 COH901318_CX_CTRL_TCP_DISABLE |
1390 COH901318_CX_CTRL_TC_IRQ_ENABLE |
1391 COH901318_CX_CTRL_HSP_ENABLE |
1392 COH901318_CX_CTRL_HSS_DISABLE |
1393 COH901318_CX_CTRL_DDMA_LEGACY,
1394 .param.ctrl_lli_last = 0 |
1395 COH901318_CX_CTRL_TC_ENABLE |
1396 COH901318_CX_CTRL_MASTER_MODE_M1RW |
1397 COH901318_CX_CTRL_TCP_DISABLE |
1398 COH901318_CX_CTRL_TC_IRQ_ENABLE |
1399 COH901318_CX_CTRL_HSP_ENABLE |
1400 COH901318_CX_CTRL_HSS_DISABLE |
1401 COH901318_CX_CTRL_DDMA_LEGACY,
1402
1264 }, 1403 },
1265 { 1404 {
1266 .number = U300_DMA_GENERAL_PURPOSE_0, 1405 .number = U300_DMA_GENERAL_PURPOSE_0,
@@ -1617,7 +1756,7 @@ static void __init u300_init_check_chip(void)
1617#endif 1756#endif
1618#ifdef CONFIG_MACH_U300_BS335 1757#ifdef CONFIG_MACH_U300_BS335
1619 if ((val & 0xFF00U) != 0xf000 && (val & 0xFF00U) != 0xf100) { 1758 if ((val & 0xFF00U) != 0xf000 && (val & 0xFF00U) != 0xf100) {
1620 printk(KERN_ERR "Platform configured for BS365 " \ 1759 printk(KERN_ERR "Platform configured for BS335 " \
1621 " with DB3350 but %s detected, expect problems!", 1760 " with DB3350 but %s detected, expect problems!",
1622 chipname); 1761 chipname);
1623 } 1762 }
@@ -1692,12 +1831,12 @@ void __init u300_init_devices(void)
1692 /* Register subdevices on the I2C buses */ 1831 /* Register subdevices on the I2C buses */
1693 u300_i2c_register_board_devices(); 1832 u300_i2c_register_board_devices();
1694 1833
1695 /* Register subdevices on the SPI bus */
1696 u300_spi_register_board_devices();
1697
1698 /* Register the platform devices */ 1834 /* Register the platform devices */
1699 platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); 1835 platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs));
1700 1836
1837 /* Register subdevices on the SPI bus */
1838 u300_spi_register_board_devices();
1839
1701#ifndef CONFIG_MACH_U300_SEMI_IS_SHARED 1840#ifndef CONFIG_MACH_U300_SEMI_IS_SHARED
1702 /* 1841 /*
1703 * Enable SEMI self refresh. Self-refresh of the SDRAM is entered when 1842 * Enable SEMI self refresh. Self-refresh of the SDRAM is entered when
diff --git a/arch/arm/mach-u300/include/mach/coh901318.h b/arch/arm/mach-u300/include/mach/coh901318.h
index 6193aaa47794..7c3b2b2d25b6 100644
--- a/arch/arm/mach-u300/include/mach/coh901318.h
+++ b/arch/arm/mach-u300/include/mach/coh901318.h
@@ -102,6 +102,7 @@ struct coh901318_platform {
102 const int max_channels; 102 const int max_channels;
103}; 103};
104 104
105#ifdef CONFIG_COH901318
105/** 106/**
106 * coh901318_filter_id() - DMA channel filter function 107 * coh901318_filter_id() - DMA channel filter function
107 * @chan: dma channel handle 108 * @chan: dma channel handle
@@ -110,6 +111,12 @@ struct coh901318_platform {
110 * In dma_request_channel() it specifies what channel id to be requested 111 * In dma_request_channel() it specifies what channel id to be requested
111 */ 112 */
112bool coh901318_filter_id(struct dma_chan *chan, void *chan_id); 113bool coh901318_filter_id(struct dma_chan *chan, void *chan_id);
114#else
115static inline bool coh901318_filter_id(struct dma_chan *chan, void *chan_id)
116{
117 return false;
118}
119#endif
113 120
114/* 121/*
115 * DMA Controller - this access the static mappings of the coh901318 dma. 122 * DMA Controller - this access the static mappings of the coh901318 dma.
diff --git a/arch/arm/mach-u300/include/mach/memory.h b/arch/arm/mach-u300/include/mach/memory.h
index bf134bcc129d..888e2e351ee1 100644
--- a/arch/arm/mach-u300/include/mach/memory.h
+++ b/arch/arm/mach-u300/include/mach/memory.h
@@ -15,17 +15,17 @@
15 15
16#ifdef CONFIG_MACH_U300_DUAL_RAM 16#ifdef CONFIG_MACH_U300_DUAL_RAM
17 17
18#define PHYS_OFFSET UL(0x48000000) 18#define PLAT_PHYS_OFFSET UL(0x48000000)
19#define BOOT_PARAMS_OFFSET (PHYS_OFFSET + 0x100) 19#define BOOT_PARAMS_OFFSET (PHYS_OFFSET + 0x100)
20 20
21#else 21#else
22 22
23#ifdef CONFIG_MACH_U300_2MB_ALIGNMENT_FIX 23#ifdef CONFIG_MACH_U300_2MB_ALIGNMENT_FIX
24#define PHYS_OFFSET (0x28000000 + \ 24#define PLAT_PHYS_OFFSET (0x28000000 + \
25 (CONFIG_MACH_U300_ACCESS_MEM_SIZE - \ 25 (CONFIG_MACH_U300_ACCESS_MEM_SIZE - \
26 (CONFIG_MACH_U300_ACCESS_MEM_SIZE & 1))*1024*1024) 26 (CONFIG_MACH_U300_ACCESS_MEM_SIZE & 1))*1024*1024)
27#else 27#else
28#define PHYS_OFFSET (0x28000000 + \ 28#define PLAT_PHYS_OFFSET (0x28000000 + \
29 (CONFIG_MACH_U300_ACCESS_MEM_SIZE + \ 29 (CONFIG_MACH_U300_ACCESS_MEM_SIZE + \
30 (CONFIG_MACH_U300_ACCESS_MEM_SIZE & 1))*1024*1024) 30 (CONFIG_MACH_U300_ACCESS_MEM_SIZE & 1))*1024*1024)
31#endif 31#endif
diff --git a/arch/arm/mach-u300/mmc.c b/arch/arm/mach-u300/mmc.c
index de1ac9ad2213..677ccef5cd32 100644
--- a/arch/arm/mach-u300/mmc.c
+++ b/arch/arm/mach-u300/mmc.c
@@ -3,159 +3,52 @@
3 * arch/arm/mach-u300/mmc.c 3 * arch/arm/mach-u300/mmc.c
4 * 4 *
5 * 5 *
6 * Copyright (C) 2009 ST-Ericsson AB 6 * Copyright (C) 2009 ST-Ericsson SA
7 * License terms: GNU General Public License (GPL) version 2 7 * License terms: GNU General Public License (GPL) version 2
8 * 8 *
9 * Author: Linus Walleij <linus.walleij@stericsson.com> 9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 * Author: Johan Lundin <johan.lundin@stericsson.com> 10 * Author: Johan Lundin
11 * Author: Jonas Aaberg <jonas.aberg@stericsson.com> 11 * Author: Jonas Aaberg <jonas.aberg@stericsson.com>
12 */ 12 */
13#include <linux/device.h> 13#include <linux/device.h>
14#include <linux/amba/bus.h> 14#include <linux/amba/bus.h>
15#include <linux/mmc/host.h> 15#include <linux/mmc/host.h>
16#include <linux/input.h>
17#include <linux/workqueue.h>
18#include <linux/delay.h>
19#include <linux/regulator/consumer.h>
20#include <linux/regulator/machine.h>
21#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <linux/dmaengine.h>
22#include <linux/amba/mmci.h> 18#include <linux/amba/mmci.h>
23#include <linux/slab.h> 19#include <linux/slab.h>
20#include <mach/coh901318.h>
21#include <mach/dma_channels.h>
24 22
25#include "mmc.h" 23#include "mmc.h"
26#include "padmux.h" 24#include "padmux.h"
27 25
28struct mmci_card_event { 26static struct mmci_platform_data mmc0_plat_data = {
29 struct input_dev *mmc_input; 27 /*
30 int mmc_inserted; 28 * Do not set ocr_mask or voltage translation function,
31 struct work_struct workq; 29 * we have a regulator we can control instead.
32 struct mmci_platform_data mmc0_plat_data; 30 */
31 /* Nominally 2.85V on our platform */
32 .f_max = 24000000,
33 .gpio_wp = -1,
34 .gpio_cd = U300_GPIO_PIN_MMC_CD,
35 .cd_invert = true,
36 .capabilities = MMC_CAP_MMC_HIGHSPEED |
37 MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
38#ifdef CONFIG_COH901318
39 .dma_filter = coh901318_filter_id,
40 .dma_rx_param = (void *) U300_DMA_MMCSD_RX_TX,
41 /* Don't specify a TX channel, this RX channel is bidirectional */
42#endif
33}; 43};
34 44
35static unsigned int mmc_status(struct device *dev)
36{
37 struct mmci_card_event *mmci_card = container_of(
38 dev->platform_data,
39 struct mmci_card_event, mmc0_plat_data);
40
41 return mmci_card->mmc_inserted;
42}
43
44static int mmci_callback(void *data)
45{
46 struct mmci_card_event *mmci_card = data;
47
48 disable_irq_on_gpio_pin(U300_GPIO_PIN_MMC_CD);
49 schedule_work(&mmci_card->workq);
50
51 return 0;
52}
53
54
55static ssize_t gpio_show(struct device *dev, struct device_attribute *attr,
56 char *buf)
57{
58 struct mmci_card_event *mmci_card = container_of(
59 dev->platform_data,
60 struct mmci_card_event, mmc0_plat_data);
61
62
63 return sprintf(buf, "%d\n", !mmci_card->mmc_inserted);
64}
65
66static DEVICE_ATTR(mmc_inserted, S_IRUGO, gpio_show, NULL);
67
68static void _mmci_callback(struct work_struct *ws)
69{
70
71 struct mmci_card_event *mmci_card = container_of(
72 ws,
73 struct mmci_card_event, workq);
74
75 mdelay(20);
76
77 mmci_card->mmc_inserted = !gpio_get_value(U300_GPIO_PIN_MMC_CD);
78
79 input_report_switch(mmci_card->mmc_input, KEY_INSERT,
80 mmci_card->mmc_inserted);
81 input_sync(mmci_card->mmc_input);
82
83 pr_debug("MMC/SD card was %s\n",
84 mmci_card->mmc_inserted ? "inserted" : "removed");
85
86 enable_irq_on_gpio_pin(U300_GPIO_PIN_MMC_CD, mmci_card->mmc_inserted);
87}
88
89int __devinit mmc_init(struct amba_device *adev) 45int __devinit mmc_init(struct amba_device *adev)
90{ 46{
91 struct mmci_card_event *mmci_card;
92 struct device *mmcsd_device = &adev->dev; 47 struct device *mmcsd_device = &adev->dev;
93 struct pmx *pmx; 48 struct pmx *pmx;
94 int ret = 0; 49 int ret = 0;
95 50
96 mmci_card = kzalloc(sizeof(struct mmci_card_event), GFP_KERNEL); 51 mmcsd_device->platform_data = &mmc0_plat_data;
97 if (!mmci_card)
98 return -ENOMEM;
99
100 /*
101 * Do not set ocr_mask or voltage translation function,
102 * we have a regulator we can control instead.
103 */
104 /* Nominally 2.85V on our platform */
105 mmci_card->mmc0_plat_data.f_max = 24000000;
106 mmci_card->mmc0_plat_data.status = mmc_status;
107 mmci_card->mmc0_plat_data.gpio_wp = -1;
108 mmci_card->mmc0_plat_data.gpio_cd = -1;
109 mmci_card->mmc0_plat_data.capabilities = MMC_CAP_MMC_HIGHSPEED |
110 MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
111
112 mmcsd_device->platform_data = (void *) &mmci_card->mmc0_plat_data;
113
114 INIT_WORK(&mmci_card->workq, _mmci_callback);
115
116 ret = gpio_request(U300_GPIO_PIN_MMC_CD, "MMC card detection");
117 if (ret) {
118 printk(KERN_CRIT "Could not allocate MMC card detection " \
119 "GPIO pin\n");
120 goto out;
121 }
122
123 ret = gpio_direction_input(U300_GPIO_PIN_MMC_CD);
124 if (ret) {
125 printk(KERN_CRIT "Invalid GPIO pin requested\n");
126 goto out;
127 }
128
129 ret = sysfs_create_file(&mmcsd_device->kobj,
130 &dev_attr_mmc_inserted.attr);
131 if (ret)
132 goto out;
133
134 mmci_card->mmc_input = input_allocate_device();
135 if (!mmci_card->mmc_input) {
136 printk(KERN_CRIT "Could not allocate MMC input device\n");
137 return -ENOMEM;
138 }
139
140 mmci_card->mmc_input->name = "MMC insert notification";
141 mmci_card->mmc_input->id.bustype = BUS_HOST;
142 mmci_card->mmc_input->id.vendor = 0;
143 mmci_card->mmc_input->id.product = 0;
144 mmci_card->mmc_input->id.version = 0x0100;
145 mmci_card->mmc_input->dev.parent = mmcsd_device;
146 input_set_capability(mmci_card->mmc_input, EV_SW, KEY_INSERT);
147
148 /*
149 * Since this must always be compiled into the kernel, this input
150 * is never unregistered or free:ed.
151 */
152 ret = input_register_device(mmci_card->mmc_input);
153 if (ret) {
154 input_free_device(mmci_card->mmc_input);
155 goto out;
156 }
157
158 input_set_drvdata(mmci_card->mmc_input, mmci_card);
159 52
160 /* 53 /*
161 * Setup padmuxing for MMC. Since this must always be 54 * Setup padmuxing for MMC. Since this must always be
@@ -171,12 +64,5 @@ int __devinit mmc_init(struct amba_device *adev)
171 pr_warning("Could not activate padmuxing\n"); 64 pr_warning("Could not activate padmuxing\n");
172 } 65 }
173 66
174 ret = gpio_register_callback(U300_GPIO_PIN_MMC_CD, mmci_callback,
175 mmci_card);
176
177 schedule_work(&mmci_card->workq);
178
179 printk(KERN_INFO "Registered MMC insert/remove notification\n");
180out:
181 return ret; 67 return ret;
182} 68}
diff --git a/arch/arm/mach-u300/spi.c b/arch/arm/mach-u300/spi.c
index 00869def5420..5767208f1c1d 100644
--- a/arch/arm/mach-u300/spi.c
+++ b/arch/arm/mach-u300/spi.c
@@ -11,6 +11,9 @@
11#include <linux/spi/spi.h> 11#include <linux/spi/spi.h>
12#include <linux/amba/pl022.h> 12#include <linux/amba/pl022.h>
13#include <linux/err.h> 13#include <linux/err.h>
14#include <mach/coh901318.h>
15#include <mach/dma_channels.h>
16
14#include "padmux.h" 17#include "padmux.h"
15 18
16/* 19/*
@@ -30,11 +33,8 @@ static void select_dummy_chip(u32 chipselect)
30} 33}
31 34
32struct pl022_config_chip dummy_chip_info = { 35struct pl022_config_chip dummy_chip_info = {
33 /* 36 /* available POLLING_TRANSFER, INTERRUPT_TRANSFER, DMA_TRANSFER */
34 * available POLLING_TRANSFER and INTERRUPT_TRANSFER, 37 .com_mode = DMA_TRANSFER,
35 * DMA_TRANSFER does not work
36 */
37 .com_mode = INTERRUPT_TRANSFER,
38 .iface = SSP_INTERFACE_MOTOROLA_SPI, 38 .iface = SSP_INTERFACE_MOTOROLA_SPI,
39 /* We can only act as master but SSP_SLAVE is possible in theory */ 39 /* We can only act as master but SSP_SLAVE is possible in theory */
40 .hierarchy = SSP_MASTER, 40 .hierarchy = SSP_MASTER,
@@ -75,8 +75,6 @@ static struct spi_board_info u300_spi_devices[] = {
75static struct pl022_ssp_controller ssp_platform_data = { 75static struct pl022_ssp_controller ssp_platform_data = {
76 /* If you have several SPI buses this varies, we have only bus 0 */ 76 /* If you have several SPI buses this varies, we have only bus 0 */
77 .bus_id = 0, 77 .bus_id = 0,
78 /* Set this to 1 when we think we got DMA working */
79 .enable_dma = 0,
80 /* 78 /*
81 * On the APP CPU GPIO 4, 5 and 6 are connected as generic 79 * On the APP CPU GPIO 4, 5 and 6 are connected as generic
82 * chip selects for SPI. (Same on U330, U335 and U365.) 80 * chip selects for SPI. (Same on U330, U335 and U365.)
@@ -84,6 +82,14 @@ static struct pl022_ssp_controller ssp_platform_data = {
84 * and do padmuxing accordingly too. 82 * and do padmuxing accordingly too.
85 */ 83 */
86 .num_chipselect = 3, 84 .num_chipselect = 3,
85#ifdef CONFIG_COH901318
86 .enable_dma = 1,
87 .dma_filter = coh901318_filter_id,
88 .dma_rx_param = (void *) U300_DMA_SPI_RX,
89 .dma_tx_param = (void *) U300_DMA_SPI_TX,
90#else
91 .enable_dma = 0,
92#endif
87}; 93};
88 94
89 95
@@ -109,6 +115,7 @@ void __init u300_spi_init(struct amba_device *adev)
109 } 115 }
110 116
111} 117}
118
112void __init u300_spi_register_board_devices(void) 119void __init u300_spi_register_board_devices(void)
113{ 120{
114 /* Register any SPI devices */ 121 /* Register any SPI devices */
diff --git a/arch/arm/mach-u300/u300.c b/arch/arm/mach-u300/u300.c
index 07c35a846424..48b3b7f39966 100644
--- a/arch/arm/mach-u300/u300.c
+++ b/arch/arm/mach-u300/u300.c
@@ -19,9 +19,9 @@
19#include <linux/io.h> 19#include <linux/io.h>
20#include <mach/hardware.h> 20#include <mach/hardware.h>
21#include <mach/platform.h> 21#include <mach/platform.h>
22#include <mach/memory.h>
23#include <asm/mach-types.h> 22#include <asm/mach-types.h>
24#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24#include <asm/memory.h>
25 25
26static void __init u300_reserve(void) 26static void __init u300_reserve(void)
27{ 27{
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
index 247caa3400d0..203b986280f5 100644
--- a/arch/arm/mach-ux500/Kconfig
+++ b/arch/arm/mach-ux500/Kconfig
@@ -6,6 +6,7 @@ config UX500_SOC_COMMON
6 select ARM_GIC 6 select ARM_GIC
7 select HAS_MTU 7 select HAS_MTU
8 select NOMADIK_GPIO 8 select NOMADIK_GPIO
9 select ARM_ERRATA_753970
9 10
10menu "Ux500 SoC" 11menu "Ux500 SoC"
11 12
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
index 53ebb429e971..b549a8fb4231 100644
--- a/arch/arm/mach-ux500/Makefile
+++ b/arch/arm/mach-ux500/Makefile
@@ -3,16 +3,18 @@
3# 3#
4 4
5obj-y := clock.o cpu.o devices.o devices-common.o \ 5obj-y := clock.o cpu.o devices.o devices-common.o \
6 id.o 6 id.o usb.o
7obj-$(CONFIG_UX500_SOC_DB5500) += cpu-db5500.o dma-db5500.o 7obj-$(CONFIG_UX500_SOC_DB5500) += cpu-db5500.o dma-db5500.o
8obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o prcmu.o 8obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o prcmu.o
9obj-$(CONFIG_MACH_U8500) += board-mop500.o board-mop500-sdi.o \ 9obj-$(CONFIG_MACH_U8500) += board-mop500.o board-mop500-sdi.o \
10 board-mop500-keypads.o 10 board-mop500-regulators.o \
11 board-mop500-uib.o board-mop500-stuib.o \
12 board-mop500-u8500uib.o \
13 board-mop500-pins.o
11obj-$(CONFIG_MACH_U5500) += board-u5500.o board-u5500-sdi.o 14obj-$(CONFIG_MACH_U5500) += board-u5500.o board-u5500-sdi.o
12obj-$(CONFIG_SMP) += platsmp.o headsmp.o 15obj-$(CONFIG_SMP) += platsmp.o headsmp.o
13obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 16obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
14obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o 17obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
15obj-$(CONFIG_REGULATOR_AB8500) += board-mop500-regulators.o
16obj-$(CONFIG_U5500_MODEM_IRQ) += modem-irq-db5500.o 18obj-$(CONFIG_U5500_MODEM_IRQ) += modem-irq-db5500.o
17obj-$(CONFIG_U5500_MBOX) += mbox-db5500.o 19obj-$(CONFIG_U5500_MBOX) += mbox-db5500.o
18obj-$(CONFIG_CPU_FREQ) += cpufreq.o 20obj-$(CONFIG_CPU_FREQ) += cpufreq.o
diff --git a/arch/arm/mach-ux500/board-mop500-keypads.c b/arch/arm/mach-ux500/board-mop500-keypads.c
deleted file mode 100644
index 70318c354d32..000000000000
--- a/arch/arm/mach-ux500/board-mop500-keypads.c
+++ /dev/null
@@ -1,229 +0,0 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License Terms: GNU General Public License v2
5 *
6 * Keypad layouts for various boards
7 */
8
9#include <linux/i2c.h>
10#include <linux/gpio.h>
11#include <linux/interrupt.h>
12#include <linux/platform_device.h>
13#include <linux/mfd/stmpe.h>
14#include <linux/mfd/tc3589x.h>
15#include <linux/input/matrix_keypad.h>
16
17#include <plat/pincfg.h>
18#include <plat/ske.h>
19
20#include <mach/devices.h>
21#include <mach/hardware.h>
22
23#include "devices-db8500.h"
24#include "board-mop500.h"
25
26/* STMPE/SKE keypad use this key layout */
27static const unsigned int mop500_keymap[] = {
28 KEY(2, 5, KEY_END),
29 KEY(4, 1, KEY_POWER),
30 KEY(3, 5, KEY_VOLUMEDOWN),
31 KEY(1, 3, KEY_3),
32 KEY(5, 2, KEY_RIGHT),
33 KEY(5, 0, KEY_9),
34
35 KEY(0, 5, KEY_MENU),
36 KEY(7, 6, KEY_ENTER),
37 KEY(4, 5, KEY_0),
38 KEY(6, 7, KEY_2),
39 KEY(3, 4, KEY_UP),
40 KEY(3, 3, KEY_DOWN),
41
42 KEY(6, 4, KEY_SEND),
43 KEY(6, 2, KEY_BACK),
44 KEY(4, 2, KEY_VOLUMEUP),
45 KEY(5, 5, KEY_1),
46 KEY(4, 3, KEY_LEFT),
47 KEY(3, 2, KEY_7),
48};
49
50static const struct matrix_keymap_data mop500_keymap_data = {
51 .keymap = mop500_keymap,
52 .keymap_size = ARRAY_SIZE(mop500_keymap),
53};
54
55/*
56 * Nomadik SKE keypad
57 */
58#define ROW_PIN_I0 164
59#define ROW_PIN_I1 163
60#define ROW_PIN_I2 162
61#define ROW_PIN_I3 161
62#define ROW_PIN_I4 156
63#define ROW_PIN_I5 155
64#define ROW_PIN_I6 154
65#define ROW_PIN_I7 153
66#define COL_PIN_O0 168
67#define COL_PIN_O1 167
68#define COL_PIN_O2 166
69#define COL_PIN_O3 165
70#define COL_PIN_O4 160
71#define COL_PIN_O5 159
72#define COL_PIN_O6 158
73#define COL_PIN_O7 157
74
75#define SKE_KPD_MAX_ROWS 8
76#define SKE_KPD_MAX_COLS 8
77
78static int ske_kp_rows[] = {
79 ROW_PIN_I0, ROW_PIN_I1, ROW_PIN_I2, ROW_PIN_I3,
80 ROW_PIN_I4, ROW_PIN_I5, ROW_PIN_I6, ROW_PIN_I7,
81};
82
83/*
84 * ske_set_gpio_row: request and set gpio rows
85 */
86static int ske_set_gpio_row(int gpio)
87{
88 int ret;
89
90 ret = gpio_request(gpio, "ske-kp");
91 if (ret < 0) {
92 pr_err("ske_set_gpio_row: gpio request failed\n");
93 return ret;
94 }
95
96 ret = gpio_direction_output(gpio, 1);
97 if (ret < 0) {
98 pr_err("ske_set_gpio_row: gpio direction failed\n");
99 gpio_free(gpio);
100 }
101
102 return ret;
103}
104
105/*
106 * ske_kp_init - enable the gpio configuration
107 */
108static int ske_kp_init(void)
109{
110 int ret, i;
111
112 for (i = 0; i < SKE_KPD_MAX_ROWS; i++) {
113 ret = ske_set_gpio_row(ske_kp_rows[i]);
114 if (ret < 0) {
115 pr_err("ske_kp_init: failed init\n");
116 return ret;
117 }
118 }
119
120 return 0;
121}
122
123static struct ske_keypad_platform_data ske_keypad_board = {
124 .init = ske_kp_init,
125 .keymap_data = &mop500_keymap_data,
126 .no_autorepeat = true,
127 .krow = SKE_KPD_MAX_ROWS, /* 8x8 matrix */
128 .kcol = SKE_KPD_MAX_COLS,
129 .debounce_ms = 40, /* in millisecs */
130};
131
132/*
133 * STMPE1601
134 */
135static struct stmpe_keypad_platform_data stmpe1601_keypad_data = {
136 .debounce_ms = 64,
137 .scan_count = 8,
138 .no_autorepeat = true,
139 .keymap_data = &mop500_keymap_data,
140};
141
142static struct stmpe_platform_data stmpe1601_data = {
143 .id = 1,
144 .blocks = STMPE_BLOCK_KEYPAD,
145 .irq_trigger = IRQF_TRIGGER_FALLING,
146 .irq_base = MOP500_STMPE1601_IRQ(0),
147 .keypad = &stmpe1601_keypad_data,
148 .autosleep = true,
149 .autosleep_timeout = 1024,
150};
151
152static struct i2c_board_info mop500_i2c0_devices_stuib[] = {
153 {
154 I2C_BOARD_INFO("stmpe1601", 0x40),
155 .irq = NOMADIK_GPIO_TO_IRQ(218),
156 .platform_data = &stmpe1601_data,
157 .flags = I2C_CLIENT_WAKE,
158 },
159};
160
161/*
162 * TC35893
163 */
164
165static const unsigned int uib_keymap[] = {
166 KEY(3, 1, KEY_END),
167 KEY(4, 1, KEY_POWER),
168 KEY(6, 4, KEY_VOLUMEDOWN),
169 KEY(4, 2, KEY_EMAIL),
170 KEY(3, 3, KEY_RIGHT),
171 KEY(2, 5, KEY_BACKSPACE),
172
173 KEY(6, 7, KEY_MENU),
174 KEY(5, 0, KEY_ENTER),
175 KEY(4, 3, KEY_0),
176 KEY(3, 4, KEY_DOT),
177 KEY(5, 2, KEY_UP),
178 KEY(3, 5, KEY_DOWN),
179
180 KEY(4, 5, KEY_SEND),
181 KEY(0, 5, KEY_BACK),
182 KEY(6, 2, KEY_VOLUMEUP),
183 KEY(1, 3, KEY_SPACE),
184 KEY(7, 6, KEY_LEFT),
185 KEY(5, 5, KEY_SEARCH),
186};
187
188static struct matrix_keymap_data uib_keymap_data = {
189 .keymap = uib_keymap,
190 .keymap_size = ARRAY_SIZE(uib_keymap),
191};
192
193static struct tc3589x_keypad_platform_data tc35893_data = {
194 .krow = TC_KPD_ROWS,
195 .kcol = TC_KPD_COLUMNS,
196 .debounce_period = TC_KPD_DEBOUNCE_PERIOD,
197 .settle_time = TC_KPD_SETTLE_TIME,
198 .irqtype = IRQF_TRIGGER_FALLING,
199 .enable_wakeup = true,
200 .keymap_data = &uib_keymap_data,
201 .no_autorepeat = true,
202};
203
204static struct tc3589x_platform_data tc3589x_keypad_data = {
205 .block = TC3589x_BLOCK_KEYPAD,
206 .keypad = &tc35893_data,
207 .irq_base = MOP500_EGPIO_IRQ_BASE,
208};
209
210static struct i2c_board_info mop500_i2c0_devices_uib[] = {
211 {
212 I2C_BOARD_INFO("tc3589x", 0x44),
213 .platform_data = &tc3589x_keypad_data,
214 .irq = NOMADIK_GPIO_TO_IRQ(218),
215 .flags = I2C_CLIENT_WAKE,
216 },
217};
218
219void mop500_keypad_init(void)
220{
221 db8500_add_ske_keypad(&ske_keypad_board);
222
223 i2c_register_board_info(0, mop500_i2c0_devices_stuib,
224 ARRAY_SIZE(mop500_i2c0_devices_stuib));
225
226 i2c_register_board_info(0, mop500_i2c0_devices_uib,
227 ARRAY_SIZE(mop500_i2c0_devices_uib));
228
229}
diff --git a/arch/arm/mach-ux500/board-mop500-pins.c b/arch/arm/mach-ux500/board-mop500-pins.c
new file mode 100644
index 000000000000..fd4cf1ca5efd
--- /dev/null
+++ b/arch/arm/mach-ux500/board-mop500-pins.c
@@ -0,0 +1,241 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License terms: GNU General Public License (GPL) version 2
5 */
6
7#include <linux/kernel.h>
8#include <linux/init.h>
9#include <linux/gpio.h>
10
11#include <asm/mach-types.h>
12#include <plat/pincfg.h>
13#include <mach/hardware.h>
14
15#include "pins-db8500.h"
16
17static pin_cfg_t mop500_pins_common[] = {
18 /* I2C */
19 GPIO147_I2C0_SCL,
20 GPIO148_I2C0_SDA,
21 GPIO16_I2C1_SCL,
22 GPIO17_I2C1_SDA,
23 GPIO10_I2C2_SDA,
24 GPIO11_I2C2_SCL,
25 GPIO229_I2C3_SDA,
26 GPIO230_I2C3_SCL,
27
28 /* MSP0 */
29 GPIO12_MSP0_TXD,
30 GPIO13_MSP0_TFS,
31 GPIO14_MSP0_TCK,
32 GPIO15_MSP0_RXD,
33
34 /* MSP2: HDMI */
35 GPIO193_MSP2_TXD,
36 GPIO194_MSP2_TCK,
37 GPIO195_MSP2_TFS,
38 GPIO196_MSP2_RXD | PIN_OUTPUT_LOW,
39
40 /* Touch screen INTERFACE */
41 GPIO84_GPIO | PIN_INPUT_PULLUP, /* TOUCH_INT1 */
42
43 /* STMPE1601/tc35893 keypad IRQ */
44 GPIO218_GPIO | PIN_INPUT_PULLUP,
45
46 /* MMC0 (MicroSD card) */
47 GPIO18_MC0_CMDDIR | PIN_OUTPUT_HIGH,
48 GPIO19_MC0_DAT0DIR | PIN_OUTPUT_HIGH,
49 GPIO20_MC0_DAT2DIR | PIN_OUTPUT_HIGH,
50
51 GPIO22_MC0_FBCLK | PIN_INPUT_NOPULL,
52 GPIO23_MC0_CLK | PIN_OUTPUT_LOW,
53 GPIO24_MC0_CMD | PIN_INPUT_PULLUP,
54 GPIO25_MC0_DAT0 | PIN_INPUT_PULLUP,
55 GPIO26_MC0_DAT1 | PIN_INPUT_PULLUP,
56 GPIO27_MC0_DAT2 | PIN_INPUT_PULLUP,
57 GPIO28_MC0_DAT3 | PIN_INPUT_PULLUP,
58
59 /* SDI1 (SDIO) */
60 GPIO208_MC1_CLK | PIN_OUTPUT_LOW,
61 GPIO209_MC1_FBCLK | PIN_INPUT_NOPULL,
62 GPIO210_MC1_CMD | PIN_INPUT_PULLUP,
63 GPIO211_MC1_DAT0 | PIN_INPUT_PULLUP,
64 GPIO212_MC1_DAT1 | PIN_INPUT_PULLUP,
65 GPIO213_MC1_DAT2 | PIN_INPUT_PULLUP,
66 GPIO214_MC1_DAT3 | PIN_INPUT_PULLUP,
67
68 /* MMC2 (On-board DATA INTERFACE eMMC) */
69 GPIO128_MC2_CLK | PIN_OUTPUT_LOW,
70 GPIO129_MC2_CMD | PIN_INPUT_PULLUP,
71 GPIO130_MC2_FBCLK | PIN_INPUT_NOPULL,
72 GPIO131_MC2_DAT0 | PIN_INPUT_PULLUP,
73 GPIO132_MC2_DAT1 | PIN_INPUT_PULLUP,
74 GPIO133_MC2_DAT2 | PIN_INPUT_PULLUP,
75 GPIO134_MC2_DAT3 | PIN_INPUT_PULLUP,
76 GPIO135_MC2_DAT4 | PIN_INPUT_PULLUP,
77 GPIO136_MC2_DAT5 | PIN_INPUT_PULLUP,
78 GPIO137_MC2_DAT6 | PIN_INPUT_PULLUP,
79 GPIO138_MC2_DAT7 | PIN_INPUT_PULLUP,
80
81 /* MMC4 (On-board STORAGE INTERFACE eMMC) */
82 GPIO197_MC4_DAT3 | PIN_INPUT_PULLUP,
83 GPIO198_MC4_DAT2 | PIN_INPUT_PULLUP,
84 GPIO199_MC4_DAT1 | PIN_INPUT_PULLUP,
85 GPIO200_MC4_DAT0 | PIN_INPUT_PULLUP,
86 GPIO201_MC4_CMD | PIN_INPUT_PULLUP,
87 GPIO202_MC4_FBCLK | PIN_INPUT_NOPULL,
88 GPIO203_MC4_CLK | PIN_OUTPUT_LOW,
89 GPIO204_MC4_DAT7 | PIN_INPUT_PULLUP,
90 GPIO205_MC4_DAT6 | PIN_INPUT_PULLUP,
91 GPIO206_MC4_DAT5 | PIN_INPUT_PULLUP,
92 GPIO207_MC4_DAT4 | PIN_INPUT_PULLUP,
93
94 /* SKE keypad */
95 GPIO153_KP_I7,
96 GPIO154_KP_I6,
97 GPIO155_KP_I5,
98 GPIO156_KP_I4,
99 GPIO157_KP_O7,
100 GPIO158_KP_O6,
101 GPIO159_KP_O5,
102 GPIO160_KP_O4,
103 GPIO161_KP_I3,
104 GPIO162_KP_I2,
105 GPIO163_KP_I1,
106 GPIO164_KP_I0,
107 GPIO165_KP_O3,
108 GPIO166_KP_O2,
109 GPIO167_KP_O1,
110 GPIO168_KP_O0,
111
112 /* UART */
113 GPIO0_U0_CTSn | PIN_INPUT_PULLUP,
114 GPIO1_U0_RTSn | PIN_OUTPUT_HIGH,
115 GPIO2_U0_RXD | PIN_INPUT_PULLUP,
116 GPIO3_U0_TXD | PIN_OUTPUT_HIGH,
117
118 GPIO29_U2_RXD | PIN_INPUT_PULLUP,
119 GPIO30_U2_TXD | PIN_OUTPUT_HIGH,
120 GPIO31_U2_CTSn | PIN_INPUT_PULLUP,
121 GPIO32_U2_RTSn | PIN_OUTPUT_HIGH,
122
123 /* Display & HDMI HW sync */
124 GPIO68_LCD_VSI0 | PIN_INPUT_PULLUP,
125 GPIO69_LCD_VSI1 | PIN_INPUT_PULLUP,
126};
127
128static pin_cfg_t mop500_pins_default[] = {
129 /* SSP0 */
130 GPIO143_SSP0_CLK,
131 GPIO144_SSP0_FRM,
132 GPIO145_SSP0_RXD | PIN_PULL_DOWN,
133 GPIO146_SSP0_TXD,
134
135
136 GPIO217_GPIO | PIN_INPUT_PULLUP, /* TC35892 IRQ */
137
138 /* SDI0 (MicroSD card) */
139 GPIO21_MC0_DAT31DIR | PIN_OUTPUT_HIGH,
140
141 /* UART */
142 GPIO4_U1_RXD | PIN_INPUT_PULLUP,
143 GPIO5_U1_TXD | PIN_OUTPUT_HIGH,
144 GPIO6_U1_CTSn | PIN_INPUT_PULLUP,
145 GPIO7_U1_RTSn | PIN_OUTPUT_HIGH,
146};
147
148static pin_cfg_t mop500_pins_hrefv60[] = {
149 /* WLAN */
150 GPIO4_GPIO | PIN_INPUT_PULLUP,/* WLAN_IRQ */
151 GPIO85_GPIO | PIN_OUTPUT_LOW,/* WLAN_ENA */
152
153 /* XENON Flashgun INTERFACE */
154 GPIO6_IP_GPIO0 | PIN_INPUT_PULLUP,/* XENON_FLASH_ID */
155 GPIO7_IP_GPIO1 | PIN_INPUT_PULLUP,/* XENON_READY */
156 GPIO170_GPIO | PIN_OUTPUT_LOW, /* XENON_CHARGE */
157
158 /* Assistant LED INTERFACE */
159 GPIO21_GPIO | PIN_OUTPUT_LOW, /* XENON_EN1 */
160 GPIO64_IP_GPIO4 | PIN_OUTPUT_LOW, /* XENON_EN2 */
161
162 /* Magnetometer */
163 GPIO31_GPIO | PIN_INPUT_PULLUP, /* magnetometer_INT */
164 GPIO32_GPIO | PIN_INPUT_PULLDOWN, /* Magnetometer DRDY */
165
166 /* Display Interface */
167 GPIO65_GPIO | PIN_OUTPUT_LOW, /* DISP1 RST */
168 GPIO66_GPIO | PIN_OUTPUT_LOW, /* DISP2 RST */
169
170 /* Touch screen INTERFACE */
171 GPIO143_GPIO | PIN_OUTPUT_LOW,/*TOUCH_RST1 */
172
173 /* Touch screen INTERFACE 2 */
174 GPIO67_GPIO | PIN_INPUT_PULLUP, /* TOUCH_INT2 */
175 GPIO146_GPIO | PIN_OUTPUT_LOW,/*TOUCH_RST2 */
176
177 /* ETM_PTM_TRACE INTERFACE */
178 GPIO70_GPIO | PIN_OUTPUT_LOW,/* ETM_PTM_DATA23 */
179 GPIO71_GPIO | PIN_OUTPUT_LOW,/* ETM_PTM_DATA22 */
180 GPIO72_GPIO | PIN_OUTPUT_LOW,/* ETM_PTM_DATA21 */
181 GPIO73_GPIO | PIN_OUTPUT_LOW,/* ETM_PTM_DATA20 */
182 GPIO74_GPIO | PIN_OUTPUT_LOW,/* ETM_PTM_DATA19 */
183
184 /* NAHJ INTERFACE */
185 GPIO76_GPIO | PIN_OUTPUT_LOW,/* NAHJ_CTRL */
186 GPIO216_GPIO | PIN_OUTPUT_HIGH,/* NAHJ_CTRL_INV */
187
188 /* NFC INTERFACE */
189 GPIO77_GPIO | PIN_OUTPUT_LOW, /* NFC_ENA */
190 GPIO144_GPIO | PIN_INPUT_PULLDOWN, /* NFC_IRQ */
191 GPIO142_GPIO | PIN_OUTPUT_LOW, /* NFC_RESET */
192
193 /* Keyboard MATRIX INTERFACE */
194 GPIO90_MC5_CMD | PIN_OUTPUT_LOW, /* KP_O_1 */
195 GPIO87_MC5_DAT1 | PIN_OUTPUT_LOW, /* KP_O_2 */
196 GPIO86_MC5_DAT0 | PIN_OUTPUT_LOW, /* KP_O_3 */
197 GPIO96_KP_O6 | PIN_OUTPUT_LOW, /* KP_O_6 */
198 GPIO94_KP_O7 | PIN_OUTPUT_LOW, /* KP_O_7 */
199 GPIO93_MC5_DAT4 | PIN_INPUT_PULLUP, /* KP_I_0 */
200 GPIO89_MC5_DAT3 | PIN_INPUT_PULLUP, /* KP_I_2 */
201 GPIO88_MC5_DAT2 | PIN_INPUT_PULLUP, /* KP_I_3 */
202 GPIO91_GPIO | PIN_INPUT_PULLUP, /* FORCE_SENSING_INT */
203 GPIO92_GPIO | PIN_OUTPUT_LOW, /* FORCE_SENSING_RST */
204 GPIO97_GPIO | PIN_OUTPUT_LOW, /* FORCE_SENSING_WU */
205
206 /* DiPro Sensor Interface */
207 GPIO139_GPIO | PIN_INPUT_PULLUP, /* DIPRO_INT */
208
209 /* HAL SWITCH INTERFACE */
210 GPIO145_GPIO | PIN_INPUT_PULLDOWN,/* HAL_SW */
211
212 /* Audio Amplifier Interface */
213 GPIO149_GPIO | PIN_OUTPUT_LOW, /* VAUDIO_HF_EN */
214
215 /* GBF INTERFACE */
216 GPIO171_GPIO | PIN_OUTPUT_LOW, /* GBF_ENA_RESET */
217
218 /* MSP : HDTV INTERFACE */
219 GPIO192_GPIO | PIN_INPUT_PULLDOWN,
220
221 /* ACCELEROMETER_INTERFACE */
222 GPIO82_GPIO | PIN_INPUT_PULLUP, /* ACC_INT1 */
223 GPIO83_GPIO | PIN_INPUT_PULLUP, /* ACC_INT2 */
224
225 /* Proximity Sensor */
226 GPIO217_GPIO | PIN_INPUT_PULLUP,
227
228
229};
230
231void __init mop500_pins_init(void)
232{
233 nmk_config_pins(mop500_pins_common,
234 ARRAY_SIZE(mop500_pins_common));
235 if (machine_is_hrefv60())
236 nmk_config_pins(mop500_pins_hrefv60,
237 ARRAY_SIZE(mop500_pins_hrefv60));
238 else
239 nmk_config_pins(mop500_pins_default,
240 ARRAY_SIZE(mop500_pins_default));
241}
diff --git a/arch/arm/mach-ux500/board-mop500-regulators.c b/arch/arm/mach-ux500/board-mop500-regulators.c
index 533967c2d095..875c91b2f8a4 100644
--- a/arch/arm/mach-ux500/board-mop500-regulators.c
+++ b/arch/arm/mach-ux500/board-mop500-regulators.c
@@ -11,6 +11,56 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/regulator/machine.h> 12#include <linux/regulator/machine.h>
13#include <linux/regulator/ab8500.h> 13#include <linux/regulator/ab8500.h>
14#include "board-mop500-regulators.h"
15
16static struct regulator_consumer_supply ab8500_vaux1_consumers[] = {
17 /* External displays, connector on board 2v5 power supply */
18 REGULATOR_SUPPLY("vaux12v5", "mcde.0"),
19 /* SFH7741 proximity sensor */
20 REGULATOR_SUPPLY("vcc", "gpio-keys.0"),
21 /* BH1780GLS ambient light sensor */
22 REGULATOR_SUPPLY("vcc", "2-0029"),
23 /* lsm303dlh accelerometer */
24 REGULATOR_SUPPLY("vdd", "3-0018"),
25 /* lsm303dlh magnetometer */
26 REGULATOR_SUPPLY("vdd", "3-001e"),
27 /* Rohm BU21013 Touchscreen devices */
28 REGULATOR_SUPPLY("avdd", "3-005c"),
29 REGULATOR_SUPPLY("avdd", "3-005d"),
30 /* Synaptics RMI4 Touchscreen device */
31 REGULATOR_SUPPLY("vdd", "3-004b"),
32};
33
34static struct regulator_consumer_supply ab8500_vaux2_consumers[] = {
35 /* On-board eMMC power */
36 REGULATOR_SUPPLY("vmmc", "sdi4"),
37 /* AB8500 audio codec */
38 REGULATOR_SUPPLY("vcc-N2158", "ab8500-codec.0"),
39};
40
41static struct regulator_consumer_supply ab8500_vaux3_consumers[] = {
42 /* External MMC slot power */
43 REGULATOR_SUPPLY("vmmc", "sdi0"),
44};
45
46static struct regulator_consumer_supply ab8500_vtvout_consumers[] = {
47 /* TV-out DENC supply */
48 REGULATOR_SUPPLY("vtvout", "ab8500-denc.0"),
49 /* Internal general-purpose ADC */
50 REGULATOR_SUPPLY("vddadc", "ab8500-gpadc.0"),
51};
52
53static struct regulator_consumer_supply ab8500_vintcore_consumers[] = {
54 /* SoC core supply, no device */
55 REGULATOR_SUPPLY("v-intcore", NULL),
56 /* USB Transciever */
57 REGULATOR_SUPPLY("vddulpivio18", "ab8500-usb.0"),
58};
59
60static struct regulator_consumer_supply ab8500_vana_consumers[] = {
61 /* External displays, connector on board, 1v8 power supply */
62 REGULATOR_SUPPLY("vsmps2", "mcde.0"),
63};
14 64
15/* AB8500 regulators */ 65/* AB8500 regulators */
16struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = { 66struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = {
@@ -23,6 +73,8 @@ struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = {
23 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 73 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
24 REGULATOR_CHANGE_STATUS, 74 REGULATOR_CHANGE_STATUS,
25 }, 75 },
76 .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux1_consumers),
77 .consumer_supplies = ab8500_vaux1_consumers,
26 }, 78 },
27 /* supplies to the on-board eMMC */ 79 /* supplies to the on-board eMMC */
28 [AB8500_LDO_AUX2] = { 80 [AB8500_LDO_AUX2] = {
@@ -33,6 +85,8 @@ struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = {
33 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 85 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
34 REGULATOR_CHANGE_STATUS, 86 REGULATOR_CHANGE_STATUS,
35 }, 87 },
88 .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux2_consumers),
89 .consumer_supplies = ab8500_vaux2_consumers,
36 }, 90 },
37 /* supply for VAUX3, supplies to SDcard slots */ 91 /* supply for VAUX3, supplies to SDcard slots */
38 [AB8500_LDO_AUX3] = { 92 [AB8500_LDO_AUX3] = {
@@ -43,6 +97,8 @@ struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = {
43 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | 97 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
44 REGULATOR_CHANGE_STATUS, 98 REGULATOR_CHANGE_STATUS,
45 }, 99 },
100 .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux3_consumers),
101 .consumer_supplies = ab8500_vaux3_consumers,
46 }, 102 },
47 /* supply for tvout, gpadc, TVOUT LDO */ 103 /* supply for tvout, gpadc, TVOUT LDO */
48 [AB8500_LDO_TVOUT] = { 104 [AB8500_LDO_TVOUT] = {
@@ -50,6 +106,8 @@ struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = {
50 .name = "V-TVOUT", 106 .name = "V-TVOUT",
51 .valid_ops_mask = REGULATOR_CHANGE_STATUS, 107 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
52 }, 108 },
109 .num_consumer_supplies = ARRAY_SIZE(ab8500_vtvout_consumers),
110 .consumer_supplies = ab8500_vtvout_consumers,
53 }, 111 },
54 /* supply for ab8500-vaudio, VAUDIO LDO */ 112 /* supply for ab8500-vaudio, VAUDIO LDO */
55 [AB8500_LDO_AUDIO] = { 113 [AB8500_LDO_AUDIO] = {
@@ -85,6 +143,8 @@ struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = {
85 .name = "V-INTCORE", 143 .name = "V-INTCORE",
86 .valid_ops_mask = REGULATOR_CHANGE_STATUS, 144 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
87 }, 145 },
146 .num_consumer_supplies = ARRAY_SIZE(ab8500_vintcore_consumers),
147 .consumer_supplies = ab8500_vintcore_consumers,
88 }, 148 },
89 /* supply for U8500 CSI/DSI, VANA LDO */ 149 /* supply for U8500 CSI/DSI, VANA LDO */
90 [AB8500_LDO_ANA] = { 150 [AB8500_LDO_ANA] = {
@@ -92,5 +152,7 @@ struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = {
92 .name = "V-CSI/DSI", 152 .name = "V-CSI/DSI",
93 .valid_ops_mask = REGULATOR_CHANGE_STATUS, 153 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
94 }, 154 },
155 .num_consumer_supplies = ARRAY_SIZE(ab8500_vana_consumers),
156 .consumer_supplies = ab8500_vana_consumers,
95 }, 157 },
96}; 158};
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
index 4b996676594e..bf0b02414e5b 100644
--- a/arch/arm/mach-ux500/board-mop500-sdi.c
+++ b/arch/arm/mach-ux500/board-mop500-sdi.c
@@ -12,56 +12,14 @@
12#include <linux/mmc/host.h> 12#include <linux/mmc/host.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14 14
15#include <plat/pincfg.h> 15#include <asm/mach-types.h>
16#include <plat/ste_dma40.h>
16#include <mach/devices.h> 17#include <mach/devices.h>
17#include <mach/hardware.h> 18#include <mach/hardware.h>
18 19
19#include "devices-db8500.h" 20#include "devices-db8500.h"
20#include "pins-db8500.h"
21#include "board-mop500.h" 21#include "board-mop500.h"
22 22#include "ste-dma40-db8500.h"
23static pin_cfg_t mop500_sdi_pins[] = {
24 /* SDI0 (MicroSD slot) */
25 GPIO18_MC0_CMDDIR,
26 GPIO19_MC0_DAT0DIR,
27 GPIO20_MC0_DAT2DIR,
28 GPIO21_MC0_DAT31DIR,
29 GPIO22_MC0_FBCLK,
30 GPIO23_MC0_CLK,
31 GPIO24_MC0_CMD,
32 GPIO25_MC0_DAT0,
33 GPIO26_MC0_DAT1,
34 GPIO27_MC0_DAT2,
35 GPIO28_MC0_DAT3,
36
37 /* SDI4 (on-board eMMC) */
38 GPIO197_MC4_DAT3,
39 GPIO198_MC4_DAT2,
40 GPIO199_MC4_DAT1,
41 GPIO200_MC4_DAT0,
42 GPIO201_MC4_CMD,
43 GPIO202_MC4_FBCLK,
44 GPIO203_MC4_CLK,
45 GPIO204_MC4_DAT7,
46 GPIO205_MC4_DAT6,
47 GPIO206_MC4_DAT5,
48 GPIO207_MC4_DAT4,
49};
50
51static pin_cfg_t mop500_sdi2_pins[] = {
52 /* SDI2 (POP eMMC) */
53 GPIO128_MC2_CLK,
54 GPIO129_MC2_CMD,
55 GPIO130_MC2_FBCLK,
56 GPIO131_MC2_DAT0,
57 GPIO132_MC2_DAT1,
58 GPIO133_MC2_DAT2,
59 GPIO134_MC2_DAT3,
60 GPIO135_MC2_DAT4,
61 GPIO136_MC2_DAT5,
62 GPIO137_MC2_DAT6,
63 GPIO138_MC2_DAT7,
64};
65 23
66/* 24/*
67 * SDI 0 (MicroSD slot) 25 * SDI 0 (MicroSD slot)
@@ -86,48 +44,134 @@ static u32 mop500_sdi0_vdd_handler(struct device *dev, unsigned int vdd,
86 MCI_DATA2DIREN | MCI_DATA31DIREN; 44 MCI_DATA2DIREN | MCI_DATA31DIREN;
87} 45}
88 46
47#ifdef CONFIG_STE_DMA40
48struct stedma40_chan_cfg mop500_sdi0_dma_cfg_rx = {
49 .mode = STEDMA40_MODE_LOGICAL,
50 .dir = STEDMA40_PERIPH_TO_MEM,
51 .src_dev_type = DB8500_DMA_DEV29_SD_MM0_RX,
52 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
53 .src_info.data_width = STEDMA40_WORD_WIDTH,
54 .dst_info.data_width = STEDMA40_WORD_WIDTH,
55};
56
57static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = {
58 .mode = STEDMA40_MODE_LOGICAL,
59 .dir = STEDMA40_MEM_TO_PERIPH,
60 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
61 .dst_dev_type = DB8500_DMA_DEV29_SD_MM0_TX,
62 .src_info.data_width = STEDMA40_WORD_WIDTH,
63 .dst_info.data_width = STEDMA40_WORD_WIDTH,
64};
65#endif
66
89static struct mmci_platform_data mop500_sdi0_data = { 67static struct mmci_platform_data mop500_sdi0_data = {
90 .vdd_handler = mop500_sdi0_vdd_handler, 68 .vdd_handler = mop500_sdi0_vdd_handler,
91 .ocr_mask = MMC_VDD_29_30, 69 .ocr_mask = MMC_VDD_29_30,
92 .f_max = 100000000, 70 .f_max = 100000000,
93 .capabilities = MMC_CAP_4_BIT_DATA, 71 .capabilities = MMC_CAP_4_BIT_DATA,
94 .gpio_cd = GPIO_SDMMC_CD,
95 .gpio_wp = -1, 72 .gpio_wp = -1,
73#ifdef CONFIG_STE_DMA40
74 .dma_filter = stedma40_filter,
75 .dma_rx_param = &mop500_sdi0_dma_cfg_rx,
76 .dma_tx_param = &mop500_sdi0_dma_cfg_tx,
77#endif
96}; 78};
97 79
98void mop500_sdi_tc35892_init(void) 80/* GPIO pins used by the sdi0 level shifter */
81static int sdi0_en = -1;
82static int sdi0_vsel = -1;
83
84static void sdi0_configure(void)
99{ 85{
100 int ret; 86 int ret;
101 87
102 ret = gpio_request(GPIO_SDMMC_EN, "SDMMC_EN"); 88 ret = gpio_request(sdi0_en, "level shifter enable");
103 if (!ret) 89 if (!ret)
104 ret = gpio_request(GPIO_SDMMC_1V8_3V_SEL, 90 ret = gpio_request(sdi0_vsel,
105 "GPIO_SDMMC_1V8_3V_SEL"); 91 "level shifter 1v8-3v select");
106 if (ret) 92
93 if (ret) {
94 pr_warning("unable to config sdi0 gpios for level shifter.\n");
107 return; 95 return;
96 }
108 97
109 gpio_direction_output(GPIO_SDMMC_1V8_3V_SEL, 1); 98 /* Select the default 2.9V and enable level shifter */
110 gpio_direction_output(GPIO_SDMMC_EN, 0); 99 gpio_direction_output(sdi0_vsel, 0);
100 gpio_direction_output(sdi0_en, 1);
111 101
102 /* Add the device */
112 db8500_add_sdi0(&mop500_sdi0_data); 103 db8500_add_sdi0(&mop500_sdi0_data);
113} 104}
114 105
106void mop500_sdi_tc35892_init(void)
107{
108 mop500_sdi0_data.gpio_cd = GPIO_SDMMC_CD;
109 sdi0_en = GPIO_SDMMC_EN;
110 sdi0_vsel = GPIO_SDMMC_1V8_3V_SEL;
111 sdi0_configure();
112}
113
115/* 114/*
116 * SDI 2 (POP eMMC, not on DB8500ed) 115 * SDI 2 (POP eMMC, not on DB8500ed)
117 */ 116 */
118 117
118#ifdef CONFIG_STE_DMA40
119struct stedma40_chan_cfg mop500_sdi2_dma_cfg_rx = {
120 .mode = STEDMA40_MODE_LOGICAL,
121 .dir = STEDMA40_PERIPH_TO_MEM,
122 .src_dev_type = DB8500_DMA_DEV28_SD_MM2_RX,
123 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
124 .src_info.data_width = STEDMA40_WORD_WIDTH,
125 .dst_info.data_width = STEDMA40_WORD_WIDTH,
126};
127
128static struct stedma40_chan_cfg mop500_sdi2_dma_cfg_tx = {
129 .mode = STEDMA40_MODE_LOGICAL,
130 .dir = STEDMA40_MEM_TO_PERIPH,
131 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
132 .dst_dev_type = DB8500_DMA_DEV28_SD_MM2_TX,
133 .src_info.data_width = STEDMA40_WORD_WIDTH,
134 .dst_info.data_width = STEDMA40_WORD_WIDTH,
135};
136#endif
137
119static struct mmci_platform_data mop500_sdi2_data = { 138static struct mmci_platform_data mop500_sdi2_data = {
120 .ocr_mask = MMC_VDD_165_195, 139 .ocr_mask = MMC_VDD_165_195,
121 .f_max = 100000000, 140 .f_max = 100000000,
122 .capabilities = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, 141 .capabilities = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
123 .gpio_cd = -1, 142 .gpio_cd = -1,
124 .gpio_wp = -1, 143 .gpio_wp = -1,
144#ifdef CONFIG_STE_DMA40
145 .dma_filter = stedma40_filter,
146 .dma_rx_param = &mop500_sdi2_dma_cfg_rx,
147 .dma_tx_param = &mop500_sdi2_dma_cfg_tx,
148#endif
125}; 149};
126 150
127/* 151/*
128 * SDI 4 (on-board eMMC) 152 * SDI 4 (on-board eMMC)
129 */ 153 */
130 154
155#ifdef CONFIG_STE_DMA40
156struct stedma40_chan_cfg mop500_sdi4_dma_cfg_rx = {
157 .mode = STEDMA40_MODE_LOGICAL,
158 .dir = STEDMA40_PERIPH_TO_MEM,
159 .src_dev_type = DB8500_DMA_DEV42_SD_MM4_RX,
160 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
161 .src_info.data_width = STEDMA40_WORD_WIDTH,
162 .dst_info.data_width = STEDMA40_WORD_WIDTH,
163};
164
165static struct stedma40_chan_cfg mop500_sdi4_dma_cfg_tx = {
166 .mode = STEDMA40_MODE_LOGICAL,
167 .dir = STEDMA40_MEM_TO_PERIPH,
168 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
169 .dst_dev_type = DB8500_DMA_DEV42_SD_MM4_TX,
170 .src_info.data_width = STEDMA40_WORD_WIDTH,
171 .dst_info.data_width = STEDMA40_WORD_WIDTH,
172};
173#endif
174
131static struct mmci_platform_data mop500_sdi4_data = { 175static struct mmci_platform_data mop500_sdi4_data = {
132 .ocr_mask = MMC_VDD_29_30, 176 .ocr_mask = MMC_VDD_29_30,
133 .f_max = 100000000, 177 .f_max = 100000000,
@@ -135,26 +179,32 @@ static struct mmci_platform_data mop500_sdi4_data = {
135 MMC_CAP_MMC_HIGHSPEED, 179 MMC_CAP_MMC_HIGHSPEED,
136 .gpio_cd = -1, 180 .gpio_cd = -1,
137 .gpio_wp = -1, 181 .gpio_wp = -1,
182#ifdef CONFIG_STE_DMA40
183 .dma_filter = stedma40_filter,
184 .dma_rx_param = &mop500_sdi4_dma_cfg_rx,
185 .dma_tx_param = &mop500_sdi4_dma_cfg_tx,
186#endif
138}; 187};
139 188
140void __init mop500_sdi_init(void) 189void __init mop500_sdi_init(void)
141{ 190{
142 nmk_config_pins(mop500_sdi_pins, ARRAY_SIZE(mop500_sdi_pins)); 191 /* PoP:ed eMMC on top of DB8500 v1.0 has problems with high speed */
192 if (!cpu_is_u8500v10())
193 mop500_sdi2_data.capabilities |= MMC_CAP_MMC_HIGHSPEED;
194 db8500_add_sdi2(&mop500_sdi2_data);
195
196 /* On-board eMMC */
197 db8500_add_sdi4(&mop500_sdi4_data);
143 198
199 if (machine_is_hrefv60()) {
200 mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
201 sdi0_en = HREFV60_SDMMC_EN_GPIO;
202 sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
203 sdi0_configure();
204 }
144 /* 205 /*
145 * sdi0 will finally be added when the TC35892 initializes and calls 206 * On boards with the TC35892 GPIO expander, sdi0 will finally
207 * be added when the TC35892 initializes and calls
146 * mop500_sdi_tc35892_init() above. 208 * mop500_sdi_tc35892_init() above.
147 */ 209 */
148
149 /* PoP:ed eMMC */
150 if (!cpu_is_u8500ed()) {
151 nmk_config_pins(mop500_sdi2_pins, ARRAY_SIZE(mop500_sdi2_pins));
152 /* POP eMMC on v1.0 has problems with high speed */
153 if (!cpu_is_u8500v10())
154 mop500_sdi2_data.capabilities |= MMC_CAP_MMC_HIGHSPEED;
155 db8500_add_sdi2(&mop500_sdi2_data);
156 }
157
158 /* On-board eMMC */
159 db8500_add_sdi4(&mop500_sdi4_data);
160} 210}
diff --git a/arch/arm/mach-ux500/board-mop500-stuib.c b/arch/arm/mach-ux500/board-mop500-stuib.c
new file mode 100644
index 000000000000..8c979770d872
--- /dev/null
+++ b/arch/arm/mach-ux500/board-mop500-stuib.c
@@ -0,0 +1,205 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License terms: GNU General Public License (GPL), version 2
5 */
6
7#include <linux/kernel.h>
8#include <linux/init.h>
9#include <linux/mfd/stmpe.h>
10#include <linux/input/bu21013.h>
11#include <linux/gpio.h>
12#include <linux/interrupt.h>
13#include <linux/i2c.h>
14#include <linux/input/matrix_keypad.h>
15#include <asm/mach-types.h>
16
17#include "board-mop500.h"
18
19/* STMPE/SKE keypad use this key layout */
20static const unsigned int mop500_keymap[] = {
21 KEY(2, 5, KEY_END),
22 KEY(4, 1, KEY_POWER),
23 KEY(3, 5, KEY_VOLUMEDOWN),
24 KEY(1, 3, KEY_3),
25 KEY(5, 2, KEY_RIGHT),
26 KEY(5, 0, KEY_9),
27
28 KEY(0, 5, KEY_MENU),
29 KEY(7, 6, KEY_ENTER),
30 KEY(4, 5, KEY_0),
31 KEY(6, 7, KEY_2),
32 KEY(3, 4, KEY_UP),
33 KEY(3, 3, KEY_DOWN),
34
35 KEY(6, 4, KEY_SEND),
36 KEY(6, 2, KEY_BACK),
37 KEY(4, 2, KEY_VOLUMEUP),
38 KEY(5, 5, KEY_1),
39 KEY(4, 3, KEY_LEFT),
40 KEY(3, 2, KEY_7),
41};
42
43static const struct matrix_keymap_data mop500_keymap_data = {
44 .keymap = mop500_keymap,
45 .keymap_size = ARRAY_SIZE(mop500_keymap),
46};
47/*
48 * STMPE1601
49 */
50static struct stmpe_keypad_platform_data stmpe1601_keypad_data = {
51 .debounce_ms = 64,
52 .scan_count = 8,
53 .no_autorepeat = true,
54 .keymap_data = &mop500_keymap_data,
55};
56
57static struct stmpe_platform_data stmpe1601_data = {
58 .id = 1,
59 .blocks = STMPE_BLOCK_KEYPAD,
60 .irq_trigger = IRQF_TRIGGER_FALLING,
61 .irq_base = MOP500_STMPE1601_IRQ(0),
62 .keypad = &stmpe1601_keypad_data,
63 .autosleep = true,
64 .autosleep_timeout = 1024,
65};
66
67static struct i2c_board_info __initdata mop500_i2c0_devices_stuib[] = {
68 {
69 I2C_BOARD_INFO("stmpe1601", 0x40),
70 .irq = NOMADIK_GPIO_TO_IRQ(218),
71 .platform_data = &stmpe1601_data,
72 .flags = I2C_CLIENT_WAKE,
73 },
74};
75
76/*
77 * BU21013 ROHM touchscreen interface on the STUIBs
78 */
79
80/* tracks number of bu21013 devices being enabled */
81static int bu21013_devices;
82
83#define TOUCH_GPIO_PIN 84
84
85#define TOUCH_XMAX 384
86#define TOUCH_YMAX 704
87
88#define PRCMU_CLOCK_OCR 0x1CC
89#define TSC_EXT_CLOCK_9_6MHZ 0x840000
90
91/**
92 * bu21013_gpio_board_init : configures the touch panel.
93 * @reset_pin: reset pin number
94 * This function can be used to configures
95 * the voltage and reset the touch panel controller.
96 */
97static int bu21013_gpio_board_init(int reset_pin)
98{
99 int retval = 0;
100
101 bu21013_devices++;
102 if (bu21013_devices == 1) {
103 retval = gpio_request(reset_pin, "touchp_reset");
104 if (retval) {
105 printk(KERN_ERR "Unable to request gpio reset_pin");
106 return retval;
107 }
108 retval = gpio_direction_output(reset_pin, 1);
109 if (retval < 0) {
110 printk(KERN_ERR "%s: gpio direction failed\n",
111 __func__);
112 return retval;
113 }
114 }
115
116 return retval;
117}
118
119/**
120 * bu21013_gpio_board_exit : deconfigures the touch panel controller
121 * @reset_pin: reset pin number
122 * This function can be used to deconfigures the chip selection
123 * for touch panel controller.
124 */
125static int bu21013_gpio_board_exit(int reset_pin)
126{
127 int retval = 0;
128
129 if (bu21013_devices == 1) {
130 retval = gpio_direction_output(reset_pin, 0);
131 if (retval < 0) {
132 printk(KERN_ERR "%s: gpio direction failed\n",
133 __func__);
134 return retval;
135 }
136 gpio_set_value(reset_pin, 0);
137 }
138 bu21013_devices--;
139
140 return retval;
141}
142
143/**
144 * bu21013_read_pin_val : get the interrupt pin value
145 * This function can be used to get the interrupt pin value for touch panel
146 * controller.
147 */
148static int bu21013_read_pin_val(void)
149{
150 return gpio_get_value(TOUCH_GPIO_PIN);
151}
152
153static struct bu21013_platform_device tsc_plat_device = {
154 .cs_en = bu21013_gpio_board_init,
155 .cs_dis = bu21013_gpio_board_exit,
156 .irq_read_val = bu21013_read_pin_val,
157 .irq = NOMADIK_GPIO_TO_IRQ(TOUCH_GPIO_PIN),
158 .touch_x_max = TOUCH_XMAX,
159 .touch_y_max = TOUCH_YMAX,
160 .ext_clk = false,
161 .x_flip = false,
162 .y_flip = true,
163};
164
165static struct bu21013_platform_device tsc_plat2_device = {
166 .cs_en = bu21013_gpio_board_init,
167 .cs_dis = bu21013_gpio_board_exit,
168 .irq_read_val = bu21013_read_pin_val,
169 .irq = NOMADIK_GPIO_TO_IRQ(TOUCH_GPIO_PIN),
170 .touch_x_max = TOUCH_XMAX,
171 .touch_y_max = TOUCH_YMAX,
172 .ext_clk = false,
173 .x_flip = false,
174 .y_flip = true,
175};
176
177static struct i2c_board_info __initdata u8500_i2c3_devices_stuib[] = {
178 {
179 I2C_BOARD_INFO("bu21013_tp", 0x5C),
180 .platform_data = &tsc_plat_device,
181 },
182 {
183 I2C_BOARD_INFO("bu21013_tp", 0x5D),
184 .platform_data = &tsc_plat2_device,
185 },
186
187};
188
189void __init mop500_stuib_init(void)
190{
191 if (machine_is_hrefv60()) {
192 tsc_plat_device.cs_pin = HREFV60_TOUCH_RST_GPIO;
193 tsc_plat2_device.cs_pin = HREFV60_TOUCH_RST_GPIO;
194 } else {
195 tsc_plat_device.cs_pin = GPIO_BU21013_CS;
196 tsc_plat2_device.cs_pin = GPIO_BU21013_CS;
197
198 }
199
200 mop500_uib_i2c_add(0, mop500_i2c0_devices_stuib,
201 ARRAY_SIZE(mop500_i2c0_devices_stuib));
202
203 mop500_uib_i2c_add(3, u8500_i2c3_devices_stuib,
204 ARRAY_SIZE(u8500_i2c3_devices_stuib));
205}
diff --git a/arch/arm/mach-ux500/board-mop500-u8500uib.c b/arch/arm/mach-ux500/board-mop500-u8500uib.c
new file mode 100644
index 000000000000..d8a8734a0eba
--- /dev/null
+++ b/arch/arm/mach-ux500/board-mop500-u8500uib.c
@@ -0,0 +1,111 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * Board data for the U8500 UIB, also known as the New UIB
5 * License terms: GNU General Public License (GPL), version 2
6 */
7
8#include <linux/kernel.h>
9#include <linux/init.h>
10#include <linux/i2c.h>
11#include <linux/gpio.h>
12#include <linux/interrupt.h>
13#include <linux/mfd/tc3589x.h>
14#include <linux/input/matrix_keypad.h>
15#include <../drivers/staging/ste_rmi4/synaptics_i2c_rmi4.h>
16
17#include <mach/gpio.h>
18#include <mach/irqs.h>
19
20#include "board-mop500.h"
21
22/*
23 * Synaptics RMI4 touchscreen interface on the U8500 UIB
24 */
25
26/*
27 * Descriptor structure.
28 * Describes the number of i2c devices on the bus that speak RMI.
29 */
30static struct synaptics_rmi4_platform_data rmi4_i2c_dev_platformdata = {
31 .irq_number = NOMADIK_GPIO_TO_IRQ(84),
32 .irq_type = (IRQF_TRIGGER_FALLING | IRQF_SHARED),
33 .x_flip = false,
34 .y_flip = true,
35 .regulator_en = false,
36};
37
38static struct i2c_board_info __initdata mop500_i2c3_devices_u8500[] = {
39 {
40 I2C_BOARD_INFO("synaptics_rmi4_i2c", 0x4B),
41 .platform_data = &rmi4_i2c_dev_platformdata,
42 },
43};
44
45/*
46 * TC35893
47 */
48static const unsigned int u8500_keymap[] = {
49 KEY(3, 1, KEY_END),
50 KEY(4, 1, KEY_POWER),
51 KEY(6, 4, KEY_VOLUMEDOWN),
52 KEY(4, 2, KEY_EMAIL),
53 KEY(3, 3, KEY_RIGHT),
54 KEY(2, 5, KEY_BACKSPACE),
55
56 KEY(6, 7, KEY_MENU),
57 KEY(5, 0, KEY_ENTER),
58 KEY(4, 3, KEY_0),
59 KEY(3, 4, KEY_DOT),
60 KEY(5, 2, KEY_UP),
61 KEY(3, 5, KEY_DOWN),
62
63 KEY(4, 5, KEY_SEND),
64 KEY(0, 5, KEY_BACK),
65 KEY(6, 2, KEY_VOLUMEUP),
66 KEY(1, 3, KEY_SPACE),
67 KEY(7, 6, KEY_LEFT),
68 KEY(5, 5, KEY_SEARCH),
69};
70
71static struct matrix_keymap_data u8500_keymap_data = {
72 .keymap = u8500_keymap,
73 .keymap_size = ARRAY_SIZE(u8500_keymap),
74};
75
76static struct tc3589x_keypad_platform_data tc35893_data = {
77 .krow = TC_KPD_ROWS,
78 .kcol = TC_KPD_COLUMNS,
79 .debounce_period = TC_KPD_DEBOUNCE_PERIOD,
80 .settle_time = TC_KPD_SETTLE_TIME,
81 .irqtype = IRQF_TRIGGER_FALLING,
82 .enable_wakeup = true,
83 .keymap_data = &u8500_keymap_data,
84 .no_autorepeat = true,
85};
86
87static struct tc3589x_platform_data tc3589x_keypad_data = {
88 .block = TC3589x_BLOCK_KEYPAD,
89 .keypad = &tc35893_data,
90 .irq_base = MOP500_EGPIO_IRQ_BASE,
91};
92
93static struct i2c_board_info __initdata mop500_i2c0_devices_u8500[] = {
94 {
95 I2C_BOARD_INFO("tc3589x", 0x44),
96 .platform_data = &tc3589x_keypad_data,
97 .irq = NOMADIK_GPIO_TO_IRQ(218),
98 .flags = I2C_CLIENT_WAKE,
99 },
100};
101
102
103void __init mop500_u8500uib_init(void)
104{
105 mop500_uib_i2c_add(3, mop500_i2c3_devices_u8500,
106 ARRAY_SIZE(mop500_i2c3_devices_u8500));
107
108 mop500_uib_i2c_add(0, mop500_i2c0_devices_u8500,
109 ARRAY_SIZE(mop500_i2c0_devices_u8500));
110
111}
diff --git a/arch/arm/mach-ux500/board-mop500-uib.c b/arch/arm/mach-ux500/board-mop500-uib.c
new file mode 100644
index 000000000000..69cce41f602a
--- /dev/null
+++ b/arch/arm/mach-ux500/board-mop500-uib.c
@@ -0,0 +1,135 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
5 * License terms: GNU General Public License (GPL), version 2
6 */
7
8#define pr_fmt(fmt) "mop500-uib: " fmt
9
10#include <linux/kernel.h>
11#include <linux/init.h>
12#include <linux/i2c.h>
13
14#include <mach/hardware.h>
15#include "board-mop500.h"
16
17enum mop500_uib {
18 STUIB,
19 U8500UIB,
20};
21
22struct uib {
23 const char *name;
24 const char *option;
25 void (*init)(void);
26};
27
28static struct __initdata uib mop500_uibs[] = {
29 [STUIB] = {
30 .name = "ST-UIB",
31 .option = "stuib",
32 .init = mop500_stuib_init,
33 },
34 [U8500UIB] = {
35 .name = "U8500-UIB",
36 .option = "u8500uib",
37 .init = mop500_u8500uib_init,
38 },
39};
40
41static struct uib *mop500_uib;
42
43static int __init mop500_uib_setup(char *str)
44{
45 int i;
46
47 for (i = 0; i < ARRAY_SIZE(mop500_uibs); i++) {
48 struct uib *uib = &mop500_uibs[i];
49
50 if (!strcmp(str, uib->option)) {
51 mop500_uib = uib;
52 break;
53 }
54 }
55
56 if (i == ARRAY_SIZE(mop500_uibs))
57 pr_err("invalid uib= option (%s)\n", str);
58
59 return 1;
60}
61__setup("uib=", mop500_uib_setup);
62
63/*
64 * The UIBs are detected after the I2C host controllers are registered, so
65 * i2c_register_board_info() can't be used.
66 */
67void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info,
68 unsigned n)
69{
70 struct i2c_adapter *adap;
71 struct i2c_client *client;
72 int i;
73
74 adap = i2c_get_adapter(busnum);
75 if (!adap) {
76 pr_err("failed to get adapter i2c%d\n", busnum);
77 return;
78 }
79
80 for (i = 0; i < n; i++) {
81 client = i2c_new_device(adap, &info[i]);
82 if (!client)
83 pr_err("failed to register %s to i2c%d\n",
84 info[i].type, busnum);
85 }
86
87 i2c_put_adapter(adap);
88}
89
90static void __init __mop500_uib_init(struct uib *uib, const char *why)
91{
92 pr_info("%s (%s)\n", uib->name, why);
93 uib->init();
94}
95
96/*
97 * Detect the UIB attached based on the presence or absence of i2c devices.
98 */
99static int __init mop500_uib_init(void)
100{
101 struct uib *uib = mop500_uib;
102 struct i2c_adapter *i2c0;
103 int ret;
104
105 if (!cpu_is_u8500())
106 return -ENODEV;
107
108 if (uib) {
109 __mop500_uib_init(uib, "from uib= boot argument");
110 return 0;
111 }
112
113 i2c0 = i2c_get_adapter(0);
114 if (!i2c0) {
115 __mop500_uib_init(&mop500_uibs[STUIB],
116 "fallback, could not get i2c0");
117 return -ENODEV;
118 }
119
120 /* U8500-UIB has the TC35893 at 0x44 on I2C0, the ST-UIB doesn't. */
121 ret = i2c_smbus_xfer(i2c0, 0x44, 0, I2C_SMBUS_WRITE, 0,
122 I2C_SMBUS_QUICK, NULL);
123 i2c_put_adapter(i2c0);
124
125 if (ret == 0)
126 uib = &mop500_uibs[U8500UIB];
127 else
128 uib = &mop500_uibs[STUIB];
129
130 __mop500_uib_init(uib, "detected");
131
132 return 0;
133}
134
135module_init(mop500_uib_init);
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index a393f57ed2a8..8790d984cac8 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -17,68 +17,30 @@
17#include <linux/gpio.h> 17#include <linux/gpio.h>
18#include <linux/amba/bus.h> 18#include <linux/amba/bus.h>
19#include <linux/amba/pl022.h> 19#include <linux/amba/pl022.h>
20#include <linux/amba/serial.h>
20#include <linux/spi/spi.h> 21#include <linux/spi/spi.h>
21#include <linux/mfd/ab8500.h> 22#include <linux/mfd/ab8500.h>
22#include <linux/mfd/tc3589x.h> 23#include <linux/mfd/tc3589x.h>
24#include <linux/leds-lp5521.h>
25#include <linux/input.h>
26#include <linux/gpio_keys.h>
23 27
24#include <asm/mach-types.h> 28#include <asm/mach-types.h>
25#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
26 30
27#include <plat/pincfg.h>
28#include <plat/i2c.h> 31#include <plat/i2c.h>
32#include <plat/ste_dma40.h>
29 33
30#include <mach/hardware.h> 34#include <mach/hardware.h>
31#include <mach/setup.h> 35#include <mach/setup.h>
32#include <mach/devices.h> 36#include <mach/devices.h>
33#include <mach/irqs.h> 37#include <mach/irqs.h>
34 38
39#include "ste-dma40-db8500.h"
35#include "devices-db8500.h" 40#include "devices-db8500.h"
36#include "pins-db8500.h"
37#include "board-mop500.h" 41#include "board-mop500.h"
38#include "board-mop500-regulators.h" 42#include "board-mop500-regulators.h"
39 43
40static pin_cfg_t mop500_pins[] = {
41 /* SSP0 */
42 GPIO143_SSP0_CLK,
43 GPIO144_SSP0_FRM,
44 GPIO145_SSP0_RXD,
45 GPIO146_SSP0_TXD,
46
47 /* I2C */
48 GPIO147_I2C0_SCL,
49 GPIO148_I2C0_SDA,
50 GPIO16_I2C1_SCL,
51 GPIO17_I2C1_SDA,
52 GPIO10_I2C2_SDA,
53 GPIO11_I2C2_SCL,
54 GPIO229_I2C3_SDA,
55 GPIO230_I2C3_SCL,
56
57 /* SKE keypad */
58 GPIO153_KP_I7,
59 GPIO154_KP_I6,
60 GPIO155_KP_I5,
61 GPIO156_KP_I4,
62 GPIO157_KP_O7,
63 GPIO158_KP_O6,
64 GPIO159_KP_O5,
65 GPIO160_KP_O4,
66 GPIO161_KP_I3,
67 GPIO162_KP_I2,
68 GPIO163_KP_I1,
69 GPIO164_KP_I0,
70 GPIO165_KP_O3,
71 GPIO166_KP_O2,
72 GPIO167_KP_O1,
73 GPIO168_KP_O0,
74
75 /* GPIO_EXP_INT */
76 GPIO217_GPIO,
77
78 /* STMPE1601 IRQ */
79 GPIO218_GPIO | PIN_INPUT_PULLUP,
80};
81
82static struct ab8500_platform_data ab8500_platdata = { 44static struct ab8500_platform_data ab8500_platdata = {
83 .irq_base = MOP500_AB8500_IRQ_BASE, 45 .irq_base = MOP500_AB8500_IRQ_BASE,
84 .regulator = ab8500_regulators, 46 .regulator = ab8500_regulators,
@@ -103,16 +65,6 @@ struct platform_device ab8500_device = {
103 .resource = ab8500_resources, 65 .resource = ab8500_resources,
104}; 66};
105 67
106static struct pl022_ssp_controller ssp0_platform_data = {
107 .bus_id = 0,
108 /* pl022 not yet supports dma */
109 .enable_dma = 0,
110 /* on this platform, gpio 31,142,144,214 &
111 * 224 are connected as chip selects
112 */
113 .num_chipselect = 5,
114};
115
116/* 68/*
117 * TC35892 69 * TC35892
118 */ 70 */
@@ -133,14 +85,81 @@ static struct tc3589x_platform_data mop500_tc35892_data = {
133 .irq_base = MOP500_EGPIO_IRQ_BASE, 85 .irq_base = MOP500_EGPIO_IRQ_BASE,
134}; 86};
135 87
88static struct lp5521_led_config lp5521_pri_led[] = {
89 [0] = {
90 .chan_nr = 0,
91 .led_current = 0x2f,
92 .max_current = 0x5f,
93 },
94 [1] = {
95 .chan_nr = 1,
96 .led_current = 0x2f,
97 .max_current = 0x5f,
98 },
99 [2] = {
100 .chan_nr = 2,
101 .led_current = 0x2f,
102 .max_current = 0x5f,
103 },
104};
105
106static struct lp5521_platform_data __initdata lp5521_pri_data = {
107 .label = "lp5521_pri",
108 .led_config = &lp5521_pri_led[0],
109 .num_channels = 3,
110 .clock_mode = LP5521_CLOCK_EXT,
111};
112
113static struct lp5521_led_config lp5521_sec_led[] = {
114 [0] = {
115 .chan_nr = 0,
116 .led_current = 0x2f,
117 .max_current = 0x5f,
118 },
119 [1] = {
120 .chan_nr = 1,
121 .led_current = 0x2f,
122 .max_current = 0x5f,
123 },
124 [2] = {
125 .chan_nr = 2,
126 .led_current = 0x2f,
127 .max_current = 0x5f,
128 },
129};
130
131static struct lp5521_platform_data __initdata lp5521_sec_data = {
132 .label = "lp5521_sec",
133 .led_config = &lp5521_sec_led[0],
134 .num_channels = 3,
135 .clock_mode = LP5521_CLOCK_EXT,
136};
137
136static struct i2c_board_info mop500_i2c0_devices[] = { 138static struct i2c_board_info mop500_i2c0_devices[] = {
137 { 139 {
138 I2C_BOARD_INFO("tc3589x", 0x42), 140 I2C_BOARD_INFO("tc3589x", 0x42),
139 .irq = NOMADIK_GPIO_TO_IRQ(217), 141 .irq = NOMADIK_GPIO_TO_IRQ(217),
140 .platform_data = &mop500_tc35892_data, 142 .platform_data = &mop500_tc35892_data,
141 }, 143 },
142}; 144};
143 145
146static struct i2c_board_info __initdata mop500_i2c2_devices[] = {
147 {
148 /* lp5521 LED driver, 1st device */
149 I2C_BOARD_INFO("lp5521", 0x33),
150 .platform_data = &lp5521_pri_data,
151 },
152 {
153 /* lp5521 LED driver, 2st device */
154 I2C_BOARD_INFO("lp5521", 0x34),
155 .platform_data = &lp5521_sec_data,
156 },
157 {
158 /* Light sensor Rohm BH1780GLI */
159 I2C_BOARD_INFO("bh1780", 0x29),
160 },
161};
162
144#define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \ 163#define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, _sm) \
145static struct nmk_i2c_controller u8500_i2c##id##_data = { \ 164static struct nmk_i2c_controller u8500_i2c##id##_data = { \
146 /* \ 165 /* \
@@ -178,8 +197,93 @@ static void __init mop500_i2c_init(void)
178 db8500_add_i2c3(&u8500_i2c3_data); 197 db8500_add_i2c3(&u8500_i2c3_data);
179} 198}
180 199
200static struct gpio_keys_button mop500_gpio_keys[] = {
201 {
202 .desc = "SFH7741 Proximity Sensor",
203 .type = EV_SW,
204 .code = SW_FRONT_PROXIMITY,
205 .active_low = 0,
206 .can_disable = 1,
207 }
208};
209
210static struct regulator *prox_regulator;
211static int mop500_prox_activate(struct device *dev);
212static void mop500_prox_deactivate(struct device *dev);
213
214static struct gpio_keys_platform_data mop500_gpio_keys_data = {
215 .buttons = mop500_gpio_keys,
216 .nbuttons = ARRAY_SIZE(mop500_gpio_keys),
217 .enable = mop500_prox_activate,
218 .disable = mop500_prox_deactivate,
219};
220
221static struct platform_device mop500_gpio_keys_device = {
222 .name = "gpio-keys",
223 .id = 0,
224 .dev = {
225 .platform_data = &mop500_gpio_keys_data,
226 },
227};
228
229static int mop500_prox_activate(struct device *dev)
230{
231 prox_regulator = regulator_get(&mop500_gpio_keys_device.dev,
232 "vcc");
233 if (IS_ERR(prox_regulator)) {
234 dev_err(&mop500_gpio_keys_device.dev,
235 "no regulator\n");
236 return PTR_ERR(prox_regulator);
237 }
238 regulator_enable(prox_regulator);
239 return 0;
240}
241
242static void mop500_prox_deactivate(struct device *dev)
243{
244 regulator_disable(prox_regulator);
245 regulator_put(prox_regulator);
246}
247
181/* add any platform devices here - TODO */ 248/* add any platform devices here - TODO */
182static struct platform_device *platform_devs[] __initdata = { 249static struct platform_device *platform_devs[] __initdata = {
250 &mop500_gpio_keys_device,
251};
252
253#ifdef CONFIG_STE_DMA40
254static struct stedma40_chan_cfg ssp0_dma_cfg_rx = {
255 .mode = STEDMA40_MODE_LOGICAL,
256 .dir = STEDMA40_PERIPH_TO_MEM,
257 .src_dev_type = DB8500_DMA_DEV8_SSP0_RX,
258 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
259 .src_info.data_width = STEDMA40_BYTE_WIDTH,
260 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
261};
262
263static struct stedma40_chan_cfg ssp0_dma_cfg_tx = {
264 .mode = STEDMA40_MODE_LOGICAL,
265 .dir = STEDMA40_MEM_TO_PERIPH,
266 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
267 .dst_dev_type = DB8500_DMA_DEV8_SSP0_TX,
268 .src_info.data_width = STEDMA40_BYTE_WIDTH,
269 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
270};
271#endif
272
273static struct pl022_ssp_controller ssp0_platform_data = {
274 .bus_id = 0,
275#ifdef CONFIG_STE_DMA40
276 .enable_dma = 1,
277 .dma_filter = stedma40_filter,
278 .dma_rx_param = &ssp0_dma_cfg_rx,
279 .dma_tx_param = &ssp0_dma_cfg_tx,
280#else
281 .enable_dma = 0,
282#endif
283 /* on this platform, gpio 31,142,144,214 &
284 * 224 are connected as chip selects
285 */
286 .num_chipselect = 5,
183}; 287};
184 288
185static void __init mop500_spi_init(void) 289static void __init mop500_spi_init(void)
@@ -187,18 +291,108 @@ static void __init mop500_spi_init(void)
187 db8500_add_ssp0(&ssp0_platform_data); 291 db8500_add_ssp0(&ssp0_platform_data);
188} 292}
189 293
294#ifdef CONFIG_STE_DMA40
295static struct stedma40_chan_cfg uart0_dma_cfg_rx = {
296 .mode = STEDMA40_MODE_LOGICAL,
297 .dir = STEDMA40_PERIPH_TO_MEM,
298 .src_dev_type = DB8500_DMA_DEV13_UART0_RX,
299 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
300 .src_info.data_width = STEDMA40_BYTE_WIDTH,
301 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
302};
303
304static struct stedma40_chan_cfg uart0_dma_cfg_tx = {
305 .mode = STEDMA40_MODE_LOGICAL,
306 .dir = STEDMA40_MEM_TO_PERIPH,
307 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
308 .dst_dev_type = DB8500_DMA_DEV13_UART0_TX,
309 .src_info.data_width = STEDMA40_BYTE_WIDTH,
310 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
311};
312
313static struct stedma40_chan_cfg uart1_dma_cfg_rx = {
314 .mode = STEDMA40_MODE_LOGICAL,
315 .dir = STEDMA40_PERIPH_TO_MEM,
316 .src_dev_type = DB8500_DMA_DEV12_UART1_RX,
317 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
318 .src_info.data_width = STEDMA40_BYTE_WIDTH,
319 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
320};
321
322static struct stedma40_chan_cfg uart1_dma_cfg_tx = {
323 .mode = STEDMA40_MODE_LOGICAL,
324 .dir = STEDMA40_MEM_TO_PERIPH,
325 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
326 .dst_dev_type = DB8500_DMA_DEV12_UART1_TX,
327 .src_info.data_width = STEDMA40_BYTE_WIDTH,
328 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
329};
330
331static struct stedma40_chan_cfg uart2_dma_cfg_rx = {
332 .mode = STEDMA40_MODE_LOGICAL,
333 .dir = STEDMA40_PERIPH_TO_MEM,
334 .src_dev_type = DB8500_DMA_DEV11_UART2_RX,
335 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
336 .src_info.data_width = STEDMA40_BYTE_WIDTH,
337 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
338};
339
340static struct stedma40_chan_cfg uart2_dma_cfg_tx = {
341 .mode = STEDMA40_MODE_LOGICAL,
342 .dir = STEDMA40_MEM_TO_PERIPH,
343 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
344 .dst_dev_type = DB8500_DMA_DEV11_UART2_TX,
345 .src_info.data_width = STEDMA40_BYTE_WIDTH,
346 .dst_info.data_width = STEDMA40_BYTE_WIDTH,
347};
348#endif
349
350static struct amba_pl011_data uart0_plat = {
351#ifdef CONFIG_STE_DMA40
352 .dma_filter = stedma40_filter,
353 .dma_rx_param = &uart0_dma_cfg_rx,
354 .dma_tx_param = &uart0_dma_cfg_tx,
355#endif
356};
357
358static struct amba_pl011_data uart1_plat = {
359#ifdef CONFIG_STE_DMA40
360 .dma_filter = stedma40_filter,
361 .dma_rx_param = &uart1_dma_cfg_rx,
362 .dma_tx_param = &uart1_dma_cfg_tx,
363#endif
364};
365
366static struct amba_pl011_data uart2_plat = {
367#ifdef CONFIG_STE_DMA40
368 .dma_filter = stedma40_filter,
369 .dma_rx_param = &uart2_dma_cfg_rx,
370 .dma_tx_param = &uart2_dma_cfg_tx,
371#endif
372};
373
190static void __init mop500_uart_init(void) 374static void __init mop500_uart_init(void)
191{ 375{
192 db8500_add_uart0(); 376 db8500_add_uart0(&uart0_plat);
193 db8500_add_uart1(); 377 db8500_add_uart1(&uart1_plat);
194 db8500_add_uart2(); 378 db8500_add_uart2(&uart2_plat);
195} 379}
196 380
197static void __init u8500_init_machine(void) 381static void __init mop500_init_machine(void)
198{ 382{
383 /*
384 * The HREFv60 board removed a GPIO expander and routed
385 * all these GPIO pins to the internal GPIO controller
386 * instead.
387 */
388 if (machine_is_hrefv60())
389 mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
390 else
391 mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
392
199 u8500_init_devices(); 393 u8500_init_devices();
200 394
201 nmk_config_pins(mop500_pins, ARRAY_SIZE(mop500_pins)); 395 mop500_pins_init();
202 396
203 platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); 397 platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs));
204 398
@@ -207,12 +401,12 @@ static void __init u8500_init_machine(void)
207 mop500_spi_init(); 401 mop500_spi_init();
208 mop500_uart_init(); 402 mop500_uart_init();
209 403
210 mop500_keypad_init();
211
212 platform_device_register(&ab8500_device); 404 platform_device_register(&ab8500_device);
213 405
214 i2c_register_board_info(0, mop500_i2c0_devices, 406 i2c_register_board_info(0, mop500_i2c0_devices,
215 ARRAY_SIZE(mop500_i2c0_devices)); 407 ARRAY_SIZE(mop500_i2c0_devices));
408 i2c_register_board_info(2, mop500_i2c2_devices,
409 ARRAY_SIZE(mop500_i2c2_devices));
216} 410}
217 411
218MACHINE_START(U8500, "ST-Ericsson MOP500 platform") 412MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
@@ -222,5 +416,13 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
222 .init_irq = ux500_init_irq, 416 .init_irq = ux500_init_irq,
223 /* we re-use nomadik timer here */ 417 /* we re-use nomadik timer here */
224 .timer = &ux500_timer, 418 .timer = &ux500_timer,
225 .init_machine = u8500_init_machine, 419 .init_machine = mop500_init_machine,
420MACHINE_END
421
422MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
423 .boot_params = 0x100,
424 .map_io = u8500_map_io,
425 .init_irq = ux500_init_irq,
426 .timer = &ux500_timer,
427 .init_machine = mop500_init_machine,
226MACHINE_END 428MACHINE_END
diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h
index 3104ae2a02c2..56722f4be71b 100644
--- a/arch/arm/mach-ux500/board-mop500.h
+++ b/arch/arm/mach-ux500/board-mop500.h
@@ -7,15 +7,36 @@
7#ifndef __BOARD_MOP500_H 7#ifndef __BOARD_MOP500_H
8#define __BOARD_MOP500_H 8#define __BOARD_MOP500_H
9 9
10#define MOP500_EGPIO(x) (NOMADIK_NR_GPIO + (x)) 10/* HREFv60-specific GPIO assignments, this board has no GPIO expander */
11#define HREFV60_TOUCH_RST_GPIO 143
12#define HREFV60_PROX_SENSE_GPIO 217
13#define HREFV60_HAL_SW_GPIO 145
14#define HREFV60_SDMMC_EN_GPIO 169
15#define HREFV60_SDMMC_1V8_3V_GPIO 5
16#define HREFV60_SDMMC_CD_GPIO 95
17#define HREFV60_ACCEL_INT1_GPIO 82
18#define HREFV60_ACCEL_INT2_GPIO 83
19#define HREFV60_MAGNET_DRDY_GPIO 32
20#define HREFV60_DISP1_RST_GPIO 65
21#define HREFV60_DISP2_RST_GPIO 66
11 22
12/* GPIOs on the TC35892 expander */ 23/* GPIOs on the TC35892 expander */
24#define MOP500_EGPIO(x) (NOMADIK_NR_GPIO + (x))
13#define GPIO_SDMMC_CD MOP500_EGPIO(3) 25#define GPIO_SDMMC_CD MOP500_EGPIO(3)
26#define GPIO_PROX_SENSOR MOP500_EGPIO(7)
27#define GPIO_BU21013_CS MOP500_EGPIO(13)
14#define GPIO_SDMMC_EN MOP500_EGPIO(17) 28#define GPIO_SDMMC_EN MOP500_EGPIO(17)
15#define GPIO_SDMMC_1V8_3V_SEL MOP500_EGPIO(18) 29#define GPIO_SDMMC_1V8_3V_SEL MOP500_EGPIO(18)
16 30
31struct i2c_board_info;
32
17extern void mop500_sdi_init(void); 33extern void mop500_sdi_init(void);
18extern void mop500_sdi_tc35892_init(void); 34extern void mop500_sdi_tc35892_init(void);
19extern void mop500_keypad_init(void); 35void __init mop500_u8500uib_init(void);
36void __init mop500_stuib_init(void);
37void __init mop500_pins_init(void);
38
39void mop500_uib_i2c_add(int busnum, struct i2c_board_info *info,
40 unsigned n);
20 41
21#endif 42#endif
diff --git a/arch/arm/mach-ux500/board-u5500-sdi.c b/arch/arm/mach-ux500/board-u5500-sdi.c
index 54712acc0394..739fb4c5b160 100644
--- a/arch/arm/mach-ux500/board-u5500-sdi.c
+++ b/arch/arm/mach-ux500/board-u5500-sdi.c
@@ -31,6 +31,26 @@ static pin_cfg_t u5500_sdi_pins[] = {
31 GPIO14_MC0_CLK | PIN_DIR_OUTPUT | PIN_VAL_LOW, 31 GPIO14_MC0_CLK | PIN_DIR_OUTPUT | PIN_VAL_LOW,
32}; 32};
33 33
34#ifdef CONFIG_STE_DMA40
35struct stedma40_chan_cfg u5500_sdi0_dma_cfg_rx = {
36 .mode = STEDMA40_MODE_LOGICAL,
37 .dir = STEDMA40_PERIPH_TO_MEM,
38 .src_dev_type = DB5500_DMA_DEV24_SDMMC0_RX,
39 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
40 .src_info.data_width = STEDMA40_WORD_WIDTH,
41 .dst_info.data_width = STEDMA40_WORD_WIDTH,
42};
43
44static struct stedma40_chan_cfg u5500_sdi0_dma_cfg_tx = {
45 .mode = STEDMA40_MODE_LOGICAL,
46 .dir = STEDMA40_MEM_TO_PERIPH,
47 .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
48 .dst_dev_type = DB5500_DMA_DEV24_SDMMC0_TX,
49 .src_info.data_width = STEDMA40_WORD_WIDTH,
50 .dst_info.data_width = STEDMA40_WORD_WIDTH,
51};
52#endif
53
34static struct mmci_platform_data u5500_sdi0_data = { 54static struct mmci_platform_data u5500_sdi0_data = {
35 .ocr_mask = MMC_VDD_165_195, 55 .ocr_mask = MMC_VDD_165_195,
36 .f_max = 50000000, 56 .f_max = 50000000,
@@ -39,6 +59,11 @@ static struct mmci_platform_data u5500_sdi0_data = {
39 MMC_CAP_MMC_HIGHSPEED, 59 MMC_CAP_MMC_HIGHSPEED,
40 .gpio_cd = -1, 60 .gpio_cd = -1,
41 .gpio_wp = -1, 61 .gpio_wp = -1,
62#ifdef CONFIG_STE_DMA40
63 .dma_filter = stedma40_filter,
64 .dma_rx_param = &u5500_sdi0_dma_cfg_rx,
65 .dma_tx_param = &u5500_sdi0_dma_cfg_tx,
66#endif
42}; 67};
43 68
44void __init u5500_sdi_init(void) 69void __init u5500_sdi_init(void)
diff --git a/arch/arm/mach-ux500/board-u5500.c b/arch/arm/mach-ux500/board-u5500.c
index 39d370c1f3b4..44fd3b5c33ec 100644
--- a/arch/arm/mach-ux500/board-u5500.c
+++ b/arch/arm/mach-ux500/board-u5500.c
@@ -22,9 +22,9 @@
22 22
23static void __init u5500_uart_init(void) 23static void __init u5500_uart_init(void)
24{ 24{
25 db5500_add_uart0(); 25 db5500_add_uart0(NULL);
26 db5500_add_uart1(); 26 db5500_add_uart1(NULL);
27 db5500_add_uart2(); 27 db5500_add_uart2(NULL);
28} 28}
29 29
30static void __init u5500_init_machine(void) 30static void __init u5500_init_machine(void)
diff --git a/arch/arm/mach-ux500/clock.c b/arch/arm/mach-ux500/clock.c
index b2b0a3b9be8f..32ce90840ee1 100644
--- a/arch/arm/mach-ux500/clock.c
+++ b/arch/arm/mach-ux500/clock.c
@@ -313,7 +313,7 @@ static DEFINE_PRCMU_CLK_RATE(uartclk, 0x0, 5, UARTCLK, 38400000);
313static DEFINE_PRCMU_CLK(msp02clk, 0x0, 6, MSP02CLK); 313static DEFINE_PRCMU_CLK(msp02clk, 0x0, 6, MSP02CLK);
314static DEFINE_PRCMU_CLK(msp1clk, 0x0, 7, MSP1CLK); /* v1 */ 314static DEFINE_PRCMU_CLK(msp1clk, 0x0, 7, MSP1CLK); /* v1 */
315static DEFINE_PRCMU_CLK_RATE(i2cclk, 0x0, 8, I2CCLK, 48000000); 315static DEFINE_PRCMU_CLK_RATE(i2cclk, 0x0, 8, I2CCLK, 48000000);
316static DEFINE_PRCMU_CLK_RATE(sdmmcclk, 0x0, 9, SDMMCCLK, 50000000); 316static DEFINE_PRCMU_CLK_RATE(sdmmcclk, 0x0, 9, SDMMCCLK, 100000000);
317static DEFINE_PRCMU_CLK(slimclk, 0x0, 10, SLIMCLK); 317static DEFINE_PRCMU_CLK(slimclk, 0x0, 10, SLIMCLK);
318static DEFINE_PRCMU_CLK(per1clk, 0x0, 11, PER1CLK); 318static DEFINE_PRCMU_CLK(per1clk, 0x0, 11, PER1CLK);
319static DEFINE_PRCMU_CLK(per2clk, 0x0, 12, PER2CLK); 319static DEFINE_PRCMU_CLK(per2clk, 0x0, 12, PER2CLK);
@@ -520,7 +520,7 @@ static struct clk_lookup u8500_ed_clks[] = {
520 CLK(ssp0_ed, "ssp0", NULL), 520 CLK(ssp0_ed, "ssp0", NULL),
521 521
522 /* Peripheral Cluster #5 */ 522 /* Peripheral Cluster #5 */
523 CLK(usb_ed, "musb_hdrc.0", "usb"), 523 CLK(usb_ed, "musb-ux500.0", "usb"),
524 524
525 /* Peripheral Cluster #6 */ 525 /* Peripheral Cluster #6 */
526 CLK(dmc_ed, "dmc", NULL), 526 CLK(dmc_ed, "dmc", NULL),
@@ -561,7 +561,7 @@ static struct clk_lookup u8500_v1_clks[] = {
561 CLK(ssp0_v1, "ssp0", NULL), 561 CLK(ssp0_v1, "ssp0", NULL),
562 562
563 /* Peripheral Cluster #5 */ 563 /* Peripheral Cluster #5 */
564 CLK(usb_v1, "musb_hdrc.0", "usb"), 564 CLK(usb_v1, "musb-ux500.0", "usb"),
565 565
566 /* Peripheral Cluster #6 */ 566 /* Peripheral Cluster #6 */
567 CLK(mtu1_v1, "mtu1", NULL), 567 CLK(mtu1_v1, "mtu1", NULL),
diff --git a/arch/arm/mach-ux500/cpu-db5500.c b/arch/arm/mach-ux500/cpu-db5500.c
index af04e0891a78..c9dc2eff3cb2 100644
--- a/arch/arm/mach-ux500/cpu-db5500.c
+++ b/arch/arm/mach-ux500/cpu-db5500.c
@@ -11,6 +11,7 @@
11#include <linux/irq.h> 11#include <linux/irq.h>
12 12
13#include <asm/mach/map.h> 13#include <asm/mach/map.h>
14#include <asm/pmu.h>
14 15
15#include <plat/gpio.h> 16#include <plat/gpio.h>
16 17
@@ -18,8 +19,10 @@
18#include <mach/devices.h> 19#include <mach/devices.h>
19#include <mach/setup.h> 20#include <mach/setup.h>
20#include <mach/irqs.h> 21#include <mach/irqs.h>
22#include <mach/usb.h>
21 23
22#include "devices-db5500.h" 24#include "devices-db5500.h"
25#include "ste-dma40-db5500.h"
23 26
24static struct map_desc u5500_uart_io_desc[] __initdata = { 27static struct map_desc u5500_uart_io_desc[] __initdata = {
25 __IO_DEV_DESC(U5500_UART0_BASE, SZ_4K), 28 __IO_DEV_DESC(U5500_UART0_BASE, SZ_4K),
@@ -43,6 +46,26 @@ static struct map_desc u5500_io_desc[] __initdata = {
43 __IO_DEV_DESC(U5500_PRCMU_BASE, SZ_4K), 46 __IO_DEV_DESC(U5500_PRCMU_BASE, SZ_4K),
44}; 47};
45 48
49static struct resource db5500_pmu_resources[] = {
50 [0] = {
51 .start = IRQ_DB5500_PMU0,
52 .end = IRQ_DB5500_PMU0,
53 .flags = IORESOURCE_IRQ,
54 },
55 [1] = {
56 .start = IRQ_DB5500_PMU1,
57 .end = IRQ_DB5500_PMU1,
58 .flags = IORESOURCE_IRQ,
59 },
60};
61
62static struct platform_device db5500_pmu_device = {
63 .name = "arm-pmu",
64 .id = ARM_PMU_DEVICE_CPU,
65 .num_resources = ARRAY_SIZE(db5500_pmu_resources),
66 .resource = db5500_pmu_resources,
67};
68
46static struct resource mbox0_resources[] = { 69static struct resource mbox0_resources[] = {
47 { 70 {
48 .name = "mbox_peer", 71 .name = "mbox_peer",
@@ -127,7 +150,8 @@ static struct platform_device mbox2_device = {
127 .num_resources = ARRAY_SIZE(mbox2_resources), 150 .num_resources = ARRAY_SIZE(mbox2_resources),
128}; 151};
129 152
130static struct platform_device *u5500_platform_devs[] __initdata = { 153static struct platform_device *db5500_platform_devs[] __initdata = {
154 &db5500_pmu_device,
131 &mbox0_device, 155 &mbox0_device,
132 &mbox1_device, 156 &mbox1_device,
133 &mbox2_device, 157 &mbox2_device,
@@ -166,12 +190,35 @@ void __init u5500_map_io(void)
166 iotable_init(u5500_io_desc, ARRAY_SIZE(u5500_io_desc)); 190 iotable_init(u5500_io_desc, ARRAY_SIZE(u5500_io_desc));
167} 191}
168 192
193static int usb_db5500_rx_dma_cfg[] = {
194 DB5500_DMA_DEV4_USB_OTG_IEP_1_9,
195 DB5500_DMA_DEV5_USB_OTG_IEP_2_10,
196 DB5500_DMA_DEV6_USB_OTG_IEP_3_11,
197 DB5500_DMA_DEV20_USB_OTG_IEP_4_12,
198 DB5500_DMA_DEV21_USB_OTG_IEP_5_13,
199 DB5500_DMA_DEV22_USB_OTG_IEP_6_14,
200 DB5500_DMA_DEV23_USB_OTG_IEP_7_15,
201 DB5500_DMA_DEV38_USB_OTG_IEP_8
202};
203
204static int usb_db5500_tx_dma_cfg[] = {
205 DB5500_DMA_DEV4_USB_OTG_OEP_1_9,
206 DB5500_DMA_DEV5_USB_OTG_OEP_2_10,
207 DB5500_DMA_DEV6_USB_OTG_OEP_3_11,
208 DB5500_DMA_DEV20_USB_OTG_OEP_4_12,
209 DB5500_DMA_DEV21_USB_OTG_OEP_5_13,
210 DB5500_DMA_DEV22_USB_OTG_OEP_6_14,
211 DB5500_DMA_DEV23_USB_OTG_OEP_7_15,
212 DB5500_DMA_DEV38_USB_OTG_OEP_8
213};
214
169void __init u5500_init_devices(void) 215void __init u5500_init_devices(void)
170{ 216{
171 db5500_add_gpios(); 217 db5500_add_gpios();
172 db5500_dma_init(); 218 db5500_dma_init();
173 db5500_add_rtc(); 219 db5500_add_rtc();
220 db5500_add_usb(usb_db5500_rx_dma_cfg, usb_db5500_tx_dma_cfg);
174 221
175 platform_add_devices(u5500_platform_devs, 222 platform_add_devices(db5500_platform_devs,
176 ARRAY_SIZE(u5500_platform_devs)); 223 ARRAY_SIZE(db5500_platform_devs));
177} 224}
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index 1748fbc58530..516126cb357d 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -12,21 +12,21 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/device.h> 13#include <linux/device.h>
14#include <linux/amba/bus.h> 14#include <linux/amba/bus.h>
15#include <linux/interrupt.h>
15#include <linux/irq.h> 16#include <linux/irq.h>
16#include <linux/gpio.h> 17#include <linux/gpio.h>
17#include <linux/platform_device.h> 18#include <linux/platform_device.h>
18#include <linux/io.h> 19#include <linux/io.h>
19 20
20#include <asm/mach/map.h> 21#include <asm/mach/map.h>
22#include <asm/pmu.h>
21#include <mach/hardware.h> 23#include <mach/hardware.h>
22#include <mach/setup.h> 24#include <mach/setup.h>
23#include <mach/devices.h> 25#include <mach/devices.h>
26#include <mach/usb.h>
24 27
25#include "devices-db8500.h" 28#include "devices-db8500.h"
26 29#include "ste-dma40-db8500.h"
27static struct platform_device *platform_devs[] __initdata = {
28 &u8500_dma40_device,
29};
30 30
31/* minimum static i/o mapping required to boot U8500 platforms */ 31/* minimum static i/o mapping required to boot U8500 platforms */
32static struct map_desc u8500_uart_io_desc[] __initdata = { 32static struct map_desc u8500_uart_io_desc[] __initdata = {
@@ -89,6 +89,51 @@ void __init u8500_map_io(void)
89 iotable_init(u8500_v2_io_desc, ARRAY_SIZE(u8500_v2_io_desc)); 89 iotable_init(u8500_v2_io_desc, ARRAY_SIZE(u8500_v2_io_desc));
90} 90}
91 91
92static struct resource db8500_pmu_resources[] = {
93 [0] = {
94 .start = IRQ_DB8500_PMU,
95 .end = IRQ_DB8500_PMU,
96 .flags = IORESOURCE_IRQ,
97 },
98};
99
100/*
101 * The PMU IRQ lines of two cores are wired together into a single interrupt.
102 * Bounce the interrupt to the other core if it's not ours.
103 */
104static irqreturn_t db8500_pmu_handler(int irq, void *dev, irq_handler_t handler)
105{
106 irqreturn_t ret = handler(irq, dev);
107 int other = !smp_processor_id();
108
109 if (ret == IRQ_NONE && cpu_online(other))
110 irq_set_affinity(irq, cpumask_of(other));
111
112 /*
113 * We should be able to get away with the amount of IRQ_NONEs we give,
114 * while still having the spurious IRQ detection code kick in if the
115 * interrupt really starts hitting spuriously.
116 */
117 return ret;
118}
119
120static struct arm_pmu_platdata db8500_pmu_platdata = {
121 .handle_irq = db8500_pmu_handler,
122};
123
124static struct platform_device db8500_pmu_device = {
125 .name = "arm-pmu",
126 .id = ARM_PMU_DEVICE_CPU,
127 .num_resources = ARRAY_SIZE(db8500_pmu_resources),
128 .resource = db8500_pmu_resources,
129 .dev.platform_data = &db8500_pmu_platdata,
130};
131
132static struct platform_device *platform_devs[] __initdata = {
133 &u8500_dma40_device,
134 &db8500_pmu_device,
135};
136
92static resource_size_t __initdata db8500_gpio_base[] = { 137static resource_size_t __initdata db8500_gpio_base[] = {
93 U8500_GPIOBANK0_BASE, 138 U8500_GPIOBANK0_BASE,
94 U8500_GPIOBANK1_BASE, 139 U8500_GPIOBANK1_BASE,
@@ -111,6 +156,28 @@ static void __init db8500_add_gpios(void)
111 IRQ_DB8500_GPIO0, &pdata); 156 IRQ_DB8500_GPIO0, &pdata);
112} 157}
113 158
159static int usb_db8500_rx_dma_cfg[] = {
160 DB8500_DMA_DEV38_USB_OTG_IEP_1_9,
161 DB8500_DMA_DEV37_USB_OTG_IEP_2_10,
162 DB8500_DMA_DEV36_USB_OTG_IEP_3_11,
163 DB8500_DMA_DEV19_USB_OTG_IEP_4_12,
164 DB8500_DMA_DEV18_USB_OTG_IEP_5_13,
165 DB8500_DMA_DEV17_USB_OTG_IEP_6_14,
166 DB8500_DMA_DEV16_USB_OTG_IEP_7_15,
167 DB8500_DMA_DEV39_USB_OTG_IEP_8
168};
169
170static int usb_db8500_tx_dma_cfg[] = {
171 DB8500_DMA_DEV38_USB_OTG_OEP_1_9,
172 DB8500_DMA_DEV37_USB_OTG_OEP_2_10,
173 DB8500_DMA_DEV36_USB_OTG_OEP_3_11,
174 DB8500_DMA_DEV19_USB_OTG_OEP_4_12,
175 DB8500_DMA_DEV18_USB_OTG_OEP_5_13,
176 DB8500_DMA_DEV17_USB_OTG_OEP_6_14,
177 DB8500_DMA_DEV16_USB_OTG_OEP_7_15,
178 DB8500_DMA_DEV39_USB_OTG_OEP_8
179};
180
114/* 181/*
115 * This function is called from the board init 182 * This function is called from the board init
116 */ 183 */
@@ -121,6 +188,7 @@ void __init u8500_init_devices(void)
121 188
122 db8500_add_rtc(); 189 db8500_add_rtc();
123 db8500_add_gpios(); 190 db8500_add_gpios();
191 db8500_add_usb(usb_db8500_rx_dma_cfg, usb_db8500_tx_dma_cfg);
124 192
125 platform_device_register_simple("cpufreq-u8500", -1, NULL, 0); 193 platform_device_register_simple("cpufreq-u8500", -1, NULL, 0);
126 platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs)); 194 platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs));
diff --git a/arch/arm/mach-ux500/devices-common.c b/arch/arm/mach-ux500/devices-common.c
index fe69f5fac1bb..13a4ce046ae5 100644
--- a/arch/arm/mach-ux500/devices-common.c
+++ b/arch/arm/mach-ux500/devices-common.c
@@ -139,6 +139,7 @@ void dbx500_add_gpios(resource_size_t *base, int num, int irq,
139 for (i = 0; i < num; i++, first += 32, irq++) { 139 for (i = 0; i < num; i++, first += 32, irq++) {
140 pdata->first_gpio = first; 140 pdata->first_gpio = first;
141 pdata->first_irq = NOMADIK_GPIO_TO_IRQ(first); 141 pdata->first_irq = NOMADIK_GPIO_TO_IRQ(first);
142 pdata->num_gpio = 32;
142 143
143 dbx500_add_gpio(i, base[i], irq, pdata); 144 dbx500_add_gpio(i, base[i], irq, pdata);
144 } 145 }
diff --git a/arch/arm/mach-ux500/devices-common.h b/arch/arm/mach-ux500/devices-common.h
index cbadc117d2db..c719b5a1d913 100644
--- a/arch/arm/mach-ux500/devices-common.h
+++ b/arch/arm/mach-ux500/devices-common.h
@@ -42,10 +42,13 @@ dbx500_add_sdi(const char *name, resource_size_t base, int irq,
42 return dbx500_add_amba_device(name, base, irq, pdata, 0); 42 return dbx500_add_amba_device(name, base, irq, pdata, 0);
43} 43}
44 44
45struct amba_pl011_data;
46
45static inline struct amba_device * 47static inline struct amba_device *
46dbx500_add_uart(const char *name, resource_size_t base, int irq) 48dbx500_add_uart(const char *name, resource_size_t base, int irq,
49 struct amba_pl011_data *pdata)
47{ 50{
48 return dbx500_add_amba_device(name, base, irq, NULL, 0); 51 return dbx500_add_amba_device(name, base, irq, pdata, 0);
49} 52}
50 53
51struct nmk_i2c_controller; 54struct nmk_i2c_controller;
diff --git a/arch/arm/mach-ux500/devices-db5500.h b/arch/arm/mach-ux500/devices-db5500.h
index c8d7901c1f2d..94627f7783b0 100644
--- a/arch/arm/mach-ux500/devices-db5500.h
+++ b/arch/arm/mach-ux500/devices-db5500.h
@@ -34,6 +34,9 @@
34#define db5500_add_rtc() \ 34#define db5500_add_rtc() \
35 dbx500_add_rtc(U5500_RTC_BASE, IRQ_DB5500_RTC); 35 dbx500_add_rtc(U5500_RTC_BASE, IRQ_DB5500_RTC);
36 36
37#define db5500_add_usb(rx_cfg, tx_cfg) \
38 ux500_add_usb(U5500_USBOTG_BASE, IRQ_DB5500_USBOTG, rx_cfg, tx_cfg)
39
37#define db5500_add_sdi0(pdata) \ 40#define db5500_add_sdi0(pdata) \
38 dbx500_add_sdi("sdi0", U5500_SDI0_BASE, IRQ_DB5500_SDMMC0, pdata) 41 dbx500_add_sdi("sdi0", U5500_SDI0_BASE, IRQ_DB5500_SDMMC0, pdata)
39#define db5500_add_sdi1(pdata) \ 42#define db5500_add_sdi1(pdata) \
@@ -54,13 +57,13 @@
54#define db5500_add_spi3(pdata) \ 57#define db5500_add_spi3(pdata) \
55 dbx500_add_spi("spi3", U5500_SPI3_BASE, IRQ_DB5500_SPI3, pdata) 58 dbx500_add_spi("spi3", U5500_SPI3_BASE, IRQ_DB5500_SPI3, pdata)
56 59
57#define db5500_add_uart0() \ 60#define db5500_add_uart0(plat) \
58 dbx500_add_uart("uart0", U5500_UART0_BASE, IRQ_DB5500_UART0) 61 dbx500_add_uart("uart0", U5500_UART0_BASE, IRQ_DB5500_UART0, plat)
59#define db5500_add_uart1() \ 62#define db5500_add_uart1(plat) \
60 dbx500_add_uart("uart1", U5500_UART1_BASE, IRQ_DB5500_UART1) 63 dbx500_add_uart("uart1", U5500_UART1_BASE, IRQ_DB5500_UART1, plat)
61#define db5500_add_uart2() \ 64#define db5500_add_uart2(plat) \
62 dbx500_add_uart("uart2", U5500_UART2_BASE, IRQ_DB5500_UART2) 65 dbx500_add_uart("uart2", U5500_UART2_BASE, IRQ_DB5500_UART2, plat)
63#define db5500_add_uart3() \ 66#define db5500_add_uart3(plat) \
64 dbx500_add_uart("uart3", U5500_UART3_BASE, IRQ_DB5500_UART3) 67 dbx500_add_uart("uart3", U5500_UART3_BASE, IRQ_DB5500_UART3, plat)
65 68
66#endif 69#endif
diff --git a/arch/arm/mach-ux500/devices-db8500.c b/arch/arm/mach-ux500/devices-db8500.c
index 23c695d54977..73b17404b194 100644
--- a/arch/arm/mach-ux500/devices-db8500.c
+++ b/arch/arm/mach-ux500/devices-db8500.c
@@ -11,6 +11,7 @@
11#include <linux/io.h> 11#include <linux/io.h>
12#include <linux/gpio.h> 12#include <linux/gpio.h>
13#include <linux/amba/bus.h> 13#include <linux/amba/bus.h>
14#include <linux/amba/pl022.h>
14 15
15#include <plat/ste_dma40.h> 16#include <plat/ste_dma40.h>
16 17
@@ -67,12 +68,72 @@ struct stedma40_chan_cfg dma40_memcpy_conf_log = {
67 68
68/* 69/*
69 * Mapping between destination event lines and physical device address. 70 * Mapping between destination event lines and physical device address.
70 * The event line is tied to a device and therefor the address is constant. 71 * The event line is tied to a device and therefore the address is constant.
72 * When the address comes from a primecell it will be configured in runtime
73 * and we set the address to -1 as a placeholder.
71 */ 74 */
72static const dma_addr_t dma40_tx_map[DB8500_DMA_NR_DEV]; 75static const dma_addr_t dma40_tx_map[DB8500_DMA_NR_DEV] = {
76 /* MUSB - these will be runtime-reconfigured */
77 [DB8500_DMA_DEV39_USB_OTG_OEP_8] = -1,
78 [DB8500_DMA_DEV16_USB_OTG_OEP_7_15] = -1,
79 [DB8500_DMA_DEV17_USB_OTG_OEP_6_14] = -1,
80 [DB8500_DMA_DEV18_USB_OTG_OEP_5_13] = -1,
81 [DB8500_DMA_DEV19_USB_OTG_OEP_4_12] = -1,
82 [DB8500_DMA_DEV36_USB_OTG_OEP_3_11] = -1,
83 [DB8500_DMA_DEV37_USB_OTG_OEP_2_10] = -1,
84 [DB8500_DMA_DEV38_USB_OTG_OEP_1_9] = -1,
85 /* PrimeCells - run-time configured */
86 [DB8500_DMA_DEV0_SPI0_TX] = -1,
87 [DB8500_DMA_DEV1_SD_MMC0_TX] = -1,
88 [DB8500_DMA_DEV2_SD_MMC1_TX] = -1,
89 [DB8500_DMA_DEV3_SD_MMC2_TX] = -1,
90 [DB8500_DMA_DEV8_SSP0_TX] = -1,
91 [DB8500_DMA_DEV9_SSP1_TX] = -1,
92 [DB8500_DMA_DEV11_UART2_TX] = -1,
93 [DB8500_DMA_DEV12_UART1_TX] = -1,
94 [DB8500_DMA_DEV13_UART0_TX] = -1,
95 [DB8500_DMA_DEV28_SD_MM2_TX] = -1,
96 [DB8500_DMA_DEV29_SD_MM0_TX] = -1,
97 [DB8500_DMA_DEV32_SD_MM1_TX] = -1,
98 [DB8500_DMA_DEV33_SPI2_TX] = -1,
99 [DB8500_DMA_DEV35_SPI1_TX] = -1,
100 [DB8500_DMA_DEV40_SPI3_TX] = -1,
101 [DB8500_DMA_DEV41_SD_MM3_TX] = -1,
102 [DB8500_DMA_DEV42_SD_MM4_TX] = -1,
103 [DB8500_DMA_DEV43_SD_MM5_TX] = -1,
104};
73 105
74/* Mapping between source event lines and physical device address */ 106/* Mapping between source event lines and physical device address */
75static const dma_addr_t dma40_rx_map[DB8500_DMA_NR_DEV]; 107static const dma_addr_t dma40_rx_map[DB8500_DMA_NR_DEV] = {
108 /* MUSB - these will be runtime-reconfigured */
109 [DB8500_DMA_DEV39_USB_OTG_IEP_8] = -1,
110 [DB8500_DMA_DEV16_USB_OTG_IEP_7_15] = -1,
111 [DB8500_DMA_DEV17_USB_OTG_IEP_6_14] = -1,
112 [DB8500_DMA_DEV18_USB_OTG_IEP_5_13] = -1,
113 [DB8500_DMA_DEV19_USB_OTG_IEP_4_12] = -1,
114 [DB8500_DMA_DEV36_USB_OTG_IEP_3_11] = -1,
115 [DB8500_DMA_DEV37_USB_OTG_IEP_2_10] = -1,
116 [DB8500_DMA_DEV38_USB_OTG_IEP_1_9] = -1,
117 /* PrimeCells */
118 [DB8500_DMA_DEV0_SPI0_RX] = -1,
119 [DB8500_DMA_DEV1_SD_MMC0_RX] = -1,
120 [DB8500_DMA_DEV2_SD_MMC1_RX] = -1,
121 [DB8500_DMA_DEV3_SD_MMC2_RX] = -1,
122 [DB8500_DMA_DEV8_SSP0_RX] = -1,
123 [DB8500_DMA_DEV9_SSP1_RX] = -1,
124 [DB8500_DMA_DEV11_UART2_RX] = -1,
125 [DB8500_DMA_DEV12_UART1_RX] = -1,
126 [DB8500_DMA_DEV13_UART0_RX] = -1,
127 [DB8500_DMA_DEV28_SD_MM2_RX] = -1,
128 [DB8500_DMA_DEV29_SD_MM0_RX] = -1,
129 [DB8500_DMA_DEV32_SD_MM1_RX] = -1,
130 [DB8500_DMA_DEV33_SPI2_RX] = -1,
131 [DB8500_DMA_DEV35_SPI1_RX] = -1,
132 [DB8500_DMA_DEV40_SPI3_RX] = -1,
133 [DB8500_DMA_DEV41_SD_MM3_RX] = -1,
134 [DB8500_DMA_DEV42_SD_MM4_RX] = -1,
135 [DB8500_DMA_DEV43_SD_MM5_RX] = -1,
136};
76 137
77/* Reserved event lines for memcpy only */ 138/* Reserved event lines for memcpy only */
78static int dma40_memcpy_event[] = { 139static int dma40_memcpy_event[] = {
diff --git a/arch/arm/mach-ux500/devices-db8500.h b/arch/arm/mach-ux500/devices-db8500.h
index 3a770c756979..9cc6f8f5d3e6 100644
--- a/arch/arm/mach-ux500/devices-db8500.h
+++ b/arch/arm/mach-ux500/devices-db8500.h
@@ -61,6 +61,9 @@ db8500_add_ssp(const char *name, resource_size_t base, int irq,
61#define db8500_add_rtc() \ 61#define db8500_add_rtc() \
62 dbx500_add_rtc(U8500_RTC_BASE, IRQ_DB8500_RTC); 62 dbx500_add_rtc(U8500_RTC_BASE, IRQ_DB8500_RTC);
63 63
64#define db8500_add_usb(rx_cfg, tx_cfg) \
65 ux500_add_usb(U8500_USBOTG_BASE, IRQ_DB8500_USBOTG, rx_cfg, tx_cfg)
66
64#define db8500_add_sdi0(pdata) \ 67#define db8500_add_sdi0(pdata) \
65 dbx500_add_sdi("sdi0", U8500_SDI0_BASE, IRQ_DB8500_SDMMC0, pdata) 68 dbx500_add_sdi("sdi0", U8500_SDI0_BASE, IRQ_DB8500_SDMMC0, pdata)
66#define db8500_add_sdi1(pdata) \ 69#define db8500_add_sdi1(pdata) \
@@ -88,11 +91,11 @@ db8500_add_ssp(const char *name, resource_size_t base, int irq,
88#define db8500_add_spi3(pdata) \ 91#define db8500_add_spi3(pdata) \
89 dbx500_add_spi("spi3", U8500_SPI3_BASE, IRQ_DB8500_SPI3, pdata) 92 dbx500_add_spi("spi3", U8500_SPI3_BASE, IRQ_DB8500_SPI3, pdata)
90 93
91#define db8500_add_uart0() \ 94#define db8500_add_uart0(pdata) \
92 dbx500_add_uart("uart0", U8500_UART0_BASE, IRQ_DB8500_UART0) 95 dbx500_add_uart("uart0", U8500_UART0_BASE, IRQ_DB8500_UART0, pdata)
93#define db8500_add_uart1() \ 96#define db8500_add_uart1(pdata) \
94 dbx500_add_uart("uart1", U8500_UART1_BASE, IRQ_DB8500_UART1) 97 dbx500_add_uart("uart1", U8500_UART1_BASE, IRQ_DB8500_UART1, pdata)
95#define db8500_add_uart2() \ 98#define db8500_add_uart2(pdata) \
96 dbx500_add_uart("uart2", U8500_UART2_BASE, IRQ_DB8500_UART2) 99 dbx500_add_uart("uart2", U8500_UART2_BASE, IRQ_DB8500_UART2, pdata)
97 100
98#endif 101#endif
diff --git a/arch/arm/mach-ux500/dma-db5500.c b/arch/arm/mach-ux500/dma-db5500.c
index 32a061f8a95b..1cfab68ae417 100644
--- a/arch/arm/mach-ux500/dma-db5500.c
+++ b/arch/arm/mach-ux500/dma-db5500.c
@@ -73,11 +73,27 @@ static struct stedma40_chan_cfg dma40_memcpy_conf_log = {
73 */ 73 */
74static const dma_addr_t dma40_rx_map[DB5500_DMA_NR_DEV] = { 74static const dma_addr_t dma40_rx_map[DB5500_DMA_NR_DEV] = {
75 [DB5500_DMA_DEV24_SDMMC0_RX] = -1, 75 [DB5500_DMA_DEV24_SDMMC0_RX] = -1,
76 [DB5500_DMA_DEV38_USB_OTG_IEP_8] = -1,
77 [DB5500_DMA_DEV23_USB_OTG_IEP_7_15] = -1,
78 [DB5500_DMA_DEV22_USB_OTG_IEP_6_14] = -1,
79 [DB5500_DMA_DEV21_USB_OTG_IEP_5_13] = -1,
80 [DB5500_DMA_DEV20_USB_OTG_IEP_4_12] = -1,
81 [DB5500_DMA_DEV6_USB_OTG_IEP_3_11] = -1,
82 [DB5500_DMA_DEV5_USB_OTG_IEP_2_10] = -1,
83 [DB5500_DMA_DEV4_USB_OTG_IEP_1_9] = -1,
76}; 84};
77 85
78/* Mapping between destination event lines and physical device address */ 86/* Mapping between destination event lines and physical device address */
79static const dma_addr_t dma40_tx_map[DB5500_DMA_NR_DEV] = { 87static const dma_addr_t dma40_tx_map[DB5500_DMA_NR_DEV] = {
80 [DB5500_DMA_DEV24_SDMMC0_TX] = -1, 88 [DB5500_DMA_DEV24_SDMMC0_TX] = -1,
89 [DB5500_DMA_DEV38_USB_OTG_OEP_8] = -1,
90 [DB5500_DMA_DEV23_USB_OTG_OEP_7_15] = -1,
91 [DB5500_DMA_DEV22_USB_OTG_OEP_6_14] = -1,
92 [DB5500_DMA_DEV21_USB_OTG_OEP_5_13] = -1,
93 [DB5500_DMA_DEV20_USB_OTG_OEP_4_12] = -1,
94 [DB5500_DMA_DEV6_USB_OTG_OEP_3_11] = -1,
95 [DB5500_DMA_DEV5_USB_OTG_OEP_2_10] = -1,
96 [DB5500_DMA_DEV4_USB_OTG_OEP_1_9] = -1,
81}; 97};
82 98
83static int dma40_memcpy_event[] = { 99static int dma40_memcpy_event[] = {
diff --git a/arch/arm/mach-ux500/include/mach/memory.h b/arch/arm/mach-ux500/include/mach/memory.h
index 510571a59e25..2ef697a67006 100644
--- a/arch/arm/mach-ux500/include/mach/memory.h
+++ b/arch/arm/mach-ux500/include/mach/memory.h
@@ -12,7 +12,7 @@
12/* 12/*
13 * Physical DRAM offset. 13 * Physical DRAM offset.
14 */ 14 */
15#define PHYS_OFFSET UL(0x00000000) 15#define PLAT_PHYS_OFFSET UL(0x00000000)
16#define BUS_OFFSET UL(0x00000000) 16#define BUS_OFFSET UL(0x00000000)
17 17
18#endif 18#endif
diff --git a/arch/arm/mach-ux500/include/mach/uncompress.h b/arch/arm/mach-ux500/include/mach/uncompress.h
index 9a6614c6808e..ab0fe1432fae 100644
--- a/arch/arm/mach-ux500/include/mach/uncompress.h
+++ b/arch/arm/mach-ux500/include/mach/uncompress.h
@@ -50,7 +50,11 @@ static void flush(void)
50 50
51static inline void arch_decomp_setup(void) 51static inline void arch_decomp_setup(void)
52{ 52{
53 if (machine_is_u8500()) 53 /* Check in run time if we run on an U8500 or U5500 */
54 if (machine_is_u8500() ||
55 machine_is_svp8500v1() ||
56 machine_is_svp8500v2() ||
57 machine_is_hrefv60())
54 ux500_uart_base = U8500_UART2_BASE; 58 ux500_uart_base = U8500_UART2_BASE;
55 else if (machine_is_u5500()) 59 else if (machine_is_u5500())
56 ux500_uart_base = U5500_UART0_BASE; 60 ux500_uart_base = U5500_UART0_BASE;
diff --git a/arch/arm/mach-ux500/include/mach/usb.h b/arch/arm/mach-ux500/include/mach/usb.h
new file mode 100644
index 000000000000..d3739d418813
--- /dev/null
+++ b/arch/arm/mach-ux500/include/mach/usb.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2011
3 *
4 * Author: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
5 * License terms: GNU General Public License (GPL) version 2
6 */
7#ifndef __ASM_ARCH_USB_H
8#define __ASM_ARCH_USB_H
9
10#include <linux/dmaengine.h>
11
12#define UX500_MUSB_DMA_NUM_RX_CHANNELS 8
13#define UX500_MUSB_DMA_NUM_TX_CHANNELS 8
14
15struct ux500_musb_board_data {
16 void **dma_rx_param_array;
17 void **dma_tx_param_array;
18 u32 num_rx_channels;
19 u32 num_tx_channels;
20 bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
21};
22
23void ux500_add_usb(resource_size_t base, int irq, int *dma_rx_cfg,
24 int *dma_tx_cfg);
25#endif
diff --git a/arch/arm/mach-ux500/localtimer.c b/arch/arm/mach-ux500/localtimer.c
index 2288f6a7c518..5ba113309a0b 100644
--- a/arch/arm/mach-ux500/localtimer.c
+++ b/arch/arm/mach-ux500/localtimer.c
@@ -21,8 +21,9 @@
21/* 21/*
22 * Setup the local clock events for a CPU. 22 * Setup the local clock events for a CPU.
23 */ 23 */
24void __cpuinit local_timer_setup(struct clock_event_device *evt) 24int __cpuinit local_timer_setup(struct clock_event_device *evt)
25{ 25{
26 evt->irq = IRQ_LOCALTIMER; 26 evt->irq = IRQ_LOCALTIMER;
27 twd_timer_setup(evt); 27 twd_timer_setup(evt);
28 return 0;
28} 29}
diff --git a/arch/arm/mach-ux500/mbox-db5500.c b/arch/arm/mach-ux500/mbox-db5500.c
index cbf15718fc3c..a4ffb9f4f461 100644
--- a/arch/arm/mach-ux500/mbox-db5500.c
+++ b/arch/arm/mach-ux500/mbox-db5500.c
@@ -498,7 +498,7 @@ struct mbox *mbox_setup(u8 mbox_id, mbox_recv_cb_t *mbox_cb, void *priv)
498#endif 498#endif
499 499
500 dev_info(&(mbox->pdev->dev), 500 dev_info(&(mbox->pdev->dev),
501 "Mailbox driver with index %d initated!\n", mbox_id); 501 "Mailbox driver with index %d initiated!\n", mbox_id);
502 502
503exit: 503exit:
504 return mbox; 504 return mbox;
diff --git a/arch/arm/mach-ux500/usb.c b/arch/arm/mach-ux500/usb.c
new file mode 100644
index 000000000000..82e535953fd9
--- /dev/null
+++ b/arch/arm/mach-ux500/usb.c
@@ -0,0 +1,160 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2011
3 *
4 * Author: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
5 * License terms: GNU General Public License (GPL) version 2
6 */
7#include <linux/platform_device.h>
8#include <linux/usb/musb.h>
9#include <plat/ste_dma40.h>
10#include <mach/hardware.h>
11#include <mach/usb.h>
12
13#define MUSB_DMA40_RX_CH { \
14 .mode = STEDMA40_MODE_LOGICAL, \
15 .dir = STEDMA40_PERIPH_TO_MEM, \
16 .dst_dev_type = STEDMA40_DEV_DST_MEMORY, \
17 .src_info.data_width = STEDMA40_WORD_WIDTH, \
18 .dst_info.data_width = STEDMA40_WORD_WIDTH, \
19 .src_info.psize = STEDMA40_PSIZE_LOG_16, \
20 .dst_info.psize = STEDMA40_PSIZE_LOG_16, \
21 }
22
23#define MUSB_DMA40_TX_CH { \
24 .mode = STEDMA40_MODE_LOGICAL, \
25 .dir = STEDMA40_MEM_TO_PERIPH, \
26 .src_dev_type = STEDMA40_DEV_SRC_MEMORY, \
27 .src_info.data_width = STEDMA40_WORD_WIDTH, \
28 .dst_info.data_width = STEDMA40_WORD_WIDTH, \
29 .src_info.psize = STEDMA40_PSIZE_LOG_16, \
30 .dst_info.psize = STEDMA40_PSIZE_LOG_16, \
31 }
32
33static struct stedma40_chan_cfg musb_dma_rx_ch[UX500_MUSB_DMA_NUM_RX_CHANNELS]
34 = {
35 MUSB_DMA40_RX_CH,
36 MUSB_DMA40_RX_CH,
37 MUSB_DMA40_RX_CH,
38 MUSB_DMA40_RX_CH,
39 MUSB_DMA40_RX_CH,
40 MUSB_DMA40_RX_CH,
41 MUSB_DMA40_RX_CH,
42 MUSB_DMA40_RX_CH
43};
44
45static struct stedma40_chan_cfg musb_dma_tx_ch[UX500_MUSB_DMA_NUM_TX_CHANNELS]
46 = {
47 MUSB_DMA40_TX_CH,
48 MUSB_DMA40_TX_CH,
49 MUSB_DMA40_TX_CH,
50 MUSB_DMA40_TX_CH,
51 MUSB_DMA40_TX_CH,
52 MUSB_DMA40_TX_CH,
53 MUSB_DMA40_TX_CH,
54 MUSB_DMA40_TX_CH,
55};
56
57static void *ux500_dma_rx_param_array[UX500_MUSB_DMA_NUM_RX_CHANNELS] = {
58 &musb_dma_rx_ch[0],
59 &musb_dma_rx_ch[1],
60 &musb_dma_rx_ch[2],
61 &musb_dma_rx_ch[3],
62 &musb_dma_rx_ch[4],
63 &musb_dma_rx_ch[5],
64 &musb_dma_rx_ch[6],
65 &musb_dma_rx_ch[7]
66};
67
68static void *ux500_dma_tx_param_array[UX500_MUSB_DMA_NUM_TX_CHANNELS] = {
69 &musb_dma_tx_ch[0],
70 &musb_dma_tx_ch[1],
71 &musb_dma_tx_ch[2],
72 &musb_dma_tx_ch[3],
73 &musb_dma_tx_ch[4],
74 &musb_dma_tx_ch[5],
75 &musb_dma_tx_ch[6],
76 &musb_dma_tx_ch[7]
77};
78
79static struct ux500_musb_board_data musb_board_data = {
80 .dma_rx_param_array = ux500_dma_rx_param_array,
81 .dma_tx_param_array = ux500_dma_tx_param_array,
82 .num_rx_channels = UX500_MUSB_DMA_NUM_RX_CHANNELS,
83 .num_tx_channels = UX500_MUSB_DMA_NUM_TX_CHANNELS,
84 .dma_filter = stedma40_filter,
85};
86
87static u64 ux500_musb_dmamask = DMA_BIT_MASK(32);
88
89static struct musb_hdrc_config musb_hdrc_config = {
90 .multipoint = true,
91 .dyn_fifo = true,
92 .num_eps = 16,
93 .ram_bits = 16,
94};
95
96static struct musb_hdrc_platform_data musb_platform_data = {
97#if defined(CONFIG_USB_MUSB_OTG)
98 .mode = MUSB_OTG,
99#elif defined(CONFIG_USB_MUSB_PERIPHERAL)
100 .mode = MUSB_PERIPHERAL,
101#else /* defined(CONFIG_USB_MUSB_HOST) */
102 .mode = MUSB_HOST,
103#endif
104 .config = &musb_hdrc_config,
105 .board_data = &musb_board_data,
106};
107
108static struct resource usb_resources[] = {
109 [0] = {
110 .name = "usb-mem",
111 .flags = IORESOURCE_MEM,
112 },
113
114 [1] = {
115 .name = "mc", /* hard-coded in musb */
116 .flags = IORESOURCE_IRQ,
117 },
118};
119
120struct platform_device ux500_musb_device = {
121 .name = "musb-ux500",
122 .id = 0,
123 .dev = {
124 .platform_data = &musb_platform_data,
125 .dma_mask = &ux500_musb_dmamask,
126 .coherent_dma_mask = DMA_BIT_MASK(32),
127 },
128 .num_resources = ARRAY_SIZE(usb_resources),
129 .resource = usb_resources,
130};
131
132static inline void ux500_usb_dma_update_rx_ch_config(int *src_dev_type)
133{
134 u32 idx;
135
136 for (idx = 0; idx < UX500_MUSB_DMA_NUM_RX_CHANNELS; idx++)
137 musb_dma_rx_ch[idx].src_dev_type = src_dev_type[idx];
138}
139
140static inline void ux500_usb_dma_update_tx_ch_config(int *dst_dev_type)
141{
142 u32 idx;
143
144 for (idx = 0; idx < UX500_MUSB_DMA_NUM_TX_CHANNELS; idx++)
145 musb_dma_tx_ch[idx].dst_dev_type = dst_dev_type[idx];
146}
147
148void ux500_add_usb(resource_size_t base, int irq, int *dma_rx_cfg,
149 int *dma_tx_cfg)
150{
151 ux500_musb_device.resource[0].start = base;
152 ux500_musb_device.resource[0].end = base + SZ_64K - 1;
153 ux500_musb_device.resource[1].start = irq;
154 ux500_musb_device.resource[1].end = irq;
155
156 ux500_usb_dma_update_rx_ch_config(dma_rx_cfg);
157 ux500_usb_dma_update_tx_ch_config(dma_tx_cfg);
158
159 platform_device_register(&ux500_musb_device);
160}
diff --git a/arch/arm/mach-versatile/Kconfig b/arch/arm/mach-versatile/Kconfig
index 3f7b5e9d83c5..9cdec5aa04a0 100644
--- a/arch/arm/mach-versatile/Kconfig
+++ b/arch/arm/mach-versatile/Kconfig
@@ -2,17 +2,19 @@ menu "Versatile platform type"
2 depends on ARCH_VERSATILE 2 depends on ARCH_VERSATILE
3 3
4config ARCH_VERSATILE_PB 4config ARCH_VERSATILE_PB
5 bool "Support Versatile/PB platform" 5 bool "Support Versatile Platform Baseboard for ARM926EJ-S"
6 select CPU_ARM926T 6 select CPU_ARM926T
7 select MIGHT_HAVE_PCI 7 select MIGHT_HAVE_PCI
8 default y 8 default y
9 help 9 help
10 Include support for the ARM(R) Versatile/PB platform. 10 Include support for the ARM(R) Versatile Platform Baseboard
11 for the ARM926EJ-S.
11 12
12config MACH_VERSATILE_AB 13config MACH_VERSATILE_AB
13 bool "Support Versatile/AB platform" 14 bool "Support Versatile Application Baseboard for ARM926EJ-S"
14 select CPU_ARM926T 15 select CPU_ARM926T
15 help 16 help
16 Include support for the ARM(R) Versatile/AP platform. 17 Include support for the ARM(R) Versatile Application Baseboard
18 for the ARM926EJ-S.
17 19
18endmenu 20endmenu
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 136c32e7ed8e..eb7ffa0ee8b5 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -50,6 +50,8 @@
50#include <mach/platform.h> 50#include <mach/platform.h>
51#include <asm/hardware/timer-sp.h> 51#include <asm/hardware/timer-sp.h>
52 52
53#include <plat/clcd.h>
54#include <plat/fpga-irq.h>
53#include <plat/sched_clock.h> 55#include <plat/sched_clock.h>
54 56
55#include "core.h" 57#include "core.h"
@@ -63,47 +65,12 @@
63#define VA_VIC_BASE __io_address(VERSATILE_VIC_BASE) 65#define VA_VIC_BASE __io_address(VERSATILE_VIC_BASE)
64#define VA_SIC_BASE __io_address(VERSATILE_SIC_BASE) 66#define VA_SIC_BASE __io_address(VERSATILE_SIC_BASE)
65 67
66static void sic_mask_irq(struct irq_data *d) 68static struct fpga_irq_data sic_irq = {
67{ 69 .base = VA_SIC_BASE,
68 unsigned int irq = d->irq - IRQ_SIC_START; 70 .irq_start = IRQ_SIC_START,
69 71 .chip.name = "SIC",
70 writel(1 << irq, VA_SIC_BASE + SIC_IRQ_ENABLE_CLEAR);
71}
72
73static void sic_unmask_irq(struct irq_data *d)
74{
75 unsigned int irq = d->irq - IRQ_SIC_START;
76
77 writel(1 << irq, VA_SIC_BASE + SIC_IRQ_ENABLE_SET);
78}
79
80static struct irq_chip sic_chip = {
81 .name = "SIC",
82 .irq_ack = sic_mask_irq,
83 .irq_mask = sic_mask_irq,
84 .irq_unmask = sic_unmask_irq,
85}; 72};
86 73
87static void
88sic_handle_irq(unsigned int irq, struct irq_desc *desc)
89{
90 unsigned long status = readl(VA_SIC_BASE + SIC_IRQ_STATUS);
91
92 if (status == 0) {
93 do_bad_IRQ(irq, desc);
94 return;
95 }
96
97 do {
98 irq = ffs(status) - 1;
99 status &= ~(1 << irq);
100
101 irq += IRQ_SIC_START;
102
103 generic_handle_irq(irq);
104 } while (status);
105}
106
107#if 1 74#if 1
108#define IRQ_MMCI0A IRQ_VICSOURCE22 75#define IRQ_MMCI0A IRQ_VICSOURCE22
109#define IRQ_AACI IRQ_VICSOURCE24 76#define IRQ_AACI IRQ_VICSOURCE24
@@ -118,22 +85,11 @@ sic_handle_irq(unsigned int irq, struct irq_desc *desc)
118 85
119void __init versatile_init_irq(void) 86void __init versatile_init_irq(void)
120{ 87{
121 unsigned int i;
122
123 vic_init(VA_VIC_BASE, IRQ_VIC_START, ~0, 0); 88 vic_init(VA_VIC_BASE, IRQ_VIC_START, ~0, 0);
124 89
125 set_irq_chained_handler(IRQ_VICSOURCE31, sic_handle_irq);
126
127 /* Do second interrupt controller */
128 writel(~0, VA_SIC_BASE + SIC_IRQ_ENABLE_CLEAR); 90 writel(~0, VA_SIC_BASE + SIC_IRQ_ENABLE_CLEAR);
129 91
130 for (i = IRQ_SIC_START; i <= IRQ_SIC_END; i++) { 92 fpga_irq_init(IRQ_VICSOURCE31, ~PIC_MASK, &sic_irq);
131 if ((PIC_MASK & (1 << (i - IRQ_SIC_START))) == 0) {
132 set_irq_chip(i, &sic_chip);
133 set_irq_handler(i, handle_level_irq);
134 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
135 }
136 }
137 93
138 /* 94 /*
139 * Interrupts on secondary controller from 0 to 8 are routed to 95 * Interrupts on secondary controller from 0 to 8 are routed to
@@ -476,127 +432,7 @@ static struct clk_lookup lookups[] = {
476#define SYS_CLCD_ID_SANYO_2_5 (0x07 << 8) 432#define SYS_CLCD_ID_SANYO_2_5 (0x07 << 8)
477#define SYS_CLCD_ID_VGA (0x1f << 8) 433#define SYS_CLCD_ID_VGA (0x1f << 8)
478 434
479static struct clcd_panel vga = { 435static bool is_sanyo_2_5_lcd;
480 .mode = {
481 .name = "VGA",
482 .refresh = 60,
483 .xres = 640,
484 .yres = 480,
485 .pixclock = 39721,
486 .left_margin = 40,
487 .right_margin = 24,
488 .upper_margin = 32,
489 .lower_margin = 11,
490 .hsync_len = 96,
491 .vsync_len = 2,
492 .sync = 0,
493 .vmode = FB_VMODE_NONINTERLACED,
494 },
495 .width = -1,
496 .height = -1,
497 .tim2 = TIM2_BCD | TIM2_IPC,
498 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
499 .bpp = 16,
500};
501
502static struct clcd_panel sanyo_3_8_in = {
503 .mode = {
504 .name = "Sanyo QVGA",
505 .refresh = 116,
506 .xres = 320,
507 .yres = 240,
508 .pixclock = 100000,
509 .left_margin = 6,
510 .right_margin = 6,
511 .upper_margin = 5,
512 .lower_margin = 5,
513 .hsync_len = 6,
514 .vsync_len = 6,
515 .sync = 0,
516 .vmode = FB_VMODE_NONINTERLACED,
517 },
518 .width = -1,
519 .height = -1,
520 .tim2 = TIM2_BCD,
521 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
522 .bpp = 16,
523};
524
525static struct clcd_panel sanyo_2_5_in = {
526 .mode = {
527 .name = "Sanyo QVGA Portrait",
528 .refresh = 116,
529 .xres = 240,
530 .yres = 320,
531 .pixclock = 100000,
532 .left_margin = 20,
533 .right_margin = 10,
534 .upper_margin = 2,
535 .lower_margin = 2,
536 .hsync_len = 10,
537 .vsync_len = 2,
538 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
539 .vmode = FB_VMODE_NONINTERLACED,
540 },
541 .width = -1,
542 .height = -1,
543 .tim2 = TIM2_IVS | TIM2_IHS | TIM2_IPC,
544 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
545 .bpp = 16,
546};
547
548static struct clcd_panel epson_2_2_in = {
549 .mode = {
550 .name = "Epson QCIF",
551 .refresh = 390,
552 .xres = 176,
553 .yres = 220,
554 .pixclock = 62500,
555 .left_margin = 3,
556 .right_margin = 2,
557 .upper_margin = 1,
558 .lower_margin = 0,
559 .hsync_len = 3,
560 .vsync_len = 2,
561 .sync = 0,
562 .vmode = FB_VMODE_NONINTERLACED,
563 },
564 .width = -1,
565 .height = -1,
566 .tim2 = TIM2_BCD | TIM2_IPC,
567 .cntl = CNTL_LCDTFT | CNTL_LCDVCOMP(1),
568 .bpp = 16,
569};
570
571/*
572 * Detect which LCD panel is connected, and return the appropriate
573 * clcd_panel structure. Note: we do not have any information on
574 * the required timings for the 8.4in panel, so we presently assume
575 * VGA timings.
576 */
577static struct clcd_panel *versatile_clcd_panel(void)
578{
579 void __iomem *sys_clcd = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_CLCD_OFFSET;
580 struct clcd_panel *panel = &vga;
581 u32 val;
582
583 val = readl(sys_clcd) & SYS_CLCD_ID_MASK;
584 if (val == SYS_CLCD_ID_SANYO_3_8)
585 panel = &sanyo_3_8_in;
586 else if (val == SYS_CLCD_ID_SANYO_2_5)
587 panel = &sanyo_2_5_in;
588 else if (val == SYS_CLCD_ID_EPSON_2_2)
589 panel = &epson_2_2_in;
590 else if (val == SYS_CLCD_ID_VGA)
591 panel = &vga;
592 else {
593 printk(KERN_ERR "CLCD: unknown LCD panel ID 0x%08x, using VGA\n",
594 val);
595 panel = &vga;
596 }
597
598 return panel;
599}
600 436
601/* 437/*
602 * Disable all display connectors on the interface module. 438 * Disable all display connectors on the interface module.
@@ -614,7 +450,7 @@ static void versatile_clcd_disable(struct clcd_fb *fb)
614 /* 450 /*
615 * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light off 451 * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light off
616 */ 452 */
617 if (machine_is_versatile_ab() && fb->panel == &sanyo_2_5_in) { 453 if (machine_is_versatile_ab() && is_sanyo_2_5_lcd) {
618 void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL); 454 void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL);
619 unsigned long ctrl; 455 unsigned long ctrl;
620 456
@@ -630,18 +466,22 @@ static void versatile_clcd_disable(struct clcd_fb *fb)
630 */ 466 */
631static void versatile_clcd_enable(struct clcd_fb *fb) 467static void versatile_clcd_enable(struct clcd_fb *fb)
632{ 468{
469 struct fb_var_screeninfo *var = &fb->fb.var;
633 void __iomem *sys_clcd = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_CLCD_OFFSET; 470 void __iomem *sys_clcd = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_CLCD_OFFSET;
634 u32 val; 471 u32 val;
635 472
636 val = readl(sys_clcd); 473 val = readl(sys_clcd);
637 val &= ~SYS_CLCD_MODE_MASK; 474 val &= ~SYS_CLCD_MODE_MASK;
638 475
639 switch (fb->fb.var.green.length) { 476 switch (var->green.length) {
640 case 5: 477 case 5:
641 val |= SYS_CLCD_MODE_5551; 478 val |= SYS_CLCD_MODE_5551;
642 break; 479 break;
643 case 6: 480 case 6:
644 val |= SYS_CLCD_MODE_565_RLSB; 481 if (var->red.offset == 0)
482 val |= SYS_CLCD_MODE_565_RLSB;
483 else
484 val |= SYS_CLCD_MODE_565_BLSB;
645 break; 485 break;
646 case 8: 486 case 8:
647 val |= SYS_CLCD_MODE_888; 487 val |= SYS_CLCD_MODE_888;
@@ -663,7 +503,7 @@ static void versatile_clcd_enable(struct clcd_fb *fb)
663 /* 503 /*
664 * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light on 504 * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light on
665 */ 505 */
666 if (machine_is_versatile_ab() && fb->panel == &sanyo_2_5_in) { 506 if (machine_is_versatile_ab() && is_sanyo_2_5_lcd) {
667 void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL); 507 void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL);
668 unsigned long ctrl; 508 unsigned long ctrl;
669 509
@@ -674,50 +514,62 @@ static void versatile_clcd_enable(struct clcd_fb *fb)
674#endif 514#endif
675} 515}
676 516
677static unsigned long framesize = SZ_1M; 517/*
678 518 * Detect which LCD panel is connected, and return the appropriate
519 * clcd_panel structure. Note: we do not have any information on
520 * the required timings for the 8.4in panel, so we presently assume
521 * VGA timings.
522 */
679static int versatile_clcd_setup(struct clcd_fb *fb) 523static int versatile_clcd_setup(struct clcd_fb *fb)
680{ 524{
681 dma_addr_t dma; 525 void __iomem *sys_clcd = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_CLCD_OFFSET;
526 const char *panel_name;
527 u32 val;
682 528
683 fb->panel = versatile_clcd_panel(); 529 is_sanyo_2_5_lcd = false;
684 530
685 fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize, 531 val = readl(sys_clcd) & SYS_CLCD_ID_MASK;
686 &dma, GFP_KERNEL); 532 if (val == SYS_CLCD_ID_SANYO_3_8)
687 if (!fb->fb.screen_base) { 533 panel_name = "Sanyo TM38QV67A02A";
688 printk(KERN_ERR "CLCD: unable to map framebuffer\n"); 534 else if (val == SYS_CLCD_ID_SANYO_2_5) {
689 return -ENOMEM; 535 panel_name = "Sanyo QVGA Portrait";
536 is_sanyo_2_5_lcd = true;
537 } else if (val == SYS_CLCD_ID_EPSON_2_2)
538 panel_name = "Epson L2F50113T00";
539 else if (val == SYS_CLCD_ID_VGA)
540 panel_name = "VGA";
541 else {
542 printk(KERN_ERR "CLCD: unknown LCD panel ID 0x%08x, using VGA\n",
543 val);
544 panel_name = "VGA";
690 } 545 }
691 546
692 fb->fb.fix.smem_start = dma; 547 fb->panel = versatile_clcd_get_panel(panel_name);
693 fb->fb.fix.smem_len = framesize; 548 if (!fb->panel)
549 return -EINVAL;
694 550
695 return 0; 551 return versatile_clcd_setup_dma(fb, SZ_1M);
696} 552}
697 553
698static int versatile_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma) 554static void versatile_clcd_decode(struct clcd_fb *fb, struct clcd_regs *regs)
699{ 555{
700 return dma_mmap_writecombine(&fb->dev->dev, vma, 556 clcdfb_decode(fb, regs);
701 fb->fb.screen_base,
702 fb->fb.fix.smem_start,
703 fb->fb.fix.smem_len);
704}
705 557
706static void versatile_clcd_remove(struct clcd_fb *fb) 558 /* Always clear BGR for RGB565: we do the routing externally */
707{ 559 if (fb->fb.var.green.length == 6)
708 dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len, 560 regs->cntl &= ~CNTL_BGR;
709 fb->fb.screen_base, fb->fb.fix.smem_start);
710} 561}
711 562
712static struct clcd_board clcd_plat_data = { 563static struct clcd_board clcd_plat_data = {
713 .name = "Versatile", 564 .name = "Versatile",
565 .caps = CLCD_CAP_5551 | CLCD_CAP_565 | CLCD_CAP_888,
714 .check = clcdfb_check, 566 .check = clcdfb_check,
715 .decode = clcdfb_decode, 567 .decode = versatile_clcd_decode,
716 .disable = versatile_clcd_disable, 568 .disable = versatile_clcd_disable,
717 .enable = versatile_clcd_enable, 569 .enable = versatile_clcd_enable,
718 .setup = versatile_clcd_setup, 570 .setup = versatile_clcd_setup,
719 .mmap = versatile_clcd_mmap, 571 .mmap = versatile_clcd_mmap_dma,
720 .remove = versatile_clcd_remove, 572 .remove = versatile_clcd_remove_dma,
721}; 573};
722 574
723static struct pl061_platform_data gpio0_plat_data = { 575static struct pl061_platform_data gpio0_plat_data = {
@@ -737,53 +589,35 @@ static struct pl022_ssp_controller ssp0_plat_data = {
737}; 589};
738 590
739#define AACI_IRQ { IRQ_AACI, NO_IRQ } 591#define AACI_IRQ { IRQ_AACI, NO_IRQ }
740#define AACI_DMA { 0x80, 0x81 }
741#define MMCI0_IRQ { IRQ_MMCI0A,IRQ_SIC_MMCI0B } 592#define MMCI0_IRQ { IRQ_MMCI0A,IRQ_SIC_MMCI0B }
742#define MMCI0_DMA { 0x84, 0 }
743#define KMI0_IRQ { IRQ_SIC_KMI0, NO_IRQ } 593#define KMI0_IRQ { IRQ_SIC_KMI0, NO_IRQ }
744#define KMI0_DMA { 0, 0 }
745#define KMI1_IRQ { IRQ_SIC_KMI1, NO_IRQ } 594#define KMI1_IRQ { IRQ_SIC_KMI1, NO_IRQ }
746#define KMI1_DMA { 0, 0 }
747 595
748/* 596/*
749 * These devices are connected directly to the multi-layer AHB switch 597 * These devices are connected directly to the multi-layer AHB switch
750 */ 598 */
751#define SMC_IRQ { NO_IRQ, NO_IRQ } 599#define SMC_IRQ { NO_IRQ, NO_IRQ }
752#define SMC_DMA { 0, 0 }
753#define MPMC_IRQ { NO_IRQ, NO_IRQ } 600#define MPMC_IRQ { NO_IRQ, NO_IRQ }
754#define MPMC_DMA { 0, 0 }
755#define CLCD_IRQ { IRQ_CLCDINT, NO_IRQ } 601#define CLCD_IRQ { IRQ_CLCDINT, NO_IRQ }
756#define CLCD_DMA { 0, 0 }
757#define DMAC_IRQ { IRQ_DMAINT, NO_IRQ } 602#define DMAC_IRQ { IRQ_DMAINT, NO_IRQ }
758#define DMAC_DMA { 0, 0 }
759 603
760/* 604/*
761 * These devices are connected via the core APB bridge 605 * These devices are connected via the core APB bridge
762 */ 606 */
763#define SCTL_IRQ { NO_IRQ, NO_IRQ } 607#define SCTL_IRQ { NO_IRQ, NO_IRQ }
764#define SCTL_DMA { 0, 0 }
765#define WATCHDOG_IRQ { IRQ_WDOGINT, NO_IRQ } 608#define WATCHDOG_IRQ { IRQ_WDOGINT, NO_IRQ }
766#define WATCHDOG_DMA { 0, 0 }
767#define GPIO0_IRQ { IRQ_GPIOINT0, NO_IRQ } 609#define GPIO0_IRQ { IRQ_GPIOINT0, NO_IRQ }
768#define GPIO0_DMA { 0, 0 }
769#define GPIO1_IRQ { IRQ_GPIOINT1, NO_IRQ } 610#define GPIO1_IRQ { IRQ_GPIOINT1, NO_IRQ }
770#define GPIO1_DMA { 0, 0 }
771#define RTC_IRQ { IRQ_RTCINT, NO_IRQ } 611#define RTC_IRQ { IRQ_RTCINT, NO_IRQ }
772#define RTC_DMA { 0, 0 }
773 612
774/* 613/*
775 * These devices are connected via the DMA APB bridge 614 * These devices are connected via the DMA APB bridge
776 */ 615 */
777#define SCI_IRQ { IRQ_SCIINT, NO_IRQ } 616#define SCI_IRQ { IRQ_SCIINT, NO_IRQ }
778#define SCI_DMA { 7, 6 }
779#define UART0_IRQ { IRQ_UARTINT0, NO_IRQ } 617#define UART0_IRQ { IRQ_UARTINT0, NO_IRQ }
780#define UART0_DMA { 15, 14 }
781#define UART1_IRQ { IRQ_UARTINT1, NO_IRQ } 618#define UART1_IRQ { IRQ_UARTINT1, NO_IRQ }
782#define UART1_DMA { 13, 12 }
783#define UART2_IRQ { IRQ_UARTINT2, NO_IRQ } 619#define UART2_IRQ { IRQ_UARTINT2, NO_IRQ }
784#define UART2_DMA { 11, 10 }
785#define SSP_IRQ { IRQ_SSPINT, NO_IRQ } 620#define SSP_IRQ { IRQ_SSPINT, NO_IRQ }
786#define SSP_DMA { 9, 8 }
787 621
788/* FPGA Primecells */ 622/* FPGA Primecells */
789AMBA_DEVICE(aaci, "fpga:04", AACI, NULL); 623AMBA_DEVICE(aaci, "fpga:04", AACI, NULL);
@@ -865,14 +699,21 @@ static void versatile_leds_event(led_event_t ledevt)
865} 699}
866#endif /* CONFIG_LEDS */ 700#endif /* CONFIG_LEDS */
867 701
868void __init versatile_init(void) 702/* Early initializations */
703void __init versatile_init_early(void)
869{ 704{
870 int i; 705 void __iomem *sys = __io_address(VERSATILE_SYS_BASE);
871
872 osc4_clk.vcoreg = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSCCLCD_OFFSET;
873 706
707 osc4_clk.vcoreg = sys + VERSATILE_SYS_OSCCLCD_OFFSET;
874 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 708 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
875 709
710 versatile_sched_clock_init(sys + VERSATILE_SYS_24MHz_OFFSET, 24000000);
711}
712
713void __init versatile_init(void)
714{
715 int i;
716
876 platform_device_register(&versatile_flash_device); 717 platform_device_register(&versatile_flash_device);
877 platform_device_register(&versatile_i2c_device); 718 platform_device_register(&versatile_i2c_device);
878 platform_device_register(&smc91x_device); 719 platform_device_register(&smc91x_device);
@@ -889,12 +730,6 @@ void __init versatile_init(void)
889} 730}
890 731
891/* 732/*
892 * The sched_clock counter
893 */
894#define REFCOUNTER (__io_address(VERSATILE_SYS_BASE) + \
895 VERSATILE_SYS_24MHz_OFFSET)
896
897/*
898 * Where is the timer (VA)? 733 * Where is the timer (VA)?
899 */ 734 */
900#define TIMER0_VA_BASE __io_address(VERSATILE_TIMER0_1_BASE) 735#define TIMER0_VA_BASE __io_address(VERSATILE_TIMER0_1_BASE)
@@ -909,8 +744,6 @@ static void __init versatile_timer_init(void)
909{ 744{
910 u32 val; 745 u32 val;
911 746
912 versatile_sched_clock_init(REFCOUNTER, 24000000);
913
914 /* 747 /*
915 * set clock frequency: 748 * set clock frequency:
916 * VERSATILE_REFCLK is 32KHz 749 * VERSATILE_REFCLK is 32KHz
diff --git a/arch/arm/mach-versatile/core.h b/arch/arm/mach-versatile/core.h
index 9d39886a8351..fd6404e5d788 100644
--- a/arch/arm/mach-versatile/core.h
+++ b/arch/arm/mach-versatile/core.h
@@ -25,6 +25,7 @@
25#include <linux/amba/bus.h> 25#include <linux/amba/bus.h>
26 26
27extern void __init versatile_init(void); 27extern void __init versatile_init(void);
28extern void __init versatile_init_early(void);
28extern void __init versatile_init_irq(void); 29extern void __init versatile_init_irq(void);
29extern void __init versatile_map_io(void); 30extern void __init versatile_map_io(void);
30extern struct sys_timer versatile_timer; 31extern struct sys_timer versatile_timer;
@@ -44,7 +45,6 @@ static struct amba_device name##_device = { \
44 }, \ 45 }, \
45 .dma_mask = ~0, \ 46 .dma_mask = ~0, \
46 .irq = base##_IRQ, \ 47 .irq = base##_IRQ, \
47 /* .dma = base##_DMA,*/ \
48} 48}
49 49
50#endif 50#endif
diff --git a/arch/arm/mach-versatile/include/mach/hardware.h b/arch/arm/mach-versatile/include/mach/hardware.h
index b5e75bb44965..6911e1f5f156 100644
--- a/arch/arm/mach-versatile/include/mach/hardware.h
+++ b/arch/arm/mach-versatile/include/mach/hardware.h
@@ -39,6 +39,6 @@
39/* macro to get at IO space when running virtually */ 39/* macro to get at IO space when running virtually */
40#define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000) 40#define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000)
41 41
42#define __io_address(n) __io(IO_ADDRESS(n)) 42#define __io_address(n) ((void __iomem __force *)IO_ADDRESS(n))
43 43
44#endif 44#endif
diff --git a/arch/arm/mach-versatile/include/mach/memory.h b/arch/arm/mach-versatile/include/mach/memory.h
index 79aeab86b903..dacc9d8e4e6a 100644
--- a/arch/arm/mach-versatile/include/mach/memory.h
+++ b/arch/arm/mach-versatile/include/mach/memory.h
@@ -23,6 +23,6 @@
23/* 23/*
24 * Physical DRAM offset. 24 * Physical DRAM offset.
25 */ 25 */
26#define PHYS_OFFSET UL(0x00000000) 26#define PLAT_PHYS_OFFSET UL(0x00000000)
27 27
28#endif 28#endif
diff --git a/arch/arm/mach-versatile/versatile_ab.c b/arch/arm/mach-versatile/versatile_ab.c
index aa9730fb13bf..f8ae64b3eed0 100644
--- a/arch/arm/mach-versatile/versatile_ab.c
+++ b/arch/arm/mach-versatile/versatile_ab.c
@@ -37,6 +37,7 @@ MACHINE_START(VERSATILE_AB, "ARM-Versatile AB")
37 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 37 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
38 .boot_params = 0x00000100, 38 .boot_params = 0x00000100,
39 .map_io = versatile_map_io, 39 .map_io = versatile_map_io,
40 .init_early = versatile_init_early,
40 .init_irq = versatile_init_irq, 41 .init_irq = versatile_init_irq,
41 .timer = &versatile_timer, 42 .timer = &versatile_timer,
42 .init_machine = versatile_init, 43 .init_machine = versatile_init,
diff --git a/arch/arm/mach-versatile/versatile_pb.c b/arch/arm/mach-versatile/versatile_pb.c
index bf469642a3f8..37c23dfeefb7 100644
--- a/arch/arm/mach-versatile/versatile_pb.c
+++ b/arch/arm/mach-versatile/versatile_pb.c
@@ -59,19 +59,14 @@ static struct pl061_platform_data gpio3_plat_data = {
59}; 59};
60 60
61#define UART3_IRQ { IRQ_SIC_UART3, NO_IRQ } 61#define UART3_IRQ { IRQ_SIC_UART3, NO_IRQ }
62#define UART3_DMA { 0x86, 0x87 }
63#define SCI1_IRQ { IRQ_SIC_SCI3, NO_IRQ } 62#define SCI1_IRQ { IRQ_SIC_SCI3, NO_IRQ }
64#define SCI1_DMA { 0x88, 0x89 }
65#define MMCI1_IRQ { IRQ_MMCI1A, IRQ_SIC_MMCI1B } 63#define MMCI1_IRQ { IRQ_MMCI1A, IRQ_SIC_MMCI1B }
66#define MMCI1_DMA { 0x85, 0 }
67 64
68/* 65/*
69 * These devices are connected via the core APB bridge 66 * These devices are connected via the core APB bridge
70 */ 67 */
71#define GPIO2_IRQ { IRQ_GPIOINT2, NO_IRQ } 68#define GPIO2_IRQ { IRQ_GPIOINT2, NO_IRQ }
72#define GPIO2_DMA { 0, 0 }
73#define GPIO3_IRQ { IRQ_GPIOINT3, NO_IRQ } 69#define GPIO3_IRQ { IRQ_GPIOINT3, NO_IRQ }
74#define GPIO3_DMA { 0, 0 }
75 70
76/* 71/*
77 * These devices are connected via the DMA APB bridge 72 * These devices are connected via the DMA APB bridge
@@ -110,6 +105,7 @@ MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
110 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 105 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
111 .boot_params = 0x00000100, 106 .boot_params = 0x00000100,
112 .map_io = versatile_map_io, 107 .map_io = versatile_map_io,
108 .init_early = versatile_init_early,
113 .init_irq = versatile_init_irq, 109 .init_irq = versatile_init_irq,
114 .timer = &versatile_timer, 110 .timer = &versatile_timer,
115 .init_machine = versatile_pb_init, 111 .init_machine = versatile_pb_init,
diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
index 3f19b660a165..931148487f0b 100644
--- a/arch/arm/mach-vexpress/Kconfig
+++ b/arch/arm/mach-vexpress/Kconfig
@@ -5,5 +5,8 @@ config ARCH_VEXPRESS_CA9X4
5 bool "Versatile Express Cortex-A9x4 tile" 5 bool "Versatile Express Cortex-A9x4 tile"
6 select CPU_V7 6 select CPU_V7
7 select ARM_GIC 7 select ARM_GIC
8 select ARM_ERRATA_720789
9 select ARM_ERRATA_751472
10 select ARM_ERRATA_753970
8 11
9endmenu 12endmenu
diff --git a/arch/arm/mach-vexpress/Makefile b/arch/arm/mach-vexpress/Makefile
index 2c0ac7de2814..90551b9780ab 100644
--- a/arch/arm/mach-vexpress/Makefile
+++ b/arch/arm/mach-vexpress/Makefile
@@ -4,6 +4,5 @@
4 4
5obj-y := v2m.o 5obj-y := v2m.o
6obj-$(CONFIG_ARCH_VEXPRESS_CA9X4) += ct-ca9x4.o 6obj-$(CONFIG_ARCH_VEXPRESS_CA9X4) += ct-ca9x4.o
7obj-$(CONFIG_SMP) += platsmp.o headsmp.o 7obj-$(CONFIG_SMP) += platsmp.o
8obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 8obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
9obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
diff --git a/arch/arm/mach-vexpress/core.h b/arch/arm/mach-vexpress/core.h
index 362780d868de..f4397159c173 100644
--- a/arch/arm/mach-vexpress/core.h
+++ b/arch/arm/mach-vexpress/core.h
@@ -17,8 +17,3 @@ struct amba_device name##_device = { \
17 .irq = IRQ_##base, \ 17 .irq = IRQ_##base, \
18 /* .dma = DMA_##base,*/ \ 18 /* .dma = DMA_##base,*/ \
19} 19}
20
21struct map_desc;
22
23void v2m_map_io(struct map_desc *tile, size_t num);
24extern struct sys_timer v2m_timer;
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
index e628402b754c..ebc22e759325 100644
--- a/arch/arm/mach-vexpress/ct-ca9x4.c
+++ b/arch/arm/mach-vexpress/ct-ca9x4.c
@@ -10,19 +10,17 @@
10#include <linux/amba/clcd.h> 10#include <linux/amba/clcd.h>
11#include <linux/clkdev.h> 11#include <linux/clkdev.h>
12 12
13#include <asm/pgtable.h>
14#include <asm/hardware/arm_timer.h> 13#include <asm/hardware/arm_timer.h>
15#include <asm/hardware/cache-l2x0.h> 14#include <asm/hardware/cache-l2x0.h>
16#include <asm/hardware/gic.h> 15#include <asm/hardware/gic.h>
17#include <asm/mach-types.h>
18#include <asm/pmu.h> 16#include <asm/pmu.h>
17#include <asm/smp_scu.h>
19#include <asm/smp_twd.h> 18#include <asm/smp_twd.h>
20 19
21#include <mach/ct-ca9x4.h> 20#include <mach/ct-ca9x4.h>
22 21
23#include <asm/hardware/timer-sp.h> 22#include <asm/hardware/timer-sp.h>
24 23
25#include <asm/mach/arch.h>
26#include <asm/mach/map.h> 24#include <asm/mach/map.h>
27#include <asm/mach/time.h> 25#include <asm/mach/time.h>
28 26
@@ -30,6 +28,8 @@
30 28
31#include <mach/motherboard.h> 29#include <mach/motherboard.h>
32 30
31#include <plat/clcd.h>
32
33#define V2M_PA_CS7 0x10000000 33#define V2M_PA_CS7 0x10000000
34 34
35static struct map_desc ct_ca9x4_io_desc[] __initdata = { 35static struct map_desc ct_ca9x4_io_desc[] __initdata = {
@@ -56,7 +56,7 @@ static void __init ct_ca9x4_map_io(void)
56#ifdef CONFIG_LOCAL_TIMERS 56#ifdef CONFIG_LOCAL_TIMERS
57 twd_base = MMIO_P2V(A9_MPCORE_TWD); 57 twd_base = MMIO_P2V(A9_MPCORE_TWD);
58#endif 58#endif
59 v2m_map_io(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc)); 59 iotable_init(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc));
60} 60}
61 61
62static void __init ct_ca9x4_init_irq(void) 62static void __init ct_ca9x4_init_irq(void)
@@ -80,29 +80,6 @@ static struct sys_timer ct_ca9x4_timer = {
80}; 80};
81#endif 81#endif
82 82
83static struct clcd_panel xvga_panel = {
84 .mode = {
85 .name = "XVGA",
86 .refresh = 60,
87 .xres = 1024,
88 .yres = 768,
89 .pixclock = 15384,
90 .left_margin = 168,
91 .right_margin = 8,
92 .upper_margin = 29,
93 .lower_margin = 3,
94 .hsync_len = 144,
95 .vsync_len = 6,
96 .sync = 0,
97 .vmode = FB_VMODE_NONINTERLACED,
98 },
99 .width = -1,
100 .height = -1,
101 .tim2 = TIM2_BCD | TIM2_IPC,
102 .cntl = CNTL_LCDTFT | CNTL_BGR | CNTL_LCDVCOMP(1),
103 .bpp = 16,
104};
105
106static void ct_ca9x4_clcd_enable(struct clcd_fb *fb) 83static void ct_ca9x4_clcd_enable(struct clcd_fb *fb)
107{ 84{
108 v2m_cfg_write(SYS_CFG_MUXFPGA | SYS_CFG_SITE_DB1, 0); 85 v2m_cfg_write(SYS_CFG_MUXFPGA | SYS_CFG_SITE_DB1, 0);
@@ -112,42 +89,23 @@ static void ct_ca9x4_clcd_enable(struct clcd_fb *fb)
112static int ct_ca9x4_clcd_setup(struct clcd_fb *fb) 89static int ct_ca9x4_clcd_setup(struct clcd_fb *fb)
113{ 90{
114 unsigned long framesize = 1024 * 768 * 2; 91 unsigned long framesize = 1024 * 768 * 2;
115 dma_addr_t dma;
116 92
117 fb->panel = &xvga_panel; 93 fb->panel = versatile_clcd_get_panel("XVGA");
94 if (!fb->panel)
95 return -EINVAL;
118 96
119 fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize, 97 return versatile_clcd_setup_dma(fb, framesize);
120 &dma, GFP_KERNEL);
121 if (!fb->fb.screen_base) {
122 printk(KERN_ERR "CLCD: unable to map frame buffer\n");
123 return -ENOMEM;
124 }
125 fb->fb.fix.smem_start = dma;
126 fb->fb.fix.smem_len = framesize;
127
128 return 0;
129}
130
131static int ct_ca9x4_clcd_mmap(struct clcd_fb *fb, struct vm_area_struct *vma)
132{
133 return dma_mmap_writecombine(&fb->dev->dev, vma, fb->fb.screen_base,
134 fb->fb.fix.smem_start, fb->fb.fix.smem_len);
135}
136
137static void ct_ca9x4_clcd_remove(struct clcd_fb *fb)
138{
139 dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len,
140 fb->fb.screen_base, fb->fb.fix.smem_start);
141} 98}
142 99
143static struct clcd_board ct_ca9x4_clcd_data = { 100static struct clcd_board ct_ca9x4_clcd_data = {
144 .name = "CT-CA9X4", 101 .name = "CT-CA9X4",
102 .caps = CLCD_CAP_5551 | CLCD_CAP_565,
145 .check = clcdfb_check, 103 .check = clcdfb_check,
146 .decode = clcdfb_decode, 104 .decode = clcdfb_decode,
147 .enable = ct_ca9x4_clcd_enable, 105 .enable = ct_ca9x4_clcd_enable,
148 .setup = ct_ca9x4_clcd_setup, 106 .setup = ct_ca9x4_clcd_setup,
149 .mmap = ct_ca9x4_clcd_mmap, 107 .mmap = versatile_clcd_mmap_dma,
150 .remove = ct_ca9x4_clcd_remove, 108 .remove = versatile_clcd_remove_dma,
151}; 109};
152 110
153static AMBA_DEVICE(clcd, "ct:clcd", CT_CA9X4_CLCDC, &ct_ca9x4_clcd_data); 111static AMBA_DEVICE(clcd, "ct:clcd", CT_CA9X4_CLCDC, &ct_ca9x4_clcd_data);
@@ -220,6 +178,11 @@ static struct platform_device pmu_device = {
220 .resource = pmu_resources, 178 .resource = pmu_resources,
221}; 179};
222 180
181static void __init ct_ca9x4_init_early(void)
182{
183 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
184}
185
223static void __init ct_ca9x4_init(void) 186static void __init ct_ca9x4_init(void)
224{ 187{
225 int i; 188 int i;
@@ -234,22 +197,40 @@ static void __init ct_ca9x4_init(void)
234 l2x0_init(l2x0_base, 0x00400000, 0xfe0fffff); 197 l2x0_init(l2x0_base, 0x00400000, 0xfe0fffff);
235#endif 198#endif
236 199
237 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
238
239 for (i = 0; i < ARRAY_SIZE(ct_ca9x4_amba_devs); i++) 200 for (i = 0; i < ARRAY_SIZE(ct_ca9x4_amba_devs); i++)
240 amba_device_register(ct_ca9x4_amba_devs[i], &iomem_resource); 201 amba_device_register(ct_ca9x4_amba_devs[i], &iomem_resource);
241 202
242 platform_device_register(&pmu_device); 203 platform_device_register(&pmu_device);
243} 204}
244 205
245MACHINE_START(VEXPRESS, "ARM-Versatile Express CA9x4") 206#ifdef CONFIG_SMP
246 .boot_params = PHYS_OFFSET + 0x00000100, 207static void ct_ca9x4_init_cpu_map(void)
208{
209 int i, ncores = scu_get_core_count(MMIO_P2V(A9_MPCORE_SCU));
210
211 for (i = 0; i < ncores; ++i)
212 set_cpu_possible(i, true);
213}
214
215static void ct_ca9x4_smp_enable(unsigned int max_cpus)
216{
217 int i;
218 for (i = 0; i < max_cpus; i++)
219 set_cpu_present(i, true);
220
221 scu_enable(MMIO_P2V(A9_MPCORE_SCU));
222}
223#endif
224
225struct ct_desc ct_ca9x4_desc __initdata = {
226 .id = V2M_CT_ID_CA9,
227 .name = "CA9x4",
247 .map_io = ct_ca9x4_map_io, 228 .map_io = ct_ca9x4_map_io,
229 .init_early = ct_ca9x4_init_early,
248 .init_irq = ct_ca9x4_init_irq, 230 .init_irq = ct_ca9x4_init_irq,
249#if 0 231 .init_tile = ct_ca9x4_init,
250 .timer = &ct_ca9x4_timer, 232#ifdef CONFIG_SMP
251#else 233 .init_cpu_map = ct_ca9x4_init_cpu_map,
252 .timer = &v2m_timer, 234 .smp_enable = ct_ca9x4_smp_enable,
253#endif 235#endif
254 .init_machine = ct_ca9x4_init, 236};
255MACHINE_END
diff --git a/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h b/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h
index f9e2f8d22962..a34d3d4faae1 100644
--- a/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h
+++ b/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h
@@ -45,4 +45,6 @@
45#define IRQ_CT_CA9X4_PMU_CPU2 94 45#define IRQ_CT_CA9X4_PMU_CPU2 94
46#define IRQ_CT_CA9X4_PMU_CPU3 95 46#define IRQ_CT_CA9X4_PMU_CPU3 95
47 47
48extern struct ct_desc ct_ca9x4_desc;
49
48#endif 50#endif
diff --git a/arch/arm/mach-vexpress/include/mach/memory.h b/arch/arm/mach-vexpress/include/mach/memory.h
index be28232ae639..5b7fcd439d87 100644
--- a/arch/arm/mach-vexpress/include/mach/memory.h
+++ b/arch/arm/mach-vexpress/include/mach/memory.h
@@ -20,6 +20,6 @@
20#ifndef __ASM_ARCH_MEMORY_H 20#ifndef __ASM_ARCH_MEMORY_H
21#define __ASM_ARCH_MEMORY_H 21#define __ASM_ARCH_MEMORY_H
22 22
23#define PHYS_OFFSET UL(0x60000000) 23#define PLAT_PHYS_OFFSET UL(0x60000000)
24 24
25#endif 25#endif
diff --git a/arch/arm/mach-vexpress/include/mach/motherboard.h b/arch/arm/mach-vexpress/include/mach/motherboard.h
index 98a8ded055bf..0a3a37518405 100644
--- a/arch/arm/mach-vexpress/include/mach/motherboard.h
+++ b/arch/arm/mach-vexpress/include/mach/motherboard.h
@@ -118,4 +118,26 @@
118int v2m_cfg_write(u32 devfn, u32 data); 118int v2m_cfg_write(u32 devfn, u32 data);
119int v2m_cfg_read(u32 devfn, u32 *data); 119int v2m_cfg_read(u32 devfn, u32 *data);
120 120
121/*
122 * Core tile IDs
123 */
124#define V2M_CT_ID_CA9 0x0c000191
125#define V2M_CT_ID_UNSUPPORTED 0xff000191
126#define V2M_CT_ID_MASK 0xff000fff
127
128struct ct_desc {
129 u32 id;
130 const char *name;
131 void (*map_io)(void);
132 void (*init_early)(void);
133 void (*init_irq)(void);
134 void (*init_tile)(void);
135#ifdef CONFIG_SMP
136 void (*init_cpu_map)(void);
137 void (*smp_enable)(unsigned int);
138#endif
139};
140
141extern struct ct_desc *ct_desc;
142
121#endif 143#endif
diff --git a/arch/arm/mach-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c
index b1687b6abe63..2b5f7ac001a3 100644
--- a/arch/arm/mach-vexpress/platsmp.c
+++ b/arch/arm/mach-vexpress/platsmp.c
@@ -10,114 +10,17 @@
10 */ 10 */
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/errno.h> 12#include <linux/errno.h>
13#include <linux/delay.h>
14#include <linux/device.h>
15#include <linux/jiffies.h>
16#include <linux/smp.h> 13#include <linux/smp.h>
17#include <linux/io.h> 14#include <linux/io.h>
18 15
19#include <asm/cacheflush.h>
20#include <asm/smp_scu.h>
21#include <asm/unified.h> 16#include <asm/unified.h>
22 17
23#include <mach/ct-ca9x4.h>
24#include <mach/motherboard.h> 18#include <mach/motherboard.h>
25#define V2M_PA_CS7 0x10000000 19#define V2M_PA_CS7 0x10000000
26 20
27#include "core.h" 21#include "core.h"
28 22
29extern void vexpress_secondary_startup(void); 23extern void versatile_secondary_startup(void);
30
31/*
32 * control for which core is the next to come out of the secondary
33 * boot "holding pen"
34 */
35volatile int __cpuinitdata pen_release = -1;
36
37/*
38 * Write pen_release in a way that is guaranteed to be visible to all
39 * observers, irrespective of whether they're taking part in coherency
40 * or not. This is necessary for the hotplug code to work reliably.
41 */
42static void write_pen_release(int val)
43{
44 pen_release = val;
45 smp_wmb();
46 __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
47 outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
48}
49
50static void __iomem *scu_base_addr(void)
51{
52 return MMIO_P2V(A9_MPCORE_SCU);
53}
54
55static DEFINE_SPINLOCK(boot_lock);
56
57void __cpuinit platform_secondary_init(unsigned int cpu)
58{
59 /*
60 * if any interrupts are already enabled for the primary
61 * core (e.g. timer irq), then they will not have been enabled
62 * for us: do so
63 */
64 gic_secondary_init(0);
65
66 /*
67 * let the primary processor know we're out of the
68 * pen, then head off into the C entry point
69 */
70 write_pen_release(-1);
71
72 /*
73 * Synchronise with the boot thread.
74 */
75 spin_lock(&boot_lock);
76 spin_unlock(&boot_lock);
77}
78
79int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
80{
81 unsigned long timeout;
82
83 /*
84 * Set synchronisation state between this boot processor
85 * and the secondary one
86 */
87 spin_lock(&boot_lock);
88
89 /*
90 * This is really belt and braces; we hold unintended secondary
91 * CPUs in the holding pen until we're ready for them. However,
92 * since we haven't sent them a soft interrupt, they shouldn't
93 * be there.
94 */
95 write_pen_release(cpu);
96
97 /*
98 * Send the secondary CPU a soft interrupt, thereby causing
99 * the boot monitor to read the system wide flags register,
100 * and branch to the address found there.
101 */
102 smp_cross_call(cpumask_of(cpu), 1);
103
104 timeout = jiffies + (1 * HZ);
105 while (time_before(jiffies, timeout)) {
106 smp_rmb();
107 if (pen_release == -1)
108 break;
109
110 udelay(10);
111 }
112
113 /*
114 * now the secondary core is starting up let it run its
115 * calibrations, then wait for it to finish
116 */
117 spin_unlock(&boot_lock);
118
119 return pen_release != -1 ? -ENOSYS : 0;
120}
121 24
122/* 25/*
123 * Initialise the CPU possible map early - this describes the CPUs 26 * Initialise the CPU possible map early - this describes the CPUs
@@ -125,36 +28,16 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
125 */ 28 */
126void __init smp_init_cpus(void) 29void __init smp_init_cpus(void)
127{ 30{
128 void __iomem *scu_base = scu_base_addr(); 31 ct_desc->init_cpu_map();
129 unsigned int i, ncores;
130
131 ncores = scu_base ? scu_get_core_count(scu_base) : 1;
132
133 /* sanity check */
134 if (ncores > NR_CPUS) {
135 printk(KERN_WARNING
136 "vexpress: no. of cores (%d) greater than configured "
137 "maximum of %d - clipping\n",
138 ncores, NR_CPUS);
139 ncores = NR_CPUS;
140 }
141
142 for (i = 0; i < ncores; i++)
143 set_cpu_possible(i, true);
144} 32}
145 33
146void __init platform_smp_prepare_cpus(unsigned int max_cpus) 34void __init platform_smp_prepare_cpus(unsigned int max_cpus)
147{ 35{
148 int i;
149
150 /* 36 /*
151 * Initialise the present map, which describes the set of CPUs 37 * Initialise the present map, which describes the set of CPUs
152 * actually populated at the present time. 38 * actually populated at the present time.
153 */ 39 */
154 for (i = 0; i < max_cpus; i++) 40 ct_desc->smp_enable(max_cpus);
155 set_cpu_present(i, true);
156
157 scu_enable(scu_base_addr());
158 41
159 /* 42 /*
160 * Write the address of secondary startup into the 43 * Write the address of secondary startup into the
@@ -163,6 +46,6 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus)
163 * secondary CPU branches to this address. 46 * secondary CPU branches to this address.
164 */ 47 */
165 writel(~0, MMIO_P2V(V2M_SYS_FLAGSCLR)); 48 writel(~0, MMIO_P2V(V2M_SYS_FLAGSCLR));
166 writel(BSYM(virt_to_phys(vexpress_secondary_startup)), 49 writel(BSYM(virt_to_phys(versatile_secondary_startup)),
167 MMIO_P2V(V2M_SYS_FLAGSSET)); 50 MMIO_P2V(V2M_SYS_FLAGSSET));
168} 51}
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index a9ed3428a2fa..ba46e8e07437 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -7,19 +7,24 @@
7#include <linux/io.h> 7#include <linux/io.h>
8#include <linux/init.h> 8#include <linux/init.h>
9#include <linux/platform_device.h> 9#include <linux/platform_device.h>
10#include <linux/ata_platform.h>
10#include <linux/smsc911x.h> 11#include <linux/smsc911x.h>
11#include <linux/spinlock.h> 12#include <linux/spinlock.h>
12#include <linux/sysdev.h> 13#include <linux/sysdev.h>
13#include <linux/usb/isp1760.h> 14#include <linux/usb/isp1760.h>
14#include <linux/clkdev.h> 15#include <linux/clkdev.h>
15 16
17#include <asm/mach-types.h>
16#include <asm/sizes.h> 18#include <asm/sizes.h>
19#include <asm/mach/arch.h>
17#include <asm/mach/flash.h> 20#include <asm/mach/flash.h>
18#include <asm/mach/map.h> 21#include <asm/mach/map.h>
19#include <asm/mach/time.h> 22#include <asm/mach/time.h>
20#include <asm/hardware/arm_timer.h> 23#include <asm/hardware/arm_timer.h>
21#include <asm/hardware/timer-sp.h> 24#include <asm/hardware/timer-sp.h>
25#include <asm/hardware/sp810.h>
22 26
27#include <mach/ct-ca9x4.h>
23#include <mach/motherboard.h> 28#include <mach/motherboard.h>
24 29
25#include <plat/sched_clock.h> 30#include <plat/sched_clock.h>
@@ -41,16 +46,21 @@ static struct map_desc v2m_io_desc[] __initdata = {
41 }, 46 },
42}; 47};
43 48
44void __init v2m_map_io(struct map_desc *tile, size_t num) 49static void __init v2m_init_early(void)
45{ 50{
46 iotable_init(v2m_io_desc, ARRAY_SIZE(v2m_io_desc)); 51 ct_desc->init_early();
47 iotable_init(tile, num); 52 versatile_sched_clock_init(MMIO_P2V(V2M_SYS_24MHZ), 24000000);
48} 53}
49 54
50
51static void __init v2m_timer_init(void) 55static void __init v2m_timer_init(void)
52{ 56{
53 versatile_sched_clock_init(MMIO_P2V(V2M_SYS_24MHZ), 24000000); 57 u32 scctrl;
58
59 /* Select 1MHz TIMCLK as the reference clock for SP804 timers */
60 scctrl = readl(MMIO_P2V(V2M_SYSCTL + SCCTRL));
61 scctrl |= SCCTRL_TIMEREN0SEL_TIMCLK;
62 scctrl |= SCCTRL_TIMEREN1SEL_TIMCLK;
63 writel(scctrl, MMIO_P2V(V2M_SYSCTL + SCCTRL));
54 64
55 writel(0, MMIO_P2V(V2M_TIMER0) + TIMER_CTRL); 65 writel(0, MMIO_P2V(V2M_TIMER0) + TIMER_CTRL);
56 writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL); 66 writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL);
@@ -59,7 +69,7 @@ static void __init v2m_timer_init(void)
59 sp804_clockevents_init(MMIO_P2V(V2M_TIMER0), IRQ_V2M_TIMER0); 69 sp804_clockevents_init(MMIO_P2V(V2M_TIMER0), IRQ_V2M_TIMER0);
60} 70}
61 71
62struct sys_timer v2m_timer = { 72static struct sys_timer v2m_timer = {
63 .init = v2m_timer_init, 73 .init = v2m_timer_init,
64}; 74};
65 75
@@ -240,6 +250,29 @@ static struct platform_device v2m_flash_device = {
240 .dev.platform_data = &v2m_flash_data, 250 .dev.platform_data = &v2m_flash_data,
241}; 251};
242 252
253static struct pata_platform_info v2m_pata_data = {
254 .ioport_shift = 2,
255};
256
257static struct resource v2m_pata_resources[] = {
258 {
259 .start = V2M_CF,
260 .end = V2M_CF + 0xff,
261 .flags = IORESOURCE_MEM,
262 }, {
263 .start = V2M_CF + 0x100,
264 .end = V2M_CF + SZ_4K - 1,
265 .flags = IORESOURCE_MEM,
266 },
267};
268
269static struct platform_device v2m_cf_device = {
270 .name = "pata_platform",
271 .id = -1,
272 .resource = v2m_pata_resources,
273 .num_resources = ARRAY_SIZE(v2m_pata_resources),
274 .dev.platform_data = &v2m_pata_data,
275};
243 276
244static unsigned int v2m_mmci_status(struct device *dev) 277static unsigned int v2m_mmci_status(struct device *dev)
245{ 278{
@@ -345,7 +378,44 @@ static void v2m_restart(char str, const char *cmd)
345 printk(KERN_EMERG "Unable to reboot\n"); 378 printk(KERN_EMERG "Unable to reboot\n");
346} 379}
347 380
348static int __init v2m_init(void) 381struct ct_desc *ct_desc;
382
383static struct ct_desc *ct_descs[] __initdata = {
384#ifdef CONFIG_ARCH_VEXPRESS_CA9X4
385 &ct_ca9x4_desc,
386#endif
387};
388
389static void __init v2m_populate_ct_desc(void)
390{
391 int i;
392 u32 current_tile_id;
393
394 ct_desc = NULL;
395 current_tile_id = readl(MMIO_P2V(V2M_SYS_PROCID0)) & V2M_CT_ID_MASK;
396
397 for (i = 0; i < ARRAY_SIZE(ct_descs) && !ct_desc; ++i)
398 if (ct_descs[i]->id == current_tile_id)
399 ct_desc = ct_descs[i];
400
401 if (!ct_desc)
402 panic("vexpress: failed to populate core tile description "
403 "for tile ID 0x%8x\n", current_tile_id);
404}
405
406static void __init v2m_map_io(void)
407{
408 iotable_init(v2m_io_desc, ARRAY_SIZE(v2m_io_desc));
409 v2m_populate_ct_desc();
410 ct_desc->map_io();
411}
412
413static void __init v2m_init_irq(void)
414{
415 ct_desc->init_irq();
416}
417
418static void __init v2m_init(void)
349{ 419{
350 int i; 420 int i;
351 421
@@ -354,6 +424,7 @@ static int __init v2m_init(void)
354 platform_device_register(&v2m_pcie_i2c_device); 424 platform_device_register(&v2m_pcie_i2c_device);
355 platform_device_register(&v2m_ddc_i2c_device); 425 platform_device_register(&v2m_ddc_i2c_device);
356 platform_device_register(&v2m_flash_device); 426 platform_device_register(&v2m_flash_device);
427 platform_device_register(&v2m_cf_device);
357 platform_device_register(&v2m_eth_device); 428 platform_device_register(&v2m_eth_device);
358 platform_device_register(&v2m_usb_device); 429 platform_device_register(&v2m_usb_device);
359 430
@@ -363,6 +434,14 @@ static int __init v2m_init(void)
363 pm_power_off = v2m_power_off; 434 pm_power_off = v2m_power_off;
364 arm_pm_restart = v2m_restart; 435 arm_pm_restart = v2m_restart;
365 436
366 return 0; 437 ct_desc->init_tile();
367} 438}
368arch_initcall(v2m_init); 439
440MACHINE_START(VEXPRESS, "ARM-Versatile Express")
441 .boot_params = PLAT_PHYS_OFFSET + 0x00000100,
442 .map_io = v2m_map_io,
443 .init_early = v2m_init_early,
444 .init_irq = v2m_init_irq,
445 .timer = &v2m_timer,
446 .init_machine = v2m_init,
447MACHINE_END
diff --git a/arch/arm/mach-vt8500/Kconfig b/arch/arm/mach-vt8500/Kconfig
new file mode 100644
index 000000000000..2c20a341c11a
--- /dev/null
+++ b/arch/arm/mach-vt8500/Kconfig
@@ -0,0 +1,73 @@
1if ARCH_VT8500
2
3config VTWM_VERSION_VT8500
4 bool
5
6config VTWM_VERSION_WM8505
7 bool
8
9config MACH_BV07
10 bool "Benign BV07-8500 Mini Netbook"
11 depends on ARCH_VT8500
12 select VTWM_VERSION_VT8500
13 help
14 Add support for the inexpensive 7-inch netbooks sold by many
15 Chinese distributors under various names. Note that there are
16 many hardware implementations in identical exterior, make sure
17 that yours is indeed based on a VIA VT8500 chip.
18
19config MACH_WM8505_7IN_NETBOOK
20 bool "WM8505 7-inch generic netbook"
21 depends on ARCH_VT8500
22 select VTWM_VERSION_WM8505
23 help
24 Add support for the inexpensive 7-inch netbooks sold by many
25 Chinese distributors under various names. Note that there are
26 many hardware implementations in identical exterior, make sure
27 that yours is indeed based on a WonderMedia WM8505 chip.
28
29comment "LCD panel size"
30
31config WMT_PANEL_800X480
32 bool "7-inch with 800x480 resolution"
33 depends on (FB_VT8500 || FB_WM8505)
34 default y
35 help
36 These are found in most of the netbooks in generic cases, as
37 well as in Eken M001 tablets and possibly elsewhere.
38
39 To select this panel at runtime, say y here and append
40 'panel=800x480' to your kernel command line. Otherwise, the
41 largest one available will be used.
42
43config WMT_PANEL_800X600
44 bool "8-inch with 800x600 resolution"
45 depends on (FB_VT8500 || FB_WM8505)
46 help
47 These are found in Eken M003 tablets and possibly elsewhere.
48
49 To select this panel at runtime, say y here and append
50 'panel=800x600' to your kernel command line. Otherwise, the
51 largest one available will be used.
52
53config WMT_PANEL_1024X576
54 bool "10-inch with 1024x576 resolution"
55 depends on (FB_VT8500 || FB_WM8505)
56 help
57 These are found in CherryPal netbooks and possibly elsewhere.
58
59 To select this panel at runtime, say y here and append
60 'panel=1024x576' to your kernel command line. Otherwise, the
61 largest one available will be used.
62
63config WMT_PANEL_1024X600
64 bool "10-inch with 1024x600 resolution"
65 depends on (FB_VT8500 || FB_WM8505)
66 help
67 These are found in Eken M006 tablets and possibly elsewhere.
68
69 To select this panel at runtime, say y here and append
70 'panel=1024x600' to your kernel command line. Otherwise, the
71 largest one available will be used.
72
73endif
diff --git a/arch/arm/mach-vt8500/Makefile b/arch/arm/mach-vt8500/Makefile
new file mode 100644
index 000000000000..81aedb7c893c
--- /dev/null
+++ b/arch/arm/mach-vt8500/Makefile
@@ -0,0 +1,9 @@
1obj-y += devices.o gpio.o irq.o timer.o
2
3obj-$(CONFIG_VTWM_VERSION_VT8500) += devices-vt8500.o
4obj-$(CONFIG_VTWM_VERSION_WM8505) += devices-wm8505.o
5
6obj-$(CONFIG_MACH_BV07) += bv07.o
7obj-$(CONFIG_MACH_WM8505_7IN_NETBOOK) += wm8505_7in.o
8
9obj-$(CONFIG_HAVE_PWM) += pwm.o
diff --git a/arch/arm/mach-vt8500/Makefile.boot b/arch/arm/mach-vt8500/Makefile.boot
new file mode 100644
index 000000000000..a8acc4e24902
--- /dev/null
+++ b/arch/arm/mach-vt8500/Makefile.boot
@@ -0,0 +1,3 @@
1 zreladdr-y := 0x00008000
2params_phys-y := 0x00000100
3initrd_phys-y := 0x01000000
diff --git a/arch/arm/mach-vt8500/bv07.c b/arch/arm/mach-vt8500/bv07.c
new file mode 100644
index 000000000000..94a261d86bf0
--- /dev/null
+++ b/arch/arm/mach-vt8500/bv07.c
@@ -0,0 +1,77 @@
1/*
2 * arch/arm/mach-vt8500/bv07.c
3 *
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/io.h>
22#include <linux/pm.h>
23
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26
27#include "devices.h"
28
29static void __iomem *pmc_hiber;
30
31static struct platform_device *devices[] __initdata = {
32 &vt8500_device_uart0,
33 &vt8500_device_lcdc,
34 &vt8500_device_ehci,
35 &vt8500_device_ge_rops,
36 &vt8500_device_pwm,
37 &vt8500_device_pwmbl,
38 &vt8500_device_rtc,
39};
40
41static void vt8500_power_off(void)
42{
43 local_irq_disable();
44 writew(5, pmc_hiber);
45 asm("mcr%? p15, 0, %0, c7, c0, 4" : : "r" (0));
46}
47
48void __init bv07_init(void)
49{
50#ifdef CONFIG_FB_VT8500
51 void __iomem *gpio_mux_reg = ioremap(wmt_gpio_base + 0x200, 4);
52 if (gpio_mux_reg) {
53 writel(readl(gpio_mux_reg) | 1, gpio_mux_reg);
54 iounmap(gpio_mux_reg);
55 } else {
56 printk(KERN_ERR "Could not remap the GPIO mux register, display may not work properly!\n");
57 }
58#endif
59 pmc_hiber = ioremap(wmt_pmc_base + 0x12, 2);
60 if (pmc_hiber)
61 pm_power_off = &vt8500_power_off;
62 else
63 printk(KERN_ERR "PMC Hibernation register could not be remapped, not enabling power off!\n");
64
65 vt8500_set_resources();
66 platform_add_devices(devices, ARRAY_SIZE(devices));
67 vt8500_gpio_init();
68}
69
70MACHINE_START(BV07, "Benign BV07 Mini Netbook")
71 .boot_params = 0x00000100,
72 .reserve = vt8500_reserve_mem,
73 .map_io = vt8500_map_io,
74 .init_irq = vt8500_init_irq,
75 .timer = &vt8500_timer,
76 .init_machine = bv07_init,
77MACHINE_END
diff --git a/arch/arm/mach-vt8500/devices-vt8500.c b/arch/arm/mach-vt8500/devices-vt8500.c
new file mode 100644
index 000000000000..19519aeecf37
--- /dev/null
+++ b/arch/arm/mach-vt8500/devices-vt8500.c
@@ -0,0 +1,91 @@
1/* linux/arch/arm/mach-vt8500/devices-vt8500.c
2 *
3 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#include <linux/platform_device.h>
17
18#include <mach/vt8500_regs.h>
19#include <mach/vt8500_irqs.h>
20#include <mach/i8042.h>
21#include "devices.h"
22
23void __init vt8500_set_resources(void)
24{
25 struct resource tmp[3];
26
27 tmp[0] = wmt_mmio_res(VT8500_LCDC_BASE, SZ_1K);
28 tmp[1] = wmt_irq_res(IRQ_LCDC);
29 wmt_res_add(&vt8500_device_lcdc, tmp, 2);
30
31 tmp[0] = wmt_mmio_res(VT8500_UART0_BASE, 0x1040);
32 tmp[1] = wmt_irq_res(IRQ_UART0);
33 wmt_res_add(&vt8500_device_uart0, tmp, 2);
34
35 tmp[0] = wmt_mmio_res(VT8500_UART1_BASE, 0x1040);
36 tmp[1] = wmt_irq_res(IRQ_UART1);
37 wmt_res_add(&vt8500_device_uart1, tmp, 2);
38
39 tmp[0] = wmt_mmio_res(VT8500_UART2_BASE, 0x1040);
40 tmp[1] = wmt_irq_res(IRQ_UART2);
41 wmt_res_add(&vt8500_device_uart2, tmp, 2);
42
43 tmp[0] = wmt_mmio_res(VT8500_UART3_BASE, 0x1040);
44 tmp[1] = wmt_irq_res(IRQ_UART3);
45 wmt_res_add(&vt8500_device_uart3, tmp, 2);
46
47 tmp[0] = wmt_mmio_res(VT8500_EHCI_BASE, SZ_512);
48 tmp[1] = wmt_irq_res(IRQ_EHCI);
49 wmt_res_add(&vt8500_device_ehci, tmp, 2);
50
51 tmp[0] = wmt_mmio_res(VT8500_GEGEA_BASE, SZ_256);
52 wmt_res_add(&vt8500_device_ge_rops, tmp, 1);
53
54 tmp[0] = wmt_mmio_res(VT8500_PWM_BASE, 0x44);
55 wmt_res_add(&vt8500_device_pwm, tmp, 1);
56
57 tmp[0] = wmt_mmio_res(VT8500_RTC_BASE, 0x2c);
58 tmp[1] = wmt_irq_res(IRQ_RTC);
59 tmp[2] = wmt_irq_res(IRQ_RTCSM);
60 wmt_res_add(&vt8500_device_rtc, tmp, 3);
61}
62
63static void __init vt8500_set_externs(void)
64{
65 /* Non-resource-aware stuff */
66 wmt_ic_base = VT8500_IC_BASE;
67 wmt_gpio_base = VT8500_GPIO_BASE;
68 wmt_pmc_base = VT8500_PMC_BASE;
69 wmt_i8042_base = VT8500_PS2_BASE;
70
71 wmt_nr_irqs = VT8500_NR_IRQS;
72 wmt_timer_irq = IRQ_PMCOS0;
73 wmt_gpio_ext_irq[0] = IRQ_EXT0;
74 wmt_gpio_ext_irq[1] = IRQ_EXT1;
75 wmt_gpio_ext_irq[2] = IRQ_EXT2;
76 wmt_gpio_ext_irq[3] = IRQ_EXT3;
77 wmt_gpio_ext_irq[4] = IRQ_EXT4;
78 wmt_gpio_ext_irq[5] = IRQ_EXT5;
79 wmt_gpio_ext_irq[6] = IRQ_EXT6;
80 wmt_gpio_ext_irq[7] = IRQ_EXT7;
81 wmt_i8042_kbd_irq = IRQ_PS2KBD;
82 wmt_i8042_aux_irq = IRQ_PS2MOUSE;
83}
84
85void __init vt8500_map_io(void)
86{
87 iotable_init(wmt_io_desc, ARRAY_SIZE(wmt_io_desc));
88
89 /* Should be done before interrupts and timers are initialized */
90 vt8500_set_externs();
91}
diff --git a/arch/arm/mach-vt8500/devices-wm8505.c b/arch/arm/mach-vt8500/devices-wm8505.c
new file mode 100644
index 000000000000..db4594e029f4
--- /dev/null
+++ b/arch/arm/mach-vt8500/devices-wm8505.c
@@ -0,0 +1,99 @@
1/* linux/arch/arm/mach-vt8500/devices-wm8505.c
2 *
3 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#include <linux/platform_device.h>
17
18#include <mach/wm8505_regs.h>
19#include <mach/wm8505_irqs.h>
20#include <mach/i8042.h>
21#include "devices.h"
22
23void __init wm8505_set_resources(void)
24{
25 struct resource tmp[3];
26
27 tmp[0] = wmt_mmio_res(WM8505_GOVR_BASE, SZ_512);
28 wmt_res_add(&vt8500_device_wm8505_fb, tmp, 1);
29
30 tmp[0] = wmt_mmio_res(WM8505_UART0_BASE, 0x1040);
31 tmp[1] = wmt_irq_res(IRQ_UART0);
32 wmt_res_add(&vt8500_device_uart0, tmp, 2);
33
34 tmp[0] = wmt_mmio_res(WM8505_UART1_BASE, 0x1040);
35 tmp[1] = wmt_irq_res(IRQ_UART1);
36 wmt_res_add(&vt8500_device_uart1, tmp, 2);
37
38 tmp[0] = wmt_mmio_res(WM8505_UART2_BASE, 0x1040);
39 tmp[1] = wmt_irq_res(IRQ_UART2);
40 wmt_res_add(&vt8500_device_uart2, tmp, 2);
41
42 tmp[0] = wmt_mmio_res(WM8505_UART3_BASE, 0x1040);
43 tmp[1] = wmt_irq_res(IRQ_UART3);
44 wmt_res_add(&vt8500_device_uart3, tmp, 2);
45
46 tmp[0] = wmt_mmio_res(WM8505_UART4_BASE, 0x1040);
47 tmp[1] = wmt_irq_res(IRQ_UART4);
48 wmt_res_add(&vt8500_device_uart4, tmp, 2);
49
50 tmp[0] = wmt_mmio_res(WM8505_UART5_BASE, 0x1040);
51 tmp[1] = wmt_irq_res(IRQ_UART5);
52 wmt_res_add(&vt8500_device_uart5, tmp, 2);
53
54 tmp[0] = wmt_mmio_res(WM8505_EHCI_BASE, SZ_512);
55 tmp[1] = wmt_irq_res(IRQ_EHCI);
56 wmt_res_add(&vt8500_device_ehci, tmp, 2);
57
58 tmp[0] = wmt_mmio_res(WM8505_GEGEA_BASE, SZ_256);
59 wmt_res_add(&vt8500_device_ge_rops, tmp, 1);
60
61 tmp[0] = wmt_mmio_res(WM8505_PWM_BASE, 0x44);
62 wmt_res_add(&vt8500_device_pwm, tmp, 1);
63
64 tmp[0] = wmt_mmio_res(WM8505_RTC_BASE, 0x2c);
65 tmp[1] = wmt_irq_res(IRQ_RTC);
66 tmp[2] = wmt_irq_res(IRQ_RTCSM);
67 wmt_res_add(&vt8500_device_rtc, tmp, 3);
68}
69
70static void __init wm8505_set_externs(void)
71{
72 /* Non-resource-aware stuff */
73 wmt_ic_base = WM8505_IC_BASE;
74 wmt_sic_base = WM8505_SIC_BASE;
75 wmt_gpio_base = WM8505_GPIO_BASE;
76 wmt_pmc_base = WM8505_PMC_BASE;
77 wmt_i8042_base = WM8505_PS2_BASE;
78
79 wmt_nr_irqs = WM8505_NR_IRQS;
80 wmt_timer_irq = IRQ_PMCOS0;
81 wmt_gpio_ext_irq[0] = IRQ_EXT0;
82 wmt_gpio_ext_irq[1] = IRQ_EXT1;
83 wmt_gpio_ext_irq[2] = IRQ_EXT2;
84 wmt_gpio_ext_irq[3] = IRQ_EXT3;
85 wmt_gpio_ext_irq[4] = IRQ_EXT4;
86 wmt_gpio_ext_irq[5] = IRQ_EXT5;
87 wmt_gpio_ext_irq[6] = IRQ_EXT6;
88 wmt_gpio_ext_irq[7] = IRQ_EXT7;
89 wmt_i8042_kbd_irq = IRQ_PS2KBD;
90 wmt_i8042_aux_irq = IRQ_PS2MOUSE;
91}
92
93void __init wm8505_map_io(void)
94{
95 iotable_init(wmt_io_desc, ARRAY_SIZE(wmt_io_desc));
96
97 /* Should be done before interrupts and timers are initialized */
98 wm8505_set_externs();
99}
diff --git a/arch/arm/mach-vt8500/devices.c b/arch/arm/mach-vt8500/devices.c
new file mode 100644
index 000000000000..1fcdc36b358d
--- /dev/null
+++ b/arch/arm/mach-vt8500/devices.c
@@ -0,0 +1,270 @@
1/* linux/arch/arm/mach-vt8500/devices.c
2 *
3 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#include <linux/kernel.h>
17#include <linux/io.h>
18#include <linux/device.h>
19#include <linux/dma-mapping.h>
20#include <linux/platform_device.h>
21#include <linux/pwm_backlight.h>
22#include <linux/memblock.h>
23
24#include <asm/mach/arch.h>
25
26#include <mach/vt8500fb.h>
27#include <mach/i8042.h>
28#include "devices.h"
29
30/* These can't use resources currently */
31unsigned long wmt_ic_base __initdata;
32unsigned long wmt_sic_base __initdata;
33unsigned long wmt_gpio_base __initdata;
34unsigned long wmt_pmc_base __initdata;
35unsigned long wmt_i8042_base __initdata;
36
37int wmt_nr_irqs __initdata;
38int wmt_timer_irq __initdata;
39int wmt_gpio_ext_irq[8] __initdata;
40
41/* Should remain accessible after init.
42 * i8042 driver desperately calls for attention...
43 */
44int wmt_i8042_kbd_irq;
45int wmt_i8042_aux_irq;
46
47static u64 fb_dma_mask = DMA_BIT_MASK(32);
48
49struct platform_device vt8500_device_lcdc = {
50 .name = "vt8500-lcd",
51 .id = 0,
52 .dev = {
53 .dma_mask = &fb_dma_mask,
54 .coherent_dma_mask = DMA_BIT_MASK(32),
55 },
56};
57
58struct platform_device vt8500_device_wm8505_fb = {
59 .name = "wm8505-fb",
60 .id = 0,
61};
62
63/* Smallest to largest */
64static struct vt8500fb_platform_data panels[] = {
65#ifdef CONFIG_WMT_PANEL_800X480
66{
67 .xres_virtual = 800,
68 .yres_virtual = 480 * 2,
69 .mode = {
70 .name = "800x480",
71 .xres = 800,
72 .yres = 480,
73 .left_margin = 88,
74 .right_margin = 40,
75 .upper_margin = 32,
76 .lower_margin = 11,
77 .hsync_len = 0,
78 .vsync_len = 1,
79 .vmode = FB_VMODE_NONINTERLACED,
80 },
81},
82#endif
83#ifdef CONFIG_WMT_PANEL_800X600
84{
85 .xres_virtual = 800,
86 .yres_virtual = 600 * 2,
87 .mode = {
88 .name = "800x600",
89 .xres = 800,
90 .yres = 600,
91 .left_margin = 88,
92 .right_margin = 40,
93 .upper_margin = 32,
94 .lower_margin = 11,
95 .hsync_len = 0,
96 .vsync_len = 1,
97 .vmode = FB_VMODE_NONINTERLACED,
98 },
99},
100#endif
101#ifdef CONFIG_WMT_PANEL_1024X576
102{
103 .xres_virtual = 1024,
104 .yres_virtual = 576 * 2,
105 .mode = {
106 .name = "1024x576",
107 .xres = 1024,
108 .yres = 576,
109 .left_margin = 40,
110 .right_margin = 24,
111 .upper_margin = 32,
112 .lower_margin = 11,
113 .hsync_len = 96,
114 .vsync_len = 2,
115 .vmode = FB_VMODE_NONINTERLACED,
116 },
117},
118#endif
119#ifdef CONFIG_WMT_PANEL_1024X600
120{
121 .xres_virtual = 1024,
122 .yres_virtual = 600 * 2,
123 .mode = {
124 .name = "1024x600",
125 .xres = 1024,
126 .yres = 600,
127 .left_margin = 66,
128 .right_margin = 2,
129 .upper_margin = 19,
130 .lower_margin = 1,
131 .hsync_len = 23,
132 .vsync_len = 8,
133 .vmode = FB_VMODE_NONINTERLACED,
134 },
135},
136#endif
137};
138
139static int current_panel_idx __initdata = ARRAY_SIZE(panels) - 1;
140
141static int __init panel_setup(char *str)
142{
143 int i;
144
145 for (i = 0; i < ARRAY_SIZE(panels); i++) {
146 if (strcmp(panels[i].mode.name, str) == 0) {
147 current_panel_idx = i;
148 break;
149 }
150 }
151 return 0;
152}
153
154early_param("panel", panel_setup);
155
156static inline void preallocate_fb(struct vt8500fb_platform_data *p,
157 unsigned long align) {
158 p->video_mem_len = (p->xres_virtual * p->yres_virtual * 4) >>
159 (p->bpp > 16 ? 0 : (p->bpp > 8 ? 1 :
160 (8 / p->bpp) + 1));
161 p->video_mem_phys = (unsigned long)memblock_alloc(p->video_mem_len,
162 align);
163 p->video_mem_virt = phys_to_virt(p->video_mem_phys);
164}
165
166struct platform_device vt8500_device_uart0 = {
167 .name = "vt8500_serial",
168 .id = 0,
169};
170
171struct platform_device vt8500_device_uart1 = {
172 .name = "vt8500_serial",
173 .id = 1,
174};
175
176struct platform_device vt8500_device_uart2 = {
177 .name = "vt8500_serial",
178 .id = 2,
179};
180
181struct platform_device vt8500_device_uart3 = {
182 .name = "vt8500_serial",
183 .id = 3,
184};
185
186struct platform_device vt8500_device_uart4 = {
187 .name = "vt8500_serial",
188 .id = 4,
189};
190
191struct platform_device vt8500_device_uart5 = {
192 .name = "vt8500_serial",
193 .id = 5,
194};
195
196static u64 ehci_dma_mask = DMA_BIT_MASK(32);
197
198struct platform_device vt8500_device_ehci = {
199 .name = "vt8500-ehci",
200 .id = 0,
201 .dev = {
202 .dma_mask = &ehci_dma_mask,
203 .coherent_dma_mask = DMA_BIT_MASK(32),
204 },
205};
206
207struct platform_device vt8500_device_ge_rops = {
208 .name = "wmt_ge_rops",
209 .id = -1,
210};
211
212struct platform_device vt8500_device_pwm = {
213 .name = "vt8500-pwm",
214 .id = 0,
215};
216
217static struct platform_pwm_backlight_data vt8500_pwmbl_data = {
218 .pwm_id = 0,
219 .max_brightness = 128,
220 .dft_brightness = 70,
221 .pwm_period_ns = 250000, /* revisit when clocks are implemented */
222};
223
224struct platform_device vt8500_device_pwmbl = {
225 .name = "pwm-backlight",
226 .id = 0,
227 .dev = {
228 .platform_data = &vt8500_pwmbl_data,
229 },
230};
231
232struct platform_device vt8500_device_rtc = {
233 .name = "vt8500-rtc",
234 .id = 0,
235};
236
237struct map_desc wmt_io_desc[] __initdata = {
238 /* SoC MMIO registers */
239 [0] = {
240 .virtual = 0xf8000000,
241 .pfn = __phys_to_pfn(0xd8000000),
242 .length = 0x00390000, /* max of all chip variants */
243 .type = MT_DEVICE
244 },
245 /* PCI I/O space, numbers tied to those in <mach/io.h> */
246 [1] = {
247 .virtual = 0xf0000000,
248 .pfn = __phys_to_pfn(0xc0000000),
249 .length = SZ_64K,
250 .type = MT_DEVICE
251 },
252};
253
254void __init vt8500_reserve_mem(void)
255{
256#ifdef CONFIG_FB_VT8500
257 panels[current_panel_idx].bpp = 16; /* Always use RGB565 */
258 preallocate_fb(&panels[current_panel_idx], SZ_4M);
259 vt8500_device_lcdc.dev.platform_data = &panels[current_panel_idx];
260#endif
261}
262
263void __init wm8505_reserve_mem(void)
264{
265#if defined CONFIG_FB_WM8505
266 panels[current_panel_idx].bpp = 32; /* Always use RGB888 */
267 preallocate_fb(&panels[current_panel_idx], 32);
268 vt8500_device_wm8505_fb.dev.platform_data = &panels[current_panel_idx];
269#endif
270}
diff --git a/arch/arm/mach-vt8500/devices.h b/arch/arm/mach-vt8500/devices.h
new file mode 100644
index 000000000000..188d4e17f35c
--- /dev/null
+++ b/arch/arm/mach-vt8500/devices.h
@@ -0,0 +1,88 @@
1/* linux/arch/arm/mach-vt8500/devices.h
2 *
3 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#ifndef __ARCH_ARM_MACH_VT8500_DEVICES_H
17#define __ARCH_ARM_MACH_VT8500_DEVICES_H
18
19#include <linux/platform_device.h>
20#include <asm/mach/map.h>
21
22void __init vt8500_init_irq(void);
23void __init wm8505_init_irq(void);
24void __init vt8500_map_io(void);
25void __init wm8505_map_io(void);
26void __init vt8500_reserve_mem(void);
27void __init wm8505_reserve_mem(void);
28void __init vt8500_gpio_init(void);
29void __init vt8500_set_resources(void);
30void __init wm8505_set_resources(void);
31
32extern unsigned long wmt_ic_base __initdata;
33extern unsigned long wmt_sic_base __initdata;
34extern unsigned long wmt_gpio_base __initdata;
35extern unsigned long wmt_pmc_base __initdata;
36
37extern int wmt_nr_irqs __initdata;
38extern int wmt_timer_irq __initdata;
39extern int wmt_gpio_ext_irq[8] __initdata;
40
41extern struct map_desc wmt_io_desc[2] __initdata;
42
43static inline struct resource wmt_mmio_res(u32 start, u32 size)
44{
45 struct resource tmp = {
46 .flags = IORESOURCE_MEM,
47 .start = start,
48 .end = start + size - 1,
49 };
50
51 return tmp;
52}
53
54static inline struct resource wmt_irq_res(int irq)
55{
56 struct resource tmp = {
57 .flags = IORESOURCE_IRQ,
58 .start = irq,
59 .end = irq,
60 };
61
62 return tmp;
63}
64
65static inline void wmt_res_add(struct platform_device *pdev,
66 const struct resource *res, unsigned int num)
67{
68 if (unlikely(platform_device_add_resources(pdev, res, num)))
69 pr_err("Failed to assign resources\n");
70}
71
72extern struct sys_timer vt8500_timer;
73
74extern struct platform_device vt8500_device_uart0;
75extern struct platform_device vt8500_device_uart1;
76extern struct platform_device vt8500_device_uart2;
77extern struct platform_device vt8500_device_uart3;
78extern struct platform_device vt8500_device_uart4;
79extern struct platform_device vt8500_device_uart5;
80
81extern struct platform_device vt8500_device_lcdc;
82extern struct platform_device vt8500_device_wm8505_fb;
83extern struct platform_device vt8500_device_ehci;
84extern struct platform_device vt8500_device_ge_rops;
85extern struct platform_device vt8500_device_pwm;
86extern struct platform_device vt8500_device_pwmbl;
87extern struct platform_device vt8500_device_rtc;
88#endif
diff --git a/arch/arm/mach-vt8500/gpio.c b/arch/arm/mach-vt8500/gpio.c
new file mode 100644
index 000000000000..2bcc0ec783df
--- /dev/null
+++ b/arch/arm/mach-vt8500/gpio.c
@@ -0,0 +1,240 @@
1/* linux/arch/arm/mach-vt8500/gpio.c
2 *
3 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#include <linux/gpio.h>
17#include <linux/init.h>
18#include <linux/irq.h>
19#include <linux/io.h>
20
21#include "devices.h"
22
23#define to_vt8500(__chip) container_of(__chip, struct vt8500_gpio_chip, chip)
24
25#define ENABLE_REGS 0x0
26#define DIRECTION_REGS 0x20
27#define OUTVALUE_REGS 0x40
28#define INVALUE_REGS 0x60
29
30#define EXT_REGOFF 0x1c
31
32static void __iomem *regbase;
33
34struct vt8500_gpio_chip {
35 struct gpio_chip chip;
36 unsigned int shift;
37 unsigned int regoff;
38};
39
40static int gpio_to_irq_map[8];
41
42static int vt8500_muxed_gpio_request(struct gpio_chip *chip,
43 unsigned offset)
44{
45 struct vt8500_gpio_chip *vt8500_chip = to_vt8500(chip);
46 unsigned val = readl(regbase + ENABLE_REGS + vt8500_chip->regoff);
47
48 val |= (1 << vt8500_chip->shift << offset);
49 writel(val, regbase + ENABLE_REGS + vt8500_chip->regoff);
50
51 return 0;
52}
53
54static void vt8500_muxed_gpio_free(struct gpio_chip *chip,
55 unsigned offset)
56{
57 struct vt8500_gpio_chip *vt8500_chip = to_vt8500(chip);
58 unsigned val = readl(regbase + ENABLE_REGS + vt8500_chip->regoff);
59
60 val &= ~(1 << vt8500_chip->shift << offset);
61 writel(val, regbase + ENABLE_REGS + vt8500_chip->regoff);
62}
63
64static int vt8500_muxed_gpio_direction_input(struct gpio_chip *chip,
65 unsigned offset)
66{
67 struct vt8500_gpio_chip *vt8500_chip = to_vt8500(chip);
68 unsigned val = readl(regbase + DIRECTION_REGS + vt8500_chip->regoff);
69
70 val &= ~(1 << vt8500_chip->shift << offset);
71 writel(val, regbase + DIRECTION_REGS + vt8500_chip->regoff);
72
73 return 0;
74}
75
76static int vt8500_muxed_gpio_direction_output(struct gpio_chip *chip,
77 unsigned offset, int value)
78{
79 struct vt8500_gpio_chip *vt8500_chip = to_vt8500(chip);
80 unsigned val = readl(regbase + DIRECTION_REGS + vt8500_chip->regoff);
81
82 val |= (1 << vt8500_chip->shift << offset);
83 writel(val, regbase + DIRECTION_REGS + vt8500_chip->regoff);
84
85 if (value) {
86 val = readl(regbase + OUTVALUE_REGS + vt8500_chip->regoff);
87 val |= (1 << vt8500_chip->shift << offset);
88 writel(val, regbase + OUTVALUE_REGS + vt8500_chip->regoff);
89 }
90 return 0;
91}
92
93static int vt8500_muxed_gpio_get_value(struct gpio_chip *chip,
94 unsigned offset)
95{
96 struct vt8500_gpio_chip *vt8500_chip = to_vt8500(chip);
97
98 return (readl(regbase + INVALUE_REGS + vt8500_chip->regoff)
99 >> vt8500_chip->shift >> offset) & 1;
100}
101
102static void vt8500_muxed_gpio_set_value(struct gpio_chip *chip,
103 unsigned offset, int value)
104{
105 struct vt8500_gpio_chip *vt8500_chip = to_vt8500(chip);
106 unsigned val = readl(regbase + INVALUE_REGS + vt8500_chip->regoff);
107
108 if (value)
109 val |= (1 << vt8500_chip->shift << offset);
110 else
111 val &= ~(1 << vt8500_chip->shift << offset);
112
113 writel(val, regbase + INVALUE_REGS + vt8500_chip->regoff);
114}
115
116#define VT8500_GPIO_BANK(__name, __shift, __off, __base, __num) \
117{ \
118 .chip = { \
119 .label = __name, \
120 .request = vt8500_muxed_gpio_request, \
121 .free = vt8500_muxed_gpio_free, \
122 .direction_input = vt8500_muxed_gpio_direction_input, \
123 .direction_output = vt8500_muxed_gpio_direction_output, \
124 .get = vt8500_muxed_gpio_get_value, \
125 .set = vt8500_muxed_gpio_set_value, \
126 .can_sleep = 0, \
127 .base = __base, \
128 .ngpio = __num, \
129 }, \
130 .shift = __shift, \
131 .regoff = __off, \
132}
133
134static struct vt8500_gpio_chip vt8500_muxed_gpios[] = {
135 VT8500_GPIO_BANK("uart0", 0, 0x0, 8, 4),
136 VT8500_GPIO_BANK("uart1", 4, 0x0, 12, 4),
137 VT8500_GPIO_BANK("spi0", 8, 0x0, 16, 4),
138 VT8500_GPIO_BANK("spi1", 12, 0x0, 20, 4),
139 VT8500_GPIO_BANK("spi2", 16, 0x0, 24, 4),
140 VT8500_GPIO_BANK("pwmout", 24, 0x0, 28, 2),
141
142 VT8500_GPIO_BANK("sdmmc", 0, 0x4, 30, 11),
143 VT8500_GPIO_BANK("ms", 16, 0x4, 41, 7),
144 VT8500_GPIO_BANK("i2c0", 24, 0x4, 48, 2),
145 VT8500_GPIO_BANK("i2c1", 26, 0x4, 50, 2),
146
147 VT8500_GPIO_BANK("mii", 0, 0x8, 52, 20),
148 VT8500_GPIO_BANK("see", 20, 0x8, 72, 4),
149 VT8500_GPIO_BANK("ide", 24, 0x8, 76, 7),
150
151 VT8500_GPIO_BANK("ccir", 0, 0xc, 83, 19),
152
153 VT8500_GPIO_BANK("ts", 8, 0x10, 102, 11),
154
155 VT8500_GPIO_BANK("lcd", 0, 0x14, 113, 23),
156};
157
158static int vt8500_gpio_direction_input(struct gpio_chip *chip,
159 unsigned offset)
160{
161 unsigned val = readl(regbase + DIRECTION_REGS + EXT_REGOFF);
162
163 val &= ~(1 << offset);
164 writel(val, regbase + DIRECTION_REGS + EXT_REGOFF);
165 return 0;
166}
167
168static int vt8500_gpio_direction_output(struct gpio_chip *chip,
169 unsigned offset, int value)
170{
171 unsigned val = readl(regbase + DIRECTION_REGS + EXT_REGOFF);
172
173 val |= (1 << offset);
174 writel(val, regbase + DIRECTION_REGS + EXT_REGOFF);
175
176 if (value) {
177 val = readl(regbase + OUTVALUE_REGS + EXT_REGOFF);
178 val |= (1 << offset);
179 writel(val, regbase + OUTVALUE_REGS + EXT_REGOFF);
180 }
181 return 0;
182}
183
184static int vt8500_gpio_get_value(struct gpio_chip *chip,
185 unsigned offset)
186{
187 return (readl(regbase + INVALUE_REGS + EXT_REGOFF) >> offset) & 1;
188}
189
190static void vt8500_gpio_set_value(struct gpio_chip *chip,
191 unsigned offset, int value)
192{
193 unsigned val = readl(regbase + OUTVALUE_REGS + EXT_REGOFF);
194
195 if (value)
196 val |= (1 << offset);
197 else
198 val &= ~(1 << offset);
199
200 writel(val, regbase + OUTVALUE_REGS + EXT_REGOFF);
201}
202
203static int vt8500_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
204{
205 if (offset > 7)
206 return -EINVAL;
207
208 return gpio_to_irq_map[offset];
209}
210
211static struct gpio_chip vt8500_external_gpios = {
212 .label = "extgpio",
213 .direction_input = vt8500_gpio_direction_input,
214 .direction_output = vt8500_gpio_direction_output,
215 .get = vt8500_gpio_get_value,
216 .set = vt8500_gpio_set_value,
217 .to_irq = vt8500_gpio_to_irq,
218 .can_sleep = 0,
219 .base = 0,
220 .ngpio = 8,
221};
222
223void __init vt8500_gpio_init(void)
224{
225 int i;
226
227 for (i = 0; i < 8; i++)
228 gpio_to_irq_map[i] = wmt_gpio_ext_irq[i];
229
230 regbase = ioremap(wmt_gpio_base, SZ_64K);
231 if (!regbase) {
232 printk(KERN_ERR "Failed to map MMIO registers for GPIO\n");
233 return;
234 }
235
236 gpiochip_add(&vt8500_external_gpios);
237
238 for (i = 0; i < ARRAY_SIZE(vt8500_muxed_gpios); i++)
239 gpiochip_add(&vt8500_muxed_gpios[i].chip);
240}
diff --git a/arch/arm/mach-vt8500/include/mach/debug-macro.S b/arch/arm/mach-vt8500/include/mach/debug-macro.S
new file mode 100644
index 000000000000..f1191626ad51
--- /dev/null
+++ b/arch/arm/mach-vt8500/include/mach/debug-macro.S
@@ -0,0 +1,31 @@
1/*
2 * arch/arm/mach-vt8500/include/mach/debug-macro.S
3 *
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 *
6 * Debugging macro include header
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12*/
13
14 .macro addruart, rp, rv
15 mov \rp, #0x00200000
16 orr \rv, \rp, #0xf8000000
17 orr \rp, \rp, #0xd8000000
18 .endm
19
20 .macro senduart,rd,rx
21 strb \rd, [\rx, #0]
22 .endm
23
24 .macro busyuart,rd,rx
251001: ldr \rd, [\rx, #0x1c]
26 ands \rd, \rd, #0x2
27 bne 1001b
28 .endm
29
30 .macro waituart,rd,rx
31 .endm
diff --git a/arch/arm/mach-vt8500/include/mach/entry-macro.S b/arch/arm/mach-vt8500/include/mach/entry-macro.S
new file mode 100644
index 000000000000..92684c7eaed3
--- /dev/null
+++ b/arch/arm/mach-vt8500/include/mach/entry-macro.S
@@ -0,0 +1,32 @@
1/*
2 * arch/arm/mach-vt8500/include/mach/entry-macro.S
3 *
4 * Low-level IRQ helper macros for VIA VT8500
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11 .macro disable_fiq
12 .endm
13
14 .macro get_irqnr_preamble, base, tmp
15 @ physical 0xd8140000 is virtual 0xf8140000
16 mov \base, #0xf8000000
17 orr \base, \base, #0x00140000
18 .endm
19
20 .macro arch_ret_to_user, tmp1, tmp2
21 .endm
22
23 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
24 ldr \irqnr, [\base]
25 cmp \irqnr, #63 @ may be false positive, check interrupt status
26 bne 1001f
27 ldr \irqstat, [\base, #0x84]
28 ands \irqstat, #0x80000000
29 moveq \irqnr, #0
301001:
31 .endm
32
diff --git a/arch/arm/mach-vt8500/include/mach/gpio.h b/arch/arm/mach-vt8500/include/mach/gpio.h
new file mode 100644
index 000000000000..94ff27678a46
--- /dev/null
+++ b/arch/arm/mach-vt8500/include/mach/gpio.h
@@ -0,0 +1,6 @@
1#include <asm-generic/gpio.h>
2
3#define gpio_get_value __gpio_get_value
4#define gpio_set_value __gpio_set_value
5#define gpio_cansleep __gpio_cansleep
6#define gpio_to_irq __gpio_to_irq
diff --git a/arch/arm/mach-tegra/tegra2_dvfs.h b/arch/arm/mach-vt8500/include/mach/hardware.h
index f8c1adba96a6..db4163f72c39 100644
--- a/arch/arm/mach-tegra/tegra2_dvfs.h
+++ b/arch/arm/mach-vt8500/include/mach/hardware.h
@@ -1,10 +1,4 @@
1/* 1/* arch/arm/mach-vt8500/include/mach/hardware.h
2 * arch/arm/mach-tegra/tegra2_dvfs.h
3 *
4 * Copyright (C) 2010 Google, Inc.
5 *
6 * Author:
7 * Colin Cross <ccross@google.com>
8 * 2 *
9 * This software is licensed under the terms of the GNU General Public 3 * This software is licensed under the terms of the GNU General Public
10 * License version 2, as published by the Free Software Foundation, and 4 * License version 2, as published by the Free Software Foundation, and
@@ -16,5 +10,3 @@
16 * GNU General Public License for more details. 10 * GNU General Public License for more details.
17 * 11 *
18 */ 12 */
19
20extern struct dvfs tegra_dvfs_virtual_cpu_dvfs;
diff --git a/arch/arm/mach-vt8500/include/mach/i8042.h b/arch/arm/mach-vt8500/include/mach/i8042.h
new file mode 100644
index 000000000000..cd7143cad6f3
--- /dev/null
+++ b/arch/arm/mach-vt8500/include/mach/i8042.h
@@ -0,0 +1,18 @@
1/* arch/arm/mach-vt8500/include/mach/i8042.h
2 *
3 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16extern unsigned long wmt_i8042_base __initdata;
17extern int wmt_i8042_kbd_irq;
18extern int wmt_i8042_aux_irq;
diff --git a/arch/arm/mach-vt8500/include/mach/io.h b/arch/arm/mach-vt8500/include/mach/io.h
new file mode 100644
index 000000000000..9077239f78c9
--- /dev/null
+++ b/arch/arm/mach-vt8500/include/mach/io.h
@@ -0,0 +1,28 @@
1/*
2 * arch/arm/mach-vt8500/include/mach/io.h
3 *
4 * Copyright (C) 2010 Alexey Charkov
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __ASM_ARM_ARCH_IO_H
21#define __ASM_ARM_ARCH_IO_H
22
23#define IO_SPACE_LIMIT 0xffff
24
25#define __io(a) __typesafe_io((a) + 0xf0000000)
26#define __mem_pci(a) (a)
27
28#endif
diff --git a/arch/arm/mach-vt8500/include/mach/irqs.h b/arch/arm/mach-vt8500/include/mach/irqs.h
new file mode 100644
index 000000000000..a129fd1222fb
--- /dev/null
+++ b/arch/arm/mach-vt8500/include/mach/irqs.h
@@ -0,0 +1,22 @@
1/*
2 * arch/arm/mach-vt8500/include/mach/irqs.h
3 *
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21/* This value is just to make the core happy, never used otherwise */
22#define NR_IRQS 128
diff --git a/arch/arm/mach-vt8500/include/mach/memory.h b/arch/arm/mach-vt8500/include/mach/memory.h
new file mode 100644
index 000000000000..175f914eff93
--- /dev/null
+++ b/arch/arm/mach-vt8500/include/mach/memory.h
@@ -0,0 +1,28 @@
1/*
2 * arch/arm/mach-vt8500/include/mach/memory.h
3 *
4 * Copyright (C) 2003 ARM Limited
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __ASM_ARCH_MEMORY_H
21#define __ASM_ARCH_MEMORY_H
22
23/*
24 * Physical DRAM offset.
25 */
26#define PHYS_OFFSET UL(0x00000000)
27
28#endif
diff --git a/arch/arm/mach-vt8500/include/mach/system.h b/arch/arm/mach-vt8500/include/mach/system.h
new file mode 100644
index 000000000000..d6c757eaf26b
--- /dev/null
+++ b/arch/arm/mach-vt8500/include/mach/system.h
@@ -0,0 +1,18 @@
1/*
2 * arch/arm/mach-vt8500/include/mach/system.h
3 *
4 */
5#include <asm/io.h>
6
7/* PM Software Reset request register */
8#define VT8500_PMSR_VIRT 0xf8130060
9
10static inline void arch_idle(void)
11{
12 cpu_do_idle();
13}
14
15static inline void arch_reset(char mode, const char *cmd)
16{
17 writel(1, VT8500_PMSR_VIRT);
18}
diff --git a/arch/arm/mach-vt8500/include/mach/timex.h b/arch/arm/mach-vt8500/include/mach/timex.h
new file mode 100644
index 000000000000..8487e4c690b7
--- /dev/null
+++ b/arch/arm/mach-vt8500/include/mach/timex.h
@@ -0,0 +1,26 @@
1/*
2 * arch/arm/mach-vt8500/include/mach/timex.h
3 *
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef MACH_TIMEX_H
22#define MACH_TIMEX_H
23
24#define CLOCK_TICK_RATE (3000000)
25
26#endif /* MACH_TIMEX_H */
diff --git a/arch/arm/mach-vt8500/include/mach/uncompress.h b/arch/arm/mach-vt8500/include/mach/uncompress.h
new file mode 100644
index 000000000000..bb9e2d23fee3
--- /dev/null
+++ b/arch/arm/mach-vt8500/include/mach/uncompress.h
@@ -0,0 +1,37 @@
1/* arch/arm/mach-vt8500/include/mach/uncompress.h
2 *
3 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
4 *
5 * Based on arch/arm/mach-dove/include/mach/uncompress.h
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17
18#define UART0_PHYS 0xd8200000
19#include <asm/io.h>
20
21static void putc(const char c)
22{
23 while (readb(UART0_PHYS + 0x1c) & 0x2)
24 /* Tx busy, wait and poll */;
25
26 writeb(c, UART0_PHYS);
27}
28
29static void flush(void)
30{
31}
32
33/*
34 * nothing to do
35 */
36#define arch_decomp_setup()
37#define arch_decomp_wdog()
diff --git a/arch/arm/mach-vt8500/include/mach/vmalloc.h b/arch/arm/mach-vt8500/include/mach/vmalloc.h
new file mode 100644
index 000000000000..4642290ce416
--- /dev/null
+++ b/arch/arm/mach-vt8500/include/mach/vmalloc.h
@@ -0,0 +1,20 @@
1/*
2 * arch/arm/mach-vt8500/include/mach/vmalloc.h
3 *
4 * Copyright (C) 2000 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#define VMALLOC_END 0xd0000000UL
diff --git a/arch/arm/mach-vt8500/include/mach/vt8500_irqs.h b/arch/arm/mach-vt8500/include/mach/vt8500_irqs.h
new file mode 100644
index 000000000000..ecfee9124711
--- /dev/null
+++ b/arch/arm/mach-vt8500/include/mach/vt8500_irqs.h
@@ -0,0 +1,88 @@
1/*
2 * arch/arm/mach-vt8500/include/mach/vt8500_irqs.h
3 *
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21/* VT8500 Interrupt Sources */
22
23#define IRQ_JPEGENC 0 /* JPEG Encoder */
24#define IRQ_JPEGDEC 1 /* JPEG Decoder */
25 /* Reserved */
26#define IRQ_PATA 3 /* PATA Controller */
27 /* Reserved */
28#define IRQ_DMA 5 /* DMA Controller */
29#define IRQ_EXT0 6 /* External Interrupt 0 */
30#define IRQ_EXT1 7 /* External Interrupt 1 */
31#define IRQ_GE 8 /* Graphic Engine */
32#define IRQ_GOV 9 /* Graphic Overlay Engine */
33#define IRQ_ETHER 10 /* Ethernet MAC */
34#define IRQ_MPEGTS 11 /* Transport Stream Interface */
35#define IRQ_LCDC 12 /* LCD Controller */
36#define IRQ_EXT2 13 /* External Interrupt 2 */
37#define IRQ_EXT3 14 /* External Interrupt 3 */
38#define IRQ_EXT4 15 /* External Interrupt 4 */
39#define IRQ_CIPHER 16 /* Cipher */
40#define IRQ_VPP 17 /* Video Post-Processor */
41#define IRQ_I2C1 18 /* I2C 1 */
42#define IRQ_I2C0 19 /* I2C 0 */
43#define IRQ_SDMMC 20 /* SD/MMC Controller */
44#define IRQ_SDMMC_DMA 21 /* SD/MMC Controller DMA */
45#define IRQ_PMC_WU 22 /* Power Management Controller Wakeup */
46 /* Reserved */
47#define IRQ_SPI0 24 /* SPI 0 */
48#define IRQ_SPI1 25 /* SPI 1 */
49#define IRQ_SPI2 26 /* SPI 2 */
50#define IRQ_LCDDF 27 /* LCD Data Formatter */
51#define IRQ_NAND 28 /* NAND Flash Controller */
52#define IRQ_NAND_DMA 29 /* NAND Flash Controller DMA */
53#define IRQ_MS 30 /* MemoryStick Controller */
54#define IRQ_MS_DMA 31 /* MemoryStick Controller DMA */
55#define IRQ_UART0 32 /* UART 0 */
56#define IRQ_UART1 33 /* UART 1 */
57#define IRQ_I2S 34 /* I2S */
58#define IRQ_PCM 35 /* PCM */
59#define IRQ_PMCOS0 36 /* PMC OS Timer 0 */
60#define IRQ_PMCOS1 37 /* PMC OS Timer 1 */
61#define IRQ_PMCOS2 38 /* PMC OS Timer 2 */
62#define IRQ_PMCOS3 39 /* PMC OS Timer 3 */
63#define IRQ_VPU 40 /* Video Processing Unit */
64#define IRQ_VID 41 /* Video Digital Input Interface */
65#define IRQ_AC97 42 /* AC97 Interface */
66#define IRQ_EHCI 43 /* USB */
67#define IRQ_NOR 44 /* NOR Flash Controller */
68#define IRQ_PS2MOUSE 45 /* PS/2 Mouse */
69#define IRQ_PS2KBD 46 /* PS/2 Keyboard */
70#define IRQ_UART2 47 /* UART 2 */
71#define IRQ_RTC 48 /* RTC Interrupt */
72#define IRQ_RTCSM 49 /* RTC Second/Minute Update Interrupt */
73#define IRQ_UART3 50 /* UART 3 */
74#define IRQ_ADC 51 /* ADC */
75#define IRQ_EXT5 52 /* External Interrupt 5 */
76#define IRQ_EXT6 53 /* External Interrupt 6 */
77#define IRQ_EXT7 54 /* External Interrupt 7 */
78#define IRQ_CIR 55 /* CIR */
79#define IRQ_DMA0 56 /* DMA Channel 0 */
80#define IRQ_DMA1 57 /* DMA Channel 1 */
81#define IRQ_DMA2 58 /* DMA Channel 2 */
82#define IRQ_DMA3 59 /* DMA Channel 3 */
83#define IRQ_DMA4 60 /* DMA Channel 4 */
84#define IRQ_DMA5 61 /* DMA Channel 5 */
85#define IRQ_DMA6 62 /* DMA Channel 6 */
86#define IRQ_DMA7 63 /* DMA Channel 7 */
87
88#define VT8500_NR_IRQS 64
diff --git a/arch/arm/mach-vt8500/include/mach/vt8500_regs.h b/arch/arm/mach-vt8500/include/mach/vt8500_regs.h
new file mode 100644
index 000000000000..29c63ecb2383
--- /dev/null
+++ b/arch/arm/mach-vt8500/include/mach/vt8500_regs.h
@@ -0,0 +1,79 @@
1/*
2 * arch/arm/mach-vt8500/include/mach/vt8500_regs.h
3 *
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __ASM_ARM_ARCH_VT8500_REGS_H
21#define __ASM_ARM_ARCH_VT8500_REGS_H
22
23/* VT8500 Registers Map */
24
25#define VT8500_REGS_START_PHYS 0xd8000000 /* Start of MMIO registers */
26#define VT8500_REGS_START_VIRT 0xf8000000 /* Virtual mapping start */
27
28#define VT8500_DDR_BASE 0xd8000000 /* 1k DDR/DDR2 Memory
29 Controller */
30#define VT8500_DMA_BASE 0xd8001000 /* 1k DMA Controller */
31#define VT8500_SFLASH_BASE 0xd8002000 /* 1k Serial Flash Memory
32 Controller */
33#define VT8500_ETHER_BASE 0xd8004000 /* 1k Ethernet MAC 0 */
34#define VT8500_CIPHER_BASE 0xd8006000 /* 4k Cipher */
35#define VT8500_USB_BASE 0xd8007800 /* 2k USB OTG */
36# define VT8500_EHCI_BASE 0xd8007900 /* EHCI */
37# define VT8500_UHCI_BASE 0xd8007b01 /* UHCI */
38#define VT8500_PATA_BASE 0xd8008000 /* 512 PATA */
39#define VT8500_PS2_BASE 0xd8008800 /* 1k PS/2 */
40#define VT8500_NAND_BASE 0xd8009000 /* 1k NAND Controller */
41#define VT8500_NOR_BASE 0xd8009400 /* 1k NOR Controller */
42#define VT8500_SDMMC_BASE 0xd800a000 /* 1k SD/MMC Controller */
43#define VT8500_MS_BASE 0xd800b000 /* 1k MS/MSPRO Controller */
44#define VT8500_LCDC_BASE 0xd800e400 /* 1k LCD Controller */
45#define VT8500_VPU_BASE 0xd8050000 /* 256 VPU */
46#define VT8500_GOV_BASE 0xd8050300 /* 256 GOV */
47#define VT8500_GEGEA_BASE 0xd8050400 /* 768 GE/GE Alpha Mixing */
48#define VT8500_LCDF_BASE 0xd8050900 /* 256 LCD Formatter */
49#define VT8500_VID_BASE 0xd8050a00 /* 256 VID */
50#define VT8500_VPP_BASE 0xd8050b00 /* 256 VPP */
51#define VT8500_TSBK_BASE 0xd80f4000 /* 4k TSBK */
52#define VT8500_JPEGDEC_BASE 0xd80fe000 /* 4k JPEG Decoder */
53#define VT8500_JPEGENC_BASE 0xd80ff000 /* 4k JPEG Encoder */
54#define VT8500_RTC_BASE 0xd8100000 /* 64k RTC */
55#define VT8500_GPIO_BASE 0xd8110000 /* 64k GPIO Configuration */
56#define VT8500_SCC_BASE 0xd8120000 /* 64k System Configuration*/
57#define VT8500_PMC_BASE 0xd8130000 /* 64k PMC Configuration */
58#define VT8500_IC_BASE 0xd8140000 /* 64k Interrupt Controller*/
59#define VT8500_UART0_BASE 0xd8200000 /* 64k UART 0 */
60#define VT8500_UART2_BASE 0xd8210000 /* 64k UART 2 */
61#define VT8500_PWM_BASE 0xd8220000 /* 64k PWM Configuration */
62#define VT8500_SPI0_BASE 0xd8240000 /* 64k SPI 0 */
63#define VT8500_SPI1_BASE 0xd8250000 /* 64k SPI 1 */
64#define VT8500_CIR_BASE 0xd8270000 /* 64k CIR */
65#define VT8500_I2C0_BASE 0xd8280000 /* 64k I2C 0 */
66#define VT8500_AC97_BASE 0xd8290000 /* 64k AC97 */
67#define VT8500_SPI2_BASE 0xd82a0000 /* 64k SPI 2 */
68#define VT8500_UART1_BASE 0xd82b0000 /* 64k UART 1 */
69#define VT8500_UART3_BASE 0xd82c0000 /* 64k UART 3 */
70#define VT8500_PCM_BASE 0xd82d0000 /* 64k PCM */
71#define VT8500_I2C1_BASE 0xd8320000 /* 64k I2C 1 */
72#define VT8500_I2S_BASE 0xd8330000 /* 64k I2S */
73#define VT8500_ADC_BASE 0xd8340000 /* 64k ADC */
74
75#define VT8500_REGS_END_PHYS 0xd834ffff /* End of MMIO registers */
76#define VT8500_REGS_LENGTH (VT8500_REGS_END_PHYS \
77 - VT8500_REGS_START_PHYS + 1)
78
79#endif
diff --git a/arch/arm/mach-vt8500/include/mach/vt8500fb.h b/arch/arm/mach-vt8500/include/mach/vt8500fb.h
new file mode 100644
index 000000000000..7f399c370fe0
--- /dev/null
+++ b/arch/arm/mach-vt8500/include/mach/vt8500fb.h
@@ -0,0 +1,31 @@
1/*
2 * VT8500/WM8505 Frame Buffer platform data definitions
3 *
4 * Copyright (C) 2010 Ed Spiridonov <edo.rus@gmail.com>
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef _VT8500FB_H
17#define _VT8500FB_H
18
19#include <linux/fb.h>
20
21struct vt8500fb_platform_data {
22 struct fb_videomode mode;
23 u32 xres_virtual;
24 u32 yres_virtual;
25 u32 bpp;
26 unsigned long video_mem_phys;
27 void *video_mem_virt;
28 unsigned long video_mem_len;
29};
30
31#endif /* _VT8500FB_H */
diff --git a/arch/arm/mach-vt8500/include/mach/wm8505_irqs.h b/arch/arm/mach-vt8500/include/mach/wm8505_irqs.h
new file mode 100644
index 000000000000..6128627ac753
--- /dev/null
+++ b/arch/arm/mach-vt8500/include/mach/wm8505_irqs.h
@@ -0,0 +1,115 @@
1/*
2 * arch/arm/mach-vt8500/include/mach/wm8505_irqs.h
3 *
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21/* WM8505 Interrupt Sources */
22
23#define IRQ_UHCI 0 /* UHC FS (UHCI?) */
24#define IRQ_EHCI 1 /* UHC HS */
25#define IRQ_UDCDMA 2 /* UDC DMA */
26 /* Reserved */
27#define IRQ_PS2MOUSE 4 /* PS/2 Mouse */
28#define IRQ_UDC 5 /* UDC */
29#define IRQ_EXT0 6 /* External Interrupt 0 */
30#define IRQ_EXT1 7 /* External Interrupt 1 */
31#define IRQ_KEYPAD 8 /* Keypad */
32#define IRQ_DMA 9 /* DMA Controller */
33#define IRQ_ETHER 10 /* Ethernet MAC */
34 /* Reserved */
35 /* Reserved */
36#define IRQ_EXT2 13 /* External Interrupt 2 */
37#define IRQ_EXT3 14 /* External Interrupt 3 */
38#define IRQ_EXT4 15 /* External Interrupt 4 */
39#define IRQ_APB 16 /* APB Bridge */
40#define IRQ_DMA0 17 /* DMA Channel 0 */
41#define IRQ_I2C1 18 /* I2C 1 */
42#define IRQ_I2C0 19 /* I2C 0 */
43#define IRQ_SDMMC 20 /* SD/MMC Controller */
44#define IRQ_SDMMC_DMA 21 /* SD/MMC Controller DMA */
45#define IRQ_PMC_WU 22 /* Power Management Controller Wakeup */
46#define IRQ_PS2KBD 23 /* PS/2 Keyboard */
47#define IRQ_SPI0 24 /* SPI 0 */
48#define IRQ_SPI1 25 /* SPI 1 */
49#define IRQ_SPI2 26 /* SPI 2 */
50#define IRQ_DMA1 27 /* DMA Channel 1 */
51#define IRQ_NAND 28 /* NAND Flash Controller */
52#define IRQ_NAND_DMA 29 /* NAND Flash Controller DMA */
53#define IRQ_UART5 30 /* UART 5 */
54#define IRQ_UART4 31 /* UART 4 */
55#define IRQ_UART0 32 /* UART 0 */
56#define IRQ_UART1 33 /* UART 1 */
57#define IRQ_DMA2 34 /* DMA Channel 2 */
58#define IRQ_I2S 35 /* I2S */
59#define IRQ_PMCOS0 36 /* PMC OS Timer 0 */
60#define IRQ_PMCOS1 37 /* PMC OS Timer 1 */
61#define IRQ_PMCOS2 38 /* PMC OS Timer 2 */
62#define IRQ_PMCOS3 39 /* PMC OS Timer 3 */
63#define IRQ_DMA3 40 /* DMA Channel 3 */
64#define IRQ_DMA4 41 /* DMA Channel 4 */
65#define IRQ_AC97 42 /* AC97 Interface */
66 /* Reserved */
67#define IRQ_NOR 44 /* NOR Flash Controller */
68#define IRQ_DMA5 45 /* DMA Channel 5 */
69#define IRQ_DMA6 46 /* DMA Channel 6 */
70#define IRQ_UART2 47 /* UART 2 */
71#define IRQ_RTC 48 /* RTC Interrupt */
72#define IRQ_RTCSM 49 /* RTC Second/Minute Update Interrupt */
73#define IRQ_UART3 50 /* UART 3 */
74#define IRQ_DMA7 51 /* DMA Channel 7 */
75#define IRQ_EXT5 52 /* External Interrupt 5 */
76#define IRQ_EXT6 53 /* External Interrupt 6 */
77#define IRQ_EXT7 54 /* External Interrupt 7 */
78#define IRQ_CIR 55 /* CIR */
79#define IRQ_SIC0 56 /* SIC IRQ0 */
80#define IRQ_SIC1 57 /* SIC IRQ1 */
81#define IRQ_SIC2 58 /* SIC IRQ2 */
82#define IRQ_SIC3 59 /* SIC IRQ3 */
83#define IRQ_SIC4 60 /* SIC IRQ4 */
84#define IRQ_SIC5 61 /* SIC IRQ5 */
85#define IRQ_SIC6 62 /* SIC IRQ6 */
86#define IRQ_SIC7 63 /* SIC IRQ7 */
87 /* Reserved */
88#define IRQ_JPEGDEC 65 /* JPEG Decoder */
89#define IRQ_SAE 66 /* SAE (?) */
90 /* Reserved */
91#define IRQ_VPU 79 /* Video Processing Unit */
92#define IRQ_VPP 80 /* Video Post-Processor */
93#define IRQ_VID 81 /* Video Digital Input Interface */
94#define IRQ_SPU 82 /* SPU (?) */
95#define IRQ_PIP 83 /* PIP Error */
96#define IRQ_GE 84 /* Graphic Engine */
97#define IRQ_GOV 85 /* Graphic Overlay Engine */
98#define IRQ_DVO 86 /* Digital Video Output */
99 /* Reserved */
100#define IRQ_DMA8 92 /* DMA Channel 8 */
101#define IRQ_DMA9 93 /* DMA Channel 9 */
102#define IRQ_DMA10 94 /* DMA Channel 10 */
103#define IRQ_DMA11 95 /* DMA Channel 11 */
104#define IRQ_DMA12 96 /* DMA Channel 12 */
105#define IRQ_DMA13 97 /* DMA Channel 13 */
106#define IRQ_DMA14 98 /* DMA Channel 14 */
107#define IRQ_DMA15 99 /* DMA Channel 15 */
108 /* Reserved */
109#define IRQ_GOVW 111 /* GOVW (?) */
110#define IRQ_GOVRSDSCD 112 /* GOVR SDSCD (?) */
111#define IRQ_GOVRSDMIF 113 /* GOVR SDMIF (?) */
112#define IRQ_GOVRHDSCD 114 /* GOVR HDSCD (?) */
113#define IRQ_GOVRHDMIF 115 /* GOVR HDMIF (?) */
114
115#define WM8505_NR_IRQS 116
diff --git a/arch/arm/mach-vt8500/include/mach/wm8505_regs.h b/arch/arm/mach-vt8500/include/mach/wm8505_regs.h
new file mode 100644
index 000000000000..df1550941efb
--- /dev/null
+++ b/arch/arm/mach-vt8500/include/mach/wm8505_regs.h
@@ -0,0 +1,78 @@
1/*
2 * arch/arm/mach-vt8500/include/mach/wm8505_regs.h
3 *
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __ASM_ARM_ARCH_WM8505_REGS_H
21#define __ASM_ARM_ARCH_WM8505_REGS_H
22
23/* WM8505 Registers Map */
24
25#define WM8505_REGS_START_PHYS 0xd8000000 /* Start of MMIO registers */
26#define WM8505_REGS_START_VIRT 0xf8000000 /* Virtual mapping start */
27
28#define WM8505_DDR_BASE 0xd8000400 /* 1k DDR/DDR2 Memory
29 Controller */
30#define WM8505_DMA_BASE 0xd8001800 /* 1k DMA Controller */
31#define WM8505_VDMA_BASE 0xd8001c00 /* 1k VDMA */
32#define WM8505_SFLASH_BASE 0xd8002000 /* 1k Serial Flash Memory
33 Controller */
34#define WM8505_ETHER_BASE 0xd8004000 /* 1k Ethernet MAC 0 */
35#define WM8505_CIPHER_BASE 0xd8006000 /* 4k Cipher */
36#define WM8505_USB_BASE 0xd8007000 /* 2k USB 2.0 Host */
37# define WM8505_EHCI_BASE 0xd8007100 /* EHCI */
38# define WM8505_UHCI_BASE 0xd8007301 /* UHCI */
39#define WM8505_PS2_BASE 0xd8008800 /* 1k PS/2 */
40#define WM8505_NAND_BASE 0xd8009000 /* 1k NAND Controller */
41#define WM8505_NOR_BASE 0xd8009400 /* 1k NOR Controller */
42#define WM8505_SDMMC_BASE 0xd800a000 /* 1k SD/MMC Controller */
43#define WM8505_VPU_BASE 0xd8050000 /* 256 VPU */
44#define WM8505_GOV_BASE 0xd8050300 /* 256 GOV */
45#define WM8505_GEGEA_BASE 0xd8050400 /* 768 GE/GE Alpha Mixing */
46#define WM8505_GOVR_BASE 0xd8050800 /* 512 GOVR (frambuffer) */
47#define WM8505_VID_BASE 0xd8050a00 /* 256 VID */
48#define WM8505_SCL_BASE 0xd8050d00 /* 256 SCL */
49#define WM8505_VPP_BASE 0xd8050f00 /* 256 VPP */
50#define WM8505_JPEGDEC_BASE 0xd80fe000 /* 4k JPEG Decoder */
51#define WM8505_RTC_BASE 0xd8100000 /* 64k RTC */
52#define WM8505_GPIO_BASE 0xd8110000 /* 64k GPIO Configuration */
53#define WM8505_SCC_BASE 0xd8120000 /* 64k System Configuration*/
54#define WM8505_PMC_BASE 0xd8130000 /* 64k PMC Configuration */
55#define WM8505_IC_BASE 0xd8140000 /* 64k Interrupt Controller*/
56#define WM8505_SIC_BASE 0xd8150000 /* 64k Secondary IC */
57#define WM8505_UART0_BASE 0xd8200000 /* 64k UART 0 */
58#define WM8505_UART2_BASE 0xd8210000 /* 64k UART 2 */
59#define WM8505_PWM_BASE 0xd8220000 /* 64k PWM Configuration */
60#define WM8505_SPI0_BASE 0xd8240000 /* 64k SPI 0 */
61#define WM8505_SPI1_BASE 0xd8250000 /* 64k SPI 1 */
62#define WM8505_KEYPAD_BASE 0xd8260000 /* 64k Keypad control */
63#define WM8505_CIR_BASE 0xd8270000 /* 64k CIR */
64#define WM8505_I2C0_BASE 0xd8280000 /* 64k I2C 0 */
65#define WM8505_AC97_BASE 0xd8290000 /* 64k AC97 */
66#define WM8505_SPI2_BASE 0xd82a0000 /* 64k SPI 2 */
67#define WM8505_UART1_BASE 0xd82b0000 /* 64k UART 1 */
68#define WM8505_UART3_BASE 0xd82c0000 /* 64k UART 3 */
69#define WM8505_I2C1_BASE 0xd8320000 /* 64k I2C 1 */
70#define WM8505_I2S_BASE 0xd8330000 /* 64k I2S */
71#define WM8505_UART4_BASE 0xd8370000 /* 64k UART 4 */
72#define WM8505_UART5_BASE 0xd8380000 /* 64k UART 5 */
73
74#define WM8505_REGS_END_PHYS 0xd838ffff /* End of MMIO registers */
75#define WM8505_REGS_LENGTH (WM8505_REGS_END_PHYS \
76 - WM8505_REGS_START_PHYS + 1)
77
78#endif
diff --git a/arch/arm/mach-vt8500/irq.c b/arch/arm/mach-vt8500/irq.c
new file mode 100644
index 000000000000..5f4ddde4f02a
--- /dev/null
+++ b/arch/arm/mach-vt8500/irq.c
@@ -0,0 +1,177 @@
1/*
2 * arch/arm/mach-vt8500/irq.c
3 *
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/io.h>
22#include <linux/irq.h>
23#include <linux/interrupt.h>
24
25#include <asm/irq.h>
26
27#include "devices.h"
28
29#define VT8500_IC_DCTR 0x40 /* Destination control
30 register, 64*u8 */
31#define VT8500_INT_ENABLE (1 << 3)
32#define VT8500_TRIGGER_HIGH (0 << 4)
33#define VT8500_TRIGGER_RISING (1 << 4)
34#define VT8500_TRIGGER_FALLING (2 << 4)
35#define VT8500_EDGE ( VT8500_TRIGGER_RISING \
36 | VT8500_TRIGGER_FALLING)
37#define VT8500_IC_STATUS 0x80 /* Interrupt status, 2*u32 */
38
39static void __iomem *ic_regbase;
40static void __iomem *sic_regbase;
41
42static void vt8500_irq_mask(unsigned int irq)
43{
44 void __iomem *base = ic_regbase;
45 u8 edge;
46
47 if (irq >= 64) {
48 base = sic_regbase;
49 irq -= 64;
50 }
51 edge = readb(base + VT8500_IC_DCTR + irq) & VT8500_EDGE;
52 if (edge) {
53 void __iomem *stat_reg = base + VT8500_IC_STATUS
54 + (irq < 32 ? 0 : 4);
55 unsigned status = readl(stat_reg);
56
57 status |= (1 << (irq & 0x1f));
58 writel(status, stat_reg);
59 } else {
60 u8 dctr = readb(base + VT8500_IC_DCTR + irq);
61
62 dctr &= ~VT8500_INT_ENABLE;
63 writeb(dctr, base + VT8500_IC_DCTR + irq);
64 }
65}
66
67static void vt8500_irq_unmask(unsigned int irq)
68{
69 void __iomem *base = ic_regbase;
70 u8 dctr;
71
72 if (irq >= 64) {
73 base = sic_regbase;
74 irq -= 64;
75 }
76 dctr = readb(base + VT8500_IC_DCTR + irq);
77 dctr |= VT8500_INT_ENABLE;
78 writeb(dctr, base + VT8500_IC_DCTR + irq);
79}
80
81static int vt8500_irq_set_type(unsigned int irq, unsigned int flow_type)
82{
83 void __iomem *base = ic_regbase;
84 unsigned int orig_irq = irq;
85 u8 dctr;
86
87 if (irq >= 64) {
88 base = sic_regbase;
89 irq -= 64;
90 }
91
92 dctr = readb(base + VT8500_IC_DCTR + irq);
93 dctr &= ~VT8500_EDGE;
94
95 switch (flow_type) {
96 case IRQF_TRIGGER_LOW:
97 return -EINVAL;
98 case IRQF_TRIGGER_HIGH:
99 dctr |= VT8500_TRIGGER_HIGH;
100 irq_desc[orig_irq].handle_irq = handle_level_irq;
101 break;
102 case IRQF_TRIGGER_FALLING:
103 dctr |= VT8500_TRIGGER_FALLING;
104 irq_desc[orig_irq].handle_irq = handle_edge_irq;
105 break;
106 case IRQF_TRIGGER_RISING:
107 dctr |= VT8500_TRIGGER_RISING;
108 irq_desc[orig_irq].handle_irq = handle_edge_irq;
109 break;
110 }
111 writeb(dctr, base + VT8500_IC_DCTR + irq);
112
113 return 0;
114}
115
116static struct irq_chip vt8500_irq_chip = {
117 .name = "vt8500",
118 .ack = vt8500_irq_mask,
119 .mask = vt8500_irq_mask,
120 .unmask = vt8500_irq_unmask,
121 .set_type = vt8500_irq_set_type,
122};
123
124void __init vt8500_init_irq(void)
125{
126 unsigned int i;
127
128 ic_regbase = ioremap(wmt_ic_base, SZ_64K);
129
130 if (ic_regbase) {
131 /* Enable rotating priority for IRQ */
132 writel((1 << 6), ic_regbase + 0x20);
133 writel(0, ic_regbase + 0x24);
134
135 for (i = 0; i < wmt_nr_irqs; i++) {
136 /* Disable all interrupts and route them to IRQ */
137 writeb(0x00, ic_regbase + VT8500_IC_DCTR + i);
138
139 set_irq_chip(i, &vt8500_irq_chip);
140 set_irq_handler(i, handle_level_irq);
141 set_irq_flags(i, IRQF_VALID);
142 }
143 } else {
144 printk(KERN_ERR "Unable to remap the Interrupt Controller registers, not enabling IRQs!\n");
145 }
146}
147
148void __init wm8505_init_irq(void)
149{
150 unsigned int i;
151
152 ic_regbase = ioremap(wmt_ic_base, SZ_64K);
153 sic_regbase = ioremap(wmt_sic_base, SZ_64K);
154
155 if (ic_regbase && sic_regbase) {
156 /* Enable rotating priority for IRQ */
157 writel((1 << 6), ic_regbase + 0x20);
158 writel(0, ic_regbase + 0x24);
159 writel((1 << 6), sic_regbase + 0x20);
160 writel(0, sic_regbase + 0x24);
161
162 for (i = 0; i < wmt_nr_irqs; i++) {
163 /* Disable all interrupts and route them to IRQ */
164 if (i < 64)
165 writeb(0x00, ic_regbase + VT8500_IC_DCTR + i);
166 else
167 writeb(0x00, sic_regbase + VT8500_IC_DCTR
168 + i - 64);
169
170 set_irq_chip(i, &vt8500_irq_chip);
171 set_irq_handler(i, handle_level_irq);
172 set_irq_flags(i, IRQF_VALID);
173 }
174 } else {
175 printk(KERN_ERR "Unable to remap the Interrupt Controller registers, not enabling IRQs!\n");
176 }
177}
diff --git a/arch/arm/mach-vt8500/pwm.c b/arch/arm/mach-vt8500/pwm.c
new file mode 100644
index 000000000000..8ad825e93592
--- /dev/null
+++ b/arch/arm/mach-vt8500/pwm.c
@@ -0,0 +1,265 @@
1/*
2 * arch/arm/mach-vt8500/pwm.c
3 *
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#include <linux/module.h>
17#include <linux/kernel.h>
18#include <linux/platform_device.h>
19#include <linux/slab.h>
20#include <linux/err.h>
21#include <linux/io.h>
22#include <linux/pwm.h>
23#include <linux/delay.h>
24
25#include <asm/div64.h>
26
27#define VT8500_NR_PWMS 4
28
29static DEFINE_MUTEX(pwm_lock);
30static LIST_HEAD(pwm_list);
31
32struct pwm_device {
33 struct list_head node;
34 struct platform_device *pdev;
35
36 const char *label;
37
38 void __iomem *regbase;
39
40 unsigned int use_count;
41 unsigned int pwm_id;
42};
43
44#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t)
45static inline void pwm_busy_wait(void __iomem *reg, u8 bitmask)
46{
47 int loops = msecs_to_loops(10);
48 while ((readb(reg) & bitmask) && --loops)
49 cpu_relax();
50
51 if (unlikely(!loops))
52 pr_warning("Waiting for status bits 0x%x to clear timed out\n",
53 bitmask);
54}
55
56int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
57{
58 unsigned long long c;
59 unsigned long period_cycles, prescale, pv, dc;
60
61 if (pwm == NULL || period_ns == 0 || duty_ns > period_ns)
62 return -EINVAL;
63
64 c = 25000000/2; /* wild guess --- need to implement clocks */
65 c = c * period_ns;
66 do_div(c, 1000000000);
67 period_cycles = c;
68
69 if (period_cycles < 1)
70 period_cycles = 1;
71 prescale = (period_cycles - 1) / 4096;
72 pv = period_cycles / (prescale + 1) - 1;
73 if (pv > 4095)
74 pv = 4095;
75
76 if (prescale > 1023)
77 return -EINVAL;
78
79 c = (unsigned long long)pv * duty_ns;
80 do_div(c, period_ns);
81 dc = c;
82
83 pwm_busy_wait(pwm->regbase + 0x40 + pwm->pwm_id, (1 << 1));
84 writel(prescale, pwm->regbase + 0x4 + (pwm->pwm_id << 4));
85
86 pwm_busy_wait(pwm->regbase + 0x40 + pwm->pwm_id, (1 << 2));
87 writel(pv, pwm->regbase + 0x8 + (pwm->pwm_id << 4));
88
89 pwm_busy_wait(pwm->regbase + 0x40 + pwm->pwm_id, (1 << 3));
90 writel(dc, pwm->regbase + 0xc + (pwm->pwm_id << 4));
91
92 return 0;
93}
94EXPORT_SYMBOL(pwm_config);
95
96int pwm_enable(struct pwm_device *pwm)
97{
98 pwm_busy_wait(pwm->regbase + 0x40 + pwm->pwm_id, (1 << 0));
99 writel(5, pwm->regbase + (pwm->pwm_id << 4));
100 return 0;
101}
102EXPORT_SYMBOL(pwm_enable);
103
104void pwm_disable(struct pwm_device *pwm)
105{
106 pwm_busy_wait(pwm->regbase + 0x40 + pwm->pwm_id, (1 << 0));
107 writel(0, pwm->regbase + (pwm->pwm_id << 4));
108}
109EXPORT_SYMBOL(pwm_disable);
110
111struct pwm_device *pwm_request(int pwm_id, const char *label)
112{
113 struct pwm_device *pwm;
114 int found = 0;
115
116 mutex_lock(&pwm_lock);
117
118 list_for_each_entry(pwm, &pwm_list, node) {
119 if (pwm->pwm_id == pwm_id) {
120 found = 1;
121 break;
122 }
123 }
124
125 if (found) {
126 if (pwm->use_count == 0) {
127 pwm->use_count++;
128 pwm->label = label;
129 } else {
130 pwm = ERR_PTR(-EBUSY);
131 }
132 } else {
133 pwm = ERR_PTR(-ENOENT);
134 }
135
136 mutex_unlock(&pwm_lock);
137 return pwm;
138}
139EXPORT_SYMBOL(pwm_request);
140
141void pwm_free(struct pwm_device *pwm)
142{
143 mutex_lock(&pwm_lock);
144
145 if (pwm->use_count) {
146 pwm->use_count--;
147 pwm->label = NULL;
148 } else {
149 pr_warning("PWM device already freed\n");
150 }
151
152 mutex_unlock(&pwm_lock);
153}
154EXPORT_SYMBOL(pwm_free);
155
156static inline void __add_pwm(struct pwm_device *pwm)
157{
158 mutex_lock(&pwm_lock);
159 list_add_tail(&pwm->node, &pwm_list);
160 mutex_unlock(&pwm_lock);
161}
162
163static int __devinit pwm_probe(struct platform_device *pdev)
164{
165 struct pwm_device *pwms;
166 struct resource *r;
167 int ret = 0;
168 int i;
169
170 pwms = kzalloc(sizeof(struct pwm_device) * VT8500_NR_PWMS, GFP_KERNEL);
171 if (pwms == NULL) {
172 dev_err(&pdev->dev, "failed to allocate memory\n");
173 return -ENOMEM;
174 }
175
176 for (i = 0; i < VT8500_NR_PWMS; i++) {
177 pwms[i].use_count = 0;
178 pwms[i].pwm_id = i;
179 pwms[i].pdev = pdev;
180 }
181
182 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
183 if (r == NULL) {
184 dev_err(&pdev->dev, "no memory resource defined\n");
185 ret = -ENODEV;
186 goto err_free;
187 }
188
189 r = request_mem_region(r->start, resource_size(r), pdev->name);
190 if (r == NULL) {
191 dev_err(&pdev->dev, "failed to request memory resource\n");
192 ret = -EBUSY;
193 goto err_free;
194 }
195
196 pwms[0].regbase = ioremap(r->start, resource_size(r));
197 if (pwms[0].regbase == NULL) {
198 dev_err(&pdev->dev, "failed to ioremap() registers\n");
199 ret = -ENODEV;
200 goto err_free_mem;
201 }
202
203 for (i = 1; i < VT8500_NR_PWMS; i++)
204 pwms[i].regbase = pwms[0].regbase;
205
206 for (i = 0; i < VT8500_NR_PWMS; i++)
207 __add_pwm(&pwms[i]);
208
209 platform_set_drvdata(pdev, pwms);
210 return 0;
211
212err_free_mem:
213 release_mem_region(r->start, resource_size(r));
214err_free:
215 kfree(pwms);
216 return ret;
217}
218
219static int __devexit pwm_remove(struct platform_device *pdev)
220{
221 struct pwm_device *pwms;
222 struct resource *r;
223 int i;
224
225 pwms = platform_get_drvdata(pdev);
226 if (pwms == NULL)
227 return -ENODEV;
228
229 mutex_lock(&pwm_lock);
230
231 for (i = 0; i < VT8500_NR_PWMS; i++)
232 list_del(&pwms[i].node);
233 mutex_unlock(&pwm_lock);
234
235 iounmap(pwms[0].regbase);
236
237 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
238 release_mem_region(r->start, resource_size(r));
239
240 kfree(pwms);
241 return 0;
242}
243
244static struct platform_driver pwm_driver = {
245 .driver = {
246 .name = "vt8500-pwm",
247 .owner = THIS_MODULE,
248 },
249 .probe = pwm_probe,
250 .remove = __devexit_p(pwm_remove),
251};
252
253static int __init pwm_init(void)
254{
255 return platform_driver_register(&pwm_driver);
256}
257arch_initcall(pwm_init);
258
259static void __exit pwm_exit(void)
260{
261 platform_driver_unregister(&pwm_driver);
262}
263module_exit(pwm_exit);
264
265MODULE_LICENSE("GPL");
diff --git a/arch/arm/mach-vt8500/timer.c b/arch/arm/mach-vt8500/timer.c
new file mode 100644
index 000000000000..d5376c592ab6
--- /dev/null
+++ b/arch/arm/mach-vt8500/timer.c
@@ -0,0 +1,155 @@
1/*
2 * arch/arm/mach-vt8500/timer.c
3 *
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/io.h>
22#include <linux/irq.h>
23#include <linux/interrupt.h>
24#include <linux/clocksource.h>
25#include <linux/clockchips.h>
26#include <linux/delay.h>
27
28#include <asm/mach/time.h>
29
30#include "devices.h"
31
32#define VT8500_TIMER_OFFSET 0x0100
33#define TIMER_MATCH_VAL 0x0000
34#define TIMER_COUNT_VAL 0x0010
35#define TIMER_STATUS_VAL 0x0014
36#define TIMER_IER_VAL 0x001c /* interrupt enable */
37#define TIMER_CTRL_VAL 0x0020
38#define TIMER_AS_VAL 0x0024 /* access status */
39#define TIMER_COUNT_R_ACTIVE (1 << 5) /* not ready for read */
40#define TIMER_COUNT_W_ACTIVE (1 << 4) /* not ready for write */
41#define TIMER_MATCH_W_ACTIVE (1 << 0) /* not ready for write */
42#define VT8500_TIMER_HZ 3000000
43
44#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t)
45
46static void __iomem *regbase;
47
48static cycle_t vt8500_timer_read(struct clocksource *cs)
49{
50 int loops = msecs_to_loops(10);
51 writel(3, regbase + TIMER_CTRL_VAL);
52 while ((readl((regbase + TIMER_AS_VAL)) & TIMER_COUNT_R_ACTIVE)
53 && --loops)
54 cpu_relax();
55 return readl(regbase + TIMER_COUNT_VAL);
56}
57
58struct clocksource clocksource = {
59 .name = "vt8500_timer",
60 .rating = 200,
61 .read = vt8500_timer_read,
62 .mask = CLOCKSOURCE_MASK(32),
63 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
64};
65
66static int vt8500_timer_set_next_event(unsigned long cycles,
67 struct clock_event_device *evt)
68{
69 int loops = msecs_to_loops(10);
70 cycle_t alarm = clocksource.read(&clocksource) + cycles;
71 while ((readl(regbase + TIMER_AS_VAL) & TIMER_MATCH_W_ACTIVE)
72 && --loops)
73 cpu_relax();
74 writel((unsigned long)alarm, regbase + TIMER_MATCH_VAL);
75
76 if ((signed)(alarm - clocksource.read(&clocksource)) <= 16)
77 return -ETIME;
78
79 writel(1, regbase + TIMER_IER_VAL);
80
81 return 0;
82}
83
84static void vt8500_timer_set_mode(enum clock_event_mode mode,
85 struct clock_event_device *evt)
86{
87 switch (mode) {
88 case CLOCK_EVT_MODE_RESUME:
89 case CLOCK_EVT_MODE_PERIODIC:
90 break;
91 case CLOCK_EVT_MODE_ONESHOT:
92 case CLOCK_EVT_MODE_UNUSED:
93 case CLOCK_EVT_MODE_SHUTDOWN:
94 writel(readl(regbase + TIMER_CTRL_VAL) | 1,
95 regbase + TIMER_CTRL_VAL);
96 writel(0, regbase + TIMER_IER_VAL);
97 break;
98 }
99}
100
101struct clock_event_device clockevent = {
102 .name = "vt8500_timer",
103 .features = CLOCK_EVT_FEAT_ONESHOT,
104 .rating = 200,
105 .set_next_event = vt8500_timer_set_next_event,
106 .set_mode = vt8500_timer_set_mode,
107};
108
109static irqreturn_t vt8500_timer_interrupt(int irq, void *dev_id)
110{
111 struct clock_event_device *evt = dev_id;
112 writel(0xf, regbase + TIMER_STATUS_VAL);
113 evt->event_handler(evt);
114
115 return IRQ_HANDLED;
116}
117
118struct irqaction irq = {
119 .name = "vt8500_timer",
120 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
121 .handler = vt8500_timer_interrupt,
122 .dev_id = &clockevent,
123};
124
125static void __init vt8500_timer_init(void)
126{
127 regbase = ioremap(wmt_pmc_base + VT8500_TIMER_OFFSET, 0x28);
128 if (!regbase)
129 printk(KERN_ERR "vt8500_timer_init: failed to map MMIO registers\n");
130
131 writel(1, regbase + TIMER_CTRL_VAL);
132 writel(0xf, regbase + TIMER_STATUS_VAL);
133 writel(~0, regbase + TIMER_MATCH_VAL);
134
135 if (clocksource_register_hz(&clocksource, VT8500_TIMER_HZ))
136 printk(KERN_ERR "vt8500_timer_init: clocksource_register failed for %s\n",
137 clocksource.name);
138
139 clockevents_calc_mult_shift(&clockevent, VT8500_TIMER_HZ, 4);
140
141 /* copy-pasted from mach-msm; no idea */
142 clockevent.max_delta_ns =
143 clockevent_delta2ns(0xf0000000, &clockevent);
144 clockevent.min_delta_ns = clockevent_delta2ns(4, &clockevent);
145 clockevent.cpumask = cpumask_of(0);
146
147 if (setup_irq(wmt_timer_irq, &irq))
148 printk(KERN_ERR "vt8500_timer_init: setup_irq failed for %s\n",
149 clockevent.name);
150 clockevents_register_device(&clockevent);
151}
152
153struct sys_timer vt8500_timer = {
154 .init = vt8500_timer_init
155};
diff --git a/arch/arm/mach-vt8500/wm8505_7in.c b/arch/arm/mach-vt8500/wm8505_7in.c
new file mode 100644
index 000000000000..e73aadbcafd6
--- /dev/null
+++ b/arch/arm/mach-vt8500/wm8505_7in.c
@@ -0,0 +1,77 @@
1/*
2 * arch/arm/mach-vt8500/wm8505_7in.c
3 *
4 * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/io.h>
22#include <linux/pm.h>
23
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26
27#include "devices.h"
28
29static void __iomem *pmc_hiber;
30
31static struct platform_device *devices[] __initdata = {
32 &vt8500_device_uart0,
33 &vt8500_device_ehci,
34 &vt8500_device_wm8505_fb,
35 &vt8500_device_ge_rops,
36 &vt8500_device_pwm,
37 &vt8500_device_pwmbl,
38 &vt8500_device_rtc,
39};
40
41static void vt8500_power_off(void)
42{
43 local_irq_disable();
44 writew(5, pmc_hiber);
45 asm("mcr%? p15, 0, %0, c7, c0, 4" : : "r" (0));
46}
47
48void __init wm8505_7in_init(void)
49{
50#ifdef CONFIG_FB_WM8505
51 void __iomem *gpio_mux_reg = ioremap(wmt_gpio_base + 0x200, 4);
52 if (gpio_mux_reg) {
53 writel(readl(gpio_mux_reg) | 0x80000000, gpio_mux_reg);
54 iounmap(gpio_mux_reg);
55 } else {
56 printk(KERN_ERR "Could not remap the GPIO mux register, display may not work properly!\n");
57 }
58#endif
59 pmc_hiber = ioremap(wmt_pmc_base + 0x12, 2);
60 if (pmc_hiber)
61 pm_power_off = &vt8500_power_off;
62 else
63 printk(KERN_ERR "PMC Hibernation register could not be remapped, not enabling power off!\n");
64
65 wm8505_set_resources();
66 platform_add_devices(devices, ARRAY_SIZE(devices));
67 vt8500_gpio_init();
68}
69
70MACHINE_START(WM8505_7IN_NETBOOK, "WM8505 7-inch generic netbook")
71 .boot_params = 0x00000100,
72 .reserve = wm8505_reserve_mem,
73 .map_io = wm8505_map_io,
74 .init_irq = wm8505_init_irq,
75 .timer = &vt8500_timer,
76 .init_machine = wm8505_7in_init,
77MACHINE_END
diff --git a/arch/arm/mach-w90x900/include/mach/memory.h b/arch/arm/mach-w90x900/include/mach/memory.h
index 971b80702c27..f02905ba7746 100644
--- a/arch/arm/mach-w90x900/include/mach/memory.h
+++ b/arch/arm/mach-w90x900/include/mach/memory.h
@@ -18,6 +18,6 @@
18#ifndef __ASM_ARCH_MEMORY_H 18#ifndef __ASM_ARCH_MEMORY_H
19#define __ASM_ARCH_MEMORY_H 19#define __ASM_ARCH_MEMORY_H
20 20
21#define PHYS_OFFSET UL(0x00000000) 21#define PLAT_PHYS_OFFSET UL(0x00000000)
22 22
23#endif 23#endif
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 9d30c6f804b9..0074b8dba793 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -390,7 +390,7 @@ config CPU_PJ4
390 390
391# ARMv6 391# ARMv6
392config CPU_V6 392config CPU_V6
393 bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX || ARCH_DOVE 393 bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX
394 select CPU_32v6 394 select CPU_32v6
395 select CPU_ABRT_EV6 395 select CPU_ABRT_EV6
396 select CPU_PABRT_V6 396 select CPU_PABRT_V6
@@ -402,21 +402,23 @@ config CPU_V6
402 select CPU_TLB_V6 if MMU 402 select CPU_TLB_V6 if MMU
403 403
404# ARMv6k 404# ARMv6k
405config CPU_32v6K 405config CPU_V6K
406 bool "Support ARM V6K processor extensions" if !SMP 406 bool "Support ARM V6K processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX
407 depends on CPU_V6 || CPU_V7 407 select CPU_32v6
408 default y if SMP && !(ARCH_MX3 || ARCH_OMAP2) 408 select CPU_32v6K
409 help 409 select CPU_ABRT_EV6
410 Say Y here if your ARMv6 processor supports the 'K' extension. 410 select CPU_PABRT_V6
411 This enables the kernel to use some instructions not present 411 select CPU_CACHE_V6
412 on previous processors, and as such a kernel build with this 412 select CPU_CACHE_VIPT
413 enabled will not boot on processors with do not support these 413 select CPU_CP15_MMU
414 instructions. 414 select CPU_HAS_ASID if MMU
415 select CPU_COPY_V6 if MMU
416 select CPU_TLB_V6 if MMU
415 417
416# ARMv7 418# ARMv7
417config CPU_V7 419config CPU_V7
418 bool "Support ARM V7 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX 420 bool "Support ARM V7 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX
419 select CPU_32v6K if !ARCH_OMAP2 421 select CPU_32v6K
420 select CPU_32v7 422 select CPU_32v7
421 select CPU_ABRT_EV7 423 select CPU_ABRT_EV7
422 select CPU_PABRT_V7 424 select CPU_PABRT_V7
@@ -433,25 +435,33 @@ config CPU_32v3
433 bool 435 bool
434 select TLS_REG_EMUL if SMP || !MMU 436 select TLS_REG_EMUL if SMP || !MMU
435 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP 437 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
438 select CPU_USE_DOMAINS if MMU
436 439
437config CPU_32v4 440config CPU_32v4
438 bool 441 bool
439 select TLS_REG_EMUL if SMP || !MMU 442 select TLS_REG_EMUL if SMP || !MMU
440 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP 443 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
444 select CPU_USE_DOMAINS if MMU
441 445
442config CPU_32v4T 446config CPU_32v4T
443 bool 447 bool
444 select TLS_REG_EMUL if SMP || !MMU 448 select TLS_REG_EMUL if SMP || !MMU
445 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP 449 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
450 select CPU_USE_DOMAINS if MMU
446 451
447config CPU_32v5 452config CPU_32v5
448 bool 453 bool
449 select TLS_REG_EMUL if SMP || !MMU 454 select TLS_REG_EMUL if SMP || !MMU
450 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP 455 select NEEDS_SYSCALL_FOR_CMPXCHG if SMP
456 select CPU_USE_DOMAINS if MMU
451 457
452config CPU_32v6 458config CPU_32v6
453 bool 459 bool
454 select TLS_REG_EMUL if !CPU_32v6K && !MMU 460 select TLS_REG_EMUL if !CPU_32v6K && !MMU
461 select CPU_USE_DOMAINS if CPU_V6 && MMU
462
463config CPU_32v6K
464 bool
455 465
456config CPU_32v7 466config CPU_32v7
457 bool 467 bool
@@ -607,8 +617,6 @@ config CPU_CP15_MPU
607 617
608config CPU_USE_DOMAINS 618config CPU_USE_DOMAINS
609 bool 619 bool
610 depends on MMU
611 default y if !CPU_32v6K
612 help 620 help
613 This option enables or disables the use of domain switching 621 This option enables or disables the use of domain switching
614 via the set_fs() function. 622 via the set_fs() function.
@@ -623,7 +631,7 @@ comment "Processor Features"
623 631
624config ARM_THUMB 632config ARM_THUMB
625 bool "Support Thumb user binaries" 633 bool "Support Thumb user binaries"
626 depends on CPU_ARM720T || CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || CPU_ARM1020 || CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_V6 || CPU_V7 || CPU_FEROCEON 634 depends on CPU_ARM720T || CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || CPU_ARM1020 || CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_V6 || CPU_V6K || CPU_V7 || CPU_FEROCEON
627 default y 635 default y
628 help 636 help
629 Say Y if you want to include kernel support for running user space 637 Say Y if you want to include kernel support for running user space
@@ -644,7 +652,7 @@ config ARM_THUMBEE
644 652
645config SWP_EMULATE 653config SWP_EMULATE
646 bool "Emulate SWP/SWPB instructions" 654 bool "Emulate SWP/SWPB instructions"
647 depends on CPU_V7 && !CPU_V6 655 depends on !CPU_USE_DOMAINS && CPU_V7
648 select HAVE_PROC_CPU if PROC_FS 656 select HAVE_PROC_CPU if PROC_FS
649 default y if SMP 657 default y if SMP
650 help 658 help
@@ -681,7 +689,7 @@ config CPU_BIG_ENDIAN
681config CPU_ENDIAN_BE8 689config CPU_ENDIAN_BE8
682 bool 690 bool
683 depends on CPU_BIG_ENDIAN 691 depends on CPU_BIG_ENDIAN
684 default CPU_V6 || CPU_V7 692 default CPU_V6 || CPU_V6K || CPU_V7
685 help 693 help
686 Support for the BE-8 (big-endian) mode on ARMv6 and ARMv7 processors. 694 Support for the BE-8 (big-endian) mode on ARMv6 and ARMv7 processors.
687 695
@@ -747,7 +755,7 @@ config CPU_CACHE_ROUND_ROBIN
747 755
748config CPU_BPREDICT_DISABLE 756config CPU_BPREDICT_DISABLE
749 bool "Disable branch prediction" 757 bool "Disable branch prediction"
750 depends on CPU_ARM1020 || CPU_V6 || CPU_MOHAWK || CPU_XSC3 || CPU_V7 || CPU_FA526 758 depends on CPU_ARM1020 || CPU_V6 || CPU_V6K || CPU_MOHAWK || CPU_XSC3 || CPU_V7 || CPU_FA526
751 help 759 help
752 Say Y here to disable branch prediction. If unsure, say N. 760 Say Y here to disable branch prediction. If unsure, say N.
753 761
@@ -767,7 +775,7 @@ config NEEDS_SYSCALL_FOR_CMPXCHG
767 775
768config DMA_CACHE_RWFO 776config DMA_CACHE_RWFO
769 bool "Enable read/write for ownership DMA cache maintenance" 777 bool "Enable read/write for ownership DMA cache maintenance"
770 depends on CPU_V6 && SMP 778 depends on CPU_V6K && SMP
771 default y 779 default y
772 help 780 help
773 The Snoop Control Unit on ARM11MPCore does not detect the 781 The Snoop Control Unit on ARM11MPCore does not detect the
@@ -811,8 +819,8 @@ config CACHE_FEROCEON_L2_WRITETHROUGH
811config CACHE_L2X0 819config CACHE_L2X0
812 bool "Enable the L2x0 outer cache controller" 820 bool "Enable the L2x0 outer cache controller"
813 depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \ 821 depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \
814 REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX || \ 822 REALVIEW_EB_A9MP || SOC_IMX35 || SOC_IMX31 || MACH_REALVIEW_PBX || \
815 ARCH_NOMADIK || ARCH_OMAP4 || ARCH_S5PV310 || ARCH_TEGRA || \ 823 ARCH_NOMADIK || ARCH_OMAP4 || ARCH_EXYNOS4 || ARCH_TEGRA || \
816 ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || ARCH_SHMOBILE 824 ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || ARCH_SHMOBILE
817 default y 825 default y
818 select OUTER_CACHE 826 select OUTER_CACHE
@@ -823,7 +831,7 @@ config CACHE_L2X0
823config CACHE_PL310 831config CACHE_PL310
824 bool 832 bool
825 depends on CACHE_L2X0 833 depends on CACHE_L2X0
826 default y if CPU_V7 && !CPU_V6 834 default y if CPU_V7 && !(CPU_V6 || CPU_V6K)
827 help 835 help
828 This option enables optimisations for the PL310 cache 836 This option enables optimisations for the PL310 cache
829 controller. 837 controller.
@@ -845,16 +853,21 @@ config CACHE_XSC3L2
845 help 853 help
846 This option enables the L2 cache on XScale3. 854 This option enables the L2 cache on XScale3.
847 855
856config ARM_L1_CACHE_SHIFT_6
857 bool
858 help
859 Setting ARM L1 cache line size to 64 Bytes.
860
848config ARM_L1_CACHE_SHIFT 861config ARM_L1_CACHE_SHIFT
849 int 862 int
850 default 6 if ARM_L1_CACHE_SHIFT_6 863 default 6 if ARM_L1_CACHE_SHIFT_6
851 default 5 864 default 5
852 865
853config ARM_DMA_MEM_BUFFERABLE 866config ARM_DMA_MEM_BUFFERABLE
854 bool "Use non-cacheable memory for DMA" if CPU_V6 && !CPU_V7 867 bool "Use non-cacheable memory for DMA" if (CPU_V6 || CPU_V6K) && !CPU_V7
855 depends on !(MACH_REALVIEW_PB1176 || REALVIEW_EB_ARM11MP || \ 868 depends on !(MACH_REALVIEW_PB1176 || REALVIEW_EB_ARM11MP || \
856 MACH_REALVIEW_PB11MP) 869 MACH_REALVIEW_PB11MP)
857 default y if CPU_V6 || CPU_V7 870 default y if CPU_V6 || CPU_V6K || CPU_V7
858 help 871 help
859 Historically, the kernel has used strongly ordered mappings to 872 Historically, the kernel has used strongly ordered mappings to
860 provide DMA coherent memory. With the advent of ARMv7, mapping 873 provide DMA coherent memory. With the advent of ARMv7, mapping
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile
index 00d74a04af3a..bca7e61928c7 100644
--- a/arch/arm/mm/Makefile
+++ b/arch/arm/mm/Makefile
@@ -90,6 +90,7 @@ obj-$(CONFIG_CPU_XSC3) += proc-xsc3.o
90obj-$(CONFIG_CPU_MOHAWK) += proc-mohawk.o 90obj-$(CONFIG_CPU_MOHAWK) += proc-mohawk.o
91obj-$(CONFIG_CPU_FEROCEON) += proc-feroceon.o 91obj-$(CONFIG_CPU_FEROCEON) += proc-feroceon.o
92obj-$(CONFIG_CPU_V6) += proc-v6.o 92obj-$(CONFIG_CPU_V6) += proc-v6.o
93obj-$(CONFIG_CPU_V6K) += proc-v6.o
93obj-$(CONFIG_CPU_V7) += proc-v7.o 94obj-$(CONFIG_CPU_V7) += proc-v7.o
94 95
95AFLAGS_proc-v6.o :=-Wa,-march=armv6 96AFLAGS_proc-v6.o :=-Wa,-march=armv6
diff --git a/arch/arm/mm/abort-ev6.S b/arch/arm/mm/abort-ev6.S
index f332df7f0d37..1478aa522144 100644
--- a/arch/arm/mm/abort-ev6.S
+++ b/arch/arm/mm/abort-ev6.S
@@ -20,11 +20,11 @@
20 */ 20 */
21 .align 5 21 .align 5
22ENTRY(v6_early_abort) 22ENTRY(v6_early_abort)
23#ifdef CONFIG_CPU_32v6K 23#ifdef CONFIG_CPU_V6
24 clrex
25#else
26 sub r1, sp, #4 @ Get unused stack location 24 sub r1, sp, #4 @ Get unused stack location
27 strex r0, r1, [r1] @ Clear the exclusive monitor 25 strex r0, r1, [r1] @ Clear the exclusive monitor
26#elif defined(CONFIG_CPU_32v6K)
27 clrex
28#endif 28#endif
29 mrc p15, 0, r1, c5, c0, 0 @ get FSR 29 mrc p15, 0, r1, c5, c0, 0 @ get FSR
30 mrc p15, 0, r0, c6, c0, 0 @ get FAR 30 mrc p15, 0, r0, c6, c0, 0 @ get FAR
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 170c9bb95866..ef59099a5463 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -49,7 +49,13 @@ static inline void cache_wait(void __iomem *reg, unsigned long mask)
49static inline void cache_sync(void) 49static inline void cache_sync(void)
50{ 50{
51 void __iomem *base = l2x0_base; 51 void __iomem *base = l2x0_base;
52
53#ifdef CONFIG_ARM_ERRATA_753970
54 /* write to an unmmapped register */
55 writel_relaxed(0, base + L2X0_DUMMY_REG);
56#else
52 writel_relaxed(0, base + L2X0_CACHE_SYNC); 57 writel_relaxed(0, base + L2X0_CACHE_SYNC);
58#endif
53 cache_wait(base + L2X0_CACHE_SYNC, 1); 59 cache_wait(base + L2X0_CACHE_SYNC, 1);
54} 60}
55 61
@@ -67,18 +73,24 @@ static inline void l2x0_inv_line(unsigned long addr)
67 writel_relaxed(addr, base + L2X0_INV_LINE_PA); 73 writel_relaxed(addr, base + L2X0_INV_LINE_PA);
68} 74}
69 75
70#ifdef CONFIG_PL310_ERRATA_588369 76#if defined(CONFIG_PL310_ERRATA_588369) || defined(CONFIG_PL310_ERRATA_727915)
71static void debug_writel(unsigned long val)
72{
73 extern void omap_smc1(u32 fn, u32 arg);
74 77
75 /* 78#define debug_writel(val) outer_cache.set_debug(val)
76 * Texas Instrument secure monitor api to modify the 79
77 * PL310 Debug Control Register. 80static void l2x0_set_debug(unsigned long val)
78 */ 81{
79 omap_smc1(0x100, val); 82 writel_relaxed(val, l2x0_base + L2X0_DEBUG_CTRL);
83}
84#else
85/* Optimised out for non-errata case */
86static inline void debug_writel(unsigned long val)
87{
80} 88}
81 89
90#define l2x0_set_debug NULL
91#endif
92
93#ifdef CONFIG_PL310_ERRATA_588369
82static inline void l2x0_flush_line(unsigned long addr) 94static inline void l2x0_flush_line(unsigned long addr)
83{ 95{
84 void __iomem *base = l2x0_base; 96 void __iomem *base = l2x0_base;
@@ -91,11 +103,6 @@ static inline void l2x0_flush_line(unsigned long addr)
91} 103}
92#else 104#else
93 105
94/* Optimised out for non-errata case */
95static inline void debug_writel(unsigned long val)
96{
97}
98
99static inline void l2x0_flush_line(unsigned long addr) 106static inline void l2x0_flush_line(unsigned long addr)
100{ 107{
101 void __iomem *base = l2x0_base; 108 void __iomem *base = l2x0_base;
@@ -119,9 +126,11 @@ static void l2x0_flush_all(void)
119 126
120 /* clean all ways */ 127 /* clean all ways */
121 spin_lock_irqsave(&l2x0_lock, flags); 128 spin_lock_irqsave(&l2x0_lock, flags);
129 debug_writel(0x03);
122 writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_CLEAN_INV_WAY); 130 writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_CLEAN_INV_WAY);
123 cache_wait_way(l2x0_base + L2X0_CLEAN_INV_WAY, l2x0_way_mask); 131 cache_wait_way(l2x0_base + L2X0_CLEAN_INV_WAY, l2x0_way_mask);
124 cache_sync(); 132 cache_sync();
133 debug_writel(0x00);
125 spin_unlock_irqrestore(&l2x0_lock, flags); 134 spin_unlock_irqrestore(&l2x0_lock, flags);
126} 135}
127 136
@@ -329,6 +338,7 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask)
329 outer_cache.flush_all = l2x0_flush_all; 338 outer_cache.flush_all = l2x0_flush_all;
330 outer_cache.inv_all = l2x0_inv_all; 339 outer_cache.inv_all = l2x0_inv_all;
331 outer_cache.disable = l2x0_disable; 340 outer_cache.disable = l2x0_disable;
341 outer_cache.set_debug = l2x0_set_debug;
332 342
333 printk(KERN_INFO "%s cache controller enabled\n", type); 343 printk(KERN_INFO "%s cache controller enabled\n", type);
334 printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x, Cache size: %d B\n", 344 printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x, Cache size: %d B\n",
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 4771dba61448..82a093cee09a 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -149,6 +149,7 @@ static int __init consistent_init(void)
149{ 149{
150 int ret = 0; 150 int ret = 0;
151 pgd_t *pgd; 151 pgd_t *pgd;
152 pud_t *pud;
152 pmd_t *pmd; 153 pmd_t *pmd;
153 pte_t *pte; 154 pte_t *pte;
154 int i = 0; 155 int i = 0;
@@ -156,7 +157,15 @@ static int __init consistent_init(void)
156 157
157 do { 158 do {
158 pgd = pgd_offset(&init_mm, base); 159 pgd = pgd_offset(&init_mm, base);
159 pmd = pmd_alloc(&init_mm, pgd, base); 160
161 pud = pud_alloc(&init_mm, pgd, base);
162 if (!pud) {
163 printk(KERN_ERR "%s: no pud tables\n", __func__);
164 ret = -ENOMEM;
165 break;
166 }
167
168 pmd = pmd_alloc(&init_mm, pud, base);
160 if (!pmd) { 169 if (!pmd) {
161 printk(KERN_ERR "%s: no pmd tables\n", __func__); 170 printk(KERN_ERR "%s: no pmd tables\n", __func__);
162 ret = -ENOMEM; 171 ret = -ENOMEM;
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c
index 01210dba0221..7cab79179421 100644
--- a/arch/arm/mm/fault-armv.c
+++ b/arch/arm/mm/fault-armv.c
@@ -95,6 +95,7 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address,
95{ 95{
96 spinlock_t *ptl; 96 spinlock_t *ptl;
97 pgd_t *pgd; 97 pgd_t *pgd;
98 pud_t *pud;
98 pmd_t *pmd; 99 pmd_t *pmd;
99 pte_t *pte; 100 pte_t *pte;
100 int ret; 101 int ret;
@@ -103,7 +104,11 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address,
103 if (pgd_none_or_clear_bad(pgd)) 104 if (pgd_none_or_clear_bad(pgd))
104 return 0; 105 return 0;
105 106
106 pmd = pmd_offset(pgd, address); 107 pud = pud_offset(pgd, address);
108 if (pud_none_or_clear_bad(pud))
109 return 0;
110
111 pmd = pmd_offset(pud, address);
107 if (pmd_none_or_clear_bad(pmd)) 112 if (pmd_none_or_clear_bad(pmd))
108 return 0; 113 return 0;
109 114
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index f10f9bac2206..bc0e1d88fd3b 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -76,9 +76,11 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
76 76
77 printk(KERN_ALERT "pgd = %p\n", mm->pgd); 77 printk(KERN_ALERT "pgd = %p\n", mm->pgd);
78 pgd = pgd_offset(mm, addr); 78 pgd = pgd_offset(mm, addr);
79 printk(KERN_ALERT "[%08lx] *pgd=%08lx", addr, pgd_val(*pgd)); 79 printk(KERN_ALERT "[%08lx] *pgd=%08llx",
80 addr, (long long)pgd_val(*pgd));
80 81
81 do { 82 do {
83 pud_t *pud;
82 pmd_t *pmd; 84 pmd_t *pmd;
83 pte_t *pte; 85 pte_t *pte;
84 86
@@ -90,9 +92,21 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
90 break; 92 break;
91 } 93 }
92 94
93 pmd = pmd_offset(pgd, addr); 95 pud = pud_offset(pgd, addr);
96 if (PTRS_PER_PUD != 1)
97 printk(", *pud=%08lx", pud_val(*pud));
98
99 if (pud_none(*pud))
100 break;
101
102 if (pud_bad(*pud)) {
103 printk("(bad)");
104 break;
105 }
106
107 pmd = pmd_offset(pud, addr);
94 if (PTRS_PER_PMD != 1) 108 if (PTRS_PER_PMD != 1)
95 printk(", *pmd=%08lx", pmd_val(*pmd)); 109 printk(", *pmd=%08llx", (long long)pmd_val(*pmd));
96 110
97 if (pmd_none(*pmd)) 111 if (pmd_none(*pmd))
98 break; 112 break;
@@ -107,8 +121,9 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
107 break; 121 break;
108 122
109 pte = pte_offset_map(pmd, addr); 123 pte = pte_offset_map(pmd, addr);
110 printk(", *pte=%08lx", pte_val(*pte)); 124 printk(", *pte=%08llx", (long long)pte_val(*pte));
111 printk(", *ppte=%08lx", pte_val(pte[PTE_HWTABLE_PTRS])); 125 printk(", *ppte=%08llx",
126 (long long)pte_val(pte[PTE_HWTABLE_PTRS]));
112 pte_unmap(pte); 127 pte_unmap(pte);
113 } while(0); 128 } while(0);
114 129
@@ -388,6 +403,7 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
388{ 403{
389 unsigned int index; 404 unsigned int index;
390 pgd_t *pgd, *pgd_k; 405 pgd_t *pgd, *pgd_k;
406 pud_t *pud, *pud_k;
391 pmd_t *pmd, *pmd_k; 407 pmd_t *pmd, *pmd_k;
392 408
393 if (addr < TASK_SIZE) 409 if (addr < TASK_SIZE)
@@ -406,12 +422,19 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
406 422
407 if (pgd_none(*pgd_k)) 423 if (pgd_none(*pgd_k))
408 goto bad_area; 424 goto bad_area;
409
410 if (!pgd_present(*pgd)) 425 if (!pgd_present(*pgd))
411 set_pgd(pgd, *pgd_k); 426 set_pgd(pgd, *pgd_k);
412 427
413 pmd_k = pmd_offset(pgd_k, addr); 428 pud = pud_offset(pgd, addr);
414 pmd = pmd_offset(pgd, addr); 429 pud_k = pud_offset(pgd_k, addr);
430
431 if (pud_none(*pud_k))
432 goto bad_area;
433 if (!pud_present(*pud))
434 set_pud(pud, *pud_k);
435
436 pmd = pmd_offset(pud, addr);
437 pmd_k = pmd_offset(pud_k, addr);
415 438
416 /* 439 /*
417 * On ARM one Linux PGD entry contains two hardware entries (see page 440 * On ARM one Linux PGD entry contains two hardware entries (see page
diff --git a/arch/arm/mm/idmap.c b/arch/arm/mm/idmap.c
index 57299446f787..2be9139a4ef3 100644
--- a/arch/arm/mm/idmap.c
+++ b/arch/arm/mm/idmap.c
@@ -4,10 +4,10 @@
4#include <asm/pgalloc.h> 4#include <asm/pgalloc.h>
5#include <asm/pgtable.h> 5#include <asm/pgtable.h>
6 6
7static void idmap_add_pmd(pgd_t *pgd, unsigned long addr, unsigned long end, 7static void idmap_add_pmd(pud_t *pud, unsigned long addr, unsigned long end,
8 unsigned long prot) 8 unsigned long prot)
9{ 9{
10 pmd_t *pmd = pmd_offset(pgd, addr); 10 pmd_t *pmd = pmd_offset(pud, addr);
11 11
12 addr = (addr & PMD_MASK) | prot; 12 addr = (addr & PMD_MASK) | prot;
13 pmd[0] = __pmd(addr); 13 pmd[0] = __pmd(addr);
@@ -16,6 +16,18 @@ static void idmap_add_pmd(pgd_t *pgd, unsigned long addr, unsigned long end,
16 flush_pmd_entry(pmd); 16 flush_pmd_entry(pmd);
17} 17}
18 18
19static void idmap_add_pud(pgd_t *pgd, unsigned long addr, unsigned long end,
20 unsigned long prot)
21{
22 pud_t *pud = pud_offset(pgd, addr);
23 unsigned long next;
24
25 do {
26 next = pud_addr_end(addr, end);
27 idmap_add_pmd(pud, addr, next, prot);
28 } while (pud++, addr = next, addr != end);
29}
30
19void identity_mapping_add(pgd_t *pgd, unsigned long addr, unsigned long end) 31void identity_mapping_add(pgd_t *pgd, unsigned long addr, unsigned long end)
20{ 32{
21 unsigned long prot, next; 33 unsigned long prot, next;
@@ -27,17 +39,28 @@ void identity_mapping_add(pgd_t *pgd, unsigned long addr, unsigned long end)
27 pgd += pgd_index(addr); 39 pgd += pgd_index(addr);
28 do { 40 do {
29 next = pgd_addr_end(addr, end); 41 next = pgd_addr_end(addr, end);
30 idmap_add_pmd(pgd, addr, next, prot); 42 idmap_add_pud(pgd, addr, next, prot);
31 } while (pgd++, addr = next, addr != end); 43 } while (pgd++, addr = next, addr != end);
32} 44}
33 45
34#ifdef CONFIG_SMP 46#ifdef CONFIG_SMP
35static void idmap_del_pmd(pgd_t *pgd, unsigned long addr, unsigned long end) 47static void idmap_del_pmd(pud_t *pud, unsigned long addr, unsigned long end)
36{ 48{
37 pmd_t *pmd = pmd_offset(pgd, addr); 49 pmd_t *pmd = pmd_offset(pud, addr);
38 pmd_clear(pmd); 50 pmd_clear(pmd);
39} 51}
40 52
53static void idmap_del_pud(pgd_t *pgd, unsigned long addr, unsigned long end)
54{
55 pud_t *pud = pud_offset(pgd, addr);
56 unsigned long next;
57
58 do {
59 next = pud_addr_end(addr, end);
60 idmap_del_pmd(pud, addr, next);
61 } while (pud++, addr = next, addr != end);
62}
63
41void identity_mapping_del(pgd_t *pgd, unsigned long addr, unsigned long end) 64void identity_mapping_del(pgd_t *pgd, unsigned long addr, unsigned long end)
42{ 65{
43 unsigned long next; 66 unsigned long next;
@@ -45,7 +68,7 @@ void identity_mapping_del(pgd_t *pgd, unsigned long addr, unsigned long end)
45 pgd += pgd_index(addr); 68 pgd += pgd_index(addr);
46 do { 69 do {
47 next = pgd_addr_end(addr, end); 70 next = pgd_addr_end(addr, end);
48 idmap_del_pmd(pgd, addr, next); 71 idmap_del_pud(pgd, addr, next);
49 } while (pgd++, addr = next, addr != end); 72 } while (pgd++, addr = next, addr != end);
50} 73}
51#endif 74#endif
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 5164069ced42..e5f6fc428348 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -78,7 +78,7 @@ __tagtable(ATAG_INITRD2, parse_tag_initrd2);
78 */ 78 */
79struct meminfo meminfo; 79struct meminfo meminfo;
80 80
81void show_mem(void) 81void show_mem(unsigned int filter)
82{ 82{
83 int free = 0, total = 0, reserved = 0; 83 int free = 0, total = 0, reserved = 0;
84 int shared = 0, cached = 0, slab = 0, i; 84 int shared = 0, cached = 0, slab = 0, i;
@@ -297,6 +297,12 @@ void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
297 memblock_reserve(__pa(_stext), _end - _stext); 297 memblock_reserve(__pa(_stext), _end - _stext);
298#endif 298#endif
299#ifdef CONFIG_BLK_DEV_INITRD 299#ifdef CONFIG_BLK_DEV_INITRD
300 if (phys_initrd_size &&
301 memblock_is_region_reserved(phys_initrd_start, phys_initrd_size)) {
302 pr_err("INITRD: 0x%08lx+0x%08lx overlaps in-use memory region - disabling initrd\n",
303 phys_initrd_start, phys_initrd_size);
304 phys_initrd_start = phys_initrd_size = 0;
305 }
300 if (phys_initrd_size) { 306 if (phys_initrd_size) {
301 memblock_reserve(phys_initrd_start, phys_initrd_size); 307 memblock_reserve(phys_initrd_start, phys_initrd_size);
302 308
@@ -344,7 +350,7 @@ void __init bootmem_init(void)
344 */ 350 */
345 arm_bootmem_free(min, max_low, max_high); 351 arm_bootmem_free(min, max_low, max_high);
346 352
347 high_memory = __va((max_low << PAGE_SHIFT) - 1) + 1; 353 high_memory = __va(((phys_addr_t)max_low << PAGE_SHIFT) - 1) + 1;
348 354
349 /* 355 /*
350 * This doesn't seem to be used by the Linux memory manager any 356 * This doesn't seem to be used by the Linux memory manager any
@@ -392,8 +398,8 @@ free_memmap(unsigned long start_pfn, unsigned long end_pfn)
392 * Convert to physical addresses, and 398 * Convert to physical addresses, and
393 * round start upwards and end downwards. 399 * round start upwards and end downwards.
394 */ 400 */
395 pg = PAGE_ALIGN(__pa(start_pg)); 401 pg = (unsigned long)PAGE_ALIGN(__pa(start_pg));
396 pgend = __pa(end_pg) & PAGE_MASK; 402 pgend = (unsigned long)__pa(end_pg) & PAGE_MASK;
397 403
398 /* 404 /*
399 * If there are free pages between these, 405 * If there are free pages between these,
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
index 36960df5fb76..d2384106af9c 100644
--- a/arch/arm/mm/mm.h
+++ b/arch/arm/mm/mm.h
@@ -7,7 +7,7 @@ extern pmd_t *top_pmd;
7 7
8static inline pmd_t *pmd_off(pgd_t *pgd, unsigned long virt) 8static inline pmd_t *pmd_off(pgd_t *pgd, unsigned long virt)
9{ 9{
10 return pmd_offset(pgd, virt); 10 return pmd_offset(pud_offset(pgd, virt), virt);
11} 11}
12 12
13static inline pmd_t *pmd_off_k(unsigned long virt) 13static inline pmd_t *pmd_off_k(unsigned long virt)
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
index b0a98305055c..afe209e1e1f8 100644
--- a/arch/arm/mm/mmap.c
+++ b/arch/arm/mm/mmap.c
@@ -31,7 +31,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
31 struct mm_struct *mm = current->mm; 31 struct mm_struct *mm = current->mm;
32 struct vm_area_struct *vma; 32 struct vm_area_struct *vma;
33 unsigned long start_addr; 33 unsigned long start_addr;
34#ifdef CONFIG_CPU_V6 34#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
35 unsigned int cache_type; 35 unsigned int cache_type;
36 int do_align = 0, aliasing = 0; 36 int do_align = 0, aliasing = 0;
37 37
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 3c67e92f7d59..6cf76b3b68d1 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -533,7 +533,7 @@ static void __init *early_alloc(unsigned long sz)
533static pte_t * __init early_pte_alloc(pmd_t *pmd, unsigned long addr, unsigned long prot) 533static pte_t * __init early_pte_alloc(pmd_t *pmd, unsigned long addr, unsigned long prot)
534{ 534{
535 if (pmd_none(*pmd)) { 535 if (pmd_none(*pmd)) {
536 pte_t *pte = early_alloc(2 * PTRS_PER_PTE * sizeof(pte_t)); 536 pte_t *pte = early_alloc(PTE_HWTABLE_OFF + PTE_HWTABLE_SIZE);
537 __pmd_populate(pmd, __pa(pte), prot); 537 __pmd_populate(pmd, __pa(pte), prot);
538 } 538 }
539 BUG_ON(pmd_bad(*pmd)); 539 BUG_ON(pmd_bad(*pmd));
@@ -551,11 +551,11 @@ static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr,
551 } while (pte++, addr += PAGE_SIZE, addr != end); 551 } while (pte++, addr += PAGE_SIZE, addr != end);
552} 552}
553 553
554static void __init alloc_init_section(pgd_t *pgd, unsigned long addr, 554static void __init alloc_init_section(pud_t *pud, unsigned long addr,
555 unsigned long end, phys_addr_t phys, 555 unsigned long end, phys_addr_t phys,
556 const struct mem_type *type) 556 const struct mem_type *type)
557{ 557{
558 pmd_t *pmd = pmd_offset(pgd, addr); 558 pmd_t *pmd = pmd_offset(pud, addr);
559 559
560 /* 560 /*
561 * Try a section mapping - end, addr and phys must all be aligned 561 * Try a section mapping - end, addr and phys must all be aligned
@@ -584,6 +584,19 @@ static void __init alloc_init_section(pgd_t *pgd, unsigned long addr,
584 } 584 }
585} 585}
586 586
587static void alloc_init_pud(pgd_t *pgd, unsigned long addr, unsigned long end,
588 unsigned long phys, const struct mem_type *type)
589{
590 pud_t *pud = pud_offset(pgd, addr);
591 unsigned long next;
592
593 do {
594 next = pud_addr_end(addr, end);
595 alloc_init_section(pud, addr, next, phys, type);
596 phys += next - addr;
597 } while (pud++, addr = next, addr != end);
598}
599
587static void __init create_36bit_mapping(struct map_desc *md, 600static void __init create_36bit_mapping(struct map_desc *md,
588 const struct mem_type *type) 601 const struct mem_type *type)
589{ 602{
@@ -592,13 +605,13 @@ static void __init create_36bit_mapping(struct map_desc *md,
592 pgd_t *pgd; 605 pgd_t *pgd;
593 606
594 addr = md->virtual; 607 addr = md->virtual;
595 phys = (unsigned long)__pfn_to_phys(md->pfn); 608 phys = __pfn_to_phys(md->pfn);
596 length = PAGE_ALIGN(md->length); 609 length = PAGE_ALIGN(md->length);
597 610
598 if (!(cpu_architecture() >= CPU_ARCH_ARMv6 || cpu_is_xsc3())) { 611 if (!(cpu_architecture() >= CPU_ARCH_ARMv6 || cpu_is_xsc3())) {
599 printk(KERN_ERR "MM: CPU does not support supersection " 612 printk(KERN_ERR "MM: CPU does not support supersection "
600 "mapping for 0x%08llx at 0x%08lx\n", 613 "mapping for 0x%08llx at 0x%08lx\n",
601 __pfn_to_phys((u64)md->pfn), addr); 614 (long long)__pfn_to_phys((u64)md->pfn), addr);
602 return; 615 return;
603 } 616 }
604 617
@@ -611,14 +624,14 @@ static void __init create_36bit_mapping(struct map_desc *md,
611 if (type->domain) { 624 if (type->domain) {
612 printk(KERN_ERR "MM: invalid domain in supersection " 625 printk(KERN_ERR "MM: invalid domain in supersection "
613 "mapping for 0x%08llx at 0x%08lx\n", 626 "mapping for 0x%08llx at 0x%08lx\n",
614 __pfn_to_phys((u64)md->pfn), addr); 627 (long long)__pfn_to_phys((u64)md->pfn), addr);
615 return; 628 return;
616 } 629 }
617 630
618 if ((addr | length | __pfn_to_phys(md->pfn)) & ~SUPERSECTION_MASK) { 631 if ((addr | length | __pfn_to_phys(md->pfn)) & ~SUPERSECTION_MASK) {
619 printk(KERN_ERR "MM: cannot create mapping for " 632 printk(KERN_ERR "MM: cannot create mapping for 0x%08llx"
620 "0x%08llx at 0x%08lx invalid alignment\n", 633 " at 0x%08lx invalid alignment\n",
621 __pfn_to_phys((u64)md->pfn), addr); 634 (long long)__pfn_to_phys((u64)md->pfn), addr);
622 return; 635 return;
623 } 636 }
624 637
@@ -631,7 +644,8 @@ static void __init create_36bit_mapping(struct map_desc *md,
631 pgd = pgd_offset_k(addr); 644 pgd = pgd_offset_k(addr);
632 end = addr + length; 645 end = addr + length;
633 do { 646 do {
634 pmd_t *pmd = pmd_offset(pgd, addr); 647 pud_t *pud = pud_offset(pgd, addr);
648 pmd_t *pmd = pmd_offset(pud, addr);
635 int i; 649 int i;
636 650
637 for (i = 0; i < 16; i++) 651 for (i = 0; i < 16; i++)
@@ -652,22 +666,23 @@ static void __init create_36bit_mapping(struct map_desc *md,
652 */ 666 */
653static void __init create_mapping(struct map_desc *md) 667static void __init create_mapping(struct map_desc *md)
654{ 668{
655 unsigned long phys, addr, length, end; 669 unsigned long addr, length, end;
670 phys_addr_t phys;
656 const struct mem_type *type; 671 const struct mem_type *type;
657 pgd_t *pgd; 672 pgd_t *pgd;
658 673
659 if (md->virtual != vectors_base() && md->virtual < TASK_SIZE) { 674 if (md->virtual != vectors_base() && md->virtual < TASK_SIZE) {
660 printk(KERN_WARNING "BUG: not creating mapping for " 675 printk(KERN_WARNING "BUG: not creating mapping for 0x%08llx"
661 "0x%08llx at 0x%08lx in user region\n", 676 " at 0x%08lx in user region\n",
662 __pfn_to_phys((u64)md->pfn), md->virtual); 677 (long long)__pfn_to_phys((u64)md->pfn), md->virtual);
663 return; 678 return;
664 } 679 }
665 680
666 if ((md->type == MT_DEVICE || md->type == MT_ROM) && 681 if ((md->type == MT_DEVICE || md->type == MT_ROM) &&
667 md->virtual >= PAGE_OFFSET && md->virtual < VMALLOC_END) { 682 md->virtual >= PAGE_OFFSET && md->virtual < VMALLOC_END) {
668 printk(KERN_WARNING "BUG: mapping for 0x%08llx at 0x%08lx " 683 printk(KERN_WARNING "BUG: mapping for 0x%08llx"
669 "overlaps vmalloc space\n", 684 " at 0x%08lx overlaps vmalloc space\n",
670 __pfn_to_phys((u64)md->pfn), md->virtual); 685 (long long)__pfn_to_phys((u64)md->pfn), md->virtual);
671 } 686 }
672 687
673 type = &mem_types[md->type]; 688 type = &mem_types[md->type];
@@ -681,13 +696,13 @@ static void __init create_mapping(struct map_desc *md)
681 } 696 }
682 697
683 addr = md->virtual & PAGE_MASK; 698 addr = md->virtual & PAGE_MASK;
684 phys = (unsigned long)__pfn_to_phys(md->pfn); 699 phys = __pfn_to_phys(md->pfn);
685 length = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK)); 700 length = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK));
686 701
687 if (type->prot_l1 == 0 && ((addr | phys | length) & ~SECTION_MASK)) { 702 if (type->prot_l1 == 0 && ((addr | phys | length) & ~SECTION_MASK)) {
688 printk(KERN_WARNING "BUG: map for 0x%08lx at 0x%08lx can not " 703 printk(KERN_WARNING "BUG: map for 0x%08llx at 0x%08lx can not "
689 "be mapped using pages, ignoring.\n", 704 "be mapped using pages, ignoring.\n",
690 __pfn_to_phys(md->pfn), addr); 705 (long long)__pfn_to_phys(md->pfn), addr);
691 return; 706 return;
692 } 707 }
693 708
@@ -696,7 +711,7 @@ static void __init create_mapping(struct map_desc *md)
696 do { 711 do {
697 unsigned long next = pgd_addr_end(addr, end); 712 unsigned long next = pgd_addr_end(addr, end);
698 713
699 alloc_init_section(pgd, addr, next, phys, type); 714 alloc_init_pud(pgd, addr, next, phys, type);
700 715
701 phys += next - addr; 716 phys += next - addr;
702 addr = next; 717 addr = next;
@@ -794,9 +809,10 @@ static void __init sanity_check_meminfo(void)
794 */ 809 */
795 if (__va(bank->start) >= vmalloc_min || 810 if (__va(bank->start) >= vmalloc_min ||
796 __va(bank->start) < (void *)PAGE_OFFSET) { 811 __va(bank->start) < (void *)PAGE_OFFSET) {
797 printk(KERN_NOTICE "Ignoring RAM at %.8lx-%.8lx " 812 printk(KERN_NOTICE "Ignoring RAM at %.8llx-%.8llx "
798 "(vmalloc region overlap).\n", 813 "(vmalloc region overlap).\n",
799 bank->start, bank->start + bank->size - 1); 814 (unsigned long long)bank->start,
815 (unsigned long long)bank->start + bank->size - 1);
800 continue; 816 continue;
801 } 817 }
802 818
@@ -807,10 +823,11 @@ static void __init sanity_check_meminfo(void)
807 if (__va(bank->start + bank->size) > vmalloc_min || 823 if (__va(bank->start + bank->size) > vmalloc_min ||
808 __va(bank->start + bank->size) < __va(bank->start)) { 824 __va(bank->start + bank->size) < __va(bank->start)) {
809 unsigned long newsize = vmalloc_min - __va(bank->start); 825 unsigned long newsize = vmalloc_min - __va(bank->start);
810 printk(KERN_NOTICE "Truncating RAM at %.8lx-%.8lx " 826 printk(KERN_NOTICE "Truncating RAM at %.8llx-%.8llx "
811 "to -%.8lx (vmalloc region overlap).\n", 827 "to -%.8llx (vmalloc region overlap).\n",
812 bank->start, bank->start + bank->size - 1, 828 (unsigned long long)bank->start,
813 bank->start + newsize - 1); 829 (unsigned long long)bank->start + bank->size - 1,
830 (unsigned long long)bank->start + newsize - 1);
814 bank->size = newsize; 831 bank->size = newsize;
815 } 832 }
816#endif 833#endif
@@ -827,16 +844,6 @@ static void __init sanity_check_meminfo(void)
827 * rather difficult. 844 * rather difficult.
828 */ 845 */
829 reason = "with VIPT aliasing cache"; 846 reason = "with VIPT aliasing cache";
830 } else if (is_smp() && tlb_ops_need_broadcast()) {
831 /*
832 * kmap_high needs to occasionally flush TLB entries,
833 * however, if the TLB entries need to be broadcast
834 * we may deadlock:
835 * kmap_high(irqs off)->flush_all_zero_pkmaps->
836 * flush_tlb_kernel_range->smp_call_function_many
837 * (must not be called with irqs off)
838 */
839 reason = "without hardware TLB ops broadcasting";
840 } 847 }
841 if (reason) { 848 if (reason) {
842 printk(KERN_CRIT "HIGHMEM is not supported %s, ignoring high memory\n", 849 printk(KERN_CRIT "HIGHMEM is not supported %s, ignoring high memory\n",
diff --git a/arch/arm/mm/pgd.c b/arch/arm/mm/pgd.c
index 709244c66fa3..b2027c154b2a 100644
--- a/arch/arm/mm/pgd.c
+++ b/arch/arm/mm/pgd.c
@@ -23,6 +23,7 @@
23pgd_t *pgd_alloc(struct mm_struct *mm) 23pgd_t *pgd_alloc(struct mm_struct *mm)
24{ 24{
25 pgd_t *new_pgd, *init_pgd; 25 pgd_t *new_pgd, *init_pgd;
26 pud_t *new_pud, *init_pud;
26 pmd_t *new_pmd, *init_pmd; 27 pmd_t *new_pmd, *init_pmd;
27 pte_t *new_pte, *init_pte; 28 pte_t *new_pte, *init_pte;
28 29
@@ -46,7 +47,11 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
46 * On ARM, first page must always be allocated since it 47 * On ARM, first page must always be allocated since it
47 * contains the machine vectors. 48 * contains the machine vectors.
48 */ 49 */
49 new_pmd = pmd_alloc(mm, new_pgd, 0); 50 new_pud = pud_alloc(mm, new_pgd, 0);
51 if (!new_pud)
52 goto no_pud;
53
54 new_pmd = pmd_alloc(mm, new_pud, 0);
50 if (!new_pmd) 55 if (!new_pmd)
51 goto no_pmd; 56 goto no_pmd;
52 57
@@ -54,7 +59,8 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
54 if (!new_pte) 59 if (!new_pte)
55 goto no_pte; 60 goto no_pte;
56 61
57 init_pmd = pmd_offset(init_pgd, 0); 62 init_pud = pud_offset(init_pgd, 0);
63 init_pmd = pmd_offset(init_pud, 0);
58 init_pte = pte_offset_map(init_pmd, 0); 64 init_pte = pte_offset_map(init_pmd, 0);
59 set_pte_ext(new_pte, *init_pte, 0); 65 set_pte_ext(new_pte, *init_pte, 0);
60 pte_unmap(init_pte); 66 pte_unmap(init_pte);
@@ -66,6 +72,8 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
66no_pte: 72no_pte:
67 pmd_free(mm, new_pmd); 73 pmd_free(mm, new_pmd);
68no_pmd: 74no_pmd:
75 pud_free(mm, new_pud);
76no_pud:
69 free_pages((unsigned long)new_pgd, 2); 77 free_pages((unsigned long)new_pgd, 2);
70no_pgd: 78no_pgd:
71 return NULL; 79 return NULL;
@@ -74,6 +82,7 @@ no_pgd:
74void pgd_free(struct mm_struct *mm, pgd_t *pgd_base) 82void pgd_free(struct mm_struct *mm, pgd_t *pgd_base)
75{ 83{
76 pgd_t *pgd; 84 pgd_t *pgd;
85 pud_t *pud;
77 pmd_t *pmd; 86 pmd_t *pmd;
78 pgtable_t pte; 87 pgtable_t pte;
79 88
@@ -84,7 +93,11 @@ void pgd_free(struct mm_struct *mm, pgd_t *pgd_base)
84 if (pgd_none_or_clear_bad(pgd)) 93 if (pgd_none_or_clear_bad(pgd))
85 goto no_pgd; 94 goto no_pgd;
86 95
87 pmd = pmd_offset(pgd, 0); 96 pud = pud_offset(pgd, 0);
97 if (pud_none_or_clear_bad(pud))
98 goto no_pud;
99
100 pmd = pmd_offset(pud, 0);
88 if (pmd_none_or_clear_bad(pmd)) 101 if (pmd_none_or_clear_bad(pmd))
89 goto no_pmd; 102 goto no_pmd;
90 103
@@ -92,8 +105,11 @@ void pgd_free(struct mm_struct *mm, pgd_t *pgd_base)
92 pmd_clear(pmd); 105 pmd_clear(pmd);
93 pte_free(mm, pte); 106 pte_free(mm, pte);
94no_pmd: 107no_pmd:
95 pgd_clear(pgd); 108 pud_clear(pud);
96 pmd_free(mm, pmd); 109 pmd_free(mm, pmd);
110no_pud:
111 pgd_clear(pgd);
112 pud_free(mm, pud);
97no_pgd: 113no_pgd:
98 free_pages((unsigned long) pgd_base, 2); 114 free_pages((unsigned long) pgd_base, 2);
99} 115}
diff --git a/arch/arm/mm/proc-arm1020.S b/arch/arm/mm/proc-arm1020.S
index bcf748d9f4e2..226e3d8351c2 100644
--- a/arch/arm/mm/proc-arm1020.S
+++ b/arch/arm/mm/proc-arm1020.S
@@ -493,6 +493,9 @@ arm1020_processor_functions:
493 .word cpu_arm1020_dcache_clean_area 493 .word cpu_arm1020_dcache_clean_area
494 .word cpu_arm1020_switch_mm 494 .word cpu_arm1020_switch_mm
495 .word cpu_arm1020_set_pte_ext 495 .word cpu_arm1020_set_pte_ext
496 .word 0
497 .word 0
498 .word 0
496 .size arm1020_processor_functions, . - arm1020_processor_functions 499 .size arm1020_processor_functions, . - arm1020_processor_functions
497 500
498 .section ".rodata" 501 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm1020e.S b/arch/arm/mm/proc-arm1020e.S
index ab7ec26657ea..86d9c2cf0bce 100644
--- a/arch/arm/mm/proc-arm1020e.S
+++ b/arch/arm/mm/proc-arm1020e.S
@@ -474,6 +474,9 @@ arm1020e_processor_functions:
474 .word cpu_arm1020e_dcache_clean_area 474 .word cpu_arm1020e_dcache_clean_area
475 .word cpu_arm1020e_switch_mm 475 .word cpu_arm1020e_switch_mm
476 .word cpu_arm1020e_set_pte_ext 476 .word cpu_arm1020e_set_pte_ext
477 .word 0
478 .word 0
479 .word 0
477 .size arm1020e_processor_functions, . - arm1020e_processor_functions 480 .size arm1020e_processor_functions, . - arm1020e_processor_functions
478 481
479 .section ".rodata" 482 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm1022.S b/arch/arm/mm/proc-arm1022.S
index 831c5e54e22f..83d3dd34f846 100644
--- a/arch/arm/mm/proc-arm1022.S
+++ b/arch/arm/mm/proc-arm1022.S
@@ -457,6 +457,9 @@ arm1022_processor_functions:
457 .word cpu_arm1022_dcache_clean_area 457 .word cpu_arm1022_dcache_clean_area
458 .word cpu_arm1022_switch_mm 458 .word cpu_arm1022_switch_mm
459 .word cpu_arm1022_set_pte_ext 459 .word cpu_arm1022_set_pte_ext
460 .word 0
461 .word 0
462 .word 0
460 .size arm1022_processor_functions, . - arm1022_processor_functions 463 .size arm1022_processor_functions, . - arm1022_processor_functions
461 464
462 .section ".rodata" 465 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm1026.S b/arch/arm/mm/proc-arm1026.S
index e3f7e9a166bf..686043ee7281 100644
--- a/arch/arm/mm/proc-arm1026.S
+++ b/arch/arm/mm/proc-arm1026.S
@@ -452,6 +452,9 @@ arm1026_processor_functions:
452 .word cpu_arm1026_dcache_clean_area 452 .word cpu_arm1026_dcache_clean_area
453 .word cpu_arm1026_switch_mm 453 .word cpu_arm1026_switch_mm
454 .word cpu_arm1026_set_pte_ext 454 .word cpu_arm1026_set_pte_ext
455 .word 0
456 .word 0
457 .word 0
455 .size arm1026_processor_functions, . - arm1026_processor_functions 458 .size arm1026_processor_functions, . - arm1026_processor_functions
456 459
457 .section .rodata 460 .section .rodata
diff --git a/arch/arm/mm/proc-arm6_7.S b/arch/arm/mm/proc-arm6_7.S
index 6a7be1863edd..5f79dc4ce3fb 100644
--- a/arch/arm/mm/proc-arm6_7.S
+++ b/arch/arm/mm/proc-arm6_7.S
@@ -284,6 +284,9 @@ ENTRY(arm6_processor_functions)
284 .word cpu_arm6_dcache_clean_area 284 .word cpu_arm6_dcache_clean_area
285 .word cpu_arm6_switch_mm 285 .word cpu_arm6_switch_mm
286 .word cpu_arm6_set_pte_ext 286 .word cpu_arm6_set_pte_ext
287 .word 0
288 .word 0
289 .word 0
287 .size arm6_processor_functions, . - arm6_processor_functions 290 .size arm6_processor_functions, . - arm6_processor_functions
288 291
289/* 292/*
@@ -301,6 +304,9 @@ ENTRY(arm7_processor_functions)
301 .word cpu_arm7_dcache_clean_area 304 .word cpu_arm7_dcache_clean_area
302 .word cpu_arm7_switch_mm 305 .word cpu_arm7_switch_mm
303 .word cpu_arm7_set_pte_ext 306 .word cpu_arm7_set_pte_ext
307 .word 0
308 .word 0
309 .word 0
304 .size arm7_processor_functions, . - arm7_processor_functions 310 .size arm7_processor_functions, . - arm7_processor_functions
305 311
306 .section ".rodata" 312 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm720.S b/arch/arm/mm/proc-arm720.S
index c285395f44b2..665266da143c 100644
--- a/arch/arm/mm/proc-arm720.S
+++ b/arch/arm/mm/proc-arm720.S
@@ -185,6 +185,9 @@ ENTRY(arm720_processor_functions)
185 .word cpu_arm720_dcache_clean_area 185 .word cpu_arm720_dcache_clean_area
186 .word cpu_arm720_switch_mm 186 .word cpu_arm720_switch_mm
187 .word cpu_arm720_set_pte_ext 187 .word cpu_arm720_set_pte_ext
188 .word 0
189 .word 0
190 .word 0
188 .size arm720_processor_functions, . - arm720_processor_functions 191 .size arm720_processor_functions, . - arm720_processor_functions
189 192
190 .section ".rodata" 193 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm740.S b/arch/arm/mm/proc-arm740.S
index 38b27dcba727..6f9d12effee1 100644
--- a/arch/arm/mm/proc-arm740.S
+++ b/arch/arm/mm/proc-arm740.S
@@ -130,6 +130,9 @@ ENTRY(arm740_processor_functions)
130 .word cpu_arm740_dcache_clean_area 130 .word cpu_arm740_dcache_clean_area
131 .word cpu_arm740_switch_mm 131 .word cpu_arm740_switch_mm
132 .word 0 @ cpu_*_set_pte 132 .word 0 @ cpu_*_set_pte
133 .word 0
134 .word 0
135 .word 0
133 .size arm740_processor_functions, . - arm740_processor_functions 136 .size arm740_processor_functions, . - arm740_processor_functions
134 137
135 .section ".rodata" 138 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm7tdmi.S b/arch/arm/mm/proc-arm7tdmi.S
index 0c9786de20af..e4c165ca6696 100644
--- a/arch/arm/mm/proc-arm7tdmi.S
+++ b/arch/arm/mm/proc-arm7tdmi.S
@@ -70,6 +70,9 @@ ENTRY(arm7tdmi_processor_functions)
70 .word cpu_arm7tdmi_dcache_clean_area 70 .word cpu_arm7tdmi_dcache_clean_area
71 .word cpu_arm7tdmi_switch_mm 71 .word cpu_arm7tdmi_switch_mm
72 .word 0 @ cpu_*_set_pte 72 .word 0 @ cpu_*_set_pte
73 .word 0
74 .word 0
75 .word 0
73 .size arm7tdmi_processor_functions, . - arm7tdmi_processor_functions 76 .size arm7tdmi_processor_functions, . - arm7tdmi_processor_functions
74 77
75 .section ".rodata" 78 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S
index 6109f278a904..219980ec8b6e 100644
--- a/arch/arm/mm/proc-arm920.S
+++ b/arch/arm/mm/proc-arm920.S
@@ -387,6 +387,40 @@ ENTRY(cpu_arm920_set_pte_ext)
387#endif 387#endif
388 mov pc, lr 388 mov pc, lr
389 389
390/* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */
391.globl cpu_arm920_suspend_size
392.equ cpu_arm920_suspend_size, 4 * 3
393#ifdef CONFIG_PM
394ENTRY(cpu_arm920_do_suspend)
395 stmfd sp!, {r4 - r7, lr}
396 mrc p15, 0, r4, c13, c0, 0 @ PID
397 mrc p15, 0, r5, c3, c0, 0 @ Domain ID
398 mrc p15, 0, r6, c2, c0, 0 @ TTB address
399 mrc p15, 0, r7, c1, c0, 0 @ Control register
400 stmia r0, {r4 - r7}
401 ldmfd sp!, {r4 - r7, pc}
402ENDPROC(cpu_arm920_do_suspend)
403
404ENTRY(cpu_arm920_do_resume)
405 mov ip, #0
406 mcr p15, 0, ip, c8, c7, 0 @ invalidate I+D TLBs
407 mcr p15, 0, ip, c7, c7, 0 @ invalidate I+D caches
408 ldmia r0, {r4 - r7}
409 mcr p15, 0, r4, c13, c0, 0 @ PID
410 mcr p15, 0, r5, c3, c0, 0 @ Domain ID
411 mcr p15, 0, r6, c2, c0, 0 @ TTB address
412 mov r0, r7 @ control register
413 mov r2, r6, lsr #14 @ get TTB0 base
414 mov r2, r2, lsl #14
415 ldr r3, =PMD_TYPE_SECT | PMD_SECT_BUFFERABLE | \
416 PMD_SECT_CACHEABLE | PMD_BIT4 | PMD_SECT_AP_WRITE
417 b cpu_resume_mmu
418ENDPROC(cpu_arm920_do_resume)
419#else
420#define cpu_arm920_do_suspend 0
421#define cpu_arm920_do_resume 0
422#endif
423
390 __CPUINIT 424 __CPUINIT
391 425
392 .type __arm920_setup, #function 426 .type __arm920_setup, #function
@@ -432,6 +466,9 @@ arm920_processor_functions:
432 .word cpu_arm920_dcache_clean_area 466 .word cpu_arm920_dcache_clean_area
433 .word cpu_arm920_switch_mm 467 .word cpu_arm920_switch_mm
434 .word cpu_arm920_set_pte_ext 468 .word cpu_arm920_set_pte_ext
469 .word cpu_arm920_suspend_size
470 .word cpu_arm920_do_suspend
471 .word cpu_arm920_do_resume
435 .size arm920_processor_functions, . - arm920_processor_functions 472 .size arm920_processor_functions, . - arm920_processor_functions
436 473
437 .section ".rodata" 474 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm922.S b/arch/arm/mm/proc-arm922.S
index bb2f0f46a5e6..36154b1e792a 100644
--- a/arch/arm/mm/proc-arm922.S
+++ b/arch/arm/mm/proc-arm922.S
@@ -436,6 +436,9 @@ arm922_processor_functions:
436 .word cpu_arm922_dcache_clean_area 436 .word cpu_arm922_dcache_clean_area
437 .word cpu_arm922_switch_mm 437 .word cpu_arm922_switch_mm
438 .word cpu_arm922_set_pte_ext 438 .word cpu_arm922_set_pte_ext
439 .word 0
440 .word 0
441 .word 0
439 .size arm922_processor_functions, . - arm922_processor_functions 442 .size arm922_processor_functions, . - arm922_processor_functions
440 443
441 .section ".rodata" 444 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm925.S b/arch/arm/mm/proc-arm925.S
index c13e01accfe2..89c5e0009c4c 100644
--- a/arch/arm/mm/proc-arm925.S
+++ b/arch/arm/mm/proc-arm925.S
@@ -503,6 +503,9 @@ arm925_processor_functions:
503 .word cpu_arm925_dcache_clean_area 503 .word cpu_arm925_dcache_clean_area
504 .word cpu_arm925_switch_mm 504 .word cpu_arm925_switch_mm
505 .word cpu_arm925_set_pte_ext 505 .word cpu_arm925_set_pte_ext
506 .word 0
507 .word 0
508 .word 0
506 .size arm925_processor_functions, . - arm925_processor_functions 509 .size arm925_processor_functions, . - arm925_processor_functions
507 510
508 .section ".rodata" 511 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S
index 42eb4315740b..6a4bdb2c94a7 100644
--- a/arch/arm/mm/proc-arm926.S
+++ b/arch/arm/mm/proc-arm926.S
@@ -401,6 +401,40 @@ ENTRY(cpu_arm926_set_pte_ext)
401#endif 401#endif
402 mov pc, lr 402 mov pc, lr
403 403
404/* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */
405.globl cpu_arm926_suspend_size
406.equ cpu_arm926_suspend_size, 4 * 3
407#ifdef CONFIG_PM
408ENTRY(cpu_arm926_do_suspend)
409 stmfd sp!, {r4 - r7, lr}
410 mrc p15, 0, r4, c13, c0, 0 @ PID
411 mrc p15, 0, r5, c3, c0, 0 @ Domain ID
412 mrc p15, 0, r6, c2, c0, 0 @ TTB address
413 mrc p15, 0, r7, c1, c0, 0 @ Control register
414 stmia r0, {r4 - r7}
415 ldmfd sp!, {r4 - r7, pc}
416ENDPROC(cpu_arm926_do_suspend)
417
418ENTRY(cpu_arm926_do_resume)
419 mov ip, #0
420 mcr p15, 0, ip, c8, c7, 0 @ invalidate I+D TLBs
421 mcr p15, 0, ip, c7, c7, 0 @ invalidate I+D caches
422 ldmia r0, {r4 - r7}
423 mcr p15, 0, r4, c13, c0, 0 @ PID
424 mcr p15, 0, r5, c3, c0, 0 @ Domain ID
425 mcr p15, 0, r6, c2, c0, 0 @ TTB address
426 mov r0, r7 @ control register
427 mov r2, r6, lsr #14 @ get TTB0 base
428 mov r2, r2, lsl #14
429 ldr r3, =PMD_TYPE_SECT | PMD_SECT_BUFFERABLE | \
430 PMD_SECT_CACHEABLE | PMD_BIT4 | PMD_SECT_AP_WRITE
431 b cpu_resume_mmu
432ENDPROC(cpu_arm926_do_resume)
433#else
434#define cpu_arm926_do_suspend 0
435#define cpu_arm926_do_resume 0
436#endif
437
404 __CPUINIT 438 __CPUINIT
405 439
406 .type __arm926_setup, #function 440 .type __arm926_setup, #function
@@ -456,6 +490,9 @@ arm926_processor_functions:
456 .word cpu_arm926_dcache_clean_area 490 .word cpu_arm926_dcache_clean_area
457 .word cpu_arm926_switch_mm 491 .word cpu_arm926_switch_mm
458 .word cpu_arm926_set_pte_ext 492 .word cpu_arm926_set_pte_ext
493 .word cpu_arm926_suspend_size
494 .word cpu_arm926_do_suspend
495 .word cpu_arm926_do_resume
459 .size arm926_processor_functions, . - arm926_processor_functions 496 .size arm926_processor_functions, . - arm926_processor_functions
460 497
461 .section ".rodata" 498 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm940.S b/arch/arm/mm/proc-arm940.S
index 7b11cdb9935f..26aea3f71c26 100644
--- a/arch/arm/mm/proc-arm940.S
+++ b/arch/arm/mm/proc-arm940.S
@@ -363,6 +363,9 @@ ENTRY(arm940_processor_functions)
363 .word cpu_arm940_dcache_clean_area 363 .word cpu_arm940_dcache_clean_area
364 .word cpu_arm940_switch_mm 364 .word cpu_arm940_switch_mm
365 .word 0 @ cpu_*_set_pte 365 .word 0 @ cpu_*_set_pte
366 .word 0
367 .word 0
368 .word 0
366 .size arm940_processor_functions, . - arm940_processor_functions 369 .size arm940_processor_functions, . - arm940_processor_functions
367 370
368 .section ".rodata" 371 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm946.S b/arch/arm/mm/proc-arm946.S
index 1a5bbf080342..8063345406fe 100644
--- a/arch/arm/mm/proc-arm946.S
+++ b/arch/arm/mm/proc-arm946.S
@@ -419,6 +419,9 @@ ENTRY(arm946_processor_functions)
419 .word cpu_arm946_dcache_clean_area 419 .word cpu_arm946_dcache_clean_area
420 .word cpu_arm946_switch_mm 420 .word cpu_arm946_switch_mm
421 .word 0 @ cpu_*_set_pte 421 .word 0 @ cpu_*_set_pte
422 .word 0
423 .word 0
424 .word 0
422 .size arm946_processor_functions, . - arm946_processor_functions 425 .size arm946_processor_functions, . - arm946_processor_functions
423 426
424 .section ".rodata" 427 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm9tdmi.S b/arch/arm/mm/proc-arm9tdmi.S
index db67e3134d7a..7b7ebd4d096d 100644
--- a/arch/arm/mm/proc-arm9tdmi.S
+++ b/arch/arm/mm/proc-arm9tdmi.S
@@ -70,6 +70,9 @@ ENTRY(arm9tdmi_processor_functions)
70 .word cpu_arm9tdmi_dcache_clean_area 70 .word cpu_arm9tdmi_dcache_clean_area
71 .word cpu_arm9tdmi_switch_mm 71 .word cpu_arm9tdmi_switch_mm
72 .word 0 @ cpu_*_set_pte 72 .word 0 @ cpu_*_set_pte
73 .word 0
74 .word 0
75 .word 0
73 .size arm9tdmi_processor_functions, . - arm9tdmi_processor_functions 76 .size arm9tdmi_processor_functions, . - arm9tdmi_processor_functions
74 77
75 .section ".rodata" 78 .section ".rodata"
diff --git a/arch/arm/mm/proc-fa526.S b/arch/arm/mm/proc-fa526.S
index 7c9ad621f0e6..fc2a4ae15cf4 100644
--- a/arch/arm/mm/proc-fa526.S
+++ b/arch/arm/mm/proc-fa526.S
@@ -195,6 +195,9 @@ fa526_processor_functions:
195 .word cpu_fa526_dcache_clean_area 195 .word cpu_fa526_dcache_clean_area
196 .word cpu_fa526_switch_mm 196 .word cpu_fa526_switch_mm
197 .word cpu_fa526_set_pte_ext 197 .word cpu_fa526_set_pte_ext
198 .word 0
199 .word 0
200 .word 0
198 .size fa526_processor_functions, . - fa526_processor_functions 201 .size fa526_processor_functions, . - fa526_processor_functions
199 202
200 .section ".rodata" 203 .section ".rodata"
diff --git a/arch/arm/mm/proc-feroceon.S b/arch/arm/mm/proc-feroceon.S
index b4597edbff97..d3883eed7a4a 100644
--- a/arch/arm/mm/proc-feroceon.S
+++ b/arch/arm/mm/proc-feroceon.S
@@ -554,6 +554,9 @@ feroceon_processor_functions:
554 .word cpu_feroceon_dcache_clean_area 554 .word cpu_feroceon_dcache_clean_area
555 .word cpu_feroceon_switch_mm 555 .word cpu_feroceon_switch_mm
556 .word cpu_feroceon_set_pte_ext 556 .word cpu_feroceon_set_pte_ext
557 .word 0
558 .word 0
559 .word 0
557 .size feroceon_processor_functions, . - feroceon_processor_functions 560 .size feroceon_processor_functions, . - feroceon_processor_functions
558 561
559 .section ".rodata" 562 .section ".rodata"
diff --git a/arch/arm/mm/proc-mohawk.S b/arch/arm/mm/proc-mohawk.S
index 4458ee6aa713..9d4f2ae63370 100644
--- a/arch/arm/mm/proc-mohawk.S
+++ b/arch/arm/mm/proc-mohawk.S
@@ -388,6 +388,9 @@ mohawk_processor_functions:
388 .word cpu_mohawk_dcache_clean_area 388 .word cpu_mohawk_dcache_clean_area
389 .word cpu_mohawk_switch_mm 389 .word cpu_mohawk_switch_mm
390 .word cpu_mohawk_set_pte_ext 390 .word cpu_mohawk_set_pte_ext
391 .word 0
392 .word 0
393 .word 0
391 .size mohawk_processor_functions, . - mohawk_processor_functions 394 .size mohawk_processor_functions, . - mohawk_processor_functions
392 395
393 .section ".rodata" 396 .section ".rodata"
diff --git a/arch/arm/mm/proc-sa110.S b/arch/arm/mm/proc-sa110.S
index 5aa8d59c2e85..46f09ed16b98 100644
--- a/arch/arm/mm/proc-sa110.S
+++ b/arch/arm/mm/proc-sa110.S
@@ -203,6 +203,9 @@ ENTRY(sa110_processor_functions)
203 .word cpu_sa110_dcache_clean_area 203 .word cpu_sa110_dcache_clean_area
204 .word cpu_sa110_switch_mm 204 .word cpu_sa110_switch_mm
205 .word cpu_sa110_set_pte_ext 205 .word cpu_sa110_set_pte_ext
206 .word 0
207 .word 0
208 .word 0
206 .size sa110_processor_functions, . - sa110_processor_functions 209 .size sa110_processor_functions, . - sa110_processor_functions
207 210
208 .section ".rodata" 211 .section ".rodata"
diff --git a/arch/arm/mm/proc-sa1100.S b/arch/arm/mm/proc-sa1100.S
index 2ac4e6f10713..74483d1977fe 100644
--- a/arch/arm/mm/proc-sa1100.S
+++ b/arch/arm/mm/proc-sa1100.S
@@ -169,6 +169,42 @@ ENTRY(cpu_sa1100_set_pte_ext)
169#endif 169#endif
170 mov pc, lr 170 mov pc, lr
171 171
172.globl cpu_sa1100_suspend_size
173.equ cpu_sa1100_suspend_size, 4*4
174#ifdef CONFIG_PM
175ENTRY(cpu_sa1100_do_suspend)
176 stmfd sp!, {r4 - r7, lr}
177 mrc p15, 0, r4, c3, c0, 0 @ domain ID
178 mrc p15, 0, r5, c2, c0, 0 @ translation table base addr
179 mrc p15, 0, r6, c13, c0, 0 @ PID
180 mrc p15, 0, r7, c1, c0, 0 @ control reg
181 stmia r0, {r4 - r7} @ store cp regs
182 ldmfd sp!, {r4 - r7, pc}
183ENDPROC(cpu_sa1100_do_suspend)
184
185ENTRY(cpu_sa1100_do_resume)
186 ldmia r0, {r4 - r7} @ load cp regs
187 mov r1, #0
188 mcr p15, 0, r1, c8, c7, 0 @ flush I+D TLBs
189 mcr p15, 0, r1, c7, c7, 0 @ flush I&D cache
190 mcr p15, 0, r1, c9, c0, 0 @ invalidate RB
191 mcr p15, 0, r1, c9, c0, 5 @ allow user space to use RB
192
193 mcr p15, 0, r4, c3, c0, 0 @ domain ID
194 mcr p15, 0, r5, c2, c0, 0 @ translation table base addr
195 mcr p15, 0, r6, c13, c0, 0 @ PID
196 mov r0, r7 @ control register
197 mov r2, r5, lsr #14 @ get TTB0 base
198 mov r2, r2, lsl #14
199 ldr r3, =PMD_TYPE_SECT | PMD_SECT_BUFFERABLE | \
200 PMD_SECT_CACHEABLE | PMD_SECT_AP_WRITE
201 b cpu_resume_mmu
202ENDPROC(cpu_sa1100_do_resume)
203#else
204#define cpu_sa1100_do_suspend 0
205#define cpu_sa1100_do_resume 0
206#endif
207
172 __CPUINIT 208 __CPUINIT
173 209
174 .type __sa1100_setup, #function 210 .type __sa1100_setup, #function
@@ -218,6 +254,9 @@ ENTRY(sa1100_processor_functions)
218 .word cpu_sa1100_dcache_clean_area 254 .word cpu_sa1100_dcache_clean_area
219 .word cpu_sa1100_switch_mm 255 .word cpu_sa1100_switch_mm
220 .word cpu_sa1100_set_pte_ext 256 .word cpu_sa1100_set_pte_ext
257 .word cpu_sa1100_suspend_size
258 .word cpu_sa1100_do_suspend
259 .word cpu_sa1100_do_resume
221 .size sa1100_processor_functions, . - sa1100_processor_functions 260 .size sa1100_processor_functions, . - sa1100_processor_functions
222 261
223 .section ".rodata" 262 .section ".rodata"
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index 59a7e1ffe7bc..832b6bdc192c 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -121,6 +121,53 @@ ENTRY(cpu_v6_set_pte_ext)
121#endif 121#endif
122 mov pc, lr 122 mov pc, lr
123 123
124/* Suspend/resume support: taken from arch/arm/mach-s3c64xx/sleep.S */
125.globl cpu_v6_suspend_size
126.equ cpu_v6_suspend_size, 4 * 8
127#ifdef CONFIG_PM
128ENTRY(cpu_v6_do_suspend)
129 stmfd sp!, {r4 - r11, lr}
130 mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID
131 mrc p15, 0, r5, c13, c0, 1 @ Context ID
132 mrc p15, 0, r6, c3, c0, 0 @ Domain ID
133 mrc p15, 0, r7, c2, c0, 0 @ Translation table base 0
134 mrc p15, 0, r8, c2, c0, 1 @ Translation table base 1
135 mrc p15, 0, r9, c1, c0, 1 @ auxillary control register
136 mrc p15, 0, r10, c1, c0, 2 @ co-processor access control
137 mrc p15, 0, r11, c1, c0, 0 @ control register
138 stmia r0, {r4 - r11}
139 ldmfd sp!, {r4- r11, pc}
140ENDPROC(cpu_v6_do_suspend)
141
142ENTRY(cpu_v6_do_resume)
143 mov ip, #0
144 mcr p15, 0, ip, c7, c14, 0 @ clean+invalidate D cache
145 mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
146 mcr p15, 0, ip, c7, c15, 0 @ clean+invalidate cache
147 mcr p15, 0, ip, c7, c10, 4 @ drain write buffer
148 ldmia r0, {r4 - r11}
149 mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID
150 mcr p15, 0, r5, c13, c0, 1 @ Context ID
151 mcr p15, 0, r6, c3, c0, 0 @ Domain ID
152 mcr p15, 0, r7, c2, c0, 0 @ Translation table base 0
153 mcr p15, 0, r8, c2, c0, 1 @ Translation table base 1
154 mcr p15, 0, r9, c1, c0, 1 @ auxillary control register
155 mcr p15, 0, r10, c1, c0, 2 @ co-processor access control
156 mcr p15, 0, ip, c2, c0, 2 @ TTB control register
157 mcr p15, 0, ip, c7, c5, 4 @ ISB
158 mov r0, r11 @ control register
159 mov r2, r7, lsr #14 @ get TTB0 base
160 mov r2, r2, lsl #14
161 ldr r3, cpu_resume_l1_flags
162 b cpu_resume_mmu
163ENDPROC(cpu_v6_do_resume)
164cpu_resume_l1_flags:
165 ALT_SMP(.long PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_FLAGS_SMP)
166 ALT_UP(.long PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_FLAGS_UP)
167#else
168#define cpu_v6_do_suspend 0
169#define cpu_v6_do_resume 0
170#endif
124 171
125 172
126 .type cpu_v6_name, #object 173 .type cpu_v6_name, #object
@@ -206,6 +253,9 @@ ENTRY(v6_processor_functions)
206 .word cpu_v6_dcache_clean_area 253 .word cpu_v6_dcache_clean_area
207 .word cpu_v6_switch_mm 254 .word cpu_v6_switch_mm
208 .word cpu_v6_set_pte_ext 255 .word cpu_v6_set_pte_ext
256 .word cpu_v6_suspend_size
257 .word cpu_v6_do_suspend
258 .word cpu_v6_do_resume
209 .size v6_processor_functions, . - v6_processor_functions 259 .size v6_processor_functions, . - v6_processor_functions
210 260
211 .section ".rodata" 261 .section ".rodata"
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 0c1172b56b4e..262fa88a7439 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -108,10 +108,16 @@ ENTRY(cpu_v7_switch_mm)
108#ifdef CONFIG_ARM_ERRATA_430973 108#ifdef CONFIG_ARM_ERRATA_430973
109 mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB 109 mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB
110#endif 110#endif
111#ifdef CONFIG_ARM_ERRATA_754322
112 dsb
113#endif
111 mcr p15, 0, r2, c13, c0, 1 @ set reserved context ID 114 mcr p15, 0, r2, c13, c0, 1 @ set reserved context ID
112 isb 115 isb
1131: mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 1161: mcr p15, 0, r0, c2, c0, 0 @ set TTB 0
114 isb 117 isb
118#ifdef CONFIG_ARM_ERRATA_754322
119 dsb
120#endif
115 mcr p15, 0, r1, c13, c0, 1 @ set context ID 121 mcr p15, 0, r1, c13, c0, 1 @ set context ID
116 isb 122 isb
117#endif 123#endif
@@ -171,6 +177,87 @@ cpu_v7_name:
171 .ascii "ARMv7 Processor" 177 .ascii "ARMv7 Processor"
172 .align 178 .align
173 179
180 /*
181 * Memory region attributes with SCTLR.TRE=1
182 *
183 * n = TEX[0],C,B
184 * TR = PRRR[2n+1:2n] - memory type
185 * IR = NMRR[2n+1:2n] - inner cacheable property
186 * OR = NMRR[2n+17:2n+16] - outer cacheable property
187 *
188 * n TR IR OR
189 * UNCACHED 000 00
190 * BUFFERABLE 001 10 00 00
191 * WRITETHROUGH 010 10 10 10
192 * WRITEBACK 011 10 11 11
193 * reserved 110
194 * WRITEALLOC 111 10 01 01
195 * DEV_SHARED 100 01
196 * DEV_NONSHARED 100 01
197 * DEV_WC 001 10
198 * DEV_CACHED 011 10
199 *
200 * Other attributes:
201 *
202 * DS0 = PRRR[16] = 0 - device shareable property
203 * DS1 = PRRR[17] = 1 - device shareable property
204 * NS0 = PRRR[18] = 0 - normal shareable property
205 * NS1 = PRRR[19] = 1 - normal shareable property
206 * NOS = PRRR[24+n] = 1 - not outer shareable
207 */
208.equ PRRR, 0xff0a81a8
209.equ NMRR, 0x40e040e0
210
211/* Suspend/resume support: derived from arch/arm/mach-s5pv210/sleep.S */
212.globl cpu_v7_suspend_size
213.equ cpu_v7_suspend_size, 4 * 8
214#ifdef CONFIG_PM
215ENTRY(cpu_v7_do_suspend)
216 stmfd sp!, {r4 - r11, lr}
217 mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID
218 mrc p15, 0, r5, c13, c0, 1 @ Context ID
219 mrc p15, 0, r6, c3, c0, 0 @ Domain ID
220 mrc p15, 0, r7, c2, c0, 0 @ TTB 0
221 mrc p15, 0, r8, c2, c0, 1 @ TTB 1
222 mrc p15, 0, r9, c1, c0, 0 @ Control register
223 mrc p15, 0, r10, c1, c0, 1 @ Auxiliary control register
224 mrc p15, 0, r11, c1, c0, 2 @ Co-processor access control
225 stmia r0, {r4 - r11}
226 ldmfd sp!, {r4 - r11, pc}
227ENDPROC(cpu_v7_do_suspend)
228
229ENTRY(cpu_v7_do_resume)
230 mov ip, #0
231 mcr p15, 0, ip, c8, c7, 0 @ invalidate TLBs
232 mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
233 ldmia r0, {r4 - r11}
234 mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID
235 mcr p15, 0, r5, c13, c0, 1 @ Context ID
236 mcr p15, 0, r6, c3, c0, 0 @ Domain ID
237 mcr p15, 0, r7, c2, c0, 0 @ TTB 0
238 mcr p15, 0, r8, c2, c0, 1 @ TTB 1
239 mcr p15, 0, ip, c2, c0, 2 @ TTB control register
240 mcr p15, 0, r10, c1, c0, 1 @ Auxillary control register
241 mcr p15, 0, r11, c1, c0, 2 @ Co-processor access control
242 ldr r4, =PRRR @ PRRR
243 ldr r5, =NMRR @ NMRR
244 mcr p15, 0, r4, c10, c2, 0 @ write PRRR
245 mcr p15, 0, r5, c10, c2, 1 @ write NMRR
246 isb
247 mov r0, r9 @ control register
248 mov r2, r7, lsr #14 @ get TTB0 base
249 mov r2, r2, lsl #14
250 ldr r3, cpu_resume_l1_flags
251 b cpu_resume_mmu
252ENDPROC(cpu_v7_do_resume)
253cpu_resume_l1_flags:
254 ALT_SMP(.long PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_FLAGS_SMP)
255 ALT_UP(.long PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_FLAGS_UP)
256#else
257#define cpu_v7_do_suspend 0
258#define cpu_v7_do_resume 0
259#endif
260
174 __CPUINIT 261 __CPUINIT
175 262
176/* 263/*
@@ -264,6 +351,12 @@ __v7_setup:
264 orreq r10, r10, #1 << 6 @ set bit #6 351 orreq r10, r10, #1 << 6 @ set bit #6
265 mcreq p15, 0, r10, c15, c0, 1 @ write diagnostic register 352 mcreq p15, 0, r10, c15, c0, 1 @ write diagnostic register
266#endif 353#endif
354#ifdef CONFIG_ARM_ERRATA_751472
355 cmp r6, #0x30 @ present prior to r3p0
356 mrclt p15, 0, r10, c15, c0, 1 @ read diagnostic register
357 orrlt r10, r10, #1 << 11 @ set bit #11
358 mcrlt p15, 0, r10, c15, c0, 1 @ write diagnostic register
359#endif
267 360
2683: mov r10, #0 3613: mov r10, #0
269#ifdef HARVARD_CACHE 362#ifdef HARVARD_CACHE
@@ -276,36 +369,8 @@ __v7_setup:
276 ALT_SMP(orr r4, r4, #TTB_FLAGS_SMP) 369 ALT_SMP(orr r4, r4, #TTB_FLAGS_SMP)
277 ALT_UP(orr r4, r4, #TTB_FLAGS_UP) 370 ALT_UP(orr r4, r4, #TTB_FLAGS_UP)
278 mcr p15, 0, r4, c2, c0, 1 @ load TTB1 371 mcr p15, 0, r4, c2, c0, 1 @ load TTB1
279 /* 372 ldr r5, =PRRR @ PRRR
280 * Memory region attributes with SCTLR.TRE=1 373 ldr r6, =NMRR @ NMRR
281 *
282 * n = TEX[0],C,B
283 * TR = PRRR[2n+1:2n] - memory type
284 * IR = NMRR[2n+1:2n] - inner cacheable property
285 * OR = NMRR[2n+17:2n+16] - outer cacheable property
286 *
287 * n TR IR OR
288 * UNCACHED 000 00
289 * BUFFERABLE 001 10 00 00
290 * WRITETHROUGH 010 10 10 10
291 * WRITEBACK 011 10 11 11
292 * reserved 110
293 * WRITEALLOC 111 10 01 01
294 * DEV_SHARED 100 01
295 * DEV_NONSHARED 100 01
296 * DEV_WC 001 10
297 * DEV_CACHED 011 10
298 *
299 * Other attributes:
300 *
301 * DS0 = PRRR[16] = 0 - device shareable property
302 * DS1 = PRRR[17] = 1 - device shareable property
303 * NS0 = PRRR[18] = 0 - normal shareable property
304 * NS1 = PRRR[19] = 1 - normal shareable property
305 * NOS = PRRR[24+n] = 1 - not outer shareable
306 */
307 ldr r5, =0xff0a81a8 @ PRRR
308 ldr r6, =0x40e040e0 @ NMRR
309 mcr p15, 0, r5, c10, c2, 0 @ write PRRR 374 mcr p15, 0, r5, c10, c2, 0 @ write PRRR
310 mcr p15, 0, r6, c10, c2, 1 @ write NMRR 375 mcr p15, 0, r6, c10, c2, 1 @ write NMRR
311#endif 376#endif
@@ -351,6 +416,9 @@ ENTRY(v7_processor_functions)
351 .word cpu_v7_dcache_clean_area 416 .word cpu_v7_dcache_clean_area
352 .word cpu_v7_switch_mm 417 .word cpu_v7_switch_mm
353 .word cpu_v7_set_pte_ext 418 .word cpu_v7_set_pte_ext
419 .word 0
420 .word 0
421 .word 0
354 .size v7_processor_functions, . - v7_processor_functions 422 .size v7_processor_functions, . - v7_processor_functions
355 423
356 .section ".rodata" 424 .section ".rodata"
diff --git a/arch/arm/mm/proc-xsc3.S b/arch/arm/mm/proc-xsc3.S
index ec26355cb7c2..63d8b2044e84 100644
--- a/arch/arm/mm/proc-xsc3.S
+++ b/arch/arm/mm/proc-xsc3.S
@@ -413,9 +413,52 @@ ENTRY(cpu_xsc3_set_pte_ext)
413 mov pc, lr 413 mov pc, lr
414 414
415 .ltorg 415 .ltorg
416
417 .align 416 .align
418 417
418.globl cpu_xsc3_suspend_size
419.equ cpu_xsc3_suspend_size, 4 * 8
420#ifdef CONFIG_PM
421ENTRY(cpu_xsc3_do_suspend)
422 stmfd sp!, {r4 - r10, lr}
423 mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
424 mrc p15, 0, r5, c15, c1, 0 @ CP access reg
425 mrc p15, 0, r6, c13, c0, 0 @ PID
426 mrc p15, 0, r7, c3, c0, 0 @ domain ID
427 mrc p15, 0, r8, c2, c0, 0 @ translation table base addr
428 mrc p15, 0, r9, c1, c0, 1 @ auxiliary control reg
429 mrc p15, 0, r10, c1, c0, 0 @ control reg
430 bic r4, r4, #2 @ clear frequency change bit
431 stmia r0, {r1, r4 - r10} @ store v:p offset + cp regs
432 ldmia sp!, {r4 - r10, pc}
433ENDPROC(cpu_xsc3_do_suspend)
434
435ENTRY(cpu_xsc3_do_resume)
436 ldmia r0, {r1, r4 - r10} @ load v:p offset + cp regs
437 mov ip, #0
438 mcr p15, 0, ip, c7, c7, 0 @ invalidate I & D caches, BTB
439 mcr p15, 0, ip, c7, c10, 4 @ drain write (&fill) buffer
440 mcr p15, 0, ip, c7, c5, 4 @ flush prefetch buffer
441 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
442 mcr p14, 0, r4, c6, c0, 0 @ clock configuration, turbo mode.
443 mcr p15, 0, r5, c15, c1, 0 @ CP access reg
444 mcr p15, 0, r6, c13, c0, 0 @ PID
445 mcr p15, 0, r7, c3, c0, 0 @ domain ID
446 mcr p15, 0, r8, c2, c0, 0 @ translation table base addr
447 mcr p15, 0, r9, c1, c0, 1 @ auxiliary control reg
448
449 @ temporarily map resume_turn_on_mmu into the page table,
450 @ otherwise prefetch abort occurs after MMU is turned on
451 mov r0, r10 @ control register
452 mov r2, r8, lsr #14 @ get TTB0 base
453 mov r2, r2, lsl #14
454 ldr r3, =0x542e @ section flags
455 b cpu_resume_mmu
456ENDPROC(cpu_xsc3_do_resume)
457#else
458#define cpu_xsc3_do_suspend 0
459#define cpu_xsc3_do_resume 0
460#endif
461
419 __CPUINIT 462 __CPUINIT
420 463
421 .type __xsc3_setup, #function 464 .type __xsc3_setup, #function
@@ -476,6 +519,9 @@ ENTRY(xsc3_processor_functions)
476 .word cpu_xsc3_dcache_clean_area 519 .word cpu_xsc3_dcache_clean_area
477 .word cpu_xsc3_switch_mm 520 .word cpu_xsc3_switch_mm
478 .word cpu_xsc3_set_pte_ext 521 .word cpu_xsc3_set_pte_ext
522 .word cpu_xsc3_suspend_size
523 .word cpu_xsc3_do_suspend
524 .word cpu_xsc3_do_resume
479 .size xsc3_processor_functions, . - xsc3_processor_functions 525 .size xsc3_processor_functions, . - xsc3_processor_functions
480 526
481 .section ".rodata" 527 .section ".rodata"
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index 5a37c5e45c41..086038cd86ab 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -513,11 +513,49 @@ ENTRY(cpu_xscale_set_pte_ext)
513 xscale_set_pte_ext_epilogue 513 xscale_set_pte_ext_epilogue
514 mov pc, lr 514 mov pc, lr
515 515
516
517 .ltorg 516 .ltorg
518
519 .align 517 .align
520 518
519.globl cpu_xscale_suspend_size
520.equ cpu_xscale_suspend_size, 4 * 7
521#ifdef CONFIG_PM
522ENTRY(cpu_xscale_do_suspend)
523 stmfd sp!, {r4 - r10, lr}
524 mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
525 mrc p15, 0, r5, c15, c1, 0 @ CP access reg
526 mrc p15, 0, r6, c13, c0, 0 @ PID
527 mrc p15, 0, r7, c3, c0, 0 @ domain ID
528 mrc p15, 0, r8, c2, c0, 0 @ translation table base addr
529 mrc p15, 0, r9, c1, c1, 0 @ auxiliary control reg
530 mrc p15, 0, r10, c1, c0, 0 @ control reg
531 bic r4, r4, #2 @ clear frequency change bit
532 stmia r0, {r4 - r10} @ store cp regs
533 ldmfd sp!, {r4 - r10, pc}
534ENDPROC(cpu_xscale_do_suspend)
535
536ENTRY(cpu_xscale_do_resume)
537 ldmia r0, {r4 - r10} @ load cp regs
538 mov ip, #0
539 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
540 mcr p15, 0, ip, c7, c7, 0 @ invalidate I & D caches, BTB
541 mcr p14, 0, r4, c6, c0, 0 @ clock configuration, turbo mode.
542 mcr p15, 0, r5, c15, c1, 0 @ CP access reg
543 mcr p15, 0, r6, c13, c0, 0 @ PID
544 mcr p15, 0, r7, c3, c0, 0 @ domain ID
545 mcr p15, 0, r8, c2, c0, 0 @ translation table base addr
546 mcr p15, 0, r9, c1, c1, 0 @ auxiliary control reg
547 mov r0, r10 @ control register
548 mov r2, r8, lsr #14 @ get TTB0 base
549 mov r2, r2, lsl #14
550 ldr r3, =PMD_TYPE_SECT | PMD_SECT_BUFFERABLE | \
551 PMD_SECT_CACHEABLE | PMD_SECT_AP_WRITE
552 b cpu_resume_mmu
553ENDPROC(cpu_xscale_do_resume)
554#else
555#define cpu_xscale_do_suspend 0
556#define cpu_xscale_do_resume 0
557#endif
558
521 __CPUINIT 559 __CPUINIT
522 560
523 .type __xscale_setup, #function 561 .type __xscale_setup, #function
@@ -565,6 +603,9 @@ ENTRY(xscale_processor_functions)
565 .word cpu_xscale_dcache_clean_area 603 .word cpu_xscale_dcache_clean_area
566 .word cpu_xscale_switch_mm 604 .word cpu_xscale_switch_mm
567 .word cpu_xscale_set_pte_ext 605 .word cpu_xscale_set_pte_ext
606 .word cpu_xscale_suspend_size
607 .word cpu_xscale_do_suspend
608 .word cpu_xscale_do_resume
568 .size xscale_processor_functions, . - xscale_processor_functions 609 .size xscale_processor_functions, . - xscale_processor_functions
569 610
570 .section ".rodata" 611 .section ".rodata"
diff --git a/arch/arm/mm/vmregion.c b/arch/arm/mm/vmregion.c
index 935993e1b1ef..036fdbfdd62f 100644
--- a/arch/arm/mm/vmregion.c
+++ b/arch/arm/mm/vmregion.c
@@ -38,7 +38,7 @@ struct arm_vmregion *
38arm_vmregion_alloc(struct arm_vmregion_head *head, size_t align, 38arm_vmregion_alloc(struct arm_vmregion_head *head, size_t align,
39 size_t size, gfp_t gfp) 39 size_t size, gfp_t gfp)
40{ 40{
41 unsigned long addr = head->vm_start, end = head->vm_end - size; 41 unsigned long start = head->vm_start, addr = head->vm_end;
42 unsigned long flags; 42 unsigned long flags;
43 struct arm_vmregion *c, *new; 43 struct arm_vmregion *c, *new;
44 44
@@ -54,21 +54,20 @@ arm_vmregion_alloc(struct arm_vmregion_head *head, size_t align,
54 54
55 spin_lock_irqsave(&head->vm_lock, flags); 55 spin_lock_irqsave(&head->vm_lock, flags);
56 56
57 list_for_each_entry(c, &head->vm_list, vm_list) { 57 addr = rounddown(addr - size, align);
58 if ((addr + size) < addr) 58 list_for_each_entry_reverse(c, &head->vm_list, vm_list) {
59 goto nospc; 59 if (addr >= c->vm_end)
60 if ((addr + size) <= c->vm_start)
61 goto found; 60 goto found;
62 addr = ALIGN(c->vm_end, align); 61 addr = rounddown(c->vm_start - size, align);
63 if (addr > end) 62 if (addr < start)
64 goto nospc; 63 goto nospc;
65 } 64 }
66 65
67 found: 66 found:
68 /* 67 /*
69 * Insert this entry _before_ the one we found. 68 * Insert this entry after the one we found.
70 */ 69 */
71 list_add_tail(&new->vm_list, &c->vm_list); 70 list_add(&new->vm_list, &c->vm_list);
72 new->vm_start = addr; 71 new->vm_start = addr;
73 new->vm_end = addr + size; 72 new->vm_end = addr + size;
74 new->vm_active = 1; 73 new->vm_active = 1;
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
index 8aa974491dfc..c074e66ad224 100644
--- a/arch/arm/oprofile/common.c
+++ b/arch/arm/oprofile/common.c
@@ -10,8 +10,6 @@
10 */ 10 */
11 11
12#include <linux/cpumask.h> 12#include <linux/cpumask.h>
13#include <linux/err.h>
14#include <linux/errno.h>
15#include <linux/init.h> 13#include <linux/init.h>
16#include <linux/mutex.h> 14#include <linux/mutex.h>
17#include <linux/oprofile.h> 15#include <linux/oprofile.h>
@@ -46,6 +44,7 @@ char *op_name_from_perf_id(void)
46 return NULL; 44 return NULL;
47 } 45 }
48} 46}
47#endif
49 48
50static int report_trace(struct stackframe *frame, void *d) 49static int report_trace(struct stackframe *frame, void *d)
51{ 50{
@@ -85,7 +84,7 @@ static struct frame_tail* user_backtrace(struct frame_tail *tail)
85 84
86 /* frame pointers should strictly progress back up the stack 85 /* frame pointers should strictly progress back up the stack
87 * (towards higher addresses) */ 86 * (towards higher addresses) */
88 if (tail >= buftail[0].fp) 87 if (tail + 1 >= buftail[0].fp)
89 return NULL; 88 return NULL;
90 89
91 return buftail[0].fp-1; 90 return buftail[0].fp-1;
@@ -111,6 +110,7 @@ static void arm_backtrace(struct pt_regs * const regs, unsigned int depth)
111 110
112int __init oprofile_arch_init(struct oprofile_operations *ops) 111int __init oprofile_arch_init(struct oprofile_operations *ops)
113{ 112{
113 /* provide backtrace support also in timer mode: */
114 ops->backtrace = arm_backtrace; 114 ops->backtrace = arm_backtrace;
115 115
116 return oprofile_perf_init(ops); 116 return oprofile_perf_init(ops);
@@ -120,11 +120,3 @@ void __exit oprofile_arch_exit(void)
120{ 120{
121 oprofile_perf_exit(); 121 oprofile_perf_exit();
122} 122}
123#else
124int __init oprofile_arch_init(struct oprofile_operations *ops)
125{
126 pr_info("oprofile: hardware counters not available\n");
127 return -ENODEV;
128}
129void __exit oprofile_arch_exit(void) {}
130#endif /* CONFIG_HW_PERF_EVENTS */
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
index 389f21795015..b0cb4258e382 100644
--- a/arch/arm/plat-mxc/Kconfig
+++ b/arch/arm/plat-mxc/Kconfig
@@ -33,6 +33,7 @@ config ARCH_MX3
33config ARCH_MXC91231 33config ARCH_MXC91231
34 bool "MXC91231-based" 34 bool "MXC91231-based"
35 select CPU_V6 35 select CPU_V6
36 select MXC_AVIC
36 help 37 help
37 This enables support for systems based on the Freescale MXC91231 family 38 This enables support for systems based on the Freescale MXC91231 family
38 39
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile
index 5fd20e96876c..a1387875a491 100644
--- a/arch/arm/plat-mxc/Makefile
+++ b/arch/arm/plat-mxc/Makefile
@@ -13,7 +13,6 @@ obj-$(CONFIG_IMX_HAVE_IOMUX_V1) += iomux-v1.o
13obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o 13obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o
14obj-$(CONFIG_IRAM_ALLOC) += iram_alloc.o 14obj-$(CONFIG_IRAM_ALLOC) += iram_alloc.o
15obj-$(CONFIG_MXC_PWM) += pwm.o 15obj-$(CONFIG_MXC_PWM) += pwm.o
16obj-$(CONFIG_USB_EHCI_MXC) += ehci.o
17obj-$(CONFIG_MXC_ULPI) += ulpi.o 16obj-$(CONFIG_MXC_ULPI) += ulpi.o
18obj-$(CONFIG_MXC_USE_EPIT) += epit.o 17obj-$(CONFIG_MXC_USE_EPIT) += epit.o
19obj-$(CONFIG_ARCH_MXC_AUDMUX_V1) += audmux-v1.o 18obj-$(CONFIG_ARCH_MXC_AUDMUX_V1) += audmux-v1.o
diff --git a/arch/arm/plat-mxc/devices.c b/arch/arm/plat-mxc/devices.c
index e9bcefe79a43..eee1b6096a08 100644
--- a/arch/arm/plat-mxc/devices.c
+++ b/arch/arm/plat-mxc/devices.c
@@ -81,6 +81,8 @@ struct platform_device *__init imx_add_platform_device_dmamask(
81 ret = platform_device_add(pdev); 81 ret = platform_device_add(pdev);
82 if (ret) { 82 if (ret) {
83err: 83err:
84 if (dmamask)
85 kfree(pdev->dev.dma_mask);
84 platform_device_put(pdev); 86 platform_device_put(pdev);
85 return ERR_PTR(ret); 87 return ERR_PTR(ret);
86 } 88 }
diff --git a/arch/arm/plat-mxc/devices/platform-fec.c b/arch/arm/plat-mxc/devices/platform-fec.c
index b50c3517d083..6561c9df5f0d 100644
--- a/arch/arm/plat-mxc/devices/platform-fec.c
+++ b/arch/arm/plat-mxc/devices/platform-fec.c
@@ -31,6 +31,11 @@ const struct imx_fec_data imx35_fec_data __initconst =
31 imx_fec_data_entry_single(MX35); 31 imx_fec_data_entry_single(MX35);
32#endif 32#endif
33 33
34#ifdef CONFIG_SOC_IMX50
35const struct imx_fec_data imx50_fec_data __initconst =
36 imx_fec_data_entry_single(MX50);
37#endif
38
34#ifdef CONFIG_SOC_IMX51 39#ifdef CONFIG_SOC_IMX51
35const struct imx_fec_data imx51_fec_data __initconst = 40const struct imx_fec_data imx51_fec_data __initconst =
36 imx_fec_data_entry_single(MX51); 41 imx_fec_data_entry_single(MX51);
@@ -57,7 +62,7 @@ struct platform_device *__init imx_add_fec(
57 }, 62 },
58 }; 63 };
59 64
60 return imx_add_platform_device("fec", 0 /* -1? */, 65 return imx_add_platform_device_dmamask("fec", 0,
61 res, ARRAY_SIZE(res), 66 res, ARRAY_SIZE(res),
62 pdata, sizeof(*pdata)); 67 pdata, sizeof(*pdata), DMA_BIT_MASK(32));
63} 68}
diff --git a/arch/arm/plat-mxc/devices/platform-imx-dma.c b/arch/arm/plat-mxc/devices/platform-imx-dma.c
index 33530d2d5ed1..3538b85ede91 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-dma.c
+++ b/arch/arm/plat-mxc/devices/platform-imx-dma.c
@@ -94,7 +94,7 @@ static struct sdma_script_start_addrs addr_imx25_to1 = {
94}; 94};
95#endif 95#endif
96 96
97#ifdef CONFIG_ARCH_MX31 97#ifdef CONFIG_SOC_IMX31
98static struct sdma_script_start_addrs addr_imx31_to1 = { 98static struct sdma_script_start_addrs addr_imx31_to1 = {
99 .per_2_per_addr = 1677, 99 .per_2_per_addr = 1677,
100}; 100};
@@ -106,7 +106,7 @@ static struct sdma_script_start_addrs addr_imx31_to2 = {
106}; 106};
107#endif 107#endif
108 108
109#ifdef CONFIG_ARCH_MX35 109#ifdef CONFIG_SOC_IMX35
110static struct sdma_script_start_addrs addr_imx35_to1 = { 110static struct sdma_script_start_addrs addr_imx35_to1 = {
111 .ap_2_ap_addr = 642, 111 .ap_2_ap_addr = 642,
112 .uart_2_mcu_addr = 817, 112 .uart_2_mcu_addr = 817,
@@ -194,7 +194,7 @@ static int __init imxXX_add_imx_dma(void)
194 } else 194 } else
195#endif 195#endif
196 196
197#if defined(CONFIG_ARCH_MX51) 197#if defined(CONFIG_SOC_IMX51)
198 if (cpu_is_mx51()) { 198 if (cpu_is_mx51()) {
199 imx51_imx_sdma_data.pdata.script_addrs = &addr_imx51_to1; 199 imx51_imx_sdma_data.pdata.script_addrs = &addr_imx51_to1;
200 ret = imx_add_imx_sdma(&imx51_imx_sdma_data); 200 ret = imx_add_imx_sdma(&imx51_imx_sdma_data);
diff --git a/arch/arm/plat-mxc/devices/platform-imx-fb.c b/arch/arm/plat-mxc/devices/platform-imx-fb.c
index 6100a7d824dd..79a1cb18a5b0 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-fb.c
+++ b/arch/arm/plat-mxc/devices/platform-imx-fb.c
@@ -16,6 +16,11 @@
16 .irq = soc ## _INT_LCDC, \ 16 .irq = soc ## _INT_LCDC, \
17 } 17 }
18 18
19#ifdef CONFIG_SOC_IMX1
20const struct imx_imx_fb_data imx1_imx_fb_data __initconst =
21 imx_imx_fb_data_entry_single(MX1, SZ_4K);
22#endif /* ifdef CONFIG_SOC_IMX1 */
23
19#ifdef CONFIG_SOC_IMX21 24#ifdef CONFIG_SOC_IMX21
20const struct imx_imx_fb_data imx21_imx_fb_data __initconst = 25const struct imx_imx_fb_data imx21_imx_fb_data __initconst =
21 imx_imx_fb_data_entry_single(MX21, SZ_4K); 26 imx_imx_fb_data_entry_single(MX21, SZ_4K);
diff --git a/arch/arm/plat-mxc/devices/platform-imx-i2c.c b/arch/arm/plat-mxc/devices/platform-imx-i2c.c
index 7ba94e1bbda3..2ab74f0da9a6 100644
--- a/arch/arm/plat-mxc/devices/platform-imx-i2c.c
+++ b/arch/arm/plat-mxc/devices/platform-imx-i2c.c
@@ -69,6 +69,16 @@ const struct imx_imx_i2c_data imx35_imx_i2c_data[] __initconst = {
69}; 69};
70#endif /* ifdef CONFIG_SOC_IMX35 */ 70#endif /* ifdef CONFIG_SOC_IMX35 */
71 71
72#ifdef CONFIG_SOC_IMX50
73const struct imx_imx_i2c_data imx50_imx_i2c_data[] __initconst = {
74#define imx50_imx_i2c_data_entry(_id, _hwid) \
75 imx_imx_i2c_data_entry(MX50, _id, _hwid, SZ_4K)
76 imx50_imx_i2c_data_entry(0, 1),
77 imx50_imx_i2c_data_entry(1, 2),
78 imx50_imx_i2c_data_entry(2, 3),
79};
80#endif /* ifdef CONFIG_SOC_IMX51 */
81
72#ifdef CONFIG_SOC_IMX51 82#ifdef CONFIG_SOC_IMX51
73const struct imx_imx_i2c_data imx51_imx_i2c_data[] __initconst = { 83const struct imx_imx_i2c_data imx51_imx_i2c_data[] __initconst = {
74#define imx51_imx_i2c_data_entry(_id, _hwid) \ 84#define imx51_imx_i2c_data_entry(_id, _hwid) \
diff --git a/arch/arm/plat-mxc/devices/platform-imx2-wdt.c b/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
index e0aec61177f4..5e07ef2bf1c4 100644
--- a/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
+++ b/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
@@ -53,6 +53,15 @@ const struct imx_imx2_wdt_data imx51_imx2_wdt_data[] __initconst = {
53}; 53};
54#endif /* ifdef CONFIG_SOC_IMX51 */ 54#endif /* ifdef CONFIG_SOC_IMX51 */
55 55
56#ifdef CONFIG_SOC_IMX53
57const struct imx_imx2_wdt_data imx53_imx2_wdt_data[] __initconst = {
58#define imx53_imx2_wdt_data_entry(_id, _hwid) \
59 imx_imx2_wdt_data_entry(MX53, _id, _hwid, SZ_16K)
60 imx53_imx2_wdt_data_entry(0, 1),
61 imx53_imx2_wdt_data_entry(1, 2),
62};
63#endif /* ifdef CONFIG_SOC_IMX53 */
64
56struct platform_device *__init imx_add_imx2_wdt( 65struct platform_device *__init imx_add_imx2_wdt(
57 const struct imx_imx2_wdt_data *data) 66 const struct imx_imx2_wdt_data *data)
58{ 67{
diff --git a/arch/arm/plat-mxc/devices/platform-spi_imx.c b/arch/arm/plat-mxc/devices/platform-spi_imx.c
index 013c85f20b58..f4a60ab6763b 100644
--- a/arch/arm/plat-mxc/devices/platform-spi_imx.c
+++ b/arch/arm/plat-mxc/devices/platform-spi_imx.c
@@ -21,6 +21,15 @@
21#define imx_spi_imx_data_entry(soc, type, devid, id, hwid, size) \ 21#define imx_spi_imx_data_entry(soc, type, devid, id, hwid, size) \
22 [id] = imx_spi_imx_data_entry_single(soc, type, devid, id, hwid, size) 22 [id] = imx_spi_imx_data_entry_single(soc, type, devid, id, hwid, size)
23 23
24#ifdef CONFIG_SOC_IMX1
25const struct imx_spi_imx_data imx1_cspi_data[] __initconst = {
26#define imx1_cspi_data_entry(_id, _hwid) \
27 imx_spi_imx_data_entry(MX1, CSPI, "imx1-cspi", _id, _hwid, SZ_4K)
28 imx1_cspi_data_entry(0, 1),
29 imx1_cspi_data_entry(1, 2),
30};
31#endif
32
24#ifdef CONFIG_SOC_IMX21 33#ifdef CONFIG_SOC_IMX21
25const struct imx_spi_imx_data imx21_cspi_data[] __initconst = { 34const struct imx_spi_imx_data imx21_cspi_data[] __initconst = {
26#define imx21_cspi_data_entry(_id, _hwid) \ 35#define imx21_cspi_data_entry(_id, _hwid) \
diff --git a/arch/arm/plat-mxc/ehci.c b/arch/arm/plat-mxc/ehci.c
deleted file mode 100644
index 8772ce346a58..000000000000
--- a/arch/arm/plat-mxc/ehci.c
+++ /dev/null
@@ -1,369 +0,0 @@
1/*
2 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
3 * Copyright (C) 2010 Freescale Semiconductor, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16#include <linux/platform_device.h>
17#include <linux/io.h>
18
19#include <mach/hardware.h>
20#include <mach/mxc_ehci.h>
21
22#define USBCTRL_OTGBASE_OFFSET 0x600
23
24#define MX31_OTG_SIC_SHIFT 29
25#define MX31_OTG_SIC_MASK (0x3 << MX31_OTG_SIC_SHIFT)
26#define MX31_OTG_PM_BIT (1 << 24)
27
28#define MX31_H2_SIC_SHIFT 21
29#define MX31_H2_SIC_MASK (0x3 << MX31_H2_SIC_SHIFT)
30#define MX31_H2_PM_BIT (1 << 16)
31#define MX31_H2_DT_BIT (1 << 5)
32
33#define MX31_H1_SIC_SHIFT 13
34#define MX31_H1_SIC_MASK (0x3 << MX31_H1_SIC_SHIFT)
35#define MX31_H1_PM_BIT (1 << 8)
36#define MX31_H1_DT_BIT (1 << 4)
37
38#define MX35_OTG_SIC_SHIFT 29
39#define MX35_OTG_SIC_MASK (0x3 << MX35_OTG_SIC_SHIFT)
40#define MX35_OTG_PM_BIT (1 << 24)
41
42#define MX35_H1_SIC_SHIFT 21
43#define MX35_H1_SIC_MASK (0x3 << MX35_H1_SIC_SHIFT)
44#define MX35_H1_PM_BIT (1 << 8)
45#define MX35_H1_IPPUE_UP_BIT (1 << 7)
46#define MX35_H1_IPPUE_DOWN_BIT (1 << 6)
47#define MX35_H1_TLL_BIT (1 << 5)
48#define MX35_H1_USBTE_BIT (1 << 4)
49
50#define MXC_OTG_OFFSET 0
51#define MXC_H1_OFFSET 0x200
52#define MXC_H2_OFFSET 0x400
53
54/* USB_CTRL */
55#define MXC_OTG_UCTRL_OWIE_BIT (1 << 27) /* OTG wakeup intr enable */
56#define MXC_OTG_UCTRL_OPM_BIT (1 << 24) /* OTG power mask */
57#define MXC_H1_UCTRL_H1UIE_BIT (1 << 12) /* Host1 ULPI interrupt enable */
58#define MXC_H1_UCTRL_H1WIE_BIT (1 << 11) /* HOST1 wakeup intr enable */
59#define MXC_H1_UCTRL_H1PM_BIT (1 << 8) /* HOST1 power mask */
60
61/* USB_PHY_CTRL_FUNC */
62#define MXC_OTG_PHYCTRL_OC_DIS_BIT (1 << 8) /* OTG Disable Overcurrent Event */
63#define MXC_H1_OC_DIS_BIT (1 << 5) /* UH1 Disable Overcurrent Event */
64
65/* USBH2CTRL */
66#define MXC_H2_UCTRL_H2UIE_BIT (1 << 8)
67#define MXC_H2_UCTRL_H2WIE_BIT (1 << 7)
68#define MXC_H2_UCTRL_H2PM_BIT (1 << 4)
69
70#define MXC_USBCMD_OFFSET 0x140
71
72/* USBCMD */
73#define MXC_UCMD_ITC_NO_THRESHOLD_MASK (~(0xff << 16)) /* Interrupt Threshold Control */
74
75int mxc_initialize_usb_hw(int port, unsigned int flags)
76{
77 unsigned int v;
78#if defined(CONFIG_SOC_IMX25)
79 if (cpu_is_mx25()) {
80 v = readl(MX25_IO_ADDRESS(MX25_USB_BASE_ADDR +
81 USBCTRL_OTGBASE_OFFSET));
82
83 switch (port) {
84 case 0: /* OTG port */
85 v &= ~(MX35_OTG_SIC_MASK | MX35_OTG_PM_BIT);
86 v |= (flags & MXC_EHCI_INTERFACE_MASK)
87 << MX35_OTG_SIC_SHIFT;
88 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
89 v |= MX35_OTG_PM_BIT;
90
91 break;
92 case 1: /* H1 port */
93 v &= ~(MX35_H1_SIC_MASK | MX35_H1_PM_BIT | MX35_H1_TLL_BIT |
94 MX35_H1_USBTE_BIT | MX35_H1_IPPUE_DOWN_BIT | MX35_H1_IPPUE_UP_BIT);
95 v |= (flags & MXC_EHCI_INTERFACE_MASK)
96 << MX35_H1_SIC_SHIFT;
97 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
98 v |= MX35_H1_PM_BIT;
99
100 if (!(flags & MXC_EHCI_TTL_ENABLED))
101 v |= MX35_H1_TLL_BIT;
102
103 if (flags & MXC_EHCI_INTERNAL_PHY)
104 v |= MX35_H1_USBTE_BIT;
105
106 if (flags & MXC_EHCI_IPPUE_DOWN)
107 v |= MX35_H1_IPPUE_DOWN_BIT;
108
109 if (flags & MXC_EHCI_IPPUE_UP)
110 v |= MX35_H1_IPPUE_UP_BIT;
111
112 break;
113 default:
114 return -EINVAL;
115 }
116
117 writel(v, MX25_IO_ADDRESS(MX25_USB_BASE_ADDR +
118 USBCTRL_OTGBASE_OFFSET));
119 return 0;
120 }
121#endif /* if defined(CONFIG_SOC_IMX25) */
122#if defined(CONFIG_ARCH_MX3)
123 if (cpu_is_mx31()) {
124 v = readl(MX31_IO_ADDRESS(MX31_USB_BASE_ADDR +
125 USBCTRL_OTGBASE_OFFSET));
126
127 switch (port) {
128 case 0: /* OTG port */
129 v &= ~(MX31_OTG_SIC_MASK | MX31_OTG_PM_BIT);
130 v |= (flags & MXC_EHCI_INTERFACE_MASK)
131 << MX31_OTG_SIC_SHIFT;
132 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
133 v |= MX31_OTG_PM_BIT;
134
135 break;
136 case 1: /* H1 port */
137 v &= ~(MX31_H1_SIC_MASK | MX31_H1_PM_BIT | MX31_H1_DT_BIT);
138 v |= (flags & MXC_EHCI_INTERFACE_MASK)
139 << MX31_H1_SIC_SHIFT;
140 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
141 v |= MX31_H1_PM_BIT;
142
143 if (!(flags & MXC_EHCI_TTL_ENABLED))
144 v |= MX31_H1_DT_BIT;
145
146 break;
147 case 2: /* H2 port */
148 v &= ~(MX31_H2_SIC_MASK | MX31_H2_PM_BIT | MX31_H2_DT_BIT);
149 v |= (flags & MXC_EHCI_INTERFACE_MASK)
150 << MX31_H2_SIC_SHIFT;
151 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
152 v |= MX31_H2_PM_BIT;
153
154 if (!(flags & MXC_EHCI_TTL_ENABLED))
155 v |= MX31_H2_DT_BIT;
156
157 break;
158 default:
159 return -EINVAL;
160 }
161
162 writel(v, MX31_IO_ADDRESS(MX31_USB_BASE_ADDR +
163 USBCTRL_OTGBASE_OFFSET));
164 return 0;
165 }
166
167 if (cpu_is_mx35()) {
168 v = readl(MX35_IO_ADDRESS(MX35_USB_BASE_ADDR +
169 USBCTRL_OTGBASE_OFFSET));
170
171 switch (port) {
172 case 0: /* OTG port */
173 v &= ~(MX35_OTG_SIC_MASK | MX35_OTG_PM_BIT);
174 v |= (flags & MXC_EHCI_INTERFACE_MASK)
175 << MX35_OTG_SIC_SHIFT;
176 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
177 v |= MX35_OTG_PM_BIT;
178
179 break;
180 case 1: /* H1 port */
181 v &= ~(MX35_H1_SIC_MASK | MX35_H1_PM_BIT | MX35_H1_TLL_BIT |
182 MX35_H1_USBTE_BIT | MX35_H1_IPPUE_DOWN_BIT | MX35_H1_IPPUE_UP_BIT);
183 v |= (flags & MXC_EHCI_INTERFACE_MASK)
184 << MX35_H1_SIC_SHIFT;
185 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
186 v |= MX35_H1_PM_BIT;
187
188 if (!(flags & MXC_EHCI_TTL_ENABLED))
189 v |= MX35_H1_TLL_BIT;
190
191 if (flags & MXC_EHCI_INTERNAL_PHY)
192 v |= MX35_H1_USBTE_BIT;
193
194 if (flags & MXC_EHCI_IPPUE_DOWN)
195 v |= MX35_H1_IPPUE_DOWN_BIT;
196
197 if (flags & MXC_EHCI_IPPUE_UP)
198 v |= MX35_H1_IPPUE_UP_BIT;
199
200 break;
201 default:
202 return -EINVAL;
203 }
204
205 writel(v, MX35_IO_ADDRESS(MX35_USB_BASE_ADDR +
206 USBCTRL_OTGBASE_OFFSET));
207 return 0;
208 }
209#endif /* CONFIG_ARCH_MX3 */
210#ifdef CONFIG_MACH_MX27
211 if (cpu_is_mx27()) {
212 /* On i.MX27 we can use the i.MX31 USBCTRL bits, they
213 * are identical
214 */
215 v = readl(MX27_IO_ADDRESS(MX27_USB_BASE_ADDR +
216 USBCTRL_OTGBASE_OFFSET));
217 switch (port) {
218 case 0: /* OTG port */
219 v &= ~(MX31_OTG_SIC_MASK | MX31_OTG_PM_BIT);
220 v |= (flags & MXC_EHCI_INTERFACE_MASK)
221 << MX31_OTG_SIC_SHIFT;
222 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
223 v |= MX31_OTG_PM_BIT;
224 break;
225 case 1: /* H1 port */
226 v &= ~(MX31_H1_SIC_MASK | MX31_H1_PM_BIT | MX31_H1_DT_BIT);
227 v |= (flags & MXC_EHCI_INTERFACE_MASK)
228 << MX31_H1_SIC_SHIFT;
229 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
230 v |= MX31_H1_PM_BIT;
231
232 if (!(flags & MXC_EHCI_TTL_ENABLED))
233 v |= MX31_H1_DT_BIT;
234
235 break;
236 case 2: /* H2 port */
237 v &= ~(MX31_H2_SIC_MASK | MX31_H2_PM_BIT | MX31_H2_DT_BIT);
238 v |= (flags & MXC_EHCI_INTERFACE_MASK)
239 << MX31_H2_SIC_SHIFT;
240 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
241 v |= MX31_H2_PM_BIT;
242
243 if (!(flags & MXC_EHCI_TTL_ENABLED))
244 v |= MX31_H2_DT_BIT;
245
246 break;
247 default:
248 return -EINVAL;
249 }
250 writel(v, MX27_IO_ADDRESS(MX27_USB_BASE_ADDR +
251 USBCTRL_OTGBASE_OFFSET));
252 return 0;
253 }
254#endif /* CONFIG_MACH_MX27 */
255#ifdef CONFIG_SOC_IMX51
256 if (cpu_is_mx51()) {
257 void __iomem *usb_base;
258 void __iomem *usbotg_base;
259 void __iomem *usbother_base;
260 int ret = 0;
261
262 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
263 if (!usb_base) {
264 printk(KERN_ERR "%s(): ioremap failed\n", __func__);
265 return -ENOMEM;
266 }
267
268 switch (port) {
269 case 0: /* OTG port */
270 usbotg_base = usb_base + MXC_OTG_OFFSET;
271 break;
272 case 1: /* Host 1 port */
273 usbotg_base = usb_base + MXC_H1_OFFSET;
274 break;
275 case 2: /* Host 2 port */
276 usbotg_base = usb_base + MXC_H2_OFFSET;
277 break;
278 default:
279 printk(KERN_ERR"%s no such port %d\n", __func__, port);
280 ret = -ENOENT;
281 goto error;
282 }
283 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
284
285 switch (port) {
286 case 0: /*OTG port */
287 if (flags & MXC_EHCI_INTERNAL_PHY) {
288 v = __raw_readl(usbother_base + MXC_USB_PHY_CTR_FUNC_OFFSET);
289
290 if (flags & MXC_EHCI_POWER_PINS_ENABLED) {
291 /* OC/USBPWR is not used */
292 v |= MXC_OTG_PHYCTRL_OC_DIS_BIT;
293 } else {
294 /* OC/USBPWR is used */
295 v &= ~MXC_OTG_PHYCTRL_OC_DIS_BIT;
296 }
297 __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC_OFFSET);
298
299 v = __raw_readl(usbother_base + MXC_USBCTRL_OFFSET);
300 if (flags & MXC_EHCI_WAKEUP_ENABLED)
301 v |= MXC_OTG_UCTRL_OWIE_BIT;/* OTG wakeup enable */
302 else
303 v &= ~MXC_OTG_UCTRL_OWIE_BIT;/* OTG wakeup disable */
304 if (flags & MXC_EHCI_POWER_PINS_ENABLED)
305 v |= MXC_OTG_UCTRL_OPM_BIT;
306 else
307 v &= ~MXC_OTG_UCTRL_OPM_BIT;
308 __raw_writel(v, usbother_base + MXC_USBCTRL_OFFSET);
309 }
310 break;
311 case 1: /* Host 1 */
312 /*Host ULPI */
313 v = __raw_readl(usbother_base + MXC_USBCTRL_OFFSET);
314 if (flags & MXC_EHCI_WAKEUP_ENABLED) {
315 /* HOST1 wakeup/ULPI intr enable */
316 v |= (MXC_H1_UCTRL_H1WIE_BIT | MXC_H1_UCTRL_H1UIE_BIT);
317 } else {
318 /* HOST1 wakeup/ULPI intr disable */
319 v &= ~(MXC_H1_UCTRL_H1WIE_BIT | MXC_H1_UCTRL_H1UIE_BIT);
320 }
321
322 if (flags & MXC_EHCI_POWER_PINS_ENABLED)
323 v &= ~MXC_H1_UCTRL_H1PM_BIT; /* HOST1 power mask used*/
324 else
325 v |= MXC_H1_UCTRL_H1PM_BIT; /* HOST1 power mask used*/
326 __raw_writel(v, usbother_base + MXC_USBCTRL_OFFSET);
327
328 v = __raw_readl(usbother_base + MXC_USB_PHY_CTR_FUNC_OFFSET);
329 if (flags & MXC_EHCI_POWER_PINS_ENABLED)
330 v &= ~MXC_H1_OC_DIS_BIT; /* OC is used */
331 else
332 v |= MXC_H1_OC_DIS_BIT; /* OC is not used */
333 __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC_OFFSET);
334
335 v = __raw_readl(usbotg_base + MXC_USBCMD_OFFSET);
336 if (flags & MXC_EHCI_ITC_NO_THRESHOLD)
337 /* Interrupt Threshold Control:Immediate (no threshold) */
338 v &= MXC_UCMD_ITC_NO_THRESHOLD_MASK;
339 __raw_writel(v, usbotg_base + MXC_USBCMD_OFFSET);
340 break;
341 case 2: /* Host 2 ULPI */
342 v = __raw_readl(usbother_base + MXC_USBH2CTRL_OFFSET);
343 if (flags & MXC_EHCI_WAKEUP_ENABLED) {
344 /* HOST1 wakeup/ULPI intr enable */
345 v |= (MXC_H2_UCTRL_H2WIE_BIT | MXC_H2_UCTRL_H2UIE_BIT);
346 } else {
347 /* HOST1 wakeup/ULPI intr disable */
348 v &= ~(MXC_H2_UCTRL_H2WIE_BIT | MXC_H2_UCTRL_H2UIE_BIT);
349 }
350
351 if (flags & MXC_EHCI_POWER_PINS_ENABLED)
352 v &= ~MXC_H2_UCTRL_H2PM_BIT; /* HOST2 power mask used*/
353 else
354 v |= MXC_H2_UCTRL_H2PM_BIT; /* HOST2 power mask used*/
355 __raw_writel(v, usbother_base + MXC_USBH2CTRL_OFFSET);
356 break;
357 }
358
359error:
360 iounmap(usb_base);
361 return ret;
362 }
363#endif
364 printk(KERN_WARNING
365 "%s() unable to setup USBCONTROL for this CPU\n", __func__);
366 return -EINVAL;
367}
368EXPORT_SYMBOL(mxc_initialize_usb_hw);
369
diff --git a/arch/arm/plat-mxc/gpio.c b/arch/arm/plat-mxc/gpio.c
index d17b3c996b84..57d59855f9ec 100644
--- a/arch/arm/plat-mxc/gpio.c
+++ b/arch/arm/plat-mxc/gpio.c
@@ -233,6 +233,7 @@ static int gpio_set_wake_irq(struct irq_data *d, u32 enable)
233} 233}
234 234
235static struct irq_chip gpio_irq_chip = { 235static struct irq_chip gpio_irq_chip = {
236 .name = "GPIO",
236 .irq_ack = gpio_ack_irq, 237 .irq_ack = gpio_ack_irq,
237 .irq_mask = gpio_mask_irq, 238 .irq_mask = gpio_mask_irq,
238 .irq_unmask = gpio_unmask_irq, 239 .irq_unmask = gpio_unmask_irq,
@@ -349,113 +350,3 @@ int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt)
349 350
350 return 0; 351 return 0;
351} 352}
352
353#define DEFINE_IMX_GPIO_PORT_IRQ_HIGH(soc, _id, _hwid, _irq, _irq_high) \
354 { \
355 .chip.label = "gpio-" #_id, \
356 .irq = _irq, \
357 .irq_high = _irq_high, \
358 .base = soc ## _IO_ADDRESS( \
359 soc ## _GPIO ## _hwid ## _BASE_ADDR), \
360 .virtual_irq_start = MXC_GPIO_IRQ_START + (_id) * 32, \
361 }
362
363#define DEFINE_IMX_GPIO_PORT_IRQ(soc, _id, _hwid, _irq) \
364 DEFINE_IMX_GPIO_PORT_IRQ_HIGH(soc, _id, _hwid, _irq, 0)
365#define DEFINE_IMX_GPIO_PORT(soc, _id, _hwid) \
366 DEFINE_IMX_GPIO_PORT_IRQ(soc, _id, _hwid, 0)
367
368#define DEFINE_REGISTER_FUNCTION(prefix) \
369int __init prefix ## _register_gpios(void) \
370{ \
371 return mxc_gpio_init(prefix ## _gpio_ports, \
372 ARRAY_SIZE(prefix ## _gpio_ports)); \
373}
374
375#if defined(CONFIG_SOC_IMX1)
376static struct mxc_gpio_port imx1_gpio_ports[] = {
377 DEFINE_IMX_GPIO_PORT_IRQ(MX1, 0, 1, MX1_GPIO_INT_PORTA),
378 DEFINE_IMX_GPIO_PORT_IRQ(MX1, 1, 2, MX1_GPIO_INT_PORTB),
379 DEFINE_IMX_GPIO_PORT_IRQ(MX1, 2, 3, MX1_GPIO_INT_PORTC),
380 DEFINE_IMX_GPIO_PORT_IRQ(MX1, 3, 4, MX1_GPIO_INT_PORTD),
381};
382
383DEFINE_REGISTER_FUNCTION(imx1)
384
385#endif /* if defined(CONFIG_SOC_IMX1) */
386
387#if defined(CONFIG_SOC_IMX21)
388static struct mxc_gpio_port imx21_gpio_ports[] = {
389 DEFINE_IMX_GPIO_PORT_IRQ(MX21, 0, 1, MX21_INT_GPIO),
390 DEFINE_IMX_GPIO_PORT(MX21, 1, 2),
391 DEFINE_IMX_GPIO_PORT(MX21, 2, 3),
392 DEFINE_IMX_GPIO_PORT(MX21, 3, 4),
393 DEFINE_IMX_GPIO_PORT(MX21, 4, 5),
394 DEFINE_IMX_GPIO_PORT(MX21, 5, 6),
395};
396
397DEFINE_REGISTER_FUNCTION(imx21)
398
399#endif /* if defined(CONFIG_SOC_IMX21) */
400
401#if defined(CONFIG_SOC_IMX25)
402static struct mxc_gpio_port imx25_gpio_ports[] = {
403 DEFINE_IMX_GPIO_PORT_IRQ(MX25, 0, 1, MX25_INT_GPIO1),
404 DEFINE_IMX_GPIO_PORT_IRQ(MX25, 1, 2, MX25_INT_GPIO2),
405 DEFINE_IMX_GPIO_PORT_IRQ(MX25, 2, 3, MX25_INT_GPIO3),
406 DEFINE_IMX_GPIO_PORT_IRQ(MX25, 3, 4, MX25_INT_GPIO4),
407};
408
409DEFINE_REGISTER_FUNCTION(imx25)
410
411#endif /* if defined(CONFIG_SOC_IMX25) */
412
413#if defined(CONFIG_SOC_IMX27)
414static struct mxc_gpio_port imx27_gpio_ports[] = {
415 DEFINE_IMX_GPIO_PORT_IRQ(MX27, 0, 1, MX27_INT_GPIO),
416 DEFINE_IMX_GPIO_PORT(MX27, 1, 2),
417 DEFINE_IMX_GPIO_PORT(MX27, 2, 3),
418 DEFINE_IMX_GPIO_PORT(MX27, 3, 4),
419 DEFINE_IMX_GPIO_PORT(MX27, 4, 5),
420 DEFINE_IMX_GPIO_PORT(MX27, 5, 6),
421};
422
423DEFINE_REGISTER_FUNCTION(imx27)
424
425#endif /* if defined(CONFIG_SOC_IMX27) */
426
427#if defined(CONFIG_SOC_IMX31)
428static struct mxc_gpio_port imx31_gpio_ports[] = {
429 DEFINE_IMX_GPIO_PORT_IRQ(MX31, 0, 1, MX31_INT_GPIO1),
430 DEFINE_IMX_GPIO_PORT_IRQ(MX31, 1, 2, MX31_INT_GPIO2),
431 DEFINE_IMX_GPIO_PORT_IRQ(MX31, 2, 3, MX31_INT_GPIO3),
432};
433
434DEFINE_REGISTER_FUNCTION(imx31)
435
436#endif /* if defined(CONFIG_SOC_IMX31) */
437
438#if defined(CONFIG_SOC_IMX35)
439static struct mxc_gpio_port imx35_gpio_ports[] = {
440 DEFINE_IMX_GPIO_PORT_IRQ(MX35, 0, 1, MX35_INT_GPIO1),
441 DEFINE_IMX_GPIO_PORT_IRQ(MX35, 1, 2, MX35_INT_GPIO2),
442 DEFINE_IMX_GPIO_PORT_IRQ(MX35, 2, 3, MX35_INT_GPIO3),
443};
444
445DEFINE_REGISTER_FUNCTION(imx35)
446
447#endif /* if defined(CONFIG_SOC_IMX35) */
448
449#if defined(CONFIG_SOC_IMX50)
450static struct mxc_gpio_port imx50_gpio_ports[] = {
451 DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 0, 1, MX50_INT_GPIO1_LOW, MX50_INT_GPIO1_HIGH),
452 DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 1, 2, MX50_INT_GPIO2_LOW, MX50_INT_GPIO2_HIGH),
453 DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 2, 3, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH),
454 DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 3, 4, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH),
455 DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 4, 5, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH),
456 DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 5, 6, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH),
457};
458
459DEFINE_REGISTER_FUNCTION(imx50)
460
461#endif /* if defined(CONFIG_SOC_IMX50) */
diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/plat-mxc/include/mach/common.h
index aea2cd3b6d15..a22ebe11a602 100644
--- a/arch/arm/plat-mxc/include/mach/common.h
+++ b/arch/arm/plat-mxc/include/mach/common.h
@@ -24,6 +24,16 @@ extern void mx50_map_io(void);
24extern void mx51_map_io(void); 24extern void mx51_map_io(void);
25extern void mx53_map_io(void); 25extern void mx53_map_io(void);
26extern void mxc91231_map_io(void); 26extern void mxc91231_map_io(void);
27extern void imx1_init_early(void);
28extern void imx21_init_early(void);
29extern void imx25_init_early(void);
30extern void imx27_init_early(void);
31extern void imx31_init_early(void);
32extern void imx35_init_early(void);
33extern void imx50_init_early(void);
34extern void imx51_init_early(void);
35extern void imx53_init_early(void);
36extern void mxc91231_init_early(void);
27extern void mxc_init_irq(void __iomem *); 37extern void mxc_init_irq(void __iomem *);
28extern void tzic_init_irq(void __iomem *); 38extern void tzic_init_irq(void __iomem *);
29extern void mx1_init_irq(void); 39extern void mx1_init_irq(void);
diff --git a/arch/arm/plat-mxc/include/mach/esdhc.h b/arch/arm/plat-mxc/include/mach/esdhc.h
index a48a9aaa56b1..86003f411755 100644
--- a/arch/arm/plat-mxc/include/mach/esdhc.h
+++ b/arch/arm/plat-mxc/include/mach/esdhc.h
@@ -10,7 +10,17 @@
10#ifndef __ASM_ARCH_IMX_ESDHC_H 10#ifndef __ASM_ARCH_IMX_ESDHC_H
11#define __ASM_ARCH_IMX_ESDHC_H 11#define __ASM_ARCH_IMX_ESDHC_H
12 12
13/**
14 * struct esdhc_platform_data - optional platform data for esdhc on i.MX
15 *
16 * strongly recommended for i.MX25/35, not needed for other variants
17 *
18 * @wp_gpio: gpio for write_protect (-EINVAL if unused)
19 * @cd_gpio: gpio for card_detect interrupt (-EINVAL if unused)
20 */
21
13struct esdhc_platform_data { 22struct esdhc_platform_data {
14 unsigned int wp_gpio; /* write protect pin */ 23 unsigned int wp_gpio;
24 unsigned int cd_gpio;
15}; 25};
16#endif /* __ASM_ARCH_IMX_ESDHC_H */ 26#endif /* __ASM_ARCH_IMX_ESDHC_H */
diff --git a/arch/arm/plat-mxc/include/mach/gpio.h b/arch/arm/plat-mxc/include/mach/gpio.h
index 0044e2f1bea8..a2747f12813e 100644
--- a/arch/arm/plat-mxc/include/mach/gpio.h
+++ b/arch/arm/plat-mxc/include/mach/gpio.h
@@ -46,6 +46,21 @@ struct mxc_gpio_port {
46 spinlock_t lock; 46 spinlock_t lock;
47}; 47};
48 48
49#define DEFINE_IMX_GPIO_PORT_IRQ_HIGH(soc, _id, _hwid, _irq, _irq_high) \
50 { \
51 .chip.label = "gpio-" #_id, \
52 .irq = _irq, \
53 .irq_high = _irq_high, \
54 .base = soc ## _IO_ADDRESS( \
55 soc ## _GPIO ## _hwid ## _BASE_ADDR), \
56 .virtual_irq_start = MXC_GPIO_IRQ_START + (_id) * 32, \
57 }
58
59#define DEFINE_IMX_GPIO_PORT_IRQ(soc, _id, _hwid, _irq) \
60 DEFINE_IMX_GPIO_PORT_IRQ_HIGH(soc, _id, _hwid, _irq, 0)
61#define DEFINE_IMX_GPIO_PORT(soc, _id, _hwid) \
62 DEFINE_IMX_GPIO_PORT_IRQ(soc, _id, _hwid, 0)
63
49int mxc_gpio_init(struct mxc_gpio_port*, int); 64int mxc_gpio_init(struct mxc_gpio_port*, int);
50 65
51#endif 66#endif
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx3.h b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
index cbaed295a2bf..c92f0b1f216f 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
@@ -112,12 +112,12 @@ enum iomux_gp_func {
112 * - setups the iomux according to the configuration 112 * - setups the iomux according to the configuration
113 * - if the pin is configured as a GPIO, we claim it through kernel gpiolib 113 * - if the pin is configured as a GPIO, we claim it through kernel gpiolib
114 */ 114 */
115int mxc_iomux_alloc_pin(const unsigned int pin, const char *label); 115int mxc_iomux_alloc_pin(unsigned int pin, const char *label);
116/* 116/*
117 * setups mutliple pins 117 * setups mutliple pins
118 * convenient way to call the above function with tables 118 * convenient way to call the above function with tables
119 */ 119 */
120int mxc_iomux_setup_multiple_pins(unsigned int *pin_list, unsigned count, 120int mxc_iomux_setup_multiple_pins(const unsigned int *pin_list, unsigned count,
121 const char *label); 121 const char *label);
122 122
123/* 123/*
@@ -126,12 +126,12 @@ int mxc_iomux_setup_multiple_pins(unsigned int *pin_list, unsigned count,
126 * - frees the GPIO if the pin was configured as GPIO 126 * - frees the GPIO if the pin was configured as GPIO
127 * - DOES NOT reconfigure the IOMUX in its reset state 127 * - DOES NOT reconfigure the IOMUX in its reset state
128 */ 128 */
129void mxc_iomux_release_pin(const unsigned int pin); 129void mxc_iomux_release_pin(unsigned int pin);
130/* 130/*
131 * releases multiple pins 131 * releases multiple pins
132 * convenvient way to call the above function with tables 132 * convenvient way to call the above function with tables
133 */ 133 */
134void mxc_iomux_release_multiple_pins(unsigned int *pin_list, int count); 134void mxc_iomux_release_multiple_pins(const unsigned int *pin_list, int count);
135 135
136/* 136/*
137 * This function enables/disables the general purpose function for a particular 137 * This function enables/disables the general purpose function for a particular
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx35.h b/arch/arm/plat-mxc/include/mach/iomux-mx35.h
index 2a24bae1b878..3117c18bbbd9 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx35.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx35.h
@@ -989,13 +989,13 @@
989#define MX35_PAD_ATA_DATA2__IPU_DIAGB_9 IOMUX_PAD(0x6e8, 0x284, 6, 0x0, 0, NO_PAD_CTRL) 989#define MX35_PAD_ATA_DATA2__IPU_DIAGB_9 IOMUX_PAD(0x6e8, 0x284, 6, 0x0, 0, NO_PAD_CTRL)
990#define MX35_PAD_ATA_DATA2__ARM11P_TOP_TRACE_28 IOMUX_PAD(0x6e8, 0x284, 7, 0x0, 0, NO_PAD_CTRL) 990#define MX35_PAD_ATA_DATA2__ARM11P_TOP_TRACE_28 IOMUX_PAD(0x6e8, 0x284, 7, 0x0, 0, NO_PAD_CTRL)
991 991
992#define MX35_PAD_ATA_DATA3__ATA_DATA_3 IOMUX_PAD(0x6e8, 0x288, 0, 0x0, 0, NO_PAD_CTRL) 992#define MX35_PAD_ATA_DATA3__ATA_DATA_3 IOMUX_PAD(0x6ec, 0x288, 0, 0x0, 0, NO_PAD_CTRL)
993#define MX35_PAD_ATA_DATA3__ESDHC3_CLK IOMUX_PAD(0x6e8, 0x288, 1, 0x814, 1, NO_PAD_CTRL) 993#define MX35_PAD_ATA_DATA3__ESDHC3_CLK IOMUX_PAD(0x6ec, 0x288, 1, 0x814, 1, NO_PAD_CTRL)
994#define MX35_PAD_ATA_DATA3__USB_TOP_USBOTG_DATA_5 IOMUX_PAD(0x6e8, 0x288, 2, 0x9b8, 1, NO_PAD_CTRL) 994#define MX35_PAD_ATA_DATA3__USB_TOP_USBOTG_DATA_5 IOMUX_PAD(0x6ec, 0x288, 2, 0x9b8, 1, NO_PAD_CTRL)
995#define MX35_PAD_ATA_DATA3__CSPI2_SCLK IOMUX_PAD(0x6e8, 0x288, 4, 0x7e0, 2, NO_PAD_CTRL) 995#define MX35_PAD_ATA_DATA3__CSPI2_SCLK IOMUX_PAD(0x6ec, 0x288, 4, 0x7e0, 2, NO_PAD_CTRL)
996#define MX35_PAD_ATA_DATA3__GPIO2_16 IOMUX_PAD(0x6e8, 0x288, 5, 0x884, 1, NO_PAD_CTRL) 996#define MX35_PAD_ATA_DATA3__GPIO2_16 IOMUX_PAD(0x6ec, 0x288, 5, 0x884, 1, NO_PAD_CTRL)
997#define MX35_PAD_ATA_DATA3__IPU_DIAGB_10 IOMUX_PAD(0x6e8, 0x288, 6, 0x0, 0, NO_PAD_CTRL) 997#define MX35_PAD_ATA_DATA3__IPU_DIAGB_10 IOMUX_PAD(0x6ec, 0x288, 6, 0x0, 0, NO_PAD_CTRL)
998#define MX35_PAD_ATA_DATA3__ARM11P_TOP_TRACE_29 IOMUX_PAD(0x6e8, 0x288, 7, 0x0, 0, NO_PAD_CTRL) 998#define MX35_PAD_ATA_DATA3__ARM11P_TOP_TRACE_29 IOMUX_PAD(0x6ec, 0x288, 7, 0x0, 0, NO_PAD_CTRL)
999 999
1000#define MX35_PAD_ATA_DATA4__ATA_DATA_4 IOMUX_PAD(0x6f0, 0x28c, 0, 0x0, 0, NO_PAD_CTRL) 1000#define MX35_PAD_ATA_DATA4__ATA_DATA_4 IOMUX_PAD(0x6f0, 0x28c, 0, 0x0, 0, NO_PAD_CTRL)
1001#define MX35_PAD_ATA_DATA4__ESDHC3_CMD IOMUX_PAD(0x6f0, 0x28c, 1, 0x818, 1, NO_PAD_CTRL) 1001#define MX35_PAD_ATA_DATA4__ESDHC3_CMD IOMUX_PAD(0x6f0, 0x28c, 1, 0x818, 1, NO_PAD_CTRL)
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx50.h b/arch/arm/plat-mxc/include/mach/iomux-mx50.h
index 058a922ca147..98e7fd0b9083 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx50.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx50.h
@@ -86,7 +86,7 @@
86#define MX50_PAD_I2C1_SCL__I2C1_SCL IOMUX_PAD(0x2EC, 0x40, IOMUX_CONFIG_SION, 0x0, 0, \ 86#define MX50_PAD_I2C1_SCL__I2C1_SCL IOMUX_PAD(0x2EC, 0x40, IOMUX_CONFIG_SION, 0x0, 0, \
87 MX50_I2C_PAD_CTRL) 87 MX50_I2C_PAD_CTRL)
88#define MX50_PAD_I2C1_SCL__GPIO_6_18 IOMUX_PAD(0x2EC, 0x40, 1, 0x0, 0, NO_PAD_CTRL) 88#define MX50_PAD_I2C1_SCL__GPIO_6_18 IOMUX_PAD(0x2EC, 0x40, 1, 0x0, 0, NO_PAD_CTRL)
89#define MX50_PAD_I2C1_SCL__UART2_TXD IOMUX_PAD(0x2EC, 0x40, 2, 0x7cc, 0, MX50_UART_PAD_CTRL) 89#define MX50_PAD_I2C1_SCL__UART2_TXD IOMUX_PAD(0x2EC, 0x40, 2, 0x0, 0, MX50_UART_PAD_CTRL)
90 90
91#define MX50_PAD_I2C1_SDA__I2C1_SDA IOMUX_PAD(0x2F0, 0x44, IOMUX_CONFIG_SION, 0x0, 0, \ 91#define MX50_PAD_I2C1_SDA__I2C1_SDA IOMUX_PAD(0x2F0, 0x44, IOMUX_CONFIG_SION, 0x0, 0, \
92 MX50_I2C_PAD_CTRL) 92 MX50_I2C_PAD_CTRL)
@@ -96,7 +96,7 @@
96#define MX50_PAD_I2C2_SCL__I2C2_SCL IOMUX_PAD(0x2F4, 0x48, IOMUX_CONFIG_SION, 0x0, 0, \ 96#define MX50_PAD_I2C2_SCL__I2C2_SCL IOMUX_PAD(0x2F4, 0x48, IOMUX_CONFIG_SION, 0x0, 0, \
97 MX50_I2C_PAD_CTRL) 97 MX50_I2C_PAD_CTRL)
98#define MX50_PAD_I2C2_SCL__GPIO_6_20 IOMUX_PAD(0x2F4, 0x48, 1, 0x0, 0, NO_PAD_CTRL) 98#define MX50_PAD_I2C2_SCL__GPIO_6_20 IOMUX_PAD(0x2F4, 0x48, 1, 0x0, 0, NO_PAD_CTRL)
99#define MX50_PAD_I2C2_SCL__UART2_CTS IOMUX_PAD(0x2F4, 0x48, 2, 0x7c8, 0, MX50_UART_PAD_CTRL) 99#define MX50_PAD_I2C2_SCL__UART2_CTS IOMUX_PAD(0x2F4, 0x48, 2, 0x0, 0, MX50_UART_PAD_CTRL)
100#define MX50_PAD_I2C2_SCL__DCDC_OK IOMUX_PAD(0x2F4, 0x48, 7, 0x0, 0, NO_PAD_CTRL) 100#define MX50_PAD_I2C2_SCL__DCDC_OK IOMUX_PAD(0x2F4, 0x48, 7, 0x0, 0, NO_PAD_CTRL)
101 101
102#define MX50_PAD_I2C2_SDA__I2C2_SDA IOMUX_PAD(0x2F8, 0x4C, IOMUX_CONFIG_SION, 0x0, 0, \ 102#define MX50_PAD_I2C2_SDA__I2C2_SDA IOMUX_PAD(0x2F8, 0x4C, IOMUX_CONFIG_SION, 0x0, 0, \
@@ -172,7 +172,7 @@
172 172
173#define MX50_PAD_SSI_RXFS__AUD3_RXFS IOMUX_PAD(0x328, 0x7C, 0, 0x0, 0, NO_PAD_CTRL) 173#define MX50_PAD_SSI_RXFS__AUD3_RXFS IOMUX_PAD(0x328, 0x7C, 0, 0x0, 0, NO_PAD_CTRL)
174#define MX50_PAD_SSI_RXFS__GPIO_6_4 IOMUX_PAD(0x328, 0x7C, 1, 0x0, 0, NO_PAD_CTRL) 174#define MX50_PAD_SSI_RXFS__GPIO_6_4 IOMUX_PAD(0x328, 0x7C, 1, 0x0, 0, NO_PAD_CTRL)
175#define MX50_PAD_SSI_RXFS__UART5_TXD IOMUX_PAD(0x328, 0x7C, 2, 0x7e4, 0, MX50_UART_PAD_CTRL) 175#define MX50_PAD_SSI_RXFS__UART5_TXD IOMUX_PAD(0x328, 0x7C, 2, 0x0, 0, MX50_UART_PAD_CTRL)
176#define MX50_PAD_SSI_RXFS__WEIM_D6 IOMUX_PAD(0x328, 0x7C, 3, 0x804, 0, NO_PAD_CTRL) 176#define MX50_PAD_SSI_RXFS__WEIM_D6 IOMUX_PAD(0x328, 0x7C, 3, 0x804, 0, NO_PAD_CTRL)
177#define MX50_PAD_SSI_RXFS__CSPI_SS2 IOMUX_PAD(0x328, 0x7C, 4, 0x6f0, 0, MX50_CSPI_SS_PAD) 177#define MX50_PAD_SSI_RXFS__CSPI_SS2 IOMUX_PAD(0x328, 0x7C, 4, 0x6f0, 0, MX50_CSPI_SS_PAD)
178#define MX50_PAD_SSI_RXFS__FEC_COL IOMUX_PAD(0x328, 0x7C, 5, 0x770, 0, PAD_CTL_DSE_HIGH) 178#define MX50_PAD_SSI_RXFS__FEC_COL IOMUX_PAD(0x328, 0x7C, 5, 0x770, 0, PAD_CTL_DSE_HIGH)
@@ -186,25 +186,25 @@
186#define MX50_PAD_SSI_RXC__FEC_RX_CLK IOMUX_PAD(0x32C, 0x80, 5, 0x780, 0, NO_PAD_CTRL) 186#define MX50_PAD_SSI_RXC__FEC_RX_CLK IOMUX_PAD(0x32C, 0x80, 5, 0x780, 0, NO_PAD_CTRL)
187#define MX50_PAD_SSI_RXC__FEC_MDIO IOMUX_PAD(0x32C, 0x80, 6, 0x774, 1, MX50_FEC_PAD_CTRL) 187#define MX50_PAD_SSI_RXC__FEC_MDIO IOMUX_PAD(0x32C, 0x80, 6, 0x774, 1, MX50_FEC_PAD_CTRL)
188 188
189#define MX50_PAD_UART1_TXD__UART1_TXD IOMUX_PAD(0x330, 0x84, 0, 0x7c4, 0, MX50_UART_PAD_CTRL) 189#define MX50_PAD_UART1_TXD__UART1_TXD IOMUX_PAD(0x330, 0x84, 0, 0x0, 0, MX50_UART_PAD_CTRL)
190#define MX50_PAD_UART1_TXD__GPIO_6_6 IOMUX_PAD(0x330, 0x84, 1, 0x0, 0, NO_PAD_CTRL) 190#define MX50_PAD_UART1_TXD__GPIO_6_6 IOMUX_PAD(0x330, 0x84, 1, 0x0, 0, NO_PAD_CTRL)
191 191
192#define MX50_PAD_UART1_RXD__UART1_RXD IOMUX_PAD(0x334, 0x88, 0, 0x7c4, 1, MX50_UART_PAD_CTRL) 192#define MX50_PAD_UART1_RXD__UART1_RXD IOMUX_PAD(0x334, 0x88, 0, 0x7c4, 1, MX50_UART_PAD_CTRL)
193#define MX50_PAD_UART1_RXD__GPIO_6_7 IOMUX_PAD(0x334, 0x88, 1, 0x0, 0, NO_PAD_CTRL) 193#define MX50_PAD_UART1_RXD__GPIO_6_7 IOMUX_PAD(0x334, 0x88, 1, 0x0, 0, NO_PAD_CTRL)
194 194
195#define MX50_PAD_UART1_CTS__UART1_CTS IOMUX_PAD(0x338, 0x8C, 0, 0x7c0, 0, MX50_UART_PAD_CTRL) 195#define MX50_PAD_UART1_CTS__UART1_CTS IOMUX_PAD(0x338, 0x8C, 0, 0x0, 0, MX50_UART_PAD_CTRL)
196#define MX50_PAD_UART1_CTS__GPIO_6_8 IOMUX_PAD(0x338, 0x8C, 1, 0x0, 0, NO_PAD_CTRL) 196#define MX50_PAD_UART1_CTS__GPIO_6_8 IOMUX_PAD(0x338, 0x8C, 1, 0x0, 0, NO_PAD_CTRL)
197#define MX50_PAD_UART1_CTS__UART5_TXD IOMUX_PAD(0x338, 0x8C, 2, 0x7e4, 2, MX50_UART_PAD_CTRL) 197#define MX50_PAD_UART1_CTS__UART5_TXD IOMUX_PAD(0x338, 0x8C, 2, 0x0, 0, MX50_UART_PAD_CTRL)
198#define MX50_PAD_UART1_CTS__SD4_D4 IOMUX_PAD(0x338, 0x8C, 4, 0x760, 0, MX50_SD_PAD_CTRL) 198#define MX50_PAD_UART1_CTS__SD4_D4 IOMUX_PAD(0x338, 0x8C, 4, 0x760, 0, MX50_SD_PAD_CTRL)
199#define MX50_PAD_UART1_CTS__SD4_CMD IOMUX_PAD(0x338, 0x8C, 5, 0x74c, 0, MX50_SD_PAD_CTRL) 199#define MX50_PAD_UART1_CTS__SD4_CMD IOMUX_PAD(0x338, 0x8C, 5, 0x74c, 0, MX50_SD_PAD_CTRL)
200 200
201#define MX50_PAD_UART1_RTS__UART1_RTS IOMUX_PAD(0x33C, 0x90, 0, 0x7c0, 1, MX50_UART_PAD_CTRL) 201#define MX50_PAD_UART1_RTS__UART1_RTS IOMUX_PAD(0x33C, 0x90, 0, 0x7c0, 1, MX50_UART_PAD_CTRL)
202#define MX50_PAD_UART1_RTS__GPIO_6_9 IOMUX_PAD(0x33C, 0x90, 1, 0x0, 0, NO_PAD_CTRL) 202#define MX50_PAD_UART1_RTS__GPIO_6_9 IOMUX_PAD(0x33C, 0x90, 1, 0x0, 0, NO_PAD_CTRL)
203#define MX50_PAD_UART1_RTS__UART5_RXD IOMUX_PAD(0x33C, 0x90, 2, 0x7e4, 3, MX50_UART_PAD_CTRL) 203#define MX50_PAD_UART1_RTS__UART5_RXD IOMUX_PAD(0x33C, 0x90, 2, 0x7e4, 3, MX50_UART_PAD_CTRL)
204#define MX50_PAD_UART1_RTS__SD4_D5 IOMUX_PAD(0x33C, 0x90, 4, 0x0, 1, MX50_SD_PAD_CTRL) 204#define MX50_PAD_UART1_RTS__SD4_D5 IOMUX_PAD(0x33C, 0x90, 4, 0x764, 0, MX50_SD_PAD_CTRL)
205#define MX50_PAD_UART1_RTS__SD4_CLK IOMUX_PAD(0x33C, 0x90, 5, 0x0, 1, MX50_SD_PAD_CTRL) 205#define MX50_PAD_UART1_RTS__SD4_CLK IOMUX_PAD(0x33C, 0x90, 5, 0x748, 0, MX50_SD_PAD_CTRL)
206 206
207#define MX50_PAD_UART2_TXD__UART2_TXD IOMUX_PAD(0x340, 0x94, 0, 0x7cc, 2, MX50_UART_PAD_CTRL) 207#define MX50_PAD_UART2_TXD__UART2_TXD IOMUX_PAD(0x340, 0x94, 0, 0x0, 0, MX50_UART_PAD_CTRL)
208#define MX50_PAD_UART2_TXD__GPIO_6_10 IOMUX_PAD(0x340, 0x94, 1, 0x0, 0, NO_PAD_CTRL) 208#define MX50_PAD_UART2_TXD__GPIO_6_10 IOMUX_PAD(0x340, 0x94, 1, 0x0, 0, NO_PAD_CTRL)
209#define MX50_PAD_UART2_TXD__SD4_D6 IOMUX_PAD(0x340, 0x94, 4, 0x768, 0, MX50_SD_PAD_CTRL) 209#define MX50_PAD_UART2_TXD__SD4_D6 IOMUX_PAD(0x340, 0x94, 4, 0x768, 0, MX50_SD_PAD_CTRL)
210#define MX50_PAD_UART2_TXD__SD4_D4 IOMUX_PAD(0x340, 0x94, 5, 0x760, 1, MX50_SD_PAD_CTRL) 210#define MX50_PAD_UART2_TXD__SD4_D4 IOMUX_PAD(0x340, 0x94, 5, 0x760, 1, MX50_SD_PAD_CTRL)
@@ -214,7 +214,7 @@
214#define MX50_PAD_UART2_RXD__SD4_D7 IOMUX_PAD(0x344, 0x98, 4, 0x76c, 0, MX50_SD_PAD_CTRL) 214#define MX50_PAD_UART2_RXD__SD4_D7 IOMUX_PAD(0x344, 0x98, 4, 0x76c, 0, MX50_SD_PAD_CTRL)
215#define MX50_PAD_UART2_RXD__SD4_D5 IOMUX_PAD(0x344, 0x98, 5, 0x764, 1, MX50_SD_PAD_CTRL) 215#define MX50_PAD_UART2_RXD__SD4_D5 IOMUX_PAD(0x344, 0x98, 5, 0x764, 1, MX50_SD_PAD_CTRL)
216 216
217#define MX50_PAD_UART2_CTS__UART2_CTS IOMUX_PAD(0x348, 0x9C, 0, 0x7c8, 2, MX50_UART_PAD_CTRL) 217#define MX50_PAD_UART2_CTS__UART2_CTS IOMUX_PAD(0x348, 0x9C, 0, 0x0, 0, MX50_UART_PAD_CTRL)
218#define MX50_PAD_UART2_CTS__GPIO_6_12 IOMUX_PAD(0x348, 0x9C, 1, 0x0, 0, NO_PAD_CTRL) 218#define MX50_PAD_UART2_CTS__GPIO_6_12 IOMUX_PAD(0x348, 0x9C, 1, 0x0, 0, NO_PAD_CTRL)
219#define MX50_PAD_UART2_CTS__SD4_CMD IOMUX_PAD(0x348, 0x9C, 4, 0x74c, 1, MX50_SD_PAD_CTRL) 219#define MX50_PAD_UART2_CTS__SD4_CMD IOMUX_PAD(0x348, 0x9C, 4, 0x74c, 1, MX50_SD_PAD_CTRL)
220#define MX50_PAD_UART2_CTS__SD4_D6 IOMUX_PAD(0x348, 0x9C, 5, 0x768, 1, MX50_SD_PAD_CTRL) 220#define MX50_PAD_UART2_CTS__SD4_D6 IOMUX_PAD(0x348, 0x9C, 5, 0x768, 1, MX50_SD_PAD_CTRL)
@@ -224,7 +224,7 @@
224#define MX50_PAD_UART2_RTS__SD4_CLK IOMUX_PAD(0x34C, 0xA0, 4, 0x748, 1, MX50_SD_PAD_CTRL) 224#define MX50_PAD_UART2_RTS__SD4_CLK IOMUX_PAD(0x34C, 0xA0, 4, 0x748, 1, MX50_SD_PAD_CTRL)
225#define MX50_PAD_UART2_RTS__SD4_D7 IOMUX_PAD(0x34C, 0xA0, 5, 0x76c, 1, MX50_SD_PAD_CTRL) 225#define MX50_PAD_UART2_RTS__SD4_D7 IOMUX_PAD(0x34C, 0xA0, 5, 0x76c, 1, MX50_SD_PAD_CTRL)
226 226
227#define MX50_PAD_UART3_TXD__UART3_TXD IOMUX_PAD(0x350, 0xA4, 0, 0x7d4, 0, MX50_UART_PAD_CTRL) 227#define MX50_PAD_UART3_TXD__UART3_TXD IOMUX_PAD(0x350, 0xA4, 0, 0x0, 0, MX50_UART_PAD_CTRL)
228#define MX50_PAD_UART3_TXD__GPIO_6_14 IOMUX_PAD(0x350, 0xA4, 1, 0x0, 0, NO_PAD_CTRL) 228#define MX50_PAD_UART3_TXD__GPIO_6_14 IOMUX_PAD(0x350, 0xA4, 1, 0x0, 0, NO_PAD_CTRL)
229#define MX50_PAD_UART3_TXD__SD1_D4 IOMUX_PAD(0x350, 0xA4, 3, 0x0, 0, MX50_SD_PAD_CTRL) 229#define MX50_PAD_UART3_TXD__SD1_D4 IOMUX_PAD(0x350, 0xA4, 3, 0x0, 0, MX50_SD_PAD_CTRL)
230#define MX50_PAD_UART3_TXD__SD4_D0 IOMUX_PAD(0x350, 0xA4, 4, 0x750, 0, MX50_SD_PAD_CTRL) 230#define MX50_PAD_UART3_TXD__SD4_D0 IOMUX_PAD(0x350, 0xA4, 4, 0x750, 0, MX50_SD_PAD_CTRL)
@@ -238,9 +238,9 @@
238#define MX50_PAD_UART3_RXD__SD2_CD IOMUX_PAD(0x354, 0xA8, 5, 0x740, 0, MX50_SD_PAD_CTRL) 238#define MX50_PAD_UART3_RXD__SD2_CD IOMUX_PAD(0x354, 0xA8, 5, 0x740, 0, MX50_SD_PAD_CTRL)
239#define MX50_PAD_UART3_RXD__WEIM_D13 IOMUX_PAD(0x354, 0xA8, 6, 0x820, 0, NO_PAD_CTRL) 239#define MX50_PAD_UART3_RXD__WEIM_D13 IOMUX_PAD(0x354, 0xA8, 6, 0x820, 0, NO_PAD_CTRL)
240 240
241#define MX50_PAD_UART4_TXD__UART4_TXD IOMUX_PAD(0x358, 0xAC, 0, 0x7dc, 0, MX50_UART_PAD_CTRL) 241#define MX50_PAD_UART4_TXD__UART4_TXD IOMUX_PAD(0x358, 0xAC, 0, 0x0, 0, MX50_UART_PAD_CTRL)
242#define MX50_PAD_UART4_TXD__GPIO_6_16 IOMUX_PAD(0x358, 0xAC, 1, 0x0, 0, NO_PAD_CTRL) 242#define MX50_PAD_UART4_TXD__GPIO_6_16 IOMUX_PAD(0x358, 0xAC, 1, 0x0, 0, NO_PAD_CTRL)
243#define MX50_PAD_UART4_TXD__UART3_CTS IOMUX_PAD(0x358, 0xAC, 2, 0x7d0, 0, MX50_UART_PAD_CTRL) 243#define MX50_PAD_UART4_TXD__UART3_CTS IOMUX_PAD(0x358, 0xAC, 2, 0x0, 0, MX50_UART_PAD_CTRL)
244#define MX50_PAD_UART4_TXD__SD1_D6 IOMUX_PAD(0x358, 0xAC, 3, 0x0, 0, MX50_SD_PAD_CTRL) 244#define MX50_PAD_UART4_TXD__SD1_D6 IOMUX_PAD(0x358, 0xAC, 3, 0x0, 0, MX50_SD_PAD_CTRL)
245#define MX50_PAD_UART4_TXD__SD4_D2 IOMUX_PAD(0x358, 0xAC, 4, 0x758, 0, MX50_SD_PAD_CTRL) 245#define MX50_PAD_UART4_TXD__SD4_D2 IOMUX_PAD(0x358, 0xAC, 4, 0x758, 0, MX50_SD_PAD_CTRL)
246#define MX50_PAD_UART4_TXD__SD2_LCTL IOMUX_PAD(0x358, 0xAC, 5, 0x0, 0, MX50_SD_PAD_CTRL) 246#define MX50_PAD_UART4_TXD__SD2_LCTL IOMUX_PAD(0x358, 0xAC, 5, 0x0, 0, MX50_SD_PAD_CTRL)
@@ -278,7 +278,7 @@
278#define MX50_PAD_ECSPI1_MOSI__GPIO_4_13 IOMUX_PAD(0x374, 0xC8, 1, 0x0, 0, NO_PAD_CTRL) 278#define MX50_PAD_ECSPI1_MOSI__GPIO_4_13 IOMUX_PAD(0x374, 0xC8, 1, 0x0, 0, NO_PAD_CTRL)
279#define MX50_PAD_ECSPI1_MOSI__CSPI_SS1 IOMUX_PAD(0x374, 0xC8, 2, 0x6ec, 1, MX50_CSPI_SS_PAD) 279#define MX50_PAD_ECSPI1_MOSI__CSPI_SS1 IOMUX_PAD(0x374, 0xC8, 2, 0x6ec, 1, MX50_CSPI_SS_PAD)
280#define MX50_PAD_ECSPI1_MOSI__ECSPI2_SS1 IOMUX_PAD(0x374, 0xC8, 3, 0x0, 0, MX50_CSPI_SS_PAD) 280#define MX50_PAD_ECSPI1_MOSI__ECSPI2_SS1 IOMUX_PAD(0x374, 0xC8, 3, 0x0, 0, MX50_CSPI_SS_PAD)
281#define MX50_PAD_ECSPI1_MOSI__UART3_CTS IOMUX_PAD(0x374, 0xC8, 4, 0x7d0, 3, MX50_UART_PAD_CTRL) 281#define MX50_PAD_ECSPI1_MOSI__UART3_CTS IOMUX_PAD(0x374, 0xC8, 4, 0x0, 0, MX50_UART_PAD_CTRL)
282#define MX50_PAD_ECSPI1_MOSI__EPDC_SDCE7 IOMUX_PAD(0x374, 0xC8, 5, 0x0, 0, NO_PAD_CTRL) 282#define MX50_PAD_ECSPI1_MOSI__EPDC_SDCE7 IOMUX_PAD(0x374, 0xC8, 5, 0x0, 0, NO_PAD_CTRL)
283#define MX50_PAD_ECSPI1_MOSI__WEIM_D9 IOMUX_PAD(0x374, 0xC8, 7, 0x810, 0, NO_PAD_CTRL) 283#define MX50_PAD_ECSPI1_MOSI__WEIM_D9 IOMUX_PAD(0x374, 0xC8, 7, 0x810, 0, NO_PAD_CTRL)
284 284
@@ -294,7 +294,7 @@
294#define MX50_PAD_ECSPI1_SS0__GPIO_4_15 IOMUX_PAD(0x37C, 0xD0, 1, 0x0, 0, PAD_CTL_PUS_100K_UP) 294#define MX50_PAD_ECSPI1_SS0__GPIO_4_15 IOMUX_PAD(0x37C, 0xD0, 1, 0x0, 0, PAD_CTL_PUS_100K_UP)
295#define MX50_PAD_ECSPI1_SS0__CSPI_SS3 IOMUX_PAD(0x37C, 0xD0, 2, 0x6f4, 1, MX50_CSPI_SS_PAD) 295#define MX50_PAD_ECSPI1_SS0__CSPI_SS3 IOMUX_PAD(0x37C, 0xD0, 2, 0x6f4, 1, MX50_CSPI_SS_PAD)
296#define MX50_PAD_ECSPI1_SS0__ECSPI2_SS3 IOMUX_PAD(0x37C, 0xD0, 3, 0x0, 0, MX50_CSPI_SS_PAD) 296#define MX50_PAD_ECSPI1_SS0__ECSPI2_SS3 IOMUX_PAD(0x37C, 0xD0, 3, 0x0, 0, MX50_CSPI_SS_PAD)
297#define MX50_PAD_ECSPI1_SS0__UART4_CTS IOMUX_PAD(0x37C, 0xD0, 4, 0x7d8, 1, MX50_UART_PAD_CTRL) 297#define MX50_PAD_ECSPI1_SS0__UART4_CTS IOMUX_PAD(0x37C, 0xD0, 4, 0x0, 0, MX50_UART_PAD_CTRL)
298#define MX50_PAD_ECSPI1_SS0__EPDC_SDCE9 IOMUX_PAD(0x37C, 0xD0, 5, 0x0, 0, NO_PAD_CTRL) 298#define MX50_PAD_ECSPI1_SS0__EPDC_SDCE9 IOMUX_PAD(0x37C, 0xD0, 5, 0x0, 0, NO_PAD_CTRL)
299#define MX50_PAD_ECSPI1_SS0__WEIM_D11 IOMUX_PAD(0x37C, 0xD0, 7, 0x818, 0, NO_PAD_CTRL) 299#define MX50_PAD_ECSPI1_SS0__WEIM_D11 IOMUX_PAD(0x37C, 0xD0, 7, 0x818, 0, NO_PAD_CTRL)
300 300
@@ -311,17 +311,17 @@
311#define MX50_PAD_ECSPI2_MOSI__GPIO_4_17 IOMUX_PAD(0x384, 0xD8, 1, 0x0, 0, NO_PAD_CTRL) 311#define MX50_PAD_ECSPI2_MOSI__GPIO_4_17 IOMUX_PAD(0x384, 0xD8, 1, 0x0, 0, NO_PAD_CTRL)
312#define MX50_PAD_ECSPI2_MOSI__ELCDIF_RD IOMUX_PAD(0x384, 0xD8, 2, 0x0, 0, NO_PAD_CTRL) 312#define MX50_PAD_ECSPI2_MOSI__ELCDIF_RD IOMUX_PAD(0x384, 0xD8, 2, 0x0, 0, NO_PAD_CTRL)
313#define MX50_PAD_ECSPI2_MOSI__ECSPI1_SS1 IOMUX_PAD(0x384, 0xD8, 3, 0x0, 0, MX50_CSPI_SS_PAD) 313#define MX50_PAD_ECSPI2_MOSI__ECSPI1_SS1 IOMUX_PAD(0x384, 0xD8, 3, 0x0, 0, MX50_CSPI_SS_PAD)
314#define MX50_PAD_ECSPI2_MOSI__UART5_CTS IOMUX_PAD(0x384, 0xD8, 4, 0x7e0, 1, MX50_UART_PAD_CTRL) 314#define MX50_PAD_ECSPI2_MOSI__UART5_CTS IOMUX_PAD(0x384, 0xD8, 4, 0x0, 0, MX50_UART_PAD_CTRL)
315#define MX50_PAD_ECSPI2_MOSI__ELCDIF_EN IOMUX_PAD(0x384, 0xD8, 5, 0x0, 0, NO_PAD_CTRL) 315#define MX50_PAD_ECSPI2_MOSI__ELCDIF_EN IOMUX_PAD(0x384, 0xD8, 5, 0x0, 0, NO_PAD_CTRL)
316#define MX50_PAD_ECSPI2_MOSI__NANDF_CEN5 IOMUX_PAD(0x384, 0xD8, 6, 0x0, 0, NO_PAD_CTRL) 316#define MX50_PAD_ECSPI2_MOSI__NANDF_CEN5 IOMUX_PAD(0x384, 0xD8, 6, 0x0, 0, NO_PAD_CTRL)
317#define MX50_PAD_ECSPI2_MOSI__WEIM_D9 IOMUX_PAD(0x384, 0xD8, 7, 0x810, 1, NO_PAD_CTRL) 317#define MX50_PAD_ECSPI2_MOSI__WEIM_D9 IOMUX_PAD(0x384, 0xD8, 7, 0x810, 1, NO_PAD_CTRL)
318 318
319#define MX50_PAD_ECSPI2_MISO__ECSPI2_MISO IOMUX_PAD(0x388, 0xDC, 0, 0x73c, 0, NO_PAD_CTRL) 319#define MX50_PAD_ECSPI2_MISO__ECSPI2_MISO IOMUX_PAD(0x388, 0xDC, 0, 0x0, 0, NO_PAD_CTRL)
320#define MX50_PAD_ECSPI2_MISO__GPIO_4_18 IOMUX_PAD(0x388, 0xDC, 1, 0x0, 0, PAD_CTL_PUS_100K_UP) 320#define MX50_PAD_ECSPI2_MISO__GPIO_4_18 IOMUX_PAD(0x388, 0xDC, 1, 0x0, 0, PAD_CTL_PUS_100K_UP)
321#define MX50_PAD_ECSPI2_MISO__ELCDIF_RS IOMUX_PAD(0x388, 0xDC, 2, 0x0, 0, NO_PAD_CTRL) 321#define MX50_PAD_ECSPI2_MISO__ELCDIF_RS IOMUX_PAD(0x388, 0xDC, 2, 0x0, 0, NO_PAD_CTRL)
322#define MX50_PAD_ECSPI2_MISO__ECSPI1_SS2 IOMUX_PAD(0x388, 0xDC, 3, 0x0, 0, MX50_CSPI_SS_PAD) 322#define MX50_PAD_ECSPI2_MISO__ECSPI1_SS2 IOMUX_PAD(0x388, 0xDC, 3, 0x0, 0, MX50_CSPI_SS_PAD)
323#define MX50_PAD_ECSPI2_MISO__UART5_TXD IOMUX_PAD(0x388, 0xDC, 4, 0x7e4, 4, MX50_UART_PAD_CTRL) 323#define MX50_PAD_ECSPI2_MISO__UART5_TXD IOMUX_PAD(0x388, 0xDC, 4, 0x0, 0, MX50_UART_PAD_CTRL)
324#define MX50_PAD_ECSPI2_MISO__ELCDIF_VSYNC IOMUX_PAD(0x388, 0xDC, 5, 0x0, 0, NO_PAD_CTRL) 324#define MX50_PAD_ECSPI2_MISO__ELCDIF_VSYNC IOMUX_PAD(0x388, 0xDC, 5, 0x73c, 0, NO_PAD_CTRL)
325#define MX50_PAD_ECSPI2_MISO__NANDF_CEN6 IOMUX_PAD(0x388, 0xDC, 6, 0x0, 0, NO_PAD_CTRL) 325#define MX50_PAD_ECSPI2_MISO__NANDF_CEN6 IOMUX_PAD(0x388, 0xDC, 6, 0x0, 0, NO_PAD_CTRL)
326#define MX50_PAD_ECSPI2_MISO__WEIM_D10 IOMUX_PAD(0x388, 0xDC, 7, 0x814, 1, NO_PAD_CTRL) 326#define MX50_PAD_ECSPI2_MISO__WEIM_D10 IOMUX_PAD(0x388, 0xDC, 7, 0x814, 1, NO_PAD_CTRL)
327 327
@@ -503,7 +503,7 @@
503#define MX50_PAD_DISP_RD__ELCDIF_EN IOMUX_PAD(0x430, 0x150, 2, 0x0, 0, MX50_ELCDIF_PAD_CTRL) 503#define MX50_PAD_DISP_RD__ELCDIF_EN IOMUX_PAD(0x430, 0x150, 2, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
504#define MX50_PAD_DISP_RD__WEIM_A25 IOMUX_PAD(0x430, 0x150, 3, 0x0, 0, NO_PAD_CTRL) 504#define MX50_PAD_DISP_RD__WEIM_A25 IOMUX_PAD(0x430, 0x150, 3, 0x0, 0, NO_PAD_CTRL)
505 505
506#define MX50_PAD_DISP_RS__ELCDIF_RS IOMUX_PAD(0x434, 0x154, 0, 0x73c, 1, MX50_ELCDIF_PAD_CTRL) 506#define MX50_PAD_DISP_RS__ELCDIF_RS IOMUX_PAD(0x434, 0x154, 0, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
507#define MX50_PAD_DISP_RS__GPIO_2_17 IOMUX_PAD(0x434, 0x154, 1, 0x0, 0, NO_PAD_CTRL) 507#define MX50_PAD_DISP_RS__GPIO_2_17 IOMUX_PAD(0x434, 0x154, 1, 0x0, 0, NO_PAD_CTRL)
508#define MX50_PAD_DISP_RS__ELCDIF_VSYNC IOMUX_PAD(0x434, 0x154, 2, 0x73c, 1, MX50_ELCDIF_PAD_CTRL) 508#define MX50_PAD_DISP_RS__ELCDIF_VSYNC IOMUX_PAD(0x434, 0x154, 2, 0x73c, 1, MX50_ELCDIF_PAD_CTRL)
509#define MX50_PAD_DISP_RS__WEIM_A26 IOMUX_PAD(0x434, 0x154, 3, 0x0, 0, NO_PAD_CTRL) 509#define MX50_PAD_DISP_RS__WEIM_A26 IOMUX_PAD(0x434, 0x154, 3, 0x0, 0, NO_PAD_CTRL)
@@ -691,8 +691,8 @@
691 691
692#define MX50_PAD_EPDC_D9__EPDC_D9 IOMUX_PAD(0x570, 0x1D4, 0, 0x0, 0, NO_PAD_CTRL) 692#define MX50_PAD_EPDC_D9__EPDC_D9 IOMUX_PAD(0x570, 0x1D4, 0, 0x0, 0, NO_PAD_CTRL)
693#define MX50_PAD_EPDC_D9__GPIO_3_9 IOMUX_PAD(0x570, 0x1D4, 1, 0x0, 0, NO_PAD_CTRL) 693#define MX50_PAD_EPDC_D9__GPIO_3_9 IOMUX_PAD(0x570, 0x1D4, 1, 0x0, 0, NO_PAD_CTRL)
694#define MX50_PAD_EPDC_D9__WEIM_D9 IOMUX_PAD(0x570, 0x1D4, 2, 0x0, 0, NO_PAD_CTRL) 694#define MX50_PAD_EPDC_D9__WEIM_D9 IOMUX_PAD(0x570, 0x1D4, 2, 0x810, 2, NO_PAD_CTRL)
695#define MX50_PAD_EPDC_D9__ELCDIF_D25 IOMUX_PAD(0x570, 0x1D4, 3, 0x810, 2, MX50_ELCDIF_PAD_CTRL) 695#define MX50_PAD_EPDC_D9__ELCDIF_D25 IOMUX_PAD(0x570, 0x1D4, 3, 0x0, 0, MX50_ELCDIF_PAD_CTRL)
696 696
697#define MX50_PAD_EPDC_D10__EPDC_D10 IOMUX_PAD(0x574, 0x1D8, 0, 0x0, 0, NO_PAD_CTRL) 697#define MX50_PAD_EPDC_D10__EPDC_D10 IOMUX_PAD(0x574, 0x1D8, 0, 0x0, 0, NO_PAD_CTRL)
698#define MX50_PAD_EPDC_D10__GPIO_3_10 IOMUX_PAD(0x574, 0x1D8, 1, 0x0, 0, NO_PAD_CTRL) 698#define MX50_PAD_EPDC_D10__GPIO_3_10 IOMUX_PAD(0x574, 0x1D8, 1, 0x0, 0, NO_PAD_CTRL)
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx51.h b/arch/arm/plat-mxc/include/mach/iomux-mx51.h
index b6767f90ef14..df6acc066fb1 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx51.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx51.h
@@ -473,7 +473,7 @@
473#define _MX51_PAD_UART2_RXD__UART2_RXD IOMUX_PAD(0x628, 0x238, 0, 0x09ec, 2, 0) 473#define _MX51_PAD_UART2_RXD__UART2_RXD IOMUX_PAD(0x628, 0x238, 0, 0x09ec, 2, 0)
474#define _MX51_PAD_UART2_TXD__FIRI_RXD IOMUX_PAD(0x62c, 0x23c, 1, 0x0000, 0, 0) 474#define _MX51_PAD_UART2_TXD__FIRI_RXD IOMUX_PAD(0x62c, 0x23c, 1, 0x0000, 0, 0)
475#define _MX51_PAD_UART2_TXD__GPIO1_21 IOMUX_PAD(0x62c, 0x23c, 3, 0x0000, 0, 0) 475#define _MX51_PAD_UART2_TXD__GPIO1_21 IOMUX_PAD(0x62c, 0x23c, 3, 0x0000, 0, 0)
476#define _MX51_PAD_UART2_TXD__UART2_TXD IOMUX_PAD(0x62c, 0x23c, 0, 0x09ec, 3, 0) 476#define _MX51_PAD_UART2_TXD__UART2_TXD IOMUX_PAD(0x62c, 0x23c, 0, 0x0000, 0, 0)
477#define _MX51_PAD_UART3_RXD__CSI1_D0 IOMUX_PAD(0x630, 0x240, 2, 0x0000, 0, 0) 477#define _MX51_PAD_UART3_RXD__CSI1_D0 IOMUX_PAD(0x630, 0x240, 2, 0x0000, 0, 0)
478#define _MX51_PAD_UART3_RXD__GPIO1_22 IOMUX_PAD(0x630, 0x240, 3, 0x0000, 0, 0) 478#define _MX51_PAD_UART3_RXD__GPIO1_22 IOMUX_PAD(0x630, 0x240, 3, 0x0000, 0, 0)
479#define _MX51_PAD_UART3_RXD__UART1_DTR IOMUX_PAD(0x630, 0x240, 0, 0x0000, 0, 0) 479#define _MX51_PAD_UART3_RXD__UART1_DTR IOMUX_PAD(0x630, 0x240, 0, 0x0000, 0, 0)
@@ -528,7 +528,7 @@
528#define _MX51_PAD_USBH1_DATA1__UART2_RXD IOMUX_PAD(0x68c, 0x28c, 1, 0x09ec, 4, 0) 528#define _MX51_PAD_USBH1_DATA1__UART2_RXD IOMUX_PAD(0x68c, 0x28c, 1, 0x09ec, 4, 0)
529#define _MX51_PAD_USBH1_DATA1__USBH1_DATA1 IOMUX_PAD(0x68c, 0x28c, 0, 0x0000, 0, 0) 529#define _MX51_PAD_USBH1_DATA1__USBH1_DATA1 IOMUX_PAD(0x68c, 0x28c, 0, 0x0000, 0, 0)
530#define _MX51_PAD_USBH1_DATA2__GPIO1_13 IOMUX_PAD(0x690, 0x290, 2, 0x0000, 0, 0) 530#define _MX51_PAD_USBH1_DATA2__GPIO1_13 IOMUX_PAD(0x690, 0x290, 2, 0x0000, 0, 0)
531#define _MX51_PAD_USBH1_DATA2__UART2_TXD IOMUX_PAD(0x690, 0x290, 1, 0x09ec, 5, 0) 531#define _MX51_PAD_USBH1_DATA2__UART2_TXD IOMUX_PAD(0x690, 0x290, 1, 0x0000, 0, 0)
532#define _MX51_PAD_USBH1_DATA2__USBH1_DATA2 IOMUX_PAD(0x690, 0x290, 0, 0x0000, 0, 0) 532#define _MX51_PAD_USBH1_DATA2__USBH1_DATA2 IOMUX_PAD(0x690, 0x290, 0, 0x0000, 0, 0)
533#define _MX51_PAD_USBH1_DATA3__GPIO1_14 IOMUX_PAD(0x694, 0x294, 2, 0x0000, 0, 0) 533#define _MX51_PAD_USBH1_DATA3__GPIO1_14 IOMUX_PAD(0x694, 0x294, 2, 0x0000, 0, 0)
534#define _MX51_PAD_USBH1_DATA3__UART2_RTS IOMUX_PAD(0x694, 0x294, 1, 0x09e8, 5, 0) 534#define _MX51_PAD_USBH1_DATA3__UART2_RTS IOMUX_PAD(0x694, 0x294, 1, 0x09e8, 5, 0)
@@ -985,11 +985,11 @@
985#define MX51_PAD_NANDF_WE_B__GPIO3_3 (_MX51_PAD_NANDF_WE_B__GPIO3_3 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) 985#define MX51_PAD_NANDF_WE_B__GPIO3_3 (_MX51_PAD_NANDF_WE_B__GPIO3_3 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL))
986#define MX51_PAD_NANDF_WE_B__NANDF_WE_B (_MX51_PAD_NANDF_WE_B__NANDF_WE_B | MUX_PAD_CTRL(NO_PAD_CTRL)) 986#define MX51_PAD_NANDF_WE_B__NANDF_WE_B (_MX51_PAD_NANDF_WE_B__NANDF_WE_B | MUX_PAD_CTRL(NO_PAD_CTRL))
987#define MX51_PAD_NANDF_WE_B__PATA_DIOW (_MX51_PAD_NANDF_WE_B__PATA_DIOW | MUX_PAD_CTRL(NO_PAD_CTRL)) 987#define MX51_PAD_NANDF_WE_B__PATA_DIOW (_MX51_PAD_NANDF_WE_B__PATA_DIOW | MUX_PAD_CTRL(NO_PAD_CTRL))
988#define MX51_PAD_NANDF_WE_B__SD3_DATA0 (_MX51_PAD_NANDF_WE_B__SD3_DATA0 | MUX_PAD_CTRL(NO_PAD_CTRL)) 988#define MX51_PAD_NANDF_WE_B__SD3_DATA0 (_MX51_PAD_NANDF_WE_B__SD3_DATA0 | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL))
989#define MX51_PAD_NANDF_RE_B__GPIO3_4 (_MX51_PAD_NANDF_RE_B__GPIO3_4 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) 989#define MX51_PAD_NANDF_RE_B__GPIO3_4 (_MX51_PAD_NANDF_RE_B__GPIO3_4 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL))
990#define MX51_PAD_NANDF_RE_B__NANDF_RE_B (_MX51_PAD_NANDF_RE_B__NANDF_RE_B | MUX_PAD_CTRL(NO_PAD_CTRL)) 990#define MX51_PAD_NANDF_RE_B__NANDF_RE_B (_MX51_PAD_NANDF_RE_B__NANDF_RE_B | MUX_PAD_CTRL(NO_PAD_CTRL))
991#define MX51_PAD_NANDF_RE_B__PATA_DIOR (_MX51_PAD_NANDF_RE_B__PATA_DIOR | MUX_PAD_CTRL(NO_PAD_CTRL)) 991#define MX51_PAD_NANDF_RE_B__PATA_DIOR (_MX51_PAD_NANDF_RE_B__PATA_DIOR | MUX_PAD_CTRL(NO_PAD_CTRL))
992#define MX51_PAD_NANDF_RE_B__SD3_DATA1 (_MX51_PAD_NANDF_RE_B__SD3_DATA1 | MUX_PAD_CTRL(NO_PAD_CTRL)) 992#define MX51_PAD_NANDF_RE_B__SD3_DATA1 (_MX51_PAD_NANDF_RE_B__SD3_DATA1 | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL))
993#define MX51_PAD_NANDF_ALE__GPIO3_5 (_MX51_PAD_NANDF_ALE__GPIO3_5 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) 993#define MX51_PAD_NANDF_ALE__GPIO3_5 (_MX51_PAD_NANDF_ALE__GPIO3_5 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL))
994#define MX51_PAD_NANDF_ALE__NANDF_ALE (_MX51_PAD_NANDF_ALE__NANDF_ALE | MUX_PAD_CTRL(NO_PAD_CTRL)) 994#define MX51_PAD_NANDF_ALE__NANDF_ALE (_MX51_PAD_NANDF_ALE__NANDF_ALE | MUX_PAD_CTRL(NO_PAD_CTRL))
995#define MX51_PAD_NANDF_ALE__PATA_BUFFER_EN (_MX51_PAD_NANDF_ALE__PATA_BUFFER_EN | MUX_PAD_CTRL(NO_PAD_CTRL)) 995#define MX51_PAD_NANDF_ALE__PATA_BUFFER_EN (_MX51_PAD_NANDF_ALE__PATA_BUFFER_EN | MUX_PAD_CTRL(NO_PAD_CTRL))
@@ -999,18 +999,18 @@
999#define MX51_PAD_NANDF_WP_B__GPIO3_7 (_MX51_PAD_NANDF_WP_B__GPIO3_7 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) 999#define MX51_PAD_NANDF_WP_B__GPIO3_7 (_MX51_PAD_NANDF_WP_B__GPIO3_7 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL))
1000#define MX51_PAD_NANDF_WP_B__NANDF_WP_B (_MX51_PAD_NANDF_WP_B__NANDF_WP_B | MUX_PAD_CTRL(NO_PAD_CTRL)) 1000#define MX51_PAD_NANDF_WP_B__NANDF_WP_B (_MX51_PAD_NANDF_WP_B__NANDF_WP_B | MUX_PAD_CTRL(NO_PAD_CTRL))
1001#define MX51_PAD_NANDF_WP_B__PATA_DMACK (_MX51_PAD_NANDF_WP_B__PATA_DMACK | MUX_PAD_CTRL(NO_PAD_CTRL)) 1001#define MX51_PAD_NANDF_WP_B__PATA_DMACK (_MX51_PAD_NANDF_WP_B__PATA_DMACK | MUX_PAD_CTRL(NO_PAD_CTRL))
1002#define MX51_PAD_NANDF_WP_B__SD3_DATA2 (_MX51_PAD_NANDF_WP_B__SD3_DATA2 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1002#define MX51_PAD_NANDF_WP_B__SD3_DATA2 (_MX51_PAD_NANDF_WP_B__SD3_DATA2 | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL))
1003#define MX51_PAD_NANDF_RB0__ECSPI2_SS1 (_MX51_PAD_NANDF_RB0__ECSPI2_SS1 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) 1003#define MX51_PAD_NANDF_RB0__ECSPI2_SS1 (_MX51_PAD_NANDF_RB0__ECSPI2_SS1 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL))
1004#define MX51_PAD_NANDF_RB0__GPIO3_8 (_MX51_PAD_NANDF_RB0__GPIO3_8 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) 1004#define MX51_PAD_NANDF_RB0__GPIO3_8 (_MX51_PAD_NANDF_RB0__GPIO3_8 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL))
1005#define MX51_PAD_NANDF_RB0__NANDF_RB0 (_MX51_PAD_NANDF_RB0__NANDF_RB0 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1005#define MX51_PAD_NANDF_RB0__NANDF_RB0 (_MX51_PAD_NANDF_RB0__NANDF_RB0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1006#define MX51_PAD_NANDF_RB0__PATA_DMARQ (_MX51_PAD_NANDF_RB0__PATA_DMARQ | MUX_PAD_CTRL(NO_PAD_CTRL)) 1006#define MX51_PAD_NANDF_RB0__PATA_DMARQ (_MX51_PAD_NANDF_RB0__PATA_DMARQ | MUX_PAD_CTRL(NO_PAD_CTRL))
1007#define MX51_PAD_NANDF_RB0__SD3_DATA3 (_MX51_PAD_NANDF_RB0__SD3_DATA3 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1007#define MX51_PAD_NANDF_RB0__SD3_DATA3 (_MX51_PAD_NANDF_RB0__SD3_DATA3 | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL))
1008#define MX51_PAD_NANDF_RB1__CSPI_MOSI (_MX51_PAD_NANDF_RB1__CSPI_MOSI | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) 1008#define MX51_PAD_NANDF_RB1__CSPI_MOSI (_MX51_PAD_NANDF_RB1__CSPI_MOSI | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL))
1009#define MX51_PAD_NANDF_RB1__ECSPI2_RDY (_MX51_PAD_NANDF_RB1__ECSPI2_RDY | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) 1009#define MX51_PAD_NANDF_RB1__ECSPI2_RDY (_MX51_PAD_NANDF_RB1__ECSPI2_RDY | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL))
1010#define MX51_PAD_NANDF_RB1__GPIO3_9 (_MX51_PAD_NANDF_RB1__GPIO3_9 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) 1010#define MX51_PAD_NANDF_RB1__GPIO3_9 (_MX51_PAD_NANDF_RB1__GPIO3_9 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL))
1011#define MX51_PAD_NANDF_RB1__NANDF_RB1 (_MX51_PAD_NANDF_RB1__NANDF_RB1 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1011#define MX51_PAD_NANDF_RB1__NANDF_RB1 (_MX51_PAD_NANDF_RB1__NANDF_RB1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1012#define MX51_PAD_NANDF_RB1__PATA_IORDY (_MX51_PAD_NANDF_RB1__PATA_IORDY | MUX_PAD_CTRL(NO_PAD_CTRL)) 1012#define MX51_PAD_NANDF_RB1__PATA_IORDY (_MX51_PAD_NANDF_RB1__PATA_IORDY | MUX_PAD_CTRL(NO_PAD_CTRL))
1013#define MX51_PAD_NANDF_RB1__SD4_CMD (_MX51_PAD_NANDF_RB1__SD4_CMD | MUX_PAD_CTRL(NO_PAD_CTRL)) 1013#define MX51_PAD_NANDF_RB1__SD4_CMD (_MX51_PAD_NANDF_RB1__SD4_CMD | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL))
1014#define MX51_PAD_NANDF_RB2__DISP2_WAIT (_MX51_PAD_NANDF_RB2__DISP2_WAIT | MUX_PAD_CTRL(NO_PAD_CTRL)) 1014#define MX51_PAD_NANDF_RB2__DISP2_WAIT (_MX51_PAD_NANDF_RB2__DISP2_WAIT | MUX_PAD_CTRL(NO_PAD_CTRL))
1015#define MX51_PAD_NANDF_RB2__ECSPI2_SCLK (_MX51_PAD_NANDF_RB2__ECSPI2_SCLK | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) 1015#define MX51_PAD_NANDF_RB2__ECSPI2_SCLK (_MX51_PAD_NANDF_RB2__ECSPI2_SCLK | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL))
1016#define MX51_PAD_NANDF_RB2__FEC_COL (_MX51_PAD_NANDF_RB2__FEC_COL | MUX_PAD_CTRL(MX51_PAD_CTRL_2)) 1016#define MX51_PAD_NANDF_RB2__FEC_COL (_MX51_PAD_NANDF_RB2__FEC_COL | MUX_PAD_CTRL(MX51_PAD_CTRL_2))
@@ -1036,41 +1036,41 @@
1036#define MX51_PAD_NANDF_CS2__GPIO3_18 (_MX51_PAD_NANDF_CS2__GPIO3_18 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) 1036#define MX51_PAD_NANDF_CS2__GPIO3_18 (_MX51_PAD_NANDF_CS2__GPIO3_18 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL))
1037#define MX51_PAD_NANDF_CS2__NANDF_CS2 (_MX51_PAD_NANDF_CS2__NANDF_CS2 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1037#define MX51_PAD_NANDF_CS2__NANDF_CS2 (_MX51_PAD_NANDF_CS2__NANDF_CS2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1038#define MX51_PAD_NANDF_CS2__PATA_CS_0 (_MX51_PAD_NANDF_CS2__PATA_CS_0 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1038#define MX51_PAD_NANDF_CS2__PATA_CS_0 (_MX51_PAD_NANDF_CS2__PATA_CS_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1039#define MX51_PAD_NANDF_CS2__SD4_CLK (_MX51_PAD_NANDF_CS2__SD4_CLK | MUX_PAD_CTRL(NO_PAD_CTRL)) 1039#define MX51_PAD_NANDF_CS2__SD4_CLK (_MX51_PAD_NANDF_CS2__SD4_CLK | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL | PAD_CTL_HYS))
1040#define MX51_PAD_NANDF_CS2__USBH3_H1_DP (_MX51_PAD_NANDF_CS2__USBH3_H1_DP | MUX_PAD_CTRL(NO_PAD_CTRL)) 1040#define MX51_PAD_NANDF_CS2__USBH3_H1_DP (_MX51_PAD_NANDF_CS2__USBH3_H1_DP | MUX_PAD_CTRL(NO_PAD_CTRL))
1041#define MX51_PAD_NANDF_CS3__FEC_MDC (_MX51_PAD_NANDF_CS3__FEC_MDC | MUX_PAD_CTRL(MX51_PAD_CTRL_5)) 1041#define MX51_PAD_NANDF_CS3__FEC_MDC (_MX51_PAD_NANDF_CS3__FEC_MDC | MUX_PAD_CTRL(MX51_PAD_CTRL_5))
1042#define MX51_PAD_NANDF_CS3__GPIO3_19 (_MX51_PAD_NANDF_CS3__GPIO3_19 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) 1042#define MX51_PAD_NANDF_CS3__GPIO3_19 (_MX51_PAD_NANDF_CS3__GPIO3_19 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL))
1043#define MX51_PAD_NANDF_CS3__NANDF_CS3 (_MX51_PAD_NANDF_CS3__NANDF_CS3 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1043#define MX51_PAD_NANDF_CS3__NANDF_CS3 (_MX51_PAD_NANDF_CS3__NANDF_CS3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1044#define MX51_PAD_NANDF_CS3__PATA_CS_1 (_MX51_PAD_NANDF_CS3__PATA_CS_1 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1044#define MX51_PAD_NANDF_CS3__PATA_CS_1 (_MX51_PAD_NANDF_CS3__PATA_CS_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1045#define MX51_PAD_NANDF_CS3__SD4_DAT0 (_MX51_PAD_NANDF_CS3__SD4_DAT0 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1045#define MX51_PAD_NANDF_CS3__SD4_DAT0 (_MX51_PAD_NANDF_CS3__SD4_DAT0 | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL))
1046#define MX51_PAD_NANDF_CS3__USBH3_H1_DM (_MX51_PAD_NANDF_CS3__USBH3_H1_DM | MUX_PAD_CTRL(NO_PAD_CTRL)) 1046#define MX51_PAD_NANDF_CS3__USBH3_H1_DM (_MX51_PAD_NANDF_CS3__USBH3_H1_DM | MUX_PAD_CTRL(NO_PAD_CTRL))
1047#define MX51_PAD_NANDF_CS4__FEC_TDATA1 (_MX51_PAD_NANDF_CS4__FEC_TDATA1 | MUX_PAD_CTRL(MX51_PAD_CTRL_5)) 1047#define MX51_PAD_NANDF_CS4__FEC_TDATA1 (_MX51_PAD_NANDF_CS4__FEC_TDATA1 | MUX_PAD_CTRL(MX51_PAD_CTRL_5))
1048#define MX51_PAD_NANDF_CS4__GPIO3_20 (_MX51_PAD_NANDF_CS4__GPIO3_20 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) 1048#define MX51_PAD_NANDF_CS4__GPIO3_20 (_MX51_PAD_NANDF_CS4__GPIO3_20 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL))
1049#define MX51_PAD_NANDF_CS4__NANDF_CS4 (_MX51_PAD_NANDF_CS4__NANDF_CS4 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1049#define MX51_PAD_NANDF_CS4__NANDF_CS4 (_MX51_PAD_NANDF_CS4__NANDF_CS4 | MUX_PAD_CTRL(NO_PAD_CTRL))
1050#define MX51_PAD_NANDF_CS4__PATA_DA_0 (_MX51_PAD_NANDF_CS4__PATA_DA_0 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1050#define MX51_PAD_NANDF_CS4__PATA_DA_0 (_MX51_PAD_NANDF_CS4__PATA_DA_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1051#define MX51_PAD_NANDF_CS4__SD4_DAT1 (_MX51_PAD_NANDF_CS4__SD4_DAT1 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1051#define MX51_PAD_NANDF_CS4__SD4_DAT1 (_MX51_PAD_NANDF_CS4__SD4_DAT1 | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL))
1052#define MX51_PAD_NANDF_CS4__USBH3_STP (_MX51_PAD_NANDF_CS4__USBH3_STP | MUX_PAD_CTRL(NO_PAD_CTRL)) 1052#define MX51_PAD_NANDF_CS4__USBH3_STP (_MX51_PAD_NANDF_CS4__USBH3_STP | MUX_PAD_CTRL(NO_PAD_CTRL))
1053#define MX51_PAD_NANDF_CS5__FEC_TDATA2 (_MX51_PAD_NANDF_CS5__FEC_TDATA2 | MUX_PAD_CTRL(MX51_PAD_CTRL_5)) 1053#define MX51_PAD_NANDF_CS5__FEC_TDATA2 (_MX51_PAD_NANDF_CS5__FEC_TDATA2 | MUX_PAD_CTRL(MX51_PAD_CTRL_5))
1054#define MX51_PAD_NANDF_CS5__GPIO3_21 (_MX51_PAD_NANDF_CS5__GPIO3_21 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) 1054#define MX51_PAD_NANDF_CS5__GPIO3_21 (_MX51_PAD_NANDF_CS5__GPIO3_21 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL))
1055#define MX51_PAD_NANDF_CS5__NANDF_CS5 (_MX51_PAD_NANDF_CS5__NANDF_CS5 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1055#define MX51_PAD_NANDF_CS5__NANDF_CS5 (_MX51_PAD_NANDF_CS5__NANDF_CS5 | MUX_PAD_CTRL(NO_PAD_CTRL))
1056#define MX51_PAD_NANDF_CS5__PATA_DA_1 (_MX51_PAD_NANDF_CS5__PATA_DA_1 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1056#define MX51_PAD_NANDF_CS5__PATA_DA_1 (_MX51_PAD_NANDF_CS5__PATA_DA_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1057#define MX51_PAD_NANDF_CS5__SD4_DAT2 (_MX51_PAD_NANDF_CS5__SD4_DAT2 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1057#define MX51_PAD_NANDF_CS5__SD4_DAT2 (_MX51_PAD_NANDF_CS5__SD4_DAT2 | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL))
1058#define MX51_PAD_NANDF_CS5__USBH3_DIR (_MX51_PAD_NANDF_CS5__USBH3_DIR | MUX_PAD_CTRL(NO_PAD_CTRL)) 1058#define MX51_PAD_NANDF_CS5__USBH3_DIR (_MX51_PAD_NANDF_CS5__USBH3_DIR | MUX_PAD_CTRL(NO_PAD_CTRL))
1059#define MX51_PAD_NANDF_CS6__CSPI_SS3 (_MX51_PAD_NANDF_CS6__CSPI_SS3 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) 1059#define MX51_PAD_NANDF_CS6__CSPI_SS3 (_MX51_PAD_NANDF_CS6__CSPI_SS3 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL))
1060#define MX51_PAD_NANDF_CS6__FEC_TDATA3 (_MX51_PAD_NANDF_CS6__FEC_TDATA3 | MUX_PAD_CTRL(MX51_PAD_CTRL_5)) 1060#define MX51_PAD_NANDF_CS6__FEC_TDATA3 (_MX51_PAD_NANDF_CS6__FEC_TDATA3 | MUX_PAD_CTRL(MX51_PAD_CTRL_5))
1061#define MX51_PAD_NANDF_CS6__GPIO3_22 (_MX51_PAD_NANDF_CS6__GPIO3_22 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) 1061#define MX51_PAD_NANDF_CS6__GPIO3_22 (_MX51_PAD_NANDF_CS6__GPIO3_22 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL))
1062#define MX51_PAD_NANDF_CS6__NANDF_CS6 (_MX51_PAD_NANDF_CS6__NANDF_CS6 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1062#define MX51_PAD_NANDF_CS6__NANDF_CS6 (_MX51_PAD_NANDF_CS6__NANDF_CS6 | MUX_PAD_CTRL(NO_PAD_CTRL))
1063#define MX51_PAD_NANDF_CS6__PATA_DA_2 (_MX51_PAD_NANDF_CS6__PATA_DA_2 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1063#define MX51_PAD_NANDF_CS6__PATA_DA_2 (_MX51_PAD_NANDF_CS6__PATA_DA_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1064#define MX51_PAD_NANDF_CS6__SD4_DAT3 (_MX51_PAD_NANDF_CS6__SD4_DAT3 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1064#define MX51_PAD_NANDF_CS6__SD4_DAT3 (_MX51_PAD_NANDF_CS6__SD4_DAT3 | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL))
1065#define MX51_PAD_NANDF_CS7__FEC_TX_EN (_MX51_PAD_NANDF_CS7__FEC_TX_EN | MUX_PAD_CTRL(MX51_PAD_CTRL_5)) 1065#define MX51_PAD_NANDF_CS7__FEC_TX_EN (_MX51_PAD_NANDF_CS7__FEC_TX_EN | MUX_PAD_CTRL(MX51_PAD_CTRL_5))
1066#define MX51_PAD_NANDF_CS7__GPIO3_23 (_MX51_PAD_NANDF_CS7__GPIO3_23 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) 1066#define MX51_PAD_NANDF_CS7__GPIO3_23 (_MX51_PAD_NANDF_CS7__GPIO3_23 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL))
1067#define MX51_PAD_NANDF_CS7__NANDF_CS7 (_MX51_PAD_NANDF_CS7__NANDF_CS7 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1067#define MX51_PAD_NANDF_CS7__NANDF_CS7 (_MX51_PAD_NANDF_CS7__NANDF_CS7 | MUX_PAD_CTRL(NO_PAD_CTRL))
1068#define MX51_PAD_NANDF_CS7__SD3_CLK (_MX51_PAD_NANDF_CS7__SD3_CLK | MUX_PAD_CTRL(NO_PAD_CTRL)) 1068#define MX51_PAD_NANDF_CS7__SD3_CLK (_MX51_PAD_NANDF_CS7__SD3_CLK | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL | PAD_CTL_HYS))
1069#define MX51_PAD_NANDF_RDY_INT__ECSPI2_SS0 (_MX51_PAD_NANDF_RDY_INT__ECSPI2_SS0 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) 1069#define MX51_PAD_NANDF_RDY_INT__ECSPI2_SS0 (_MX51_PAD_NANDF_RDY_INT__ECSPI2_SS0 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL))
1070#define MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK (_MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK | MUX_PAD_CTRL(MX51_PAD_CTRL_4)) 1070#define MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK (_MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK | MUX_PAD_CTRL(MX51_PAD_CTRL_4))
1071#define MX51_PAD_NANDF_RDY_INT__GPIO3_24 (_MX51_PAD_NANDF_RDY_INT__GPIO3_24 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) 1071#define MX51_PAD_NANDF_RDY_INT__GPIO3_24 (_MX51_PAD_NANDF_RDY_INT__GPIO3_24 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL))
1072#define MX51_PAD_NANDF_RDY_INT__NANDF_RDY_INT (_MX51_PAD_NANDF_RDY_INT__NANDF_RDY_INT | MUX_PAD_CTRL(NO_PAD_CTRL)) 1072#define MX51_PAD_NANDF_RDY_INT__NANDF_RDY_INT (_MX51_PAD_NANDF_RDY_INT__NANDF_RDY_INT | MUX_PAD_CTRL(NO_PAD_CTRL))
1073#define MX51_PAD_NANDF_RDY_INT__SD3_CMD (_MX51_PAD_NANDF_RDY_INT__SD3_CMD | MUX_PAD_CTRL(NO_PAD_CTRL)) 1073#define MX51_PAD_NANDF_RDY_INT__SD3_CMD (_MX51_PAD_NANDF_RDY_INT__SD3_CMD | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL))
1074#define MX51_PAD_NANDF_D15__ECSPI2_MOSI (_MX51_PAD_NANDF_D15__ECSPI2_MOSI | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) 1074#define MX51_PAD_NANDF_D15__ECSPI2_MOSI (_MX51_PAD_NANDF_D15__ECSPI2_MOSI | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL))
1075#define MX51_PAD_NANDF_D15__GPIO3_25 (_MX51_PAD_NANDF_D15__GPIO3_25 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL)) 1075#define MX51_PAD_NANDF_D15__GPIO3_25 (_MX51_PAD_NANDF_D15__GPIO3_25 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL))
1076#define MX51_PAD_NANDF_D15__NANDF_D15 (_MX51_PAD_NANDF_D15__NANDF_D15 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1076#define MX51_PAD_NANDF_D15__NANDF_D15 (_MX51_PAD_NANDF_D15__NANDF_D15 | MUX_PAD_CTRL(NO_PAD_CTRL))
@@ -1479,26 +1479,26 @@
1479#define MX51_PAD_SD1_CLK__SD1_CLK (_MX51_PAD_SD1_CLK__SD1_CLK | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL | PAD_CTL_HYS)) 1479#define MX51_PAD_SD1_CLK__SD1_CLK (_MX51_PAD_SD1_CLK__SD1_CLK | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL | PAD_CTL_HYS))
1480#define MX51_PAD_SD1_DATA0__AUD5_TXD (_MX51_PAD_SD1_DATA0__AUD5_TXD | MUX_PAD_CTRL(NO_PAD_CTRL)) 1480#define MX51_PAD_SD1_DATA0__AUD5_TXD (_MX51_PAD_SD1_DATA0__AUD5_TXD | MUX_PAD_CTRL(NO_PAD_CTRL))
1481#define MX51_PAD_SD1_DATA0__CSPI_MISO (_MX51_PAD_SD1_DATA0__CSPI_MISO | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) 1481#define MX51_PAD_SD1_DATA0__CSPI_MISO (_MX51_PAD_SD1_DATA0__CSPI_MISO | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL))
1482#define MX51_PAD_SD1_DATA0__SD1_DATA0 (_MX51_PAD_SD1_DATA0__SD1_DATA0 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1482#define MX51_PAD_SD1_DATA0__SD1_DATA0 (_MX51_PAD_SD1_DATA0__SD1_DATA0 | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL))
1483#define MX51_PAD_EIM_DA0__EIM_DA0 (_MX51_PAD_EIM_DA0__EIM_DA0 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1483#define MX51_PAD_EIM_DA0__EIM_DA0 (_MX51_PAD_EIM_DA0__EIM_DA0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1484#define MX51_PAD_EIM_DA1__EIM_DA1 (_MX51_PAD_EIM_DA1__EIM_DA1 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1484#define MX51_PAD_EIM_DA1__EIM_DA1 (_MX51_PAD_EIM_DA1__EIM_DA1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1485#define MX51_PAD_EIM_DA2__EIM_DA2 (_MX51_PAD_EIM_DA2__EIM_DA2 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1485#define MX51_PAD_EIM_DA2__EIM_DA2 (_MX51_PAD_EIM_DA2__EIM_DA2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1486#define MX51_PAD_EIM_DA3__EIM_DA3 (_MX51_PAD_EIM_DA3__EIM_DA3 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1486#define MX51_PAD_EIM_DA3__EIM_DA3 (_MX51_PAD_EIM_DA3__EIM_DA3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1487#define MX51_PAD_SD1_DATA1__AUD5_RXD (_MX51_PAD_SD1_DATA1__AUD5_RXD | MUX_PAD_CTRL(NO_PAD_CTRL)) 1487#define MX51_PAD_SD1_DATA1__AUD5_RXD (_MX51_PAD_SD1_DATA1__AUD5_RXD | MUX_PAD_CTRL(NO_PAD_CTRL))
1488#define MX51_PAD_SD1_DATA1__SD1_DATA1 (_MX51_PAD_SD1_DATA1__SD1_DATA1 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1488#define MX51_PAD_SD1_DATA1__SD1_DATA1 (_MX51_PAD_SD1_DATA1__SD1_DATA1 | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL))
1489#define MX51_PAD_EIM_DA4__EIM_DA4 (_MX51_PAD_EIM_DA4__EIM_DA4 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1489#define MX51_PAD_EIM_DA4__EIM_DA4 (_MX51_PAD_EIM_DA4__EIM_DA4 | MUX_PAD_CTRL(NO_PAD_CTRL))
1490#define MX51_PAD_EIM_DA5__EIM_DA5 (_MX51_PAD_EIM_DA5__EIM_DA5 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1490#define MX51_PAD_EIM_DA5__EIM_DA5 (_MX51_PAD_EIM_DA5__EIM_DA5 | MUX_PAD_CTRL(NO_PAD_CTRL))
1491#define MX51_PAD_EIM_DA6__EIM_DA6 (_MX51_PAD_EIM_DA6__EIM_DA6 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1491#define MX51_PAD_EIM_DA6__EIM_DA6 (_MX51_PAD_EIM_DA6__EIM_DA6 | MUX_PAD_CTRL(NO_PAD_CTRL))
1492#define MX51_PAD_EIM_DA7__EIM_DA7 (_MX51_PAD_EIM_DA7__EIM_DA7 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1492#define MX51_PAD_EIM_DA7__EIM_DA7 (_MX51_PAD_EIM_DA7__EIM_DA7 | MUX_PAD_CTRL(NO_PAD_CTRL))
1493#define MX51_PAD_SD1_DATA2__AUD5_TXC (_MX51_PAD_SD1_DATA2__AUD5_TXC | MUX_PAD_CTRL(NO_PAD_CTRL)) 1493#define MX51_PAD_SD1_DATA2__AUD5_TXC (_MX51_PAD_SD1_DATA2__AUD5_TXC | MUX_PAD_CTRL(NO_PAD_CTRL))
1494#define MX51_PAD_SD1_DATA2__SD1_DATA2 (_MX51_PAD_SD1_DATA2__SD1_DATA2 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1494#define MX51_PAD_SD1_DATA2__SD1_DATA2 (_MX51_PAD_SD1_DATA2__SD1_DATA2 | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL))
1495#define MX51_PAD_EIM_DA10__EIM_DA10 (_MX51_PAD_EIM_DA10__EIM_DA10 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1495#define MX51_PAD_EIM_DA10__EIM_DA10 (_MX51_PAD_EIM_DA10__EIM_DA10 | MUX_PAD_CTRL(NO_PAD_CTRL))
1496#define MX51_PAD_EIM_DA11__EIM_DA11 (_MX51_PAD_EIM_DA11__EIM_DA11 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1496#define MX51_PAD_EIM_DA11__EIM_DA11 (_MX51_PAD_EIM_DA11__EIM_DA11 | MUX_PAD_CTRL(NO_PAD_CTRL))
1497#define MX51_PAD_EIM_DA8__EIM_DA8 (_MX51_PAD_EIM_DA8__EIM_DA8 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1497#define MX51_PAD_EIM_DA8__EIM_DA8 (_MX51_PAD_EIM_DA8__EIM_DA8 | MUX_PAD_CTRL(NO_PAD_CTRL))
1498#define MX51_PAD_EIM_DA9__EIM_DA9 (_MX51_PAD_EIM_DA9__EIM_DA9 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1498#define MX51_PAD_EIM_DA9__EIM_DA9 (_MX51_PAD_EIM_DA9__EIM_DA9 | MUX_PAD_CTRL(NO_PAD_CTRL))
1499#define MX51_PAD_SD1_DATA3__AUD5_TXFS (_MX51_PAD_SD1_DATA3__AUD5_TXFS | MUX_PAD_CTRL(NO_PAD_CTRL)) 1499#define MX51_PAD_SD1_DATA3__AUD5_TXFS (_MX51_PAD_SD1_DATA3__AUD5_TXFS | MUX_PAD_CTRL(NO_PAD_CTRL))
1500#define MX51_PAD_SD1_DATA3__CSPI_SS1 (_MX51_PAD_SD1_DATA3__CSPI_SS1 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) 1500#define MX51_PAD_SD1_DATA3__CSPI_SS1 (_MX51_PAD_SD1_DATA3__CSPI_SS1 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL))
1501#define MX51_PAD_SD1_DATA3__SD1_DATA3 (_MX51_PAD_SD1_DATA3__SD1_DATA3 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1501#define MX51_PAD_SD1_DATA3__SD1_DATA3 (_MX51_PAD_SD1_DATA3__SD1_DATA3 | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL))
1502#define MX51_PAD_GPIO1_0__CSPI_SS2 (_MX51_PAD_GPIO1_0__CSPI_SS2 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) 1502#define MX51_PAD_GPIO1_0__CSPI_SS2 (_MX51_PAD_GPIO1_0__CSPI_SS2 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL))
1503#define MX51_PAD_GPIO1_0__GPIO1_0 (_MX51_PAD_GPIO1_0__GPIO1_0 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1503#define MX51_PAD_GPIO1_0__GPIO1_0 (_MX51_PAD_GPIO1_0__GPIO1_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1504#define MX51_PAD_GPIO1_0__SD1_CD (_MX51_PAD_GPIO1_0__SD1_CD | MUX_PAD_CTRL(MX51_ESDHC_PAD_CTRL)) 1504#define MX51_PAD_GPIO1_0__SD1_CD (_MX51_PAD_GPIO1_0__SD1_CD | MUX_PAD_CTRL(MX51_ESDHC_PAD_CTRL))
@@ -1517,16 +1517,16 @@
1517#define MX51_PAD_SD2_CLK__SD2_CLK (_MX51_PAD_SD2_CLK__SD2_CLK | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL | PAD_CTL_HYS)) 1517#define MX51_PAD_SD2_CLK__SD2_CLK (_MX51_PAD_SD2_CLK__SD2_CLK | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL | PAD_CTL_HYS))
1518#define MX51_PAD_SD2_DATA0__CSPI_MISO (_MX51_PAD_SD2_DATA0__CSPI_MISO | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) 1518#define MX51_PAD_SD2_DATA0__CSPI_MISO (_MX51_PAD_SD2_DATA0__CSPI_MISO | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL))
1519#define MX51_PAD_SD2_DATA0__SD1_DAT4 (_MX51_PAD_SD2_DATA0__SD1_DAT4 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1519#define MX51_PAD_SD2_DATA0__SD1_DAT4 (_MX51_PAD_SD2_DATA0__SD1_DAT4 | MUX_PAD_CTRL(NO_PAD_CTRL))
1520#define MX51_PAD_SD2_DATA0__SD2_DATA0 (_MX51_PAD_SD2_DATA0__SD2_DATA0 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1520#define MX51_PAD_SD2_DATA0__SD2_DATA0 (_MX51_PAD_SD2_DATA0__SD2_DATA0 | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL))
1521#define MX51_PAD_SD2_DATA1__SD1_DAT5 (_MX51_PAD_SD2_DATA1__SD1_DAT5 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1521#define MX51_PAD_SD2_DATA1__SD1_DAT5 (_MX51_PAD_SD2_DATA1__SD1_DAT5 | MUX_PAD_CTRL(NO_PAD_CTRL))
1522#define MX51_PAD_SD2_DATA1__SD2_DATA1 (_MX51_PAD_SD2_DATA1__SD2_DATA1 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1522#define MX51_PAD_SD2_DATA1__SD2_DATA1 (_MX51_PAD_SD2_DATA1__SD2_DATA1 | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL))
1523#define MX51_PAD_SD2_DATA1__USBH3_H2_DP (_MX51_PAD_SD2_DATA1__USBH3_H2_DP | MUX_PAD_CTRL(NO_PAD_CTRL)) 1523#define MX51_PAD_SD2_DATA1__USBH3_H2_DP (_MX51_PAD_SD2_DATA1__USBH3_H2_DP | MUX_PAD_CTRL(NO_PAD_CTRL))
1524#define MX51_PAD_SD2_DATA2__SD1_DAT6 (_MX51_PAD_SD2_DATA2__SD1_DAT6 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1524#define MX51_PAD_SD2_DATA2__SD1_DAT6 (_MX51_PAD_SD2_DATA2__SD1_DAT6 | MUX_PAD_CTRL(NO_PAD_CTRL))
1525#define MX51_PAD_SD2_DATA2__SD2_DATA2 (_MX51_PAD_SD2_DATA2__SD2_DATA2 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1525#define MX51_PAD_SD2_DATA2__SD2_DATA2 (_MX51_PAD_SD2_DATA2__SD2_DATA2 | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL))
1526#define MX51_PAD_SD2_DATA2__USBH3_H2_DM (_MX51_PAD_SD2_DATA2__USBH3_H2_DM | MUX_PAD_CTRL(NO_PAD_CTRL)) 1526#define MX51_PAD_SD2_DATA2__USBH3_H2_DM (_MX51_PAD_SD2_DATA2__USBH3_H2_DM | MUX_PAD_CTRL(NO_PAD_CTRL))
1527#define MX51_PAD_SD2_DATA3__CSPI_SS2 (_MX51_PAD_SD2_DATA3__CSPI_SS2 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL)) 1527#define MX51_PAD_SD2_DATA3__CSPI_SS2 (_MX51_PAD_SD2_DATA3__CSPI_SS2 | MUX_PAD_CTRL(MX51_ECSPI_PAD_CTRL))
1528#define MX51_PAD_SD2_DATA3__SD1_DAT7 (_MX51_PAD_SD2_DATA3__SD1_DAT7 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1528#define MX51_PAD_SD2_DATA3__SD1_DAT7 (_MX51_PAD_SD2_DATA3__SD1_DAT7 | MUX_PAD_CTRL(NO_PAD_CTRL))
1529#define MX51_PAD_SD2_DATA3__SD2_DATA3 (_MX51_PAD_SD2_DATA3__SD2_DATA3 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1529#define MX51_PAD_SD2_DATA3__SD2_DATA3 (_MX51_PAD_SD2_DATA3__SD2_DATA3 | MUX_PAD_CTRL(MX51_SDHCI_PAD_CTRL))
1530#define MX51_PAD_GPIO1_2__CCM_OUT_2 (_MX51_PAD_GPIO1_2__CCM_OUT_2 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1530#define MX51_PAD_GPIO1_2__CCM_OUT_2 (_MX51_PAD_GPIO1_2__CCM_OUT_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1531#define MX51_PAD_GPIO1_2__GPIO1_2 (_MX51_PAD_GPIO1_2__GPIO1_2 | MUX_PAD_CTRL(NO_PAD_CTRL)) 1531#define MX51_PAD_GPIO1_2__GPIO1_2 (_MX51_PAD_GPIO1_2__GPIO1_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1532#define MX51_PAD_GPIO1_2__I2C2_SCL (_MX51_PAD_GPIO1_2__I2C2_SCL | MUX_PAD_CTRL(MX51_I2C_PAD_CTRL)) 1532#define MX51_PAD_GPIO1_2__I2C2_SCL (_MX51_PAD_GPIO1_2__I2C2_SCL | MUX_PAD_CTRL(MX51_I2C_PAD_CTRL))
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx53.h b/arch/arm/plat-mxc/include/mach/iomux-mx53.h
index 68e11d7ab79d..e95d9cb8aeb7 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx53.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx53.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved. 2 * Copyright (C) 2010-2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 * it under the terms of the GNU General Public License as published by
@@ -21,305 +21,2358 @@
21 21
22#include <mach/iomux-v3.h> 22#include <mach/iomux-v3.h>
23 23
24/*
25 * various IOMUX alternate output functions (1-7)
26 */
27typedef enum iomux_config {
28 IOMUX_CONFIG_ALT0,
29 IOMUX_CONFIG_ALT1,
30 IOMUX_CONFIG_ALT2,
31 IOMUX_CONFIG_ALT3,
32 IOMUX_CONFIG_ALT4,
33 IOMUX_CONFIG_ALT5,
34 IOMUX_CONFIG_ALT6,
35 IOMUX_CONFIG_ALT7,
36 IOMUX_CONFIG_GPIO, /* added to help user use GPIO mode */
37} iomux_pin_cfg_t;
38
39/* These 2 defines are for pins that may not have a mux register, but could 24/* These 2 defines are for pins that may not have a mux register, but could
40 * have a pad setting register, and vice-versa. */ 25 * have a pad setting register, and vice-versa. */
41#define NON_MUX_I 0x00
42#define NON_PAD_I 0x00 26#define NON_PAD_I 0x00
43 27
44#define MX53_UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \ 28#define MX53_UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
45 PAD_CTL_DSE_HIGH | PAD_CTL_SRE_FAST | PAD_CTL_HYS) 29 PAD_CTL_DSE_HIGH | PAD_CTL_SRE_FAST | PAD_CTL_HYS)
46/* UART1 */ 30#define MX53_SDHC_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_PUE | \
47#define MX53_PAD_CSI0_D10__UART1_TXD IOMUX_PAD(0x414, 0xE8, 2, 0x0, 0, MX53_UART_PAD_CTRL) 31 PAD_CTL_PUS_47K_UP | PAD_CTL_DSE_HIGH | \
48#define MX53_PAD_CSI0_D11__UART1_RXD IOMUX_PAD(0x418, 0xEC, 2, 0x878, 1, MX53_UART_PAD_CTRL) 32 PAD_CTL_SRE_FAST)
49#define MX53_PAD_ATA_DIOW__UART1_TXD IOMUX_PAD(0x5F0, 0x270, 3, 0x0, 0, MX53_UART_PAD_CTRL)
50#define MX53_PAD_ATA_DMACK__UART1_RXD IOMUX_PAD(0x5F4, 0x274, 3, 0x880, 3, MX53_UART_PAD_CTRL)
51
52/* UART2 */
53#define MX53_PAD_ATA_BUFFER_EN__UART2_RXD IOMUX_PAD(0x5FC, 0x27C, 3, 0x880, 3, MX53_UART_PAD_CTRL)
54#define MX53_PAD_ATA_DMARQ__UART2_TXD IOMUX_PAD(0x5F8, 0x278, 3, 0x0, 0, MX53_UART_PAD_CTRL)
55#define MX53_PAD_ATA_DIOR__UART2_RTS IOMUX_PAD(0x604, 0x284, 3, 0x87C, 3, MX53_UART_PAD_CTRL)
56#define MX53_PAD_ATA_INTRQ__UART2_CTS IOMUX_PAD(0x600, 0x280, 3, 0x0, 0, MX53_UART_PAD_CTRL)
57 33
58/* UART3 */ 34#define _MX53_PAD_GPIO_19__KPP_COL_5 IOMUX_PAD(0x348, 0x20, 0, 0x840, 0, 0)
59#define MX53_PAD_ATA_CS_0__UART3_TXD IOMUX_PAD(0x61C, 0x29C, 4, 0x0, 0, MX53_UART_PAD_CTRL) 35#define _MX53_PAD_GPIO_19__GPIO4_5 IOMUX_PAD(0x348, 0x20, 1, 0x0, 0, 0)
60#define MX53_PAD_ATA_CS_1__UART3_RXD IOMUX_PAD(0x620, 0x2A0, 4, 0x888, 3, MX53_UART_PAD_CTRL) 36#define _MX53_PAD_GPIO_19__CCM_CLKO IOMUX_PAD(0x348, 0x20, 2, 0x0, 0, 0)
61#define MX53_PAD_ATA_DA_1__UART3_CTS IOMUX_PAD(0x614, 0x294, 4, 0x0, 0, MX53_UART_PAD_CTRL) 37#define _MX53_PAD_GPIO_19__SPDIF_OUT1 IOMUX_PAD(0x348, 0x20, 3, 0x0, 0, 0)
62#define MX53_PAD_ATA_DA_2__UART3_RTS IOMUX_PAD(0x618, 0x298, 4, 0x884, 5, MX53_UART_PAD_CTRL) 38#define _MX53_PAD_GPIO_19__RTC_CE_RTC_EXT_TRIG2 IOMUX_PAD(0x348, 0x20, 4, 0x0, 0, 0)
39#define _MX53_PAD_GPIO_19__ECSPI1_RDY IOMUX_PAD(0x348, 0x20, 5, 0x0, 0, 0)
40#define _MX53_PAD_GPIO_19__FEC_TDATA_3 IOMUX_PAD(0x348, 0x20, 6, 0x0, 0, 0)
41#define _MX53_PAD_GPIO_19__SRC_INT_BOOT IOMUX_PAD(0x348, 0x20,7, 0x0, 0, 0)
42#define _MX53_PAD_KEY_COL0__KPP_COL_0 IOMUX_PAD(0x34C, 0x24, o, 0x0, 0, 0)
43#define _MX53_PAD_KEY_COL0__GPIO4_6 IOMUX_PAD(0x34C, 0x24, 1, 0x0, 0, 0)
44#define _MX53_PAD_KEY_COL0__AUDMUX_AUD5_TXC IOMUX_PAD(0x34C, 0x24, 2, 0x758, 0, 0)
45#define _MX53_PAD_KEY_COL0__UART4_TXD_MUX IOMUX_PAD(0x34C, 0x24, 4, 0x890, 0, 0)
46#define _MX53_PAD_KEY_COL0__ECSPI1_SCLK IOMUX_PAD(0x34C, 0x24, 5, 0x79C, 0, 0)
47#define _MX53_PAD_KEY_COL0__FEC_RDATA_3 IOMUX_PAD(0x34C, 0x24, 6, 0x0, 0, 0)
48#define _MX53_PAD_KEY_COL0__SRC_ANY_PU_RST IOMUX_PAD(0x34C, 0x24, 7, 0x0, 0, 0)
49#define _MX53_PAD_KEY_ROW0__KPP_ROW_0 IOMUX_PAD(0x350, 0x28, 0, 0x0, 0, 0)
50#define _MX53_PAD_KEY_ROW0__GPIO4_7 IOMUX_PAD(0x350, 0x28, 1, 0x0, 0, 0)
51#define _MX53_PAD_KEY_ROW0__AUDMUX_AUD5_TXD IOMUX_PAD(0x350, 0x28, 2, 0x74C, 0, 0)
52#define _MX53_PAD_KEY_ROW0__UART4_RXD_MUX IOMUX_PAD(0x350, 0x28, 4, 0x890, 1, 0)
53#define _MX53_PAD_KEY_ROW0__ECSPI1_MOSI IOMUX_PAD(0x350, 0x28, 5, 0x7A4, 0, 0)
54#define _MX53_PAD_KEY_ROW0__FEC_TX_ER IOMUX_PAD(0x350, 0x28, 6, 0x0, 0, 0)
55#define _MX53_PAD_KEY_COL1__KPP_COL_1 IOMUX_PAD(0x354, 0x2C, 0, 0x0, 0, 0)
56#define _MX53_PAD_KEY_COL1__GPIO4_8 IOMUX_PAD(0x354, 0x2C, 1, 0x0, 0, 0)
57#define _MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS IOMUX_PAD(0x354, 0x2C, 2, 0x75C, 0, 0)
58#define _MX53_PAD_KEY_COL1__UART5_TXD_MUX IOMUX_PAD(0x354, 0x2C, 4, 0x898, 0, 0)
59#define _MX53_PAD_KEY_COL1__ECSPI1_MISO IOMUX_PAD(0x354, 0x2C, 5, 0x7A0, 0, 0)
60#define _MX53_PAD_KEY_COL1__FEC_RX_CLK IOMUX_PAD(0x354, 0x2C, 6, 0x808, 0, 0)
61#define _MX53_PAD_KEY_COL1__USBPHY1_TXREADY IOMUX_PAD(0x354, 0x2C, 7, 0x0, 0, 0)
62#define _MX53_PAD_KEY_ROW1__KPP_ROW_1 IOMUX_PAD(0x358, 0x30, 0, 0x0, 0, 0)
63#define _MX53_PAD_KEY_ROW1__GPIO4_9 IOMUX_PAD(0x358, 0x30, 1, 0x0, 0, 0)
64#define _MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD IOMUX_PAD(0x358, 0x30, 2, 0x748, 0, 0)
65#define _MX53_PAD_KEY_ROW1__UART5_RXD_MUX IOMUX_PAD(0x358, 0x30, 4, 0x898, 1, 0)
66#define _MX53_PAD_KEY_ROW1__ECSPI1_SS0 IOMUX_PAD(0x358, 0x30, 5, 0x7A8, 0, 0)
67#define _MX53_PAD_KEY_ROW1__FEC_COL IOMUX_PAD(0x358, 0x30, 6, 0x800, 0, 0)
68#define _MX53_PAD_KEY_ROW1__USBPHY1_RXVALID IOMUX_PAD(0x358, 0x30, 7, 0x0, 0, 0)
69#define _MX53_PAD_KEY_COL2__KPP_COL_2 IOMUX_PAD(0x35C, 0x34, 0, 0x0, 0, 0)
70#define _MX53_PAD_KEY_COL2__GPIO4_10 IOMUX_PAD(0x35C, 0x34, 1, 0x0, 0, 0)
71#define _MX53_PAD_KEY_COL2__CAN1_TXCAN IOMUX_PAD(0x35C, 0x34, 2, 0x0, 0, 0)
72#define _MX53_PAD_KEY_COL2__FEC_MDIO IOMUX_PAD(0x35C, 0x34, 4, 0x804, 0, 0)
73#define _MX53_PAD_KEY_COL2__ECSPI1_SS1 IOMUX_PAD(0x35C, 0x34, 5, 0x7AC, 0, 0)
74#define _MX53_PAD_KEY_COL2__FEC_RDATA_2 IOMUX_PAD(0x35C, 0x34, 6, 0x0, 0, 0)
75#define _MX53_PAD_KEY_COL2__USBPHY1_RXACTIVE IOMUX_PAD(0x35C, 0x34, 7, 0x0, 0, 0)
76#define _MX53_PAD_KEY_ROW2__KPP_ROW_2 IOMUX_PAD(0x360, 0x38, 0, 0x0, 0, 0)
77#define _MX53_PAD_KEY_ROW2__GPIO4_11 IOMUX_PAD(0x360, 0x38, 1, 0x0, 0, 0)
78#define _MX53_PAD_KEY_ROW2__CAN1_RXCAN IOMUX_PAD(0x360, 0x38, 2, 0x760, 0, 0)
79#define _MX53_PAD_KEY_ROW2__FEC_MDC IOMUX_PAD(0x360, 0x38, 4, 0x0, 0, 0)
80#define _MX53_PAD_KEY_ROW2__ECSPI1_SS2 IOMUX_PAD(0x360, 0x38, 5, 0x7B0, 0, 0)
81#define _MX53_PAD_KEY_ROW2__FEC_TDATA_2 IOMUX_PAD(0x360, 0x38, 6, 0x0, 0, 0)
82#define _MX53_PAD_KEY_ROW2__USBPHY1_RXERROR IOMUX_PAD(0x360, 0x38, 7, 0x0, 0, 0)
83#define _MX53_PAD_KEY_COL3__KPP_COL_3 IOMUX_PAD(0x364, 0x3C, 0, 0x0, 0, 0)
84#define _MX53_PAD_KEY_COL3__GPIO4_12 IOMUX_PAD(0x364, 0x3C, 1, 0x0, 0, 0)
85#define _MX53_PAD_KEY_COL3__USBOH3_H2_DP IOMUX_PAD(0x364, 0x3C, 2, 0x0, 0, 0)
86#define _MX53_PAD_KEY_COL3__SPDIF_IN1 IOMUX_PAD(0x364, 0x3C, 3, 0x870, 0, 0)
87#define _MX53_PAD_KEY_COL3__I2C2_SCL IOMUX_PAD(0x364, 0x3C, 4 | IOMUX_CONFIG_SION, 0x81C, 0, 0)
88#define _MX53_PAD_KEY_COL3__ECSPI1_SS3 IOMUX_PAD(0x364, 0x3C, 5, 0x7B4, 0, 0)
89#define _MX53_PAD_KEY_COL3__FEC_CRS IOMUX_PAD(0x364, 0x3C, 6, 0x0, 0, 0)
90#define _MX53_PAD_KEY_COL3__USBPHY1_SIECLOCK IOMUX_PAD(0x364, 0x3C, 7, 0x0, 0, 0)
91#define _MX53_PAD_KEY_ROW3__KPP_ROW_3 IOMUX_PAD(0x368, 0x40, 0, 0x0, 0, 0)
92#define _MX53_PAD_KEY_ROW3__GPIO4_13 IOMUX_PAD(0x368, 0x40, 1, 0x0, 0, 0)
93#define _MX53_PAD_KEY_ROW3__USBOH3_H2_DM IOMUX_PAD(0x368, 0x40, 2, 0x0, 0, 0)
94#define _MX53_PAD_KEY_ROW3__CCM_ASRC_EXT_CLK IOMUX_PAD(0x368, 0x40, 3, 0x768, 0, 0)
95#define _MX53_PAD_KEY_ROW3__I2C2_SDA IOMUX_PAD(0x368, 0x40, 4 | IOMUX_CONFIG_SION, 0x820, 0, 0)
96#define _MX53_PAD_KEY_ROW3__OSC32K_32K_OUT IOMUX_PAD(0x368, 0x40, 5, 0x0, 0, 0)
97#define _MX53_PAD_KEY_ROW3__CCM_PLL4_BYP IOMUX_PAD(0x368, 0x40, 6, 0x77C, 0, 0)
98#define _MX53_PAD_KEY_ROW3__USBPHY1_LINESTATE_0 IOMUX_PAD(0x368, 0x40, 7, 0x0, 0, 0)
99#define _MX53_PAD_KEY_COL4__KPP_COL_4 IOMUX_PAD(0x36C, 0x44, 0, 0x0, 0, 0)
100#define _MX53_PAD_KEY_COL4__GPIO4_14 IOMUX_PAD(0x36C, 0x44, 1, 0x0, 0, 0)
101#define _MX53_PAD_KEY_COL4__CAN2_TXCAN IOMUX_PAD(0x36C, 0x44, 2, 0x0, 0, 0)
102#define _MX53_PAD_KEY_COL4__IPU_SISG_4 IOMUX_PAD(0x36C, 0x44, 3, 0x0, 0, 0)
103#define _MX53_PAD_KEY_COL4__UART5_RTS IOMUX_PAD(0x36C, 0x44, 4, 0x894, 0, 0)
104#define _MX53_PAD_KEY_COL4__USBOH3_USBOTG_OC IOMUX_PAD(0x36C, 0x44, 5, 0x89C, 0, 0)
105#define _MX53_PAD_KEY_COL4__USBPHY1_LINESTATE_1 IOMUX_PAD(0x36C, 0x44, 7, 0x0, 0, 0)
106#define _MX53_PAD_KEY_ROW4__KPP_ROW_4 IOMUX_PAD(0x370, 0x48, 0, 0x0, 0, 0)
107#define _MX53_PAD_KEY_ROW4__GPIO4_15 IOMUX_PAD(0x370, 0x48, 1, 0x0, 0, 0)
108#define _MX53_PAD_KEY_ROW4__CAN2_RXCAN IOMUX_PAD(0x370, 0x48, 2, 0x764, 0, 0)
109#define _MX53_PAD_KEY_ROW4__IPU_SISG_5 IOMUX_PAD(0x370, 0x48, 3, 0x0, 0, 0)
110#define _MX53_PAD_KEY_ROW4__UART5_CTS IOMUX_PAD(0x370, 0x48, 4, 0x894, 1, 0)
111#define _MX53_PAD_KEY_ROW4__USBOH3_USBOTG_PWR IOMUX_PAD(0x370, 0x48, 5, 0x0, 0, 0)
112#define _MX53_PAD_KEY_ROW4__USBPHY1_VBUSVALID IOMUX_PAD(0x370, 0x48, 7, 0x0, 0, 0)
113#define _MX53_PAD_DI0_DISP_CLK__IPU_DI0_DISP_CLK IOMUX_PAD(0x378, 0x4C, 0, 0x0, 0, 0)
114#define _MX53_PAD_DI0_DISP_CLK__GPIO4_16 IOMUX_PAD(0x378, 0x4C, 1, 0x0, 0, 0)
115#define _MX53_PAD_DI0_DISP_CLK__USBOH3_USBH2_DIR IOMUX_PAD(0x378, 0x4C, 2, 0x0, 0, 0)
116#define _MX53_PAD_DI0_DISP_CLK__SDMA_DEBUG_CORE_STATE_0 IOMUX_PAD(0x378, 0x4C, 5, 0x0, 0, 0)
117#define _MX53_PAD_DI0_DISP_CLK__EMI_EMI_DEBUG_0 IOMUX_PAD(0x378, 0x4C, 6, 0x0, 0, 0)
118#define _MX53_PAD_DI0_DISP_CLK__USBPHY1_AVALID IOMUX_PAD(0x378, 0x4C, 7, 0x0, 0, 0)
119#define _MX53_PAD_DI0_PIN15__IPU_DI0_PIN15 IOMUX_PAD(0x37C, 0x50, 0, 0x0, 0, 0)
120#define _MX53_PAD_DI0_PIN15__GPIO4_17 IOMUX_PAD(0x37C, 0x50, 1, 0x0, 0, 0)
121#define _MX53_PAD_DI0_PIN15__AUDMUX_AUD6_TXC IOMUX_PAD(0x37C, 0x50, 2, 0x0, 0, 0)
122#define _MX53_PAD_DI0_PIN15__SDMA_DEBUG_CORE_STATE_1 IOMUX_PAD(0x37C, 0x50, 5, 0x0, 0, 0)
123#define _MX53_PAD_DI0_PIN15__EMI_EMI_DEBUG_1 IOMUX_PAD(0x37C, 0x50, 6, 0x0, 0, 0)
124#define _MX53_PAD_DI0_PIN15__USBPHY1_BVALID IOMUX_PAD(0x37C, 0x50, 7, 0x0, 0, 0)
125#define _MX53_PAD_DI0_PIN2__IPU_DI0_PIN2 IOMUX_PAD(0x380, 0x54, 0, 0x0, 0, 0)
126#define _MX53_PAD_DI0_PIN2__GPIO4_18 IOMUX_PAD(0x380, 0x54, 1, 0x0, 0, 0)
127#define _MX53_PAD_DI0_PIN2__AUDMUX_AUD6_TXD IOMUX_PAD(0x380, 0x54, 2, 0x0, 0, 0)
128#define _MX53_PAD_DI0_PIN2__SDMA_DEBUG_CORE_STATE_2 IOMUX_PAD(0x380, 0x54, 5, 0x0, 0, 0)
129#define _MX53_PAD_DI0_PIN2__EMI_EMI_DEBUG_2 IOMUX_PAD(0x380, 0x54, 6, 0x0, 0, 0)
130#define _MX53_PAD_DI0_PIN2__USBPHY1_ENDSESSION IOMUX_PAD(0x380, 0x54, 7, 0x0, 0, 0)
131#define _MX53_PAD_DI0_PIN3__IPU_DI0_PIN3 IOMUX_PAD(0x384, 0x58, 0, 0x0, 0, 0)
132#define _MX53_PAD_DI0_PIN3__GPIO4_19 IOMUX_PAD(0x384, 0x58, 1, 0x0, 0, 0)
133#define _MX53_PAD_DI0_PIN3__AUDMUX_AUD6_TXFS IOMUX_PAD(0x384, 0x58, 2, 0x0, 0, 0)
134#define _MX53_PAD_DI0_PIN3__SDMA_DEBUG_CORE_STATE_3 IOMUX_PAD(0x384, 0x58, 5, 0x0, 0, 0)
135#define _MX53_PAD_DI0_PIN3__EMI_EMI_DEBUG_3 IOMUX_PAD(0x384, 0x58, 6, 0x0, 0, 0)
136#define _MX53_PAD_DI0_PIN3__USBPHY1_IDDIG IOMUX_PAD(0x384, 0x58, 7, 0x0, 0, 0)
137#define _MX53_PAD_DI0_PIN4__IPU_DI0_PIN4 IOMUX_PAD(0x388, 0x5C, 0, 0x0, 0, 0)
138#define _MX53_PAD_DI0_PIN4__GPIO4_20 IOMUX_PAD(0x388, 0x5C, 1, 0x0, 0, 0)
139#define _MX53_PAD_DI0_PIN4__AUDMUX_AUD6_RXD IOMUX_PAD(0x388, 0x5C, 2, 0x0, 0, 0)
140#define _MX53_PAD_DI0_PIN4__ESDHC1_WP IOMUX_PAD(0x388, 0x5C, 3, 0x7FC, 0, 0)
141#define _MX53_PAD_DI0_PIN4__SDMA_DEBUG_YIELD IOMUX_PAD(0x388, 0x5C, 5, 0x0, 0, 0)
142#define _MX53_PAD_DI0_PIN4__EMI_EMI_DEBUG_4 IOMUX_PAD(0x388, 0x5C, 6, 0x0, 0, 0)
143#define _MX53_PAD_DI0_PIN4__USBPHY1_HOSTDISCONNECT IOMUX_PAD(0x388, 0x5C, 7, 0x0, 0, 0)
144#define _MX53_PAD_DISP0_DAT0__IPU_DISP0_DAT_0 IOMUX_PAD(0x38C, 0x60, 0, 0x0, 0, 0)
145#define _MX53_PAD_DISP0_DAT0__GPIO4_21 IOMUX_PAD(0x38C, 0x60, 1, 0x0, 0, 0)
146#define _MX53_PAD_DISP0_DAT0__CSPI_SCLK IOMUX_PAD(0x38C, 0x60, 2, 0x780, 0, 0)
147#define _MX53_PAD_DISP0_DAT0__USBOH3_USBH2_DATA_0 IOMUX_PAD(0x38C, 0x60, 3, 0x0, 0, 0)
148#define _MX53_PAD_DISP0_DAT0__SDMA_DEBUG_CORE_RUN IOMUX_PAD(0x38C, 0x60, 5, 0x0, 0, 0)
149#define _MX53_PAD_DISP0_DAT0__EMI_EMI_DEBUG_5 IOMUX_PAD(0x38C, 0x60, 6, 0x0, 0, 0)
150#define _MX53_PAD_DISP0_DAT0__USBPHY2_TXREADY IOMUX_PAD(0x38C, 0x60, 7, 0x0, 0, 0)
151#define _MX53_PAD_DISP0_DAT1__IPU_DISP0_DAT_1 IOMUX_PAD(0x390, 0x64, 0, 0x0, 0, 0)
152#define _MX53_PAD_DISP0_DAT1__GPIO4_22 IOMUX_PAD(0x390, 0x64, 1, 0x0, 0, 0)
153#define _MX53_PAD_DISP0_DAT1__CSPI_MOSI IOMUX_PAD(0x390, 0x64, 2, 0x788, 0, 0)
154#define _MX53_PAD_DISP0_DAT1__USBOH3_USBH2_DATA_1 IOMUX_PAD(0x390, 0x64, 3, 0x0, 0, 0)
155#define _MX53_PAD_DISP0_DAT1__SDMA_DEBUG_EVENT_CHANNEL_SEL IOMUX_PAD(0x390, 0x64, 5, 0x0, 0, 0)
156#define _MX53_PAD_DISP0_DAT1__EMI_EMI_DEBUG_6 IOMUX_PAD(0x390, 0x64, 6, 0x0, 0, 0)
157#define _MX53_PAD_DISP0_DAT1__USBPHY2_RXVALID IOMUX_PAD(0x390, 0x64, 7, 0x0, 0, 0)
158#define _MX53_PAD_DISP0_DAT2__IPU_DISP0_DAT_2 IOMUX_PAD(0x394, 0x68, 0, 0x0, 0, 0)
159#define _MX53_PAD_DISP0_DAT2__GPIO4_23 IOMUX_PAD(0x394, 0x68, 1, 0x0, 0, 0)
160#define _MX53_PAD_DISP0_DAT2__CSPI_MISO IOMUX_PAD(0x394, 0x68, 2, 0x784, 0, 0)
161#define _MX53_PAD_DISP0_DAT2__USBOH3_USBH2_DATA_2 IOMUX_PAD(0x394, 0x68, 3, 0x0, 0, 0)
162#define _MX53_PAD_DISP0_DAT2__SDMA_DEBUG_MODE IOMUX_PAD(0x394, 0x68, 5, 0x0, 0, 0)
163#define _MX53_PAD_DISP0_DAT2__EMI_EMI_DEBUG_7 IOMUX_PAD(0x394, 0x68, 6, 0x0, 0, 0)
164#define _MX53_PAD_DISP0_DAT2__USBPHY2_RXACTIVE IOMUX_PAD(0x394, 0x68, 7, 0x0, 0, 0)
165#define _MX53_PAD_DISP0_DAT3__IPU_DISP0_DAT_3 IOMUX_PAD(0x398, 0x6C, 0, 0x0, 0, 0)
166#define _MX53_PAD_DISP0_DAT3__GPIO4_24 IOMUX_PAD(0x398, 0x6C, 1, 0x0, 0, 0)
167#define _MX53_PAD_DISP0_DAT3__CSPI_SS0 IOMUX_PAD(0x398, 0x6C, 2, 0x78C, 0, 0)
168#define _MX53_PAD_DISP0_DAT3__USBOH3_USBH2_DATA_3 IOMUX_PAD(0x398, 0x6C, 3, 0x0, 0, 0)
169#define _MX53_PAD_DISP0_DAT3__SDMA_DEBUG_BUS_ERROR IOMUX_PAD(0x398, 0x6C, 5, 0x0, 0, 0)
170#define _MX53_PAD_DISP0_DAT3__EMI_EMI_DEBUG_8 IOMUX_PAD(0x398, 0x6C, 6, 0x0, 0, 0)
171#define _MX53_PAD_DISP0_DAT3__USBPHY2_RXERROR IOMUX_PAD(0x398, 0x6C, 7, 0x0, 0, 0)
172#define _MX53_PAD_DISP0_DAT4__IPU_DISP0_DAT_4 IOMUX_PAD(0x39C, 0x70, 0, 0x0, 0, 0)
173#define _MX53_PAD_DISP0_DAT4__GPIO4_25 IOMUX_PAD(0x39C, 0x70, 1, 0x0, 0, 0)
174#define _MX53_PAD_DISP0_DAT4__CSPI_SS1 IOMUX_PAD(0x39C, 0x70, 2, 0x790, 0, 0)
175#define _MX53_PAD_DISP0_DAT4__USBOH3_USBH2_DATA_4 IOMUX_PAD(0x39C, 0x70, 3, 0x0, 0, 0)
176#define _MX53_PAD_DISP0_DAT4__SDMA_DEBUG_BUS_RWB IOMUX_PAD(0x39C, 0x70, 5, 0x0, 0, 0)
177#define _MX53_PAD_DISP0_DAT4__EMI_EMI_DEBUG_9 IOMUX_PAD(0x39C, 0x70, 6, 0x0, 0, 0)
178#define _MX53_PAD_DISP0_DAT4__USBPHY2_SIECLOCK IOMUX_PAD(0x39C, 0x70, 7, 0x0, 0, 0)
179#define _MX53_PAD_DISP0_DAT5__IPU_DISP0_DAT_5 IOMUX_PAD(0x3A0, 0x74, 0, 0x0, 0, 0)
180#define _MX53_PAD_DISP0_DAT5__GPIO4_26 IOMUX_PAD(0x3A0, 0x74, 1, 0x0, 0, 0)
181#define _MX53_PAD_DISP0_DAT5__CSPI_SS2 IOMUX_PAD(0x3A0, 0x74, 2, 0x794, 0, 0)
182#define _MX53_PAD_DISP0_DAT5__USBOH3_USBH2_DATA_5 IOMUX_PAD(0x3A0, 0x74, 3, 0x0, 0, 0)
183#define _MX53_PAD_DISP0_DAT5__SDMA_DEBUG_MATCHED_DMBUS IOMUX_PAD(0x3A0, 0x74, 5, 0x0, 0, 0)
184#define _MX53_PAD_DISP0_DAT5__EMI_EMI_DEBUG_10 IOMUX_PAD(0x3A0, 0x74, 6, 0x0, 0, 0)
185#define _MX53_PAD_DISP0_DAT5__USBPHY2_LINESTATE_0 IOMUX_PAD(0x3A0, 0x74, 7, 0x0, 0, 0)
186#define _MX53_PAD_DISP0_DAT6__IPU_DISP0_DAT_6 IOMUX_PAD(0x3A4, 0x78, 0, 0x0, 0, 0)
187#define _MX53_PAD_DISP0_DAT6__GPIO4_27 IOMUX_PAD(0x3A4, 0x78, 1, 0x0, 0, 0)
188#define _MX53_PAD_DISP0_DAT6__CSPI_SS3 IOMUX_PAD(0x3A4, 0x78, 2, 0x798, 0, 0)
189#define _MX53_PAD_DISP0_DAT6__USBOH3_USBH2_DATA_6 IOMUX_PAD(0x3A4, 0x78, 3, 0x0, 0, 0)
190#define _MX53_PAD_DISP0_DAT6__SDMA_DEBUG_RTBUFFER_WRITE IOMUX_PAD(0x3A4, 0x78, 5, 0x0, 0, 0)
191#define _MX53_PAD_DISP0_DAT6__EMI_EMI_DEBUG_11 IOMUX_PAD(0x3A4, 0x78, 6, 0x0, 0, 0)
192#define _MX53_PAD_DISP0_DAT6__USBPHY2_LINESTATE_1 IOMUX_PAD(0x3A4, 0x78, 7, 0x0, 0, 0)
193#define _MX53_PAD_DISP0_DAT7__IPU_DISP0_DAT_7 IOMUX_PAD(0x3A8, 0x7C, 0, 0x0, 0, 0)
194#define _MX53_PAD_DISP0_DAT7__GPIO4_28 IOMUX_PAD(0x3A8, 0x7C, 1, 0x0, 0, 0)
195#define _MX53_PAD_DISP0_DAT7__CSPI_RDY IOMUX_PAD(0x3A8, 0x7C, 2, 0x0, 0, 0)
196#define _MX53_PAD_DISP0_DAT7__USBOH3_USBH2_DATA_7 IOMUX_PAD(0x3A8, 0x7C, 3, 0x0, 0, 0)
197#define _MX53_PAD_DISP0_DAT7__SDMA_DEBUG_EVENT_CHANNEL_0 IOMUX_PAD(0x3A8, 0x7C, 5, 0x0, 0, 0)
198#define _MX53_PAD_DISP0_DAT7__EMI_EMI_DEBUG_12 IOMUX_PAD(0x3A8, 0x7C, 6, 0x0, 0, 0)
199#define _MX53_PAD_DISP0_DAT7__USBPHY2_VBUSVALID IOMUX_PAD(0x3A8, 0x7C, 7, 0x0, 0, 0)
200#define _MX53_PAD_DISP0_DAT8__IPU_DISP0_DAT_8 IOMUX_PAD(0x3AC, 0x80, 0, 0x0, 0, 0)
201#define _MX53_PAD_DISP0_DAT8__GPIO4_29 IOMUX_PAD(0x3AC, 0x80, 1, 0x0, 0, 0)
202#define _MX53_PAD_DISP0_DAT8__PWM1_PWMO IOMUX_PAD(0x3AC, 0x80, 2, 0x0, 0, 0)
203#define _MX53_PAD_DISP0_DAT8__WDOG1_WDOG_B IOMUX_PAD(0x3AC, 0x80, 3, 0x0, 0, 0)
204#define _MX53_PAD_DISP0_DAT8__SDMA_DEBUG_EVENT_CHANNEL_1 IOMUX_PAD(0x3AC, 0x80, 5, 0x0, 0, 0)
205#define _MX53_PAD_DISP0_DAT8__EMI_EMI_DEBUG_13 IOMUX_PAD(0x3AC, 0x80, 6, 0x0, 0, 0)
206#define _MX53_PAD_DISP0_DAT8__USBPHY2_AVALID IOMUX_PAD(0x3AC, 0x80, 7, 0x0, 0, 0)
207#define _MX53_PAD_DISP0_DAT9__IPU_DISP0_DAT_9 IOMUX_PAD(0x3B0, 0x84, 0, 0x0, 0, 0)
208#define _MX53_PAD_DISP0_DAT9__GPIO4_30 IOMUX_PAD(0x3B0, 0x84, 1, 0x0, 0, 0)
209#define _MX53_PAD_DISP0_DAT9__PWM2_PWMO IOMUX_PAD(0x3B0, 0x84, 2, 0x0, 0, 0)
210#define _MX53_PAD_DISP0_DAT9__WDOG2_WDOG_B IOMUX_PAD(0x3B0, 0x84, 3, 0x0, 0, 0)
211#define _MX53_PAD_DISP0_DAT9__SDMA_DEBUG_EVENT_CHANNEL_2 IOMUX_PAD(0x3B0, 0x84, 5, 0x0, 0, 0)
212#define _MX53_PAD_DISP0_DAT9__EMI_EMI_DEBUG_14 IOMUX_PAD(0x3B0, 0x84, 6, 0x0, 0, 0)
213#define _MX53_PAD_DISP0_DAT9__USBPHY2_VSTATUS_0 IOMUX_PAD(0x3B0, 0x84, 7, 0x0, 0, 0)
214#define _MX53_PAD_DISP0_DAT10__IPU_DISP0_DAT_10 IOMUX_PAD(0x3B4, 0x88, 0, 0x0, 0, 0)
215#define _MX53_PAD_DISP0_DAT10__GPIO4_31 IOMUX_PAD(0x3B4, 0x88, 1, 0x0, 0, 0)
216#define _MX53_PAD_DISP0_DAT10__USBOH3_USBH2_STP IOMUX_PAD(0x3B4, 0x88, 2, 0x0, 0, 0)
217#define _MX53_PAD_DISP0_DAT10__SDMA_DEBUG_EVENT_CHANNEL_3 IOMUX_PAD(0x3B4, 0x88, 5, 0x0, 0, 0)
218#define _MX53_PAD_DISP0_DAT10__EMI_EMI_DEBUG_15 IOMUX_PAD(0x3B4, 0x88, 6, 0x0, 0, 0)
219#define _MX53_PAD_DISP0_DAT10__USBPHY2_VSTATUS_1 IOMUX_PAD(0x3B4, 0x88, 7, 0x0, 0, 0)
220#define _MX53_PAD_DISP0_DAT11__IPU_DISP0_DAT_11 IOMUX_PAD(0x3B8, 0x8C, 0, 0x0, 0, 0)
221#define _MX53_PAD_DISP0_DAT11__GPIO5_5 IOMUX_PAD(0x3B8, 0x8C, 1, 0x0, 0, 0)
222#define _MX53_PAD_DISP0_DAT11__USBOH3_USBH2_NXT IOMUX_PAD(0x3B8, 0x8C, 2, 0x0, 0, 0)
223#define _MX53_PAD_DISP0_DAT11__SDMA_DEBUG_EVENT_CHANNEL_4 IOMUX_PAD(0x3B8, 0x8C, 5, 0x0, 0, 0)
224#define _MX53_PAD_DISP0_DAT11__EMI_EMI_DEBUG_16 IOMUX_PAD(0x3B8, 0x8C, 6, 0x0, 0, 0)
225#define _MX53_PAD_DISP0_DAT11__USBPHY2_VSTATUS_2 IOMUX_PAD(0x3B8, 0x8C, 7, 0x0, 0, 0)
226#define _MX53_PAD_DISP0_DAT12__IPU_DISP0_DAT_12 IOMUX_PAD(0x3BC, 0x90, 0, 0x0, 0, 0)
227#define _MX53_PAD_DISP0_DAT12__GPIO5_6 IOMUX_PAD(0x3BC, 0x90, 1, 0x0, 0, 0)
228#define _MX53_PAD_DISP0_DAT12__USBOH3_USBH2_CLK IOMUX_PAD(0x3BC, 0x90, 2, 0x0, 0, 0)
229#define _MX53_PAD_DISP0_DAT12__SDMA_DEBUG_EVENT_CHANNEL_5 IOMUX_PAD(0x3BC, 0x90, 5, 0x0, 0, 0)
230#define _MX53_PAD_DISP0_DAT12__EMI_EMI_DEBUG_17 IOMUX_PAD(0x3BC, 0x90, 6, 0x0, 0, 0)
231#define _MX53_PAD_DISP0_DAT12__USBPHY2_VSTATUS_3 IOMUX_PAD(0x3BC, 0x90, 7, 0x0, 0, 0)
232#define _MX53_PAD_DISP0_DAT13__IPU_DISP0_DAT_13 IOMUX_PAD(0x3C0, 0x94, 0, 0x0, 0, 0)
233#define _MX53_PAD_DISP0_DAT13__GPIO5_7 IOMUX_PAD(0x3C0, 0x94, 1, 0x0, 0, 0)
234#define _MX53_PAD_DISP0_DAT13__AUDMUX_AUD5_RXFS IOMUX_PAD(0x3C0, 0x94, 3, 0x754, 0, 0)
235#define _MX53_PAD_DISP0_DAT13__SDMA_DEBUG_EVT_CHN_LINES_0 IOMUX_PAD(0x3C0, 0x94, 5, 0x0, 0, 0)
236#define _MX53_PAD_DISP0_DAT13__EMI_EMI_DEBUG_18 IOMUX_PAD(0x3C0, 0x94, 6, 0x0, 0, 0)
237#define _MX53_PAD_DISP0_DAT13__USBPHY2_VSTATUS_4 IOMUX_PAD(0x3C0, 0x94, 7, 0x0, 0, 0)
238#define _MX53_PAD_DISP0_DAT14__IPU_DISP0_DAT_14 IOMUX_PAD(0x3C4, 0x98, 0, 0x0, 0, 0)
239#define _MX53_PAD_DISP0_DAT14__GPIO5_8 IOMUX_PAD(0x3C4, 0x98, 1, 0x0, 0, 0)
240#define _MX53_PAD_DISP0_DAT14__AUDMUX_AUD5_RXC IOMUX_PAD(0x3C4, 0x98, 3, 0x750, 0, 0)
241#define _MX53_PAD_DISP0_DAT14__SDMA_DEBUG_EVT_CHN_LINES_1 IOMUX_PAD(0x3C4, 0x98, 5, 0x0, 0, 0)
242#define _MX53_PAD_DISP0_DAT14__EMI_EMI_DEBUG_19 IOMUX_PAD(0x3C4, 0x98, 6, 0x0, 0, 0)
243#define _MX53_PAD_DISP0_DAT14__USBPHY2_VSTATUS_5 IOMUX_PAD(0x3C4, 0x98, 7, 0x0, 0, 0)
244#define _MX53_PAD_DISP0_DAT15__IPU_DISP0_DAT_15 IOMUX_PAD(0x3C8, 0x9C, 0, 0x0, 0, 0)
245#define _MX53_PAD_DISP0_DAT15__GPIO5_9 IOMUX_PAD(0x3C8, 0x9C, 1, 0x0, 0, 0)
246#define _MX53_PAD_DISP0_DAT15__ECSPI1_SS1 IOMUX_PAD(0x3C8, 0x9C, 2, 0x7AC, 1, 0)
247#define _MX53_PAD_DISP0_DAT15__ECSPI2_SS1 IOMUX_PAD(0x3C8, 0x9C, 3, 0x7C8, 0, 0)
248#define _MX53_PAD_DISP0_DAT15__SDMA_DEBUG_EVT_CHN_LINES_2 IOMUX_PAD(0x3C8, 0x9C, 5, 0x0, 0, 0)
249#define _MX53_PAD_DISP0_DAT15__EMI_EMI_DEBUG_20 IOMUX_PAD(0x3C8, 0x9C, 6, 0x0, 0, 0)
250#define _MX53_PAD_DISP0_DAT15__USBPHY2_VSTATUS_6 IOMUX_PAD(0x3C8, 0x9C, 7, 0x0, 0, 0)
251#define _MX53_PAD_DISP0_DAT16__IPU_DISP0_DAT_16 IOMUX_PAD(0x3CC, 0xA0, 0, 0x0, 0, 0)
252#define _MX53_PAD_DISP0_DAT16__GPIO5_10 IOMUX_PAD(0x3CC, 0xA0, 1, 0x0, 0, 0)
253#define _MX53_PAD_DISP0_DAT16__ECSPI2_MOSI IOMUX_PAD(0x3CC, 0xA0, 2, 0x7C0, 0, 0)
254#define _MX53_PAD_DISP0_DAT16__AUDMUX_AUD5_TXC IOMUX_PAD(0x3CC, 0xA0, 3, 0x758, 1, 0)
255#define _MX53_PAD_DISP0_DAT16__SDMA_EXT_EVENT_0 IOMUX_PAD(0x3CC, 0xA0, 4, 0x868, 0, 0)
256#define _MX53_PAD_DISP0_DAT16__SDMA_DEBUG_EVT_CHN_LINES_3 IOMUX_PAD(0x3CC, 0xA0, 5, 0x0, 0, 0)
257#define _MX53_PAD_DISP0_DAT16__EMI_EMI_DEBUG_21 IOMUX_PAD(0x3CC, 0xA0, 6, 0x0, 0, 0)
258#define _MX53_PAD_DISP0_DAT16__USBPHY2_VSTATUS_7 IOMUX_PAD(0x3CC, 0xA0, 7, 0x0, 0, 0)
259#define _MX53_PAD_DISP0_DAT17__IPU_DISP0_DAT_17 IOMUX_PAD(0x3D0, 0xA4, 0, 0x0, 0, 0)
260#define _MX53_PAD_DISP0_DAT17__GPIO5_11 IOMUX_PAD(0x3D0, 0xA4, 1, 0x0, 0, 0)
261#define _MX53_PAD_DISP0_DAT17__ECSPI2_MISO IOMUX_PAD(0x3D0, 0xA4, 2, 0x7BC, 0, 0)
262#define _MX53_PAD_DISP0_DAT17__AUDMUX_AUD5_TXD IOMUX_PAD(0x3D0, 0xA4, 3, 0x74C, 1, 0)
263#define _MX53_PAD_DISP0_DAT17__SDMA_EXT_EVENT_1 IOMUX_PAD(0x3D0, 0xA4, 4, 0x86C, 0, 0)
264#define _MX53_PAD_DISP0_DAT17__SDMA_DEBUG_EVT_CHN_LINES_4 IOMUX_PAD(0x3D0, 0xA4, 5, 0x0, 0, 0)
265#define _MX53_PAD_DISP0_DAT17__EMI_EMI_DEBUG_22 IOMUX_PAD(0x3D0, 0xA4, 6, 0x0, 0, 0)
266#define _MX53_PAD_DISP0_DAT18__IPU_DISP0_DAT_18 IOMUX_PAD(0x3D4, 0xA8, 0, 0x0, 0, 0)
267#define _MX53_PAD_DISP0_DAT18__GPIO5_12 IOMUX_PAD(0x3D4, 0xA8, 1, 0x0, 0, 0)
268#define _MX53_PAD_DISP0_DAT18__ECSPI2_SS0 IOMUX_PAD(0x3D4, 0xA8, 2, 0x7C4, 0, 0)
269#define _MX53_PAD_DISP0_DAT18__AUDMUX_AUD5_TXFS IOMUX_PAD(0x3D4, 0xA8, 3, 0x75C, 1, 0)
270#define _MX53_PAD_DISP0_DAT18__AUDMUX_AUD4_RXFS IOMUX_PAD(0x3D4, 0xA8, 4, 0x73C, 0, 0)
271#define _MX53_PAD_DISP0_DAT18__SDMA_DEBUG_EVT_CHN_LINES_5 IOMUX_PAD(0x3D4, 0xA8, 5, 0x0, 0, 0)
272#define _MX53_PAD_DISP0_DAT18__EMI_EMI_DEBUG_23 IOMUX_PAD(0x3D4, 0xA8, 6, 0x0, 0, 0)
273#define _MX53_PAD_DISP0_DAT18__EMI_WEIM_CS_2 IOMUX_PAD(0x3D4, 0xA8, 7, 0x0, 0, 0)
274#define _MX53_PAD_DISP0_DAT19__IPU_DISP0_DAT_19 IOMUX_PAD(0x3D8, 0xAC, 0, 0x0, 0, 0)
275#define _MX53_PAD_DISP0_DAT19__GPIO5_13 IOMUX_PAD(0x3D8, 0xAC, 1, 0x0, 0, 0)
276#define _MX53_PAD_DISP0_DAT19__ECSPI2_SCLK IOMUX_PAD(0x3D8, 0xAC, 2, 0x7B8, 0, 0)
277#define _MX53_PAD_DISP0_DAT19__AUDMUX_AUD5_RXD IOMUX_PAD(0x3D8, 0xAC, 3, 0x748, 1, 0)
278#define _MX53_PAD_DISP0_DAT19__AUDMUX_AUD4_RXC IOMUX_PAD(0x3D8, 0xAC, 4, 0x738, 0, 0)
279#define _MX53_PAD_DISP0_DAT19__SDMA_DEBUG_EVT_CHN_LINES_6 IOMUX_PAD(0x3D8, 0xAC, 5, 0x0, 0, 0)
280#define _MX53_PAD_DISP0_DAT19__EMI_EMI_DEBUG_24 IOMUX_PAD(0x3D8, 0xAC, 6, 0x0, 0, 0)
281#define _MX53_PAD_DISP0_DAT19__EMI_WEIM_CS_3 IOMUX_PAD(0x3D8, 0xAC, 7, 0x0, 0, 0)
282#define _MX53_PAD_DISP0_DAT20__IPU_DISP0_DAT_20 IOMUX_PAD(0x3DC, 0xB0, 0, 0x0, 0, 0)
283#define _MX53_PAD_DISP0_DAT20__GPIO5_14 IOMUX_PAD(0x3DC, 0xB0, 1, 0x0, 0, 0)
284#define _MX53_PAD_DISP0_DAT20__ECSPI1_SCLK IOMUX_PAD(0x3DC, 0xB0, 2, 0x79C, 1, 0)
285#define _MX53_PAD_DISP0_DAT20__AUDMUX_AUD4_TXC IOMUX_PAD(0x3DC, 0xB0, 3, 0x740, 0, 0)
286#define _MX53_PAD_DISP0_DAT20__SDMA_DEBUG_EVT_CHN_LINES_7 IOMUX_PAD(0x3DC, 0xB0, 5, 0x0, 0, 0)
287#define _MX53_PAD_DISP0_DAT20__EMI_EMI_DEBUG_25 IOMUX_PAD(0x3DC, 0xB0, 6, 0x0, 0, 0)
288#define _MX53_PAD_DISP0_DAT20__SATA_PHY_TDI IOMUX_PAD(0x3DC, 0xB0, 7, 0x0, 0, 0)
289#define _MX53_PAD_DISP0_DAT21__IPU_DISP0_DAT_21 IOMUX_PAD(0x3E0, 0xB4, 0, 0x0, 0, 0)
290#define _MX53_PAD_DISP0_DAT21__GPIO5_15 IOMUX_PAD(0x3E0, 0xB4, 1, 0x0, 0, 0)
291#define _MX53_PAD_DISP0_DAT21__ECSPI1_MOSI IOMUX_PAD(0x3E0, 0xB4, 2, 0x7A4, 1, 0)
292#define _MX53_PAD_DISP0_DAT21__AUDMUX_AUD4_TXD IOMUX_PAD(0x3E0, 0xB4, 3, 0x734, 0, 0)
293#define _MX53_PAD_DISP0_DAT21__SDMA_DEBUG_BUS_DEVICE_0 IOMUX_PAD(0x3E0, 0xB4, 5, 0x0, 0, 0)
294#define _MX53_PAD_DISP0_DAT21__EMI_EMI_DEBUG_26 IOMUX_PAD(0x3E0, 0xB4, 6, 0x0, 0, 0)
295#define _MX53_PAD_DISP0_DAT21__SATA_PHY_TDO IOMUX_PAD(0x3E0, 0xB4, 7, 0x0, 0, 0)
296#define _MX53_PAD_DISP0_DAT22__IPU_DISP0_DAT_22 IOMUX_PAD(0x3E4, 0xB8, 0, 0x0, 0, 0)
297#define _MX53_PAD_DISP0_DAT22__GPIO5_16 IOMUX_PAD(0x3E4, 0xB8, 1, 0x0, 0, 0)
298#define _MX53_PAD_DISP0_DAT22__ECSPI1_MISO IOMUX_PAD(0x3E4, 0xB8, 2, 0x7A0, 1, 0)
299#define _MX53_PAD_DISP0_DAT22__AUDMUX_AUD4_TXFS IOMUX_PAD(0x3E4, 0xB8, 3, 0x744, 0, 0)
300#define _MX53_PAD_DISP0_DAT22__SDMA_DEBUG_BUS_DEVICE_1 IOMUX_PAD(0x3E4, 0xB8, 5, 0x0, 0, 0)
301#define _MX53_PAD_DISP0_DAT22__EMI_EMI_DEBUG_27 IOMUX_PAD(0x3E4, 0xB8, 6, 0x0, 0, 0)
302#define _MX53_PAD_DISP0_DAT22__SATA_PHY_TCK IOMUX_PAD(0x3E4, 0xB8, 7, 0x0, 0, 0)
303#define _MX53_PAD_DISP0_DAT23__IPU_DISP0_DAT_23 IOMUX_PAD(0x3E8, 0xBC, 0, 0x0, 0, 0)
304#define _MX53_PAD_DISP0_DAT23__GPIO5_17 IOMUX_PAD(0x3E8, 0xBC, 1, 0x0, 0, 0)
305#define _MX53_PAD_DISP0_DAT23__ECSPI1_SS0 IOMUX_PAD(0x3E8, 0xBC, 2, 0x7A8, 1, 0)
306#define _MX53_PAD_DISP0_DAT23__AUDMUX_AUD4_RXD IOMUX_PAD(0x3E8, 0xBC, 3, 0x730, 0, 0)
307#define _MX53_PAD_DISP0_DAT23__SDMA_DEBUG_BUS_DEVICE_2 IOMUX_PAD(0x3E8, 0xBC, 5, 0x0, 0, 0)
308#define _MX53_PAD_DISP0_DAT23__EMI_EMI_DEBUG_28 IOMUX_PAD(0x3E8, 0xBC, 6, 0x0, 0, 0)
309#define _MX53_PAD_DISP0_DAT23__SATA_PHY_TMS IOMUX_PAD(0x3E8, 0xBC, 7, 0x0, 0, 0)
310#define _MX53_PAD_CSI0_PIXCLK__IPU_CSI0_PIXCLK IOMUX_PAD(0x3EC, 0xC0, 0, 0x0, 0, 0)
311#define _MX53_PAD_CSI0_PIXCLK__GPIO5_18 IOMUX_PAD(0x3EC, 0xC0, 1, 0x0, 0, 0)
312#define _MX53_PAD_CSI0_PIXCLK__SDMA_DEBUG_PC_0 IOMUX_PAD(0x3EC, 0xC0, 5, 0x0, 0, 0)
313#define _MX53_PAD_CSI0_PIXCLK__EMI_EMI_DEBUG_29 IOMUX_PAD(0x3EC, 0xC0, 6, 0x0, 0, 0)
314#define _MX53_PAD_CSI0_MCLK__IPU_CSI0_HSYNC IOMUX_PAD(0x3F0, 0xC4, 0, 0x0, 0, 0)
315#define _MX53_PAD_CSI0_MCLK__GPIO5_19 IOMUX_PAD(0x3F0, 0xC4, 1, 0x0, 0, 0)
316#define _MX53_PAD_CSI0_MCLK__CCM_CSI0_MCLK IOMUX_PAD(0x3F0, 0xC4, 2, 0x0, 0, 0)
317#define _MX53_PAD_CSI0_MCLK__SDMA_DEBUG_PC_1 IOMUX_PAD(0x3F0, 0xC4, 5, 0x0, 0, 0)
318#define _MX53_PAD_CSI0_MCLK__EMI_EMI_DEBUG_30 IOMUX_PAD(0x3F0, 0xC4, 6, 0x0, 0, 0)
319#define _MX53_PAD_CSI0_MCLK__TPIU_TRCTL IOMUX_PAD(0x3F0, 0xC4, 7, 0x0, 0, 0)
320#define _MX53_PAD_CSI0_DATA_EN__IPU_CSI0_DATA_EN IOMUX_PAD(0x3F4, 0xC8, 0, 0x0, 0, 0)
321#define _MX53_PAD_CSI0_DATA_EN__GPIO5_20 IOMUX_PAD(0x3F4, 0xC8, 1, 0x0, 0, 0)
322#define _MX53_PAD_CSI0_DATA_EN__SDMA_DEBUG_PC_2 IOMUX_PAD(0x3F4, 0xC8, 5, 0x0, 0, 0)
323#define _MX53_PAD_CSI0_DATA_EN__EMI_EMI_DEBUG_31 IOMUX_PAD(0x3F4, 0xC8, 6, 0x0, 0, 0)
324#define _MX53_PAD_CSI0_DATA_EN__TPIU_TRCLK IOMUX_PAD(0x3F4, 0xC8, 7, 0x0, 0, 0)
325#define _MX53_PAD_CSI0_VSYNC__IPU_CSI0_VSYNC IOMUX_PAD(0x3F8, 0xCC, 0, 0x0, 0, 0)
326#define _MX53_PAD_CSI0_VSYNC__GPIO5_21 IOMUX_PAD(0x3F8, 0xCC, 1, 0x0, 0, 0)
327#define _MX53_PAD_CSI0_VSYNC__SDMA_DEBUG_PC_3 IOMUX_PAD(0x3F8, 0xCC, 5, 0x0, 0, 0)
328#define _MX53_PAD_CSI0_VSYNC__EMI_EMI_DEBUG_32 IOMUX_PAD(0x3F8, 0xCC, 6, 0x0, 0, 0)
329#define _MX53_PAD_CSI0_VSYNC__TPIU_TRACE_0 IOMUX_PAD(0x3F8, 0xCC, 7, 0x0, 0, 0)
330#define _MX53_PAD_CSI0_DAT4__IPU_CSI0_D_4 IOMUX_PAD(0x3FC, 0xD0, 0, 0x0, 0, 0)
331#define _MX53_PAD_CSI0_DAT4__GPIO5_22 IOMUX_PAD(0x3FC, 0xD0, 1, 0x0, 0, 0)
332#define _MX53_PAD_CSI0_DAT4__KPP_COL_5 IOMUX_PAD(0x3FC, 0xD0, 2, 0x840, 1, 0)
333#define _MX53_PAD_CSI0_DAT4__ECSPI1_SCLK IOMUX_PAD(0x3FC, 0xD0, 3, 0x79C, 2, 0)
334#define _MX53_PAD_CSI0_DAT4__USBOH3_USBH3_STP IOMUX_PAD(0x3FC, 0xD0, 4, 0x0, 0, 0)
335#define _MX53_PAD_CSI0_DAT4__AUDMUX_AUD3_TXC IOMUX_PAD(0x3FC, 0xD0, 5, 0x0, 0, 0)
336#define _MX53_PAD_CSI0_DAT4__EMI_EMI_DEBUG_33 IOMUX_PAD(0x3FC, 0xD0, 6, 0x0, 0, 0)
337#define _MX53_PAD_CSI0_DAT4__TPIU_TRACE_1 IOMUX_PAD(0x3FC, 0xD0, 7, 0x0, 0, 0)
338#define _MX53_PAD_CSI0_DAT5__IPU_CSI0_D_5 IOMUX_PAD(0x400, 0xD4, 0, 0x0, 0, 0)
339#define _MX53_PAD_CSI0_DAT5__GPIO5_23 IOMUX_PAD(0x400, 0xD4, 1, 0x0, 0, 0)
340#define _MX53_PAD_CSI0_DAT5__KPP_ROW_5 IOMUX_PAD(0x400, 0xD4, 2, 0x84C, 0, 0)
341#define _MX53_PAD_CSI0_DAT5__ECSPI1_MOSI IOMUX_PAD(0x400, 0xD4, 3, 0x7A4, 2, 0)
342#define _MX53_PAD_CSI0_DAT5__USBOH3_USBH3_NXT IOMUX_PAD(0x400, 0xD4, 4, 0x0, 0, 0)
343#define _MX53_PAD_CSI0_DAT5__AUDMUX_AUD3_TXD IOMUX_PAD(0x400, 0xD4, 5, 0x0, 0, 0)
344#define _MX53_PAD_CSI0_DAT5__EMI_EMI_DEBUG_34 IOMUX_PAD(0x400, 0xD4, 6, 0x0, 0, 0)
345#define _MX53_PAD_CSI0_DAT5__TPIU_TRACE_2 IOMUX_PAD(0x400, 0xD4, 7, 0x0, 0, 0)
346#define _MX53_PAD_CSI0_DAT6__IPU_CSI0_D_6 IOMUX_PAD(0x404, 0xD8, 0, 0x0, 0, 0)
347#define _MX53_PAD_CSI0_DAT6__GPIO5_24 IOMUX_PAD(0x404, 0xD8, 1, 0x0, 0, 0)
348#define _MX53_PAD_CSI0_DAT6__KPP_COL_6 IOMUX_PAD(0x404, 0xD8, 2, 0x844, 0, 0)
349#define _MX53_PAD_CSI0_DAT6__ECSPI1_MISO IOMUX_PAD(0x404, 0xD8, 3, 0x7A0, 2, 0)
350#define _MX53_PAD_CSI0_DAT6__USBOH3_USBH3_CLK IOMUX_PAD(0x404, 0xD8, 4, 0x0, 0, 0)
351#define _MX53_PAD_CSI0_DAT6__AUDMUX_AUD3_TXFS IOMUX_PAD(0x404, 0xD8, 5, 0x0, 0, 0)
352#define _MX53_PAD_CSI0_DAT6__EMI_EMI_DEBUG_35 IOMUX_PAD(0x404, 0xD8, 6, 0x0, 0, 0)
353#define _MX53_PAD_CSI0_DAT6__TPIU_TRACE_3 IOMUX_PAD(0x404, 0xD8, 7, 0x0, 0, 0)
354#define _MX53_PAD_CSI0_DAT7__IPU_CSI0_D_7 IOMUX_PAD(0x408, 0xDC, 0, 0x0, 0, 0)
355#define _MX53_PAD_CSI0_DAT7__GPIO5_25 IOMUX_PAD(0x408, 0xDC, 1, 0x0, 0, 0)
356#define _MX53_PAD_CSI0_DAT7__KPP_ROW_6 IOMUX_PAD(0x408, 0xDC, 2, 0x850, 0, 0)
357#define _MX53_PAD_CSI0_DAT7__ECSPI1_SS0 IOMUX_PAD(0x408, 0xDC, 3, 0x7A8, 2, 0)
358#define _MX53_PAD_CSI0_DAT7__USBOH3_USBH3_DIR IOMUX_PAD(0x408, 0xDC, 4, 0x0, 0, 0)
359#define _MX53_PAD_CSI0_DAT7__AUDMUX_AUD3_RXD IOMUX_PAD(0x408, 0xDC, 5, 0x0, 0, 0)
360#define _MX53_PAD_CSI0_DAT7__EMI_EMI_DEBUG_36 IOMUX_PAD(0x408, 0xDC, 6, 0x0, 0, 0)
361#define _MX53_PAD_CSI0_DAT7__TPIU_TRACE_4 IOMUX_PAD(0x408, 0xDC, 7, 0x0, 0, 0)
362#define _MX53_PAD_CSI0_DAT8__IPU_CSI0_D_8 IOMUX_PAD(0x40C, 0xE0, 0, 0x0, 0, 0)
363#define _MX53_PAD_CSI0_DAT8__GPIO5_26 IOMUX_PAD(0x40C, 0xE0, 1, 0x0, 0, 0)
364#define _MX53_PAD_CSI0_DAT8__KPP_COL_7 IOMUX_PAD(0x40C, 0xE0, 2, 0x848, 0, 0)
365#define _MX53_PAD_CSI0_DAT8__ECSPI2_SCLK IOMUX_PAD(0x40C, 0xE0, 3, 0x7B8, 1, 0)
366#define _MX53_PAD_CSI0_DAT8__USBOH3_USBH3_OC IOMUX_PAD(0x40C, 0xE0, 4, 0x0, 0, 0)
367#define _MX53_PAD_CSI0_DAT8__I2C1_SDA IOMUX_PAD(0x40C, 0xE0, 5 | IOMUX_CONFIG_SION, 0x818, 0, 0)
368#define _MX53_PAD_CSI0_DAT8__EMI_EMI_DEBUG_37 IOMUX_PAD(0x40C, 0xE0, 6, 0x0, 0, 0)
369#define _MX53_PAD_CSI0_DAT8__TPIU_TRACE_5 IOMUX_PAD(0x40C, 0xE0, 7, 0x0, 0, 0)
370#define _MX53_PAD_CSI0_DAT9__IPU_CSI0_D_9 IOMUX_PAD(0x410, 0xE4, 0, 0x0, 0, 0)
371#define _MX53_PAD_CSI0_DAT9__GPIO5_27 IOMUX_PAD(0x410, 0xE4, 1, 0x0, 0, 0)
372#define _MX53_PAD_CSI0_DAT9__KPP_ROW_7 IOMUX_PAD(0x410, 0xE4, 2, 0x854, 0, 0)
373#define _MX53_PAD_CSI0_DAT9__ECSPI2_MOSI IOMUX_PAD(0x410, 0xE4, 3, 0x7C0, 1, 0)
374#define _MX53_PAD_CSI0_DAT9__USBOH3_USBH3_PWR IOMUX_PAD(0x410, 0xE4, 4, 0x0, 0, 0)
375#define _MX53_PAD_CSI0_DAT9__I2C1_SCL IOMUX_PAD(0x410, 0xE4, 5 | IOMUX_CONFIG_SION, 0x814, 0, 0)
376#define _MX53_PAD_CSI0_DAT9__EMI_EMI_DEBUG_38 IOMUX_PAD(0x410, 0xE4, 6, 0x0, 0, 0)
377#define _MX53_PAD_CSI0_DAT9__TPIU_TRACE_6 IOMUX_PAD(0x410, 0xE4, 7, 0x0, 0, 0)
378#define _MX53_PAD_CSI0_DAT10__IPU_CSI0_D_10 IOMUX_PAD(0x414, 0xE8, 0, 0x0, 0, 0)
379#define _MX53_PAD_CSI0_DAT10__GPIO5_28 IOMUX_PAD(0x414, 0xE8, 1, 0x0, 0, 0)
380#define _MX53_PAD_CSI0_DAT10__UART1_TXD_MUX IOMUX_PAD(0x414, 0xE8, 2, 0x878, 0, 0)
381#define _MX53_PAD_CSI0_DAT10__ECSPI2_MISO IOMUX_PAD(0x414, 0xE8, 3, 0x7BC, 1, 0)
382#define _MX53_PAD_CSI0_DAT10__AUDMUX_AUD3_RXC IOMUX_PAD(0x414, 0xE8, 4, 0x0, 0, 0)
383#define _MX53_PAD_CSI0_DAT10__SDMA_DEBUG_PC_4 IOMUX_PAD(0x414, 0xE8, 5, 0x0, 0, 0)
384#define _MX53_PAD_CSI0_DAT10__EMI_EMI_DEBUG_39 IOMUX_PAD(0x414, 0xE8, 6, 0x0, 0, 0)
385#define _MX53_PAD_CSI0_DAT10__TPIU_TRACE_7 IOMUX_PAD(0x414, 0xE8, 7, 0x0, 0, 0)
386#define _MX53_PAD_CSI0_DAT11__IPU_CSI0_D_11 IOMUX_PAD(0x418, 0xEC, 0, 0x0, 0, 0)
387#define _MX53_PAD_CSI0_DAT11__GPIO5_29 IOMUX_PAD(0x418, 0xEC, 1, 0x0, 0, 0)
388#define _MX53_PAD_CSI0_DAT11__UART1_RXD_MUX IOMUX_PAD(0x418, 0xEC, 2, 0x878, 1, 0)
389#define _MX53_PAD_CSI0_DAT11__ECSPI2_SS0 IOMUX_PAD(0x418, 0xEC, 3, 0x7C4, 1, 0)
390#define _MX53_PAD_CSI0_DAT11__AUDMUX_AUD3_RXFS IOMUX_PAD(0x418, 0xEC, 4, 0x0, 0, 0)
391#define _MX53_PAD_CSI0_DAT11__SDMA_DEBUG_PC_5 IOMUX_PAD(0x418, 0xEC, 5, 0x0, 0, 0)
392#define _MX53_PAD_CSI0_DAT11__EMI_EMI_DEBUG_40 IOMUX_PAD(0x418, 0xEC, 6, 0x0, 0, 0)
393#define _MX53_PAD_CSI0_DAT11__TPIU_TRACE_8 IOMUX_PAD(0x418, 0xEC, 7, 0x0, 0, 0)
394#define _MX53_PAD_CSI0_DAT12__IPU_CSI0_D_12 IOMUX_PAD(0x41C, 0xF0, 0, 0x0, 0, 0)
395#define _MX53_PAD_CSI0_DAT12__GPIO5_30 IOMUX_PAD(0x41C, 0xF0, 1, 0x0, 0, 0)
396#define _MX53_PAD_CSI0_DAT12__UART4_TXD_MUX IOMUX_PAD(0x41C, 0xF0, 2, 0x890, 2, 0)
397#define _MX53_PAD_CSI0_DAT12__USBOH3_USBH3_DATA_0 IOMUX_PAD(0x41C, 0xF0, 4, 0x0, 0, 0)
398#define _MX53_PAD_CSI0_DAT12__SDMA_DEBUG_PC_6 IOMUX_PAD(0x41C, 0xF0, 5, 0x0, 0, 0)
399#define _MX53_PAD_CSI0_DAT12__EMI_EMI_DEBUG_41 IOMUX_PAD(0x41C, 0xF0, 6, 0x0, 0, 0)
400#define _MX53_PAD_CSI0_DAT12__TPIU_TRACE_9 IOMUX_PAD(0x41C, 0xF0, 7, 0x0, 0, 0)
401#define _MX53_PAD_CSI0_DAT13__IPU_CSI0_D_13 IOMUX_PAD(0x420, 0xF4, 0, 0x0, 0, 0)
402#define _MX53_PAD_CSI0_DAT13__GPIO5_31 IOMUX_PAD(0x420, 0xF4, 1, 0x0, 0, 0)
403#define _MX53_PAD_CSI0_DAT13__UART4_RXD_MUX IOMUX_PAD(0x420, 0xF4, 2, 0x890, 3, 0)
404#define _MX53_PAD_CSI0_DAT13__USBOH3_USBH3_DATA_1 IOMUX_PAD(0x420, 0xF4, 4, 0x0, 0, 0)
405#define _MX53_PAD_CSI0_DAT13__SDMA_DEBUG_PC_7 IOMUX_PAD(0x420, 0xF4, 5, 0x0, 0, 0)
406#define _MX53_PAD_CSI0_DAT13__EMI_EMI_DEBUG_42 IOMUX_PAD(0x420, 0xF4, 6, 0x0, 0, 0)
407#define _MX53_PAD_CSI0_DAT13__TPIU_TRACE_10 IOMUX_PAD(0x420, 0xF4, 7, 0x0, 0, 0)
408#define _MX53_PAD_CSI0_DAT14__IPU_CSI0_D_14 IOMUX_PAD(0x424, 0xF8, 0, 0x0, 0, 0)
409#define _MX53_PAD_CSI0_DAT14__GPIO6_0 IOMUX_PAD(0x424, 0xF8, 1, 0x0, 0, 0)
410#define _MX53_PAD_CSI0_DAT14__UART5_TXD_MUX IOMUX_PAD(0x424, 0xF8, 2, 0x898, 2, 0)
411#define _MX53_PAD_CSI0_DAT14__USBOH3_USBH3_DATA_2 IOMUX_PAD(0x424, 0xF8, 4, 0x0, 0, 0)
412#define _MX53_PAD_CSI0_DAT14__SDMA_DEBUG_PC_8 IOMUX_PAD(0x424, 0xF8, 5, 0x0, 0, 0)
413#define _MX53_PAD_CSI0_DAT14__EMI_EMI_DEBUG_43 IOMUX_PAD(0x424, 0xF8, 6, 0x0, 0, 0)
414#define _MX53_PAD_CSI0_DAT14__TPIU_TRACE_11 IOMUX_PAD(0x424, 0xF8, 7, 0x0, 0, 0)
415#define _MX53_PAD_CSI0_DAT15__IPU_CSI0_D_15 IOMUX_PAD(0x428, 0xFC, 0, 0x0, 0, 0)
416#define _MX53_PAD_CSI0_DAT15__GPIO6_1 IOMUX_PAD(0x428, 0xFC, 1, 0x0, 0, 0)
417#define _MX53_PAD_CSI0_DAT15__UART5_RXD_MUX IOMUX_PAD(0x428, 0xFC, 2, 0x898, 3, 0)
418#define _MX53_PAD_CSI0_DAT15__USBOH3_USBH3_DATA_3 IOMUX_PAD(0x428, 0xFC, 4, 0x0, 0, 0)
419#define _MX53_PAD_CSI0_DAT15__SDMA_DEBUG_PC_9 IOMUX_PAD(0x428, 0xFC, 5, 0x0, 0, 0)
420#define _MX53_PAD_CSI0_DAT15__EMI_EMI_DEBUG_44 IOMUX_PAD(0x428, 0xFC, 6, 0x0, 0, 0)
421#define _MX53_PAD_CSI0_DAT15__TPIU_TRACE_12 IOMUX_PAD(0x428, 0xFC, 7, 0x0, 0, 0)
422#define _MX53_PAD_CSI0_DAT16__IPU_CSI0_D_16 IOMUX_PAD(0x42C, 0x100, 0, 0x0, 0, 0)
423#define _MX53_PAD_CSI0_DAT16__GPIO6_2 IOMUX_PAD(0x42C, 0x100, 1, 0x0, 0, 0)
424#define _MX53_PAD_CSI0_DAT16__UART4_RTS IOMUX_PAD(0x42C, 0x100, 2, 0x88C, 0, 0)
425#define _MX53_PAD_CSI0_DAT16__USBOH3_USBH3_DATA_4 IOMUX_PAD(0x42C, 0x100, 4, 0x0, 0, 0)
426#define _MX53_PAD_CSI0_DAT16__SDMA_DEBUG_PC_10 IOMUX_PAD(0x42C, 0x100, 5, 0x0, 0, 0)
427#define _MX53_PAD_CSI0_DAT16__EMI_EMI_DEBUG_45 IOMUX_PAD(0x42C, 0x100, 6, 0x0, 0, 0)
428#define _MX53_PAD_CSI0_DAT16__TPIU_TRACE_13 IOMUX_PAD(0x42C, 0x100, 7, 0x0, 0, 0)
429#define _MX53_PAD_CSI0_DAT17__IPU_CSI0_D_17 IOMUX_PAD(0x430, 0x104, 0, 0x0, 0, 0)
430#define _MX53_PAD_CSI0_DAT17__GPIO6_3 IOMUX_PAD(0x430, 0x104, 1, 0x0, 0, 0)
431#define _MX53_PAD_CSI0_DAT17__UART4_CTS IOMUX_PAD(0x430, 0x104, 2, 0x88C, 1, 0)
432#define _MX53_PAD_CSI0_DAT17__USBOH3_USBH3_DATA_5 IOMUX_PAD(0x430, 0x104, 4, 0x0, 0, 0)
433#define _MX53_PAD_CSI0_DAT17__SDMA_DEBUG_PC_11 IOMUX_PAD(0x430, 0x104, 5, 0x0, 0, 0)
434#define _MX53_PAD_CSI0_DAT17__EMI_EMI_DEBUG_46 IOMUX_PAD(0x430, 0x104, 6, 0x0, 0, 0)
435#define _MX53_PAD_CSI0_DAT17__TPIU_TRACE_14 IOMUX_PAD(0x430, 0x104, 7, 0x0, 0, 0)
436#define _MX53_PAD_CSI0_DAT18__IPU_CSI0_D_18 IOMUX_PAD(0x434, 0x108, 0, 0x0, 0, 0)
437#define _MX53_PAD_CSI0_DAT18__GPIO6_4 IOMUX_PAD(0x434, 0x108, 1, 0x0, 0, 0)
438#define _MX53_PAD_CSI0_DAT18__UART5_RTS IOMUX_PAD(0x434, 0x108, 2, 0x894, 2, 0)
439#define _MX53_PAD_CSI0_DAT18__USBOH3_USBH3_DATA_6 IOMUX_PAD(0x434, 0x108, 4, 0x0, 0, 0)
440#define _MX53_PAD_CSI0_DAT18__SDMA_DEBUG_PC_12 IOMUX_PAD(0x434, 0x108, 5, 0x0, 0, 0)
441#define _MX53_PAD_CSI0_DAT18__EMI_EMI_DEBUG_47 IOMUX_PAD(0x434, 0x108, 6, 0x0, 0, 0)
442#define _MX53_PAD_CSI0_DAT18__TPIU_TRACE_15 IOMUX_PAD(0x434, 0x108, 7, 0x0, 0, 0)
443#define _MX53_PAD_CSI0_DAT19__IPU_CSI0_D_19 IOMUX_PAD(0x438, 0x10C, 0, 0x0, 0, 0)
444#define _MX53_PAD_CSI0_DAT19__GPIO6_5 IOMUX_PAD(0x438, 0x10C, 1, 0x0, 0, 0)
445#define _MX53_PAD_CSI0_DAT19__UART5_CTS IOMUX_PAD(0x438, 0x10C, 2, 0x894, 3, 0)
446#define _MX53_PAD_CSI0_DAT19__USBOH3_USBH3_DATA_7 IOMUX_PAD(0x438, 0x10C, 4, 0x0, 0, 0)
447#define _MX53_PAD_CSI0_DAT19__SDMA_DEBUG_PC_13 IOMUX_PAD(0x438, 0x10C, 5, 0x0, 0, 0)
448#define _MX53_PAD_CSI0_DAT19__EMI_EMI_DEBUG_48 IOMUX_PAD(0x438, 0x10C, 6, 0x0, 0, 0)
449#define _MX53_PAD_CSI0_DAT19__USBPHY2_BISTOK IOMUX_PAD(0x438, 0x10C, 7, 0x0, 0, 0)
450#define _MX53_PAD_EIM_A25__EMI_WEIM_A_25 IOMUX_PAD(0x458, 0x110, 0, 0x0, 0, 0)
451#define _MX53_PAD_EIM_A25__GPIO5_2 IOMUX_PAD(0x458, 0x110, 1, 0x0, 0, 0)
452#define _MX53_PAD_EIM_A25__ECSPI2_RDY IOMUX_PAD(0x458, 0x110, 2, 0x0, 0, 0)
453#define _MX53_PAD_EIM_A25__IPU_DI1_PIN12 IOMUX_PAD(0x458, 0x110, 3, 0x0, 0, 0)
454#define _MX53_PAD_EIM_A25__CSPI_SS1 IOMUX_PAD(0x458, 0x110, 4, 0x790, 1, 0)
455#define _MX53_PAD_EIM_A25__IPU_DI0_D1_CS IOMUX_PAD(0x458, 0x110, 6, 0x0, 0, 0)
456#define _MX53_PAD_EIM_A25__USBPHY1_BISTOK IOMUX_PAD(0x458, 0x110, 7, 0x0, 0, 0)
457#define _MX53_PAD_EIM_EB2__EMI_WEIM_EB_2 IOMUX_PAD(0x45C, 0x114, 0, 0x0, 0, 0)
458#define _MX53_PAD_EIM_EB2__GPIO2_30 IOMUX_PAD(0x45C, 0x114, 1, 0x0, 0, 0)
459#define _MX53_PAD_EIM_EB2__CCM_DI1_EXT_CLK IOMUX_PAD(0x45C, 0x114, 2, 0x76C, 0, 0)
460#define _MX53_PAD_EIM_EB2__IPU_SER_DISP1_CS IOMUX_PAD(0x45C, 0x114, 3, 0x0, 0, 0)
461#define _MX53_PAD_EIM_EB2__ECSPI1_SS0 IOMUX_PAD(0x45C, 0x114, 4, 0x7A8, 3, 0)
462#define _MX53_PAD_EIM_EB2__I2C2_SCL IOMUX_PAD(0x45C, 0x114, 5 | IOMUX_CONFIG_SION, 0x81C, 1, 0)
463#define _MX53_PAD_EIM_D16__EMI_WEIM_D_16 IOMUX_PAD(0x460, 0x118, 0, 0x0, 0, 0)
464#define _MX53_PAD_EIM_D16__GPIO3_16 IOMUX_PAD(0x460, 0x118, 1, 0x0, 0, 0)
465#define _MX53_PAD_EIM_D16__IPU_DI0_PIN5 IOMUX_PAD(0x460, 0x118, 2, 0x0, 0, 0)
466#define _MX53_PAD_EIM_D16__IPU_DISPB1_SER_CLK IOMUX_PAD(0x460, 0x118, 3, 0x0, 0, 0)
467#define _MX53_PAD_EIM_D16__ECSPI1_SCLK IOMUX_PAD(0x460, 0x118, 4, 0x79C, 3, 0)
468#define _MX53_PAD_EIM_D16__I2C2_SDA IOMUX_PAD(0x460, 0x118, 5, 0x820, 1, 0)
469#define _MX53_PAD_EIM_D17__EMI_WEIM_D_17 IOMUX_PAD(0x464, 0x11C, 0, 0x0, 0, 0)
470#define _MX53_PAD_EIM_D17__GPIO3_17 IOMUX_PAD(0x464, 0x11C, 1, 0x0, 0, 0)
471#define _MX53_PAD_EIM_D17__IPU_DI0_PIN6 IOMUX_PAD(0x464, 0x11C, 2, 0x0, 0, 0)
472#define _MX53_PAD_EIM_D17__IPU_DISPB1_SER_DIN IOMUX_PAD(0x464, 0x11C, 3, 0x830, 0, 0)
473#define _MX53_PAD_EIM_D17__ECSPI1_MISO IOMUX_PAD(0x464, 0x11C, 4, 0x7A0, 3, 0)
474#define _MX53_PAD_EIM_D17__I2C3_SCL IOMUX_PAD(0x464, 0x11C, 5, 0x824, 0, 0)
475#define _MX53_PAD_EIM_D18__EMI_WEIM_D_18 IOMUX_PAD(0x468, 0x120, 0, 0x0, 0, 0)
476#define _MX53_PAD_EIM_D18__GPIO3_18 IOMUX_PAD(0x468, 0x120, 1, 0x0, 0, 0)
477#define _MX53_PAD_EIM_D18__IPU_DI0_PIN7 IOMUX_PAD(0x468, 0x120, 2, 0x0, 0, 0)
478#define _MX53_PAD_EIM_D18__IPU_DISPB1_SER_DIO IOMUX_PAD(0x468, 0x120, 3, 0x830, 1, 0)
479#define _MX53_PAD_EIM_D18__ECSPI1_MOSI IOMUX_PAD(0x468, 0x120, 4, 0x7A4, 3, 0)
480#define _MX53_PAD_EIM_D18__I2C3_SDA IOMUX_PAD(0x468, 0x120, 5, 0x828, 0, 0)
481#define _MX53_PAD_EIM_D18__IPU_DI1_D0_CS IOMUX_PAD(0x468, 0x120, 6, 0x0, 0, 0)
482#define _MX53_PAD_EIM_D19__EMI_WEIM_D_19 IOMUX_PAD(0x46C, 0x124, 0, 0x0, 0, 0)
483#define _MX53_PAD_EIM_D19__GPIO3_19 IOMUX_PAD(0x46C, 0x124, 1, 0x0, 0, 0)
484#define _MX53_PAD_EIM_D19__IPU_DI0_PIN8 IOMUX_PAD(0x46C, 0x124, 2, 0x0, 0, 0)
485#define _MX53_PAD_EIM_D19__IPU_DISPB1_SER_RS IOMUX_PAD(0x46C, 0x124, 3, 0x0, 0, 0)
486#define _MX53_PAD_EIM_D19__ECSPI1_SS1 IOMUX_PAD(0x46C, 0x124, 4, 0x7AC, 2, 0)
487#define _MX53_PAD_EIM_D19__EPIT1_EPITO IOMUX_PAD(0x46C, 0x124, 5, 0x0, 0, 0)
488#define _MX53_PAD_EIM_D19__UART1_CTS IOMUX_PAD(0x46C, 0x124, 6, 0x874, 0, 0)
489#define _MX53_PAD_EIM_D19__USBOH3_USBH2_OC IOMUX_PAD(0x46C, 0x124, 7, 0x8A4, 0, 0)
490#define _MX53_PAD_EIM_D20__EMI_WEIM_D_20 IOMUX_PAD(0x470, 0x128, 0, 0x0, 0, 0)
491#define _MX53_PAD_EIM_D20__GPIO3_20 IOMUX_PAD(0x470, 0x128, 1, 0x0, 0, 0)
492#define _MX53_PAD_EIM_D20__IPU_DI0_PIN16 IOMUX_PAD(0x470, 0x128, 2, 0x0, 0, 0)
493#define _MX53_PAD_EIM_D20__IPU_SER_DISP0_CS IOMUX_PAD(0x470, 0x128, 3, 0x0, 0, 0)
494#define _MX53_PAD_EIM_D20__CSPI_SS0 IOMUX_PAD(0x470, 0x128, 4, 0x78C, 1, 0)
495#define _MX53_PAD_EIM_D20__EPIT2_EPITO IOMUX_PAD(0x470, 0x128, 5, 0x0, 0, 0)
496#define _MX53_PAD_EIM_D20__UART1_RTS IOMUX_PAD(0x470, 0x128, 6, 0x874, 1, 0)
497#define _MX53_PAD_EIM_D20__USBOH3_USBH2_PWR IOMUX_PAD(0x470, 0x128, 7, 0x0, 0, 0)
498#define _MX53_PAD_EIM_D21__EMI_WEIM_D_21 IOMUX_PAD(0x474, 0x12C, 0, 0x0, 0, 0)
499#define _MX53_PAD_EIM_D21__GPIO3_21 IOMUX_PAD(0x474, 0x12C, 1, 0x0, 0, 0)
500#define _MX53_PAD_EIM_D21__IPU_DI0_PIN17 IOMUX_PAD(0x474, 0x12C, 2, 0x0, 0, 0)
501#define _MX53_PAD_EIM_D21__IPU_DISPB0_SER_CLK IOMUX_PAD(0x474, 0x12C, 3, 0x0, 0, 0)
502#define _MX53_PAD_EIM_D21__CSPI_SCLK IOMUX_PAD(0x474, 0x12C, 4, 0x780, 1, 0)
503#define _MX53_PAD_EIM_D21__I2C1_SCL IOMUX_PAD(0x474, 0x12C, 5, 0x814, 1, 0)
504#define _MX53_PAD_EIM_D21__USBOH3_USBOTG_OC IOMUX_PAD(0x474, 0x12C, 6, 0x89C, 1, 0)
505#define _MX53_PAD_EIM_D22__EMI_WEIM_D_22 IOMUX_PAD(0x478, 0x130, 0, 0x0, 0, 0)
506#define _MX53_PAD_EIM_D22__GPIO3_22 IOMUX_PAD(0x478, 0x130, 1, 0x0, 0, 0)
507#define _MX53_PAD_EIM_D22__IPU_DI0_PIN1 IOMUX_PAD(0x478, 0x130, 2, 0x0, 0, 0)
508#define _MX53_PAD_EIM_D22__IPU_DISPB0_SER_DIN IOMUX_PAD(0x478, 0x130, 3, 0x82C, 0, 0)
509#define _MX53_PAD_EIM_D22__CSPI_MISO IOMUX_PAD(0x478, 0x130, 4, 0x784, 1, 0)
510#define _MX53_PAD_EIM_D22__USBOH3_USBOTG_PWR IOMUX_PAD(0x478, 0x130, 6, 0x0, 0, 0)
511#define _MX53_PAD_EIM_D23__EMI_WEIM_D_23 IOMUX_PAD(0x47C, 0x134, 0, 0x0, 0, 0)
512#define _MX53_PAD_EIM_D23__GPIO3_23 IOMUX_PAD(0x47C, 0x134, 1, 0x0, 0, 0)
513#define _MX53_PAD_EIM_D23__UART3_CTS IOMUX_PAD(0x47C, 0x134, 2, 0x884, 0, 0)
514#define _MX53_PAD_EIM_D23__UART1_DCD IOMUX_PAD(0x47C, 0x134, 3, 0x0, 0, 0)
515#define _MX53_PAD_EIM_D23__IPU_DI0_D0_CS IOMUX_PAD(0x47C, 0x134, 4, 0x0, 0, 0)
516#define _MX53_PAD_EIM_D23__IPU_DI1_PIN2 IOMUX_PAD(0x47C, 0x134, 5, 0x0, 0, 0)
517#define _MX53_PAD_EIM_D23__IPU_CSI1_DATA_EN IOMUX_PAD(0x47C, 0x134, 6, 0x834, 0, 0)
518#define _MX53_PAD_EIM_D23__IPU_DI1_PIN14 IOMUX_PAD(0x47C, 0x134, 7, 0x0, 0, 0)
519#define _MX53_PAD_EIM_EB3__EMI_WEIM_EB_3 IOMUX_PAD(0x480, 0x138, 0, 0x0, 0, 0)
520#define _MX53_PAD_EIM_EB3__GPIO2_31 IOMUX_PAD(0x480, 0x138, 1, 0x0, 0, 0)
521#define _MX53_PAD_EIM_EB3__UART3_RTS IOMUX_PAD(0x480, 0x138, 2, 0x884, 1, 0)
522#define _MX53_PAD_EIM_EB3__UART1_RI IOMUX_PAD(0x480, 0x138, 3, 0x0, 0, 0)
523#define _MX53_PAD_EIM_EB3__IPU_DI1_PIN3 IOMUX_PAD(0x480, 0x138, 5, 0x0, 0, 0)
524#define _MX53_PAD_EIM_EB3__IPU_CSI1_HSYNC IOMUX_PAD(0x480, 0x138, 6, 0x838, 0, 0)
525#define _MX53_PAD_EIM_EB3__IPU_DI1_PIN16 IOMUX_PAD(0x480, 0x138, 7, 0x0, 0, 0)
526#define _MX53_PAD_EIM_D24__EMI_WEIM_D_24 IOMUX_PAD(0x484, 0x13C, 0, 0x0, 0, 0)
527#define _MX53_PAD_EIM_D24__GPIO3_24 IOMUX_PAD(0x484, 0x13C, 1, 0x0, 0, 0)
528#define _MX53_PAD_EIM_D24__UART3_TXD_MUX IOMUX_PAD(0x484, 0x13C, 2, 0x888, 0, 0)
529#define _MX53_PAD_EIM_D24__ECSPI1_SS2 IOMUX_PAD(0x484, 0x13C, 3, 0x7B0, 1, 0)
530#define _MX53_PAD_EIM_D24__CSPI_SS2 IOMUX_PAD(0x484, 0x13C, 4, 0x794, 1, 0)
531#define _MX53_PAD_EIM_D24__AUDMUX_AUD5_RXFS IOMUX_PAD(0x484, 0x13C, 5, 0x754, 1, 0)
532#define _MX53_PAD_EIM_D24__ECSPI2_SS2 IOMUX_PAD(0x484, 0x13C, 6, 0x0, 0, 0)
533#define _MX53_PAD_EIM_D24__UART1_DTR IOMUX_PAD(0x484, 0x13C, 7, 0x0, 0, 0)
534#define _MX53_PAD_EIM_D25__EMI_WEIM_D_25 IOMUX_PAD(0x488, 0x140, 0, 0x0, 0, 0)
535#define _MX53_PAD_EIM_D25__GPIO3_25 IOMUX_PAD(0x488, 0x140, 1, 0x0, 0, 0)
536#define _MX53_PAD_EIM_D25__UART3_RXD_MUX IOMUX_PAD(0x488, 0x140, 2, 0x888, 1, 0)
537#define _MX53_PAD_EIM_D25__ECSPI1_SS3 IOMUX_PAD(0x488, 0x140, 3, 0x7B4, 1, 0)
538#define _MX53_PAD_EIM_D25__CSPI_SS3 IOMUX_PAD(0x488, 0x140, 4, 0x798, 1, 0)
539#define _MX53_PAD_EIM_D25__AUDMUX_AUD5_RXC IOMUX_PAD(0x488, 0x140, 5, 0x750, 1, 0)
540#define _MX53_PAD_EIM_D25__ECSPI2_SS3 IOMUX_PAD(0x488, 0x140, 6, 0x0, 0, 0)
541#define _MX53_PAD_EIM_D25__UART1_DSR IOMUX_PAD(0x488, 0x140, 7, 0x0, 0, 0)
542#define _MX53_PAD_EIM_D26__EMI_WEIM_D_26 IOMUX_PAD(0x48C, 0x144, 0, 0x0, 0, 0)
543#define _MX53_PAD_EIM_D26__GPIO3_26 IOMUX_PAD(0x48C, 0x144, 1, 0x0, 0, 0)
544#define _MX53_PAD_EIM_D26__UART2_TXD_MUX IOMUX_PAD(0x48C, 0x144, 2, 0x880, 0, 0)
545#define _MX53_PAD_EIM_D26__FIRI_RXD IOMUX_PAD(0x48C, 0x144, 3, 0x80C, 0, 0)
546#define _MX53_PAD_EIM_D26__IPU_CSI0_D_1 IOMUX_PAD(0x48C, 0x144, 4, 0x0, 0, 0)
547#define _MX53_PAD_EIM_D26__IPU_DI1_PIN11 IOMUX_PAD(0x48C, 0x144, 5, 0x0, 0, 0)
548#define _MX53_PAD_EIM_D26__IPU_SISG_2 IOMUX_PAD(0x48C, 0x144, 6, 0x0, 0, 0)
549#define _MX53_PAD_EIM_D26__IPU_DISP1_DAT_22 IOMUX_PAD(0x48C, 0x144, 7, 0x0, 0, 0)
550#define _MX53_PAD_EIM_D27__EMI_WEIM_D_27 IOMUX_PAD(0x490, 0x148, 0, 0x0, 0, 0)
551#define _MX53_PAD_EIM_D27__GPIO3_27 IOMUX_PAD(0x490, 0x148, 1, 0x0, 0, 0)
552#define _MX53_PAD_EIM_D27__UART2_RXD_MUX IOMUX_PAD(0x490, 0x148, 2, 0x880, 1, 0)
553#define _MX53_PAD_EIM_D27__FIRI_TXD IOMUX_PAD(0x490, 0x148, 3, 0x0, 0, 0)
554#define _MX53_PAD_EIM_D27__IPU_CSI0_D_0 IOMUX_PAD(0x490, 0x148, 4, 0x0, 0, 0)
555#define _MX53_PAD_EIM_D27__IPU_DI1_PIN13 IOMUX_PAD(0x490, 0x148, 5, 0x0, 0, 0)
556#define _MX53_PAD_EIM_D27__IPU_SISG_3 IOMUX_PAD(0x490, 0x148, 6, 0x0, 0, 0)
557#define _MX53_PAD_EIM_D27__IPU_DISP1_DAT_23 IOMUX_PAD(0x490, 0x148, 7, 0x0, 0, 0)
558#define _MX53_PAD_EIM_D28__EMI_WEIM_D_28 IOMUX_PAD(0x494, 0x14C, 0, 0x0, 0, 0)
559#define _MX53_PAD_EIM_D28__GPIO3_28 IOMUX_PAD(0x494, 0x14C, 1, 0x0, 0, 0)
560#define _MX53_PAD_EIM_D28__UART2_CTS IOMUX_PAD(0x494, 0x14C, 2, 0x87C, 0, 0)
561#define _MX53_PAD_EIM_D28__IPU_DISPB0_SER_DIO IOMUX_PAD(0x494, 0x14C, 3, 0x82C, 1, 0)
562#define _MX53_PAD_EIM_D28__CSPI_MOSI IOMUX_PAD(0x494, 0x14C, 4, 0x788, 1, 0)
563#define _MX53_PAD_EIM_D28__I2C1_SDA IOMUX_PAD(0x494, 0x14C, 5, 0x818, 1, 0)
564#define _MX53_PAD_EIM_D28__IPU_EXT_TRIG IOMUX_PAD(0x494, 0x14C, 6, 0x0, 0, 0)
565#define _MX53_PAD_EIM_D28__IPU_DI0_PIN13 IOMUX_PAD(0x494, 0x14C, 7, 0x0, 0, 0)
566#define _MX53_PAD_EIM_D29__EMI_WEIM_D_29 IOMUX_PAD(0x498, 0x150, 0, 0x0, 0, 0)
567#define _MX53_PAD_EIM_D29__GPIO3_29 IOMUX_PAD(0x498, 0x150, 1, 0x0, 0, 0)
568#define _MX53_PAD_EIM_D29__UART2_RTS IOMUX_PAD(0x498, 0x150, 2, 0x87C, 1, 0)
569#define _MX53_PAD_EIM_D29__IPU_DISPB0_SER_RS IOMUX_PAD(0x498, 0x150, 3, 0x0, 0, 0)
570#define _MX53_PAD_EIM_D29__CSPI_SS0 IOMUX_PAD(0x498, 0x150, 4, 0x78C, 2, 0)
571#define _MX53_PAD_EIM_D29__IPU_DI1_PIN15 IOMUX_PAD(0x498, 0x150, 5, 0x0, 0, 0)
572#define _MX53_PAD_EIM_D29__IPU_CSI1_VSYNC IOMUX_PAD(0x498, 0x150, 6, 0x83C, 0, 0)
573#define _MX53_PAD_EIM_D29__IPU_DI0_PIN14 IOMUX_PAD(0x498, 0x150, 7, 0x0, 0, 0)
574#define _MX53_PAD_EIM_D30__EMI_WEIM_D_30 IOMUX_PAD(0x49C, 0x154, 0, 0x0, 0, 0)
575#define _MX53_PAD_EIM_D30__GPIO3_30 IOMUX_PAD(0x49C, 0x154, 1, 0x0, 0, 0)
576#define _MX53_PAD_EIM_D30__UART3_CTS IOMUX_PAD(0x49C, 0x154, 2, 0x884, 2, 0)
577#define _MX53_PAD_EIM_D30__IPU_CSI0_D_3 IOMUX_PAD(0x49C, 0x154, 3, 0x0, 0, 0)
578#define _MX53_PAD_EIM_D30__IPU_DI0_PIN11 IOMUX_PAD(0x49C, 0x154, 4, 0x0, 0, 0)
579#define _MX53_PAD_EIM_D30__IPU_DISP1_DAT_21 IOMUX_PAD(0x49C, 0x154, 5, 0x0, 0, 0)
580#define _MX53_PAD_EIM_D30__USBOH3_USBH1_OC IOMUX_PAD(0x49C, 0x154, 6, 0x8A0, 0, 0)
581#define _MX53_PAD_EIM_D30__USBOH3_USBH2_OC IOMUX_PAD(0x49C, 0x154, 7, 0x8A4, 1, 0)
582#define _MX53_PAD_EIM_D31__EMI_WEIM_D_31 IOMUX_PAD(0x4A0, 0x158, 0, 0x0, 0, 0)
583#define _MX53_PAD_EIM_D31__GPIO3_31 IOMUX_PAD(0x4A0, 0x158, 1, 0x0, 0, 0)
584#define _MX53_PAD_EIM_D31__UART3_RTS IOMUX_PAD(0x4A0, 0x158, 2, 0x884, 3, 0)
585#define _MX53_PAD_EIM_D31__IPU_CSI0_D_2 IOMUX_PAD(0x4A0, 0x158, 3, 0x0, 0, 0)
586#define _MX53_PAD_EIM_D31__IPU_DI0_PIN12 IOMUX_PAD(0x4A0, 0x158, 4, 0x0, 0, 0)
587#define _MX53_PAD_EIM_D31__IPU_DISP1_DAT_20 IOMUX_PAD(0x4A0, 0x158, 5, 0x0, 0, 0)
588#define _MX53_PAD_EIM_D31__USBOH3_USBH1_PWR IOMUX_PAD(0x4A0, 0x158, 6, 0x0, 0, 0)
589#define _MX53_PAD_EIM_D31__USBOH3_USBH2_PWR IOMUX_PAD(0x4A0, 0x158, 7, 0x0, 0, 0)
590#define _MX53_PAD_EIM_A24__EMI_WEIM_A_24 IOMUX_PAD(0x4A8, 0x15C, 0, 0x0, 0, 0)
591#define _MX53_PAD_EIM_A24__GPIO5_4 IOMUX_PAD(0x4A8, 0x15C, 1, 0x0, 0, 0)
592#define _MX53_PAD_EIM_A24__IPU_DISP1_DAT_19 IOMUX_PAD(0x4A8, 0x15C, 2, 0x0, 0, 0)
593#define _MX53_PAD_EIM_A24__IPU_CSI1_D_19 IOMUX_PAD(0x4A8, 0x15C, 3, 0x0, 0, 0)
594#define _MX53_PAD_EIM_A24__IPU_SISG_2 IOMUX_PAD(0x4A8, 0x15C, 6, 0x0, 0, 0)
595#define _MX53_PAD_EIM_A24__USBPHY2_BVALID IOMUX_PAD(0x4A8, 0x15C, 7, 0x0, 0, 0)
596#define _MX53_PAD_EIM_A23__EMI_WEIM_A_23 IOMUX_PAD(0x4AC, 0x160, 0, 0x0, 0, 0)
597#define _MX53_PAD_EIM_A23__GPIO6_6 IOMUX_PAD(0x4AC, 0x160, 1, 0x0, 0, 0)
598#define _MX53_PAD_EIM_A23__IPU_DISP1_DAT_18 IOMUX_PAD(0x4AC, 0x160, 2, 0x0, 0, 0)
599#define _MX53_PAD_EIM_A23__IPU_CSI1_D_18 IOMUX_PAD(0x4AC, 0x160, 3, 0x0, 0, 0)
600#define _MX53_PAD_EIM_A23__IPU_SISG_3 IOMUX_PAD(0x4AC, 0x160, 6, 0x0, 0, 0)
601#define _MX53_PAD_EIM_A23__USBPHY2_ENDSESSION IOMUX_PAD(0x4AC, 0x160, 7, 0x0, 0, 0)
602#define _MX53_PAD_EIM_A22__EMI_WEIM_A_22 IOMUX_PAD(0x4B0, 0x164, 0, 0x0, 0, 0)
603#define _MX53_PAD_EIM_A22__GPIO2_16 IOMUX_PAD(0x4B0, 0x164, 1, 0x0, 0, 0)
604#define _MX53_PAD_EIM_A22__IPU_DISP1_DAT_17 IOMUX_PAD(0x4B0, 0x164, 2, 0x0, 0, 0)
605#define _MX53_PAD_EIM_A22__IPU_CSI1_D_17 IOMUX_PAD(0x4B0, 0x164, 3, 0x0, 0, 0)
606#define _MX53_PAD_EIM_A22__SRC_BT_CFG1_7 IOMUX_PAD(0x4B0, 0x164, 7, 0x0, 0, 0)
607#define _MX53_PAD_EIM_A21__EMI_WEIM_A_21 IOMUX_PAD(0x4B4, 0x168, 0, 0x0, 0, 0)
608#define _MX53_PAD_EIM_A21__GPIO2_17 IOMUX_PAD(0x4B4, 0x168, 1, 0x0, 0, 0)
609#define _MX53_PAD_EIM_A21__IPU_DISP1_DAT_16 IOMUX_PAD(0x4B4, 0x168, 2, 0x0, 0, 0)
610#define _MX53_PAD_EIM_A21__IPU_CSI1_D_16 IOMUX_PAD(0x4B4, 0x168, 3, 0x0, 0, 0)
611#define _MX53_PAD_EIM_A21__SRC_BT_CFG1_6 IOMUX_PAD(0x4B4, 0x168, 7, 0x0, 0, 0)
612#define _MX53_PAD_EIM_A20__EMI_WEIM_A_20 IOMUX_PAD(0x4B8, 0x16C, 0, 0x0, 0, 0)
613#define _MX53_PAD_EIM_A20__GPIO2_18 IOMUX_PAD(0x4B8, 0x16C, 1, 0x0, 0, 0)
614#define _MX53_PAD_EIM_A20__IPU_DISP1_DAT_15 IOMUX_PAD(0x4B8, 0x16C, 2, 0x0, 0, 0)
615#define _MX53_PAD_EIM_A20__IPU_CSI1_D_15 IOMUX_PAD(0x4B8, 0x16C, 3, 0x0, 0, 0)
616#define _MX53_PAD_EIM_A20__SRC_BT_CFG1_5 IOMUX_PAD(0x4B8, 0x16C, 7, 0x0, 0, 0)
617#define _MX53_PAD_EIM_A19__EMI_WEIM_A_19 IOMUX_PAD(0x4BC, 0x170, 0, 0x0, 0, 0)
618#define _MX53_PAD_EIM_A19__GPIO2_19 IOMUX_PAD(0x4BC, 0x170, 1, 0x0, 0, 0)
619#define _MX53_PAD_EIM_A19__IPU_DISP1_DAT_14 IOMUX_PAD(0x4BC, 0x170, 2, 0x0, 0, 0)
620#define _MX53_PAD_EIM_A19__IPU_CSI1_D_14 IOMUX_PAD(0x4BC, 0x170, 3, 0x0, 0, 0)
621#define _MX53_PAD_EIM_A19__SRC_BT_CFG1_4 IOMUX_PAD(0x4BC, 0x170, 7, 0x0, 0, 0)
622#define _MX53_PAD_EIM_A18__EMI_WEIM_A_18 IOMUX_PAD(0x4C0, 0x174, 0, 0x0, 0, 0)
623#define _MX53_PAD_EIM_A18__GPIO2_20 IOMUX_PAD(0x4C0, 0x174, 1, 0x0, 0, 0)
624#define _MX53_PAD_EIM_A18__IPU_DISP1_DAT_13 IOMUX_PAD(0x4C0, 0x174, 2, 0x0, 0, 0)
625#define _MX53_PAD_EIM_A18__IPU_CSI1_D_13 IOMUX_PAD(0x4C0, 0x174, 3, 0x0, 0, 0)
626#define _MX53_PAD_EIM_A18__SRC_BT_CFG1_3 IOMUX_PAD(0x4C0, 0x174, 7, 0x0, 0, 0)
627#define _MX53_PAD_EIM_A17__EMI_WEIM_A_17 IOMUX_PAD(0x4C4, 0x178, 0, 0x0, 0, 0)
628#define _MX53_PAD_EIM_A17__GPIO2_21 IOMUX_PAD(0x4C4, 0x178, 1, 0x0, 0, 0)
629#define _MX53_PAD_EIM_A17__IPU_DISP1_DAT_12 IOMUX_PAD(0x4C4, 0x178, 2, 0x0, 0, 0)
630#define _MX53_PAD_EIM_A17__IPU_CSI1_D_12 IOMUX_PAD(0x4C4, 0x178, 3, 0x0, 0, 0)
631#define _MX53_PAD_EIM_A17__SRC_BT_CFG1_2 IOMUX_PAD(0x4C4, 0x178, 7, 0x0, 0, 0)
632#define _MX53_PAD_EIM_A16__EMI_WEIM_A_16 IOMUX_PAD(0x4C8, 0x17C, 0, 0x0, 0, 0)
633#define _MX53_PAD_EIM_A16__GPIO2_22 IOMUX_PAD(0x4C8, 0x17C, 1, 0x0, 0, 0)
634#define _MX53_PAD_EIM_A16__IPU_DI1_DISP_CLK IOMUX_PAD(0x4C8, 0x17C, 2, 0x0, 0, 0)
635#define _MX53_PAD_EIM_A16__IPU_CSI1_PIXCLK IOMUX_PAD(0x4C8, 0x17C, 3, 0x0, 0, 0)
636#define _MX53_PAD_EIM_A16__SRC_BT_CFG1_1 IOMUX_PAD(0x4C8, 0x17C, 7, 0x0, 0, 0)
637#define _MX53_PAD_EIM_CS0__EMI_WEIM_CS_0 IOMUX_PAD(0x4CC, 0x180, 0, 0x0, 0, 0)
638#define _MX53_PAD_EIM_CS0__GPIO2_23 IOMUX_PAD(0x4CC, 0x180, 1, 0x0, 0, 0)
639#define _MX53_PAD_EIM_CS0__ECSPI2_SCLK IOMUX_PAD(0x4CC, 0x180, 2, 0x7B8, 2, 0)
640#define _MX53_PAD_EIM_CS0__IPU_DI1_PIN5 IOMUX_PAD(0x4CC, 0x180, 3, 0x0, 0, 0)
641#define _MX53_PAD_EIM_CS1__EMI_WEIM_CS_1 IOMUX_PAD(0x4D0, 0x184, 0, 0x0, 0, 0)
642#define _MX53_PAD_EIM_CS1__GPIO2_24 IOMUX_PAD(0x4D0, 0x184, 1, 0x0, 0, 0)
643#define _MX53_PAD_EIM_CS1__ECSPI2_MOSI IOMUX_PAD(0x4D0, 0x184, 2, 0x7C0, 2, 0)
644#define _MX53_PAD_EIM_CS1__IPU_DI1_PIN6 IOMUX_PAD(0x4D0, 0x184, 3, 0x0, 0, 0)
645#define _MX53_PAD_EIM_OE__EMI_WEIM_OE IOMUX_PAD(0x4D4, 0x188, 0, 0x0, 0, 0)
646#define _MX53_PAD_EIM_OE__GPIO2_25 IOMUX_PAD(0x4D4, 0x188, 1, 0x0, 0, 0)
647#define _MX53_PAD_EIM_OE__ECSPI2_MISO IOMUX_PAD(0x4D4, 0x188, 2, 0x7BC, 2, 0)
648#define _MX53_PAD_EIM_OE__IPU_DI1_PIN7 IOMUX_PAD(0x4D4, 0x188, 3, 0x0, 0, 0)
649#define _MX53_PAD_EIM_OE__USBPHY2_IDDIG IOMUX_PAD(0x4D4, 0x188, 7, 0x0, 0, 0)
650#define _MX53_PAD_EIM_RW__EMI_WEIM_RW IOMUX_PAD(0x4D8, 0x18C, 0, 0x0, 0, 0)
651#define _MX53_PAD_EIM_RW__GPIO2_26 IOMUX_PAD(0x4D8, 0x18C, 1, 0x0, 0, 0)
652#define _MX53_PAD_EIM_RW__ECSPI2_SS0 IOMUX_PAD(0x4D8, 0x18C, 2, 0x7C4, 2, 0)
653#define _MX53_PAD_EIM_RW__IPU_DI1_PIN8 IOMUX_PAD(0x4D8, 0x18C, 3, 0x0, 0, 0)
654#define _MX53_PAD_EIM_RW__USBPHY2_HOSTDISCONNECT IOMUX_PAD(0x4D8, 0x18C, 7, 0x0, 0, 0)
655#define _MX53_PAD_EIM_LBA__EMI_WEIM_LBA IOMUX_PAD(0x4DC, 0x190, 0, 0x0, 0, 0)
656#define _MX53_PAD_EIM_LBA__GPIO2_27 IOMUX_PAD(0x4DC, 0x190, 1, 0x0, 0, 0)
657#define _MX53_PAD_EIM_LBA__ECSPI2_SS1 IOMUX_PAD(0x4DC, 0x190, 2, 0x7C8, 1, 0)
658#define _MX53_PAD_EIM_LBA__IPU_DI1_PIN17 IOMUX_PAD(0x4DC, 0x190, 3, 0x0, 0, 0)
659#define _MX53_PAD_EIM_LBA__SRC_BT_CFG1_0 IOMUX_PAD(0x4DC, 0x190, 7, 0x0, 0, 0)
660#define _MX53_PAD_EIM_EB0__EMI_WEIM_EB_0 IOMUX_PAD(0x4E4, 0x194, 0, 0x0, 0, 0)
661#define _MX53_PAD_EIM_EB0__GPIO2_28 IOMUX_PAD(0x4E4, 0x194, 1, 0x0, 0, 0)
662#define _MX53_PAD_EIM_EB0__IPU_DISP1_DAT_11 IOMUX_PAD(0x4E4, 0x194, 3, 0x0, 0, 0)
663#define _MX53_PAD_EIM_EB0__IPU_CSI1_D_11 IOMUX_PAD(0x4E4, 0x194, 4, 0x0, 0, 0)
664#define _MX53_PAD_EIM_EB0__GPC_PMIC_RDY IOMUX_PAD(0x4E4, 0x194, 5, 0x810, 0, 0)
665#define _MX53_PAD_EIM_EB0__SRC_BT_CFG2_7 IOMUX_PAD(0x4E4, 0x194, 7, 0x0, 0, 0)
666#define _MX53_PAD_EIM_EB1__EMI_WEIM_EB_1 IOMUX_PAD(0x4E8, 0x198, 0, 0x0, 0, 0)
667#define _MX53_PAD_EIM_EB1__GPIO2_29 IOMUX_PAD(0x4E8, 0x198, 1, 0x0, 0, 0)
668#define _MX53_PAD_EIM_EB1__IPU_DISP1_DAT_10 IOMUX_PAD(0x4E8, 0x198, 3, 0x0, 0, 0)
669#define _MX53_PAD_EIM_EB1__IPU_CSI1_D_10 IOMUX_PAD(0x4E8, 0x198, 4, 0x0, 0, 0)
670#define _MX53_PAD_EIM_EB1__SRC_BT_CFG2_6 IOMUX_PAD(0x4E8, 0x198, 7, 0x0, 0, 0)
671#define _MX53_PAD_EIM_DA0__EMI_NAND_WEIM_DA_0 IOMUX_PAD(0x4EC, 0x19C, 0, 0x0, 0, 0)
672#define _MX53_PAD_EIM_DA0__GPIO3_0 IOMUX_PAD(0x4EC, 0x19C, 1, 0x0, 0, 0)
673#define _MX53_PAD_EIM_DA0__IPU_DISP1_DAT_9 IOMUX_PAD(0x4EC, 0x19C, 3, 0x0, 0, 0)
674#define _MX53_PAD_EIM_DA0__IPU_CSI1_D_9 IOMUX_PAD(0x4EC, 0x19C, 4, 0x0, 0, 0)
675#define _MX53_PAD_EIM_DA0__SRC_BT_CFG2_5 IOMUX_PAD(0x4EC, 0x19C, 7, 0x0, 0, 0)
676#define _MX53_PAD_EIM_DA1__EMI_NAND_WEIM_DA_1 IOMUX_PAD(0x4F0, 0x1A0, 0, 0x0, 0, 0)
677#define _MX53_PAD_EIM_DA1__GPIO3_1 IOMUX_PAD(0x4F0, 0x1A0, 1, 0x0, 0, 0)
678#define _MX53_PAD_EIM_DA1__IPU_DISP1_DAT_8 IOMUX_PAD(0x4F0, 0x1A0, 3, 0x0, 0, 0)
679#define _MX53_PAD_EIM_DA1__IPU_CSI1_D_8 IOMUX_PAD(0x4F0, 0x1A0, 4, 0x0, 0, 0)
680#define _MX53_PAD_EIM_DA1__SRC_BT_CFG2_4 IOMUX_PAD(0x4F0, 0x1A0, 7, 0x0, 0, 0)
681#define _MX53_PAD_EIM_DA2__EMI_NAND_WEIM_DA_2 IOMUX_PAD(0x4F4, 0x1A4, 0, 0x0, 0, 0)
682#define _MX53_PAD_EIM_DA2__GPIO3_2 IOMUX_PAD(0x4F4, 0x1A4, 1, 0x0, 0, 0)
683#define _MX53_PAD_EIM_DA2__IPU_DISP1_DAT_7 IOMUX_PAD(0x4F4, 0x1A4, 3, 0x0, 0, 0)
684#define _MX53_PAD_EIM_DA2__IPU_CSI1_D_7 IOMUX_PAD(0x4F4, 0x1A4, 4, 0x0, 0, 0)
685#define _MX53_PAD_EIM_DA2__SRC_BT_CFG2_3 IOMUX_PAD(0x4F4, 0x1A4, 7, 0x0, 0, 0)
686#define _MX53_PAD_EIM_DA3__EMI_NAND_WEIM_DA_3 IOMUX_PAD(0x4F8, 0x1A8, 0, 0x0, 0, 0)
687#define _MX53_PAD_EIM_DA3__GPIO3_3 IOMUX_PAD(0x4F8, 0x1A8, 1, 0x0, 0, 0)
688#define _MX53_PAD_EIM_DA3__IPU_DISP1_DAT_6 IOMUX_PAD(0x4F8, 0x1A8, 3, 0x0, 0, 0)
689#define _MX53_PAD_EIM_DA3__IPU_CSI1_D_6 IOMUX_PAD(0x4F8, 0x1A8, 4, 0x0, 0, 0)
690#define _MX53_PAD_EIM_DA3__SRC_BT_CFG2_2 IOMUX_PAD(0x4F8, 0x1A8, 7, 0x0, 0, 0)
691#define _MX53_PAD_EIM_DA4__EMI_NAND_WEIM_DA_4 IOMUX_PAD(0x4FC, 0x1AC, 0, 0x0, 0, 0)
692#define _MX53_PAD_EIM_DA4__GPIO3_4 IOMUX_PAD(0x4FC, 0x1AC, 1, 0x0, 0, 0)
693#define _MX53_PAD_EIM_DA4__IPU_DISP1_DAT_5 IOMUX_PAD(0x4FC, 0x1AC, 3, 0x0, 0, 0)
694#define _MX53_PAD_EIM_DA4__IPU_CSI1_D_5 IOMUX_PAD(0x4FC, 0x1AC, 4, 0x0, 0, 0)
695#define _MX53_PAD_EIM_DA4__SRC_BT_CFG3_7 IOMUX_PAD(0x4FC, 0x1AC, 7, 0x0, 0, 0)
696#define _MX53_PAD_EIM_DA5__EMI_NAND_WEIM_DA_5 IOMUX_PAD(0x500, 0x1B0, 0, 0x0, 0, 0)
697#define _MX53_PAD_EIM_DA5__GPIO3_5 IOMUX_PAD(0x500, 0x1B0, 1, 0x0, 0, 0)
698#define _MX53_PAD_EIM_DA5__IPU_DISP1_DAT_4 IOMUX_PAD(0x500, 0x1B0, 3, 0x0, 0, 0)
699#define _MX53_PAD_EIM_DA5__IPU_CSI1_D_4 IOMUX_PAD(0x500, 0x1B0, 4, 0x0, 0, 0)
700#define _MX53_PAD_EIM_DA5__SRC_BT_CFG3_6 IOMUX_PAD(0x500, 0x1B0, 17, 0x0, 0, 0)
701#define _MX53_PAD_EIM_DA6__EMI_NAND_WEIM_DA_6 IOMUX_PAD(0x504, 0x1B4, 0, 0x0, 0, 0)
702#define _MX53_PAD_EIM_DA6__GPIO3_6 IOMUX_PAD(0x504, 0x1B4, 1, 0x0, 0, 0)
703#define _MX53_PAD_EIM_DA6__IPU_DISP1_DAT_3 IOMUX_PAD(0x504, 0x1B4, 3, 0x0, 0, 0)
704#define _MX53_PAD_EIM_DA6__IPU_CSI1_D_3 IOMUX_PAD(0x504, 0x1B4, 4, 0x0, 0, 0)
705#define _MX53_PAD_EIM_DA6__SRC_BT_CFG3_5 IOMUX_PAD(0x504, 0x1B4, 7, 0x0, 0, 0)
706#define _MX53_PAD_EIM_DA7__EMI_NAND_WEIM_DA_7 IOMUX_PAD(0x508, 0x1B8, 0, 0x0, 0, 0)
707#define _MX53_PAD_EIM_DA7__GPIO3_7 IOMUX_PAD(0x508, 0x1B8, 1, 0x0, 0, 0)
708#define _MX53_PAD_EIM_DA7__IPU_DISP1_DAT_2 IOMUX_PAD(0x508, 0x1B8, 3, 0x0, 0, 0)
709#define _MX53_PAD_EIM_DA7__IPU_CSI1_D_2 IOMUX_PAD(0x508, 0x1B8, 4, 0x0, 0, 0)
710#define _MX53_PAD_EIM_DA7__SRC_BT_CFG3_4 IOMUX_PAD(0x508, 0x1B8, 7, 0x0, 0, 0)
711#define _MX53_PAD_EIM_DA8__EMI_NAND_WEIM_DA_8 IOMUX_PAD(0x50C, 0x1BC, 0, 0x0, 0, 0)
712#define _MX53_PAD_EIM_DA8__GPIO3_8 IOMUX_PAD(0x50C, 0x1BC, 1, 0x0, 0, 0)
713#define _MX53_PAD_EIM_DA8__IPU_DISP1_DAT_1 IOMUX_PAD(0x50C, 0x1BC, 3, 0x0, 0, 0)
714#define _MX53_PAD_EIM_DA8__IPU_CSI1_D_1 IOMUX_PAD(0x50C, 0x1BC, 4, 0x0, 0, 0)
715#define _MX53_PAD_EIM_DA8__SRC_BT_CFG3_3 IOMUX_PAD(0x50C, 0x1BC, 7, 0x0, 0, 0)
716#define _MX53_PAD_EIM_DA9__EMI_NAND_WEIM_DA_9 IOMUX_PAD(0x510, 0x1C0, 0, 0x0, 0, 0)
717#define _MX53_PAD_EIM_DA9__GPIO3_9 IOMUX_PAD(0x510, 0x1C0, 1, 0x0, 0, 0)
718#define _MX53_PAD_EIM_DA9__IPU_DISP1_DAT_0 IOMUX_PAD(0x510, 0x1C0, 3, 0x0, 0, 0)
719#define _MX53_PAD_EIM_DA9__IPU_CSI1_D_0 IOMUX_PAD(0x510, 0x1C0, 4, 0x0, 0, 0)
720#define _MX53_PAD_EIM_DA9__SRC_BT_CFG3_2 IOMUX_PAD(0x510, 0x1C0, 7, 0x0, 0, 0)
721#define _MX53_PAD_EIM_DA10__EMI_NAND_WEIM_DA_10 IOMUX_PAD(0x514, 0x1C4, 0, 0x0, 0, 0)
722#define _MX53_PAD_EIM_DA10__GPIO3_10 IOMUX_PAD(0x514, 0x1C4, 1, 0x0, 0, 0)
723#define _MX53_PAD_EIM_DA10__IPU_DI1_PIN15 IOMUX_PAD(0x514, 0x1C4, 3, 0x0, 0, 0)
724#define _MX53_PAD_EIM_DA10__IPU_CSI1_DATA_EN IOMUX_PAD(0x514, 0x1C4, 4, 0x834, 1, 0)
725#define _MX53_PAD_EIM_DA10__SRC_BT_CFG3_1 IOMUX_PAD(0x514, 0x1C4, 7, 0x0, 0, 0)
726#define _MX53_PAD_EIM_DA11__EMI_NAND_WEIM_DA_11 IOMUX_PAD(0x518, 0x1C8, 0, 0x0, 0, 0)
727#define _MX53_PAD_EIM_DA11__GPIO3_11 IOMUX_PAD(0x518, 0x1C8, 1, 0x0, 0, 0)
728#define _MX53_PAD_EIM_DA11__IPU_DI1_PIN2 IOMUX_PAD(0x518, 0x1C8, 3, 0x0, 0, 0)
729#define _MX53_PAD_EIM_DA11__IPU_CSI1_HSYNC IOMUX_PAD(0x518, 0x1C8, 4, 0x838, 1, 0)
730#define _MX53_PAD_EIM_DA12__EMI_NAND_WEIM_DA_12 IOMUX_PAD(0x51C, 0x1CC, 0, 0x0, 0, 0)
731#define _MX53_PAD_EIM_DA12__GPIO3_12 IOMUX_PAD(0x51C, 0x1CC, 1, 0x0, 0, 0)
732#define _MX53_PAD_EIM_DA12__IPU_DI1_PIN3 IOMUX_PAD(0x51C, 0x1CC, 3, 0x0, 0, 0)
733#define _MX53_PAD_EIM_DA12__IPU_CSI1_VSYNC IOMUX_PAD(0x51C, 0x1CC, 4, 0x83C, 1, 0)
734#define _MX53_PAD_EIM_DA13__EMI_NAND_WEIM_DA_13 IOMUX_PAD(0x520, 0x1D0, 0, 0x0, 0, 0)
735#define _MX53_PAD_EIM_DA13__GPIO3_13 IOMUX_PAD(0x520, 0x1D0, 1, 0x0, 0, 0)
736#define _MX53_PAD_EIM_DA13__IPU_DI1_D0_CS IOMUX_PAD(0x520, 0x1D0, 3, 0x0, 0, 0)
737#define _MX53_PAD_EIM_DA13__CCM_DI1_EXT_CLK IOMUX_PAD(0x520, 0x1D0, 4, 0x76C, 1, 0)
738#define _MX53_PAD_EIM_DA14__EMI_NAND_WEIM_DA_14 IOMUX_PAD(0x524, 0x1D4, 0, 0x0, 0, 0)
739#define _MX53_PAD_EIM_DA14__GPIO3_14 IOMUX_PAD(0x524, 0x1D4, 1, 0x0, 0, 0)
740#define _MX53_PAD_EIM_DA14__IPU_DI1_D1_CS IOMUX_PAD(0x524, 0x1D4, 3, 0x0, 0, 0)
741#define _MX53_PAD_EIM_DA14__CCM_DI0_EXT_CLK IOMUX_PAD(0x524, 0x1D4, 4, 0x0, 0, 0)
742#define _MX53_PAD_EIM_DA15__EMI_NAND_WEIM_DA_15 IOMUX_PAD(0x528, 0x1D8, 0, 0x0, 0, 0)
743#define _MX53_PAD_EIM_DA15__GPIO3_15 IOMUX_PAD(0x528, 0x1D8, 1, 0x0, 0, 0)
744#define _MX53_PAD_EIM_DA15__IPU_DI1_PIN1 IOMUX_PAD(0x528, 0x1D8, 3, 0x0, 0, 0)
745#define _MX53_PAD_EIM_DA15__IPU_DI1_PIN4 IOMUX_PAD(0x528, 0x1D8, 4, 0x0, 0, 0)
746#define _MX53_PAD_NANDF_WE_B__EMI_NANDF_WE_B IOMUX_PAD(0x52C, 0x1DC, 0, 0x0, 0, 0)
747#define _MX53_PAD_NANDF_WE_B__GPIO6_12 IOMUX_PAD(0x52C, 0x1DC, 1, 0x0, 0, 0)
748#define _MX53_PAD_NANDF_RE_B__EMI_NANDF_RE_B IOMUX_PAD(0x530, 0x1E0, 0, 0x0, 0, 0)
749#define _MX53_PAD_NANDF_RE_B__GPIO6_13 IOMUX_PAD(0x530, 0x1E0, 1, 0x0, 0, 0)
750#define _MX53_PAD_EIM_WAIT__EMI_WEIM_WAIT IOMUX_PAD(0x534, 0x1E4, 0, 0x0, 0, 0)
751#define _MX53_PAD_EIM_WAIT__GPIO5_0 IOMUX_PAD(0x534, 0x1E4, 1, 0x0, 0, 0)
752#define _MX53_PAD_EIM_WAIT__EMI_WEIM_DTACK_B IOMUX_PAD(0x534, 0x1E4, 2, 0x0, 0, 0)
753#define _MX53_PAD_LVDS1_TX3_P__GPIO6_22 IOMUX_PAD(NON_PAD_I, 0x1EC, 0, 0x0, 0, 0)
754#define _MX53_PAD_LVDS1_TX3_P__LDB_LVDS1_TX3 IOMUX_PAD(NON_PAD_I, 0x1EC, 1, 0x0, 0, 0)
755#define _MX53_PAD_LVDS1_TX2_P__GPIO6_24 IOMUX_PAD(NON_PAD_I, 0x1F0, 0, 0x0, 0, 0)
756#define _MX53_PAD_LVDS1_TX2_P__LDB_LVDS1_TX2 IOMUX_PAD(NON_PAD_I, 0x1F0, 1, 0x0, 0, 0)
757#define _MX53_PAD_LVDS1_CLK_P__GPIO6_26 IOMUX_PAD(NON_PAD_I, 0x1F4, 0, 0x0, 0, 0)
758#define _MX53_PAD_LVDS1_CLK_P__LDB_LVDS1_CLK IOMUX_PAD(NON_PAD_I, 0x1F4, 1, 0x0, 0, 0)
759#define _MX53_PAD_LVDS1_TX1_P__GPIO6_28 IOMUX_PAD(NON_PAD_I, 0x1F8, 0, 0x0, 0, 0)
760#define _MX53_PAD_LVDS1_TX1_P__LDB_LVDS1_TX1 IOMUX_PAD(NON_PAD_I, 0x1F8, 1, 0x0, 0, 0)
761#define _MX53_PAD_LVDS1_TX0_P__GPIO6_30 IOMUX_PAD(NON_PAD_I, 0x1FC, 0, 0x0, 0, 0)
762#define _MX53_PAD_LVDS1_TX0_P__LDB_LVDS1_TX0 IOMUX_PAD(NON_PAD_I, 0x1FC, 1, 0x0, 0, 0)
763#define _MX53_PAD_LVDS0_TX3_P__GPIO7_22 IOMUX_PAD(NON_PAD_I, 0x200, 0, 0x0, 0, 0)
764#define _MX53_PAD_LVDS0_TX3_P__LDB_LVDS0_TX3 IOMUX_PAD(NON_PAD_I, 0x200, 1, 0x0, 0, 0)
765#define _MX53_PAD_LVDS0_CLK_P__GPIO7_24 IOMUX_PAD(NON_PAD_I, 0x204, 0, 0x0, 0, 0)
766#define _MX53_PAD_LVDS0_CLK_P__LDB_LVDS0_CLK IOMUX_PAD(NON_PAD_I, 0x204, 1, 0x0, 0, 0)
767#define _MX53_PAD_LVDS0_TX2_P__GPIO7_26 IOMUX_PAD(NON_PAD_I, 0x208, 0, 0x0, 0, 0)
768#define _MX53_PAD_LVDS0_TX2_P__LDB_LVDS0_TX2 IOMUX_PAD(NON_PAD_I, 0x208, 1, 0x0, 0, 0)
769#define _MX53_PAD_LVDS0_TX1_P__GPIO7_28 IOMUX_PAD(NON_PAD_I, 0x20C, 0, 0x0, 0, 0)
770#define _MX53_PAD_LVDS0_TX1_P__LDB_LVDS0_TX1 IOMUX_PAD(NON_PAD_I, 0x20C, 1, 0x0, 0, 0)
771#define _MX53_PAD_LVDS0_TX0_P__GPIO7_30 IOMUX_PAD(NON_PAD_I, 0x210, 0, 0x0, 0, 0)
772#define _MX53_PAD_LVDS0_TX0_P__LDB_LVDS0_TX0 IOMUX_PAD(NON_PAD_I, 0x210, 1, 0x0, 0, 0)
773#define _MX53_PAD_GPIO_10__GPIO4_0 IOMUX_PAD(0x540, 0x214, 0, 0x0, 0, 0)
774#define _MX53_PAD_GPIO_10__OSC32k_32K_OUT IOMUX_PAD(0x540, 0x214, 1, 0x0, 0, 0)
775#define _MX53_PAD_GPIO_11__GPIO4_1 IOMUX_PAD(0x544, 0x218, 0, 0x0, 0, 0)
776#define _MX53_PAD_GPIO_12__GPIO4_2 IOMUX_PAD(0x548, 0x21C, 0, 0x0, 0, 0)
777#define _MX53_PAD_GPIO_13__GPIO4_3 IOMUX_PAD(0x54C, 0x220, 0, 0x0, 0, 0)
778#define _MX53_PAD_GPIO_14__GPIO4_4 IOMUX_PAD(0x550, 0x224, 0, 0x0, 0, 0)
779#define _MX53_PAD_NANDF_CLE__EMI_NANDF_CLE IOMUX_PAD(0x5A0, 0x228, 0, 0x0, 0, 0)
780#define _MX53_PAD_NANDF_CLE__GPIO6_7 IOMUX_PAD(0x5A0, 0x228, 1, 0x0, 0, 0)
781#define _MX53_PAD_NANDF_CLE__USBPHY1_VSTATUS_0 IOMUX_PAD(0x5A0, 0x228, 7, 0x0, 0, 0)
782#define _MX53_PAD_NANDF_ALE__EMI_NANDF_ALE IOMUX_PAD(0x5A4, 0x22C, 0, 0x0, 0, 0)
783#define _MX53_PAD_NANDF_ALE__GPIO6_8 IOMUX_PAD(0x5A4, 0x22C, 1, 0x0, 0, 0)
784#define _MX53_PAD_NANDF_ALE__USBPHY1_VSTATUS_1 IOMUX_PAD(0x5A4, 0x22C, 7, 0x0, 0, 0)
785#define _MX53_PAD_NANDF_WP_B__EMI_NANDF_WP_B IOMUX_PAD(0x5A8, 0x230, 0, 0x0, 0, 0)
786#define _MX53_PAD_NANDF_WP_B__GPIO6_9 IOMUX_PAD(0x5A8, 0x230, 1, 0x0, 0, 0)
787#define _MX53_PAD_NANDF_WP_B__USBPHY1_VSTATUS_2 IOMUX_PAD(0x5A8, 0x230, 7, 0x0, 0, 0)
788#define _MX53_PAD_NANDF_RB0__EMI_NANDF_RB_0 IOMUX_PAD(0x5AC, 0x234, 0, 0x0, 0, 0)
789#define _MX53_PAD_NANDF_RB0__GPIO6_10 IOMUX_PAD(0x5AC, 0x234, 1, 0x0, 0, 0)
790#define _MX53_PAD_NANDF_RB0__USBPHY1_VSTATUS_3 IOMUX_PAD(0x5AC, 0x234, 7, 0x0, 0, 0)
791#define _MX53_PAD_NANDF_CS0__EMI_NANDF_CS_0 IOMUX_PAD(0x5B0, 0x238, 0, 0x0, 0, 0)
792#define _MX53_PAD_NANDF_CS0__GPIO6_11 IOMUX_PAD(0x5B0, 0x238, 1, 0x0, 0, 0)
793#define _MX53_PAD_NANDF_CS0__USBPHY1_VSTATUS_4 IOMUX_PAD(0x5B0, 0x238, 7, 0x0, 0, 0)
794#define _MX53_PAD_NANDF_CS1__EMI_NANDF_CS_1 IOMUX_PAD(0x5B4, 0x23C, 0, 0x0, 0, 0)
795#define _MX53_PAD_NANDF_CS1__GPIO6_14 IOMUX_PAD(0x5B4, 0x23C, 1, 0x0, 0, 0)
796#define _MX53_PAD_NANDF_CS1__MLB_MLBCLK IOMUX_PAD(0x5B4, 0x23C, 6, 0x858, 0, 0)
797#define _MX53_PAD_NANDF_CS1__USBPHY1_VSTATUS_5 IOMUX_PAD(0x5B4, 0x23C, 7, 0x0, 0, 0)
798#define _MX53_PAD_NANDF_CS2__EMI_NANDF_CS_2 IOMUX_PAD(0x5B8, 0x240, 0, 0x0, 0, 0)
799#define _MX53_PAD_NANDF_CS2__GPIO6_15 IOMUX_PAD(0x5B8, 0x240, 1, 0x0, 0, 0)
800#define _MX53_PAD_NANDF_CS2__IPU_SISG_0 IOMUX_PAD(0x5B8, 0x240, 2, 0x0, 0, 0)
801#define _MX53_PAD_NANDF_CS2__ESAI1_TX0 IOMUX_PAD(0x5B8, 0x240, 3, 0x7E4, 0, 0)
802#define _MX53_PAD_NANDF_CS2__EMI_WEIM_CRE IOMUX_PAD(0x5B8, 0x240, 4, 0x0, 0, 0)
803#define _MX53_PAD_NANDF_CS2__CCM_CSI0_MCLK IOMUX_PAD(0x5B8, 0x240, 5, 0x0, 0, 0)
804#define _MX53_PAD_NANDF_CS2__MLB_MLBSIG IOMUX_PAD(0x5B8, 0x240, 6, 0x860, 0, 0)
805#define _MX53_PAD_NANDF_CS2__USBPHY1_VSTATUS_6 IOMUX_PAD(0x5B8, 0x240, 7, 0x0, 0, 0)
806#define _MX53_PAD_NANDF_CS3__EMI_NANDF_CS_3 IOMUX_PAD(0x5BC, 0x244, 0, 0x0, 0, 0)
807#define _MX53_PAD_NANDF_CS3__GPIO6_16 IOMUX_PAD(0x5BC, 0x244, 1, 0x0, 0, 0)
808#define _MX53_PAD_NANDF_CS3__IPU_SISG_1 IOMUX_PAD(0x5BC, 0x244, 2, 0x0, 0, 0)
809#define _MX53_PAD_NANDF_CS3__ESAI1_TX1 IOMUX_PAD(0x5BC, 0x244, 3, 0x7E8, 0, 0)
810#define _MX53_PAD_NANDF_CS3__EMI_WEIM_A_26 IOMUX_PAD(0x5BC, 0x244, 4, 0x0, 0, 0)
811#define _MX53_PAD_NANDF_CS3__MLB_MLBDAT IOMUX_PAD(0x5BC, 0x244, 6, 0x85C, 0, 0)
812#define _MX53_PAD_NANDF_CS3__USBPHY1_VSTATUS_7 IOMUX_PAD(0x5BC, 0x244, 7, 0x0, 0, 0)
813#define _MX53_PAD_FEC_MDIO__FEC_MDIO IOMUX_PAD(0x5C4, 0x248, 0, 0x804, 1, 0)
814#define _MX53_PAD_FEC_MDIO__GPIO1_22 IOMUX_PAD(0x5C4, 0x248, 1, 0x0, 0, 0)
815#define _MX53_PAD_FEC_MDIO__ESAI1_SCKR IOMUX_PAD(0x5C4, 0x248, 2, 0x7DC, 0, 0)
816#define _MX53_PAD_FEC_MDIO__FEC_COL IOMUX_PAD(0x5C4, 0x248, 3, 0x800, 1, 0)
817#define _MX53_PAD_FEC_MDIO__RTC_CE_RTC_PS2 IOMUX_PAD(0x5C4, 0x248, 4, 0x0, 0, 0)
818#define _MX53_PAD_FEC_MDIO__SDMA_DEBUG_BUS_DEVICE_3 IOMUX_PAD(0x5C4, 0x248, 5, 0x0, 0, 0)
819#define _MX53_PAD_FEC_MDIO__EMI_EMI_DEBUG_49 IOMUX_PAD(0x5C4, 0x248, 6, 0x0, 0, 0)
820#define _MX53_PAD_FEC_REF_CLK__FEC_TX_CLK IOMUX_PAD(0x5C8, 0x24C, 0, 0x0, 0, 0)
821#define _MX53_PAD_FEC_REF_CLK__GPIO1_23 IOMUX_PAD(0x5C8, 0x24C, 1, 0x0, 0, 0)
822#define _MX53_PAD_FEC_REF_CLK__ESAI1_FSR IOMUX_PAD(0x5C8, 0x24C, 2, 0x7CC, 0, 0)
823#define _MX53_PAD_FEC_REF_CLK__SDMA_DEBUG_BUS_DEVICE_4 IOMUX_PAD(0x5C8, 0x24C, 5, 0x0, 0, 0)
824#define _MX53_PAD_FEC_REF_CLK__EMI_EMI_DEBUG_50 IOMUX_PAD(0x5C8, 0x24C, 6, 0x0, 0, 0)
825#define _MX53_PAD_FEC_RX_ER__FEC_RX_ER IOMUX_PAD(0x5CC, 0x250, 0, 0x0, 0, 0)
826#define _MX53_PAD_FEC_RX_ER__GPIO1_24 IOMUX_PAD(0x5CC, 0x250, 1, 0x0, 0, 0)
827#define _MX53_PAD_FEC_RX_ER__ESAI1_HCKR IOMUX_PAD(0x5CC, 0x250, 2, 0x7D4, 0, 0)
828#define _MX53_PAD_FEC_RX_ER__FEC_RX_CLK IOMUX_PAD(0x5CC, 0x250, 3, 0x808, 1, 0)
829#define _MX53_PAD_FEC_RX_ER__RTC_CE_RTC_PS3 IOMUX_PAD(0x5CC, 0x250, 4, 0x0, 0, 0)
830#define _MX53_PAD_FEC_CRS_DV__FEC_RX_DV IOMUX_PAD(0x5D0, 0x254, 0, 0x0, 0, 0)
831#define _MX53_PAD_FEC_CRS_DV__GPIO1_25 IOMUX_PAD(0x5D0, 0x254, 1, 0x0, 0, 0)
832#define _MX53_PAD_FEC_CRS_DV__ESAI1_SCKT IOMUX_PAD(0x5D0, 0x254, 2, 0x7E0, 0, 0)
833#define _MX53_PAD_FEC_RXD1__FEC_RDATA_1 IOMUX_PAD(0x5D4, 0x258, 0, 0x0, 0, 0)
834#define _MX53_PAD_FEC_RXD1__GPIO1_26 IOMUX_PAD(0x5D4, 0x258, 1, 0x0, 0, 0)
835#define _MX53_PAD_FEC_RXD1__ESAI1_FST IOMUX_PAD(0x5D4, 0x258, 2, 0x7D0, 0, 0)
836#define _MX53_PAD_FEC_RXD1__MLB_MLBSIG IOMUX_PAD(0x5D4, 0x258, 3, 0x860, 1, 0)
837#define _MX53_PAD_FEC_RXD1__RTC_CE_RTC_PS1 IOMUX_PAD(0x5D4, 0x258, 4, 0x0, 0, 0)
838#define _MX53_PAD_FEC_RXD0__FEC_RDATA_0 IOMUX_PAD(0x5D8, 0x25C, 0, 0x0, 0, 0)
839#define _MX53_PAD_FEC_RXD0__GPIO1_27 IOMUX_PAD(0x5D8, 0x25C, 1, 0x0, 0, 0)
840#define _MX53_PAD_FEC_RXD0__ESAI1_HCKT IOMUX_PAD(0x5D8, 0x25C, 2, 0x7D8, 0, 0)
841#define _MX53_PAD_FEC_RXD0__OSC32k_32K_OUT IOMUX_PAD(0x5D8, 0x25C, 3, 0x0, 0, 0)
842#define _MX53_PAD_FEC_TX_EN__FEC_TX_EN IOMUX_PAD(0x5DC, 0x260, 0, 0x0, 0, 0)
843#define _MX53_PAD_FEC_TX_EN__GPIO1_28 IOMUX_PAD(0x5DC, 0x260, 1, 0x0, 0, 0)
844#define _MX53_PAD_FEC_TX_EN__ESAI1_TX3_RX2 IOMUX_PAD(0x5DC, 0x260, 2, 0x7F0, 0, 0)
845#define _MX53_PAD_FEC_TXD1__FEC_TDATA_1 IOMUX_PAD(0x5E0, 0x264, 0, 0x0, 0, 0)
846#define _MX53_PAD_FEC_TXD1__GPIO1_29 IOMUX_PAD(0x5E0, 0x264, 1, 0x0, 0, 0)
847#define _MX53_PAD_FEC_TXD1__ESAI1_TX2_RX3 IOMUX_PAD(0x5E0, 0x264, 2, 0x7EC, 0, 0)
848#define _MX53_PAD_FEC_TXD1__MLB_MLBCLK IOMUX_PAD(0x5E0, 0x264, 3, 0x858, 1, 0)
849#define _MX53_PAD_FEC_TXD1__RTC_CE_RTC_PRSC_CLK IOMUX_PAD(0x5E0, 0x264, 4, 0x0, 0, 0)
850#define _MX53_PAD_FEC_TXD0__FEC_TDATA_0 IOMUX_PAD(0x5E4, 0x268, 0, 0x0, 0, 0)
851#define _MX53_PAD_FEC_TXD0__GPIO1_30 IOMUX_PAD(0x5E4, 0x268, 1, 0x0, 0, 0)
852#define _MX53_PAD_FEC_TXD0__ESAI1_TX4_RX1 IOMUX_PAD(0x5E4, 0x268, 2, 0x7F4, 0, 0)
853#define _MX53_PAD_FEC_TXD0__USBPHY2_DATAOUT_0 IOMUX_PAD(0x5E4, 0x268, 7, 0x0, 0, 0)
854#define _MX53_PAD_FEC_MDC__FEC_MDC IOMUX_PAD(0x5E8, 0x26C, 0, 0x0, 0, 0)
855#define _MX53_PAD_FEC_MDC__GPIO1_31 IOMUX_PAD(0x5E8, 0x26C, 1, 0x0, 0, 0)
856#define _MX53_PAD_FEC_MDC__ESAI1_TX5_RX0 IOMUX_PAD(0x5E8, 0x26C, 2, 0x7F8, 0, 0)
857#define _MX53_PAD_FEC_MDC__MLB_MLBDAT IOMUX_PAD(0x5E8, 0x26C, 3, 0x85C, 1, 0)
858#define _MX53_PAD_FEC_MDC__RTC_CE_RTC_ALARM1_TRIG IOMUX_PAD(0x5E8, 0x26C, 4, 0x0, 0, 0)
859#define _MX53_PAD_FEC_MDC__USBPHY2_DATAOUT_1 IOMUX_PAD(0x5E8, 0x26C, 7, 0x0, 0, 0)
860#define _MX53_PAD_PATA_DIOW__PATA_DIOW IOMUX_PAD(0x5F0, 0x270, 0, 0x0, 0, 0)
861#define _MX53_PAD_PATA_DIOW__GPIO6_17 IOMUX_PAD(0x5F0, 0x270, 1, 0x0, 0, 0)
862#define _MX53_PAD_PATA_DIOW__UART1_TXD_MUX IOMUX_PAD(0x5F0, 0x270, 3, 0x878, 2, 0)
863#define _MX53_PAD_PATA_DIOW__USBPHY2_DATAOUT_2 IOMUX_PAD(0x5F0, 0x270, 7, 0x0, 0, 0)
864#define _MX53_PAD_PATA_DMACK__PATA_DMACK IOMUX_PAD(0x5F4, 0x274, 0, 0x0, 0, 0)
865#define _MX53_PAD_PATA_DMACK__GPIO6_18 IOMUX_PAD(0x5F4, 0x274, 1, 0x0, 0, 0)
866#define _MX53_PAD_PATA_DMACK__UART1_RXD_MUX IOMUX_PAD(0x5F4, 0x274, 3, 0x878, 3, 0)
867#define _MX53_PAD_PATA_DMACK__USBPHY2_DATAOUT_3 IOMUX_PAD(0x5F4, 0x274, 7, 0x0, 0, 0)
868#define _MX53_PAD_PATA_DMARQ__PATA_DMARQ IOMUX_PAD(0x5F8, 0x278, 0, 0x0, 0, 0)
869#define _MX53_PAD_PATA_DMARQ__GPIO7_0 IOMUX_PAD(0x5F8, 0x278, 1, 0x0, 0, 0)
870#define _MX53_PAD_PATA_DMARQ__UART2_TXD_MUX IOMUX_PAD(0x5F8, 0x278, 3, 0x880, 2, 0)
871#define _MX53_PAD_PATA_DMARQ__CCM_CCM_OUT_0 IOMUX_PAD(0x5F8, 0x278, 5, 0x0, 0, 0)
872#define _MX53_PAD_PATA_DMARQ__USBPHY2_DATAOUT_4 IOMUX_PAD(0x5F8, 0x278, 7, 0x0, 0, 0)
873#define _MX53_PAD_PATA_BUFFER_EN__PATA_BUFFER_EN IOMUX_PAD(0x5FC, 0x27C, 0, 0x0, 0, 0)
874#define _MX53_PAD_PATA_BUFFER_EN__GPIO7_1 IOMUX_PAD(0x5FC, 0x27C, 1, 0x0, 0, 0)
875#define _MX53_PAD_PATA_BUFFER_EN__UART2_RXD_MUX IOMUX_PAD(0x5FC, 0x27C, 3, 0x880, 3, 0)
876#define _MX53_PAD_PATA_BUFFER_EN__CCM_CCM_OUT_1 IOMUX_PAD(0x5FC, 0x27C, 5, 0x0, 0, 0)
877#define _MX53_PAD_PATA_BUFFER_EN__USBPHY2_DATAOUT_5 IOMUX_PAD(0x5FC, 0x27C, 7, 0x0, 0, 0)
878#define _MX53_PAD_PATA_INTRQ__PATA_INTRQ IOMUX_PAD(0x600, 0x280, 0, 0x0, 0, 0)
879#define _MX53_PAD_PATA_INTRQ__GPIO7_2 IOMUX_PAD(0x600, 0x280, 1, 0x0, 0, 0)
880#define _MX53_PAD_PATA_INTRQ__UART2_CTS IOMUX_PAD(0x600, 0x280, 3, 0x87C, 2, 0)
881#define _MX53_PAD_PATA_INTRQ__CAN1_TXCAN IOMUX_PAD(0x600, 0x280, 4, 0x0, 0, 0)
882#define _MX53_PAD_PATA_INTRQ__CCM_CCM_OUT_2 IOMUX_PAD(0x600, 0x280, 5, 0x0, 0, 0)
883#define _MX53_PAD_PATA_INTRQ__USBPHY2_DATAOUT_6 IOMUX_PAD(0x600, 0x280, 7, 0x0, 0, 0)
884#define _MX53_PAD_PATA_DIOR__PATA_DIOR IOMUX_PAD(0x604, 0x284, 0, 0x0, 0, 0)
885#define _MX53_PAD_PATA_DIOR__GPIO7_3 IOMUX_PAD(0x604, 0x284, 1, 0x0, 0, 0)
886#define _MX53_PAD_PATA_DIOR__UART2_RTS IOMUX_PAD(0x604, 0x284, 3, 0x87C, 3, 0)
887#define _MX53_PAD_PATA_DIOR__CAN1_RXCAN IOMUX_PAD(0x604, 0x284, 4, 0x760, 1, 0)
888#define _MX53_PAD_PATA_DIOR__USBPHY2_DATAOUT_7 IOMUX_PAD(0x604, 0x284, 7, 0x0, 0, 0)
889#define _MX53_PAD_PATA_RESET_B__PATA_PATA_RESET_B IOMUX_PAD(0x608, 0x288, 0, 0x0, 0, 0)
890#define _MX53_PAD_PATA_RESET_B__GPIO7_4 IOMUX_PAD(0x608, 0x288, 1, 0x0, 0, 0)
891#define _MX53_PAD_PATA_RESET_B__ESDHC3_CMD IOMUX_PAD(0x608, 0x288, 2, 0x0, 0, 0)
892#define _MX53_PAD_PATA_RESET_B__UART1_CTS IOMUX_PAD(0x608, 0x288, 3, 0x874, 2, 0)
893#define _MX53_PAD_PATA_RESET_B__CAN2_TXCAN IOMUX_PAD(0x608, 0x288, 4, 0x0, 0, 0)
894#define _MX53_PAD_PATA_RESET_B__USBPHY1_DATAOUT_0 IOMUX_PAD(0x608, 0x288, 7, 0x0, 0, 0)
895#define _MX53_PAD_PATA_IORDY__PATA_IORDY IOMUX_PAD(0x60C, 0x28C, 0, 0x0, 0, 0)
896#define _MX53_PAD_PATA_IORDY__GPIO7_5 IOMUX_PAD(0x60C, 0x28C, 1, 0x0, 0, 0)
897#define _MX53_PAD_PATA_IORDY__ESDHC3_CLK IOMUX_PAD(0x60C, 0x28C, 2, 0x0, 0, 0)
898#define _MX53_PAD_PATA_IORDY__UART1_RTS IOMUX_PAD(0x60C, 0x28C, 3, 0x874, 3, 0)
899#define _MX53_PAD_PATA_IORDY__CAN2_RXCAN IOMUX_PAD(0x60C, 0x28C, 4, 0x764, 1, 0)
900#define _MX53_PAD_PATA_IORDY__USBPHY1_DATAOUT_1 IOMUX_PAD(0x60C, 0x28C, 7, 0x0, 0, 0)
901#define _MX53_PAD_PATA_DA_0__PATA_DA_0 IOMUX_PAD(0x610, 0x290, 0, 0x0, 0, 0)
902#define _MX53_PAD_PATA_DA_0__GPIO7_6 IOMUX_PAD(0x610, 0x290, 1, 0x0, 0, 0)
903#define _MX53_PAD_PATA_DA_0__ESDHC3_RST IOMUX_PAD(0x610, 0x290, 2, 0x0, 0, 0)
904#define _MX53_PAD_PATA_DA_0__OWIRE_LINE IOMUX_PAD(0x610, 0x290, 4, 0x864, 0, 0)
905#define _MX53_PAD_PATA_DA_0__USBPHY1_DATAOUT_2 IOMUX_PAD(0x610, 0x290, 7, 0x0, 0, 0)
906#define _MX53_PAD_PATA_DA_1__PATA_DA_1 IOMUX_PAD(0x614, 0x294, 0, 0x0, 0, 0)
907#define _MX53_PAD_PATA_DA_1__GPIO7_7 IOMUX_PAD(0x614, 0x294, 1, 0x0, 0, 0)
908#define _MX53_PAD_PATA_DA_1__ESDHC4_CMD IOMUX_PAD(0x614, 0x294, 2, 0x0, 0, 0)
909#define _MX53_PAD_PATA_DA_1__UART3_CTS IOMUX_PAD(0x614, 0x294, 4, 0x884, 4, 0)
910#define _MX53_PAD_PATA_DA_1__USBPHY1_DATAOUT_3 IOMUX_PAD(0x614, 0x294, 7, 0x0, 0, 0)
911#define _MX53_PAD_PATA_DA_2__PATA_DA_2 IOMUX_PAD(0x618, 0x298, 0, 0x0, 0, 0)
912#define _MX53_PAD_PATA_DA_2__GPIO7_8 IOMUX_PAD(0x618, 0x298, 1, 0x0, 0, 0)
913#define _MX53_PAD_PATA_DA_2__ESDHC4_CLK IOMUX_PAD(0x618, 0x298, 2, 0x0, 0, 0)
914#define _MX53_PAD_PATA_DA_2__UART3_RTS IOMUX_PAD(0x618, 0x298, 4, 0x884, 5, 0)
915#define _MX53_PAD_PATA_DA_2__USBPHY1_DATAOUT_4 IOMUX_PAD(0x618, 0x298, 7, 0x0, 0, 0)
916#define _MX53_PAD_PATA_CS_0__PATA_CS_0 IOMUX_PAD(0x61C, 0x29C, 0, 0x0, 0, 0)
917#define _MX53_PAD_PATA_CS_0__GPIO7_9 IOMUX_PAD(0x61C, 0x29C, 1, 0x0, 0, 0)
918#define _MX53_PAD_PATA_CS_0__UART3_TXD_MUX IOMUX_PAD(0x61C, 0x29C, 4, 0x888, 2, 0)
919#define _MX53_PAD_PATA_CS_0__USBPHY1_DATAOUT_5 IOMUX_PAD(0x61C, 0x29C, 7, 0x0, 0, 0)
920#define _MX53_PAD_PATA_CS_1__PATA_CS_1 IOMUX_PAD(0x620, 0x2A0, 0, 0x0, 0, 0)
921#define _MX53_PAD_PATA_CS_1__GPIO7_10 IOMUX_PAD(0x620, 0x2A0, 1, 0x0, 0, 0)
922#define _MX53_PAD_PATA_CS_1__UART3_RXD_MUX IOMUX_PAD(0x620, 0x2A0, 4, 0x888, 3, 0)
923#define _MX53_PAD_PATA_CS_1__USBPHY1_DATAOUT_6 IOMUX_PAD(0x620, 0x2A0, 7, 0x0, 0, 0)
924#define _MX53_PAD_PATA_DATA0__PATA_DATA_0 IOMUX_PAD(0x628, 0x2A4, 0, 0x0, 0, 0)
925#define _MX53_PAD_PATA_DATA0__GPIO2_0 IOMUX_PAD(0x628, 0x2A4, 1, 0x0, 0, 0)
926#define _MX53_PAD_PATA_DATA0__EMI_NANDF_D_0 IOMUX_PAD(0x628, 0x2A4, 3, 0x0, 0, 0)
927#define _MX53_PAD_PATA_DATA0__ESDHC3_DAT4 IOMUX_PAD(0x628, 0x2A4, 4, 0x0, 0, 0)
928#define _MX53_PAD_PATA_DATA0__GPU3d_GPU_DEBUG_OUT_0 IOMUX_PAD(0x628, 0x2A4, 5, 0x0, 0, 0)
929#define _MX53_PAD_PATA_DATA0__IPU_DIAG_BUS_0 IOMUX_PAD(0x628, 0x2A4, 6, 0x0, 0, 0)
930#define _MX53_PAD_PATA_DATA0__USBPHY1_DATAOUT_7 IOMUX_PAD(0x628, 0x2A4, 7, 0x0, 0, 0)
931#define _MX53_PAD_PATA_DATA1__PATA_DATA_1 IOMUX_PAD(0x62C, 0x2A8, 0, 0x0, 0, 0)
932#define _MX53_PAD_PATA_DATA1__GPIO2_1 IOMUX_PAD(0x62C, 0x2A8, 1, 0x0, 0, 0)
933#define _MX53_PAD_PATA_DATA1__EMI_NANDF_D_1 IOMUX_PAD(0x62C, 0x2A8, 3, 0x0, 0, 0)
934#define _MX53_PAD_PATA_DATA1__ESDHC3_DAT5 IOMUX_PAD(0x62C, 0x2A8, 4, 0x0, 0, 0)
935#define _MX53_PAD_PATA_DATA1__GPU3d_GPU_DEBUG_OUT_1 IOMUX_PAD(0x62C, 0x2A8, 5, 0x0, 0, 0)
936#define _MX53_PAD_PATA_DATA1__IPU_DIAG_BUS_1 IOMUX_PAD(0x62C, 0x2A8, 6, 0x0, 0, 0)
937#define _MX53_PAD_PATA_DATA2__PATA_DATA_2 IOMUX_PAD(0x630, 0x2AC, 0, 0x0, 0, 0)
938#define _MX53_PAD_PATA_DATA2__GPIO2_2 IOMUX_PAD(0x630, 0x2AC, 1, 0x0, 0, 0)
939#define _MX53_PAD_PATA_DATA2__EMI_NANDF_D_2 IOMUX_PAD(0x630, 0x2AC, 3, 0x0, 0, 0)
940#define _MX53_PAD_PATA_DATA2__ESDHC3_DAT6 IOMUX_PAD(0x630, 0x2AC, 4, 0x0, 0, 0)
941#define _MX53_PAD_PATA_DATA2__GPU3d_GPU_DEBUG_OUT_2 IOMUX_PAD(0x630, 0x2AC, 5, 0x0, 0, 0)
942#define _MX53_PAD_PATA_DATA2__IPU_DIAG_BUS_2 IOMUX_PAD(0x630, 0x2AC, 6, 0x0, 0, 0)
943#define _MX53_PAD_PATA_DATA3__PATA_DATA_3 IOMUX_PAD(0x634, 0x2B0, 0, 0x0, 0, 0)
944#define _MX53_PAD_PATA_DATA3__GPIO2_3 IOMUX_PAD(0x634, 0x2B0, 1, 0x0, 0, 0)
945#define _MX53_PAD_PATA_DATA3__EMI_NANDF_D_3 IOMUX_PAD(0x634, 0x2B0, 3, 0x0, 0, 0)
946#define _MX53_PAD_PATA_DATA3__ESDHC3_DAT7 IOMUX_PAD(0x634, 0x2B0, 4, 0x0, 0, 0)
947#define _MX53_PAD_PATA_DATA3__GPU3d_GPU_DEBUG_OUT_3 IOMUX_PAD(0x634, 0x2B0, 5, 0x0, 0, 0)
948#define _MX53_PAD_PATA_DATA3__IPU_DIAG_BUS_3 IOMUX_PAD(0x634, 0x2B0, 6, 0x0, 0, 0)
949#define _MX53_PAD_PATA_DATA4__PATA_DATA_4 IOMUX_PAD(0x638, 0x2B4, 0, 0x0, 0, 0)
950#define _MX53_PAD_PATA_DATA4__GPIO2_4 IOMUX_PAD(0x638, 0x2B4, 1, 0x0, 0, 0)
951#define _MX53_PAD_PATA_DATA4__EMI_NANDF_D_4 IOMUX_PAD(0x638, 0x2B4, 3, 0x0, 0, 0)
952#define _MX53_PAD_PATA_DATA4__ESDHC4_DAT4 IOMUX_PAD(0x638, 0x2B4, 4, 0x0, 0, 0)
953#define _MX53_PAD_PATA_DATA4__GPU3d_GPU_DEBUG_OUT_4 IOMUX_PAD(0x638, 0x2B4, 5, 0x0, 0, 0)
954#define _MX53_PAD_PATA_DATA4__IPU_DIAG_BUS_4 IOMUX_PAD(0x638, 0x2B4, 6, 0x0, 0, 0)
955#define _MX53_PAD_PATA_DATA5__PATA_DATA_5 IOMUX_PAD(0x63C, 0x2B8, 0, 0x0, 0, 0)
956#define _MX53_PAD_PATA_DATA5__GPIO2_5 IOMUX_PAD(0x63C, 0x2B8, 1, 0x0, 0, 0)
957#define _MX53_PAD_PATA_DATA5__EMI_NANDF_D_5 IOMUX_PAD(0x63C, 0x2B8, 3, 0x0, 0, 0)
958#define _MX53_PAD_PATA_DATA5__ESDHC4_DAT5 IOMUX_PAD(0x63C, 0x2B8, 4, 0x0, 0, 0)
959#define _MX53_PAD_PATA_DATA5__GPU3d_GPU_DEBUG_OUT_5 IOMUX_PAD(0x63C, 0x2B8, 5, 0x0, 0, 0)
960#define _MX53_PAD_PATA_DATA5__IPU_DIAG_BUS_5 IOMUX_PAD(0x63C, 0x2B8, 6, 0x0, 0, 0)
961#define _MX53_PAD_PATA_DATA6__PATA_DATA_6 IOMUX_PAD(0x640, 0x2BC, 1, 0x0, 0, 0)
962#define _MX53_PAD_PATA_DATA6__GPIO2_6 IOMUX_PAD(0x640, 0x2BC, 1, 0x0, 0, 0)
963#define _MX53_PAD_PATA_DATA6__EMI_NANDF_D_6 IOMUX_PAD(0x640, 0x2BC, 1, 0x0, 0, 0)
964#define _MX53_PAD_PATA_DATA6__ESDHC4_DAT6 IOMUX_PAD(0x640, 0x2BC, 1, 0x0, 0, 0)
965#define _MX53_PAD_PATA_DATA6__GPU3d_GPU_DEBUG_OUT_6 IOMUX_PAD(0x640, 0x2BC, 1, 0x0, 0, 0)
966#define _MX53_PAD_PATA_DATA6__IPU_DIAG_BUS_6 IOMUX_PAD(0x640, 0x2BC, 1, 0x0, 0, 0)
967#define _MX53_PAD_PATA_DATA7__PATA_DATA_7 IOMUX_PAD(0x644, 0x2C0, 0, 0x0, 0, 0)
968#define _MX53_PAD_PATA_DATA7__GPIO2_7 IOMUX_PAD(0x644, 0x2C0, 1, 0x0, 0, 0)
969#define _MX53_PAD_PATA_DATA7__EMI_NANDF_D_7 IOMUX_PAD(0x644, 0x2C0, 3, 0x0, 0, 0)
970#define _MX53_PAD_PATA_DATA7__ESDHC4_DAT7 IOMUX_PAD(0x644, 0x2C0, 4, 0x0, 0, 0)
971#define _MX53_PAD_PATA_DATA7__GPU3d_GPU_DEBUG_OUT_7 IOMUX_PAD(0x644, 0x2C0, 5, 0x0, 0, 0)
972#define _MX53_PAD_PATA_DATA7__IPU_DIAG_BUS_7 IOMUX_PAD(0x644, 0x2C0, 6, 0x0, 0, 0)
973#define _MX53_PAD_PATA_DATA8__PATA_DATA_8 IOMUX_PAD(0x648, 0x2C4, 0, 0x0, 0, 0)
974#define _MX53_PAD_PATA_DATA8__GPIO2_8 IOMUX_PAD(0x648, 0x2C4, 1, 0x0, 0, 0)
975#define _MX53_PAD_PATA_DATA8__ESDHC1_DAT4 IOMUX_PAD(0x648, 0x2C4, 2, 0x0, 0, 0)
976#define _MX53_PAD_PATA_DATA8__EMI_NANDF_D_8 IOMUX_PAD(0x648, 0x2C4, 3, 0x0, 0, 0)
977#define _MX53_PAD_PATA_DATA8__ESDHC3_DAT0 IOMUX_PAD(0x648, 0x2C4, 4, 0x0, 0, 0)
978#define _MX53_PAD_PATA_DATA8__GPU3d_GPU_DEBUG_OUT_8 IOMUX_PAD(0x648, 0x2C4, 5, 0x0, 0, 0)
979#define _MX53_PAD_PATA_DATA8__IPU_DIAG_BUS_8 IOMUX_PAD(0x648, 0x2C4, 6, 0x0, 0, 0)
980#define _MX53_PAD_PATA_DATA9__PATA_DATA_9 IOMUX_PAD(0x64C, 0x2C8, 0, 0x0, 0, 0)
981#define _MX53_PAD_PATA_DATA9__GPIO2_9 IOMUX_PAD(0x64C, 0x2C8, 1, 0x0, 0, 0)
982#define _MX53_PAD_PATA_DATA9__ESDHC1_DAT5 IOMUX_PAD(0x64C, 0x2C8, 2, 0x0, 0, 0)
983#define _MX53_PAD_PATA_DATA9__EMI_NANDF_D_9 IOMUX_PAD(0x64C, 0x2C8, 3, 0x0, 0, 0)
984#define _MX53_PAD_PATA_DATA9__ESDHC3_DAT1 IOMUX_PAD(0x64C, 0x2C8, 4, 0x0, 0, 0)
985#define _MX53_PAD_PATA_DATA9__GPU3d_GPU_DEBUG_OUT_9 IOMUX_PAD(0x64C, 0x2C8, 5, 0x0, 0, 0)
986#define _MX53_PAD_PATA_DATA9__IPU_DIAG_BUS_9 IOMUX_PAD(0x64C, 0x2C8, 6, 0x0, 0, 0)
987#define _MX53_PAD_PATA_DATA10__PATA_DATA_10 IOMUX_PAD(0x650, 0x2CC, 0, 0x0, 0, 0)
988#define _MX53_PAD_PATA_DATA10__GPIO2_10 IOMUX_PAD(0x650, 0x2CC, 1, 0x0, 0, 0)
989#define _MX53_PAD_PATA_DATA10__ESDHC1_DAT6 IOMUX_PAD(0x650, 0x2CC, 2, 0x0, 0, 0)
990#define _MX53_PAD_PATA_DATA10__EMI_NANDF_D_10 IOMUX_PAD(0x650, 0x2CC, 3, 0x0, 0, 0)
991#define _MX53_PAD_PATA_DATA10__ESDHC3_DAT2 IOMUX_PAD(0x650, 0x2CC, 4, 0x0, 0, 0)
992#define _MX53_PAD_PATA_DATA10__GPU3d_GPU_DEBUG_OUT_10 IOMUX_PAD(0x650, 0x2CC, 5, 0x0, 0, 0)
993#define _MX53_PAD_PATA_DATA10__IPU_DIAG_BUS_10 IOMUX_PAD(0x650, 0x2CC, 6, 0x0, 0, 0)
994#define _MX53_PAD_PATA_DATA11__PATA_DATA_11 IOMUX_PAD(0x654, 0x2D0, 0, 0x0, 0, 0)
995#define _MX53_PAD_PATA_DATA11__GPIO2_11 IOMUX_PAD(0x654, 0x2D0, 1, 0x0, 0, 0)
996#define _MX53_PAD_PATA_DATA11__ESDHC1_DAT7 IOMUX_PAD(0x654, 0x2D0, 2, 0x0, 0, 0)
997#define _MX53_PAD_PATA_DATA11__EMI_NANDF_D_11 IOMUX_PAD(0x654, 0x2D0, 3, 0x0, 0, 0)
998#define _MX53_PAD_PATA_DATA11__ESDHC3_DAT3 IOMUX_PAD(0x654, 0x2D0, 4, 0x0, 0, 0)
999#define _MX53_PAD_PATA_DATA11__GPU3d_GPU_DEBUG_OUT_11 IOMUX_PAD(0x654, 0x2D0, 5, 0x0, 0, 0)
1000#define _MX53_PAD_PATA_DATA11__IPU_DIAG_BUS_11 IOMUX_PAD(0x654, 0x2D0, 6, 0x0, 0, 0)
1001#define _MX53_PAD_PATA_DATA12__PATA_DATA_12 IOMUX_PAD(0x658, 0x2D4, 0, 0x0, 0, 0)
1002#define _MX53_PAD_PATA_DATA12__GPIO2_12 IOMUX_PAD(0x658, 0x2D4, 1, 0x0, 0, 0)
1003#define _MX53_PAD_PATA_DATA12__ESDHC2_DAT4 IOMUX_PAD(0x658, 0x2D4, 2, 0x0, 0, 0)
1004#define _MX53_PAD_PATA_DATA12__EMI_NANDF_D_12 IOMUX_PAD(0x658, 0x2D4, 3, 0x0, 0, 0)
1005#define _MX53_PAD_PATA_DATA12__ESDHC4_DAT0 IOMUX_PAD(0x658, 0x2D4, 4, 0x0, 0, 0)
1006#define _MX53_PAD_PATA_DATA12__GPU3d_GPU_DEBUG_OUT_12 IOMUX_PAD(0x658, 0x2D4, 5, 0x0, 0, 0)
1007#define _MX53_PAD_PATA_DATA12__IPU_DIAG_BUS_12 IOMUX_PAD(0x658, 0x2D4, 6, 0x0, 0, 0)
1008#define _MX53_PAD_PATA_DATA13__PATA_DATA_13 IOMUX_PAD(0x65C, 0x2D8, 0, 0x0, 0, 0)
1009#define _MX53_PAD_PATA_DATA13__GPIO2_13 IOMUX_PAD(0x65C, 0x2D8, 1, 0x0, 0, 0)
1010#define _MX53_PAD_PATA_DATA13__ESDHC2_DAT5 IOMUX_PAD(0x65C, 0x2D8, 2, 0x0, 0, 0)
1011#define _MX53_PAD_PATA_DATA13__EMI_NANDF_D_13 IOMUX_PAD(0x65C, 0x2D8, 3, 0x0, 0, 0)
1012#define _MX53_PAD_PATA_DATA13__ESDHC4_DAT1 IOMUX_PAD(0x65C, 0x2D8, 4, 0x0, 0, 0)
1013#define _MX53_PAD_PATA_DATA13__GPU3d_GPU_DEBUG_OUT_13 IOMUX_PAD(0x65C, 0x2D8, 5, 0x0, 0, 0)
1014#define _MX53_PAD_PATA_DATA13__IPU_DIAG_BUS_13 IOMUX_PAD(0x65C, 0x2D8, 6, 0x0, 0, 0)
1015#define _MX53_PAD_PATA_DATA14__PATA_DATA_14 IOMUX_PAD(0x660, 0x2DC, 0, 0x0, 0, 0)
1016#define _MX53_PAD_PATA_DATA14__GPIO2_14 IOMUX_PAD(0x660, 0x2DC, 1, 0x0, 0, 0)
1017#define _MX53_PAD_PATA_DATA14__ESDHC2_DAT6 IOMUX_PAD(0x660, 0x2DC, 2, 0x0, 0, 0)
1018#define _MX53_PAD_PATA_DATA14__EMI_NANDF_D_14 IOMUX_PAD(0x660, 0x2DC, 3, 0x0, 0, 0)
1019#define _MX53_PAD_PATA_DATA14__ESDHC4_DAT2 IOMUX_PAD(0x660, 0x2DC, 4, 0x0, 0, 0)
1020#define _MX53_PAD_PATA_DATA14__GPU3d_GPU_DEBUG_OUT_14 IOMUX_PAD(0x660, 0x2DC, 5, 0x0, 0, 0)
1021#define _MX53_PAD_PATA_DATA14__IPU_DIAG_BUS_14 IOMUX_PAD(0x660, 0x2DC, 6, 0x0, 0, 0)
1022#define _MX53_PAD_PATA_DATA15__PATA_DATA_15 IOMUX_PAD(0x664, 0x2E0, 0, 0x0, 0, 0)
1023#define _MX53_PAD_PATA_DATA15__GPIO2_15 IOMUX_PAD(0x664, 0x2E0, 1, 0x0, 0, 0)
1024#define _MX53_PAD_PATA_DATA15__ESDHC2_DAT7 IOMUX_PAD(0x664, 0x2E0, 2, 0x0, 0, 0)
1025#define _MX53_PAD_PATA_DATA15__EMI_NANDF_D_15 IOMUX_PAD(0x664, 0x2E0, 3, 0x0, 0, 0)
1026#define _MX53_PAD_PATA_DATA15__ESDHC4_DAT3 IOMUX_PAD(0x664, 0x2E0, 4, 0x0, 0, 0)
1027#define _MX53_PAD_PATA_DATA15__GPU3d_GPU_DEBUG_OUT_15 IOMUX_PAD(0x664, 0x2E0, 5, 0x0, 0, 0)
1028#define _MX53_PAD_PATA_DATA15__IPU_DIAG_BUS_15 IOMUX_PAD(0x664, 0x2E0, 6, 0x0, 0, 0)
1029#define _MX53_PAD_SD1_DATA0__ESDHC1_DAT0 IOMUX_PAD(0x66C, 0x2E4, 0, 0x0, 0, 0)
1030#define _MX53_PAD_SD1_DATA0__GPIO1_16 IOMUX_PAD(0x66C, 0x2E4, 1, 0x0, 0, 0)
1031#define _MX53_PAD_SD1_DATA0__GPT_CAPIN1 IOMUX_PAD(0x66C, 0x2E4, 3, 0x0, 0, 0)
1032#define _MX53_PAD_SD1_DATA0__CSPI_MISO IOMUX_PAD(0x66C, 0x2E4, 5, 0x784, 2, 0)
1033#define _MX53_PAD_SD1_DATA0__CCM_PLL3_BYP IOMUX_PAD(0x66C, 0x2E4, 7, 0x778, 0, 0)
1034#define _MX53_PAD_SD1_DATA1__ESDHC1_DAT1 IOMUX_PAD(0x670, 0x2E8, 0, 0x0, 0, 0)
1035#define _MX53_PAD_SD1_DATA1__GPIO1_17 IOMUX_PAD(0x670, 0x2E8, 1, 0x0, 0, 0)
1036#define _MX53_PAD_SD1_DATA1__GPT_CAPIN2 IOMUX_PAD(0x670, 0x2E8, 3, 0x0, 0, 0)
1037#define _MX53_PAD_SD1_DATA1__CSPI_SS0 IOMUX_PAD(0x670, 0x2E8, 5, 0x78C, 3, 0)
1038#define _MX53_PAD_SD1_DATA1__CCM_PLL4_BYP IOMUX_PAD(0x670, 0x2E8, 7, 0x77C, 1, 0)
1039#define _MX53_PAD_SD1_CMD__ESDHC1_CMD IOMUX_PAD(0x674, 0x2EC, IOMUX_CONFIG_SION, 0x0, 0, 0)
1040#define _MX53_PAD_SD1_CMD__GPIO1_18 IOMUX_PAD(0x674, 0x2EC, 1, 0x0, 0, 0)
1041#define _MX53_PAD_SD1_CMD__GPT_CMPOUT1 IOMUX_PAD(0x674, 0x2EC, 3, 0x0, 0, 0)
1042#define _MX53_PAD_SD1_CMD__CSPI_MOSI IOMUX_PAD(0x674, 0x2EC, 5, 0x788, 2, 0)
1043#define _MX53_PAD_SD1_CMD__CCM_PLL1_BYP IOMUX_PAD(0x674, 0x2EC, 7, 0x770, 0, 0)
1044#define _MX53_PAD_SD1_DATA2__ESDHC1_DAT2 IOMUX_PAD(0x678, 0x2F0, 0, 0x0, 0, 0)
1045#define _MX53_PAD_SD1_DATA2__GPIO1_19 IOMUX_PAD(0x678, 0x2F0, 1, 0x0, 0, 0)
1046#define _MX53_PAD_SD1_DATA2__GPT_CMPOUT2 IOMUX_PAD(0x678, 0x2F0, 2, 0x0, 0, 0)
1047#define _MX53_PAD_SD1_DATA2__PWM2_PWMO IOMUX_PAD(0x678, 0x2F0, 3, 0x0, 0, 0)
1048#define _MX53_PAD_SD1_DATA2__WDOG1_WDOG_B IOMUX_PAD(0x678, 0x2F0, 4, 0x0, 0, 0)
1049#define _MX53_PAD_SD1_DATA2__CSPI_SS1 IOMUX_PAD(0x678, 0x2F0, 5, 0x790, 2, 0)
1050#define _MX53_PAD_SD1_DATA2__WDOG1_WDOG_RST_B_DEB IOMUX_PAD(0x678, 0x2F0, 6, 0x0, 0, 0)
1051#define _MX53_PAD_SD1_DATA2__CCM_PLL2_BYP IOMUX_PAD(0x678, 0x2F0, 7, 0x774, 0, 0)
1052#define _MX53_PAD_SD1_CLK__ESDHC1_CLK IOMUX_PAD(0x67C, 0x2F4, 0, 0x0, 0, 0)
1053#define _MX53_PAD_SD1_CLK__GPIO1_20 IOMUX_PAD(0x67C, 0x2F4, 1, 0x0, 0, 0)
1054#define _MX53_PAD_SD1_CLK__OSC32k_32K_OUT IOMUX_PAD(0x67C, 0x2F4, 2, 0x0, 0, 0)
1055#define _MX53_PAD_SD1_CLK__GPT_CLKIN IOMUX_PAD(0x67C, 0x2F4, 3, 0x0, 0, 0)
1056#define _MX53_PAD_SD1_CLK__CSPI_SCLK IOMUX_PAD(0x67C, 0x2F4, 5, 0x780, 2, 0)
1057#define _MX53_PAD_SD1_CLK__SATA_PHY_DTB_0 IOMUX_PAD(0x67C, 0x2F4, 7, 0x0, 0, 0)
1058#define _MX53_PAD_SD1_DATA3__ESDHC1_DAT3 IOMUX_PAD(0x680, 0x2F8, 0, 0x0, 0, 0)
1059#define _MX53_PAD_SD1_DATA3__GPIO1_21 IOMUX_PAD(0x680, 0x2F8, 1, 0x0, 0, 0)
1060#define _MX53_PAD_SD1_DATA3__GPT_CMPOUT3 IOMUX_PAD(0x680, 0x2F8, 2, 0x0, 0, 0)
1061#define _MX53_PAD_SD1_DATA3__PWM1_PWMO IOMUX_PAD(0x680, 0x2F8, 3, 0x0, 0, 0)
1062#define _MX53_PAD_SD1_DATA3__WDOG2_WDOG_B IOMUX_PAD(0x680, 0x2F8, 4, 0x0, 0, 0)
1063#define _MX53_PAD_SD1_DATA3__CSPI_SS2 IOMUX_PAD(0x680, 0x2F8, 5, 0x794, 2, 0)
1064#define _MX53_PAD_SD1_DATA3__WDOG2_WDOG_RST_B_DEB IOMUX_PAD(0x680, 0x2F8, 6, 0x0, 0, 0)
1065#define _MX53_PAD_SD1_DATA3__SATA_PHY_DTB_1 IOMUX_PAD(0x680, 0x2F8, 7, 0x0, 0, 0)
1066#define _MX53_PAD_SD2_CLK__ESDHC2_CLK IOMUX_PAD(0x688, 0x2FC, 0, 0x0, 0, 0)
1067#define _MX53_PAD_SD2_CLK__GPIO1_10 IOMUX_PAD(0x688, 0x2FC, 1, 0x0, 0, 0)
1068#define _MX53_PAD_SD2_CLK__KPP_COL_5 IOMUX_PAD(0x688, 0x2FC, 2, 0x840, 2, 0)
1069#define _MX53_PAD_SD2_CLK__AUDMUX_AUD4_RXFS IOMUX_PAD(0x688, 0x2FC, 3, 0x73C, 1, 0)
1070#define _MX53_PAD_SD2_CLK__CSPI_SCLK IOMUX_PAD(0x688, 0x2FC, 5, 0x780, 3, 0)
1071#define _MX53_PAD_SD2_CLK__SCC_RANDOM_V IOMUX_PAD(0x688, 0x2FC, 7, 0x0, 0, 0)
1072#define _MX53_PAD_SD2_CMD__ESDHC2_CMD IOMUX_PAD(0x68C, 0x300, 0, 0x0, 0, 0)
1073#define _MX53_PAD_SD2_CMD__GPIO1_11 IOMUX_PAD(0x68C, 0x300, 1, 0x0, 0, 0)
1074#define _MX53_PAD_SD2_CMD__KPP_ROW_5 IOMUX_PAD(0x68C, 0x300, 2, 0x84C, 1, 0)
1075#define _MX53_PAD_SD2_CMD__AUDMUX_AUD4_RXC IOMUX_PAD(0x68C, 0x300, 3, 0x738, 1, 0)
1076#define _MX53_PAD_SD2_CMD__CSPI_MOSI IOMUX_PAD(0x68C, 0x300, 5, 0x788, 3, 0)
1077#define _MX53_PAD_SD2_CMD__SCC_RANDOM IOMUX_PAD(0x68C, 0x300, 7, 0x0, 0, 0)
1078#define _MX53_PAD_SD2_DATA3__ESDHC2_DAT3 IOMUX_PAD(0x690, 0x304, 0, 0x0, 0, 0)
1079#define _MX53_PAD_SD2_DATA3__GPIO1_12 IOMUX_PAD(0x690, 0x304, 1, 0x0, 0, 0)
1080#define _MX53_PAD_SD2_DATA3__KPP_COL_6 IOMUX_PAD(0x690, 0x304, 2, 0x844, 1, 0)
1081#define _MX53_PAD_SD2_DATA3__AUDMUX_AUD4_TXC IOMUX_PAD(0x690, 0x304, 3, 0x740, 1, 0)
1082#define _MX53_PAD_SD2_DATA3__CSPI_SS2 IOMUX_PAD(0x690, 0x304, 5, 0x794, 3, 0)
1083#define _MX53_PAD_SD2_DATA3__SJC_DONE IOMUX_PAD(0x690, 0x304, 7, 0x0, 0, 0)
1084#define _MX53_PAD_SD2_DATA2__ESDHC2_DAT2 IOMUX_PAD(0x694, 0x308, 0, 0x0, 0, 0)
1085#define _MX53_PAD_SD2_DATA2__GPIO1_13 IOMUX_PAD(0x694, 0x308, 1, 0x0, 0, 0)
1086#define _MX53_PAD_SD2_DATA2__KPP_ROW_6 IOMUX_PAD(0x694, 0x308, 2, 0x850, 1, 0)
1087#define _MX53_PAD_SD2_DATA2__AUDMUX_AUD4_TXD IOMUX_PAD(0x694, 0x308, 3, 0x734, 1, 0)
1088#define _MX53_PAD_SD2_DATA2__CSPI_SS1 IOMUX_PAD(0x694, 0x308, 5, 0x790, 3, 0)
1089#define _MX53_PAD_SD2_DATA2__SJC_FAIL IOMUX_PAD(0x694, 0x308, 7, 0x0, 0, 0)
1090#define _MX53_PAD_SD2_DATA1__ESDHC2_DAT1 IOMUX_PAD(0x698, 0x30C, 0, 0x0, 0, 0)
1091#define _MX53_PAD_SD2_DATA1__GPIO1_14 IOMUX_PAD(0x698, 0x30C, 1, 0x0, 0, 0)
1092#define _MX53_PAD_SD2_DATA1__KPP_COL_7 IOMUX_PAD(0x698, 0x30C, 2, 0x848, 1, 0)
1093#define _MX53_PAD_SD2_DATA1__AUDMUX_AUD4_TXFS IOMUX_PAD(0x698, 0x30C, 3, 0x744, 0, 0)
1094#define _MX53_PAD_SD2_DATA1__CSPI_SS0 IOMUX_PAD(0x698, 0x30C, 5, 0x78C, 4, 0)
1095#define _MX53_PAD_SD2_DATA1__RTIC_SEC_VIO IOMUX_PAD(0x698, 0x30C, 7, 0x0, 0, 0)
1096#define _MX53_PAD_SD2_DATA0__ESDHC2_DAT0 IOMUX_PAD(0x69C, 0x310, 0, 0x0, 0, 0)
1097#define _MX53_PAD_SD2_DATA0__GPIO1_15 IOMUX_PAD(0x69C, 0x310, 1, 0x0, 0, 0)
1098#define _MX53_PAD_SD2_DATA0__KPP_ROW_7 IOMUX_PAD(0x69C, 0x310, 2, 0x854, 1, 0)
1099#define _MX53_PAD_SD2_DATA0__AUDMUX_AUD4_RXD IOMUX_PAD(0x69C, 0x310, 3, 0x730, 1, 0)
1100#define _MX53_PAD_SD2_DATA0__CSPI_MISO IOMUX_PAD(0x69C, 0x310, 5, 0x784, 3, 0)
1101#define _MX53_PAD_SD2_DATA0__RTIC_DONE_INT IOMUX_PAD(0x69C, 0x310, 7, 0x0, 0, 0)
1102#define _MX53_PAD_GPIO_0__CCM_CLKO IOMUX_PAD(0x6A4, 0x314, 0, 0x0, 0, 0)
1103#define _MX53_PAD_GPIO_0__GPIO1_0 IOMUX_PAD(0x6A4, 0x314, 1, 0x0, 0, 0)
1104#define _MX53_PAD_GPIO_0__KPP_COL_5 IOMUX_PAD(0x6A4, 0x314, 2, 0x840, 3, 0)
1105#define _MX53_PAD_GPIO_0__CCM_SSI_EXT1_CLK IOMUX_PAD(0x6A4, 0x314, 3, 0x0, 0, 0)
1106#define _MX53_PAD_GPIO_0__EPIT1_EPITO IOMUX_PAD(0x6A4, 0x314, 4, 0x0, 0, 0)
1107#define _MX53_PAD_GPIO_0__SRTC_ALARM_DEB IOMUX_PAD(0x6A4, 0x314, 5, 0x0, 0, 0)
1108#define _MX53_PAD_GPIO_0__USBOH3_USBH1_PWR IOMUX_PAD(0x6A4, 0x314, 6, 0x0, 0, 0)
1109#define _MX53_PAD_GPIO_0__CSU_TD IOMUX_PAD(0x6A4, 0x314, 7, 0x0, 0, 0)
1110#define _MX53_PAD_GPIO_1__ESAI1_SCKR IOMUX_PAD(0x6A8, 0x318, 0, 0x7DC, 1, 0)
1111#define _MX53_PAD_GPIO_1__GPIO1_1 IOMUX_PAD(0x6A8, 0x318, 1, 0x0, 0, 0)
1112#define _MX53_PAD_GPIO_1__KPP_ROW_5 IOMUX_PAD(0x6A8, 0x318, 2, 0x84C, 2, 0)
1113#define _MX53_PAD_GPIO_1__CCM_SSI_EXT2_CLK IOMUX_PAD(0x6A8, 0x318, 3, 0x0, 0, 0)
1114#define _MX53_PAD_GPIO_1__PWM2_PWMO IOMUX_PAD(0x6A8, 0x318, 4, 0x0, 0, 0)
1115#define _MX53_PAD_GPIO_1__WDOG2_WDOG_B IOMUX_PAD(0x6A8, 0x318, 5, 0x0, 0, 0)
1116#define _MX53_PAD_GPIO_1__ESDHC1_CD IOMUX_PAD(0x6A8, 0x318, 6, 0x0, 0, 0)
1117#define _MX53_PAD_GPIO_1__SRC_TESTER_ACK IOMUX_PAD(0x6A8, 0x318, 7, 0x0, 0, 0)
1118#define _MX53_PAD_GPIO_9__ESAI1_FSR IOMUX_PAD(0x6AC, 0x31C, 0, 0x7CC, 1, 0)
1119#define _MX53_PAD_GPIO_9__GPIO1_9 IOMUX_PAD(0x6AC, 0x31C, 1, 0x0, 0, 0)
1120#define _MX53_PAD_GPIO_9__KPP_COL_6 IOMUX_PAD(0x6AC, 0x31C, 2, 0x844, 2, 0)
1121#define _MX53_PAD_GPIO_9__CCM_REF_EN_B IOMUX_PAD(0x6AC, 0x31C, 3, 0x0, 0, 0)
1122#define _MX53_PAD_GPIO_9__PWM1_PWMO IOMUX_PAD(0x6AC, 0x31C, 4, 0x0, 0, 0)
1123#define _MX53_PAD_GPIO_9__WDOG1_WDOG_B IOMUX_PAD(0x6AC, 0x31C, 5, 0x0, 0, 0)
1124#define _MX53_PAD_GPIO_9__ESDHC1_WP IOMUX_PAD(0x6AC, 0x31C, 6, 0x7FC, 1, 0)
1125#define _MX53_PAD_GPIO_9__SCC_FAIL_STATE IOMUX_PAD(0x6AC, 0x31C, 7, 0x0, 0, 0)
1126#define _MX53_PAD_GPIO_3__ESAI1_HCKR IOMUX_PAD(0x6B0, 0x320, 0, 0x7D4, 1, 0)
1127#define _MX53_PAD_GPIO_3__GPIO1_3 IOMUX_PAD(0x6B0, 0x320, 1, 0x0, 0, 0)
1128#define _MX53_PAD_GPIO_3__I2C3_SCL IOMUX_PAD(0x6B0, 0x320, 2 | IOMUX_CONFIG_SION, 0x824, 1, 0)
1129#define _MX53_PAD_GPIO_3__DPLLIP1_TOG_EN IOMUX_PAD(0x6B0, 0x320, 3, 0x0, 0, 0)
1130#define _MX53_PAD_GPIO_3__CCM_CLKO2 IOMUX_PAD(0x6B0, 0x320, 4, 0x0, 0, 0)
1131#define _MX53_PAD_GPIO_3__OBSERVE_MUX_OBSRV_INT_OUT0 IOMUX_PAD(0x6B0, 0x320, 5, 0x0, 0, 0)
1132#define _MX53_PAD_GPIO_3__USBOH3_USBH1_OC IOMUX_PAD(0x6B0, 0x320, 6, 0x8A0, 1, 0)
1133#define _MX53_PAD_GPIO_3__MLB_MLBCLK IOMUX_PAD(0x6B0, 0x320, 7, 0x858, 2, 0)
1134#define _MX53_PAD_GPIO_6__ESAI1_SCKT IOMUX_PAD(0x6B4, 0x324, 0, 0x7E0, 1, 0)
1135#define _MX53_PAD_GPIO_6__GPIO1_6 IOMUX_PAD(0x6B4, 0x324, 1, 0x0, 0, 0)
1136#define _MX53_PAD_GPIO_6__I2C3_SDA IOMUX_PAD(0x6B4, 0x324, 2 | IOMUX_CONFIG_SION, 0x828, 1, 0)
1137#define _MX53_PAD_GPIO_6__CCM_CCM_OUT_0 IOMUX_PAD(0x6B4, 0x324, 3, 0x0, 0, 0)
1138#define _MX53_PAD_GPIO_6__CSU_CSU_INT_DEB IOMUX_PAD(0x6B4, 0x324, 4, 0x0, 0, 0)
1139#define _MX53_PAD_GPIO_6__OBSERVE_MUX_OBSRV_INT_OUT1 IOMUX_PAD(0x6B4, 0x324, 5, 0x0, 0, 0)
1140#define _MX53_PAD_GPIO_6__ESDHC2_LCTL IOMUX_PAD(0x6B4, 0x324, 6, 0x0, 0, 0)
1141#define _MX53_PAD_GPIO_6__MLB_MLBSIG IOMUX_PAD(0x6B4, 0x324, 7, 0x860, 2, 0)
1142#define _MX53_PAD_GPIO_2__ESAI1_FST IOMUX_PAD(0x6B8, 0x328, 0, 0x7D0, 1, 0)
1143#define _MX53_PAD_GPIO_2__GPIO1_2 IOMUX_PAD(0x6B8, 0x328, 1, 0x0, 0, 0)
1144#define _MX53_PAD_GPIO_2__KPP_ROW_6 IOMUX_PAD(0x6B8, 0x328, 2, 0x850, 2, 0)
1145#define _MX53_PAD_GPIO_2__CCM_CCM_OUT_1 IOMUX_PAD(0x6B8, 0x328, 3, 0x0, 0, 0)
1146#define _MX53_PAD_GPIO_2__CSU_CSU_ALARM_AUT_0 IOMUX_PAD(0x6B8, 0x328, 4, 0x0, 0, 0)
1147#define _MX53_PAD_GPIO_2__OBSERVE_MUX_OBSRV_INT_OUT2 IOMUX_PAD(0x6B8, 0x328, 5, 0x0, 0, 0)
1148#define _MX53_PAD_GPIO_2__ESDHC2_WP IOMUX_PAD(0x6B8, 0x328, 6, 0x0, 0, 0)
1149#define _MX53_PAD_GPIO_2__MLB_MLBDAT IOMUX_PAD(0x6B8, 0x328, 7, 0x85C, 2, 0)
1150#define _MX53_PAD_GPIO_4__ESAI1_HCKT IOMUX_PAD(0x6BC, 0x32C, 0, 0x7D8, 1, 0)
1151#define _MX53_PAD_GPIO_4__GPIO1_4 IOMUX_PAD(0x6BC, 0x32C, 1, 0x0, 0, 0)
1152#define _MX53_PAD_GPIO_4__KPP_COL_7 IOMUX_PAD(0x6BC, 0x32C, 2, 0x848, 2, 0)
1153#define _MX53_PAD_GPIO_4__CCM_CCM_OUT_2 IOMUX_PAD(0x6BC, 0x32C, 3, 0x0, 0, 0)
1154#define _MX53_PAD_GPIO_4__CSU_CSU_ALARM_AUT_1 IOMUX_PAD(0x6BC, 0x32C, 4, 0x0, 0, 0)
1155#define _MX53_PAD_GPIO_4__OBSERVE_MUX_OBSRV_INT_OUT3 IOMUX_PAD(0x6BC, 0x32C, 5, 0x0, 0, 0)
1156#define _MX53_PAD_GPIO_4__ESDHC2_CD IOMUX_PAD(0x6BC, 0x32C, 6, 0x0, 0, 0)
1157#define _MX53_PAD_GPIO_4__SCC_SEC_STATE IOMUX_PAD(0x6BC, 0x32C, 7, 0x0, 0, 0)
1158#define _MX53_PAD_GPIO_5__ESAI1_TX2_RX3 IOMUX_PAD(0x6C0, 0x330, 0, 0x7EC, 1, 0)
1159#define _MX53_PAD_GPIO_5__GPIO1_5 IOMUX_PAD(0x6C0, 0x330, 1, 0x0, 0, 0)
1160#define _MX53_PAD_GPIO_5__KPP_ROW_7 IOMUX_PAD(0x6C0, 0x330, 2, 0x854, 2, 0)
1161#define _MX53_PAD_GPIO_5__CCM_CLKO IOMUX_PAD(0x6C0, 0x330, 3, 0x0, 0, 0)
1162#define _MX53_PAD_GPIO_5__CSU_CSU_ALARM_AUT_2 IOMUX_PAD(0x6C0, 0x330, 4, 0x0, 0, 0)
1163#define _MX53_PAD_GPIO_5__OBSERVE_MUX_OBSRV_INT_OUT4 IOMUX_PAD(0x6C0, 0x330, 5, 0x0, 0, 0)
1164#define _MX53_PAD_GPIO_5__I2C3_SCL IOMUX_PAD(0x6C0, 0x330, 6, 0x824, 2, 0)
1165#define _MX53_PAD_GPIO_5__CCM_PLL1_BYP IOMUX_PAD(0x6C0, 0x330, 7, 0x770, 1, 0)
1166#define _MX53_PAD_GPIO_7__ESAI1_TX4_RX1 IOMUX_PAD(0x6C4, 0x334, 0, 0x7F4, 1, 0)
1167#define _MX53_PAD_GPIO_7__GPIO1_7 IOMUX_PAD(0x6C4, 0x334, 1, 0x0, 0, 0)
1168#define _MX53_PAD_GPIO_7__EPIT1_EPITO IOMUX_PAD(0x6C4, 0x334, 2, 0x0, 0, 0)
1169#define _MX53_PAD_GPIO_7__CAN1_TXCAN IOMUX_PAD(0x6C4, 0x334, 3, 0x0, 0, 0)
1170#define _MX53_PAD_GPIO_7__UART2_TXD_MUX IOMUX_PAD(0x6C4, 0x334, 4, 0x880, 4, 0)
1171#define _MX53_PAD_GPIO_7__FIRI_RXD IOMUX_PAD(0x6C4, 0x334, 5, 0x80C, 1, 0)
1172#define _MX53_PAD_GPIO_7__SPDIF_PLOCK IOMUX_PAD(0x6C4, 0x334, 6, 0x0, 0, 0)
1173#define _MX53_PAD_GPIO_7__CCM_PLL2_BYP IOMUX_PAD(0x6C4, 0x334, 7, 0x774, 1, 0)
1174#define _MX53_PAD_GPIO_8__ESAI1_TX5_RX0 IOMUX_PAD(0x6C8, 0x338, 0, 0x7F8, 1, 0)
1175#define _MX53_PAD_GPIO_8__GPIO1_8 IOMUX_PAD(0x6C8, 0x338, 1, 0x0, 0, 0)
1176#define _MX53_PAD_GPIO_8__EPIT2_EPITO IOMUX_PAD(0x6C8, 0x338, 2, 0x0, 0, 0)
1177#define _MX53_PAD_GPIO_8__CAN1_RXCAN IOMUX_PAD(0x6C8, 0x338, 3, 0x760, 3, 0)
1178#define _MX53_PAD_GPIO_8__UART2_RXD_MUX IOMUX_PAD(0x6C8, 0x338, 4, 0x880, 5, 0)
1179#define _MX53_PAD_GPIO_8__FIRI_TXD IOMUX_PAD(0x6C8, 0x338, 5, 0x0, 0, 0)
1180#define _MX53_PAD_GPIO_8__SPDIF_SRCLK IOMUX_PAD(0x6C8, 0x338, 6, 0x0, 0, 0)
1181#define _MX53_PAD_GPIO_8__CCM_PLL3_BYP IOMUX_PAD(0x6C8, 0x338, 7, 0x778, 1, 0)
1182#define _MX53_PAD_GPIO_16__ESAI1_TX3_RX2 IOMUX_PAD(0x6CC, 0x33C, 0, 0x7F0, 1, 0)
1183#define _MX53_PAD_GPIO_16__GPIO7_11 IOMUX_PAD(0x6CC, 0x33C, 1, 0x0, 0, 0)
1184#define _MX53_PAD_GPIO_16__TZIC_PWRFAIL_INT IOMUX_PAD(0x6CC, 0x33C, 2, 0x0, 0, 0)
1185#define _MX53_PAD_GPIO_16__RTC_CE_RTC_EXT_TRIG1 IOMUX_PAD(0x6CC, 0x33C, 4, 0x0, 0, 0)
1186#define _MX53_PAD_GPIO_16__SPDIF_IN1 IOMUX_PAD(0x6CC, 0x33C, 5, 0x870, 1, 0)
1187#define _MX53_PAD_GPIO_16__I2C3_SDA IOMUX_PAD(0x6CC, 0x33C, 6 | IOMUX_CONFIG_SION, 0x828, 2, 0)
1188#define _MX53_PAD_GPIO_16__SJC_DE_B IOMUX_PAD(0x6CC, 0x33C, 7, 0x0, 0, 0)
1189#define _MX53_PAD_GPIO_17__ESAI1_TX0 IOMUX_PAD(0x6D0, 0x340, 0, 0x7E4, 1, 0)
1190#define _MX53_PAD_GPIO_17__GPIO7_12 IOMUX_PAD(0x6D0, 0x340, 1, 0x0, 0, 0)
1191#define _MX53_PAD_GPIO_17__SDMA_EXT_EVENT_0 IOMUX_PAD(0x6D0, 0x340, 2, 0x868, 1, 0)
1192#define _MX53_PAD_GPIO_17__GPC_PMIC_RDY IOMUX_PAD(0x6D0, 0x340, 3, 0x810, 1, 0)
1193#define _MX53_PAD_GPIO_17__RTC_CE_RTC_FSV_TRIG IOMUX_PAD(0x6D0, 0x340, 4, 0x0, 0, 0)
1194#define _MX53_PAD_GPIO_17__SPDIF_OUT1 IOMUX_PAD(0x6D0, 0x340, 5, 0x0, 0, 0)
1195#define _MX53_PAD_GPIO_17__IPU_SNOOP2 IOMUX_PAD(0x6D0, 0x340, 6, 0x0, 0, 0)
1196#define _MX53_PAD_GPIO_17__SJC_JTAG_ACT IOMUX_PAD(0x6D0, 0x340, 7, 0x0, 0, 0)
1197#define _MX53_PAD_GPIO_18__ESAI1_TX1 IOMUX_PAD(0x6D4, 0x344, 0, 0x7E8, 1, 0)
1198#define _MX53_PAD_GPIO_18__GPIO7_13 IOMUX_PAD(0x6D4, 0x344, 1, 0x0, 0, 0)
1199#define _MX53_PAD_GPIO_18__SDMA_EXT_EVENT_1 IOMUX_PAD(0x6D4, 0x344, 2, 0x86C, 1, 0)
1200#define _MX53_PAD_GPIO_18__OWIRE_LINE IOMUX_PAD(0x6D4, 0x344, 3, 0x864, 1, 0)
1201#define _MX53_PAD_GPIO_18__RTC_CE_RTC_ALARM2_TRIG IOMUX_PAD(0x6D4, 0x344, 4, 0x0, 0, 0)
1202#define _MX53_PAD_GPIO_18__CCM_ASRC_EXT_CLK IOMUX_PAD(0x6D4, 0x344, 5, 0x768, 1, 0)
1203#define _MX53_PAD_GPIO_18__ESDHC1_LCTL IOMUX_PAD(0x6D4, 0x344, 6, 0x0, 0, 0)
1204#define _MX53_PAD_GPIO_18__SRC_SYSTEM_RST IOMUX_PAD(0x6D4, 0x344, 7, 0x0, 0, 0)
63 1205
64#define MX53_PAD_GPIO_19__GPIO_4_5 IOMUX_PAD(0x348, 0x20,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1206#define MX53_PAD_GPIO_19__KPP_COL_5 (_MX53_PAD_GPIO_19__KPP_COL_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
65#define MX53_PAD_KEY_COL0__GPIO_4_6 IOMUX_PAD(0x34C, 0x24,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1207#define MX53_PAD_GPIO_19__GPIO4_5 (_MX53_PAD_GPIO_19__GPIO4_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
66#define MX53_PAD_KEY_ROW0__GPIO_4_7 IOMUX_PAD(0x350, 0x28,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1208#define MX53_PAD_GPIO_19__CCM_CLKO (_MX53_PAD_GPIO_19__CCM_CLKO | MUX_PAD_CTRL(NO_PAD_CTRL))
67#define MX53_PAD_KEY_COL1__GPIO_4_8 IOMUX_PAD(0x354, 0x2C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1209#define MX53_PAD_GPIO_19__SPDIF_OUT1 (_MX53_PAD_GPIO_19__SPDIF_OUT1 | MUX_PAD_CTRL(NO_PAD_CTRL))
68#define MX53_PAD_KEY_ROW1__GPIO_4_9 IOMUX_PAD(0x358, 0x30,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1210#define MX53_PAD_GPIO_19__RTC_CE_RTC_EXT_TRIG2 (_MX53_PAD_GPIO_19__RTC_CE_RTC_EXT_TRIG2 | MUX_PAD_CTRL(NO_PAD_CTRL))
69#define MX53_PAD_KEY_COL2__GPIO_4_10 IOMUX_PAD(0x35C, 0x34,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1211#define MX53_PAD_GPIO_19__ECSPI1_RDY (_MX53_PAD_GPIO_19__ECSPI1_RDY | MUX_PAD_CTRL(NO_PAD_CTRL))
70#define MX53_PAD_KEY_ROW2__GPIO_4_11 IOMUX_PAD(0x360, 0x38,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1212#define MX53_PAD_GPIO_19__FEC_TDATA_3 (_MX53_PAD_GPIO_19__FEC_TDATA_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
71#define MX53_PAD_KEY_COL3__GPIO_4_12 IOMUX_PAD(0x364, 0x3C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1213#define MX53_PAD_GPIO_19__SRC_INT_BOOT (_MX53_PAD_GPIO_19__SRC_INT_BOOT | MUX_PAD_CTRL(NO_PAD_CTRL))
72#define MX53_PAD_KEY_ROW3__GPIO_4_13 IOMUX_PAD(0x368, 0x40,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1214#define MX53_PAD_KEY_COL0__KPP_COL_0 (_MX53_PAD_KEY_COL0__KPP_COL_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
73#define MX53_PAD_KEY_COL4__GPIO_4_14 IOMUX_PAD(0x36C, 0x44,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1215#define MX53_PAD_KEY_COL0__GPIO4_6 (_MX53_PAD_KEY_COL0__GPIO4_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
74#define MX53_PAD_KEY_ROW4__GPIO_4_15 IOMUX_PAD(0x370, 0x48,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1216#define MX53_PAD_KEY_COL0__AUDMUX_AUD5_TXC (_MX53_PAD_KEY_COL0__AUDMUX_AUD5_TXC | MUX_PAD_CTRL(NO_PAD_CTRL))
75#define MX53_PAD_NVCC_KEYPAD__NVCC_KEYPAD IOMUX_PAD(0x374, NON_MUX_I,IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1217#define MX53_PAD_KEY_COL0__UART4_TXD_MUX (_MX53_PAD_KEY_COL0__UART4_TXD_MUX | MUX_PAD_CTRL(NO_PAD_CTRL))
76#define MX53_PAD_DI0_DISP_CLK__GPIO_4_16 IOMUX_PAD(0x378, 0x4C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1218#define MX53_PAD_KEY_COL0__ECSPI1_SCLK (_MX53_PAD_KEY_COL0__ECSPI1_SCLK | MUX_PAD_CTRL(NO_PAD_CTRL))
77#define MX53_PAD_DI0_PIN15__GPIO_4_17 IOMUX_PAD(0x37C, 0x50,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1219#define MX53_PAD_KEY_COL0__FEC_RDATA_3 (_MX53_PAD_KEY_COL0__FEC_RDATA_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
78#define MX53_PAD_DI0_PIN2__GPIO_4_18 IOMUX_PAD(0x380, 0x54,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1220#define MX53_PAD_KEY_COL0__SRC_ANY_PU_RST (_MX53_PAD_KEY_COL0__SRC_ANY_PU_RST | MUX_PAD_CTRL(NO_PAD_CTRL))
79#define MX53_PAD_DI0_PIN3__GPIO_4_19 IOMUX_PAD(0x384, 0x58,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1221#define MX53_PAD_KEY_ROW0__KPP_ROW_0 (_MX53_PAD_KEY_ROW0__KPP_ROW_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
80#define MX53_PAD_DI0_PIN4__GPIO_4_20 IOMUX_PAD(0x388, 0x5C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1222#define MX53_PAD_KEY_ROW0__GPIO4_7 (_MX53_PAD_KEY_ROW0__GPIO4_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
81#define MX53_PAD_DISP0_DAT0__GPIO_4_21 IOMUX_PAD(0x38C, 0x60,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1223#define MX53_PAD_KEY_ROW0__AUDMUX_AUD5_TXD (_MX53_PAD_KEY_ROW0__AUDMUX_AUD5_TXD | MUX_PAD_CTRL(NO_PAD_CTRL))
82#define MX53_PAD_DISP0_DAT1__GPIO_4_22 IOMUX_PAD(0x390, 0x64,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1224#define MX53_PAD_KEY_ROW0__UART4_RXD_MUX (_MX53_PAD_KEY_ROW0__UART4_RXD_MUX | MUX_PAD_CTRL(NO_PAD_CTRL))
83#define MX53_PAD_DISP0_DAT2__GPIO_4_23 IOMUX_PAD(0x394, 0x68,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1225#define MX53_PAD_KEY_ROW0__ECSPI1_MOSI (_MX53_PAD_KEY_ROW0__ECSPI1_MOSI | MUX_PAD_CTRL(NO_PAD_CTRL))
84#define MX53_PAD_DISP0_DAT3__GPIO_4_24 IOMUX_PAD(0x398, 0x6C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1226#define MX53_PAD_KEY_ROW0__FEC_TX_ER (_MX53_PAD_KEY_ROW0__FEC_TX_ER | MUX_PAD_CTRL(NO_PAD_CTRL))
85#define MX53_PAD_DISP0_DAT4__GPIO_4_25 IOMUX_PAD(0x39C, 0x70,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1227#define MX53_PAD_KEY_COL1__KPP_COL_1 (_MX53_PAD_KEY_COL1__KPP_COL_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
86#define MX53_PAD_DISP0_DAT5__GPIO_4_26 IOMUX_PAD(0x3A0, 0x74,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1228#define MX53_PAD_KEY_COL1__GPIO4_8 (_MX53_PAD_KEY_COL1__GPIO4_8 | MUX_PAD_CTRL(NO_PAD_CTRL))
87#define MX53_PAD_DISP0_DAT6__GPIO_4_27 IOMUX_PAD(0x3A4, 0x78,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1229#define MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS (_MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS | MUX_PAD_CTRL(NO_PAD_CTRL))
88#define MX53_PAD_DISP0_DAT7__GPIO_4_28 IOMUX_PAD(0x3A8, 0x7C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1230#define MX53_PAD_KEY_COL1__UART5_TXD_MUX (_MX53_PAD_KEY_COL1__UART5_TXD_MUX | MUX_PAD_CTRL(NO_PAD_CTRL))
89#define MX53_PAD_DISP0_DAT8__GPIO_4_29 IOMUX_PAD(0x3AC, 0x80,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1231#define MX53_PAD_KEY_COL1__ECSPI1_MISO (_MX53_PAD_KEY_COL1__ECSPI1_MISO | MUX_PAD_CTRL(NO_PAD_CTRL))
90#define MX53_PAD_DISP0_DAT9__GPIO_4_30 IOMUX_PAD(0x3B0, 0x84,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1232#define MX53_PAD_KEY_COL1__FEC_RX_CLK (_MX53_PAD_KEY_COL1__FEC_RX_CLK | MUX_PAD_CTRL(NO_PAD_CTRL))
91#define MX53_PAD_DISP0_DAT10__GPIO_4_31 IOMUX_PAD(0x3B4, 0x88,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1233#define MX53_PAD_KEY_COL1__USBPHY1_TXREADY (_MX53_PAD_KEY_COL1__USBPHY1_TXREADY | MUX_PAD_CTRL(NO_PAD_CTRL))
92#define MX53_PAD_DISP0_DAT11__GPIO_5_5 IOMUX_PAD(0x3B8, 0x8C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1234#define MX53_PAD_KEY_ROW1__KPP_ROW_1 (_MX53_PAD_KEY_ROW1__KPP_ROW_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
93#define MX53_PAD_DISP0_DAT12__GPIO_5_6 IOMUX_PAD(0x3BC, 0x90,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1235#define MX53_PAD_KEY_ROW1__GPIO4_9 (_MX53_PAD_KEY_ROW1__GPIO4_9 | MUX_PAD_CTRL(NO_PAD_CTRL))
94#define MX53_PAD_DISP0_DAT13__GPIO_5_7 IOMUX_PAD(0x3C0, 0x94,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1236#define MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD (_MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD | MUX_PAD_CTRL(NO_PAD_CTRL))
95#define MX53_PAD_DISP0_DAT14__GPIO_5_8 IOMUX_PAD(0x3C4, 0x98,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1237#define MX53_PAD_KEY_ROW1__UART5_RXD_MUX (_MX53_PAD_KEY_ROW1__UART5_RXD_MUX | MUX_PAD_CTRL(NO_PAD_CTRL))
96#define MX53_PAD_DISP0_DAT15__GPIO_5_9 IOMUX_PAD(0x3C8, 0x9C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1238#define MX53_PAD_KEY_ROW1__ECSPI1_SS0 (_MX53_PAD_KEY_ROW1__ECSPI1_SS0 | MUX_PAD_CTRL(NO_PAD_CTRL))
97#define MX53_PAD_DISP0_DAT16__GPIO_5_10 IOMUX_PAD(0x3CC, 0xA0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1239#define MX53_PAD_KEY_ROW1__FEC_COL (_MX53_PAD_KEY_ROW1__FEC_COL | MUX_PAD_CTRL(NO_PAD_CTRL))
98#define MX53_PAD_DISP0_DAT17__GPIO_5_11 IOMUX_PAD(0x3D0, 0xA4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1240#define MX53_PAD_KEY_ROW1__USBPHY1_RXVALID (_MX53_PAD_KEY_ROW1__USBPHY1_RXVALID | MUX_PAD_CTRL(NO_PAD_CTRL))
99#define MX53_PAD_DISP0_DAT18__GPIO_5_12 IOMUX_PAD(0x3D4, 0xA8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1241#define MX53_PAD_KEY_COL2__KPP_COL_2 (_MX53_PAD_KEY_COL2__KPP_COL_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
100#define MX53_PAD_DISP0_DAT19__GPIO_5_13 IOMUX_PAD(0x3D8, 0xAC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1242#define MX53_PAD_KEY_COL2__GPIO4_10 (_MX53_PAD_KEY_COL2__GPIO4_10 | MUX_PAD_CTRL(NO_PAD_CTRL))
101#define MX53_PAD_DISP0_DAT20__GPIO_5_14 IOMUX_PAD(0x3DC, 0xB0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1243#define MX53_PAD_KEY_COL2__CAN1_TXCAN (_MX53_PAD_KEY_COL2__CAN1_TXCAN | MUX_PAD_CTRL(NO_PAD_CTRL))
102#define MX53_PAD_DISP0_DAT21__GPIO_5_15 IOMUX_PAD(0x3E0, 0xB4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1244#define MX53_PAD_KEY_COL2__FEC_MDIO (_MX53_PAD_KEY_COL2__FEC_MDIO | MUX_PAD_CTRL(NO_PAD_CTRL))
103#define MX53_PAD_DISP0_DAT22__GPIO_5_16 IOMUX_PAD(0x3E4, 0xB8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1245#define MX53_PAD_KEY_COL2__ECSPI1_SS1 (_MX53_PAD_KEY_COL2__ECSPI1_SS1 | MUX_PAD_CTRL(NO_PAD_CTRL))
104#define MX53_PAD_DISP0_DAT23__GPIO_5_17 IOMUX_PAD(0x3E8, 0xBC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1246#define MX53_PAD_KEY_COL2__FEC_RDATA_2 (_MX53_PAD_KEY_COL2__FEC_RDATA_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
105#define MX53_PAD_CSI0_PIXCLK__GPIO_5_18 IOMUX_PAD(0x3EC, 0xC0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1247#define MX53_PAD_KEY_COL2__USBPHY1_RXACTIVE (_MX53_PAD_KEY_COL2__USBPHY1_RXACTIVE | MUX_PAD_CTRL(NO_PAD_CTRL))
106#define MX53_PAD_CSI0_MCLK__GPIO_5_19 IOMUX_PAD(0x3F0, 0xC4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1248#define MX53_PAD_KEY_ROW2__KPP_ROW_2 (_MX53_PAD_KEY_ROW2__KPP_ROW_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
107#define MX53_PAD_CSI0_DATA_EN__GPIO_5_20 IOMUX_PAD(0x3F4, 0xC8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1249#define MX53_PAD_KEY_ROW2__GPIO4_11 (_MX53_PAD_KEY_ROW2__GPIO4_11 | MUX_PAD_CTRL(NO_PAD_CTRL))
108#define MX53_PAD_CSI0_VSYNC__GPIO_5_21 IOMUX_PAD(0x3F8, 0xCC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1250#define MX53_PAD_KEY_ROW2__CAN1_RXCAN (_MX53_PAD_KEY_ROW2__CAN1_RXCAN | MUX_PAD_CTRL(NO_PAD_CTRL))
109#define MX53_PAD_CSI0_D4__GPIO_5_22 IOMUX_PAD(0x3FC, 0xD0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1251#define MX53_PAD_KEY_ROW2__FEC_MDC (_MX53_PAD_KEY_ROW2__FEC_MDC | MUX_PAD_CTRL(NO_PAD_CTRL))
110#define MX53_PAD_CSI0_D5__GPIO_5_23 IOMUX_PAD(0x400, 0xD4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1252#define MX53_PAD_KEY_ROW2__ECSPI1_SS2 (_MX53_PAD_KEY_ROW2__ECSPI1_SS2 | MUX_PAD_CTRL(NO_PAD_CTRL))
111#define MX53_PAD_CSI0_D6__GPIO_5_24 IOMUX_PAD(0x404, 0xD8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1253#define MX53_PAD_KEY_ROW2__FEC_TDATA_2 (_MX53_PAD_KEY_ROW2__FEC_TDATA_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
112#define MX53_PAD_CSI0_D7__GPIO_5_25 IOMUX_PAD(0x408, 0xDC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1254#define MX53_PAD_KEY_ROW2__USBPHY1_RXERROR (_MX53_PAD_KEY_ROW2__USBPHY1_RXERROR | MUX_PAD_CTRL(NO_PAD_CTRL))
113#define MX53_PAD_CSI0_D8__GPIO_5_26 IOMUX_PAD(0x40C, 0xE0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1255#define MX53_PAD_KEY_COL3__KPP_COL_3 (_MX53_PAD_KEY_COL3__KPP_COL_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
114#define MX53_PAD_CSI0_D9__GPIO_5_27 IOMUX_PAD(0x410, 0xE4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1256#define MX53_PAD_KEY_COL3__GPIO4_12 (_MX53_PAD_KEY_COL3__GPIO4_12 | MUX_PAD_CTRL(NO_PAD_CTRL))
115#define MX53_PAD_CSI0_D10__GPIO_5_28 IOMUX_PAD(0x414, 0xE8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1257#define MX53_PAD_KEY_COL3__USBOH3_H2_DP (_MX53_PAD_KEY_COL3__USBOH3_H2_DP | MUX_PAD_CTRL(NO_PAD_CTRL))
116#define MX53_PAD_CSI0_D11__GPIO_5_29 IOMUX_PAD(0x418, 0xEC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1258#define MX53_PAD_KEY_COL3__SPDIF_IN1 (_MX53_PAD_KEY_COL3__SPDIF_IN1 | MUX_PAD_CTRL(NO_PAD_CTRL))
117#define MX53_PAD_CSI0_D12__GPIO_5_30 IOMUX_PAD(0x41C, 0xF0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1259#define MX53_PAD_KEY_COL3__I2C2_SCL (_MX53_PAD_KEY_COL3__I2C2_SCL | MUX_PAD_CTRL(NO_PAD_CTRL))
118#define MX53_PAD_CSI0_D13__GPIO_5_31 IOMUX_PAD(0x420, 0xF4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1260#define MX53_PAD_KEY_COL3__ECSPI1_SS3 (_MX53_PAD_KEY_COL3__ECSPI1_SS3 | MUX_PAD_CTRL(NO_PAD_CTRL))
119#define MX53_PAD_CSI0_D14__GPIO_6_0 IOMUX_PAD(0x424, 0xF8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1261#define MX53_PAD_KEY_COL3__FEC_CRS (_MX53_PAD_KEY_COL3__FEC_CRS | MUX_PAD_CTRL(NO_PAD_CTRL))
120#define MX53_PAD_CSI0_D15__GPIO_6_1 IOMUX_PAD(0x428, 0xFC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1262#define MX53_PAD_KEY_COL3__USBPHY1_SIECLOCK (_MX53_PAD_KEY_COL3__USBPHY1_SIECLOCK | MUX_PAD_CTRL(NO_PAD_CTRL))
121#define MX53_PAD_CSI0_D16__GPIO_6_2 IOMUX_PAD(0x42C, 0x100,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1263#define MX53_PAD_KEY_ROW3__KPP_ROW_3 (_MX53_PAD_KEY_ROW3__KPP_ROW_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
122#define MX53_PAD_CSI0_D17__GPIO_6_3 IOMUX_PAD(0x430, 0x104,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1264#define MX53_PAD_KEY_ROW3__GPIO4_13 (_MX53_PAD_KEY_ROW3__GPIO4_13 | MUX_PAD_CTRL(NO_PAD_CTRL))
123#define MX53_PAD_CSI0_D18__GPIO_6_4 IOMUX_PAD(0x434, 0x108,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1265#define MX53_PAD_KEY_ROW3__USBOH3_H2_DM (_MX53_PAD_KEY_ROW3__USBOH3_H2_DM | MUX_PAD_CTRL(NO_PAD_CTRL))
124#define MX53_PAD_CSI0_D19__GPIO_6_5 IOMUX_PAD(0x438, 0x10C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1266#define MX53_PAD_KEY_ROW3__CCM_ASRC_EXT_CLK (_MX53_PAD_KEY_ROW3__CCM_ASRC_EXT_CLK | MUX_PAD_CTRL(NO_PAD_CTRL))
125#define MX53_PAD_NVCC_CSI0__NVCC_CSI0 IOMUX_PAD(0x43C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1267#define MX53_PAD_KEY_ROW3__I2C2_SDA (_MX53_PAD_KEY_ROW3__I2C2_SDA | MUX_PAD_CTRL(NO_PAD_CTRL))
126#define MX53_PAD_JTAG_TMS__JTAG_TMS IOMUX_PAD(0x440, NON_MUX_I,IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1268#define MX53_PAD_KEY_ROW3__OSC32K_32K_OUT (_MX53_PAD_KEY_ROW3__OSC32K_32K_OUT | MUX_PAD_CTRL(NO_PAD_CTRL))
127#define MX53_PAD_JTAG_MOD__JTAG_MOD IOMUX_PAD(0x444, NON_MUX_I,IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1269#define MX53_PAD_KEY_ROW3__CCM_PLL4_BYP (_MX53_PAD_KEY_ROW3__CCM_PLL4_BYP | MUX_PAD_CTRL(NO_PAD_CTRL))
128#define MX53_PAD_JTAG_TRSTB__JTAG_TRSTB IOMUX_PAD(0x448, NON_MUX_I,IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1270#define MX53_PAD_KEY_ROW3__USBPHY1_LINESTATE_0 (_MX53_PAD_KEY_ROW3__USBPHY1_LINESTATE_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
129#define MX53_PAD_JTAG_TDI__JTAG_TDI IOMUX_PAD(0x44C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1271#define MX53_PAD_KEY_COL4__KPP_COL_4 (_MX53_PAD_KEY_COL4__KPP_COL_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
130#define MX53_PAD_JTAG_TCK__JTAG_TCK IOMUX_PAD(0x450, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1272#define MX53_PAD_KEY_COL4__GPIO4_14 (_MX53_PAD_KEY_COL4__GPIO4_14 | MUX_PAD_CTRL(NO_PAD_CTRL))
131#define MX53_PAD_JTAG_TDO__JTAG_TDO IOMUX_PAD(0x454, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1273#define MX53_PAD_KEY_COL4__CAN2_TXCAN (_MX53_PAD_KEY_COL4__CAN2_TXCAN | MUX_PAD_CTRL(NO_PAD_CTRL))
132#define MX53_PAD_EIM_A25__GPIO_5_2 IOMUX_PAD(0x458, 0x110,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1274#define MX53_PAD_KEY_COL4__IPU_SISG_4 (_MX53_PAD_KEY_COL4__IPU_SISG_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
133#define MX53_PAD_EIM_EB2__GPIO_2_30 IOMUX_PAD(0x45C, 0x114,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1275#define MX53_PAD_KEY_COL4__UART5_RTS (_MX53_PAD_KEY_COL4__UART5_RTS | MUX_PAD_CTRL(NO_PAD_CTRL))
134#define MX53_PAD_EIM_D16__GPIO_3_16 IOMUX_PAD(0x460, 0x118,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1276#define MX53_PAD_KEY_COL4__USBOH3_USBOTG_OC (_MX53_PAD_KEY_COL4__USBOH3_USBOTG_OC | MUX_PAD_CTRL(NO_PAD_CTRL))
135#define MX53_PAD_EIM_D17__GPIO_3_17 IOMUX_PAD(0x464, 0x11C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1277#define MX53_PAD_KEY_COL4__USBPHY1_LINESTATE_1 (_MX53_PAD_KEY_COL4__USBPHY1_LINESTATE_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
136#define MX53_PAD_EIM_D18__GPIO_3_18 IOMUX_PAD(0x468, 0x120,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1278#define MX53_PAD_KEY_ROW4__KPP_ROW_4 (_MX53_PAD_KEY_ROW4__KPP_ROW_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
137#define MX53_PAD_EIM_D16__CSPI1_SCLK IOMUX_PAD(0x460, 0x118,IOMUX_CONFIG_ALT4, 0x79c, 3, NO_PAD_CTRL) 1279#define MX53_PAD_KEY_ROW4__GPIO4_15 (_MX53_PAD_KEY_ROW4__GPIO4_15 | MUX_PAD_CTRL(NO_PAD_CTRL))
138#define MX53_PAD_EIM_D17__CSPI1_MISO IOMUX_PAD(0x464, 0x11C,IOMUX_CONFIG_ALT4, 0x7a0, 3, NO_PAD_CTRL) 1280#define MX53_PAD_KEY_ROW4__CAN2_RXCAN (_MX53_PAD_KEY_ROW4__CAN2_RXCAN | MUX_PAD_CTRL(NO_PAD_CTRL))
139#define MX53_PAD_EIM_D18__CSPI1_MOSI IOMUX_PAD(0x468, 0x120,IOMUX_CONFIG_ALT4, 0x7a4, 3, NO_PAD_CTRL) 1281#define MX53_PAD_KEY_ROW4__IPU_SISG_5 (_MX53_PAD_KEY_ROW4__IPU_SISG_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
140#define MX53_PAD_EIM_D19__GPIO_3_19 IOMUX_PAD(0x46C, 0x124,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1282#define MX53_PAD_KEY_ROW4__UART5_CTS (_MX53_PAD_KEY_ROW4__UART5_CTS | MUX_PAD_CTRL(NO_PAD_CTRL))
141#define MX53_PAD_EIM_D20__GPIO_3_20 IOMUX_PAD(0x470, 0x128,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1283#define MX53_PAD_KEY_ROW4__USBOH3_USBOTG_PWR (_MX53_PAD_KEY_ROW4__USBOH3_USBOTG_PWR | MUX_PAD_CTRL(NO_PAD_CTRL))
142#define MX53_PAD_EIM_D21__GPIO_3_21 IOMUX_PAD(0x474, 0x12C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1284#define MX53_PAD_KEY_ROW4__USBPHY1_VBUSVALID (_MX53_PAD_KEY_ROW4__USBPHY1_VBUSVALID | MUX_PAD_CTRL(NO_PAD_CTRL))
143#define MX53_PAD_EIM_D22__GPIO_3_22 IOMUX_PAD(0x478, 0x130,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1285#define MX53_PAD_DI0_DISP_CLK__IPU_DI0_DISP_CLK (_MX53_PAD_DI0_DISP_CLK__IPU_DI0_DISP_CLK | MUX_PAD_CTRL(NO_PAD_CTRL))
144#define MX53_PAD_EIM_D23__GPIO_3_23 IOMUX_PAD(0x47C, 0x134,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1286#define MX53_PAD_DI0_DISP_CLK__GPIO4_16 (_MX53_PAD_DI0_DISP_CLK__GPIO4_16 | MUX_PAD_CTRL(NO_PAD_CTRL))
145#define MX53_PAD_EIM_EB3__GPIO_2_31 IOMUX_PAD(0x480, 0x138,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1287#define MX53_PAD_DI0_DISP_CLK__USBOH3_USBH2_DIR (_MX53_PAD_DI0_DISP_CLK__USBOH3_USBH2_DIR | MUX_PAD_CTRL(NO_PAD_CTRL))
146#define MX53_PAD_EIM_D24__GPIO_3_24 IOMUX_PAD(0x484, 0x13C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1288#define MX53_PAD_DI0_DISP_CLK__SDMA_DEBUG_CORE_STATE_0 (_MX53_PAD_DI0_DISP_CLK__SDMA_DEBUG_CORE_STATE_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
147#define MX53_PAD_EIM_D25__GPIO_3_25 IOMUX_PAD(0x488, 0x140,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1289#define MX53_PAD_DI0_DISP_CLK__EMI_EMI_DEBUG_0 (_MX53_PAD_DI0_DISP_CLK__EMI_EMI_DEBUG_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
148#define MX53_PAD_EIM_D26__GPIO_3_26 IOMUX_PAD(0x48C, 0x144,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1290#define MX53_PAD_DI0_DISP_CLK__USBPHY1_AVALID (_MX53_PAD_DI0_DISP_CLK__USBPHY1_AVALID | MUX_PAD_CTRL(NO_PAD_CTRL))
149#define MX53_PAD_EIM_D27__GPIO_3_27 IOMUX_PAD(0x490, 0x148,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1291#define MX53_PAD_DI0_PIN15__IPU_DI0_PIN15 (_MX53_PAD_DI0_PIN15__IPU_DI0_PIN15 | MUX_PAD_CTRL(NO_PAD_CTRL))
150#define MX53_PAD_EIM_D28__GPIO_3_28 IOMUX_PAD(0x494, 0x14C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1292#define MX53_PAD_DI0_PIN15__GPIO4_17 (_MX53_PAD_DI0_PIN15__GPIO4_17 | MUX_PAD_CTRL(NO_PAD_CTRL))
151#define MX53_PAD_EIM_D29__GPIO_3_29 IOMUX_PAD(0x498, 0x150,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1293#define MX53_PAD_DI0_PIN15__AUDMUX_AUD6_TXC (_MX53_PAD_DI0_PIN15__AUDMUX_AUD6_TXC | MUX_PAD_CTRL(NO_PAD_CTRL))
152#define MX53_PAD_EIM_D30__GPIO_3_30 IOMUX_PAD(0x49C, 0x154,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1294#define MX53_PAD_DI0_PIN15__SDMA_DEBUG_CORE_STATE_1 (_MX53_PAD_DI0_PIN15__SDMA_DEBUG_CORE_STATE_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
153#define MX53_PAD_EIM_D31__GPIO_3_31 IOMUX_PAD(0x4A0, 0x158,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1295#define MX53_PAD_DI0_PIN15__EMI_EMI_DEBUG_1 (_MX53_PAD_DI0_PIN15__EMI_EMI_DEBUG_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
154#define MX53_PAD_NVCC_EIM1__NVCC_EIM1 IOMUX_PAD(0x4A4, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1296#define MX53_PAD_DI0_PIN15__USBPHY1_BVALID (_MX53_PAD_DI0_PIN15__USBPHY1_BVALID | MUX_PAD_CTRL(NO_PAD_CTRL))
155#define MX53_PAD_EIM_A24__GPIO_5_4 IOMUX_PAD(0x4A8, 0x15C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1297#define MX53_PAD_DI0_PIN2__IPU_DI0_PIN2 (_MX53_PAD_DI0_PIN2__IPU_DI0_PIN2 | MUX_PAD_CTRL(NO_PAD_CTRL))
156#define MX53_PAD_EIM_A23__GPIO_6_6 IOMUX_PAD(0x4AC, 0x160,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1298#define MX53_PAD_DI0_PIN2__GPIO4_18 (_MX53_PAD_DI0_PIN2__GPIO4_18 | MUX_PAD_CTRL(NO_PAD_CTRL))
157#define MX53_PAD_EIM_A22__GPIO_2_16 IOMUX_PAD(0x4B0, 0x164,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1299#define MX53_PAD_DI0_PIN2__AUDMUX_AUD6_TXD (_MX53_PAD_DI0_PIN2__AUDMUX_AUD6_TXD | MUX_PAD_CTRL(NO_PAD_CTRL))
158#define MX53_PAD_EIM_A21__GPIO_2_17 IOMUX_PAD(0x4B4, 0x168,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1300#define MX53_PAD_DI0_PIN2__SDMA_DEBUG_CORE_STATE_2 (_MX53_PAD_DI0_PIN2__SDMA_DEBUG_CORE_STATE_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
159#define MX53_PAD_EIM_A20__GPIO_2_18 IOMUX_PAD(0x4B8, 0x16C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1301#define MX53_PAD_DI0_PIN2__EMI_EMI_DEBUG_2 (_MX53_PAD_DI0_PIN2__EMI_EMI_DEBUG_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
160#define MX53_PAD_EIM_A19__GPIO_2_19 IOMUX_PAD(0x4BC, 0x170,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1302#define MX53_PAD_DI0_PIN2__USBPHY1_ENDSESSION (_MX53_PAD_DI0_PIN2__USBPHY1_ENDSESSION | MUX_PAD_CTRL(NO_PAD_CTRL))
161#define MX53_PAD_EIM_A18__GPIO_2_20 IOMUX_PAD(0x4C0, 0x174,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1303#define MX53_PAD_DI0_PIN3__IPU_DI0_PIN3 (_MX53_PAD_DI0_PIN3__IPU_DI0_PIN3 | MUX_PAD_CTRL(NO_PAD_CTRL))
162#define MX53_PAD_EIM_A17__GPIO_2_21 IOMUX_PAD(0x4C4, 0x178,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1304#define MX53_PAD_DI0_PIN3__GPIO4_19 (_MX53_PAD_DI0_PIN3__GPIO4_19 | MUX_PAD_CTRL(NO_PAD_CTRL))
163#define MX53_PAD_EIM_A16__GPIO_2_22 IOMUX_PAD(0x4C8, 0x17C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1305#define MX53_PAD_DI0_PIN3__AUDMUX_AUD6_TXFS (_MX53_PAD_DI0_PIN3__AUDMUX_AUD6_TXFS | MUX_PAD_CTRL(NO_PAD_CTRL))
164#define MX53_PAD_EIM_CS0__GPIO_2_23 IOMUX_PAD(0x4CC, 0x180,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1306#define MX53_PAD_DI0_PIN3__SDMA_DEBUG_CORE_STATE_3 (_MX53_PAD_DI0_PIN3__SDMA_DEBUG_CORE_STATE_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
165#define MX53_PAD_EIM_CS1__GPIO_2_24 IOMUX_PAD(0x4D0, 0x184,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1307#define MX53_PAD_DI0_PIN3__EMI_EMI_DEBUG_3 (_MX53_PAD_DI0_PIN3__EMI_EMI_DEBUG_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
166#define MX53_PAD_EIM_OE__GPIO_2_25 IOMUX_PAD(0x4D4, 0x188,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1308#define MX53_PAD_DI0_PIN3__USBPHY1_IDDIG (_MX53_PAD_DI0_PIN3__USBPHY1_IDDIG | MUX_PAD_CTRL(NO_PAD_CTRL))
167#define MX53_PAD_EIM_RW__GPIO_2_26 IOMUX_PAD(0x4D8, 0x18C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1309#define MX53_PAD_DI0_PIN4__IPU_DI0_PIN4 (_MX53_PAD_DI0_PIN4__IPU_DI0_PIN4 | MUX_PAD_CTRL(NO_PAD_CTRL))
168#define MX53_PAD_EIM_LBA__GPIO_2_27 IOMUX_PAD(0x4DC, 0x190,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1310#define MX53_PAD_DI0_PIN4__GPIO4_20 (_MX53_PAD_DI0_PIN4__GPIO4_20 | MUX_PAD_CTRL(NO_PAD_CTRL))
169#define MX53_PAD_NVCC_EIM4__NVCC_EIM4 IOMUX_PAD(0x4E0, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1311#define MX53_PAD_DI0_PIN4__AUDMUX_AUD6_RXD (_MX53_PAD_DI0_PIN4__AUDMUX_AUD6_RXD | MUX_PAD_CTRL(NO_PAD_CTRL))
170#define MX53_PAD_EIM_EB0__GPIO_2_28 IOMUX_PAD(0x4E4, 0x194,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1312#define MX53_PAD_DI0_PIN4__ESDHC1_WP (_MX53_PAD_DI0_PIN4__ESDHC1_WP | MUX_PAD_CTRL(NO_PAD_CTRL))
171#define MX53_PAD_EIM_EB1__GPIO_2_29 IOMUX_PAD(0x4E8, 0x198,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1313#define MX53_PAD_DI0_PIN4__SDMA_DEBUG_YIELD (_MX53_PAD_DI0_PIN4__SDMA_DEBUG_YIELD | MUX_PAD_CTRL(NO_PAD_CTRL))
172#define MX53_PAD_EIM_DA0__GPIO_3_0 IOMUX_PAD(0x4EC, 0x19C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1314#define MX53_PAD_DI0_PIN4__EMI_EMI_DEBUG_4 (_MX53_PAD_DI0_PIN4__EMI_EMI_DEBUG_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
173#define MX53_PAD_EIM_DA1__GPIO_3_1 IOMUX_PAD(0x4F0, 0x1A0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1315#define MX53_PAD_DI0_PIN4__USBPHY1_HOSTDISCONNECT (_MX53_PAD_DI0_PIN4__USBPHY1_HOSTDISCONNECT | MUX_PAD_CTRL(NO_PAD_CTRL))
174#define MX53_PAD_EIM_DA2__GPIO_3_2 IOMUX_PAD(0x4F4, 0x1A4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1316#define MX53_PAD_DISP0_DAT0__IPU_DISP0_DAT_0 (_MX53_PAD_DISP0_DAT0__IPU_DISP0_DAT_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
175#define MX53_PAD_EIM_DA3__GPIO_3_3 IOMUX_PAD(0x4F8, 0x1A8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1317#define MX53_PAD_DISP0_DAT0__GPIO4_21 (_MX53_PAD_DISP0_DAT0__GPIO4_21 | MUX_PAD_CTRL(NO_PAD_CTRL))
176#define MX53_PAD_EIM_DA4__GPIO_3_4 IOMUX_PAD(0x4FC, 0x1AC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1318#define MX53_PAD_DISP0_DAT0__CSPI_SCLK (_MX53_PAD_DISP0_DAT0__CSPI_SCLK | MUX_PAD_CTRL(NO_PAD_CTRL))
177#define MX53_PAD_EIM_DA5__GPIO_3_5 IOMUX_PAD(0x500, 0x1B0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1319#define MX53_PAD_DISP0_DAT0__USBOH3_USBH2_DATA_0 (_MX53_PAD_DISP0_DAT0__USBOH3_USBH2_DATA_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
178#define MX53_PAD_EIM_DA6__GPIO_3_6 IOMUX_PAD(0x504, 0x1B4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1320#define MX53_PAD_DISP0_DAT0__SDMA_DEBUG_CORE_RUN (_MX53_PAD_DISP0_DAT0__SDMA_DEBUG_CORE_RUN | MUX_PAD_CTRL(NO_PAD_CTRL))
179#define MX53_PAD_EIM_DA7__GPIO_3_7 IOMUX_PAD(0x508, 0x1B8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1321#define MX53_PAD_DISP0_DAT0__EMI_EMI_DEBUG_5 (_MX53_PAD_DISP0_DAT0__EMI_EMI_DEBUG_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
180#define MX53_PAD_EIM_DA8__GPIO_3_8 IOMUX_PAD(0x50C, 0x1BC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1322#define MX53_PAD_DISP0_DAT0__USBPHY2_TXREADY (_MX53_PAD_DISP0_DAT0__USBPHY2_TXREADY | MUX_PAD_CTRL(NO_PAD_CTRL))
181#define MX53_PAD_EIM_DA9__GPIO_3_9 IOMUX_PAD(0x510, 0x1C0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1323#define MX53_PAD_DISP0_DAT1__IPU_DISP0_DAT_1 (_MX53_PAD_DISP0_DAT1__IPU_DISP0_DAT_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
182#define MX53_PAD_EIM_DA10__GPIO_3_10 IOMUX_PAD(0x514, 0x1C4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1324#define MX53_PAD_DISP0_DAT1__GPIO4_22 (_MX53_PAD_DISP0_DAT1__GPIO4_22 | MUX_PAD_CTRL(NO_PAD_CTRL))
183#define MX53_PAD_EIM_DA11__GPIO_3_11 IOMUX_PAD(0x518, 0x1C8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1325#define MX53_PAD_DISP0_DAT1__CSPI_MOSI (_MX53_PAD_DISP0_DAT1__CSPI_MOSI | MUX_PAD_CTRL(NO_PAD_CTRL))
184#define MX53_PAD_EIM_DA12__GPIO_3_12 IOMUX_PAD(0x51C, 0x1CC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1326#define MX53_PAD_DISP0_DAT1__USBOH3_USBH2_DATA_1 (_MX53_PAD_DISP0_DAT1__USBOH3_USBH2_DATA_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
185#define MX53_PAD_EIM_DA13__GPIO_3_13 IOMUX_PAD(0x520, 0x1D0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1327#define MX53_PAD_DISP0_DAT1__SDMA_DEBUG_EVENT_CHANNEL_SEL (_MX53_PAD_DISP0_DAT1__SDMA_DEBUG_EVENT_CHANNEL_SEL | MUX_PAD_CTRL(NO_PAD_CTRL))
186#define MX53_PAD_EIM_DA14__GPIO_3_14 IOMUX_PAD(0x524, 0x1D4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1328#define MX53_PAD_DISP0_DAT1__EMI_EMI_DEBUG_6 (_MX53_PAD_DISP0_DAT1__EMI_EMI_DEBUG_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
187#define MX53_PAD_EIM_DA15__GPIO_3_15 IOMUX_PAD(0x528, 0x1D8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1329#define MX53_PAD_DISP0_DAT1__USBPHY2_RXVALID (_MX53_PAD_DISP0_DAT1__USBPHY2_RXVALID | MUX_PAD_CTRL(NO_PAD_CTRL))
188#define MX53_PAD_NANDF_WE_B__GPIO_6_12 IOMUX_PAD(0x52C, 0x1DC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1330#define MX53_PAD_DISP0_DAT2__IPU_DISP0_DAT_2 (_MX53_PAD_DISP0_DAT2__IPU_DISP0_DAT_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
189#define MX53_PAD_NANDF_RE_B__GPIO_6_13 IOMUX_PAD(0x530, 0x1E0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1331#define MX53_PAD_DISP0_DAT2__GPIO4_23 (_MX53_PAD_DISP0_DAT2__GPIO4_23 | MUX_PAD_CTRL(NO_PAD_CTRL))
190#define MX53_PAD_EIM_WAIT__GPIO_5_0 IOMUX_PAD(0x534, 0x1E4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1332#define MX53_PAD_DISP0_DAT2__CSPI_MISO (_MX53_PAD_DISP0_DAT2__CSPI_MISO | MUX_PAD_CTRL(NO_PAD_CTRL))
191#define MX53_PAD_EIM_BCLK__EIM_BCLK IOMUX_PAD(0x538, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1333#define MX53_PAD_DISP0_DAT2__USBOH3_USBH2_DATA_2 (_MX53_PAD_DISP0_DAT2__USBOH3_USBH2_DATA_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
192#define MX53_PAD_NVCC_EIM7__NVCC_EIM7 IOMUX_PAD(0x53C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1334#define MX53_PAD_DISP0_DAT2__SDMA_DEBUG_MODE (_MX53_PAD_DISP0_DAT2__SDMA_DEBUG_MODE | MUX_PAD_CTRL(NO_PAD_CTRL))
193#define MX53_PAD_LVDS1_TX3_P__GPIO_6_22 IOMUX_PAD(NON_PAD_I, 0x1EC, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1335#define MX53_PAD_DISP0_DAT2__EMI_EMI_DEBUG_7 (_MX53_PAD_DISP0_DAT2__EMI_EMI_DEBUG_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
194#define MX53_PAD_LVDS1_TX2_P__GPIO_6_24 IOMUX_PAD(NON_PAD_I, 0x1F0, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1336#define MX53_PAD_DISP0_DAT2__USBPHY2_RXACTIVE (_MX53_PAD_DISP0_DAT2__USBPHY2_RXACTIVE | MUX_PAD_CTRL(NO_PAD_CTRL))
195#define MX53_PAD_LVDS1_CLK_P__GPIO_6_26 IOMUX_PAD(NON_PAD_I, 0x1F4, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1337#define MX53_PAD_DISP0_DAT3__IPU_DISP0_DAT_3 (_MX53_PAD_DISP0_DAT3__IPU_DISP0_DAT_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
196#define MX53_PAD_LVDS1_TX1_P__GPIO_6_28 IOMUX_PAD(NON_PAD_I, 0x1F8, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1338#define MX53_PAD_DISP0_DAT3__GPIO4_24 (_MX53_PAD_DISP0_DAT3__GPIO4_24 | MUX_PAD_CTRL(NO_PAD_CTRL))
197#define MX53_PAD_LVDS1_TX0_P__GPIO_6_30 IOMUX_PAD(NON_PAD_I, 0x1FC, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1339#define MX53_PAD_DISP0_DAT3__CSPI_SS0 (_MX53_PAD_DISP0_DAT3__CSPI_SS0 | MUX_PAD_CTRL(NO_PAD_CTRL))
198#define MX53_PAD_LVDS0_TX3_P__GPIO_7_22 IOMUX_PAD(NON_PAD_I, 0x200, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1340#define MX53_PAD_DISP0_DAT3__USBOH3_USBH2_DATA_3 (_MX53_PAD_DISP0_DAT3__USBOH3_USBH2_DATA_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
199#define MX53_PAD_LVDS0_CLK_P__GPIO_7_24 IOMUX_PAD(NON_PAD_I, 0x204, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1341#define MX53_PAD_DISP0_DAT3__SDMA_DEBUG_BUS_ERROR (_MX53_PAD_DISP0_DAT3__SDMA_DEBUG_BUS_ERROR | MUX_PAD_CTRL(NO_PAD_CTRL))
200#define MX53_PAD_LVDS0_TX2_P__GPIO_7_26 IOMUX_PAD(NON_PAD_I, 0x208, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1342#define MX53_PAD_DISP0_DAT3__EMI_EMI_DEBUG_8 (_MX53_PAD_DISP0_DAT3__EMI_EMI_DEBUG_8 | MUX_PAD_CTRL(NO_PAD_CTRL))
201#define MX53_PAD_LVDS0_TX1_P__GPIO_7_28 IOMUX_PAD(NON_PAD_I, 0x20C, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1343#define MX53_PAD_DISP0_DAT3__USBPHY2_RXERROR (_MX53_PAD_DISP0_DAT3__USBPHY2_RXERROR | MUX_PAD_CTRL(NO_PAD_CTRL))
202#define MX53_PAD_LVDS0_TX0_P__GPIO_7_30 IOMUX_PAD(NON_PAD_I, 0x210, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1344#define MX53_PAD_DISP0_DAT4__IPU_DISP0_DAT_4 (_MX53_PAD_DISP0_DAT4__IPU_DISP0_DAT_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
203#define MX53_PAD_GPIO_10__GPIO_4_0 IOMUX_PAD(0x540, 0x214, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1345#define MX53_PAD_DISP0_DAT4__GPIO4_25 (_MX53_PAD_DISP0_DAT4__GPIO4_25 | MUX_PAD_CTRL(NO_PAD_CTRL))
204#define MX53_PAD_GPIO_11__GPIO_4_1 IOMUX_PAD(0x544, 0x218, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1346#define MX53_PAD_DISP0_DAT4__CSPI_SS1 (_MX53_PAD_DISP0_DAT4__CSPI_SS1 | MUX_PAD_CTRL(NO_PAD_CTRL))
205#define MX53_PAD_GPIO_12__GPIO_4_2 IOMUX_PAD(0x548, 0x21C, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1347#define MX53_PAD_DISP0_DAT4__USBOH3_USBH2_DATA_4 (_MX53_PAD_DISP0_DAT4__USBOH3_USBH2_DATA_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
206#define MX53_PAD_GPIO_13__GPIO_4_3 IOMUX_PAD(0x54C, 0x220, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1348#define MX53_PAD_DISP0_DAT4__SDMA_DEBUG_BUS_RWB (_MX53_PAD_DISP0_DAT4__SDMA_DEBUG_BUS_RWB | MUX_PAD_CTRL(NO_PAD_CTRL))
207#define MX53_PAD_GPIO_14__GPIO_4_4 IOMUX_PAD(0x550, 0x224, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1349#define MX53_PAD_DISP0_DAT4__EMI_EMI_DEBUG_9 (_MX53_PAD_DISP0_DAT4__EMI_EMI_DEBUG_9 | MUX_PAD_CTRL(NO_PAD_CTRL))
208#define MX53_PAD_DRAM_DQM3__DRAM_DQM3 IOMUX_PAD(0x554, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1350#define MX53_PAD_DISP0_DAT4__USBPHY2_SIECLOCK (_MX53_PAD_DISP0_DAT4__USBPHY2_SIECLOCK | MUX_PAD_CTRL(NO_PAD_CTRL))
209#define MX53_PAD_DRAM_SDQS3__DRAM_SDQS3 IOMUX_PAD(0x558, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1351#define MX53_PAD_DISP0_DAT5__IPU_DISP0_DAT_5 (_MX53_PAD_DISP0_DAT5__IPU_DISP0_DAT_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
210#define MX53_PAD_DRAM_SDCKE1__DRAM_SDCKE1 IOMUX_PAD(0x55C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1352#define MX53_PAD_DISP0_DAT5__GPIO4_26 (_MX53_PAD_DISP0_DAT5__GPIO4_26 | MUX_PAD_CTRL(NO_PAD_CTRL))
211#define MX53_PAD_DRAM_DQM2__DRAM_DQM2 IOMUX_PAD(0x560, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1353#define MX53_PAD_DISP0_DAT5__CSPI_SS2 (_MX53_PAD_DISP0_DAT5__CSPI_SS2 | MUX_PAD_CTRL(NO_PAD_CTRL))
212#define MX53_PAD_DRAM_SDODT1__DRAM_SDODT1 IOMUX_PAD(0x564, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1354#define MX53_PAD_DISP0_DAT5__USBOH3_USBH2_DATA_5 (_MX53_PAD_DISP0_DAT5__USBOH3_USBH2_DATA_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
213#define MX53_PAD_DRAM_SDQS2__DRAM_SDQS2 IOMUX_PAD(0x568, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1355#define MX53_PAD_DISP0_DAT5__SDMA_DEBUG_MATCHED_DMBUS (_MX53_PAD_DISP0_DAT5__SDMA_DEBUG_MATCHED_DMBUS | MUX_PAD_CTRL(NO_PAD_CTRL))
214#define MX53_PAD_DRAM_RESET__DRAM_RESET IOMUX_PAD(0x56C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1356#define MX53_PAD_DISP0_DAT5__EMI_EMI_DEBUG_10 (_MX53_PAD_DISP0_DAT5__EMI_EMI_DEBUG_10 | MUX_PAD_CTRL(NO_PAD_CTRL))
215#define MX53_PAD_DRAM_SDCLK1__DRAM_SDCLK1 IOMUX_PAD(0x570, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1357#define MX53_PAD_DISP0_DAT5__USBPHY2_LINESTATE_0 (_MX53_PAD_DISP0_DAT5__USBPHY2_LINESTATE_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
216#define MX53_PAD_DRAM_CAS__DRAM_CAS IOMUX_PAD(0x574, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1358#define MX53_PAD_DISP0_DAT6__IPU_DISP0_DAT_6 (_MX53_PAD_DISP0_DAT6__IPU_DISP0_DAT_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
217#define MX53_PAD_DRAM_SDCLK0__DRAM_SDCLK0 IOMUX_PAD(0x578, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1359#define MX53_PAD_DISP0_DAT6__GPIO4_27 (_MX53_PAD_DISP0_DAT6__GPIO4_27 | MUX_PAD_CTRL(NO_PAD_CTRL))
218#define MX53_PAD_DRAM_SDQS0__DRAM_SDQS0 IOMUX_PAD(0x57C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1360#define MX53_PAD_DISP0_DAT6__CSPI_SS3 (_MX53_PAD_DISP0_DAT6__CSPI_SS3 | MUX_PAD_CTRL(NO_PAD_CTRL))
219#define MX53_PAD_DRAM_SDODT0__DRAM_SDODT0 IOMUX_PAD(0x580, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1361#define MX53_PAD_DISP0_DAT6__USBOH3_USBH2_DATA_6 (_MX53_PAD_DISP0_DAT6__USBOH3_USBH2_DATA_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
220#define MX53_PAD_DRAM_DQM0__DRAM_DQM0 IOMUX_PAD(0x584, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1362#define MX53_PAD_DISP0_DAT6__SDMA_DEBUG_RTBUFFER_WRITE (_MX53_PAD_DISP0_DAT6__SDMA_DEBUG_RTBUFFER_WRITE | MUX_PAD_CTRL(NO_PAD_CTRL))
221#define MX53_PAD_DRAM_RAS__DRAM_RAS IOMUX_PAD(0x588, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1363#define MX53_PAD_DISP0_DAT6__EMI_EMI_DEBUG_11 (_MX53_PAD_DISP0_DAT6__EMI_EMI_DEBUG_11 | MUX_PAD_CTRL(NO_PAD_CTRL))
222#define MX53_PAD_DRAM_SDCKE0__DRAM_SDCKE0 IOMUX_PAD(0x58C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1364#define MX53_PAD_DISP0_DAT6__USBPHY2_LINESTATE_1 (_MX53_PAD_DISP0_DAT6__USBPHY2_LINESTATE_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
223#define MX53_PAD_DRAM_SDQS1__DRAM_SDQS1 IOMUX_PAD(0x590, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1365#define MX53_PAD_DISP0_DAT7__IPU_DISP0_DAT_7 (_MX53_PAD_DISP0_DAT7__IPU_DISP0_DAT_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
224#define MX53_PAD_DRAM_DQM1__DRAM_DQM1 IOMUX_PAD(0x594, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1366#define MX53_PAD_DISP0_DAT7__GPIO4_28 (_MX53_PAD_DISP0_DAT7__GPIO4_28 | MUX_PAD_CTRL(NO_PAD_CTRL))
225#define MX53_PAD_PMIC_ON_REQ__PMIC_ON_REQ IOMUX_PAD(0x598, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1367#define MX53_PAD_DISP0_DAT7__CSPI_RDY (_MX53_PAD_DISP0_DAT7__CSPI_RDY | MUX_PAD_CTRL(NO_PAD_CTRL))
226#define MX53_PAD_PMIC_STBY_REQ__PMIC_STBY_REQ IOMUX_PAD(0x59C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1368#define MX53_PAD_DISP0_DAT7__USBOH3_USBH2_DATA_7 (_MX53_PAD_DISP0_DAT7__USBOH3_USBH2_DATA_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
227#define MX53_PAD_NANDF_CLE__GPIO_6_7 IOMUX_PAD(0x5A0, 0x228,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1369#define MX53_PAD_DISP0_DAT7__SDMA_DEBUG_EVENT_CHANNEL_0 (_MX53_PAD_DISP0_DAT7__SDMA_DEBUG_EVENT_CHANNEL_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
228#define MX53_PAD_NANDF_ALE__GPIO_6_8 IOMUX_PAD(0x5A4, 0x22C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1370#define MX53_PAD_DISP0_DAT7__EMI_EMI_DEBUG_12 (_MX53_PAD_DISP0_DAT7__EMI_EMI_DEBUG_12 | MUX_PAD_CTRL(NO_PAD_CTRL))
229#define MX53_PAD_NANDF_WP_B__GPIO_6_9 IOMUX_PAD(0x5A8, 0x230,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1371#define MX53_PAD_DISP0_DAT7__USBPHY2_VBUSVALID (_MX53_PAD_DISP0_DAT7__USBPHY2_VBUSVALID | MUX_PAD_CTRL(NO_PAD_CTRL))
230#define MX53_PAD_NANDF_RB0__GPIO_6_10 IOMUX_PAD(0x5AC, 0x234,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1372#define MX53_PAD_DISP0_DAT8__IPU_DISP0_DAT_8 (_MX53_PAD_DISP0_DAT8__IPU_DISP0_DAT_8 | MUX_PAD_CTRL(NO_PAD_CTRL))
231#define MX53_PAD_NANDF_CS0__GPIO_6_11 IOMUX_PAD(0x5B0, 0x238,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1373#define MX53_PAD_DISP0_DAT8__GPIO4_29 (_MX53_PAD_DISP0_DAT8__GPIO4_29 | MUX_PAD_CTRL(NO_PAD_CTRL))
232#define MX53_PAD_NANDF_CS1__GPIO_6_14 IOMUX_PAD(0x5B4, 0x23C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1374#define MX53_PAD_DISP0_DAT8__PWM1_PWMO (_MX53_PAD_DISP0_DAT8__PWM1_PWMO | MUX_PAD_CTRL(NO_PAD_CTRL))
233#define MX53_PAD_NANDF_CS2__GPIO_6_15 IOMUX_PAD(0x5B8, 0x240,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1375#define MX53_PAD_DISP0_DAT8__WDOG1_WDOG_B (_MX53_PAD_DISP0_DAT8__WDOG1_WDOG_B | MUX_PAD_CTRL(NO_PAD_CTRL))
234#define MX53_PAD_NANDF_CS3__GPIO_6_16 IOMUX_PAD(0x5BC, 0x244,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1376#define MX53_PAD_DISP0_DAT8__SDMA_DEBUG_EVENT_CHANNEL_1 (_MX53_PAD_DISP0_DAT8__SDMA_DEBUG_EVENT_CHANNEL_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
235#define MX53_PAD_NVCC_NANDF__NVCC_NANDF IOMUX_PAD(0x5C0, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1377#define MX53_PAD_DISP0_DAT8__EMI_EMI_DEBUG_13 (_MX53_PAD_DISP0_DAT8__EMI_EMI_DEBUG_13 | MUX_PAD_CTRL(NO_PAD_CTRL))
236#define MX53_PAD_FEC_MDIO__GPIO_1_22 IOMUX_PAD(0x5C4, 0x248,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1378#define MX53_PAD_DISP0_DAT8__USBPHY2_AVALID (_MX53_PAD_DISP0_DAT8__USBPHY2_AVALID | MUX_PAD_CTRL(NO_PAD_CTRL))
237#define MX53_PAD_FEC_REF_CLK__GPIO_1_23 IOMUX_PAD(0x5C8, 0x24C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1379#define MX53_PAD_DISP0_DAT9__IPU_DISP0_DAT_9 (_MX53_PAD_DISP0_DAT9__IPU_DISP0_DAT_9 | MUX_PAD_CTRL(NO_PAD_CTRL))
238#define MX53_PAD_FEC_RX_ER__GPIO_1_24 IOMUX_PAD(0x5CC, 0x250,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1380#define MX53_PAD_DISP0_DAT9__GPIO4_30 (_MX53_PAD_DISP0_DAT9__GPIO4_30 | MUX_PAD_CTRL(NO_PAD_CTRL))
239#define MX53_PAD_FEC_CRS_DV__GPIO_1_25 IOMUX_PAD(0x5D0, 0x254,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1381#define MX53_PAD_DISP0_DAT9__PWM2_PWMO (_MX53_PAD_DISP0_DAT9__PWM2_PWMO | MUX_PAD_CTRL(NO_PAD_CTRL))
240#define MX53_PAD_FEC_RXD1__GPIO_1_26 IOMUX_PAD(0x5D4, 0x258,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1382#define MX53_PAD_DISP0_DAT9__WDOG2_WDOG_B (_MX53_PAD_DISP0_DAT9__WDOG2_WDOG_B | MUX_PAD_CTRL(NO_PAD_CTRL))
241#define MX53_PAD_FEC_RXD0__GPIO_1_27 IOMUX_PAD(0x5D8, 0x25C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1383#define MX53_PAD_DISP0_DAT9__SDMA_DEBUG_EVENT_CHANNEL_2 (_MX53_PAD_DISP0_DAT9__SDMA_DEBUG_EVENT_CHANNEL_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
242#define MX53_PAD_FEC_TX_EN__GPIO_1_28 IOMUX_PAD(0x5DC, 0x260,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1384#define MX53_PAD_DISP0_DAT9__EMI_EMI_DEBUG_14 (_MX53_PAD_DISP0_DAT9__EMI_EMI_DEBUG_14 | MUX_PAD_CTRL(NO_PAD_CTRL))
243#define MX53_PAD_FEC_TXD1__GPIO_1_29 IOMUX_PAD(0x5E0, 0x264,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1385#define MX53_PAD_DISP0_DAT9__USBPHY2_VSTATUS_0 (_MX53_PAD_DISP0_DAT9__USBPHY2_VSTATUS_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
244#define MX53_PAD_FEC_TXD0__GPIO_1_30 IOMUX_PAD(0x5E4, 0x268,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1386#define MX53_PAD_DISP0_DAT10__IPU_DISP0_DAT_10 (_MX53_PAD_DISP0_DAT10__IPU_DISP0_DAT_10 | MUX_PAD_CTRL(NO_PAD_CTRL))
245#define MX53_PAD_FEC_MDC__GPIO_1_31 IOMUX_PAD(0x5E8, 0x26C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1387#define MX53_PAD_DISP0_DAT10__GPIO4_31 (_MX53_PAD_DISP0_DAT10__GPIO4_31 | MUX_PAD_CTRL(NO_PAD_CTRL))
246#define MX53_PAD_NVCC_FEC__NVCC_FEC IOMUX_PAD(0x5EC, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1388#define MX53_PAD_DISP0_DAT10__USBOH3_USBH2_STP (_MX53_PAD_DISP0_DAT10__USBOH3_USBH2_STP | MUX_PAD_CTRL(NO_PAD_CTRL))
247#define MX53_PAD_ATA_DIOW__GPIO_6_17 IOMUX_PAD(0x5F0, 0x270,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1389#define MX53_PAD_DISP0_DAT10__SDMA_DEBUG_EVENT_CHANNEL_3 (_MX53_PAD_DISP0_DAT10__SDMA_DEBUG_EVENT_CHANNEL_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
248#define MX53_PAD_ATA_DMACK__GPIO_6_18 IOMUX_PAD(0x5F4, 0x274,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1390#define MX53_PAD_DISP0_DAT10__EMI_EMI_DEBUG_15 (_MX53_PAD_DISP0_DAT10__EMI_EMI_DEBUG_15 | MUX_PAD_CTRL(NO_PAD_CTRL))
249#define MX53_PAD_ATA_DMARQ__GPIO_7_0 IOMUX_PAD(0x5F8, 0x278,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1391#define MX53_PAD_DISP0_DAT10__USBPHY2_VSTATUS_1 (_MX53_PAD_DISP0_DAT10__USBPHY2_VSTATUS_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
250#define MX53_PAD_ATA_BUFFER_EN__GPIO_7_1 IOMUX_PAD(0x5FC, 0x27C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1392#define MX53_PAD_DISP0_DAT11__IPU_DISP0_DAT_11 (_MX53_PAD_DISP0_DAT11__IPU_DISP0_DAT_11 | MUX_PAD_CTRL(NO_PAD_CTRL))
251#define MX53_PAD_ATA_INTRQ__GPIO_7_2 IOMUX_PAD(0x600, 0x280,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1393#define MX53_PAD_DISP0_DAT11__GPIO5_5 (_MX53_PAD_DISP0_DAT11__GPIO5_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
252#define MX53_PAD_ATA_DIOR__GPIO_7_3 IOMUX_PAD(0x604, 0x284,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1394#define MX53_PAD_DISP0_DAT11__USBOH3_USBH2_NXT (_MX53_PAD_DISP0_DAT11__USBOH3_USBH2_NXT | MUX_PAD_CTRL(NO_PAD_CTRL))
253#define MX53_PAD_ATA_RESET_B__GPIO_7_4 IOMUX_PAD(0x608, 0x288,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1395#define MX53_PAD_DISP0_DAT11__SDMA_DEBUG_EVENT_CHANNEL_4 (_MX53_PAD_DISP0_DAT11__SDMA_DEBUG_EVENT_CHANNEL_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
254#define MX53_PAD_ATA_IORDY__GPIO_7_5 IOMUX_PAD(0x60C, 0x28C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1396#define MX53_PAD_DISP0_DAT11__EMI_EMI_DEBUG_16 (_MX53_PAD_DISP0_DAT11__EMI_EMI_DEBUG_16 | MUX_PAD_CTRL(NO_PAD_CTRL))
255#define MX53_PAD_ATA_DA_0__GPIO_7_6 IOMUX_PAD(0x610, 0x290,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1397#define MX53_PAD_DISP0_DAT11__USBPHY2_VSTATUS_2 (_MX53_PAD_DISP0_DAT11__USBPHY2_VSTATUS_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
256#define MX53_PAD_ATA_DA_1__GPIO_7_7 IOMUX_PAD(0x614, 0x294,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1398#define MX53_PAD_DISP0_DAT12__IPU_DISP0_DAT_12 (_MX53_PAD_DISP0_DAT12__IPU_DISP0_DAT_12 | MUX_PAD_CTRL(NO_PAD_CTRL))
257#define MX53_PAD_ATA_DA_2__GPIO_7_8 IOMUX_PAD(0x618, 0x298,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1399#define MX53_PAD_DISP0_DAT12__GPIO5_6 (_MX53_PAD_DISP0_DAT12__GPIO5_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
258#define MX53_PAD_ATA_CS_0__GPIO_7_9 IOMUX_PAD(0x61C, 0x29C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1400#define MX53_PAD_DISP0_DAT12__USBOH3_USBH2_CLK (_MX53_PAD_DISP0_DAT12__USBOH3_USBH2_CLK | MUX_PAD_CTRL(NO_PAD_CTRL))
259#define MX53_PAD_ATA_CS_1__GPIO_7_10 IOMUX_PAD(0x620, 0x2A0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1401#define MX53_PAD_DISP0_DAT12__SDMA_DEBUG_EVENT_CHANNEL_5 (_MX53_PAD_DISP0_DAT12__SDMA_DEBUG_EVENT_CHANNEL_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
260#define MX53_PAD_NVCC_ATA2__NVCC_ATA2 IOMUX_PAD(0x624, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1402#define MX53_PAD_DISP0_DAT12__EMI_EMI_DEBUG_17 (_MX53_PAD_DISP0_DAT12__EMI_EMI_DEBUG_17 | MUX_PAD_CTRL(NO_PAD_CTRL))
261#define MX53_PAD_ATA_DATA0__GPIO_2_0 IOMUX_PAD(0x628, 0x2A4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1403#define MX53_PAD_DISP0_DAT12__USBPHY2_VSTATUS_3 (_MX53_PAD_DISP0_DAT12__USBPHY2_VSTATUS_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
262#define MX53_PAD_ATA_DATA1__GPIO_2_1 IOMUX_PAD(0x62C, 0x2A8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1404#define MX53_PAD_DISP0_DAT13__IPU_DISP0_DAT_13 (_MX53_PAD_DISP0_DAT13__IPU_DISP0_DAT_13 | MUX_PAD_CTRL(NO_PAD_CTRL))
263#define MX53_PAD_ATA_DATA2__GPIO_2_2 IOMUX_PAD(0x630, 0x2AC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1405#define MX53_PAD_DISP0_DAT13__GPIO5_7 (_MX53_PAD_DISP0_DAT13__GPIO5_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
264#define MX53_PAD_ATA_DATA3__GPIO_2_3 IOMUX_PAD(0x634, 0x2B0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1406#define MX53_PAD_DISP0_DAT13__AUDMUX_AUD5_RXFS (_MX53_PAD_DISP0_DAT13__AUDMUX_AUD5_RXFS | MUX_PAD_CTRL(NO_PAD_CTRL))
265#define MX53_PAD_ATA_DATA4__GPIO_2_4 IOMUX_PAD(0x638, 0x2B4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1407#define MX53_PAD_DISP0_DAT13__SDMA_DEBUG_EVT_CHN_LINES_0 (_MX53_PAD_DISP0_DAT13__SDMA_DEBUG_EVT_CHN_LINES_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
266#define MX53_PAD_ATA_DATA5__GPIO_2_5 IOMUX_PAD(0x63C, 0x2B8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1408#define MX53_PAD_DISP0_DAT13__EMI_EMI_DEBUG_18 (_MX53_PAD_DISP0_DAT13__EMI_EMI_DEBUG_18 | MUX_PAD_CTRL(NO_PAD_CTRL))
267#define MX53_PAD_ATA_DATA6__GPIO_2_6 IOMUX_PAD(0x640, 0x2BC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1409#define MX53_PAD_DISP0_DAT13__USBPHY2_VSTATUS_4 (_MX53_PAD_DISP0_DAT13__USBPHY2_VSTATUS_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
268#define MX53_PAD_ATA_DATA7__GPIO_2_7 IOMUX_PAD(0x644, 0x2C0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1410#define MX53_PAD_DISP0_DAT14__IPU_DISP0_DAT_14 (_MX53_PAD_DISP0_DAT14__IPU_DISP0_DAT_14 | MUX_PAD_CTRL(NO_PAD_CTRL))
269#define MX53_PAD_ATA_DATA8__GPIO_2_8 IOMUX_PAD(0x648, 0x2C4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1411#define MX53_PAD_DISP0_DAT14__GPIO5_8 (_MX53_PAD_DISP0_DAT14__GPIO5_8 | MUX_PAD_CTRL(NO_PAD_CTRL))
270#define MX53_PAD_ATA_DATA9__GPIO_2_9 IOMUX_PAD(0x64C, 0x2C8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1412#define MX53_PAD_DISP0_DAT14__AUDMUX_AUD5_RXC (_MX53_PAD_DISP0_DAT14__AUDMUX_AUD5_RXC | MUX_PAD_CTRL(NO_PAD_CTRL))
271#define MX53_PAD_ATA_DATA10__GPIO_2_10 IOMUX_PAD(0x650, 0x2CC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1413#define MX53_PAD_DISP0_DAT14__SDMA_DEBUG_EVT_CHN_LINES_1 (_MX53_PAD_DISP0_DAT14__SDMA_DEBUG_EVT_CHN_LINES_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
272#define MX53_PAD_ATA_DATA11__GPIO_2_11 IOMUX_PAD(0x654, 0x2D0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1414#define MX53_PAD_DISP0_DAT14__EMI_EMI_DEBUG_19 (_MX53_PAD_DISP0_DAT14__EMI_EMI_DEBUG_19 | MUX_PAD_CTRL(NO_PAD_CTRL))
273#define MX53_PAD_ATA_DATA12__GPIO_2_12 IOMUX_PAD(0x658, 0x2D4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1415#define MX53_PAD_DISP0_DAT14__USBPHY2_VSTATUS_5 (_MX53_PAD_DISP0_DAT14__USBPHY2_VSTATUS_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
274#define MX53_PAD_ATA_DATA13__GPIO_2_13 IOMUX_PAD(0x65C, 0x2D8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1416#define MX53_PAD_DISP0_DAT15__IPU_DISP0_DAT_15 (_MX53_PAD_DISP0_DAT15__IPU_DISP0_DAT_15 | MUX_PAD_CTRL(NO_PAD_CTRL))
275#define MX53_PAD_ATA_DATA14__GPIO_2_14 IOMUX_PAD(0x660, 0x2DC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1417#define MX53_PAD_DISP0_DAT15__GPIO5_9 (_MX53_PAD_DISP0_DAT15__GPIO5_9 | MUX_PAD_CTRL(NO_PAD_CTRL))
276#define MX53_PAD_ATA_DATA15__GPIO_2_15 IOMUX_PAD(0x664, 0x2E0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1418#define MX53_PAD_DISP0_DAT15__ECSPI1_SS1 (_MX53_PAD_DISP0_DAT15__ECSPI1_SS1 | MUX_PAD_CTRL(NO_PAD_CTRL))
277#define MX53_PAD_NVCC_ATA0__NVCC_ATA0 IOMUX_PAD(0x668, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1419#define MX53_PAD_DISP0_DAT15__ECSPI2_SS1 (_MX53_PAD_DISP0_DAT15__ECSPI2_SS1 | MUX_PAD_CTRL(NO_PAD_CTRL))
278#define MX53_PAD_SD1_DATA0__GPIO_1_16 IOMUX_PAD(0x66C, 0x2E4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1420#define MX53_PAD_DISP0_DAT15__SDMA_DEBUG_EVT_CHN_LINES_2 (_MX53_PAD_DISP0_DAT15__SDMA_DEBUG_EVT_CHN_LINES_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
279#define MX53_PAD_SD1_DATA1__GPIO_1_17 IOMUX_PAD(0x670, 0x2E8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1421#define MX53_PAD_DISP0_DAT15__EMI_EMI_DEBUG_20 (_MX53_PAD_DISP0_DAT15__EMI_EMI_DEBUG_20 | MUX_PAD_CTRL(NO_PAD_CTRL))
280#define MX53_PAD_SD1_CMD__GPIO_1_18 IOMUX_PAD(0x674, 0x2EC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1422#define MX53_PAD_DISP0_DAT15__USBPHY2_VSTATUS_6 (_MX53_PAD_DISP0_DAT15__USBPHY2_VSTATUS_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
281#define MX53_PAD_SD1_DATA2__GPIO_1_19 IOMUX_PAD(0x678, 0x2F0,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1423#define MX53_PAD_DISP0_DAT16__IPU_DISP0_DAT_16 (_MX53_PAD_DISP0_DAT16__IPU_DISP0_DAT_16 | MUX_PAD_CTRL(NO_PAD_CTRL))
282#define MX53_PAD_SD1_CLK__GPIO_1_20 IOMUX_PAD(0x67C, 0x2F4,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1424#define MX53_PAD_DISP0_DAT16__GPIO5_10 (_MX53_PAD_DISP0_DAT16__GPIO5_10 | MUX_PAD_CTRL(NO_PAD_CTRL))
283#define MX53_PAD_SD1_DATA3__GPIO_1_21 IOMUX_PAD(0x680, 0x2F8,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1425#define MX53_PAD_DISP0_DAT16__ECSPI2_MOSI (_MX53_PAD_DISP0_DAT16__ECSPI2_MOSI | MUX_PAD_CTRL(NO_PAD_CTRL))
284#define MX53_PAD_NVCC_SD1__NVCC_SD1 IOMUX_PAD(0x684, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1426#define MX53_PAD_DISP0_DAT16__AUDMUX_AUD5_TXC (_MX53_PAD_DISP0_DAT16__AUDMUX_AUD5_TXC | MUX_PAD_CTRL(NO_PAD_CTRL))
285#define MX53_PAD_SD2_CLK__GPIO_1_10 IOMUX_PAD(0x688, 0x2FC,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1427#define MX53_PAD_DISP0_DAT16__SDMA_EXT_EVENT_0 (_MX53_PAD_DISP0_DAT16__SDMA_EXT_EVENT_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
286#define MX53_PAD_SD2_CMD__GPIO_1_11 IOMUX_PAD(0x68C, 0x300,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1428#define MX53_PAD_DISP0_DAT16__SDMA_DEBUG_EVT_CHN_LINES_3 (_MX53_PAD_DISP0_DAT16__SDMA_DEBUG_EVT_CHN_LINES_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
287#define MX53_PAD_SD2_DATA3__GPIO_1_12 IOMUX_PAD(0x690, 0x304,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1429#define MX53_PAD_DISP0_DAT16__EMI_EMI_DEBUG_21 (_MX53_PAD_DISP0_DAT16__EMI_EMI_DEBUG_21 | MUX_PAD_CTRL(NO_PAD_CTRL))
288#define MX53_PAD_SD2_DATA2__GPIO_1_13 IOMUX_PAD(0x694, 0x308,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1430#define MX53_PAD_DISP0_DAT16__USBPHY2_VSTATUS_7 (_MX53_PAD_DISP0_DAT16__USBPHY2_VSTATUS_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
289#define MX53_PAD_SD2_DATA1__GPIO_1_14 IOMUX_PAD(0x698, 0x30C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1431#define MX53_PAD_DISP0_DAT17__IPU_DISP0_DAT_17 (_MX53_PAD_DISP0_DAT17__IPU_DISP0_DAT_17 | MUX_PAD_CTRL(NO_PAD_CTRL))
290#define MX53_PAD_SD2_DATA0__GPIO_1_15 IOMUX_PAD(0x69C, 0x310,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1432#define MX53_PAD_DISP0_DAT17__GPIO5_11 (_MX53_PAD_DISP0_DAT17__GPIO5_11 | MUX_PAD_CTRL(NO_PAD_CTRL))
291#define MX53_PAD_NVCC_SD2__NVCC_SD2 IOMUX_PAD(0x6A0, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1433#define MX53_PAD_DISP0_DAT17__ECSPI2_MISO (_MX53_PAD_DISP0_DAT17__ECSPI2_MISO | MUX_PAD_CTRL(NO_PAD_CTRL))
292#define MX53_PAD_GPIO_0__GPIO_1_0 IOMUX_PAD(0x6A4, 0x314,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1434#define MX53_PAD_DISP0_DAT17__AUDMUX_AUD5_TXD (_MX53_PAD_DISP0_DAT17__AUDMUX_AUD5_TXD | MUX_PAD_CTRL(NO_PAD_CTRL))
293#define MX53_PAD_GPIO_1__GPIO_1_1 IOMUX_PAD(0x6A8, 0x318,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1435#define MX53_PAD_DISP0_DAT17__SDMA_EXT_EVENT_1 (_MX53_PAD_DISP0_DAT17__SDMA_EXT_EVENT_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
294#define MX53_PAD_GPIO_9__GPIO_1_9 IOMUX_PAD(0x6AC, 0x31C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1436#define MX53_PAD_DISP0_DAT17__SDMA_DEBUG_EVT_CHN_LINES_4 (_MX53_PAD_DISP0_DAT17__SDMA_DEBUG_EVT_CHN_LINES_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
295#define MX53_PAD_GPIO_3__GPIO_1_3 IOMUX_PAD(0x6B0, 0x320,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1437#define MX53_PAD_DISP0_DAT17__EMI_EMI_DEBUG_22 (_MX53_PAD_DISP0_DAT17__EMI_EMI_DEBUG_22 | MUX_PAD_CTRL(NO_PAD_CTRL))
296#define MX53_PAD_GPIO_6__GPIO_1_6 IOMUX_PAD(0x6B4, 0x324,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1438#define MX53_PAD_DISP0_DAT18__IPU_DISP0_DAT_18 (_MX53_PAD_DISP0_DAT18__IPU_DISP0_DAT_18 | MUX_PAD_CTRL(NO_PAD_CTRL))
297#define MX53_PAD_GPIO_2__GPIO_1_2 IOMUX_PAD(0x6B8, 0x328,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1439#define MX53_PAD_DISP0_DAT18__GPIO5_12 (_MX53_PAD_DISP0_DAT18__GPIO5_12 | MUX_PAD_CTRL(NO_PAD_CTRL))
298#define MX53_PAD_GPIO_4__GPIO_1_4 IOMUX_PAD(0x6BC, 0x32C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1440#define MX53_PAD_DISP0_DAT18__ECSPI2_SS0 (_MX53_PAD_DISP0_DAT18__ECSPI2_SS0 | MUX_PAD_CTRL(NO_PAD_CTRL))
299#define MX53_PAD_GPIO_5__GPIO_1_5 IOMUX_PAD(0x6C0, 0x330,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1441#define MX53_PAD_DISP0_DAT18__AUDMUX_AUD5_TXFS (_MX53_PAD_DISP0_DAT18__AUDMUX_AUD5_TXFS | MUX_PAD_CTRL(NO_PAD_CTRL))
300#define MX53_PAD_GPIO_7__GPIO_1_7 IOMUX_PAD(0x6C4, 0x334,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1442#define MX53_PAD_DISP0_DAT18__AUDMUX_AUD4_RXFS (_MX53_PAD_DISP0_DAT18__AUDMUX_AUD4_RXFS | MUX_PAD_CTRL(NO_PAD_CTRL))
301#define MX53_PAD_GPIO_8__GPIO_1_8 IOMUX_PAD(0x6C8, 0x338,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1443#define MX53_PAD_DISP0_DAT18__SDMA_DEBUG_EVT_CHN_LINES_5 (_MX53_PAD_DISP0_DAT18__SDMA_DEBUG_EVT_CHN_LINES_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
302#define MX53_PAD_GPIO_16__GPIO_7_11 IOMUX_PAD(0x6CC, 0x33C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1444#define MX53_PAD_DISP0_DAT18__EMI_EMI_DEBUG_23 (_MX53_PAD_DISP0_DAT18__EMI_EMI_DEBUG_23 | MUX_PAD_CTRL(NO_PAD_CTRL))
303#define MX53_PAD_GPIO_17__GPIO_7_12 IOMUX_PAD(0x6D0, 0x340,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1445#define MX53_PAD_DISP0_DAT18__EMI_WEIM_CS_2 (_MX53_PAD_DISP0_DAT18__EMI_WEIM_CS_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
304#define MX53_PAD_GPIO_18__GPIO_7_13 IOMUX_PAD(0x6D4, 0x344,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 1446#define MX53_PAD_DISP0_DAT19__IPU_DISP0_DAT_19 (_MX53_PAD_DISP0_DAT19__IPU_DISP0_DAT_19 | MUX_PAD_CTRL(NO_PAD_CTRL))
305#define MX53_PAD_NVCC_GPIO__NVCC_GPIO IOMUX_PAD(0x6D8, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1447#define MX53_PAD_DISP0_DAT19__GPIO5_13 (_MX53_PAD_DISP0_DAT19__GPIO5_13 | MUX_PAD_CTRL(NO_PAD_CTRL))
306#define MX53_PAD_POR_B__POR_B IOMUX_PAD(0x6DC, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1448#define MX53_PAD_DISP0_DAT19__ECSPI2_SCLK (_MX53_PAD_DISP0_DAT19__ECSPI2_SCLK | MUX_PAD_CTRL(NO_PAD_CTRL))
307#define MX53_PAD_BOOT_MODE1__BOOT_MODE1 IOMUX_PAD(0x6E0, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1449#define MX53_PAD_DISP0_DAT19__AUDMUX_AUD5_RXD (_MX53_PAD_DISP0_DAT19__AUDMUX_AUD5_RXD | MUX_PAD_CTRL(NO_PAD_CTRL))
308#define MX53_PAD_RESET_IN_B__RESET_IN_B IOMUX_PAD(0x6E4, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1450#define MX53_PAD_DISP0_DAT19__AUDMUX_AUD4_RXC (_MX53_PAD_DISP0_DAT19__AUDMUX_AUD4_RXC | MUX_PAD_CTRL(NO_PAD_CTRL))
309#define MX53_PAD_BOOT_MODE0__BOOT_MODE0 IOMUX_PAD(0x6E8, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1451#define MX53_PAD_DISP0_DAT19__SDMA_DEBUG_EVT_CHN_LINES_6 (_MX53_PAD_DISP0_DAT19__SDMA_DEBUG_EVT_CHN_LINES_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
310#define MX53_PAD_TEST_MODE__TEST_MODE IOMUX_PAD(0x6EC, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1452#define MX53_PAD_DISP0_DAT19__EMI_EMI_DEBUG_24 (_MX53_PAD_DISP0_DAT19__EMI_EMI_DEBUG_24 | MUX_PAD_CTRL(NO_PAD_CTRL))
311#define MX53_PAD_GRP_ADDDS__GRP_ADDDS IOMUX_PAD(0x6F0, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1453#define MX53_PAD_DISP0_DAT19__EMI_WEIM_CS_3 (_MX53_PAD_DISP0_DAT19__EMI_WEIM_CS_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
312#define MX53_PAD_GRP_DDRMODE_CTL__GRP_DDRMODE_CTL IOMUX_PAD(0x6F4, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1454#define MX53_PAD_DISP0_DAT20__IPU_DISP0_DAT_20 (_MX53_PAD_DISP0_DAT20__IPU_DISP0_DAT_20 | MUX_PAD_CTRL(NO_PAD_CTRL))
313#define MX53_PAD_GRP_DDRPKE__GRP_DDRPKE IOMUX_PAD(0x6FC, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1455#define MX53_PAD_DISP0_DAT20__GPIO5_14 (_MX53_PAD_DISP0_DAT20__GPIO5_14 | MUX_PAD_CTRL(NO_PAD_CTRL))
314#define MX53_PAD_GRP_DDRPK__GRP_DDRPK IOMUX_PAD(0x708, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1456#define MX53_PAD_DISP0_DAT20__ECSPI1_SCLK (_MX53_PAD_DISP0_DAT20__ECSPI1_SCLK | MUX_PAD_CTRL(NO_PAD_CTRL))
315#define MX53_PAD_GRP_TERM_CTL3__GRP_TERM_CTL3 IOMUX_PAD(0x70C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1457#define MX53_PAD_DISP0_DAT20__AUDMUX_AUD4_TXC (_MX53_PAD_DISP0_DAT20__AUDMUX_AUD4_TXC | MUX_PAD_CTRL(NO_PAD_CTRL))
316#define MX53_PAD_GRP_DDRHYS__GRP_DDRHYS IOMUX_PAD(0x710, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1458#define MX53_PAD_DISP0_DAT20__SDMA_DEBUG_EVT_CHN_LINES_7 (_MX53_PAD_DISP0_DAT20__SDMA_DEBUG_EVT_CHN_LINES_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
317#define MX53_PAD_GRP_DDRMODE__GRP_DDRMODE IOMUX_PAD(0x714, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1459#define MX53_PAD_DISP0_DAT20__EMI_EMI_DEBUG_25 (_MX53_PAD_DISP0_DAT20__EMI_EMI_DEBUG_25 | MUX_PAD_CTRL(NO_PAD_CTRL))
318#define MX53_PAD_GRP_B0DS__GRP_B0DS IOMUX_PAD(0x718, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1460#define MX53_PAD_DISP0_DAT20__SATA_PHY_TDI (_MX53_PAD_DISP0_DAT20__SATA_PHY_TDI | MUX_PAD_CTRL(NO_PAD_CTRL))
319#define MX53_PAD_GRP_B1DS__GRP_B1DS IOMUX_PAD(0x71C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1461#define MX53_PAD_DISP0_DAT21__IPU_DISP0_DAT_21 (_MX53_PAD_DISP0_DAT21__IPU_DISP0_DAT_21 | MUX_PAD_CTRL(NO_PAD_CTRL))
320#define MX53_PAD_GRP_CTLDS__GRP_CTLDS IOMUX_PAD(0x720, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1462#define MX53_PAD_DISP0_DAT21__GPIO5_15 (_MX53_PAD_DISP0_DAT21__GPIO5_15 | MUX_PAD_CTRL(NO_PAD_CTRL))
321#define MX53_PAD_GRP_DDR_TYPE__GRP_DDR_TYPE IOMUX_PAD(0x724, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1463#define MX53_PAD_DISP0_DAT21__ECSPI1_MOSI (_MX53_PAD_DISP0_DAT21__ECSPI1_MOSI | MUX_PAD_CTRL(NO_PAD_CTRL))
322#define MX53_PAD_GRP_B2DS__GRP_B2DS IOMUX_PAD(0x728, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1464#define MX53_PAD_DISP0_DAT21__AUDMUX_AUD4_TXD (_MX53_PAD_DISP0_DAT21__AUDMUX_AUD4_TXD | MUX_PAD_CTRL(NO_PAD_CTRL))
323#define MX53_PAD_GRP_B3DS__GRP_B3DS IOMUX_PAD(0x72C, NON_MUX_I, IOMUX_CONFIG_ALT0, 0x0, 0, NO_PAD_CTRL) 1465#define MX53_PAD_DISP0_DAT21__SDMA_DEBUG_BUS_DEVICE_0 (_MX53_PAD_DISP0_DAT21__SDMA_DEBUG_BUS_DEVICE_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1466#define MX53_PAD_DISP0_DAT21__EMI_EMI_DEBUG_26 (_MX53_PAD_DISP0_DAT21__EMI_EMI_DEBUG_26 | MUX_PAD_CTRL(NO_PAD_CTRL))
1467#define MX53_PAD_DISP0_DAT21__SATA_PHY_TDO (_MX53_PAD_DISP0_DAT21__SATA_PHY_TDO | MUX_PAD_CTRL(NO_PAD_CTRL))
1468#define MX53_PAD_DISP0_DAT22__IPU_DISP0_DAT_22 (_MX53_PAD_DISP0_DAT22__IPU_DISP0_DAT_22 | MUX_PAD_CTRL(NO_PAD_CTRL))
1469#define MX53_PAD_DISP0_DAT22__GPIO5_16 (_MX53_PAD_DISP0_DAT22__GPIO5_16 | MUX_PAD_CTRL(NO_PAD_CTRL))
1470#define MX53_PAD_DISP0_DAT22__ECSPI1_MISO (_MX53_PAD_DISP0_DAT22__ECSPI1_MISO | MUX_PAD_CTRL(NO_PAD_CTRL))
1471#define MX53_PAD_DISP0_DAT22__AUDMUX_AUD4_TXFS (_MX53_PAD_DISP0_DAT22__AUDMUX_AUD4_TXFS | MUX_PAD_CTRL(NO_PAD_CTRL))
1472#define MX53_PAD_DISP0_DAT22__SDMA_DEBUG_BUS_DEVICE_1 (_MX53_PAD_DISP0_DAT22__SDMA_DEBUG_BUS_DEVICE_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1473#define MX53_PAD_DISP0_DAT22__EMI_EMI_DEBUG_27 (_MX53_PAD_DISP0_DAT22__EMI_EMI_DEBUG_27 | MUX_PAD_CTRL(NO_PAD_CTRL))
1474#define MX53_PAD_DISP0_DAT22__SATA_PHY_TCK (_MX53_PAD_DISP0_DAT22__SATA_PHY_TCK | MUX_PAD_CTRL(NO_PAD_CTRL))
1475#define MX53_PAD_DISP0_DAT23__IPU_DISP0_DAT_23 (_MX53_PAD_DISP0_DAT23__IPU_DISP0_DAT_23 | MUX_PAD_CTRL(NO_PAD_CTRL))
1476#define MX53_PAD_DISP0_DAT23__GPIO5_17 (_MX53_PAD_DISP0_DAT23__GPIO5_17 | MUX_PAD_CTRL(NO_PAD_CTRL))
1477#define MX53_PAD_DISP0_DAT23__ECSPI1_SS0 (_MX53_PAD_DISP0_DAT23__ECSPI1_SS0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1478#define MX53_PAD_DISP0_DAT23__AUDMUX_AUD4_RXD (_MX53_PAD_DISP0_DAT23__AUDMUX_AUD4_RXD | MUX_PAD_CTRL(NO_PAD_CTRL))
1479#define MX53_PAD_DISP0_DAT23__SDMA_DEBUG_BUS_DEVICE_2 (_MX53_PAD_DISP0_DAT23__SDMA_DEBUG_BUS_DEVICE_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1480#define MX53_PAD_DISP0_DAT23__EMI_EMI_DEBUG_28 (_MX53_PAD_DISP0_DAT23__EMI_EMI_DEBUG_28 | MUX_PAD_CTRL(NO_PAD_CTRL))
1481#define MX53_PAD_DISP0_DAT23__SATA_PHY_TMS (_MX53_PAD_DISP0_DAT23__SATA_PHY_TMS | MUX_PAD_CTRL(NO_PAD_CTRL))
1482#define MX53_PAD_CSI0_PIXCLK__IPU_CSI0_PIXCLK (_MX53_PAD_CSI0_PIXCLK__IPU_CSI0_PIXCLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1483#define MX53_PAD_CSI0_PIXCLK__GPIO5_18 (_MX53_PAD_CSI0_PIXCLK__GPIO5_18 | MUX_PAD_CTRL(NO_PAD_CTRL))
1484#define MX53_PAD_CSI0_PIXCLK__SDMA_DEBUG_PC_0 (_MX53_PAD_CSI0_PIXCLK__SDMA_DEBUG_PC_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1485#define MX53_PAD_CSI0_PIXCLK__EMI_EMI_DEBUG_29 (_MX53_PAD_CSI0_PIXCLK__EMI_EMI_DEBUG_29 | MUX_PAD_CTRL(NO_PAD_CTRL))
1486#define MX53_PAD_CSI0_MCLK__IPU_CSI0_HSYNC (_MX53_PAD_CSI0_MCLK__IPU_CSI0_HSYNC | MUX_PAD_CTRL(NO_PAD_CTRL))
1487#define MX53_PAD_CSI0_MCLK__GPIO5_19 (_MX53_PAD_CSI0_MCLK__GPIO5_19 | MUX_PAD_CTRL(NO_PAD_CTRL))
1488#define MX53_PAD_CSI0_MCLK__CCM_CSI0_MCLK (_MX53_PAD_CSI0_MCLK__CCM_CSI0_MCLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1489#define MX53_PAD_CSI0_MCLK__SDMA_DEBUG_PC_1 (_MX53_PAD_CSI0_MCLK__SDMA_DEBUG_PC_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1490#define MX53_PAD_CSI0_MCLK__EMI_EMI_DEBUG_30 (_MX53_PAD_CSI0_MCLK__EMI_EMI_DEBUG_30 | MUX_PAD_CTRL(NO_PAD_CTRL))
1491#define MX53_PAD_CSI0_MCLK__TPIU_TRCTL (_MX53_PAD_CSI0_MCLK__TPIU_TRCTL | MUX_PAD_CTRL(NO_PAD_CTRL))
1492#define MX53_PAD_CSI0_DATA_EN__IPU_CSI0_DATA_EN (_MX53_PAD_CSI0_DATA_EN__IPU_CSI0_DATA_EN | MUX_PAD_CTRL(NO_PAD_CTRL))
1493#define MX53_PAD_CSI0_DATA_EN__GPIO5_20 (_MX53_PAD_CSI0_DATA_EN__GPIO5_20 | MUX_PAD_CTRL(NO_PAD_CTRL))
1494#define MX53_PAD_CSI0_DATA_EN__SDMA_DEBUG_PC_2 (_MX53_PAD_CSI0_DATA_EN__SDMA_DEBUG_PC_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1495#define MX53_PAD_CSI0_DATA_EN__EMI_EMI_DEBUG_31 (_MX53_PAD_CSI0_DATA_EN__EMI_EMI_DEBUG_31 | MUX_PAD_CTRL(NO_PAD_CTRL))
1496#define MX53_PAD_CSI0_DATA_EN__TPIU_TRCLK (_MX53_PAD_CSI0_DATA_EN__TPIU_TRCLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1497#define MX53_PAD_CSI0_VSYNC__IPU_CSI0_VSYNC (_MX53_PAD_CSI0_VSYNC__IPU_CSI0_VSYNC | MUX_PAD_CTRL(NO_PAD_CTRL))
1498#define MX53_PAD_CSI0_VSYNC__GPIO5_21 (_MX53_PAD_CSI0_VSYNC__GPIO5_21 | MUX_PAD_CTRL(NO_PAD_CTRL))
1499#define MX53_PAD_CSI0_VSYNC__SDMA_DEBUG_PC_3 (_MX53_PAD_CSI0_VSYNC__SDMA_DEBUG_PC_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1500#define MX53_PAD_CSI0_VSYNC__EMI_EMI_DEBUG_32 (_MX53_PAD_CSI0_VSYNC__EMI_EMI_DEBUG_32 | MUX_PAD_CTRL(NO_PAD_CTRL))
1501#define MX53_PAD_CSI0_VSYNC__TPIU_TRACE_0 (_MX53_PAD_CSI0_VSYNC__TPIU_TRACE_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1502#define MX53_PAD_CSI0_DAT4__IPU_CSI0_D_4 (_MX53_PAD_CSI0_DAT4__IPU_CSI0_D_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
1503#define MX53_PAD_CSI0_DAT4__GPIO5_22 (_MX53_PAD_CSI0_DAT4__GPIO5_22 | MUX_PAD_CTRL(NO_PAD_CTRL))
1504#define MX53_PAD_CSI0_DAT4__KPP_COL_5 (_MX53_PAD_CSI0_DAT4__KPP_COL_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
1505#define MX53_PAD_CSI0_DAT4__ECSPI1_SCLK (_MX53_PAD_CSI0_DAT4__ECSPI1_SCLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1506#define MX53_PAD_CSI0_DAT4__USBOH3_USBH3_STP (_MX53_PAD_CSI0_DAT4__USBOH3_USBH3_STP | MUX_PAD_CTRL(NO_PAD_CTRL))
1507#define MX53_PAD_CSI0_DAT4__AUDMUX_AUD3_TXC (_MX53_PAD_CSI0_DAT4__AUDMUX_AUD3_TXC | MUX_PAD_CTRL(NO_PAD_CTRL))
1508#define MX53_PAD_CSI0_DAT4__EMI_EMI_DEBUG_33 (_MX53_PAD_CSI0_DAT4__EMI_EMI_DEBUG_33 | MUX_PAD_CTRL(NO_PAD_CTRL))
1509#define MX53_PAD_CSI0_DAT4__TPIU_TRACE_1 (_MX53_PAD_CSI0_DAT4__TPIU_TRACE_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1510#define MX53_PAD_CSI0_DAT5__IPU_CSI0_D_5 (_MX53_PAD_CSI0_DAT5__IPU_CSI0_D_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
1511#define MX53_PAD_CSI0_DAT5__GPIO5_23 (_MX53_PAD_CSI0_DAT5__GPIO5_23 | MUX_PAD_CTRL(NO_PAD_CTRL))
1512#define MX53_PAD_CSI0_DAT5__KPP_ROW_5 (_MX53_PAD_CSI0_DAT5__KPP_ROW_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
1513#define MX53_PAD_CSI0_DAT5__ECSPI1_MOSI (_MX53_PAD_CSI0_DAT5__ECSPI1_MOSI | MUX_PAD_CTRL(NO_PAD_CTRL))
1514#define MX53_PAD_CSI0_DAT5__USBOH3_USBH3_NXT (_MX53_PAD_CSI0_DAT5__USBOH3_USBH3_NXT | MUX_PAD_CTRL(NO_PAD_CTRL))
1515#define MX53_PAD_CSI0_DAT5__AUDMUX_AUD3_TXD (_MX53_PAD_CSI0_DAT5__AUDMUX_AUD3_TXD | MUX_PAD_CTRL(NO_PAD_CTRL))
1516#define MX53_PAD_CSI0_DAT5__EMI_EMI_DEBUG_34 (_MX53_PAD_CSI0_DAT5__EMI_EMI_DEBUG_34 | MUX_PAD_CTRL(NO_PAD_CTRL))
1517#define MX53_PAD_CSI0_DAT5__TPIU_TRACE_2 (_MX53_PAD_CSI0_DAT5__TPIU_TRACE_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1518#define MX53_PAD_CSI0_DAT6__IPU_CSI0_D_6 (_MX53_PAD_CSI0_DAT6__IPU_CSI0_D_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
1519#define MX53_PAD_CSI0_DAT6__GPIO5_24 (_MX53_PAD_CSI0_DAT6__GPIO5_24 | MUX_PAD_CTRL(NO_PAD_CTRL))
1520#define MX53_PAD_CSI0_DAT6__KPP_COL_6 (_MX53_PAD_CSI0_DAT6__KPP_COL_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
1521#define MX53_PAD_CSI0_DAT6__ECSPI1_MISO (_MX53_PAD_CSI0_DAT6__ECSPI1_MISO | MUX_PAD_CTRL(NO_PAD_CTRL))
1522#define MX53_PAD_CSI0_DAT6__USBOH3_USBH3_CLK (_MX53_PAD_CSI0_DAT6__USBOH3_USBH3_CLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1523#define MX53_PAD_CSI0_DAT6__AUDMUX_AUD3_TXFS (_MX53_PAD_CSI0_DAT6__AUDMUX_AUD3_TXFS | MUX_PAD_CTRL(NO_PAD_CTRL))
1524#define MX53_PAD_CSI0_DAT6__EMI_EMI_DEBUG_35 (_MX53_PAD_CSI0_DAT6__EMI_EMI_DEBUG_35 | MUX_PAD_CTRL(NO_PAD_CTRL))
1525#define MX53_PAD_CSI0_DAT6__TPIU_TRACE_3 (_MX53_PAD_CSI0_DAT6__TPIU_TRACE_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1526#define MX53_PAD_CSI0_DAT7__IPU_CSI0_D_7 (_MX53_PAD_CSI0_DAT7__IPU_CSI0_D_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
1527#define MX53_PAD_CSI0_DAT7__GPIO5_25 (_MX53_PAD_CSI0_DAT7__GPIO5_25 | MUX_PAD_CTRL(NO_PAD_CTRL))
1528#define MX53_PAD_CSI0_DAT7__KPP_ROW_6 (_MX53_PAD_CSI0_DAT7__KPP_ROW_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
1529#define MX53_PAD_CSI0_DAT7__ECSPI1_SS0 (_MX53_PAD_CSI0_DAT7__ECSPI1_SS0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1530#define MX53_PAD_CSI0_DAT7__USBOH3_USBH3_DIR (_MX53_PAD_CSI0_DAT7__USBOH3_USBH3_DIR | MUX_PAD_CTRL(NO_PAD_CTRL))
1531#define MX53_PAD_CSI0_DAT7__AUDMUX_AUD3_RXD (_MX53_PAD_CSI0_DAT7__AUDMUX_AUD3_RXD | MUX_PAD_CTRL(NO_PAD_CTRL))
1532#define MX53_PAD_CSI0_DAT7__EMI_EMI_DEBUG_36 (_MX53_PAD_CSI0_DAT7__EMI_EMI_DEBUG_36 | MUX_PAD_CTRL(NO_PAD_CTRL))
1533#define MX53_PAD_CSI0_DAT7__TPIU_TRACE_4 (_MX53_PAD_CSI0_DAT7__TPIU_TRACE_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
1534#define MX53_PAD_CSI0_DAT8__IPU_CSI0_D_8 (_MX53_PAD_CSI0_DAT8__IPU_CSI0_D_8 | MUX_PAD_CTRL(NO_PAD_CTRL))
1535#define MX53_PAD_CSI0_DAT8__GPIO5_26 (_MX53_PAD_CSI0_DAT8__GPIO5_26 | MUX_PAD_CTRL(NO_PAD_CTRL))
1536#define MX53_PAD_CSI0_DAT8__KPP_COL_7 (_MX53_PAD_CSI0_DAT8__KPP_COL_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
1537#define MX53_PAD_CSI0_DAT8__ECSPI2_SCLK (_MX53_PAD_CSI0_DAT8__ECSPI2_SCLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1538#define MX53_PAD_CSI0_DAT8__USBOH3_USBH3_OC (_MX53_PAD_CSI0_DAT8__USBOH3_USBH3_OC | MUX_PAD_CTRL(NO_PAD_CTRL))
1539#define MX53_PAD_CSI0_DAT8__I2C1_SDA (_MX53_PAD_CSI0_DAT8__I2C1_SDA | MUX_PAD_CTRL(NO_PAD_CTRL))
1540#define MX53_PAD_CSI0_DAT8__EMI_EMI_DEBUG_37 (_MX53_PAD_CSI0_DAT8__EMI_EMI_DEBUG_37 | MUX_PAD_CTRL(NO_PAD_CTRL))
1541#define MX53_PAD_CSI0_DAT8__TPIU_TRACE_5 (_MX53_PAD_CSI0_DAT8__TPIU_TRACE_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
1542#define MX53_PAD_CSI0_DAT9__IPU_CSI0_D_9 (_MX53_PAD_CSI0_DAT9__IPU_CSI0_D_9 | MUX_PAD_CTRL(NO_PAD_CTRL))
1543#define MX53_PAD_CSI0_DAT9__GPIO5_27 (_MX53_PAD_CSI0_DAT9__GPIO5_27 | MUX_PAD_CTRL(NO_PAD_CTRL))
1544#define MX53_PAD_CSI0_DAT9__KPP_ROW_7 (_MX53_PAD_CSI0_DAT9__KPP_ROW_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
1545#define MX53_PAD_CSI0_DAT9__ECSPI2_MOSI (_MX53_PAD_CSI0_DAT9__ECSPI2_MOSI | MUX_PAD_CTRL(NO_PAD_CTRL))
1546#define MX53_PAD_CSI0_DAT9__USBOH3_USBH3_PWR (_MX53_PAD_CSI0_DAT9__USBOH3_USBH3_PWR | MUX_PAD_CTRL(NO_PAD_CTRL))
1547#define MX53_PAD_CSI0_DAT9__I2C1_SCL (_MX53_PAD_CSI0_DAT9__I2C1_SCL | MUX_PAD_CTRL(NO_PAD_CTRL))
1548#define MX53_PAD_CSI0_DAT9__EMI_EMI_DEBUG_38 (_MX53_PAD_CSI0_DAT9__EMI_EMI_DEBUG_38 | MUX_PAD_CTRL(NO_PAD_CTRL))
1549#define MX53_PAD_CSI0_DAT9__TPIU_TRACE_6 (_MX53_PAD_CSI0_DAT9__TPIU_TRACE_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
1550#define MX53_PAD_CSI0_DAT10__IPU_CSI0_D_10 (_MX53_PAD_CSI0_DAT10__IPU_CSI0_D_10 | MUX_PAD_CTRL(NO_PAD_CTRL))
1551#define MX53_PAD_CSI0_DAT10__GPIO5_28 (_MX53_PAD_CSI0_DAT10__GPIO5_28 | MUX_PAD_CTRL(NO_PAD_CTRL))
1552#define MX53_PAD_CSI0_DAT10__UART1_TXD_MUX (_MX53_PAD_CSI0_DAT10__UART1_TXD_MUX | MUX_PAD_CTRL(MX53_UART_PAD_CTRL))
1553#define MX53_PAD_CSI0_DAT10__ECSPI2_MISO (_MX53_PAD_CSI0_DAT10__ECSPI2_MISO | MUX_PAD_CTRL(NO_PAD_CTRL))
1554#define MX53_PAD_CSI0_DAT10__AUDMUX_AUD3_RXC (_MX53_PAD_CSI0_DAT10__AUDMUX_AUD3_RXC | MUX_PAD_CTRL(NO_PAD_CTRL))
1555#define MX53_PAD_CSI0_DAT10__SDMA_DEBUG_PC_4 (_MX53_PAD_CSI0_DAT10__SDMA_DEBUG_PC_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
1556#define MX53_PAD_CSI0_DAT10__EMI_EMI_DEBUG_39 (_MX53_PAD_CSI0_DAT10__EMI_EMI_DEBUG_39 | MUX_PAD_CTRL(NO_PAD_CTRL))
1557#define MX53_PAD_CSI0_DAT10__TPIU_TRACE_7 (_MX53_PAD_CSI0_DAT10__TPIU_TRACE_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
1558#define MX53_PAD_CSI0_DAT11__IPU_CSI0_D_11 (_MX53_PAD_CSI0_DAT11__IPU_CSI0_D_11 | MUX_PAD_CTRL(NO_PAD_CTRL))
1559#define MX53_PAD_CSI0_DAT11__GPIO5_29 (_MX53_PAD_CSI0_DAT11__GPIO5_29 | MUX_PAD_CTRL(NO_PAD_CTRL))
1560#define MX53_PAD_CSI0_DAT11__UART1_RXD_MUX (_MX53_PAD_CSI0_DAT11__UART1_RXD_MUX | MUX_PAD_CTRL(MX53_UART_PAD_CTRL))
1561#define MX53_PAD_CSI0_DAT11__ECSPI2_SS0 (_MX53_PAD_CSI0_DAT11__ECSPI2_SS0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1562#define MX53_PAD_CSI0_DAT11__AUDMUX_AUD3_RXFS (_MX53_PAD_CSI0_DAT11__AUDMUX_AUD3_RXFS | MUX_PAD_CTRL(NO_PAD_CTRL))
1563#define MX53_PAD_CSI0_DAT11__SDMA_DEBUG_PC_5 (_MX53_PAD_CSI0_DAT11__SDMA_DEBUG_PC_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
1564#define MX53_PAD_CSI0_DAT11__EMI_EMI_DEBUG_40 (_MX53_PAD_CSI0_DAT11__EMI_EMI_DEBUG_40 | MUX_PAD_CTRL(NO_PAD_CTRL))
1565#define MX53_PAD_CSI0_DAT11__TPIU_TRACE_8 (_MX53_PAD_CSI0_DAT11__TPIU_TRACE_8 | MUX_PAD_CTRL(NO_PAD_CTRL))
1566#define MX53_PAD_CSI0_DAT12__IPU_CSI0_D_12 (_MX53_PAD_CSI0_DAT12__IPU_CSI0_D_12 | MUX_PAD_CTRL(NO_PAD_CTRL))
1567#define MX53_PAD_CSI0_DAT12__GPIO5_30 (_MX53_PAD_CSI0_DAT12__GPIO5_30 | MUX_PAD_CTRL(NO_PAD_CTRL))
1568#define MX53_PAD_CSI0_DAT12__UART4_TXD_MUX (_MX53_PAD_CSI0_DAT12__UART4_TXD_MUX | MUX_PAD_CTRL(NO_PAD_CTRL))
1569#define MX53_PAD_CSI0_DAT12__USBOH3_USBH3_DATA_0 (_MX53_PAD_CSI0_DAT12__USBOH3_USBH3_DATA_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1570#define MX53_PAD_CSI0_DAT12__SDMA_DEBUG_PC_6 (_MX53_PAD_CSI0_DAT12__SDMA_DEBUG_PC_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
1571#define MX53_PAD_CSI0_DAT12__EMI_EMI_DEBUG_41 (_MX53_PAD_CSI0_DAT12__EMI_EMI_DEBUG_41 | MUX_PAD_CTRL(NO_PAD_CTRL))
1572#define MX53_PAD_CSI0_DAT12__TPIU_TRACE_9 (_MX53_PAD_CSI0_DAT12__TPIU_TRACE_9 | MUX_PAD_CTRL(NO_PAD_CTRL))
1573#define MX53_PAD_CSI0_DAT13__IPU_CSI0_D_13 (_MX53_PAD_CSI0_DAT13__IPU_CSI0_D_13 | MUX_PAD_CTRL(NO_PAD_CTRL))
1574#define MX53_PAD_CSI0_DAT13__GPIO5_31 (_MX53_PAD_CSI0_DAT13__GPIO5_31 | MUX_PAD_CTRL(NO_PAD_CTRL))
1575#define MX53_PAD_CSI0_DAT13__UART4_RXD_MUX (_MX53_PAD_CSI0_DAT13__UART4_RXD_MUX | MUX_PAD_CTRL(NO_PAD_CTRL))
1576#define MX53_PAD_CSI0_DAT13__USBOH3_USBH3_DATA_1 (_MX53_PAD_CSI0_DAT13__USBOH3_USBH3_DATA_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1577#define MX53_PAD_CSI0_DAT13__SDMA_DEBUG_PC_7 (_MX53_PAD_CSI0_DAT13__SDMA_DEBUG_PC_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
1578#define MX53_PAD_CSI0_DAT13__EMI_EMI_DEBUG_42 (_MX53_PAD_CSI0_DAT13__EMI_EMI_DEBUG_42 | MUX_PAD_CTRL(NO_PAD_CTRL))
1579#define MX53_PAD_CSI0_DAT13__TPIU_TRACE_10 (_MX53_PAD_CSI0_DAT13__TPIU_TRACE_10 | MUX_PAD_CTRL(NO_PAD_CTRL))
1580#define MX53_PAD_CSI0_DAT14__IPU_CSI0_D_14 (_MX53_PAD_CSI0_DAT14__IPU_CSI0_D_14 | MUX_PAD_CTRL(NO_PAD_CTRL))
1581#define MX53_PAD_CSI0_DAT14__GPIO6_0 (_MX53_PAD_CSI0_DAT14__GPIO6_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1582#define MX53_PAD_CSI0_DAT14__UART5_TXD_MUX (_MX53_PAD_CSI0_DAT14__UART5_TXD_MUX | MUX_PAD_CTRL(NO_PAD_CTRL))
1583#define MX53_PAD_CSI0_DAT14__USBOH3_USBH3_DATA_2 (_MX53_PAD_CSI0_DAT14__USBOH3_USBH3_DATA_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1584#define MX53_PAD_CSI0_DAT14__SDMA_DEBUG_PC_8 (_MX53_PAD_CSI0_DAT14__SDMA_DEBUG_PC_8 | MUX_PAD_CTRL(NO_PAD_CTRL))
1585#define MX53_PAD_CSI0_DAT14__EMI_EMI_DEBUG_43 (_MX53_PAD_CSI0_DAT14__EMI_EMI_DEBUG_43 | MUX_PAD_CTRL(NO_PAD_CTRL))
1586#define MX53_PAD_CSI0_DAT14__TPIU_TRACE_11 (_MX53_PAD_CSI0_DAT14__TPIU_TRACE_11 | MUX_PAD_CTRL(NO_PAD_CTRL))
1587#define MX53_PAD_CSI0_DAT15__IPU_CSI0_D_15 (_MX53_PAD_CSI0_DAT15__IPU_CSI0_D_15 | MUX_PAD_CTRL(NO_PAD_CTRL))
1588#define MX53_PAD_CSI0_DAT15__GPIO6_1 (_MX53_PAD_CSI0_DAT15__GPIO6_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1589#define MX53_PAD_CSI0_DAT15__UART5_RXD_MUX (_MX53_PAD_CSI0_DAT15__UART5_RXD_MUX | MUX_PAD_CTRL(NO_PAD_CTRL))
1590#define MX53_PAD_CSI0_DAT15__USBOH3_USBH3_DATA_3 (_MX53_PAD_CSI0_DAT15__USBOH3_USBH3_DATA_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1591#define MX53_PAD_CSI0_DAT15__SDMA_DEBUG_PC_9 (_MX53_PAD_CSI0_DAT15__SDMA_DEBUG_PC_9 | MUX_PAD_CTRL(NO_PAD_CTRL))
1592#define MX53_PAD_CSI0_DAT15__EMI_EMI_DEBUG_44 (_MX53_PAD_CSI0_DAT15__EMI_EMI_DEBUG_44 | MUX_PAD_CTRL(NO_PAD_CTRL))
1593#define MX53_PAD_CSI0_DAT15__TPIU_TRACE_12 (_MX53_PAD_CSI0_DAT15__TPIU_TRACE_12 | MUX_PAD_CTRL(NO_PAD_CTRL))
1594#define MX53_PAD_CSI0_DAT16__IPU_CSI0_D_16 (_MX53_PAD_CSI0_DAT16__IPU_CSI0_D_16 | MUX_PAD_CTRL(NO_PAD_CTRL))
1595#define MX53_PAD_CSI0_DAT16__GPIO6_2 (_MX53_PAD_CSI0_DAT16__GPIO6_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1596#define MX53_PAD_CSI0_DAT16__UART4_RTS (_MX53_PAD_CSI0_DAT16__UART4_RTS | MUX_PAD_CTRL(NO_PAD_CTRL))
1597#define MX53_PAD_CSI0_DAT16__USBOH3_USBH3_DATA_4 (_MX53_PAD_CSI0_DAT16__USBOH3_USBH3_DATA_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
1598#define MX53_PAD_CSI0_DAT16__SDMA_DEBUG_PC_10 (_MX53_PAD_CSI0_DAT16__SDMA_DEBUG_PC_10 | MUX_PAD_CTRL(NO_PAD_CTRL))
1599#define MX53_PAD_CSI0_DAT16__EMI_EMI_DEBUG_45 (_MX53_PAD_CSI0_DAT16__EMI_EMI_DEBUG_45 | MUX_PAD_CTRL(NO_PAD_CTRL))
1600#define MX53_PAD_CSI0_DAT16__TPIU_TRACE_13 (_MX53_PAD_CSI0_DAT16__TPIU_TRACE_13 | MUX_PAD_CTRL(NO_PAD_CTRL))
1601#define MX53_PAD_CSI0_DAT17__IPU_CSI0_D_17 (_MX53_PAD_CSI0_DAT17__IPU_CSI0_D_17 | MUX_PAD_CTRL(NO_PAD_CTRL))
1602#define MX53_PAD_CSI0_DAT17__GPIO6_3 (_MX53_PAD_CSI0_DAT17__GPIO6_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1603#define MX53_PAD_CSI0_DAT17__UART4_CTS (_MX53_PAD_CSI0_DAT17__UART4_CTS | MUX_PAD_CTRL(NO_PAD_CTRL))
1604#define MX53_PAD_CSI0_DAT17__USBOH3_USBH3_DATA_5 (_MX53_PAD_CSI0_DAT17__USBOH3_USBH3_DATA_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
1605#define MX53_PAD_CSI0_DAT17__SDMA_DEBUG_PC_11 (_MX53_PAD_CSI0_DAT17__SDMA_DEBUG_PC_11 | MUX_PAD_CTRL(NO_PAD_CTRL))
1606#define MX53_PAD_CSI0_DAT17__EMI_EMI_DEBUG_46 (_MX53_PAD_CSI0_DAT17__EMI_EMI_DEBUG_46 | MUX_PAD_CTRL(NO_PAD_CTRL))
1607#define MX53_PAD_CSI0_DAT17__TPIU_TRACE_14 (_MX53_PAD_CSI0_DAT17__TPIU_TRACE_14 | MUX_PAD_CTRL(NO_PAD_CTRL))
1608#define MX53_PAD_CSI0_DAT18__IPU_CSI0_D_18 (_MX53_PAD_CSI0_DAT18__IPU_CSI0_D_18 | MUX_PAD_CTRL(NO_PAD_CTRL))
1609#define MX53_PAD_CSI0_DAT18__GPIO6_4 (_MX53_PAD_CSI0_DAT18__GPIO6_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
1610#define MX53_PAD_CSI0_DAT18__UART5_RTS (_MX53_PAD_CSI0_DAT18__UART5_RTS | MUX_PAD_CTRL(NO_PAD_CTRL))
1611#define MX53_PAD_CSI0_DAT18__USBOH3_USBH3_DATA_6 (_MX53_PAD_CSI0_DAT18__USBOH3_USBH3_DATA_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
1612#define MX53_PAD_CSI0_DAT18__SDMA_DEBUG_PC_12 (_MX53_PAD_CSI0_DAT18__SDMA_DEBUG_PC_12 | MUX_PAD_CTRL(NO_PAD_CTRL))
1613#define MX53_PAD_CSI0_DAT18__EMI_EMI_DEBUG_47 (_MX53_PAD_CSI0_DAT18__EMI_EMI_DEBUG_47 | MUX_PAD_CTRL(NO_PAD_CTRL))
1614#define MX53_PAD_CSI0_DAT18__TPIU_TRACE_15 (_MX53_PAD_CSI0_DAT18__TPIU_TRACE_15 | MUX_PAD_CTRL(NO_PAD_CTRL))
1615#define MX53_PAD_CSI0_DAT19__IPU_CSI0_D_19 (_MX53_PAD_CSI0_DAT19__IPU_CSI0_D_19 | MUX_PAD_CTRL(NO_PAD_CTRL))
1616#define MX53_PAD_CSI0_DAT19__GPIO6_5 (_MX53_PAD_CSI0_DAT19__GPIO6_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
1617#define MX53_PAD_CSI0_DAT19__UART5_CTS (_MX53_PAD_CSI0_DAT19__UART5_CTS | MUX_PAD_CTRL(NO_PAD_CTRL))
1618#define MX53_PAD_CSI0_DAT19__USBOH3_USBH3_DATA_7 (_MX53_PAD_CSI0_DAT19__USBOH3_USBH3_DATA_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
1619#define MX53_PAD_CSI0_DAT19__SDMA_DEBUG_PC_13 (_MX53_PAD_CSI0_DAT19__SDMA_DEBUG_PC_13 | MUX_PAD_CTRL(NO_PAD_CTRL))
1620#define MX53_PAD_CSI0_DAT19__EMI_EMI_DEBUG_48 (_MX53_PAD_CSI0_DAT19__EMI_EMI_DEBUG_48 | MUX_PAD_CTRL(NO_PAD_CTRL))
1621#define MX53_PAD_CSI0_DAT19__USBPHY2_BISTOK (_MX53_PAD_CSI0_DAT19__USBPHY2_BISTOK | MUX_PAD_CTRL(NO_PAD_CTRL))
1622#define MX53_PAD_EIM_A25__EMI_WEIM_A_25 (_MX53_PAD_EIM_A25__EMI_WEIM_A_25 | MUX_PAD_CTRL(NO_PAD_CTRL))
1623#define MX53_PAD_EIM_A25__GPIO5_2 (_MX53_PAD_EIM_A25__GPIO5_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1624#define MX53_PAD_EIM_A25__ECSPI2_RDY (_MX53_PAD_EIM_A25__ECSPI2_RDY | MUX_PAD_CTRL(NO_PAD_CTRL))
1625#define MX53_PAD_EIM_A25__IPU_DI1_PIN12 (_MX53_PAD_EIM_A25__IPU_DI1_PIN12 | MUX_PAD_CTRL(NO_PAD_CTRL))
1626#define MX53_PAD_EIM_A25__CSPI_SS1 (_MX53_PAD_EIM_A25__CSPI_SS1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1627#define MX53_PAD_EIM_A25__IPU_DI0_D1_CS (_MX53_PAD_EIM_A25__IPU_DI0_D1_CS | MUX_PAD_CTRL(NO_PAD_CTRL))
1628#define MX53_PAD_EIM_A25__USBPHY1_BISTOK (_MX53_PAD_EIM_A25__USBPHY1_BISTOK | MUX_PAD_CTRL(NO_PAD_CTRL))
1629#define MX53_PAD_EIM_EB2__EMI_WEIM_EB_2 (_MX53_PAD_EIM_EB2__EMI_WEIM_EB_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1630#define MX53_PAD_EIM_EB2__GPIO2_30 (_MX53_PAD_EIM_EB2__GPIO2_30 | MUX_PAD_CTRL(NO_PAD_CTRL))
1631#define MX53_PAD_EIM_EB2__CCM_DI1_EXT_CLK (_MX53_PAD_EIM_EB2__CCM_DI1_EXT_CLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1632#define MX53_PAD_EIM_EB2__IPU_SER_DISP1_CS (_MX53_PAD_EIM_EB2__IPU_SER_DISP1_CS | MUX_PAD_CTRL(NO_PAD_CTRL))
1633#define MX53_PAD_EIM_EB2__ECSPI1_SS0 (_MX53_PAD_EIM_EB2__ECSPI1_SS0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1634#define MX53_PAD_EIM_EB2__I2C2_SCL (_MX53_PAD_EIM_EB2__I2C2_SCL | MUX_PAD_CTRL(NO_PAD_CTRL))
1635#define MX53_PAD_EIM_D16__EMI_WEIM_D_16 (_MX53_PAD_EIM_D16__EMI_WEIM_D_16 | MUX_PAD_CTRL(NO_PAD_CTRL))
1636#define MX53_PAD_EIM_D16__GPIO3_16 (_MX53_PAD_EIM_D16__GPIO3_16 | MUX_PAD_CTRL(NO_PAD_CTRL))
1637#define MX53_PAD_EIM_D16__IPU_DI0_PIN5 (_MX53_PAD_EIM_D16__IPU_DI0_PIN5 | MUX_PAD_CTRL(NO_PAD_CTRL))
1638#define MX53_PAD_EIM_D16__IPU_DISPB1_SER_CLK (_MX53_PAD_EIM_D16__IPU_DISPB1_SER_CLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1639#define MX53_PAD_EIM_D16__ECSPI1_SCLK (_MX53_PAD_EIM_D16__ECSPI1_SCLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1640#define MX53_PAD_EIM_D16__I2C2_SDA (_MX53_PAD_EIM_D16__I2C2_SDA | MUX_PAD_CTRL(NO_PAD_CTRL))
1641#define MX53_PAD_EIM_D17__EMI_WEIM_D_17 (_MX53_PAD_EIM_D17__EMI_WEIM_D_17 | MUX_PAD_CTRL(NO_PAD_CTRL))
1642#define MX53_PAD_EIM_D17__GPIO3_17 (_MX53_PAD_EIM_D17__GPIO3_17 | MUX_PAD_CTRL(NO_PAD_CTRL))
1643#define MX53_PAD_EIM_D17__IPU_DI0_PIN6 (_MX53_PAD_EIM_D17__IPU_DI0_PIN6 | MUX_PAD_CTRL(NO_PAD_CTRL))
1644#define MX53_PAD_EIM_D17__IPU_DISPB1_SER_DIN (_MX53_PAD_EIM_D17__IPU_DISPB1_SER_DIN | MUX_PAD_CTRL(NO_PAD_CTRL))
1645#define MX53_PAD_EIM_D17__ECSPI1_MISO (_MX53_PAD_EIM_D17__ECSPI1_MISO | MUX_PAD_CTRL(NO_PAD_CTRL))
1646#define MX53_PAD_EIM_D17__I2C3_SCL (_MX53_PAD_EIM_D17__I2C3_SCL | MUX_PAD_CTRL(NO_PAD_CTRL))
1647#define MX53_PAD_EIM_D18__EMI_WEIM_D_18 (_MX53_PAD_EIM_D18__EMI_WEIM_D_18 | MUX_PAD_CTRL(NO_PAD_CTRL))
1648#define MX53_PAD_EIM_D18__GPIO3_18 (_MX53_PAD_EIM_D18__GPIO3_18 | MUX_PAD_CTRL(NO_PAD_CTRL))
1649#define MX53_PAD_EIM_D18__IPU_DI0_PIN7 (_MX53_PAD_EIM_D18__IPU_DI0_PIN7 | MUX_PAD_CTRL(NO_PAD_CTRL))
1650#define MX53_PAD_EIM_D18__IPU_DISPB1_SER_DIO (_MX53_PAD_EIM_D18__IPU_DISPB1_SER_DIO | MUX_PAD_CTRL(NO_PAD_CTRL))
1651#define MX53_PAD_EIM_D18__ECSPI1_MOSI (_MX53_PAD_EIM_D18__ECSPI1_MOSI | MUX_PAD_CTRL(NO_PAD_CTRL))
1652#define MX53_PAD_EIM_D18__I2C3_SDA (_MX53_PAD_EIM_D18__I2C3_SDA | MUX_PAD_CTRL(NO_PAD_CTRL))
1653#define MX53_PAD_EIM_D18__IPU_DI1_D0_CS (_MX53_PAD_EIM_D18__IPU_DI1_D0_CS | MUX_PAD_CTRL(NO_PAD_CTRL))
1654#define MX53_PAD_EIM_D19__EMI_WEIM_D_19 (_MX53_PAD_EIM_D19__EMI_WEIM_D_19 | MUX_PAD_CTRL(NO_PAD_CTRL))
1655#define MX53_PAD_EIM_D19__GPIO3_19 (_MX53_PAD_EIM_D19__GPIO3_19 | MUX_PAD_CTRL(NO_PAD_CTRL))
1656#define MX53_PAD_EIM_D19__IPU_DI0_PIN8 (_MX53_PAD_EIM_D19__IPU_DI0_PIN8 | MUX_PAD_CTRL(NO_PAD_CTRL))
1657#define MX53_PAD_EIM_D19__IPU_DISPB1_SER_RS (_MX53_PAD_EIM_D19__IPU_DISPB1_SER_RS | MUX_PAD_CTRL(NO_PAD_CTRL))
1658#define MX53_PAD_EIM_D19__ECSPI1_SS1 (_MX53_PAD_EIM_D19__ECSPI1_SS1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1659#define MX53_PAD_EIM_D19__EPIT1_EPITO (_MX53_PAD_EIM_D19__EPIT1_EPITO | MUX_PAD_CTRL(NO_PAD_CTRL))
1660#define MX53_PAD_EIM_D19__UART1_CTS (_MX53_PAD_EIM_D19__UART1_CTS | MUX_PAD_CTRL(NO_PAD_CTRL))
1661#define MX53_PAD_EIM_D19__USBOH3_USBH2_OC (_MX53_PAD_EIM_D19__USBOH3_USBH2_OC | MUX_PAD_CTRL(NO_PAD_CTRL))
1662#define MX53_PAD_EIM_D20__EMI_WEIM_D_20 (_MX53_PAD_EIM_D20__EMI_WEIM_D_20 | MUX_PAD_CTRL(NO_PAD_CTRL))
1663#define MX53_PAD_EIM_D20__GPIO3_20 (_MX53_PAD_EIM_D20__GPIO3_20 | MUX_PAD_CTRL(NO_PAD_CTRL))
1664#define MX53_PAD_EIM_D20__IPU_DI0_PIN16 (_MX53_PAD_EIM_D20__IPU_DI0_PIN16 | MUX_PAD_CTRL(NO_PAD_CTRL))
1665#define MX53_PAD_EIM_D20__IPU_SER_DISP0_CS (_MX53_PAD_EIM_D20__IPU_SER_DISP0_CS | MUX_PAD_CTRL(NO_PAD_CTRL))
1666#define MX53_PAD_EIM_D20__CSPI_SS0 (_MX53_PAD_EIM_D20__CSPI_SS0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1667#define MX53_PAD_EIM_D20__EPIT2_EPITO (_MX53_PAD_EIM_D20__EPIT2_EPITO | MUX_PAD_CTRL(NO_PAD_CTRL))
1668#define MX53_PAD_EIM_D20__UART1_RTS (_MX53_PAD_EIM_D20__UART1_RTS | MUX_PAD_CTRL(NO_PAD_CTRL))
1669#define MX53_PAD_EIM_D20__USBOH3_USBH2_PWR (_MX53_PAD_EIM_D20__USBOH3_USBH2_PWR | MUX_PAD_CTRL(NO_PAD_CTRL))
1670#define MX53_PAD_EIM_D21__EMI_WEIM_D_21 (_MX53_PAD_EIM_D21__EMI_WEIM_D_21 | MUX_PAD_CTRL(NO_PAD_CTRL))
1671#define MX53_PAD_EIM_D21__GPIO3_21 (_MX53_PAD_EIM_D21__GPIO3_21 | MUX_PAD_CTRL(NO_PAD_CTRL))
1672#define MX53_PAD_EIM_D21__IPU_DI0_PIN17 (_MX53_PAD_EIM_D21__IPU_DI0_PIN17 | MUX_PAD_CTRL(NO_PAD_CTRL))
1673#define MX53_PAD_EIM_D21__IPU_DISPB0_SER_CLK (_MX53_PAD_EIM_D21__IPU_DISPB0_SER_CLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1674#define MX53_PAD_EIM_D21__CSPI_SCLK (_MX53_PAD_EIM_D21__CSPI_SCLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1675#define MX53_PAD_EIM_D21__I2C1_SCL (_MX53_PAD_EIM_D21__I2C1_SCL | MUX_PAD_CTRL(NO_PAD_CTRL))
1676#define MX53_PAD_EIM_D21__USBOH3_USBOTG_OC (_MX53_PAD_EIM_D21__USBOH3_USBOTG_OC | MUX_PAD_CTRL(NO_PAD_CTRL))
1677#define MX53_PAD_EIM_D22__EMI_WEIM_D_22 (_MX53_PAD_EIM_D22__EMI_WEIM_D_22 | MUX_PAD_CTRL(NO_PAD_CTRL))
1678#define MX53_PAD_EIM_D22__GPIO3_22 (_MX53_PAD_EIM_D22__GPIO3_22 | MUX_PAD_CTRL(NO_PAD_CTRL))
1679#define MX53_PAD_EIM_D22__IPU_DI0_PIN1 (_MX53_PAD_EIM_D22__IPU_DI0_PIN1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1680#define MX53_PAD_EIM_D22__IPU_DISPB0_SER_DIN (_MX53_PAD_EIM_D22__IPU_DISPB0_SER_DIN | MUX_PAD_CTRL(NO_PAD_CTRL))
1681#define MX53_PAD_EIM_D22__CSPI_MISO (_MX53_PAD_EIM_D22__CSPI_MISO | MUX_PAD_CTRL(NO_PAD_CTRL))
1682#define MX53_PAD_EIM_D22__USBOH3_USBOTG_PWR (_MX53_PAD_EIM_D22__USBOH3_USBOTG_PWR | MUX_PAD_CTRL(NO_PAD_CTRL))
1683#define MX53_PAD_EIM_D23__EMI_WEIM_D_23 (_MX53_PAD_EIM_D23__EMI_WEIM_D_23 | MUX_PAD_CTRL(NO_PAD_CTRL))
1684#define MX53_PAD_EIM_D23__GPIO3_23 (_MX53_PAD_EIM_D23__GPIO3_23 | MUX_PAD_CTRL(NO_PAD_CTRL))
1685#define MX53_PAD_EIM_D23__UART3_CTS (_MX53_PAD_EIM_D23__UART3_CTS | MUX_PAD_CTRL(NO_PAD_CTRL))
1686#define MX53_PAD_EIM_D23__UART1_DCD (_MX53_PAD_EIM_D23__UART1_DCD | MUX_PAD_CTRL(NO_PAD_CTRL))
1687#define MX53_PAD_EIM_D23__IPU_DI0_D0_CS (_MX53_PAD_EIM_D23__IPU_DI0_D0_CS | MUX_PAD_CTRL(NO_PAD_CTRL))
1688#define MX53_PAD_EIM_D23__IPU_DI1_PIN2 (_MX53_PAD_EIM_D23__IPU_DI1_PIN2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1689#define MX53_PAD_EIM_D23__IPU_CSI1_DATA_EN (_MX53_PAD_EIM_D23__IPU_CSI1_DATA_EN | MUX_PAD_CTRL(NO_PAD_CTRL))
1690#define MX53_PAD_EIM_D23__IPU_DI1_PIN14 (_MX53_PAD_EIM_D23__IPU_DI1_PIN14 | MUX_PAD_CTRL(NO_PAD_CTRL))
1691#define MX53_PAD_EIM_EB3__EMI_WEIM_EB_3 (_MX53_PAD_EIM_EB3__EMI_WEIM_EB_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1692#define MX53_PAD_EIM_EB3__GPIO2_31 (_MX53_PAD_EIM_EB3__GPIO2_31 | MUX_PAD_CTRL(NO_PAD_CTRL))
1693#define MX53_PAD_EIM_EB3__UART3_RTS (_MX53_PAD_EIM_EB3__UART3_RTS | MUX_PAD_CTRL(NO_PAD_CTRL))
1694#define MX53_PAD_EIM_EB3__UART1_RI (_MX53_PAD_EIM_EB3__UART1_RI | MUX_PAD_CTRL(NO_PAD_CTRL))
1695#define MX53_PAD_EIM_EB3__IPU_DI1_PIN3 (_MX53_PAD_EIM_EB3__IPU_DI1_PIN3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1696#define MX53_PAD_EIM_EB3__IPU_CSI1_HSYNC (_MX53_PAD_EIM_EB3__IPU_CSI1_HSYNC | MUX_PAD_CTRL(NO_PAD_CTRL))
1697#define MX53_PAD_EIM_EB3__IPU_DI1_PIN16 (_MX53_PAD_EIM_EB3__IPU_DI1_PIN16 | MUX_PAD_CTRL(NO_PAD_CTRL))
1698#define MX53_PAD_EIM_D24__EMI_WEIM_D_24 (_MX53_PAD_EIM_D24__EMI_WEIM_D_24 | MUX_PAD_CTRL(NO_PAD_CTRL))
1699#define MX53_PAD_EIM_D24__GPIO3_24 (_MX53_PAD_EIM_D24__GPIO3_24 | MUX_PAD_CTRL(NO_PAD_CTRL))
1700#define MX53_PAD_EIM_D24__UART3_TXD_MUX (_MX53_PAD_EIM_D24__UART3_TXD_MUX | MUX_PAD_CTRL(NO_PAD_CTRL))
1701#define MX53_PAD_EIM_D24__ECSPI1_SS2 (_MX53_PAD_EIM_D24__ECSPI1_SS2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1702#define MX53_PAD_EIM_D24__CSPI_SS2 (_MX53_PAD_EIM_D24__CSPI_SS2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1703#define MX53_PAD_EIM_D24__AUDMUX_AUD5_RXFS (_MX53_PAD_EIM_D24__AUDMUX_AUD5_RXFS | MUX_PAD_CTRL(NO_PAD_CTRL))
1704#define MX53_PAD_EIM_D24__ECSPI2_SS2 (_MX53_PAD_EIM_D24__ECSPI2_SS2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1705#define MX53_PAD_EIM_D24__UART1_DTR (_MX53_PAD_EIM_D24__UART1_DTR | MUX_PAD_CTRL(NO_PAD_CTRL))
1706#define MX53_PAD_EIM_D25__EMI_WEIM_D_25 (_MX53_PAD_EIM_D25__EMI_WEIM_D_25 | MUX_PAD_CTRL(NO_PAD_CTRL))
1707#define MX53_PAD_EIM_D25__GPIO3_25 (_MX53_PAD_EIM_D25__GPIO3_25 | MUX_PAD_CTRL(NO_PAD_CTRL))
1708#define MX53_PAD_EIM_D25__UART3_RXD_MUX (_MX53_PAD_EIM_D25__UART3_RXD_MUX | MUX_PAD_CTRL(NO_PAD_CTRL))
1709#define MX53_PAD_EIM_D25__ECSPI1_SS3 (_MX53_PAD_EIM_D25__ECSPI1_SS3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1710#define MX53_PAD_EIM_D25__CSPI_SS3 (_MX53_PAD_EIM_D25__CSPI_SS3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1711#define MX53_PAD_EIM_D25__AUDMUX_AUD5_RXC (_MX53_PAD_EIM_D25__AUDMUX_AUD5_RXC | MUX_PAD_CTRL(NO_PAD_CTRL))
1712#define MX53_PAD_EIM_D25__ECSPI2_SS3 (_MX53_PAD_EIM_D25__ECSPI2_SS3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1713#define MX53_PAD_EIM_D25__UART1_DSR (_MX53_PAD_EIM_D25__UART1_DSR | MUX_PAD_CTRL(NO_PAD_CTRL))
1714#define MX53_PAD_EIM_D26__EMI_WEIM_D_26 (_MX53_PAD_EIM_D26__EMI_WEIM_D_26 | MUX_PAD_CTRL(NO_PAD_CTRL))
1715#define MX53_PAD_EIM_D26__GPIO3_26 (_MX53_PAD_EIM_D26__GPIO3_26 | MUX_PAD_CTRL(NO_PAD_CTRL))
1716#define MX53_PAD_EIM_D26__UART2_TXD_MUX (_MX53_PAD_EIM_D26__UART2_TXD_MUX | MUX_PAD_CTRL(NO_PAD_CTRL))
1717#define MX53_PAD_EIM_D26__FIRI_RXD (_MX53_PAD_EIM_D26__FIRI_RXD | MUX_PAD_CTRL(NO_PAD_CTRL))
1718#define MX53_PAD_EIM_D26__IPU_CSI0_D_1 (_MX53_PAD_EIM_D26__IPU_CSI0_D_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1719#define MX53_PAD_EIM_D26__IPU_DI1_PIN11 (_MX53_PAD_EIM_D26__IPU_DI1_PIN11 | MUX_PAD_CTRL(NO_PAD_CTRL))
1720#define MX53_PAD_EIM_D26__IPU_SISG_2 (_MX53_PAD_EIM_D26__IPU_SISG_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1721#define MX53_PAD_EIM_D26__IPU_DISP1_DAT_22 (_MX53_PAD_EIM_D26__IPU_DISP1_DAT_22 | MUX_PAD_CTRL(NO_PAD_CTRL))
1722#define MX53_PAD_EIM_D27__EMI_WEIM_D_27 (_MX53_PAD_EIM_D27__EMI_WEIM_D_27 | MUX_PAD_CTRL(NO_PAD_CTRL))
1723#define MX53_PAD_EIM_D27__GPIO3_27 (_MX53_PAD_EIM_D27__GPIO3_27 | MUX_PAD_CTRL(NO_PAD_CTRL))
1724#define MX53_PAD_EIM_D27__UART2_RXD_MUX (_MX53_PAD_EIM_D27__UART2_RXD_MUX | MUX_PAD_CTRL(NO_PAD_CTRL))
1725#define MX53_PAD_EIM_D27__FIRI_TXD (_MX53_PAD_EIM_D27__FIRI_TXD | MUX_PAD_CTRL(NO_PAD_CTRL))
1726#define MX53_PAD_EIM_D27__IPU_CSI0_D_0 (_MX53_PAD_EIM_D27__IPU_CSI0_D_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1727#define MX53_PAD_EIM_D27__IPU_DI1_PIN13 (_MX53_PAD_EIM_D27__IPU_DI1_PIN13 | MUX_PAD_CTRL(NO_PAD_CTRL))
1728#define MX53_PAD_EIM_D27__IPU_SISG_3 (_MX53_PAD_EIM_D27__IPU_SISG_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1729#define MX53_PAD_EIM_D27__IPU_DISP1_DAT_23 (_MX53_PAD_EIM_D27__IPU_DISP1_DAT_23 | MUX_PAD_CTRL(NO_PAD_CTRL))
1730#define MX53_PAD_EIM_D28__EMI_WEIM_D_28 (_MX53_PAD_EIM_D28__EMI_WEIM_D_28 | MUX_PAD_CTRL(NO_PAD_CTRL))
1731#define MX53_PAD_EIM_D28__GPIO3_28 (_MX53_PAD_EIM_D28__GPIO3_28 | MUX_PAD_CTRL(NO_PAD_CTRL))
1732#define MX53_PAD_EIM_D28__UART2_CTS (_MX53_PAD_EIM_D28__UART2_CTS | MUX_PAD_CTRL(NO_PAD_CTRL))
1733#define MX53_PAD_EIM_D28__IPU_DISPB0_SER_DIO (_MX53_PAD_EIM_D28__IPU_DISPB0_SER_DIO | MUX_PAD_CTRL(NO_PAD_CTRL))
1734#define MX53_PAD_EIM_D28__CSPI_MOSI (_MX53_PAD_EIM_D28__CSPI_MOSI | MUX_PAD_CTRL(NO_PAD_CTRL))
1735#define MX53_PAD_EIM_D28__I2C1_SDA (_MX53_PAD_EIM_D28__I2C1_SDA | MUX_PAD_CTRL(NO_PAD_CTRL))
1736#define MX53_PAD_EIM_D28__IPU_EXT_TRIG (_MX53_PAD_EIM_D28__IPU_EXT_TRIG | MUX_PAD_CTRL(NO_PAD_CTRL))
1737#define MX53_PAD_EIM_D28__IPU_DI0_PIN13 (_MX53_PAD_EIM_D28__IPU_DI0_PIN13 | MUX_PAD_CTRL(NO_PAD_CTRL))
1738#define MX53_PAD_EIM_D29__EMI_WEIM_D_29 (_MX53_PAD_EIM_D29__EMI_WEIM_D_29 | MUX_PAD_CTRL(NO_PAD_CTRL))
1739#define MX53_PAD_EIM_D29__GPIO3_29 (_MX53_PAD_EIM_D29__GPIO3_29 | MUX_PAD_CTRL(NO_PAD_CTRL))
1740#define MX53_PAD_EIM_D29__UART2_RTS (_MX53_PAD_EIM_D29__UART2_RTS | MUX_PAD_CTRL(NO_PAD_CTRL))
1741#define MX53_PAD_EIM_D29__IPU_DISPB0_SER_RS (_MX53_PAD_EIM_D29__IPU_DISPB0_SER_RS | MUX_PAD_CTRL(NO_PAD_CTRL))
1742#define MX53_PAD_EIM_D29__CSPI_SS0 (_MX53_PAD_EIM_D29__CSPI_SS0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1743#define MX53_PAD_EIM_D29__IPU_DI1_PIN15 (_MX53_PAD_EIM_D29__IPU_DI1_PIN15 | MUX_PAD_CTRL(NO_PAD_CTRL))
1744#define MX53_PAD_EIM_D29__IPU_CSI1_VSYNC (_MX53_PAD_EIM_D29__IPU_CSI1_VSYNC | MUX_PAD_CTRL(NO_PAD_CTRL))
1745#define MX53_PAD_EIM_D29__IPU_DI0_PIN14 (_MX53_PAD_EIM_D29__IPU_DI0_PIN14 | MUX_PAD_CTRL(NO_PAD_CTRL))
1746#define MX53_PAD_EIM_D30__EMI_WEIM_D_30 (_MX53_PAD_EIM_D30__EMI_WEIM_D_30 | MUX_PAD_CTRL(NO_PAD_CTRL))
1747#define MX53_PAD_EIM_D30__GPIO3_30 (_MX53_PAD_EIM_D30__GPIO3_30 | MUX_PAD_CTRL(NO_PAD_CTRL))
1748#define MX53_PAD_EIM_D30__UART3_CTS (_MX53_PAD_EIM_D30__UART3_CTS | MUX_PAD_CTRL(NO_PAD_CTRL))
1749#define MX53_PAD_EIM_D30__IPU_CSI0_D_3 (_MX53_PAD_EIM_D30__IPU_CSI0_D_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1750#define MX53_PAD_EIM_D30__IPU_DI0_PIN11 (_MX53_PAD_EIM_D30__IPU_DI0_PIN11 | MUX_PAD_CTRL(NO_PAD_CTRL))
1751#define MX53_PAD_EIM_D30__IPU_DISP1_DAT_21 (_MX53_PAD_EIM_D30__IPU_DISP1_DAT_21 | MUX_PAD_CTRL(NO_PAD_CTRL))
1752#define MX53_PAD_EIM_D30__USBOH3_USBH1_OC (_MX53_PAD_EIM_D30__USBOH3_USBH1_OC | MUX_PAD_CTRL(NO_PAD_CTRL))
1753#define MX53_PAD_EIM_D30__USBOH3_USBH2_OC (_MX53_PAD_EIM_D30__USBOH3_USBH2_OC | MUX_PAD_CTRL(NO_PAD_CTRL))
1754#define MX53_PAD_EIM_D31__EMI_WEIM_D_31 (_MX53_PAD_EIM_D31__EMI_WEIM_D_31 | MUX_PAD_CTRL(NO_PAD_CTRL))
1755#define MX53_PAD_EIM_D31__GPIO3_31 (_MX53_PAD_EIM_D31__GPIO3_31 | MUX_PAD_CTRL(NO_PAD_CTRL))
1756#define MX53_PAD_EIM_D31__UART3_RTS (_MX53_PAD_EIM_D31__UART3_RTS | MUX_PAD_CTRL(NO_PAD_CTRL))
1757#define MX53_PAD_EIM_D31__IPU_CSI0_D_2 (_MX53_PAD_EIM_D31__IPU_CSI0_D_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1758#define MX53_PAD_EIM_D31__IPU_DI0_PIN12 (_MX53_PAD_EIM_D31__IPU_DI0_PIN12 | MUX_PAD_CTRL(NO_PAD_CTRL))
1759#define MX53_PAD_EIM_D31__IPU_DISP1_DAT_20 (_MX53_PAD_EIM_D31__IPU_DISP1_DAT_20 | MUX_PAD_CTRL(NO_PAD_CTRL))
1760#define MX53_PAD_EIM_D31__USBOH3_USBH1_PWR (_MX53_PAD_EIM_D31__USBOH3_USBH1_PWR | MUX_PAD_CTRL(NO_PAD_CTRL))
1761#define MX53_PAD_EIM_D31__USBOH3_USBH2_PWR (_MX53_PAD_EIM_D31__USBOH3_USBH2_PWR | MUX_PAD_CTRL(NO_PAD_CTRL))
1762#define MX53_PAD_EIM_A24__EMI_WEIM_A_24 (_MX53_PAD_EIM_A24__EMI_WEIM_A_24 | MUX_PAD_CTRL(NO_PAD_CTRL))
1763#define MX53_PAD_EIM_A24__GPIO5_4 (_MX53_PAD_EIM_A24__GPIO5_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
1764#define MX53_PAD_EIM_A24__IPU_DISP1_DAT_19 (_MX53_PAD_EIM_A24__IPU_DISP1_DAT_19 | MUX_PAD_CTRL(NO_PAD_CTRL))
1765#define MX53_PAD_EIM_A24__IPU_CSI1_D_19 (_MX53_PAD_EIM_A24__IPU_CSI1_D_19 | MUX_PAD_CTRL(NO_PAD_CTRL))
1766#define MX53_PAD_EIM_A24__IPU_SISG_2 (_MX53_PAD_EIM_A24__IPU_SISG_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1767#define MX53_PAD_EIM_A24__USBPHY2_BVALID (_MX53_PAD_EIM_A24__USBPHY2_BVALID | MUX_PAD_CTRL(NO_PAD_CTRL))
1768#define MX53_PAD_EIM_A23__EMI_WEIM_A_23 (_MX53_PAD_EIM_A23__EMI_WEIM_A_23 | MUX_PAD_CTRL(NO_PAD_CTRL))
1769#define MX53_PAD_EIM_A23__GPIO6_6 (_MX53_PAD_EIM_A23__GPIO6_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
1770#define MX53_PAD_EIM_A23__IPU_DISP1_DAT_18 (_MX53_PAD_EIM_A23__IPU_DISP1_DAT_18 | MUX_PAD_CTRL(NO_PAD_CTRL))
1771#define MX53_PAD_EIM_A23__IPU_CSI1_D_18 (_MX53_PAD_EIM_A23__IPU_CSI1_D_18 | MUX_PAD_CTRL(NO_PAD_CTRL))
1772#define MX53_PAD_EIM_A23__IPU_SISG_3 (_MX53_PAD_EIM_A23__IPU_SISG_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1773#define MX53_PAD_EIM_A23__USBPHY2_ENDSESSION (_MX53_PAD_EIM_A23__USBPHY2_ENDSESSION | MUX_PAD_CTRL(NO_PAD_CTRL))
1774#define MX53_PAD_EIM_A22__EMI_WEIM_A_22 (_MX53_PAD_EIM_A22__EMI_WEIM_A_22 | MUX_PAD_CTRL(NO_PAD_CTRL))
1775#define MX53_PAD_EIM_A22__GPIO2_16 (_MX53_PAD_EIM_A22__GPIO2_16 | MUX_PAD_CTRL(NO_PAD_CTRL))
1776#define MX53_PAD_EIM_A22__IPU_DISP1_DAT_17 (_MX53_PAD_EIM_A22__IPU_DISP1_DAT_17 | MUX_PAD_CTRL(NO_PAD_CTRL))
1777#define MX53_PAD_EIM_A22__IPU_CSI1_D_17 (_MX53_PAD_EIM_A22__IPU_CSI1_D_17 | MUX_PAD_CTRL(NO_PAD_CTRL))
1778#define MX53_PAD_EIM_A22__SRC_BT_CFG1_7 (_MX53_PAD_EIM_A22__SRC_BT_CFG1_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
1779#define MX53_PAD_EIM_A21__EMI_WEIM_A_21 (_MX53_PAD_EIM_A21__EMI_WEIM_A_21 | MUX_PAD_CTRL(NO_PAD_CTRL))
1780#define MX53_PAD_EIM_A21__GPIO2_17 (_MX53_PAD_EIM_A21__GPIO2_17 | MUX_PAD_CTRL(NO_PAD_CTRL))
1781#define MX53_PAD_EIM_A21__IPU_DISP1_DAT_16 (_MX53_PAD_EIM_A21__IPU_DISP1_DAT_16 | MUX_PAD_CTRL(NO_PAD_CTRL))
1782#define MX53_PAD_EIM_A21__IPU_CSI1_D_16 (_MX53_PAD_EIM_A21__IPU_CSI1_D_16 | MUX_PAD_CTRL(NO_PAD_CTRL))
1783#define MX53_PAD_EIM_A21__SRC_BT_CFG1_6 (_MX53_PAD_EIM_A21__SRC_BT_CFG1_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
1784#define MX53_PAD_EIM_A20__EMI_WEIM_A_20 (_MX53_PAD_EIM_A20__EMI_WEIM_A_20 | MUX_PAD_CTRL(NO_PAD_CTRL))
1785#define MX53_PAD_EIM_A20__GPIO2_18 (_MX53_PAD_EIM_A20__GPIO2_18 | MUX_PAD_CTRL(NO_PAD_CTRL))
1786#define MX53_PAD_EIM_A20__IPU_DISP1_DAT_15 (_MX53_PAD_EIM_A20__IPU_DISP1_DAT_15 | MUX_PAD_CTRL(NO_PAD_CTRL))
1787#define MX53_PAD_EIM_A20__IPU_CSI1_D_15 (_MX53_PAD_EIM_A20__IPU_CSI1_D_15 | MUX_PAD_CTRL(NO_PAD_CTRL))
1788#define MX53_PAD_EIM_A20__SRC_BT_CFG1_5 (_MX53_PAD_EIM_A20__SRC_BT_CFG1_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
1789#define MX53_PAD_EIM_A19__EMI_WEIM_A_19 (_MX53_PAD_EIM_A19__EMI_WEIM_A_19 | MUX_PAD_CTRL(NO_PAD_CTRL))
1790#define MX53_PAD_EIM_A19__GPIO2_19 (_MX53_PAD_EIM_A19__GPIO2_19 | MUX_PAD_CTRL(NO_PAD_CTRL))
1791#define MX53_PAD_EIM_A19__IPU_DISP1_DAT_14 (_MX53_PAD_EIM_A19__IPU_DISP1_DAT_14 | MUX_PAD_CTRL(NO_PAD_CTRL))
1792#define MX53_PAD_EIM_A19__IPU_CSI1_D_14 (_MX53_PAD_EIM_A19__IPU_CSI1_D_14 | MUX_PAD_CTRL(NO_PAD_CTRL))
1793#define MX53_PAD_EIM_A19__SRC_BT_CFG1_4 (_MX53_PAD_EIM_A19__SRC_BT_CFG1_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
1794#define MX53_PAD_EIM_A18__EMI_WEIM_A_18 (_MX53_PAD_EIM_A18__EMI_WEIM_A_18 | MUX_PAD_CTRL(NO_PAD_CTRL))
1795#define MX53_PAD_EIM_A18__GPIO2_20 (_MX53_PAD_EIM_A18__GPIO2_20 | MUX_PAD_CTRL(NO_PAD_CTRL))
1796#define MX53_PAD_EIM_A18__IPU_DISP1_DAT_13 (_MX53_PAD_EIM_A18__IPU_DISP1_DAT_13 | MUX_PAD_CTRL(NO_PAD_CTRL))
1797#define MX53_PAD_EIM_A18__IPU_CSI1_D_13 (_MX53_PAD_EIM_A18__IPU_CSI1_D_13 | MUX_PAD_CTRL(NO_PAD_CTRL))
1798#define MX53_PAD_EIM_A18__SRC_BT_CFG1_3 (_MX53_PAD_EIM_A18__SRC_BT_CFG1_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1799#define MX53_PAD_EIM_A17__EMI_WEIM_A_17 (_MX53_PAD_EIM_A17__EMI_WEIM_A_17 | MUX_PAD_CTRL(NO_PAD_CTRL))
1800#define MX53_PAD_EIM_A17__GPIO2_21 (_MX53_PAD_EIM_A17__GPIO2_21 | MUX_PAD_CTRL(NO_PAD_CTRL))
1801#define MX53_PAD_EIM_A17__IPU_DISP1_DAT_12 (_MX53_PAD_EIM_A17__IPU_DISP1_DAT_12 | MUX_PAD_CTRL(NO_PAD_CTRL))
1802#define MX53_PAD_EIM_A17__IPU_CSI1_D_12 (_MX53_PAD_EIM_A17__IPU_CSI1_D_12 | MUX_PAD_CTRL(NO_PAD_CTRL))
1803#define MX53_PAD_EIM_A17__SRC_BT_CFG1_2 (_MX53_PAD_EIM_A17__SRC_BT_CFG1_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1804#define MX53_PAD_EIM_A16__EMI_WEIM_A_16 (_MX53_PAD_EIM_A16__EMI_WEIM_A_16 | MUX_PAD_CTRL(NO_PAD_CTRL))
1805#define MX53_PAD_EIM_A16__GPIO2_22 (_MX53_PAD_EIM_A16__GPIO2_22 | MUX_PAD_CTRL(NO_PAD_CTRL))
1806#define MX53_PAD_EIM_A16__IPU_DI1_DISP_CLK (_MX53_PAD_EIM_A16__IPU_DI1_DISP_CLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1807#define MX53_PAD_EIM_A16__IPU_CSI1_PIXCLK (_MX53_PAD_EIM_A16__IPU_CSI1_PIXCLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1808#define MX53_PAD_EIM_A16__SRC_BT_CFG1_1 (_MX53_PAD_EIM_A16__SRC_BT_CFG1_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1809#define MX53_PAD_EIM_CS0__EMI_WEIM_CS_0 (_MX53_PAD_EIM_CS0__EMI_WEIM_CS_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1810#define MX53_PAD_EIM_CS0__GPIO2_23 (_MX53_PAD_EIM_CS0__GPIO2_23 | MUX_PAD_CTRL(NO_PAD_CTRL))
1811#define MX53_PAD_EIM_CS0__ECSPI2_SCLK (_MX53_PAD_EIM_CS0__ECSPI2_SCLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1812#define MX53_PAD_EIM_CS0__IPU_DI1_PIN5 (_MX53_PAD_EIM_CS0__IPU_DI1_PIN5 | MUX_PAD_CTRL(NO_PAD_CTRL))
1813#define MX53_PAD_EIM_CS1__EMI_WEIM_CS_1 (_MX53_PAD_EIM_CS1__EMI_WEIM_CS_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1814#define MX53_PAD_EIM_CS1__GPIO2_24 (_MX53_PAD_EIM_CS1__GPIO2_24 | MUX_PAD_CTRL(NO_PAD_CTRL))
1815#define MX53_PAD_EIM_CS1__ECSPI2_MOSI (_MX53_PAD_EIM_CS1__ECSPI2_MOSI | MUX_PAD_CTRL(NO_PAD_CTRL))
1816#define MX53_PAD_EIM_CS1__IPU_DI1_PIN6 (_MX53_PAD_EIM_CS1__IPU_DI1_PIN6 | MUX_PAD_CTRL(NO_PAD_CTRL))
1817#define MX53_PAD_EIM_OE__EMI_WEIM_OE (_MX53_PAD_EIM_OE__EMI_WEIM_OE | MUX_PAD_CTRL(NO_PAD_CTRL))
1818#define MX53_PAD_EIM_OE__GPIO2_25 (_MX53_PAD_EIM_OE__GPIO2_25 | MUX_PAD_CTRL(NO_PAD_CTRL))
1819#define MX53_PAD_EIM_OE__ECSPI2_MISO (_MX53_PAD_EIM_OE__ECSPI2_MISO | MUX_PAD_CTRL(NO_PAD_CTRL))
1820#define MX53_PAD_EIM_OE__IPU_DI1_PIN7 (_MX53_PAD_EIM_OE__IPU_DI1_PIN7 | MUX_PAD_CTRL(NO_PAD_CTRL))
1821#define MX53_PAD_EIM_OE__USBPHY2_IDDIG (_MX53_PAD_EIM_OE__USBPHY2_IDDIG | MUX_PAD_CTRL(NO_PAD_CTRL))
1822#define MX53_PAD_EIM_RW__EMI_WEIM_RW (_MX53_PAD_EIM_RW__EMI_WEIM_RW | MUX_PAD_CTRL(NO_PAD_CTRL))
1823#define MX53_PAD_EIM_RW__GPIO2_26 (_MX53_PAD_EIM_RW__GPIO2_26 | MUX_PAD_CTRL(NO_PAD_CTRL))
1824#define MX53_PAD_EIM_RW__ECSPI2_SS0 (_MX53_PAD_EIM_RW__ECSPI2_SS0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1825#define MX53_PAD_EIM_RW__IPU_DI1_PIN8 (_MX53_PAD_EIM_RW__IPU_DI1_PIN8 | MUX_PAD_CTRL(NO_PAD_CTRL))
1826#define MX53_PAD_EIM_RW__USBPHY2_HOSTDISCONNECT (_MX53_PAD_EIM_RW__USBPHY2_HOSTDISCONNECT | MUX_PAD_CTRL(NO_PAD_CTRL))
1827#define MX53_PAD_EIM_LBA__EMI_WEIM_LBA (_MX53_PAD_EIM_LBA__EMI_WEIM_LBA | MUX_PAD_CTRL(NO_PAD_CTRL))
1828#define MX53_PAD_EIM_LBA__GPIO2_27 (_MX53_PAD_EIM_LBA__GPIO2_27 | MUX_PAD_CTRL(NO_PAD_CTRL))
1829#define MX53_PAD_EIM_LBA__ECSPI2_SS1 (_MX53_PAD_EIM_LBA__ECSPI2_SS1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1830#define MX53_PAD_EIM_LBA__IPU_DI1_PIN17 (_MX53_PAD_EIM_LBA__IPU_DI1_PIN17 | MUX_PAD_CTRL(NO_PAD_CTRL))
1831#define MX53_PAD_EIM_LBA__SRC_BT_CFG1_0 (_MX53_PAD_EIM_LBA__SRC_BT_CFG1_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1832#define MX53_PAD_EIM_EB0__EMI_WEIM_EB_0 (_MX53_PAD_EIM_EB0__EMI_WEIM_EB_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1833#define MX53_PAD_EIM_EB0__GPIO2_28 (_MX53_PAD_EIM_EB0__GPIO2_28 | MUX_PAD_CTRL(NO_PAD_CTRL))
1834#define MX53_PAD_EIM_EB0__IPU_DISP1_DAT_11 (_MX53_PAD_EIM_EB0__IPU_DISP1_DAT_11 | MUX_PAD_CTRL(NO_PAD_CTRL))
1835#define MX53_PAD_EIM_EB0__IPU_CSI1_D_11 (_MX53_PAD_EIM_EB0__IPU_CSI1_D_11 | MUX_PAD_CTRL(NO_PAD_CTRL))
1836#define MX53_PAD_EIM_EB0__GPC_PMIC_RDY (_MX53_PAD_EIM_EB0__GPC_PMIC_RDY | MUX_PAD_CTRL(NO_PAD_CTRL))
1837#define MX53_PAD_EIM_EB0__SRC_BT_CFG2_7 (_MX53_PAD_EIM_EB0__SRC_BT_CFG2_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
1838#define MX53_PAD_EIM_EB1__EMI_WEIM_EB_1 (_MX53_PAD_EIM_EB1__EMI_WEIM_EB_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1839#define MX53_PAD_EIM_EB1__GPIO2_29 (_MX53_PAD_EIM_EB1__GPIO2_29 | MUX_PAD_CTRL(NO_PAD_CTRL))
1840#define MX53_PAD_EIM_EB1__IPU_DISP1_DAT_10 (_MX53_PAD_EIM_EB1__IPU_DISP1_DAT_10 | MUX_PAD_CTRL(NO_PAD_CTRL))
1841#define MX53_PAD_EIM_EB1__IPU_CSI1_D_10 (_MX53_PAD_EIM_EB1__IPU_CSI1_D_10 | MUX_PAD_CTRL(NO_PAD_CTRL))
1842#define MX53_PAD_EIM_EB1__SRC_BT_CFG2_6 (_MX53_PAD_EIM_EB1__SRC_BT_CFG2_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
1843#define MX53_PAD_EIM_DA0__EMI_NAND_WEIM_DA_0 (_MX53_PAD_EIM_DA0__EMI_NAND_WEIM_DA_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1844#define MX53_PAD_EIM_DA0__GPIO3_0 (_MX53_PAD_EIM_DA0__GPIO3_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1845#define MX53_PAD_EIM_DA0__IPU_DISP1_DAT_9 (_MX53_PAD_EIM_DA0__IPU_DISP1_DAT_9 | MUX_PAD_CTRL(NO_PAD_CTRL))
1846#define MX53_PAD_EIM_DA0__IPU_CSI1_D_9 (_MX53_PAD_EIM_DA0__IPU_CSI1_D_9 | MUX_PAD_CTRL(NO_PAD_CTRL))
1847#define MX53_PAD_EIM_DA0__SRC_BT_CFG2_5 (_MX53_PAD_EIM_DA0__SRC_BT_CFG2_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
1848#define MX53_PAD_EIM_DA1__EMI_NAND_WEIM_DA_1 (_MX53_PAD_EIM_DA1__EMI_NAND_WEIM_DA_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1849#define MX53_PAD_EIM_DA1__GPIO3_1 (_MX53_PAD_EIM_DA1__GPIO3_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1850#define MX53_PAD_EIM_DA1__IPU_DISP1_DAT_8 (_MX53_PAD_EIM_DA1__IPU_DISP1_DAT_8 | MUX_PAD_CTRL(NO_PAD_CTRL))
1851#define MX53_PAD_EIM_DA1__IPU_CSI1_D_8 (_MX53_PAD_EIM_DA1__IPU_CSI1_D_8 | MUX_PAD_CTRL(NO_PAD_CTRL))
1852#define MX53_PAD_EIM_DA1__SRC_BT_CFG2_4 (_MX53_PAD_EIM_DA1__SRC_BT_CFG2_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
1853#define MX53_PAD_EIM_DA2__EMI_NAND_WEIM_DA_2 (_MX53_PAD_EIM_DA2__EMI_NAND_WEIM_DA_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1854#define MX53_PAD_EIM_DA2__GPIO3_2 (_MX53_PAD_EIM_DA2__GPIO3_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1855#define MX53_PAD_EIM_DA2__IPU_DISP1_DAT_7 (_MX53_PAD_EIM_DA2__IPU_DISP1_DAT_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
1856#define MX53_PAD_EIM_DA2__IPU_CSI1_D_7 (_MX53_PAD_EIM_DA2__IPU_CSI1_D_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
1857#define MX53_PAD_EIM_DA2__SRC_BT_CFG2_3 (_MX53_PAD_EIM_DA2__SRC_BT_CFG2_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1858#define MX53_PAD_EIM_DA3__EMI_NAND_WEIM_DA_3 (_MX53_PAD_EIM_DA3__EMI_NAND_WEIM_DA_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1859#define MX53_PAD_EIM_DA3__GPIO3_3 (_MX53_PAD_EIM_DA3__GPIO3_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1860#define MX53_PAD_EIM_DA3__IPU_DISP1_DAT_6 (_MX53_PAD_EIM_DA3__IPU_DISP1_DAT_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
1861#define MX53_PAD_EIM_DA3__IPU_CSI1_D_6 (_MX53_PAD_EIM_DA3__IPU_CSI1_D_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
1862#define MX53_PAD_EIM_DA3__SRC_BT_CFG2_2 (_MX53_PAD_EIM_DA3__SRC_BT_CFG2_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1863#define MX53_PAD_EIM_DA4__EMI_NAND_WEIM_DA_4 (_MX53_PAD_EIM_DA4__EMI_NAND_WEIM_DA_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
1864#define MX53_PAD_EIM_DA4__GPIO3_4 (_MX53_PAD_EIM_DA4__GPIO3_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
1865#define MX53_PAD_EIM_DA4__IPU_DISP1_DAT_5 (_MX53_PAD_EIM_DA4__IPU_DISP1_DAT_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
1866#define MX53_PAD_EIM_DA4__IPU_CSI1_D_5 (_MX53_PAD_EIM_DA4__IPU_CSI1_D_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
1867#define MX53_PAD_EIM_DA4__SRC_BT_CFG3_7 (_MX53_PAD_EIM_DA4__SRC_BT_CFG3_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
1868#define MX53_PAD_EIM_DA5__EMI_NAND_WEIM_DA_5 (_MX53_PAD_EIM_DA5__EMI_NAND_WEIM_DA_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
1869#define MX53_PAD_EIM_DA5__GPIO3_5 (_MX53_PAD_EIM_DA5__GPIO3_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
1870#define MX53_PAD_EIM_DA5__IPU_DISP1_DAT_4 (_MX53_PAD_EIM_DA5__IPU_DISP1_DAT_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
1871#define MX53_PAD_EIM_DA5__IPU_CSI1_D_4 (_MX53_PAD_EIM_DA5__IPU_CSI1_D_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
1872#define MX53_PAD_EIM_DA5__SRC_BT_CFG3_6 (_MX53_PAD_EIM_DA5__SRC_BT_CFG3_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
1873#define MX53_PAD_EIM_DA6__EMI_NAND_WEIM_DA_6 (_MX53_PAD_EIM_DA6__EMI_NAND_WEIM_DA_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
1874#define MX53_PAD_EIM_DA6__GPIO3_6 (_MX53_PAD_EIM_DA6__GPIO3_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
1875#define MX53_PAD_EIM_DA6__IPU_DISP1_DAT_3 (_MX53_PAD_EIM_DA6__IPU_DISP1_DAT_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1876#define MX53_PAD_EIM_DA6__IPU_CSI1_D_3 (_MX53_PAD_EIM_DA6__IPU_CSI1_D_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1877#define MX53_PAD_EIM_DA6__SRC_BT_CFG3_5 (_MX53_PAD_EIM_DA6__SRC_BT_CFG3_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
1878#define MX53_PAD_EIM_DA7__EMI_NAND_WEIM_DA_7 (_MX53_PAD_EIM_DA7__EMI_NAND_WEIM_DA_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
1879#define MX53_PAD_EIM_DA7__GPIO3_7 (_MX53_PAD_EIM_DA7__GPIO3_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
1880#define MX53_PAD_EIM_DA7__IPU_DISP1_DAT_2 (_MX53_PAD_EIM_DA7__IPU_DISP1_DAT_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1881#define MX53_PAD_EIM_DA7__IPU_CSI1_D_2 (_MX53_PAD_EIM_DA7__IPU_CSI1_D_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1882#define MX53_PAD_EIM_DA7__SRC_BT_CFG3_4 (_MX53_PAD_EIM_DA7__SRC_BT_CFG3_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
1883#define MX53_PAD_EIM_DA8__EMI_NAND_WEIM_DA_8 (_MX53_PAD_EIM_DA8__EMI_NAND_WEIM_DA_8 | MUX_PAD_CTRL(NO_PAD_CTRL))
1884#define MX53_PAD_EIM_DA8__GPIO3_8 (_MX53_PAD_EIM_DA8__GPIO3_8 | MUX_PAD_CTRL(NO_PAD_CTRL))
1885#define MX53_PAD_EIM_DA8__IPU_DISP1_DAT_1 (_MX53_PAD_EIM_DA8__IPU_DISP1_DAT_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1886#define MX53_PAD_EIM_DA8__IPU_CSI1_D_1 (_MX53_PAD_EIM_DA8__IPU_CSI1_D_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1887#define MX53_PAD_EIM_DA8__SRC_BT_CFG3_3 (_MX53_PAD_EIM_DA8__SRC_BT_CFG3_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1888#define MX53_PAD_EIM_DA9__EMI_NAND_WEIM_DA_9 (_MX53_PAD_EIM_DA9__EMI_NAND_WEIM_DA_9 | MUX_PAD_CTRL(NO_PAD_CTRL))
1889#define MX53_PAD_EIM_DA9__GPIO3_9 (_MX53_PAD_EIM_DA9__GPIO3_9 | MUX_PAD_CTRL(NO_PAD_CTRL))
1890#define MX53_PAD_EIM_DA9__IPU_DISP1_DAT_0 (_MX53_PAD_EIM_DA9__IPU_DISP1_DAT_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1891#define MX53_PAD_EIM_DA9__IPU_CSI1_D_0 (_MX53_PAD_EIM_DA9__IPU_CSI1_D_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1892#define MX53_PAD_EIM_DA9__SRC_BT_CFG3_2 (_MX53_PAD_EIM_DA9__SRC_BT_CFG3_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1893#define MX53_PAD_EIM_DA10__EMI_NAND_WEIM_DA_10 (_MX53_PAD_EIM_DA10__EMI_NAND_WEIM_DA_10 | MUX_PAD_CTRL(NO_PAD_CTRL))
1894#define MX53_PAD_EIM_DA10__GPIO3_10 (_MX53_PAD_EIM_DA10__GPIO3_10 | MUX_PAD_CTRL(NO_PAD_CTRL))
1895#define MX53_PAD_EIM_DA10__IPU_DI1_PIN15 (_MX53_PAD_EIM_DA10__IPU_DI1_PIN15 | MUX_PAD_CTRL(NO_PAD_CTRL))
1896#define MX53_PAD_EIM_DA10__IPU_CSI1_DATA_EN (_MX53_PAD_EIM_DA10__IPU_CSI1_DATA_EN | MUX_PAD_CTRL(NO_PAD_CTRL))
1897#define MX53_PAD_EIM_DA10__SRC_BT_CFG3_1 (_MX53_PAD_EIM_DA10__SRC_BT_CFG3_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1898#define MX53_PAD_EIM_DA11__EMI_NAND_WEIM_DA_11 (_MX53_PAD_EIM_DA11__EMI_NAND_WEIM_DA_11 | MUX_PAD_CTRL(NO_PAD_CTRL))
1899#define MX53_PAD_EIM_DA11__GPIO3_11 (_MX53_PAD_EIM_DA11__GPIO3_11 | MUX_PAD_CTRL(NO_PAD_CTRL))
1900#define MX53_PAD_EIM_DA11__IPU_DI1_PIN2 (_MX53_PAD_EIM_DA11__IPU_DI1_PIN2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1901#define MX53_PAD_EIM_DA11__IPU_CSI1_HSYNC (_MX53_PAD_EIM_DA11__IPU_CSI1_HSYNC | MUX_PAD_CTRL(NO_PAD_CTRL))
1902#define MX53_PAD_EIM_DA12__EMI_NAND_WEIM_DA_12 (_MX53_PAD_EIM_DA12__EMI_NAND_WEIM_DA_12 | MUX_PAD_CTRL(NO_PAD_CTRL))
1903#define MX53_PAD_EIM_DA12__GPIO3_12 (_MX53_PAD_EIM_DA12__GPIO3_12 | MUX_PAD_CTRL(NO_PAD_CTRL))
1904#define MX53_PAD_EIM_DA12__IPU_DI1_PIN3 (_MX53_PAD_EIM_DA12__IPU_DI1_PIN3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1905#define MX53_PAD_EIM_DA12__IPU_CSI1_VSYNC (_MX53_PAD_EIM_DA12__IPU_CSI1_VSYNC | MUX_PAD_CTRL(NO_PAD_CTRL))
1906#define MX53_PAD_EIM_DA13__EMI_NAND_WEIM_DA_13 (_MX53_PAD_EIM_DA13__EMI_NAND_WEIM_DA_13 | MUX_PAD_CTRL(NO_PAD_CTRL))
1907#define MX53_PAD_EIM_DA13__GPIO3_13 (_MX53_PAD_EIM_DA13__GPIO3_13 | MUX_PAD_CTRL(NO_PAD_CTRL))
1908#define MX53_PAD_EIM_DA13__IPU_DI1_D0_CS (_MX53_PAD_EIM_DA13__IPU_DI1_D0_CS | MUX_PAD_CTRL(NO_PAD_CTRL))
1909#define MX53_PAD_EIM_DA13__CCM_DI1_EXT_CLK (_MX53_PAD_EIM_DA13__CCM_DI1_EXT_CLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1910#define MX53_PAD_EIM_DA14__EMI_NAND_WEIM_DA_14 (_MX53_PAD_EIM_DA14__EMI_NAND_WEIM_DA_14 | MUX_PAD_CTRL(NO_PAD_CTRL))
1911#define MX53_PAD_EIM_DA14__GPIO3_14 (_MX53_PAD_EIM_DA14__GPIO3_14 | MUX_PAD_CTRL(NO_PAD_CTRL))
1912#define MX53_PAD_EIM_DA14__IPU_DI1_D1_CS (_MX53_PAD_EIM_DA14__IPU_DI1_D1_CS | MUX_PAD_CTRL(NO_PAD_CTRL))
1913#define MX53_PAD_EIM_DA14__CCM_DI0_EXT_CLK (_MX53_PAD_EIM_DA14__CCM_DI0_EXT_CLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1914#define MX53_PAD_EIM_DA15__EMI_NAND_WEIM_DA_15 (_MX53_PAD_EIM_DA15__EMI_NAND_WEIM_DA_15 | MUX_PAD_CTRL(NO_PAD_CTRL))
1915#define MX53_PAD_EIM_DA15__GPIO3_15 (_MX53_PAD_EIM_DA15__GPIO3_15 | MUX_PAD_CTRL(NO_PAD_CTRL))
1916#define MX53_PAD_EIM_DA15__IPU_DI1_PIN1 (_MX53_PAD_EIM_DA15__IPU_DI1_PIN1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1917#define MX53_PAD_EIM_DA15__IPU_DI1_PIN4 (_MX53_PAD_EIM_DA15__IPU_DI1_PIN4 | MUX_PAD_CTRL(NO_PAD_CTRL))
1918#define MX53_PAD_NANDF_WE_B__EMI_NANDF_WE_B (_MX53_PAD_NANDF_WE_B__EMI_NANDF_WE_B | MUX_PAD_CTRL(NO_PAD_CTRL))
1919#define MX53_PAD_NANDF_WE_B__GPIO6_12 (_MX53_PAD_NANDF_WE_B__GPIO6_12 | MUX_PAD_CTRL(NO_PAD_CTRL))
1920#define MX53_PAD_NANDF_RE_B__EMI_NANDF_RE_B (_MX53_PAD_NANDF_RE_B__EMI_NANDF_RE_B | MUX_PAD_CTRL(NO_PAD_CTRL))
1921#define MX53_PAD_NANDF_RE_B__GPIO6_13 (_MX53_PAD_NANDF_RE_B__GPIO6_13 | MUX_PAD_CTRL(NO_PAD_CTRL))
1922#define MX53_PAD_EIM_WAIT__EMI_WEIM_WAIT (_MX53_PAD_EIM_WAIT__EMI_WEIM_WAIT | MUX_PAD_CTRL(NO_PAD_CTRL))
1923#define MX53_PAD_EIM_WAIT__GPIO5_0 (_MX53_PAD_EIM_WAIT__GPIO5_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1924#define MX53_PAD_EIM_WAIT__EMI_WEIM_DTACK_B (_MX53_PAD_EIM_WAIT__EMI_WEIM_DTACK_B | MUX_PAD_CTRL(NO_PAD_CTRL))
1925#define MX53_PAD_LVDS1_TX3_P__GPIO6_22 (_MX53_PAD_LVDS1_TX3_P__GPIO6_22 | MUX_PAD_CTRL(NO_PAD_CTRL))
1926#define MX53_PAD_LVDS1_TX3_P__LDB_LVDS1_TX3 (_MX53_PAD_LVDS1_TX3_P__LDB_LVDS1_TX3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1927#define MX53_PAD_LVDS1_TX2_P__GPIO6_24 (_MX53_PAD_LVDS1_TX2_P__GPIO6_24 | MUX_PAD_CTRL(NO_PAD_CTRL))
1928#define MX53_PAD_LVDS1_TX2_P__LDB_LVDS1_TX2 (_MX53_PAD_LVDS1_TX2_P__LDB_LVDS1_TX2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1929#define MX53_PAD_LVDS1_CLK_P__GPIO6_26 (_MX53_PAD_LVDS1_CLK_P__GPIO6_26 | MUX_PAD_CTRL(NO_PAD_CTRL))
1930#define MX53_PAD_LVDS1_CLK_P__LDB_LVDS1_CLK (_MX53_PAD_LVDS1_CLK_P__LDB_LVDS1_CLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1931#define MX53_PAD_LVDS1_TX1_P__GPIO6_28 (_MX53_PAD_LVDS1_TX1_P__GPIO6_28 | MUX_PAD_CTRL(NO_PAD_CTRL))
1932#define MX53_PAD_LVDS1_TX1_P__LDB_LVDS1_TX1 (_MX53_PAD_LVDS1_TX1_P__LDB_LVDS1_TX1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1933#define MX53_PAD_LVDS1_TX0_P__GPIO6_30 (_MX53_PAD_LVDS1_TX0_P__GPIO6_30 | MUX_PAD_CTRL(NO_PAD_CTRL))
1934#define MX53_PAD_LVDS1_TX0_P__LDB_LVDS1_TX0 (_MX53_PAD_LVDS1_TX0_P__LDB_LVDS1_TX0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1935#define MX53_PAD_LVDS0_TX3_P__GPIO7_22 (_MX53_PAD_LVDS0_TX3_P__GPIO7_22 | MUX_PAD_CTRL(NO_PAD_CTRL))
1936#define MX53_PAD_LVDS0_TX3_P__LDB_LVDS0_TX3 (_MX53_PAD_LVDS0_TX3_P__LDB_LVDS0_TX3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1937#define MX53_PAD_LVDS0_CLK_P__GPIO7_24 (_MX53_PAD_LVDS0_CLK_P__GPIO7_24 | MUX_PAD_CTRL(NO_PAD_CTRL))
1938#define MX53_PAD_LVDS0_CLK_P__LDB_LVDS0_CLK (_MX53_PAD_LVDS0_CLK_P__LDB_LVDS0_CLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1939#define MX53_PAD_LVDS0_TX2_P__GPIO7_26 (_MX53_PAD_LVDS0_TX2_P__GPIO7_26 | MUX_PAD_CTRL(NO_PAD_CTRL))
1940#define MX53_PAD_LVDS0_TX2_P__LDB_LVDS0_TX2 (_MX53_PAD_LVDS0_TX2_P__LDB_LVDS0_TX2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1941#define MX53_PAD_LVDS0_TX1_P__GPIO7_28 (_MX53_PAD_LVDS0_TX1_P__GPIO7_28 | MUX_PAD_CTRL(NO_PAD_CTRL))
1942#define MX53_PAD_LVDS0_TX1_P__LDB_LVDS0_TX1 (_MX53_PAD_LVDS0_TX1_P__LDB_LVDS0_TX1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1943#define MX53_PAD_LVDS0_TX0_P__GPIO7_30 (_MX53_PAD_LVDS0_TX0_P__GPIO7_30 | MUX_PAD_CTRL(NO_PAD_CTRL))
1944#define MX53_PAD_LVDS0_TX0_P__LDB_LVDS0_TX0 (_MX53_PAD_LVDS0_TX0_P__LDB_LVDS0_TX0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1945#define MX53_PAD_GPIO_10__GPIO4_0 (_MX53_PAD_GPIO_10__GPIO4_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1946#define MX53_PAD_GPIO_10__OSC32k_32K_OUT (_MX53_PAD_GPIO_10__OSC32k_32K_OUT | MUX_PAD_CTRL(NO_PAD_CTRL))
1947#define MX53_PAD_GPIO_11__GPIO4_1 (_MX53_PAD_GPIO_11__GPIO4_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1948#define MX53_PAD_GPIO_12__GPIO4_2 (_MX53_PAD_GPIO_12__GPIO4_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1949#define MX53_PAD_GPIO_13__GPIO4_3 (_MX53_PAD_GPIO_13__GPIO4_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1950#define MX53_PAD_GPIO_14__GPIO4_4 (_MX53_PAD_GPIO_14__GPIO4_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
1951#define MX53_PAD_NANDF_CLE__EMI_NANDF_CLE (_MX53_PAD_NANDF_CLE__EMI_NANDF_CLE | MUX_PAD_CTRL(NO_PAD_CTRL))
1952#define MX53_PAD_NANDF_CLE__GPIO6_7 (_MX53_PAD_NANDF_CLE__GPIO6_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
1953#define MX53_PAD_NANDF_CLE__USBPHY1_VSTATUS_0 (_MX53_PAD_NANDF_CLE__USBPHY1_VSTATUS_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1954#define MX53_PAD_NANDF_ALE__EMI_NANDF_ALE (_MX53_PAD_NANDF_ALE__EMI_NANDF_ALE | MUX_PAD_CTRL(NO_PAD_CTRL))
1955#define MX53_PAD_NANDF_ALE__GPIO6_8 (_MX53_PAD_NANDF_ALE__GPIO6_8 | MUX_PAD_CTRL(NO_PAD_CTRL))
1956#define MX53_PAD_NANDF_ALE__USBPHY1_VSTATUS_1 (_MX53_PAD_NANDF_ALE__USBPHY1_VSTATUS_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1957#define MX53_PAD_NANDF_WP_B__EMI_NANDF_WP_B (_MX53_PAD_NANDF_WP_B__EMI_NANDF_WP_B | MUX_PAD_CTRL(NO_PAD_CTRL))
1958#define MX53_PAD_NANDF_WP_B__GPIO6_9 (_MX53_PAD_NANDF_WP_B__GPIO6_9 | MUX_PAD_CTRL(NO_PAD_CTRL))
1959#define MX53_PAD_NANDF_WP_B__USBPHY1_VSTATUS_2 (_MX53_PAD_NANDF_WP_B__USBPHY1_VSTATUS_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1960#define MX53_PAD_NANDF_RB0__EMI_NANDF_RB_0 (_MX53_PAD_NANDF_RB0__EMI_NANDF_RB_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1961#define MX53_PAD_NANDF_RB0__GPIO6_10 (_MX53_PAD_NANDF_RB0__GPIO6_10 | MUX_PAD_CTRL(NO_PAD_CTRL))
1962#define MX53_PAD_NANDF_RB0__USBPHY1_VSTATUS_3 (_MX53_PAD_NANDF_RB0__USBPHY1_VSTATUS_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1963#define MX53_PAD_NANDF_CS0__EMI_NANDF_CS_0 (_MX53_PAD_NANDF_CS0__EMI_NANDF_CS_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1964#define MX53_PAD_NANDF_CS0__GPIO6_11 (_MX53_PAD_NANDF_CS0__GPIO6_11 | MUX_PAD_CTRL(NO_PAD_CTRL))
1965#define MX53_PAD_NANDF_CS0__USBPHY1_VSTATUS_4 (_MX53_PAD_NANDF_CS0__USBPHY1_VSTATUS_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
1966#define MX53_PAD_NANDF_CS1__EMI_NANDF_CS_1 (_MX53_PAD_NANDF_CS1__EMI_NANDF_CS_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1967#define MX53_PAD_NANDF_CS1__GPIO6_14 (_MX53_PAD_NANDF_CS1__GPIO6_14 | MUX_PAD_CTRL(NO_PAD_CTRL))
1968#define MX53_PAD_NANDF_CS1__MLB_MLBCLK (_MX53_PAD_NANDF_CS1__MLB_MLBCLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1969#define MX53_PAD_NANDF_CS1__USBPHY1_VSTATUS_5 (_MX53_PAD_NANDF_CS1__USBPHY1_VSTATUS_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
1970#define MX53_PAD_NANDF_CS2__EMI_NANDF_CS_2 (_MX53_PAD_NANDF_CS2__EMI_NANDF_CS_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1971#define MX53_PAD_NANDF_CS2__GPIO6_15 (_MX53_PAD_NANDF_CS2__GPIO6_15 | MUX_PAD_CTRL(NO_PAD_CTRL))
1972#define MX53_PAD_NANDF_CS2__IPU_SISG_0 (_MX53_PAD_NANDF_CS2__IPU_SISG_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1973#define MX53_PAD_NANDF_CS2__ESAI1_TX0 (_MX53_PAD_NANDF_CS2__ESAI1_TX0 | MUX_PAD_CTRL(NO_PAD_CTRL))
1974#define MX53_PAD_NANDF_CS2__EMI_WEIM_CRE (_MX53_PAD_NANDF_CS2__EMI_WEIM_CRE | MUX_PAD_CTRL(NO_PAD_CTRL))
1975#define MX53_PAD_NANDF_CS2__CCM_CSI0_MCLK (_MX53_PAD_NANDF_CS2__CCM_CSI0_MCLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1976#define MX53_PAD_NANDF_CS2__MLB_MLBSIG (_MX53_PAD_NANDF_CS2__MLB_MLBSIG | MUX_PAD_CTRL(NO_PAD_CTRL))
1977#define MX53_PAD_NANDF_CS2__USBPHY1_VSTATUS_6 (_MX53_PAD_NANDF_CS2__USBPHY1_VSTATUS_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
1978#define MX53_PAD_NANDF_CS3__EMI_NANDF_CS_3 (_MX53_PAD_NANDF_CS3__EMI_NANDF_CS_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1979#define MX53_PAD_NANDF_CS3__GPIO6_16 (_MX53_PAD_NANDF_CS3__GPIO6_16 | MUX_PAD_CTRL(NO_PAD_CTRL))
1980#define MX53_PAD_NANDF_CS3__IPU_SISG_1 (_MX53_PAD_NANDF_CS3__IPU_SISG_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1981#define MX53_PAD_NANDF_CS3__ESAI1_TX1 (_MX53_PAD_NANDF_CS3__ESAI1_TX1 | MUX_PAD_CTRL(NO_PAD_CTRL))
1982#define MX53_PAD_NANDF_CS3__EMI_WEIM_A_26 (_MX53_PAD_NANDF_CS3__EMI_WEIM_A_26 | MUX_PAD_CTRL(NO_PAD_CTRL))
1983#define MX53_PAD_NANDF_CS3__MLB_MLBDAT (_MX53_PAD_NANDF_CS3__MLB_MLBDAT | MUX_PAD_CTRL(NO_PAD_CTRL))
1984#define MX53_PAD_NANDF_CS3__USBPHY1_VSTATUS_7 (_MX53_PAD_NANDF_CS3__USBPHY1_VSTATUS_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
1985#define MX53_PAD_FEC_MDIO__FEC_MDIO (_MX53_PAD_FEC_MDIO__FEC_MDIO | MUX_PAD_CTRL(NO_PAD_CTRL))
1986#define MX53_PAD_FEC_MDIO__GPIO1_22 (_MX53_PAD_FEC_MDIO__GPIO1_22 | MUX_PAD_CTRL(NO_PAD_CTRL))
1987#define MX53_PAD_FEC_MDIO__ESAI1_SCKR (_MX53_PAD_FEC_MDIO__ESAI1_SCKR | MUX_PAD_CTRL(NO_PAD_CTRL))
1988#define MX53_PAD_FEC_MDIO__FEC_COL (_MX53_PAD_FEC_MDIO__FEC_COL | MUX_PAD_CTRL(NO_PAD_CTRL))
1989#define MX53_PAD_FEC_MDIO__RTC_CE_RTC_PS2 (_MX53_PAD_FEC_MDIO__RTC_CE_RTC_PS2 | MUX_PAD_CTRL(NO_PAD_CTRL))
1990#define MX53_PAD_FEC_MDIO__SDMA_DEBUG_BUS_DEVICE_3 (_MX53_PAD_FEC_MDIO__SDMA_DEBUG_BUS_DEVICE_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
1991#define MX53_PAD_FEC_MDIO__EMI_EMI_DEBUG_49 (_MX53_PAD_FEC_MDIO__EMI_EMI_DEBUG_49 | MUX_PAD_CTRL(NO_PAD_CTRL))
1992#define MX53_PAD_FEC_REF_CLK__FEC_TX_CLK (_MX53_PAD_FEC_REF_CLK__FEC_TX_CLK | MUX_PAD_CTRL(NO_PAD_CTRL))
1993#define MX53_PAD_FEC_REF_CLK__GPIO1_23 (_MX53_PAD_FEC_REF_CLK__GPIO1_23 | MUX_PAD_CTRL(NO_PAD_CTRL))
1994#define MX53_PAD_FEC_REF_CLK__ESAI1_FSR (_MX53_PAD_FEC_REF_CLK__ESAI1_FSR | MUX_PAD_CTRL(NO_PAD_CTRL))
1995#define MX53_PAD_FEC_REF_CLK__SDMA_DEBUG_BUS_DEVICE_4 (_MX53_PAD_FEC_REF_CLK__SDMA_DEBUG_BUS_DEVICE_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
1996#define MX53_PAD_FEC_REF_CLK__EMI_EMI_DEBUG_50 (_MX53_PAD_FEC_REF_CLK__EMI_EMI_DEBUG_50 | MUX_PAD_CTRL(NO_PAD_CTRL))
1997#define MX53_PAD_FEC_RX_ER__FEC_RX_ER (_MX53_PAD_FEC_RX_ER__FEC_RX_ER | MUX_PAD_CTRL(NO_PAD_CTRL))
1998#define MX53_PAD_FEC_RX_ER__GPIO1_24 (_MX53_PAD_FEC_RX_ER__GPIO1_24 | MUX_PAD_CTRL(NO_PAD_CTRL))
1999#define MX53_PAD_FEC_RX_ER__ESAI1_HCKR (_MX53_PAD_FEC_RX_ER__ESAI1_HCKR | MUX_PAD_CTRL(NO_PAD_CTRL))
2000#define MX53_PAD_FEC_RX_ER__FEC_RX_CLK (_MX53_PAD_FEC_RX_ER__FEC_RX_CLK | MUX_PAD_CTRL(NO_PAD_CTRL))
2001#define MX53_PAD_FEC_RX_ER__RTC_CE_RTC_PS3 (_MX53_PAD_FEC_RX_ER__RTC_CE_RTC_PS3 | MUX_PAD_CTRL(NO_PAD_CTRL))
2002#define MX53_PAD_FEC_CRS_DV__FEC_RX_DV (_MX53_PAD_FEC_CRS_DV__FEC_RX_DV | MUX_PAD_CTRL(NO_PAD_CTRL))
2003#define MX53_PAD_FEC_CRS_DV__GPIO1_25 (_MX53_PAD_FEC_CRS_DV__GPIO1_25 | MUX_PAD_CTRL(NO_PAD_CTRL))
2004#define MX53_PAD_FEC_CRS_DV__ESAI1_SCKT (_MX53_PAD_FEC_CRS_DV__ESAI1_SCKT | MUX_PAD_CTRL(NO_PAD_CTRL))
2005#define MX53_PAD_FEC_RXD1__FEC_RDATA_1 (_MX53_PAD_FEC_RXD1__FEC_RDATA_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2006#define MX53_PAD_FEC_RXD1__GPIO1_26 (_MX53_PAD_FEC_RXD1__GPIO1_26 | MUX_PAD_CTRL(NO_PAD_CTRL))
2007#define MX53_PAD_FEC_RXD1__ESAI1_FST (_MX53_PAD_FEC_RXD1__ESAI1_FST | MUX_PAD_CTRL(NO_PAD_CTRL))
2008#define MX53_PAD_FEC_RXD1__MLB_MLBSIG (_MX53_PAD_FEC_RXD1__MLB_MLBSIG | MUX_PAD_CTRL(NO_PAD_CTRL))
2009#define MX53_PAD_FEC_RXD1__RTC_CE_RTC_PS1 (_MX53_PAD_FEC_RXD1__RTC_CE_RTC_PS1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2010#define MX53_PAD_FEC_RXD0__FEC_RDATA_0 (_MX53_PAD_FEC_RXD0__FEC_RDATA_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2011#define MX53_PAD_FEC_RXD0__GPIO1_27 (_MX53_PAD_FEC_RXD0__GPIO1_27 | MUX_PAD_CTRL(NO_PAD_CTRL))
2012#define MX53_PAD_FEC_RXD0__ESAI1_HCKT (_MX53_PAD_FEC_RXD0__ESAI1_HCKT | MUX_PAD_CTRL(NO_PAD_CTRL))
2013#define MX53_PAD_FEC_RXD0__OSC32k_32K_OUT (_MX53_PAD_FEC_RXD0__OSC32k_32K_OUT | MUX_PAD_CTRL(NO_PAD_CTRL))
2014#define MX53_PAD_FEC_TX_EN__FEC_TX_EN (_MX53_PAD_FEC_TX_EN__FEC_TX_EN | MUX_PAD_CTRL(NO_PAD_CTRL))
2015#define MX53_PAD_FEC_TX_EN__GPIO1_28 (_MX53_PAD_FEC_TX_EN__GPIO1_28 | MUX_PAD_CTRL(NO_PAD_CTRL))
2016#define MX53_PAD_FEC_TX_EN__ESAI1_TX3_RX2 (_MX53_PAD_FEC_TX_EN__ESAI1_TX3_RX2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2017#define MX53_PAD_FEC_TXD1__FEC_TDATA_1 (_MX53_PAD_FEC_TXD1__FEC_TDATA_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2018#define MX53_PAD_FEC_TXD1__GPIO1_29 (_MX53_PAD_FEC_TXD1__GPIO1_29 | MUX_PAD_CTRL(NO_PAD_CTRL))
2019#define MX53_PAD_FEC_TXD1__ESAI1_TX2_RX3 (_MX53_PAD_FEC_TXD1__ESAI1_TX2_RX3 | MUX_PAD_CTRL(NO_PAD_CTRL))
2020#define MX53_PAD_FEC_TXD1__MLB_MLBCLK (_MX53_PAD_FEC_TXD1__MLB_MLBCLK | MUX_PAD_CTRL(NO_PAD_CTRL))
2021#define MX53_PAD_FEC_TXD1__RTC_CE_RTC_PRSC_CLK (_MX53_PAD_FEC_TXD1__RTC_CE_RTC_PRSC_CLK | MUX_PAD_CTRL(NO_PAD_CTRL))
2022#define MX53_PAD_FEC_TXD0__FEC_TDATA_0 (_MX53_PAD_FEC_TXD0__FEC_TDATA_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2023#define MX53_PAD_FEC_TXD0__GPIO1_30 (_MX53_PAD_FEC_TXD0__GPIO1_30 | MUX_PAD_CTRL(NO_PAD_CTRL))
2024#define MX53_PAD_FEC_TXD0__ESAI1_TX4_RX1 (_MX53_PAD_FEC_TXD0__ESAI1_TX4_RX1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2025#define MX53_PAD_FEC_TXD0__USBPHY2_DATAOUT_0 (_MX53_PAD_FEC_TXD0__USBPHY2_DATAOUT_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2026#define MX53_PAD_FEC_MDC__FEC_MDC (_MX53_PAD_FEC_MDC__FEC_MDC | MUX_PAD_CTRL(NO_PAD_CTRL))
2027#define MX53_PAD_FEC_MDC__GPIO1_31 (_MX53_PAD_FEC_MDC__GPIO1_31 | MUX_PAD_CTRL(NO_PAD_CTRL))
2028#define MX53_PAD_FEC_MDC__ESAI1_TX5_RX0 (_MX53_PAD_FEC_MDC__ESAI1_TX5_RX0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2029#define MX53_PAD_FEC_MDC__MLB_MLBDAT (_MX53_PAD_FEC_MDC__MLB_MLBDAT | MUX_PAD_CTRL(NO_PAD_CTRL))
2030#define MX53_PAD_FEC_MDC__RTC_CE_RTC_ALARM1_TRIG (_MX53_PAD_FEC_MDC__RTC_CE_RTC_ALARM1_TRIG | MUX_PAD_CTRL(NO_PAD_CTRL))
2031#define MX53_PAD_FEC_MDC__USBPHY2_DATAOUT_1 (_MX53_PAD_FEC_MDC__USBPHY2_DATAOUT_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2032#define MX53_PAD_PATA_DIOW__PATA_DIOW (_MX53_PAD_PATA_DIOW__PATA_DIOW | MUX_PAD_CTRL(NO_PAD_CTRL))
2033#define MX53_PAD_PATA_DIOW__GPIO6_17 (_MX53_PAD_PATA_DIOW__GPIO6_17 | MUX_PAD_CTRL(NO_PAD_CTRL))
2034#define MX53_PAD_PATA_DIOW__UART1_TXD_MUX (_MX53_PAD_PATA_DIOW__UART1_TXD_MUX | MUX_PAD_CTRL(MX53_UART_PAD_CTRL))
2035#define MX53_PAD_PATA_DIOW__USBPHY2_DATAOUT_2 (_MX53_PAD_PATA_DIOW__USBPHY2_DATAOUT_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2036#define MX53_PAD_PATA_DMACK__PATA_DMACK (_MX53_PAD_PATA_DMACK__PATA_DMACK | MUX_PAD_CTRL(NO_PAD_CTRL))
2037#define MX53_PAD_PATA_DMACK__GPIO6_18 (_MX53_PAD_PATA_DMACK__GPIO6_18 | MUX_PAD_CTRL(NO_PAD_CTRL))
2038#define MX53_PAD_PATA_DMACK__UART1_RXD_MUX (_MX53_PAD_PATA_DMACK__UART1_RXD_MUX | MUX_PAD_CTRL(MX53_UART_PAD_CTRL))
2039#define MX53_PAD_PATA_DMACK__USBPHY2_DATAOUT_3 (_MX53_PAD_PATA_DMACK__USBPHY2_DATAOUT_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
2040#define MX53_PAD_PATA_DMARQ__PATA_DMARQ (_MX53_PAD_PATA_DMARQ__PATA_DMARQ | MUX_PAD_CTRL(NO_PAD_CTRL))
2041#define MX53_PAD_PATA_DMARQ__GPIO7_0 (_MX53_PAD_PATA_DMARQ__GPIO7_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2042#define MX53_PAD_PATA_DMARQ__UART2_TXD_MUX (_MX53_PAD_PATA_DMARQ__UART2_TXD_MUX | MUX_PAD_CTRL(MX53_UART_PAD_CTRL))
2043#define MX53_PAD_PATA_DMARQ__CCM_CCM_OUT_0 (_MX53_PAD_PATA_DMARQ__CCM_CCM_OUT_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2044#define MX53_PAD_PATA_DMARQ__USBPHY2_DATAOUT_4 (_MX53_PAD_PATA_DMARQ__USBPHY2_DATAOUT_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
2045#define MX53_PAD_PATA_BUFFER_EN__PATA_BUFFER_EN (_MX53_PAD_PATA_BUFFER_EN__PATA_BUFFER_EN | MUX_PAD_CTRL(NO_PAD_CTRL))
2046#define MX53_PAD_PATA_BUFFER_EN__GPIO7_1 (_MX53_PAD_PATA_BUFFER_EN__GPIO7_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2047#define MX53_PAD_PATA_BUFFER_EN__UART2_RXD_MUX (_MX53_PAD_PATA_BUFFER_EN__UART2_RXD_MUX | MUX_PAD_CTRL(MX53_UART_PAD_CTRL))
2048#define MX53_PAD_PATA_BUFFER_EN__CCM_CCM_OUT_1 (_MX53_PAD_PATA_BUFFER_EN__CCM_CCM_OUT_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2049#define MX53_PAD_PATA_BUFFER_EN__USBPHY2_DATAOUT_5 (_MX53_PAD_PATA_BUFFER_EN__USBPHY2_DATAOUT_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
2050#define MX53_PAD_PATA_INTRQ__PATA_INTRQ (_MX53_PAD_PATA_INTRQ__PATA_INTRQ | MUX_PAD_CTRL(NO_PAD_CTRL))
2051#define MX53_PAD_PATA_INTRQ__GPIO7_2 (_MX53_PAD_PATA_INTRQ__GPIO7_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2052#define MX53_PAD_PATA_INTRQ__UART2_CTS (_MX53_PAD_PATA_INTRQ__UART2_CTS | MUX_PAD_CTRL(MX53_UART_PAD_CTRL))
2053#define MX53_PAD_PATA_INTRQ__CAN1_TXCAN (_MX53_PAD_PATA_INTRQ__CAN1_TXCAN | MUX_PAD_CTRL(NO_PAD_CTRL))
2054#define MX53_PAD_PATA_INTRQ__CCM_CCM_OUT_2 (_MX53_PAD_PATA_INTRQ__CCM_CCM_OUT_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2055#define MX53_PAD_PATA_INTRQ__USBPHY2_DATAOUT_6 (_MX53_PAD_PATA_INTRQ__USBPHY2_DATAOUT_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
2056#define MX53_PAD_PATA_DIOR__PATA_DIOR (_MX53_PAD_PATA_DIOR__PATA_DIOR | MUX_PAD_CTRL(NO_PAD_CTRL))
2057#define MX53_PAD_PATA_DIOR__GPIO7_3 (_MX53_PAD_PATA_DIOR__GPIO7_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
2058#define MX53_PAD_PATA_DIOR__UART2_RTS (_MX53_PAD_PATA_DIOR__UART2_RTS | MUX_PAD_CTRL(MX53_UART_PAD_CTRL))
2059#define MX53_PAD_PATA_DIOR__CAN1_RXCAN (_MX53_PAD_PATA_DIOR__CAN1_RXCAN | MUX_PAD_CTRL(NO_PAD_CTRL))
2060#define MX53_PAD_PATA_DIOR__USBPHY2_DATAOUT_7 (_MX53_PAD_PATA_DIOR__USBPHY2_DATAOUT_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
2061#define MX53_PAD_PATA_RESET_B__PATA_PATA_RESET_B (_MX53_PAD_PATA_RESET_B__PATA_PATA_RESET_B | MUX_PAD_CTRL(NO_PAD_CTRL))
2062#define MX53_PAD_PATA_RESET_B__GPIO7_4 (_MX53_PAD_PATA_RESET_B__GPIO7_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
2063#define MX53_PAD_PATA_RESET_B__ESDHC3_CMD (_MX53_PAD_PATA_RESET_B__ESDHC3_CMD | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2064#define MX53_PAD_PATA_RESET_B__UART1_CTS (_MX53_PAD_PATA_RESET_B__UART1_CTS | MUX_PAD_CTRL(NO_PAD_CTRL))
2065#define MX53_PAD_PATA_RESET_B__CAN2_TXCAN (_MX53_PAD_PATA_RESET_B__CAN2_TXCAN | MUX_PAD_CTRL(NO_PAD_CTRL))
2066#define MX53_PAD_PATA_RESET_B__USBPHY1_DATAOUT_0 (_MX53_PAD_PATA_RESET_B__USBPHY1_DATAOUT_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2067#define MX53_PAD_PATA_IORDY__PATA_IORDY (_MX53_PAD_PATA_IORDY__PATA_IORDY | MUX_PAD_CTRL(NO_PAD_CTRL))
2068#define MX53_PAD_PATA_IORDY__GPIO7_5 (_MX53_PAD_PATA_IORDY__GPIO7_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
2069#define MX53_PAD_PATA_IORDY__ESDHC3_CLK (_MX53_PAD_PATA_IORDY__ESDHC3_CLK | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2070#define MX53_PAD_PATA_IORDY__UART1_RTS (_MX53_PAD_PATA_IORDY__UART1_RTS | MUX_PAD_CTRL(NO_PAD_CTRL))
2071#define MX53_PAD_PATA_IORDY__CAN2_RXCAN (_MX53_PAD_PATA_IORDY__CAN2_RXCAN | MUX_PAD_CTRL(NO_PAD_CTRL))
2072#define MX53_PAD_PATA_IORDY__USBPHY1_DATAOUT_1 (_MX53_PAD_PATA_IORDY__USBPHY1_DATAOUT_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2073#define MX53_PAD_PATA_DA_0__PATA_DA_0 (_MX53_PAD_PATA_DA_0__PATA_DA_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2074#define MX53_PAD_PATA_DA_0__GPIO7_6 (_MX53_PAD_PATA_DA_0__GPIO7_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
2075#define MX53_PAD_PATA_DA_0__ESDHC3_RST (_MX53_PAD_PATA_DA_0__ESDHC3_RST | MUX_PAD_CTRL(NO_PAD_CTRL))
2076#define MX53_PAD_PATA_DA_0__OWIRE_LINE (_MX53_PAD_PATA_DA_0__OWIRE_LINE | MUX_PAD_CTRL(NO_PAD_CTRL))
2077#define MX53_PAD_PATA_DA_0__USBPHY1_DATAOUT_2 (_MX53_PAD_PATA_DA_0__USBPHY1_DATAOUT_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2078#define MX53_PAD_PATA_DA_1__PATA_DA_1 (_MX53_PAD_PATA_DA_1__PATA_DA_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2079#define MX53_PAD_PATA_DA_1__GPIO7_7 (_MX53_PAD_PATA_DA_1__GPIO7_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
2080#define MX53_PAD_PATA_DA_1__ESDHC4_CMD (_MX53_PAD_PATA_DA_1__ESDHC4_CMD | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2081#define MX53_PAD_PATA_DA_1__UART3_CTS (_MX53_PAD_PATA_DA_1__UART3_CTS | MUX_PAD_CTRL(MX53_UART_PAD_CTRL))
2082#define MX53_PAD_PATA_DA_1__USBPHY1_DATAOUT_3 (_MX53_PAD_PATA_DA_1__USBPHY1_DATAOUT_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
2083#define MX53_PAD_PATA_DA_2__PATA_DA_2 (_MX53_PAD_PATA_DA_2__PATA_DA_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2084#define MX53_PAD_PATA_DA_2__GPIO7_8 (_MX53_PAD_PATA_DA_2__GPIO7_8 | MUX_PAD_CTRL(NO_PAD_CTRL))
2085#define MX53_PAD_PATA_DA_2__ESDHC4_CLK (_MX53_PAD_PATA_DA_2__ESDHC4_CLK | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2086#define MX53_PAD_PATA_DA_2__UART3_RTS (_MX53_PAD_PATA_DA_2__UART3_RTS | MUX_PAD_CTRL(MX53_UART_PAD_CTRL))
2087#define MX53_PAD_PATA_DA_2__USBPHY1_DATAOUT_4 (_MX53_PAD_PATA_DA_2__USBPHY1_DATAOUT_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
2088#define MX53_PAD_PATA_CS_0__PATA_CS_0 (_MX53_PAD_PATA_CS_0__PATA_CS_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2089#define MX53_PAD_PATA_CS_0__GPIO7_9 (_MX53_PAD_PATA_CS_0__GPIO7_9 | MUX_PAD_CTRL(NO_PAD_CTRL))
2090#define MX53_PAD_PATA_CS_0__UART3_TXD_MUX (_MX53_PAD_PATA_CS_0__UART3_TXD_MUX | MUX_PAD_CTRL(MX53_UART_PAD_CTRL))
2091#define MX53_PAD_PATA_CS_0__USBPHY1_DATAOUT_5 (_MX53_PAD_PATA_CS_0__USBPHY1_DATAOUT_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
2092#define MX53_PAD_PATA_CS_1__PATA_CS_1 (_MX53_PAD_PATA_CS_1__PATA_CS_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2093#define MX53_PAD_PATA_CS_1__GPIO7_10 (_MX53_PAD_PATA_CS_1__GPIO7_10 | MUX_PAD_CTRL(NO_PAD_CTRL))
2094#define MX53_PAD_PATA_CS_1__UART3_RXD_MUX (_MX53_PAD_PATA_CS_1__UART3_RXD_MUX | MUX_PAD_CTRL(MX53_UART_PAD_CTRL))
2095#define MX53_PAD_PATA_CS_1__USBPHY1_DATAOUT_6 (_MX53_PAD_PATA_CS_1__USBPHY1_DATAOUT_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
2096#define MX53_PAD_PATA_DATA0__PATA_DATA_0 (_MX53_PAD_PATA_DATA0__PATA_DATA_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2097#define MX53_PAD_PATA_DATA0__GPIO2_0 (_MX53_PAD_PATA_DATA0__GPIO2_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2098#define MX53_PAD_PATA_DATA0__EMI_NANDF_D_0 (_MX53_PAD_PATA_DATA0__EMI_NANDF_D_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2099#define MX53_PAD_PATA_DATA0__ESDHC3_DAT4 (_MX53_PAD_PATA_DATA0__ESDHC3_DAT4 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2100#define MX53_PAD_PATA_DATA0__GPU3d_GPU_DEBUG_OUT_0 (_MX53_PAD_PATA_DATA0__GPU3d_GPU_DEBUG_OUT_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2101#define MX53_PAD_PATA_DATA0__IPU_DIAG_BUS_0 (_MX53_PAD_PATA_DATA0__IPU_DIAG_BUS_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2102#define MX53_PAD_PATA_DATA0__USBPHY1_DATAOUT_7 (_MX53_PAD_PATA_DATA0__USBPHY1_DATAOUT_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
2103#define MX53_PAD_PATA_DATA1__PATA_DATA_1 (_MX53_PAD_PATA_DATA1__PATA_DATA_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2104#define MX53_PAD_PATA_DATA1__GPIO2_1 (_MX53_PAD_PATA_DATA1__GPIO2_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2105#define MX53_PAD_PATA_DATA1__EMI_NANDF_D_1 (_MX53_PAD_PATA_DATA1__EMI_NANDF_D_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2106#define MX53_PAD_PATA_DATA1__ESDHC3_DAT5 (_MX53_PAD_PATA_DATA1__ESDHC3_DAT5 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2107#define MX53_PAD_PATA_DATA1__GPU3d_GPU_DEBUG_OUT_1 (_MX53_PAD_PATA_DATA1__GPU3d_GPU_DEBUG_OUT_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2108#define MX53_PAD_PATA_DATA1__IPU_DIAG_BUS_1 (_MX53_PAD_PATA_DATA1__IPU_DIAG_BUS_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2109#define MX53_PAD_PATA_DATA2__PATA_DATA_2 (_MX53_PAD_PATA_DATA2__PATA_DATA_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2110#define MX53_PAD_PATA_DATA2__GPIO2_2 (_MX53_PAD_PATA_DATA2__GPIO2_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2111#define MX53_PAD_PATA_DATA2__EMI_NANDF_D_2 (_MX53_PAD_PATA_DATA2__EMI_NANDF_D_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2112#define MX53_PAD_PATA_DATA2__ESDHC3_DAT6 (_MX53_PAD_PATA_DATA2__ESDHC3_DAT6 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2113#define MX53_PAD_PATA_DATA2__GPU3d_GPU_DEBUG_OUT_2 (_MX53_PAD_PATA_DATA2__GPU3d_GPU_DEBUG_OUT_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2114#define MX53_PAD_PATA_DATA2__IPU_DIAG_BUS_2 (_MX53_PAD_PATA_DATA2__IPU_DIAG_BUS_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2115#define MX53_PAD_PATA_DATA3__PATA_DATA_3 (_MX53_PAD_PATA_DATA3__PATA_DATA_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
2116#define MX53_PAD_PATA_DATA3__GPIO2_3 (_MX53_PAD_PATA_DATA3__GPIO2_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
2117#define MX53_PAD_PATA_DATA3__EMI_NANDF_D_3 (_MX53_PAD_PATA_DATA3__EMI_NANDF_D_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
2118#define MX53_PAD_PATA_DATA3__ESDHC3_DAT7 (_MX53_PAD_PATA_DATA3__ESDHC3_DAT7 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2119#define MX53_PAD_PATA_DATA3__GPU3d_GPU_DEBUG_OUT_3 (_MX53_PAD_PATA_DATA3__GPU3d_GPU_DEBUG_OUT_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
2120#define MX53_PAD_PATA_DATA3__IPU_DIAG_BUS_3 (_MX53_PAD_PATA_DATA3__IPU_DIAG_BUS_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
2121#define MX53_PAD_PATA_DATA4__PATA_DATA_4 (_MX53_PAD_PATA_DATA4__PATA_DATA_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
2122#define MX53_PAD_PATA_DATA4__GPIO2_4 (_MX53_PAD_PATA_DATA4__GPIO2_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
2123#define MX53_PAD_PATA_DATA4__EMI_NANDF_D_4 (_MX53_PAD_PATA_DATA4__EMI_NANDF_D_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
2124#define MX53_PAD_PATA_DATA4__ESDHC4_DAT4 (_MX53_PAD_PATA_DATA4__ESDHC4_DAT4 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2125#define MX53_PAD_PATA_DATA4__GPU3d_GPU_DEBUG_OUT_4 (_MX53_PAD_PATA_DATA4__GPU3d_GPU_DEBUG_OUT_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
2126#define MX53_PAD_PATA_DATA4__IPU_DIAG_BUS_4 (_MX53_PAD_PATA_DATA4__IPU_DIAG_BUS_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
2127#define MX53_PAD_PATA_DATA5__PATA_DATA_5 (_MX53_PAD_PATA_DATA5__PATA_DATA_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
2128#define MX53_PAD_PATA_DATA5__GPIO2_5 (_MX53_PAD_PATA_DATA5__GPIO2_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
2129#define MX53_PAD_PATA_DATA5__EMI_NANDF_D_5 (_MX53_PAD_PATA_DATA5__EMI_NANDF_D_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
2130#define MX53_PAD_PATA_DATA5__ESDHC4_DAT5 (_MX53_PAD_PATA_DATA5__ESDHC4_DAT5 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2131#define MX53_PAD_PATA_DATA5__GPU3d_GPU_DEBUG_OUT_5 (_MX53_PAD_PATA_DATA5__GPU3d_GPU_DEBUG_OUT_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
2132#define MX53_PAD_PATA_DATA5__IPU_DIAG_BUS_5 (_MX53_PAD_PATA_DATA5__IPU_DIAG_BUS_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
2133#define MX53_PAD_PATA_DATA6__PATA_DATA_6 (_MX53_PAD_PATA_DATA6__PATA_DATA_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
2134#define MX53_PAD_PATA_DATA6__GPIO2_6 (_MX53_PAD_PATA_DATA6__GPIO2_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
2135#define MX53_PAD_PATA_DATA6__EMI_NANDF_D_6 (_MX53_PAD_PATA_DATA6__EMI_NANDF_D_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
2136#define MX53_PAD_PATA_DATA6__ESDHC4_DAT6 (_MX53_PAD_PATA_DATA6__ESDHC4_DAT6 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2137#define MX53_PAD_PATA_DATA6__GPU3d_GPU_DEBUG_OUT_6 (_MX53_PAD_PATA_DATA6__GPU3d_GPU_DEBUG_OUT_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
2138#define MX53_PAD_PATA_DATA6__IPU_DIAG_BUS_6 (_MX53_PAD_PATA_DATA6__IPU_DIAG_BUS_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
2139#define MX53_PAD_PATA_DATA7__PATA_DATA_7 (_MX53_PAD_PATA_DATA7__PATA_DATA_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
2140#define MX53_PAD_PATA_DATA7__GPIO2_7 (_MX53_PAD_PATA_DATA7__GPIO2_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
2141#define MX53_PAD_PATA_DATA7__EMI_NANDF_D_7 (_MX53_PAD_PATA_DATA7__EMI_NANDF_D_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
2142#define MX53_PAD_PATA_DATA7__ESDHC4_DAT7 (_MX53_PAD_PATA_DATA7__ESDHC4_DAT7 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2143#define MX53_PAD_PATA_DATA7__GPU3d_GPU_DEBUG_OUT_7 (_MX53_PAD_PATA_DATA7__GPU3d_GPU_DEBUG_OUT_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
2144#define MX53_PAD_PATA_DATA7__IPU_DIAG_BUS_7 (_MX53_PAD_PATA_DATA7__IPU_DIAG_BUS_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
2145#define MX53_PAD_PATA_DATA8__PATA_DATA_8 (_MX53_PAD_PATA_DATA8__PATA_DATA_8 | MUX_PAD_CTRL(NO_PAD_CTRL))
2146#define MX53_PAD_PATA_DATA8__GPIO2_8 (_MX53_PAD_PATA_DATA8__GPIO2_8 | MUX_PAD_CTRL(NO_PAD_CTRL))
2147#define MX53_PAD_PATA_DATA8__ESDHC1_DAT4 (_MX53_PAD_PATA_DATA8__ESDHC1_DAT4 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2148#define MX53_PAD_PATA_DATA8__EMI_NANDF_D_8 (_MX53_PAD_PATA_DATA8__EMI_NANDF_D_8 | MUX_PAD_CTRL(NO_PAD_CTRL))
2149#define MX53_PAD_PATA_DATA8__ESDHC3_DAT0 (_MX53_PAD_PATA_DATA8__ESDHC3_DAT0 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2150#define MX53_PAD_PATA_DATA8__GPU3d_GPU_DEBUG_OUT_8 (_MX53_PAD_PATA_DATA8__GPU3d_GPU_DEBUG_OUT_8 | MUX_PAD_CTRL(NO_PAD_CTRL))
2151#define MX53_PAD_PATA_DATA8__IPU_DIAG_BUS_8 (_MX53_PAD_PATA_DATA8__IPU_DIAG_BUS_8 | MUX_PAD_CTRL(NO_PAD_CTRL))
2152#define MX53_PAD_PATA_DATA9__PATA_DATA_9 (_MX53_PAD_PATA_DATA9__PATA_DATA_9 | MUX_PAD_CTRL(NO_PAD_CTRL))
2153#define MX53_PAD_PATA_DATA9__GPIO2_9 (_MX53_PAD_PATA_DATA9__GPIO2_9 | MUX_PAD_CTRL(NO_PAD_CTRL))
2154#define MX53_PAD_PATA_DATA9__ESDHC1_DAT5 (_MX53_PAD_PATA_DATA9__ESDHC1_DAT5 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2155#define MX53_PAD_PATA_DATA9__EMI_NANDF_D_9 (_MX53_PAD_PATA_DATA9__EMI_NANDF_D_9 | MUX_PAD_CTRL(NO_PAD_CTRL))
2156#define MX53_PAD_PATA_DATA9__ESDHC3_DAT1 (_MX53_PAD_PATA_DATA9__ESDHC3_DAT1 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2157#define MX53_PAD_PATA_DATA9__GPU3d_GPU_DEBUG_OUT_9 (_MX53_PAD_PATA_DATA9__GPU3d_GPU_DEBUG_OUT_9 | MUX_PAD_CTRL(NO_PAD_CTRL))
2158#define MX53_PAD_PATA_DATA9__IPU_DIAG_BUS_9 (_MX53_PAD_PATA_DATA9__IPU_DIAG_BUS_9 | MUX_PAD_CTRL(NO_PAD_CTRL))
2159#define MX53_PAD_PATA_DATA10__PATA_DATA_10 (_MX53_PAD_PATA_DATA10__PATA_DATA_10 | MUX_PAD_CTRL(NO_PAD_CTRL))
2160#define MX53_PAD_PATA_DATA10__GPIO2_10 (_MX53_PAD_PATA_DATA10__GPIO2_10 | MUX_PAD_CTRL(NO_PAD_CTRL))
2161#define MX53_PAD_PATA_DATA10__ESDHC1_DAT6 (_MX53_PAD_PATA_DATA10__ESDHC1_DAT6 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2162#define MX53_PAD_PATA_DATA10__EMI_NANDF_D_10 (_MX53_PAD_PATA_DATA10__EMI_NANDF_D_10 | MUX_PAD_CTRL(NO_PAD_CTRL))
2163#define MX53_PAD_PATA_DATA10__ESDHC3_DAT2 (_MX53_PAD_PATA_DATA10__ESDHC3_DAT2 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2164#define MX53_PAD_PATA_DATA10__GPU3d_GPU_DEBUG_OUT_10 (_MX53_PAD_PATA_DATA10__GPU3d_GPU_DEBUG_OUT_10 | MUX_PAD_CTRL(NO_PAD_CTRL))
2165#define MX53_PAD_PATA_DATA10__IPU_DIAG_BUS_10 (_MX53_PAD_PATA_DATA10__IPU_DIAG_BUS_10 | MUX_PAD_CTRL(NO_PAD_CTRL))
2166#define MX53_PAD_PATA_DATA11__PATA_DATA_11 (_MX53_PAD_PATA_DATA11__PATA_DATA_11 | MUX_PAD_CTRL(NO_PAD_CTRL))
2167#define MX53_PAD_PATA_DATA11__GPIO2_11 (_MX53_PAD_PATA_DATA11__GPIO2_11 | MUX_PAD_CTRL(NO_PAD_CTRL))
2168#define MX53_PAD_PATA_DATA11__ESDHC1_DAT7 (_MX53_PAD_PATA_DATA11__ESDHC1_DAT7 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2169#define MX53_PAD_PATA_DATA11__EMI_NANDF_D_11 (_MX53_PAD_PATA_DATA11__EMI_NANDF_D_11 | MUX_PAD_CTRL(NO_PAD_CTRL))
2170#define MX53_PAD_PATA_DATA11__ESDHC3_DAT3 (_MX53_PAD_PATA_DATA11__ESDHC3_DAT3 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2171#define MX53_PAD_PATA_DATA11__GPU3d_GPU_DEBUG_OUT_11 (_MX53_PAD_PATA_DATA11__GPU3d_GPU_DEBUG_OUT_11 | MUX_PAD_CTRL(NO_PAD_CTRL))
2172#define MX53_PAD_PATA_DATA11__IPU_DIAG_BUS_11 (_MX53_PAD_PATA_DATA11__IPU_DIAG_BUS_11 | MUX_PAD_CTRL(NO_PAD_CTRL))
2173#define MX53_PAD_PATA_DATA12__PATA_DATA_12 (_MX53_PAD_PATA_DATA12__PATA_DATA_12 | MUX_PAD_CTRL(NO_PAD_CTRL))
2174#define MX53_PAD_PATA_DATA12__GPIO2_12 (_MX53_PAD_PATA_DATA12__GPIO2_12 | MUX_PAD_CTRL(NO_PAD_CTRL))
2175#define MX53_PAD_PATA_DATA12__ESDHC2_DAT4 (_MX53_PAD_PATA_DATA12__ESDHC2_DAT4 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2176#define MX53_PAD_PATA_DATA12__EMI_NANDF_D_12 (_MX53_PAD_PATA_DATA12__EMI_NANDF_D_12 | MUX_PAD_CTRL(NO_PAD_CTRL))
2177#define MX53_PAD_PATA_DATA12__ESDHC4_DAT0 (_MX53_PAD_PATA_DATA12__ESDHC4_DAT0 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2178#define MX53_PAD_PATA_DATA12__GPU3d_GPU_DEBUG_OUT_12 (_MX53_PAD_PATA_DATA12__GPU3d_GPU_DEBUG_OUT_12 | MUX_PAD_CTRL(NO_PAD_CTRL))
2179#define MX53_PAD_PATA_DATA12__IPU_DIAG_BUS_12 (_MX53_PAD_PATA_DATA12__IPU_DIAG_BUS_12 | MUX_PAD_CTRL(NO_PAD_CTRL))
2180#define MX53_PAD_PATA_DATA13__PATA_DATA_13 (_MX53_PAD_PATA_DATA13__PATA_DATA_13 | MUX_PAD_CTRL(NO_PAD_CTRL))
2181#define MX53_PAD_PATA_DATA13__GPIO2_13 (_MX53_PAD_PATA_DATA13__GPIO2_13 | MUX_PAD_CTRL(NO_PAD_CTRL))
2182#define MX53_PAD_PATA_DATA13__ESDHC2_DAT5 (_MX53_PAD_PATA_DATA13__ESDHC2_DAT5 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2183#define MX53_PAD_PATA_DATA13__EMI_NANDF_D_13 (_MX53_PAD_PATA_DATA13__EMI_NANDF_D_13 | MUX_PAD_CTRL(NO_PAD_CTRL))
2184#define MX53_PAD_PATA_DATA13__ESDHC4_DAT1 (_MX53_PAD_PATA_DATA13__ESDHC4_DAT1 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2185#define MX53_PAD_PATA_DATA13__GPU3d_GPU_DEBUG_OUT_13 (_MX53_PAD_PATA_DATA13__GPU3d_GPU_DEBUG_OUT_13 | MUX_PAD_CTRL(NO_PAD_CTRL))
2186#define MX53_PAD_PATA_DATA13__IPU_DIAG_BUS_13 (_MX53_PAD_PATA_DATA13__IPU_DIAG_BUS_13 | MUX_PAD_CTRL(NO_PAD_CTRL))
2187#define MX53_PAD_PATA_DATA14__PATA_DATA_14 (_MX53_PAD_PATA_DATA14__PATA_DATA_14 | MUX_PAD_CTRL(NO_PAD_CTRL))
2188#define MX53_PAD_PATA_DATA14__GPIO2_14 (_MX53_PAD_PATA_DATA14__GPIO2_14 | MUX_PAD_CTRL(NO_PAD_CTRL))
2189#define MX53_PAD_PATA_DATA14__ESDHC2_DAT6 (_MX53_PAD_PATA_DATA14__ESDHC2_DAT6 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2190#define MX53_PAD_PATA_DATA14__EMI_NANDF_D_14 (_MX53_PAD_PATA_DATA14__EMI_NANDF_D_14 | MUX_PAD_CTRL(NO_PAD_CTRL))
2191#define MX53_PAD_PATA_DATA14__ESDHC4_DAT2 (_MX53_PAD_PATA_DATA14__ESDHC4_DAT2 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2192#define MX53_PAD_PATA_DATA14__GPU3d_GPU_DEBUG_OUT_14 (_MX53_PAD_PATA_DATA14__GPU3d_GPU_DEBUG_OUT_14 | MUX_PAD_CTRL(NO_PAD_CTRL))
2193#define MX53_PAD_PATA_DATA14__IPU_DIAG_BUS_14 (_MX53_PAD_PATA_DATA14__IPU_DIAG_BUS_14 | MUX_PAD_CTRL(NO_PAD_CTRL))
2194#define MX53_PAD_PATA_DATA15__PATA_DATA_15 (_MX53_PAD_PATA_DATA15__PATA_DATA_15 | MUX_PAD_CTRL(NO_PAD_CTRL))
2195#define MX53_PAD_PATA_DATA15__GPIO2_15 (_MX53_PAD_PATA_DATA15__GPIO2_15 | MUX_PAD_CTRL(NO_PAD_CTRL))
2196#define MX53_PAD_PATA_DATA15__ESDHC2_DAT7 (_MX53_PAD_PATA_DATA15__ESDHC2_DAT7 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2197#define MX53_PAD_PATA_DATA15__EMI_NANDF_D_15 (_MX53_PAD_PATA_DATA15__EMI_NANDF_D_15 | MUX_PAD_CTRL(NO_PAD_CTRL))
2198#define MX53_PAD_PATA_DATA15__ESDHC4_DAT3 (_MX53_PAD_PATA_DATA15__ESDHC4_DAT3 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2199#define MX53_PAD_PATA_DATA15__GPU3d_GPU_DEBUG_OUT_15 (_MX53_PAD_PATA_DATA15__GPU3d_GPU_DEBUG_OUT_15 | MUX_PAD_CTRL(NO_PAD_CTRL))
2200#define MX53_PAD_PATA_DATA15__IPU_DIAG_BUS_15 (_MX53_PAD_PATA_DATA15__IPU_DIAG_BUS_15 | MUX_PAD_CTRL(NO_PAD_CTRL))
2201#define MX53_PAD_SD1_DATA0__ESDHC1_DAT0 (_MX53_PAD_SD1_DATA0__ESDHC1_DAT0 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2202#define MX53_PAD_SD1_DATA0__GPIO1_16 (_MX53_PAD_SD1_DATA0__GPIO1_16 | MUX_PAD_CTRL(NO_PAD_CTRL))
2203#define MX53_PAD_SD1_DATA0__GPT_CAPIN1 (_MX53_PAD_SD1_DATA0__GPT_CAPIN1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2204#define MX53_PAD_SD1_DATA0__CSPI_MISO (_MX53_PAD_SD1_DATA0__CSPI_MISO | MUX_PAD_CTRL(NO_PAD_CTRL))
2205#define MX53_PAD_SD1_DATA0__CCM_PLL3_BYP (_MX53_PAD_SD1_DATA0__CCM_PLL3_BYP | MUX_PAD_CTRL(NO_PAD_CTRL))
2206#define MX53_PAD_SD1_DATA1__ESDHC1_DAT1 (_MX53_PAD_SD1_DATA1__ESDHC1_DAT1 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2207#define MX53_PAD_SD1_DATA1__GPIO1_17 (_MX53_PAD_SD1_DATA1__GPIO1_17 | MUX_PAD_CTRL(NO_PAD_CTRL))
2208#define MX53_PAD_SD1_DATA1__GPT_CAPIN2 (_MX53_PAD_SD1_DATA1__GPT_CAPIN2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2209#define MX53_PAD_SD1_DATA1__CSPI_SS0 (_MX53_PAD_SD1_DATA1__CSPI_SS0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2210#define MX53_PAD_SD1_DATA1__CCM_PLL4_BYP (_MX53_PAD_SD1_DATA1__CCM_PLL4_BYP | MUX_PAD_CTRL(NO_PAD_CTRL))
2211#define MX53_PAD_SD1_CMD__ESDHC1_CMD (_MX53_PAD_SD1_CMD__ESDHC1_CMD | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2212#define MX53_PAD_SD1_CMD__GPIO1_18 (_MX53_PAD_SD1_CMD__GPIO1_18 | MUX_PAD_CTRL(NO_PAD_CTRL))
2213#define MX53_PAD_SD1_CMD__GPT_CMPOUT1 (_MX53_PAD_SD1_CMD__GPT_CMPOUT1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2214#define MX53_PAD_SD1_CMD__CSPI_MOSI (_MX53_PAD_SD1_CMD__CSPI_MOSI | MUX_PAD_CTRL(NO_PAD_CTRL))
2215#define MX53_PAD_SD1_CMD__CCM_PLL1_BYP (_MX53_PAD_SD1_CMD__CCM_PLL1_BYP | MUX_PAD_CTRL(NO_PAD_CTRL))
2216#define MX53_PAD_SD1_DATA2__ESDHC1_DAT2 (_MX53_PAD_SD1_DATA2__ESDHC1_DAT2 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2217#define MX53_PAD_SD1_DATA2__GPIO1_19 (_MX53_PAD_SD1_DATA2__GPIO1_19 | MUX_PAD_CTRL(NO_PAD_CTRL))
2218#define MX53_PAD_SD1_DATA2__GPT_CMPOUT2 (_MX53_PAD_SD1_DATA2__GPT_CMPOUT2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2219#define MX53_PAD_SD1_DATA2__PWM2_PWMO (_MX53_PAD_SD1_DATA2__PWM2_PWMO | MUX_PAD_CTRL(NO_PAD_CTRL))
2220#define MX53_PAD_SD1_DATA2__WDOG1_WDOG_B (_MX53_PAD_SD1_DATA2__WDOG1_WDOG_B | MUX_PAD_CTRL(NO_PAD_CTRL))
2221#define MX53_PAD_SD1_DATA2__CSPI_SS1 (_MX53_PAD_SD1_DATA2__CSPI_SS1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2222#define MX53_PAD_SD1_DATA2__WDOG1_WDOG_RST_B_DEB (_MX53_PAD_SD1_DATA2__WDOG1_WDOG_RST_B_DEB | MUX_PAD_CTRL(NO_PAD_CTRL))
2223#define MX53_PAD_SD1_DATA2__CCM_PLL2_BYP (_MX53_PAD_SD1_DATA2__CCM_PLL2_BYP | MUX_PAD_CTRL(NO_PAD_CTRL))
2224#define MX53_PAD_SD1_CLK__ESDHC1_CLK (_MX53_PAD_SD1_CLK__ESDHC1_CLK | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2225#define MX53_PAD_SD1_CLK__GPIO1_20 (_MX53_PAD_SD1_CLK__GPIO1_20 | MUX_PAD_CTRL(NO_PAD_CTRL))
2226#define MX53_PAD_SD1_CLK__OSC32k_32K_OUT (_MX53_PAD_SD1_CLK__OSC32k_32K_OUT | MUX_PAD_CTRL(NO_PAD_CTRL))
2227#define MX53_PAD_SD1_CLK__GPT_CLKIN (_MX53_PAD_SD1_CLK__GPT_CLKIN | MUX_PAD_CTRL(NO_PAD_CTRL))
2228#define MX53_PAD_SD1_CLK__CSPI_SCLK (_MX53_PAD_SD1_CLK__CSPI_SCLK | MUX_PAD_CTRL(NO_PAD_CTRL))
2229#define MX53_PAD_SD1_CLK__SATA_PHY_DTB_0 (_MX53_PAD_SD1_CLK__SATA_PHY_DTB_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2230#define MX53_PAD_SD1_DATA3__ESDHC1_DAT3 (_MX53_PAD_SD1_DATA3__ESDHC1_DAT3 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2231#define MX53_PAD_SD1_DATA3__GPIO1_21 (_MX53_PAD_SD1_DATA3__GPIO1_21 | MUX_PAD_CTRL(NO_PAD_CTRL))
2232#define MX53_PAD_SD1_DATA3__GPT_CMPOUT3 (_MX53_PAD_SD1_DATA3__GPT_CMPOUT3 | MUX_PAD_CTRL(NO_PAD_CTRL))
2233#define MX53_PAD_SD1_DATA3__PWM1_PWMO (_MX53_PAD_SD1_DATA3__PWM1_PWMO | MUX_PAD_CTRL(NO_PAD_CTRL))
2234#define MX53_PAD_SD1_DATA3__WDOG2_WDOG_B (_MX53_PAD_SD1_DATA3__WDOG2_WDOG_B | MUX_PAD_CTRL(NO_PAD_CTRL))
2235#define MX53_PAD_SD1_DATA3__CSPI_SS2 (_MX53_PAD_SD1_DATA3__CSPI_SS2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2236#define MX53_PAD_SD1_DATA3__WDOG2_WDOG_RST_B_DEB (_MX53_PAD_SD1_DATA3__WDOG2_WDOG_RST_B_DEB | MUX_PAD_CTRL(NO_PAD_CTRL))
2237#define MX53_PAD_SD1_DATA3__SATA_PHY_DTB_1 (_MX53_PAD_SD1_DATA3__SATA_PHY_DTB_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2238#define MX53_PAD_SD2_CLK__ESDHC2_CLK (_MX53_PAD_SD2_CLK__ESDHC2_CLK | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2239#define MX53_PAD_SD2_CLK__GPIO1_10 (_MX53_PAD_SD2_CLK__GPIO1_10 | MUX_PAD_CTRL(NO_PAD_CTRL))
2240#define MX53_PAD_SD2_CLK__KPP_COL_5 (_MX53_PAD_SD2_CLK__KPP_COL_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
2241#define MX53_PAD_SD2_CLK__AUDMUX_AUD4_RXFS (_MX53_PAD_SD2_CLK__AUDMUX_AUD4_RXFS | MUX_PAD_CTRL(NO_PAD_CTRL))
2242#define MX53_PAD_SD2_CLK__CSPI_SCLK (_MX53_PAD_SD2_CLK__CSPI_SCLK | MUX_PAD_CTRL(NO_PAD_CTRL))
2243#define MX53_PAD_SD2_CLK__SCC_RANDOM_V (_MX53_PAD_SD2_CLK__SCC_RANDOM_V | MUX_PAD_CTRL(NO_PAD_CTRL))
2244#define MX53_PAD_SD2_CMD__ESDHC2_CMD (_MX53_PAD_SD2_CMD__ESDHC2_CMD | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2245#define MX53_PAD_SD2_CMD__GPIO1_11 (_MX53_PAD_SD2_CMD__GPIO1_11 | MUX_PAD_CTRL(NO_PAD_CTRL))
2246#define MX53_PAD_SD2_CMD__KPP_ROW_5 (_MX53_PAD_SD2_CMD__KPP_ROW_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
2247#define MX53_PAD_SD2_CMD__AUDMUX_AUD4_RXC (_MX53_PAD_SD2_CMD__AUDMUX_AUD4_RXC | MUX_PAD_CTRL(NO_PAD_CTRL))
2248#define MX53_PAD_SD2_CMD__CSPI_MOSI (_MX53_PAD_SD2_CMD__CSPI_MOSI | MUX_PAD_CTRL(NO_PAD_CTRL))
2249#define MX53_PAD_SD2_CMD__SCC_RANDOM (_MX53_PAD_SD2_CMD__SCC_RANDOM | MUX_PAD_CTRL(NO_PAD_CTRL))
2250#define MX53_PAD_SD2_DATA3__ESDHC2_DAT3 (_MX53_PAD_SD2_DATA3__ESDHC2_DAT3 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2251#define MX53_PAD_SD2_DATA3__GPIO1_12 (_MX53_PAD_SD2_DATA3__GPIO1_12 | MUX_PAD_CTRL(NO_PAD_CTRL))
2252#define MX53_PAD_SD2_DATA3__KPP_COL_6 (_MX53_PAD_SD2_DATA3__KPP_COL_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
2253#define MX53_PAD_SD2_DATA3__AUDMUX_AUD4_TXC (_MX53_PAD_SD2_DATA3__AUDMUX_AUD4_TXC | MUX_PAD_CTRL(NO_PAD_CTRL))
2254#define MX53_PAD_SD2_DATA3__CSPI_SS2 (_MX53_PAD_SD2_DATA3__CSPI_SS2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2255#define MX53_PAD_SD2_DATA3__SJC_DONE (_MX53_PAD_SD2_DATA3__SJC_DONE | MUX_PAD_CTRL(NO_PAD_CTRL))
2256#define MX53_PAD_SD2_DATA2__ESDHC2_DAT2 (_MX53_PAD_SD2_DATA2__ESDHC2_DAT2 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2257#define MX53_PAD_SD2_DATA2__GPIO1_13 (_MX53_PAD_SD2_DATA2__GPIO1_13 | MUX_PAD_CTRL(NO_PAD_CTRL))
2258#define MX53_PAD_SD2_DATA2__KPP_ROW_6 (_MX53_PAD_SD2_DATA2__KPP_ROW_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
2259#define MX53_PAD_SD2_DATA2__AUDMUX_AUD4_TXD (_MX53_PAD_SD2_DATA2__AUDMUX_AUD4_TXD | MUX_PAD_CTRL(NO_PAD_CTRL))
2260#define MX53_PAD_SD2_DATA2__CSPI_SS1 (_MX53_PAD_SD2_DATA2__CSPI_SS1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2261#define MX53_PAD_SD2_DATA2__SJC_FAIL (_MX53_PAD_SD2_DATA2__SJC_FAIL | MUX_PAD_CTRL(NO_PAD_CTRL))
2262#define MX53_PAD_SD2_DATA1__ESDHC2_DAT1 (_MX53_PAD_SD2_DATA1__ESDHC2_DAT1 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2263#define MX53_PAD_SD2_DATA1__GPIO1_14 (_MX53_PAD_SD2_DATA1__GPIO1_14 | MUX_PAD_CTRL(NO_PAD_CTRL))
2264#define MX53_PAD_SD2_DATA1__KPP_COL_7 (_MX53_PAD_SD2_DATA1__KPP_COL_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
2265#define MX53_PAD_SD2_DATA1__AUDMUX_AUD4_TXFS (_MX53_PAD_SD2_DATA1__AUDMUX_AUD4_TXFS | MUX_PAD_CTRL(NO_PAD_CTRL))
2266#define MX53_PAD_SD2_DATA1__CSPI_SS0 (_MX53_PAD_SD2_DATA1__CSPI_SS0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2267#define MX53_PAD_SD2_DATA1__RTIC_SEC_VIO (_MX53_PAD_SD2_DATA1__RTIC_SEC_VIO | MUX_PAD_CTRL(NO_PAD_CTRL))
2268#define MX53_PAD_SD2_DATA0__ESDHC2_DAT0 (_MX53_PAD_SD2_DATA0__ESDHC2_DAT0 | MUX_PAD_CTRL(MX53_SDHC_PAD_CTRL))
2269#define MX53_PAD_SD2_DATA0__GPIO1_15 (_MX53_PAD_SD2_DATA0__GPIO1_15 | MUX_PAD_CTRL(NO_PAD_CTRL))
2270#define MX53_PAD_SD2_DATA0__KPP_ROW_7 (_MX53_PAD_SD2_DATA0__KPP_ROW_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
2271#define MX53_PAD_SD2_DATA0__AUDMUX_AUD4_RXD (_MX53_PAD_SD2_DATA0__AUDMUX_AUD4_RXD | MUX_PAD_CTRL(NO_PAD_CTRL))
2272#define MX53_PAD_SD2_DATA0__CSPI_MISO (_MX53_PAD_SD2_DATA0__CSPI_MISO | MUX_PAD_CTRL(NO_PAD_CTRL))
2273#define MX53_PAD_SD2_DATA0__RTIC_DONE_INT (_MX53_PAD_SD2_DATA0__RTIC_DONE_INT | MUX_PAD_CTRL(NO_PAD_CTRL))
2274#define MX53_PAD_GPIO_0__CCM_CLKO (_MX53_PAD_GPIO_0__CCM_CLKO | MUX_PAD_CTRL(NO_PAD_CTRL))
2275#define MX53_PAD_GPIO_0__GPIO1_0 (_MX53_PAD_GPIO_0__GPIO1_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2276#define MX53_PAD_GPIO_0__KPP_COL_5 (_MX53_PAD_GPIO_0__KPP_COL_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
2277#define MX53_PAD_GPIO_0__CCM_SSI_EXT1_CLK (_MX53_PAD_GPIO_0__CCM_SSI_EXT1_CLK | MUX_PAD_CTRL(NO_PAD_CTRL))
2278#define MX53_PAD_GPIO_0__EPIT1_EPITO (_MX53_PAD_GPIO_0__EPIT1_EPITO | MUX_PAD_CTRL(NO_PAD_CTRL))
2279#define MX53_PAD_GPIO_0__SRTC_ALARM_DEB (_MX53_PAD_GPIO_0__SRTC_ALARM_DEB | MUX_PAD_CTRL(NO_PAD_CTRL))
2280#define MX53_PAD_GPIO_0__USBOH3_USBH1_PWR (_MX53_PAD_GPIO_0__USBOH3_USBH1_PWR | MUX_PAD_CTRL(NO_PAD_CTRL))
2281#define MX53_PAD_GPIO_0__CSU_TD (_MX53_PAD_GPIO_0__CSU_TD | MUX_PAD_CTRL(NO_PAD_CTRL))
2282#define MX53_PAD_GPIO_1__ESAI1_SCKR (_MX53_PAD_GPIO_1__ESAI1_SCKR | MUX_PAD_CTRL(NO_PAD_CTRL))
2283#define MX53_PAD_GPIO_1__GPIO1_1 (_MX53_PAD_GPIO_1__GPIO1_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2284#define MX53_PAD_GPIO_1__KPP_ROW_5 (_MX53_PAD_GPIO_1__KPP_ROW_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
2285#define MX53_PAD_GPIO_1__CCM_SSI_EXT2_CLK (_MX53_PAD_GPIO_1__CCM_SSI_EXT2_CLK | MUX_PAD_CTRL(NO_PAD_CTRL))
2286#define MX53_PAD_GPIO_1__PWM2_PWMO (_MX53_PAD_GPIO_1__PWM2_PWMO | MUX_PAD_CTRL(NO_PAD_CTRL))
2287#define MX53_PAD_GPIO_1__WDOG2_WDOG_B (_MX53_PAD_GPIO_1__WDOG2_WDOG_B | MUX_PAD_CTRL(NO_PAD_CTRL))
2288#define MX53_PAD_GPIO_1__ESDHC1_CD (_MX53_PAD_GPIO_1__ESDHC1_CD | MUX_PAD_CTRL(NO_PAD_CTRL))
2289#define MX53_PAD_GPIO_1__SRC_TESTER_ACK (_MX53_PAD_GPIO_1__SRC_TESTER_ACK | MUX_PAD_CTRL(NO_PAD_CTRL))
2290#define MX53_PAD_GPIO_9__ESAI1_FSR (_MX53_PAD_GPIO_9__ESAI1_FSR | MUX_PAD_CTRL(NO_PAD_CTRL))
2291#define MX53_PAD_GPIO_9__GPIO1_9 (_MX53_PAD_GPIO_9__GPIO1_9 | MUX_PAD_CTRL(NO_PAD_CTRL))
2292#define MX53_PAD_GPIO_9__KPP_COL_6 (_MX53_PAD_GPIO_9__KPP_COL_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
2293#define MX53_PAD_GPIO_9__CCM_REF_EN_B (_MX53_PAD_GPIO_9__CCM_REF_EN_B | MUX_PAD_CTRL(NO_PAD_CTRL))
2294#define MX53_PAD_GPIO_9__PWM1_PWMO (_MX53_PAD_GPIO_9__PWM1_PWMO | MUX_PAD_CTRL(NO_PAD_CTRL))
2295#define MX53_PAD_GPIO_9__WDOG1_WDOG_B (_MX53_PAD_GPIO_9__WDOG1_WDOG_B | MUX_PAD_CTRL(NO_PAD_CTRL))
2296#define MX53_PAD_GPIO_9__ESDHC1_WP (_MX53_PAD_GPIO_9__ESDHC1_WP | MUX_PAD_CTRL(NO_PAD_CTRL))
2297#define MX53_PAD_GPIO_9__SCC_FAIL_STATE (_MX53_PAD_GPIO_9__SCC_FAIL_STATE | MUX_PAD_CTRL(NO_PAD_CTRL))
2298#define MX53_PAD_GPIO_3__ESAI1_HCKR (_MX53_PAD_GPIO_3__ESAI1_HCKR | MUX_PAD_CTRL(NO_PAD_CTRL))
2299#define MX53_PAD_GPIO_3__GPIO1_3 (_MX53_PAD_GPIO_3__GPIO1_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
2300#define MX53_PAD_GPIO_3__I2C3_SCL (_MX53_PAD_GPIO_3__I2C3_SCL | MUX_PAD_CTRL(NO_PAD_CTRL))
2301#define MX53_PAD_GPIO_3__DPLLIP1_TOG_EN (_MX53_PAD_GPIO_3__DPLLIP1_TOG_EN | MUX_PAD_CTRL(NO_PAD_CTRL))
2302#define MX53_PAD_GPIO_3__CCM_CLKO2 (_MX53_PAD_GPIO_3__CCM_CLKO2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2303#define MX53_PAD_GPIO_3__OBSERVE_MUX_OBSRV_INT_OUT0 (_MX53_PAD_GPIO_3__OBSERVE_MUX_OBSRV_INT_OUT0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2304#define MX53_PAD_GPIO_3__USBOH3_USBH1_OC (_MX53_PAD_GPIO_3__USBOH3_USBH1_OC | MUX_PAD_CTRL(NO_PAD_CTRL))
2305#define MX53_PAD_GPIO_3__MLB_MLBCLK (_MX53_PAD_GPIO_3__MLB_MLBCLK | MUX_PAD_CTRL(NO_PAD_CTRL))
2306#define MX53_PAD_GPIO_6__ESAI1_SCKT (_MX53_PAD_GPIO_6__ESAI1_SCKT | MUX_PAD_CTRL(NO_PAD_CTRL))
2307#define MX53_PAD_GPIO_6__GPIO1_6 (_MX53_PAD_GPIO_6__GPIO1_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
2308#define MX53_PAD_GPIO_6__I2C3_SDA (_MX53_PAD_GPIO_6__I2C3_SDA | MUX_PAD_CTRL(NO_PAD_CTRL))
2309#define MX53_PAD_GPIO_6__CCM_CCM_OUT_0 (_MX53_PAD_GPIO_6__CCM_CCM_OUT_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2310#define MX53_PAD_GPIO_6__CSU_CSU_INT_DEB (_MX53_PAD_GPIO_6__CSU_CSU_INT_DEB | MUX_PAD_CTRL(NO_PAD_CTRL))
2311#define MX53_PAD_GPIO_6__OBSERVE_MUX_OBSRV_INT_OUT1 (_MX53_PAD_GPIO_6__OBSERVE_MUX_OBSRV_INT_OUT1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2312#define MX53_PAD_GPIO_6__ESDHC2_LCTL (_MX53_PAD_GPIO_6__ESDHC2_LCTL | MUX_PAD_CTRL(NO_PAD_CTRL))
2313#define MX53_PAD_GPIO_6__MLB_MLBSIG (_MX53_PAD_GPIO_6__MLB_MLBSIG | MUX_PAD_CTRL(NO_PAD_CTRL))
2314#define MX53_PAD_GPIO_2__ESAI1_FST (_MX53_PAD_GPIO_2__ESAI1_FST | MUX_PAD_CTRL(NO_PAD_CTRL))
2315#define MX53_PAD_GPIO_2__GPIO1_2 (_MX53_PAD_GPIO_2__GPIO1_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2316#define MX53_PAD_GPIO_2__KPP_ROW_6 (_MX53_PAD_GPIO_2__KPP_ROW_6 | MUX_PAD_CTRL(NO_PAD_CTRL))
2317#define MX53_PAD_GPIO_2__CCM_CCM_OUT_1 (_MX53_PAD_GPIO_2__CCM_CCM_OUT_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2318#define MX53_PAD_GPIO_2__CSU_CSU_ALARM_AUT_0 (_MX53_PAD_GPIO_2__CSU_CSU_ALARM_AUT_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2319#define MX53_PAD_GPIO_2__OBSERVE_MUX_OBSRV_INT_OUT2 (_MX53_PAD_GPIO_2__OBSERVE_MUX_OBSRV_INT_OUT2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2320#define MX53_PAD_GPIO_2__ESDHC2_WP (_MX53_PAD_GPIO_2__ESDHC2_WP | MUX_PAD_CTRL(NO_PAD_CTRL))
2321#define MX53_PAD_GPIO_2__MLB_MLBDAT (_MX53_PAD_GPIO_2__MLB_MLBDAT | MUX_PAD_CTRL(NO_PAD_CTRL))
2322#define MX53_PAD_GPIO_4__ESAI1_HCKT (_MX53_PAD_GPIO_4__ESAI1_HCKT | MUX_PAD_CTRL(NO_PAD_CTRL))
2323#define MX53_PAD_GPIO_4__GPIO1_4 (_MX53_PAD_GPIO_4__GPIO1_4 | MUX_PAD_CTRL(NO_PAD_CTRL))
2324#define MX53_PAD_GPIO_4__KPP_COL_7 (_MX53_PAD_GPIO_4__KPP_COL_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
2325#define MX53_PAD_GPIO_4__CCM_CCM_OUT_2 (_MX53_PAD_GPIO_4__CCM_CCM_OUT_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2326#define MX53_PAD_GPIO_4__CSU_CSU_ALARM_AUT_1 (_MX53_PAD_GPIO_4__CSU_CSU_ALARM_AUT_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2327#define MX53_PAD_GPIO_4__OBSERVE_MUX_OBSRV_INT_OUT3 (_MX53_PAD_GPIO_4__OBSERVE_MUX_OBSRV_INT_OUT3 | MUX_PAD_CTRL(NO_PAD_CTRL))
2328#define MX53_PAD_GPIO_4__ESDHC2_CD (_MX53_PAD_GPIO_4__ESDHC2_CD | MUX_PAD_CTRL(NO_PAD_CTRL))
2329#define MX53_PAD_GPIO_4__SCC_SEC_STATE (_MX53_PAD_GPIO_4__SCC_SEC_STATE | MUX_PAD_CTRL(NO_PAD_CTRL))
2330#define MX53_PAD_GPIO_5__ESAI1_TX2_RX3 (_MX53_PAD_GPIO_5__ESAI1_TX2_RX3 | MUX_PAD_CTRL(NO_PAD_CTRL))
2331#define MX53_PAD_GPIO_5__GPIO1_5 (_MX53_PAD_GPIO_5__GPIO1_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
2332#define MX53_PAD_GPIO_5__KPP_ROW_7 (_MX53_PAD_GPIO_5__KPP_ROW_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
2333#define MX53_PAD_GPIO_5__CCM_CLKO (_MX53_PAD_GPIO_5__CCM_CLKO | MUX_PAD_CTRL(NO_PAD_CTRL))
2334#define MX53_PAD_GPIO_5__CSU_CSU_ALARM_AUT_2 (_MX53_PAD_GPIO_5__CSU_CSU_ALARM_AUT_2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2335#define MX53_PAD_GPIO_5__OBSERVE_MUX_OBSRV_INT_OUT4 (_MX53_PAD_GPIO_5__OBSERVE_MUX_OBSRV_INT_OUT4 | MUX_PAD_CTRL(NO_PAD_CTRL))
2336#define MX53_PAD_GPIO_5__I2C3_SCL (_MX53_PAD_GPIO_5__I2C3_SCL | MUX_PAD_CTRL(NO_PAD_CTRL))
2337#define MX53_PAD_GPIO_5__CCM_PLL1_BYP (_MX53_PAD_GPIO_5__CCM_PLL1_BYP | MUX_PAD_CTRL(NO_PAD_CTRL))
2338#define MX53_PAD_GPIO_7__ESAI1_TX4_RX1 (_MX53_PAD_GPIO_7__ESAI1_TX4_RX1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2339#define MX53_PAD_GPIO_7__GPIO1_7 (_MX53_PAD_GPIO_7__GPIO1_7 | MUX_PAD_CTRL(NO_PAD_CTRL))
2340#define MX53_PAD_GPIO_7__EPIT1_EPITO (_MX53_PAD_GPIO_7__EPIT1_EPITO | MUX_PAD_CTRL(NO_PAD_CTRL))
2341#define MX53_PAD_GPIO_7__CAN1_TXCAN (_MX53_PAD_GPIO_7__CAN1_TXCAN | MUX_PAD_CTRL(NO_PAD_CTRL))
2342#define MX53_PAD_GPIO_7__UART2_TXD_MUX (_MX53_PAD_GPIO_7__UART2_TXD_MUX | MUX_PAD_CTRL(NO_PAD_CTRL))
2343#define MX53_PAD_GPIO_7__FIRI_RXD (_MX53_PAD_GPIO_7__FIRI_RXD | MUX_PAD_CTRL(NO_PAD_CTRL))
2344#define MX53_PAD_GPIO_7__SPDIF_PLOCK (_MX53_PAD_GPIO_7__SPDIF_PLOCK | MUX_PAD_CTRL(NO_PAD_CTRL))
2345#define MX53_PAD_GPIO_7__CCM_PLL2_BYP (_MX53_PAD_GPIO_7__CCM_PLL2_BYP | MUX_PAD_CTRL(NO_PAD_CTRL))
2346#define MX53_PAD_GPIO_8__ESAI1_TX5_RX0 (_MX53_PAD_GPIO_8__ESAI1_TX5_RX0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2347#define MX53_PAD_GPIO_8__GPIO1_8 (_MX53_PAD_GPIO_8__GPIO1_8 | MUX_PAD_CTRL(NO_PAD_CTRL))
2348#define MX53_PAD_GPIO_8__EPIT2_EPITO (_MX53_PAD_GPIO_8__EPIT2_EPITO | MUX_PAD_CTRL(NO_PAD_CTRL))
2349#define MX53_PAD_GPIO_8__CAN1_RXCAN (_MX53_PAD_GPIO_8__CAN1_RXCAN | MUX_PAD_CTRL(NO_PAD_CTRL))
2350#define MX53_PAD_GPIO_8__UART2_RXD_MUX (_MX53_PAD_GPIO_8__UART2_RXD_MUX | MUX_PAD_CTRL(NO_PAD_CTRL))
2351#define MX53_PAD_GPIO_8__FIRI_TXD (_MX53_PAD_GPIO_8__FIRI_TXD | MUX_PAD_CTRL(NO_PAD_CTRL))
2352#define MX53_PAD_GPIO_8__SPDIF_SRCLK (_MX53_PAD_GPIO_8__SPDIF_SRCLK | MUX_PAD_CTRL(NO_PAD_CTRL))
2353#define MX53_PAD_GPIO_8__CCM_PLL3_BYP (_MX53_PAD_GPIO_8__CCM_PLL3_BYP | MUX_PAD_CTRL(NO_PAD_CTRL))
2354#define MX53_PAD_GPIO_16__ESAI1_TX3_RX2 (_MX53_PAD_GPIO_16__ESAI1_TX3_RX2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2355#define MX53_PAD_GPIO_16__GPIO7_11 (_MX53_PAD_GPIO_16__GPIO7_11 | MUX_PAD_CTRL(NO_PAD_CTRL))
2356#define MX53_PAD_GPIO_16__TZIC_PWRFAIL_INT (_MX53_PAD_GPIO_16__TZIC_PWRFAIL_INT | MUX_PAD_CTRL(NO_PAD_CTRL))
2357#define MX53_PAD_GPIO_16__RTC_CE_RTC_EXT_TRIG1 (_MX53_PAD_GPIO_16__RTC_CE_RTC_EXT_TRIG1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2358#define MX53_PAD_GPIO_16__SPDIF_IN1 (_MX53_PAD_GPIO_16__SPDIF_IN1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2359#define MX53_PAD_GPIO_16__I2C3_SDA (_MX53_PAD_GPIO_16__I2C3_SDA | MUX_PAD_CTRL(NO_PAD_CTRL))
2360#define MX53_PAD_GPIO_16__SJC_DE_B (_MX53_PAD_GPIO_16__SJC_DE_B | MUX_PAD_CTRL(NO_PAD_CTRL))
2361#define MX53_PAD_GPIO_17__ESAI1_TX0 (_MX53_PAD_GPIO_17__ESAI1_TX0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2362#define MX53_PAD_GPIO_17__GPIO7_12 (_MX53_PAD_GPIO_17__GPIO7_12 | MUX_PAD_CTRL(NO_PAD_CTRL))
2363#define MX53_PAD_GPIO_17__SDMA_EXT_EVENT_0 (_MX53_PAD_GPIO_17__SDMA_EXT_EVENT_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
2364#define MX53_PAD_GPIO_17__GPC_PMIC_RDY (_MX53_PAD_GPIO_17__GPC_PMIC_RDY | MUX_PAD_CTRL(NO_PAD_CTRL))
2365#define MX53_PAD_GPIO_17__RTC_CE_RTC_FSV_TRIG (_MX53_PAD_GPIO_17__RTC_CE_RTC_FSV_TRIG | MUX_PAD_CTRL(NO_PAD_CTRL))
2366#define MX53_PAD_GPIO_17__SPDIF_OUT1 (_MX53_PAD_GPIO_17__SPDIF_OUT1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2367#define MX53_PAD_GPIO_17__IPU_SNOOP2 (_MX53_PAD_GPIO_17__IPU_SNOOP2 | MUX_PAD_CTRL(NO_PAD_CTRL))
2368#define MX53_PAD_GPIO_17__SJC_JTAG_ACT (_MX53_PAD_GPIO_17__SJC_JTAG_ACT | MUX_PAD_CTRL(NO_PAD_CTRL))
2369#define MX53_PAD_GPIO_18__ESAI1_TX1 (_MX53_PAD_GPIO_18__ESAI1_TX1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2370#define MX53_PAD_GPIO_18__GPIO7_13 (_MX53_PAD_GPIO_18__GPIO7_13 | MUX_PAD_CTRL(NO_PAD_CTRL))
2371#define MX53_PAD_GPIO_18__SDMA_EXT_EVENT_1 (_MX53_PAD_GPIO_18__SDMA_EXT_EVENT_1 | MUX_PAD_CTRL(NO_PAD_CTRL))
2372#define MX53_PAD_GPIO_18__OWIRE_LINE (_MX53_PAD_GPIO_18__OWIRE_LINE | MUX_PAD_CTRL(NO_PAD_CTRL))
2373#define MX53_PAD_GPIO_18__RTC_CE_RTC_ALARM2_TRIG (_MX53_PAD_GPIO_18__RTC_CE_RTC_ALARM2_TRIG | MUX_PAD_CTRL(NO_PAD_CTRL))
2374#define MX53_PAD_GPIO_18__CCM_ASRC_EXT_CLK (_MX53_PAD_GPIO_18__CCM_ASRC_EXT_CLK | MUX_PAD_CTRL(NO_PAD_CTRL))
2375#define MX53_PAD_GPIO_18__ESDHC1_LCTL (_MX53_PAD_GPIO_18__ESDHC1_LCTL | MUX_PAD_CTRL(NO_PAD_CTRL))
2376#define MX53_PAD_GPIO_18__SRC_SYSTEM_RST (_MX53_PAD_GPIO_18__SRC_SYSTEM_RST | MUX_PAD_CTRL(NO_PAD_CTRL))
324 2377
325#endif /* __MACH_IOMUX_MX53_H__ */ 2378#endif /* __MACH_IOMUX_MX53_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mxc91231.h b/arch/arm/plat-mxc/include/mach/iomux-mxc91231.h
index 15d59510f597..bf28df0d58b7 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mxc91231.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mxc91231.h
@@ -46,12 +46,12 @@
46 * - setups the iomux according to the configuration 46 * - setups the iomux according to the configuration
47 * - if the pin is configured as a GPIO, we claim it through kernel gpiolib 47 * - if the pin is configured as a GPIO, we claim it through kernel gpiolib
48 */ 48 */
49int mxc_iomux_alloc_pin(const unsigned int pin_mode, const char *label); 49int mxc_iomux_alloc_pin(unsigned int pin_mode, const char *label);
50/* 50/*
51 * setups mutliple pins 51 * setups mutliple pins
52 * convenient way to call the above function with tables 52 * convenient way to call the above function with tables
53 */ 53 */
54int mxc_iomux_setup_multiple_pins(unsigned int *pin_list, unsigned count, 54int mxc_iomux_setup_multiple_pins(const unsigned int *pin_list, unsigned count,
55 const char *label); 55 const char *label);
56 56
57/* 57/*
@@ -60,12 +60,12 @@ int mxc_iomux_setup_multiple_pins(unsigned int *pin_list, unsigned count,
60 * - frees the GPIO if the pin was configured as GPIO 60 * - frees the GPIO if the pin was configured as GPIO
61 * - DOES NOT reconfigure the IOMUX in its reset state 61 * - DOES NOT reconfigure the IOMUX in its reset state
62 */ 62 */
63void mxc_iomux_release_pin(const unsigned int pin_mode); 63void mxc_iomux_release_pin(unsigned int pin_mode);
64/* 64/*
65 * releases multiple pins 65 * releases multiple pins
66 * convenvient way to call the above function with tables 66 * convenvient way to call the above function with tables
67 */ 67 */
68void mxc_iomux_release_multiple_pins(unsigned int *pin_list, int count); 68void mxc_iomux_release_multiple_pins(const unsigned int *pin_list, int count);
69 69
70#define MUX_SIDE_AP (0) 70#define MUX_SIDE_AP (0)
71#define MUX_SIDE_SP (1) 71#define MUX_SIDE_SP (1)
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v1.h b/arch/arm/plat-mxc/include/mach/iomux-v1.h
index 884f5753f279..c07d30210c57 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-v1.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-v1.h
@@ -100,4 +100,6 @@ extern int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
100 const char *label); 100 const char *label);
101extern void mxc_gpio_release_multiple_pins(const int *pin_list, int count); 101extern void mxc_gpio_release_multiple_pins(const int *pin_list, int count);
102 102
103extern int __init imx_iomuxv1_init(void __iomem *base, int numports);
104
103#endif /* __MACH_IOMUX_V1_H__ */ 105#endif /* __MACH_IOMUX_V1_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/irqs.h b/arch/arm/plat-mxc/include/mach/irqs.h
index ba65c9231a78..a3d930d3e65d 100644
--- a/arch/arm/plat-mxc/include/mach/irqs.h
+++ b/arch/arm/plat-mxc/include/mach/irqs.h
@@ -23,17 +23,17 @@
23#define MXC_GPIO_IRQ_START MXC_INTERNAL_IRQS 23#define MXC_GPIO_IRQ_START MXC_INTERNAL_IRQS
24 24
25/* these are ordered by size to support multi-SoC kernels */ 25/* these are ordered by size to support multi-SoC kernels */
26#if defined CONFIG_ARCH_MX53 26#if defined CONFIG_SOC_IMX53
27#define MXC_GPIO_IRQS (32 * 7) 27#define MXC_GPIO_IRQS (32 * 7)
28#elif defined CONFIG_ARCH_MX2 28#elif defined CONFIG_ARCH_MX2
29#define MXC_GPIO_IRQS (32 * 6) 29#define MXC_GPIO_IRQS (32 * 6)
30#elif defined CONFIG_ARCH_MX50 30#elif defined CONFIG_SOC_IMX50
31#define MXC_GPIO_IRQS (32 * 6) 31#define MXC_GPIO_IRQS (32 * 6)
32#elif defined CONFIG_ARCH_MX1 32#elif defined CONFIG_ARCH_MX1
33#define MXC_GPIO_IRQS (32 * 4) 33#define MXC_GPIO_IRQS (32 * 4)
34#elif defined CONFIG_ARCH_MX25 34#elif defined CONFIG_ARCH_MX25
35#define MXC_GPIO_IRQS (32 * 4) 35#define MXC_GPIO_IRQS (32 * 4)
36#elif defined CONFIG_ARCH_MX51 36#elif defined CONFIG_SOC_IMX51
37#define MXC_GPIO_IRQS (32 * 4) 37#define MXC_GPIO_IRQS (32 * 4)
38#elif defined CONFIG_ARCH_MXC91231 38#elif defined CONFIG_ARCH_MXC91231
39#define MXC_GPIO_IRQS (32 * 4) 39#define MXC_GPIO_IRQS (32 * 4)
diff --git a/arch/arm/plat-mxc/include/mach/memory.h b/arch/arm/plat-mxc/include/mach/memory.h
index 83861408133f..5d51cbb98893 100644
--- a/arch/arm/plat-mxc/include/mach/memory.h
+++ b/arch/arm/plat-mxc/include/mach/memory.h
@@ -23,23 +23,23 @@
23 23
24#if !defined(CONFIG_RUNTIME_PHYS_OFFSET) 24#if !defined(CONFIG_RUNTIME_PHYS_OFFSET)
25# if defined CONFIG_ARCH_MX1 25# if defined CONFIG_ARCH_MX1
26# define PHYS_OFFSET MX1_PHYS_OFFSET 26# define PLAT_PHYS_OFFSET MX1_PHYS_OFFSET
27# elif defined CONFIG_MACH_MX21 27# elif defined CONFIG_MACH_MX21
28# define PHYS_OFFSET MX21_PHYS_OFFSET 28# define PLAT_PHYS_OFFSET MX21_PHYS_OFFSET
29# elif defined CONFIG_ARCH_MX25 29# elif defined CONFIG_ARCH_MX25
30# define PHYS_OFFSET MX25_PHYS_OFFSET 30# define PLAT_PHYS_OFFSET MX25_PHYS_OFFSET
31# elif defined CONFIG_MACH_MX27 31# elif defined CONFIG_MACH_MX27
32# define PHYS_OFFSET MX27_PHYS_OFFSET 32# define PLAT_PHYS_OFFSET MX27_PHYS_OFFSET
33# elif defined CONFIG_ARCH_MX3 33# elif defined CONFIG_ARCH_MX3
34# define PHYS_OFFSET MX3x_PHYS_OFFSET 34# define PLAT_PHYS_OFFSET MX3x_PHYS_OFFSET
35# elif defined CONFIG_ARCH_MXC91231 35# elif defined CONFIG_ARCH_MXC91231
36# define PHYS_OFFSET MXC91231_PHYS_OFFSET 36# define PLAT_PHYS_OFFSET MXC91231_PHYS_OFFSET
37# elif defined CONFIG_ARCH_MX50 37# elif defined CONFIG_ARCH_MX50
38# define PHYS_OFFSET MX50_PHYS_OFFSET 38# define PLAT_PHYS_OFFSET MX50_PHYS_OFFSET
39# elif defined CONFIG_ARCH_MX51 39# elif defined CONFIG_ARCH_MX51
40# define PHYS_OFFSET MX51_PHYS_OFFSET 40# define PLAT_PHYS_OFFSET MX51_PHYS_OFFSET
41# elif defined CONFIG_ARCH_MX53 41# elif defined CONFIG_ARCH_MX53
42# define PHYS_OFFSET MX53_PHYS_OFFSET 42# define PLAT_PHYS_OFFSET MX53_PHYS_OFFSET
43# endif 43# endif
44#endif 44#endif
45 45
diff --git a/arch/arm/plat-mxc/include/mach/mx1.h b/arch/arm/plat-mxc/include/mach/mx1.h
index 75d96214b831..97b19e7800bc 100644
--- a/arch/arm/plat-mxc/include/mach/mx1.h
+++ b/arch/arm/plat-mxc/include/mach/mx1.h
@@ -54,13 +54,13 @@
54#define MX1_AIPI2_BASE_ADDR (0x10000 + MX1_IO_BASE_ADDR) 54#define MX1_AIPI2_BASE_ADDR (0x10000 + MX1_IO_BASE_ADDR)
55#define MX1_SIM_BASE_ADDR (0x11000 + MX1_IO_BASE_ADDR) 55#define MX1_SIM_BASE_ADDR (0x11000 + MX1_IO_BASE_ADDR)
56#define MX1_USBD_BASE_ADDR (0x12000 + MX1_IO_BASE_ADDR) 56#define MX1_USBD_BASE_ADDR (0x12000 + MX1_IO_BASE_ADDR)
57#define MX1_SPI1_BASE_ADDR (0x13000 + MX1_IO_BASE_ADDR) 57#define MX1_CSPI1_BASE_ADDR (0x13000 + MX1_IO_BASE_ADDR)
58#define MX1_MMC_BASE_ADDR (0x14000 + MX1_IO_BASE_ADDR) 58#define MX1_MMC_BASE_ADDR (0x14000 + MX1_IO_BASE_ADDR)
59#define MX1_ASP_BASE_ADDR (0x15000 + MX1_IO_BASE_ADDR) 59#define MX1_ASP_BASE_ADDR (0x15000 + MX1_IO_BASE_ADDR)
60#define MX1_BTA_BASE_ADDR (0x16000 + MX1_IO_BASE_ADDR) 60#define MX1_BTA_BASE_ADDR (0x16000 + MX1_IO_BASE_ADDR)
61#define MX1_I2C_BASE_ADDR (0x17000 + MX1_IO_BASE_ADDR) 61#define MX1_I2C_BASE_ADDR (0x17000 + MX1_IO_BASE_ADDR)
62#define MX1_SSI_BASE_ADDR (0x18000 + MX1_IO_BASE_ADDR) 62#define MX1_SSI_BASE_ADDR (0x18000 + MX1_IO_BASE_ADDR)
63#define MX1_SPI2_BASE_ADDR (0x19000 + MX1_IO_BASE_ADDR) 63#define MX1_CSPI2_BASE_ADDR (0x19000 + MX1_IO_BASE_ADDR)
64#define MX1_MSHC_BASE_ADDR (0x1A000 + MX1_IO_BASE_ADDR) 64#define MX1_MSHC_BASE_ADDR (0x1A000 + MX1_IO_BASE_ADDR)
65#define MX1_CCM_BASE_ADDR (0x1B000 + MX1_IO_BASE_ADDR) 65#define MX1_CCM_BASE_ADDR (0x1B000 + MX1_IO_BASE_ADDR)
66#define MX1_SCM_BASE_ADDR (0x1B804 + MX1_IO_BASE_ADDR) 66#define MX1_SCM_BASE_ADDR (0x1B804 + MX1_IO_BASE_ADDR)
@@ -89,7 +89,7 @@
89#define MX1_GPIO_INT_PORTA 11 89#define MX1_GPIO_INT_PORTA 11
90#define MX1_GPIO_INT_PORTB 12 90#define MX1_GPIO_INT_PORTB 12
91#define MX1_GPIO_INT_PORTC 13 91#define MX1_GPIO_INT_PORTC 13
92#define MX1_LCDC_INT 14 92#define MX1_INT_LCDC 14
93#define MX1_SIM_INT 15 93#define MX1_SIM_INT 15
94#define MX1_SIM_DATA_INT 16 94#define MX1_SIM_DATA_INT 16
95#define MX1_RTC_INT 17 95#define MX1_RTC_INT 17
@@ -112,7 +112,8 @@
112#define MX1_PWM_INT 34 112#define MX1_PWM_INT 34
113#define MX1_SDHC_INT 35 113#define MX1_SDHC_INT 35
114#define MX1_INT_I2C 39 114#define MX1_INT_I2C 39
115#define MX1_CSPI_INT 41 115#define MX1_INT_CSPI2 40
116#define MX1_INT_CSPI1 41
116#define MX1_SSI_TX_INT 42 117#define MX1_SSI_TX_INT 42
117#define MX1_SSI_TX_ERR_INT 43 118#define MX1_SSI_TX_ERR_INT 43
118#define MX1_SSI_RX_INT 44 119#define MX1_SSI_RX_INT 44
diff --git a/arch/arm/plat-mxc/include/mach/mx53.h b/arch/arm/plat-mxc/include/mach/mx53.h
index d7a8e52181ea..ace17864575e 100644
--- a/arch/arm/plat-mxc/include/mach/mx53.h
+++ b/arch/arm/plat-mxc/include/mach/mx53.h
@@ -79,7 +79,7 @@
79#define MX53_GPIO3_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x0008C000) 79#define MX53_GPIO3_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x0008C000)
80#define MX53_GPIO4_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x00090000) 80#define MX53_GPIO4_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x00090000)
81#define MX53_KPP_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x00094000) 81#define MX53_KPP_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x00094000)
82#define MX53_WDOG_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x00098000) 82#define MX53_WDOG1_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x00098000)
83#define MX53_WDOG2_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x0009C000) 83#define MX53_WDOG2_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x0009C000)
84#define MX53_GPT1_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000A0000) 84#define MX53_GPT1_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000A0000)
85#define MX53_SRTC_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000A4000) 85#define MX53_SRTC_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000A4000)
diff --git a/arch/arm/plat-mxc/include/mach/mxc.h b/arch/arm/plat-mxc/include/mach/mxc.h
index 04c7a26b1f26..7e072637eefa 100644
--- a/arch/arm/plat-mxc/include/mach/mxc.h
+++ b/arch/arm/plat-mxc/include/mach/mxc.h
@@ -103,7 +103,7 @@ extern unsigned int __mxc_cpu_type;
103# define cpu_is_mx27() (0) 103# define cpu_is_mx27() (0)
104#endif 104#endif
105 105
106#ifdef CONFIG_ARCH_MX31 106#ifdef CONFIG_SOC_IMX31
107# ifdef mxc_cpu_type 107# ifdef mxc_cpu_type
108# undef mxc_cpu_type 108# undef mxc_cpu_type
109# define mxc_cpu_type __mxc_cpu_type 109# define mxc_cpu_type __mxc_cpu_type
@@ -115,7 +115,7 @@ extern unsigned int __mxc_cpu_type;
115# define cpu_is_mx31() (0) 115# define cpu_is_mx31() (0)
116#endif 116#endif
117 117
118#ifdef CONFIG_ARCH_MX35 118#ifdef CONFIG_SOC_IMX35
119# ifdef mxc_cpu_type 119# ifdef mxc_cpu_type
120# undef mxc_cpu_type 120# undef mxc_cpu_type
121# define mxc_cpu_type __mxc_cpu_type 121# define mxc_cpu_type __mxc_cpu_type
@@ -127,7 +127,7 @@ extern unsigned int __mxc_cpu_type;
127# define cpu_is_mx35() (0) 127# define cpu_is_mx35() (0)
128#endif 128#endif
129 129
130#ifdef CONFIG_ARCH_MX50 130#ifdef CONFIG_SOC_IMX50
131# ifdef mxc_cpu_type 131# ifdef mxc_cpu_type
132# undef mxc_cpu_type 132# undef mxc_cpu_type
133# define mxc_cpu_type __mxc_cpu_type 133# define mxc_cpu_type __mxc_cpu_type
@@ -139,7 +139,7 @@ extern unsigned int __mxc_cpu_type;
139# define cpu_is_mx50() (0) 139# define cpu_is_mx50() (0)
140#endif 140#endif
141 141
142#ifdef CONFIG_ARCH_MX51 142#ifdef CONFIG_SOC_IMX51
143# ifdef mxc_cpu_type 143# ifdef mxc_cpu_type
144# undef mxc_cpu_type 144# undef mxc_cpu_type
145# define mxc_cpu_type __mxc_cpu_type 145# define mxc_cpu_type __mxc_cpu_type
@@ -151,7 +151,7 @@ extern unsigned int __mxc_cpu_type;
151# define cpu_is_mx51() (0) 151# define cpu_is_mx51() (0)
152#endif 152#endif
153 153
154#ifdef CONFIG_ARCH_MX53 154#ifdef CONFIG_SOC_IMX53
155# ifdef mxc_cpu_type 155# ifdef mxc_cpu_type
156# undef mxc_cpu_type 156# undef mxc_cpu_type
157# define mxc_cpu_type __mxc_cpu_type 157# define mxc_cpu_type __mxc_cpu_type
diff --git a/arch/arm/plat-mxc/include/mach/mxc_ehci.h b/arch/arm/plat-mxc/include/mach/mxc_ehci.h
index a523a4079299..2c159dc2398b 100644
--- a/arch/arm/plat-mxc/include/mach/mxc_ehci.h
+++ b/arch/arm/plat-mxc/include/mach/mxc_ehci.h
@@ -44,11 +44,14 @@ struct mxc_usbh_platform_data {
44 int (*exit)(struct platform_device *pdev); 44 int (*exit)(struct platform_device *pdev);
45 45
46 unsigned int portsc; 46 unsigned int portsc;
47 unsigned int flags;
48 struct otg_transceiver *otg; 47 struct otg_transceiver *otg;
49}; 48};
50 49
51int mxc_initialize_usb_hw(int port, unsigned int flags); 50int mx51_initialize_usb_hw(int port, unsigned int flags);
51int mx25_initialize_usb_hw(int port, unsigned int flags);
52int mx31_initialize_usb_hw(int port, unsigned int flags);
53int mx35_initialize_usb_hw(int port, unsigned int flags);
54int mx27_initialize_usb_hw(int port, unsigned int flags);
52 55
53#endif /* __INCLUDE_ASM_ARCH_MXC_EHCI_H */ 56#endif /* __INCLUDE_ASM_ARCH_MXC_EHCI_H */
54 57
diff --git a/arch/arm/plat-mxc/include/mach/ulpi.h b/arch/arm/plat-mxc/include/mach/ulpi.h
index 96b6ab4c40c3..f9161c96d7bd 100644
--- a/arch/arm/plat-mxc/include/mach/ulpi.h
+++ b/arch/arm/plat-mxc/include/mach/ulpi.h
@@ -1,6 +1,15 @@
1#ifndef __MACH_ULPI_H 1#ifndef __MACH_ULPI_H
2#define __MACH_ULPI_H 2#define __MACH_ULPI_H
3 3
4#ifdef CONFIG_USB_ULPI
5struct otg_transceiver *imx_otg_ulpi_create(unsigned int flags);
6#else
7static inline struct otg_transceiver *imx_otg_ulpi_create(unsigned int flags)
8{
9 return NULL;
10}
11#endif
12
4extern struct otg_io_access_ops mxc_ulpi_access_ops; 13extern struct otg_io_access_ops mxc_ulpi_access_ops;
5 14
6#endif /* __MACH_ULPI_H */ 15#endif /* __MACH_ULPI_H */
diff --git a/arch/arm/plat-mxc/include/mach/uncompress.h b/arch/arm/plat-mxc/include/mach/uncompress.h
index 3a70ebf0477f..4864b0afd440 100644
--- a/arch/arm/plat-mxc/include/mach/uncompress.h
+++ b/arch/arm/plat-mxc/include/mach/uncompress.h
@@ -62,6 +62,7 @@ static inline void flush(void)
62#define MX2X_UART1_BASE_ADDR 0x1000a000 62#define MX2X_UART1_BASE_ADDR 0x1000a000
63#define MX3X_UART1_BASE_ADDR 0x43F90000 63#define MX3X_UART1_BASE_ADDR 0x43F90000
64#define MX3X_UART2_BASE_ADDR 0x43F94000 64#define MX3X_UART2_BASE_ADDR 0x43F94000
65#define MX3X_UART5_BASE_ADDR 0x43FB4000
65#define MX51_UART1_BASE_ADDR 0x73fbc000 66#define MX51_UART1_BASE_ADDR 0x73fbc000
66#define MX50_UART1_BASE_ADDR 0x53fbc000 67#define MX50_UART1_BASE_ADDR 0x53fbc000
67#define MX53_UART1_BASE_ADDR 0x53fbc000 68#define MX53_UART1_BASE_ADDR 0x53fbc000
@@ -83,6 +84,7 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
83 case MACH_TYPE_MX21ADS: 84 case MACH_TYPE_MX21ADS:
84 case MACH_TYPE_PCA100: 85 case MACH_TYPE_PCA100:
85 case MACH_TYPE_MXT_TD60: 86 case MACH_TYPE_MXT_TD60:
87 case MACH_TYPE_IMX27IPCAM:
86 uart_base = MX2X_UART1_BASE_ADDR; 88 uart_base = MX2X_UART1_BASE_ADDR;
87 break; 89 break;
88 case MACH_TYPE_MX31LITE: 90 case MACH_TYPE_MX31LITE:
@@ -95,19 +97,26 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
95 case MACH_TYPE_MX35_3DS: 97 case MACH_TYPE_MX35_3DS:
96 case MACH_TYPE_PCM043: 98 case MACH_TYPE_PCM043:
97 case MACH_TYPE_LILLY1131: 99 case MACH_TYPE_LILLY1131:
100 case MACH_TYPE_VPR200:
98 uart_base = MX3X_UART1_BASE_ADDR; 101 uart_base = MX3X_UART1_BASE_ADDR;
99 break; 102 break;
100 case MACH_TYPE_MAGX_ZN5: 103 case MACH_TYPE_MAGX_ZN5:
101 uart_base = MX3X_UART2_BASE_ADDR; 104 uart_base = MX3X_UART2_BASE_ADDR;
102 break; 105 break;
106 case MACH_TYPE_BUG:
107 uart_base = MX3X_UART5_BASE_ADDR;
108 break;
103 case MACH_TYPE_MX51_BABBAGE: 109 case MACH_TYPE_MX51_BABBAGE:
104 case MACH_TYPE_EUKREA_CPUIMX51SD: 110 case MACH_TYPE_EUKREA_CPUIMX51SD:
111 case MACH_TYPE_MX51_3DS:
105 uart_base = MX51_UART1_BASE_ADDR; 112 uart_base = MX51_UART1_BASE_ADDR;
106 break; 113 break;
107 case MACH_TYPE_MX50_RDP: 114 case MACH_TYPE_MX50_RDP:
108 uart_base = MX50_UART1_BASE_ADDR; 115 uart_base = MX50_UART1_BASE_ADDR;
109 break; 116 break;
110 case MACH_TYPE_MX53_EVK: 117 case MACH_TYPE_MX53_EVK:
118 case MACH_TYPE_MX53_LOCO:
119 case MACH_TYPE_MX53_SMD:
111 uart_base = MX53_UART1_BASE_ADDR; 120 uart_base = MX53_UART1_BASE_ADDR;
112 break; 121 break;
113 default: 122 default:
diff --git a/arch/arm/plat-mxc/iomux-v1.c b/arch/arm/plat-mxc/iomux-v1.c
index 960a02cbcbaf..3238c10d4e02 100644
--- a/arch/arm/plat-mxc/iomux-v1.c
+++ b/arch/arm/plat-mxc/iomux-v1.c
@@ -211,28 +211,10 @@ void mxc_gpio_release_multiple_pins(const int *pin_list, int count)
211} 211}
212EXPORT_SYMBOL(mxc_gpio_release_multiple_pins); 212EXPORT_SYMBOL(mxc_gpio_release_multiple_pins);
213 213
214static int imx_iomuxv1_init(void) 214int __init imx_iomuxv1_init(void __iomem *base, int numports)
215{ 215{
216#ifdef CONFIG_ARCH_MX1 216 imx_iomuxv1_baseaddr = base;
217 if (cpu_is_mx1()) { 217 imx_iomuxv1_numports = numports;
218 imx_iomuxv1_baseaddr = MX1_IO_ADDRESS(MX1_GPIO_BASE_ADDR);
219 imx_iomuxv1_numports = MX1_NUM_GPIO_PORT;
220 } else
221#endif
222#ifdef CONFIG_MACH_MX21
223 if (cpu_is_mx21()) {
224 imx_iomuxv1_baseaddr = MX21_IO_ADDRESS(MX21_GPIO_BASE_ADDR);
225 imx_iomuxv1_numports = MX21_NUM_GPIO_PORT;
226 } else
227#endif
228#ifdef CONFIG_MACH_MX27
229 if (cpu_is_mx27()) {
230 imx_iomuxv1_baseaddr = MX27_IO_ADDRESS(MX27_GPIO_BASE_ADDR);
231 imx_iomuxv1_numports = MX27_NUM_GPIO_PORT;
232 } else
233#endif
234 return -ENODEV;
235 218
236 return 0; 219 return 0;
237} 220}
238pure_initcall(imx_iomuxv1_init);
diff --git a/arch/arm/plat-mxc/ulpi.c b/arch/arm/plat-mxc/ulpi.c
index 582c6dfaba4a..477e45bea1be 100644
--- a/arch/arm/plat-mxc/ulpi.c
+++ b/arch/arm/plat-mxc/ulpi.c
@@ -22,6 +22,7 @@
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/usb/otg.h> 24#include <linux/usb/otg.h>
25#include <linux/usb/ulpi.h>
25 26
26#include <mach/ulpi.h> 27#include <mach/ulpi.h>
27 28
@@ -111,3 +112,7 @@ struct otg_io_access_ops mxc_ulpi_access_ops = {
111}; 112};
112EXPORT_SYMBOL_GPL(mxc_ulpi_access_ops); 113EXPORT_SYMBOL_GPL(mxc_ulpi_access_ops);
113 114
115struct otg_transceiver *imx_otg_ulpi_create(unsigned int flags)
116{
117 return otg_ulpi_create(&mxc_ulpi_access_ops, flags);
118}
diff --git a/arch/arm/plat-nomadik/gpio.c b/arch/arm/plat-nomadik/gpio.c
index 1e88ecb846d1..70620426ee55 100644
--- a/arch/arm/plat-nomadik/gpio.c
+++ b/arch/arm/plat-nomadik/gpio.c
@@ -30,23 +30,39 @@
30/* 30/*
31 * The GPIO module in the Nomadik family of Systems-on-Chip is an 31 * The GPIO module in the Nomadik family of Systems-on-Chip is an
32 * AMBA device, managing 32 pins and alternate functions. The logic block 32 * AMBA device, managing 32 pins and alternate functions. The logic block
33 * is currently only used in the Nomadik. 33 * is currently used in the Nomadik and ux500.
34 * 34 *
35 * Symbols in this file are called "nmk_gpio" for "nomadik gpio" 35 * Symbols in this file are called "nmk_gpio" for "nomadik gpio"
36 */ 36 */
37 37
38#define NMK_GPIO_PER_CHIP 32 38#define NMK_GPIO_PER_CHIP 32
39
39struct nmk_gpio_chip { 40struct nmk_gpio_chip {
40 struct gpio_chip chip; 41 struct gpio_chip chip;
41 void __iomem *addr; 42 void __iomem *addr;
42 struct clk *clk; 43 struct clk *clk;
44 unsigned int bank;
43 unsigned int parent_irq; 45 unsigned int parent_irq;
46 int secondary_parent_irq;
47 u32 (*get_secondary_status)(unsigned int bank);
48 void (*set_ioforce)(bool enable);
44 spinlock_t lock; 49 spinlock_t lock;
45 /* Keep track of configured edges */ 50 /* Keep track of configured edges */
46 u32 edge_rising; 51 u32 edge_rising;
47 u32 edge_falling; 52 u32 edge_falling;
53 u32 real_wake;
54 u32 rwimsc;
55 u32 fwimsc;
56 u32 slpm;
48}; 57};
49 58
59static struct nmk_gpio_chip *
60nmk_gpio_chips[DIV_ROUND_UP(ARCH_NR_GPIOS, NMK_GPIO_PER_CHIP)];
61
62static DEFINE_SPINLOCK(nmk_gpio_slpm_lock);
63
64#define NUM_BANKS ARRAY_SIZE(nmk_gpio_chips)
65
50static void __nmk_gpio_set_mode(struct nmk_gpio_chip *nmk_chip, 66static void __nmk_gpio_set_mode(struct nmk_gpio_chip *nmk_chip,
51 unsigned offset, int gpio_mode) 67 unsigned offset, int gpio_mode)
52{ 68{
@@ -118,8 +134,35 @@ static void __nmk_gpio_make_output(struct nmk_gpio_chip *nmk_chip,
118 __nmk_gpio_set_output(nmk_chip, offset, val); 134 __nmk_gpio_set_output(nmk_chip, offset, val);
119} 135}
120 136
137static void __nmk_gpio_set_mode_safe(struct nmk_gpio_chip *nmk_chip,
138 unsigned offset, int gpio_mode,
139 bool glitch)
140{
141 u32 rwimsc = readl(nmk_chip->addr + NMK_GPIO_RWIMSC);
142 u32 fwimsc = readl(nmk_chip->addr + NMK_GPIO_FWIMSC);
143
144 if (glitch && nmk_chip->set_ioforce) {
145 u32 bit = BIT(offset);
146
147 /* Prevent spurious wakeups */
148 writel(rwimsc & ~bit, nmk_chip->addr + NMK_GPIO_RWIMSC);
149 writel(fwimsc & ~bit, nmk_chip->addr + NMK_GPIO_FWIMSC);
150
151 nmk_chip->set_ioforce(true);
152 }
153
154 __nmk_gpio_set_mode(nmk_chip, offset, gpio_mode);
155
156 if (glitch && nmk_chip->set_ioforce) {
157 nmk_chip->set_ioforce(false);
158
159 writel(rwimsc, nmk_chip->addr + NMK_GPIO_RWIMSC);
160 writel(fwimsc, nmk_chip->addr + NMK_GPIO_FWIMSC);
161 }
162}
163
121static void __nmk_config_pin(struct nmk_gpio_chip *nmk_chip, unsigned offset, 164static void __nmk_config_pin(struct nmk_gpio_chip *nmk_chip, unsigned offset,
122 pin_cfg_t cfg, bool sleep) 165 pin_cfg_t cfg, bool sleep, unsigned int *slpmregs)
123{ 166{
124 static const char *afnames[] = { 167 static const char *afnames[] = {
125 [NMK_GPIO_ALT_GPIO] = "GPIO", 168 [NMK_GPIO_ALT_GPIO] = "GPIO",
@@ -144,6 +187,7 @@ static void __nmk_config_pin(struct nmk_gpio_chip *nmk_chip, unsigned offset,
144 int slpm = PIN_SLPM(cfg); 187 int slpm = PIN_SLPM(cfg);
145 int output = PIN_DIR(cfg); 188 int output = PIN_DIR(cfg);
146 int val = PIN_VAL(cfg); 189 int val = PIN_VAL(cfg);
190 bool glitch = af == NMK_GPIO_ALT_C;
147 191
148 dev_dbg(nmk_chip->chip.dev, "pin %d [%#lx]: af %s, pull %s, slpm %s (%s%s)\n", 192 dev_dbg(nmk_chip->chip.dev, "pin %d [%#lx]: af %s, pull %s, slpm %s (%s%s)\n",
149 pin, cfg, afnames[af], pullnames[pull], slpmnames[slpm], 193 pin, cfg, afnames[af], pullnames[pull], slpmnames[slpm],
@@ -155,6 +199,8 @@ static void __nmk_config_pin(struct nmk_gpio_chip *nmk_chip, unsigned offset,
155 int slpm_output = PIN_SLPM_DIR(cfg); 199 int slpm_output = PIN_SLPM_DIR(cfg);
156 int slpm_val = PIN_SLPM_VAL(cfg); 200 int slpm_val = PIN_SLPM_VAL(cfg);
157 201
202 af = NMK_GPIO_ALT_GPIO;
203
158 /* 204 /*
159 * The SLPM_* values are normal values + 1 to allow zero to 205 * The SLPM_* values are normal values + 1 to allow zero to
160 * mean "same as normal". 206 * mean "same as normal".
@@ -180,8 +226,116 @@ static void __nmk_config_pin(struct nmk_gpio_chip *nmk_chip, unsigned offset,
180 __nmk_gpio_set_pull(nmk_chip, offset, pull); 226 __nmk_gpio_set_pull(nmk_chip, offset, pull);
181 } 227 }
182 228
183 __nmk_gpio_set_slpm(nmk_chip, offset, slpm); 229 /*
184 __nmk_gpio_set_mode(nmk_chip, offset, af); 230 * If we've backed up the SLPM registers (glitch workaround), modify
231 * the backups since they will be restored.
232 */
233 if (slpmregs) {
234 if (slpm == NMK_GPIO_SLPM_NOCHANGE)
235 slpmregs[nmk_chip->bank] |= BIT(offset);
236 else
237 slpmregs[nmk_chip->bank] &= ~BIT(offset);
238 } else
239 __nmk_gpio_set_slpm(nmk_chip, offset, slpm);
240
241 __nmk_gpio_set_mode_safe(nmk_chip, offset, af, glitch);
242}
243
244/*
245 * Safe sequence used to switch IOs between GPIO and Alternate-C mode:
246 * - Save SLPM registers
247 * - Set SLPM=0 for the IOs you want to switch and others to 1
248 * - Configure the GPIO registers for the IOs that are being switched
249 * - Set IOFORCE=1
250 * - Modify the AFLSA/B registers for the IOs that are being switched
251 * - Set IOFORCE=0
252 * - Restore SLPM registers
253 * - Any spurious wake up event during switch sequence to be ignored and
254 * cleared
255 */
256static void nmk_gpio_glitch_slpm_init(unsigned int *slpm)
257{
258 int i;
259
260 for (i = 0; i < NUM_BANKS; i++) {
261 struct nmk_gpio_chip *chip = nmk_gpio_chips[i];
262 unsigned int temp = slpm[i];
263
264 if (!chip)
265 break;
266
267 slpm[i] = readl(chip->addr + NMK_GPIO_SLPC);
268 writel(temp, chip->addr + NMK_GPIO_SLPC);
269 }
270}
271
272static void nmk_gpio_glitch_slpm_restore(unsigned int *slpm)
273{
274 int i;
275
276 for (i = 0; i < NUM_BANKS; i++) {
277 struct nmk_gpio_chip *chip = nmk_gpio_chips[i];
278
279 if (!chip)
280 break;
281
282 writel(slpm[i], chip->addr + NMK_GPIO_SLPC);
283 }
284}
285
286static int __nmk_config_pins(pin_cfg_t *cfgs, int num, bool sleep)
287{
288 static unsigned int slpm[NUM_BANKS];
289 unsigned long flags;
290 bool glitch = false;
291 int ret = 0;
292 int i;
293
294 for (i = 0; i < num; i++) {
295 if (PIN_ALT(cfgs[i]) == NMK_GPIO_ALT_C) {
296 glitch = true;
297 break;
298 }
299 }
300
301 spin_lock_irqsave(&nmk_gpio_slpm_lock, flags);
302
303 if (glitch) {
304 memset(slpm, 0xff, sizeof(slpm));
305
306 for (i = 0; i < num; i++) {
307 int pin = PIN_NUM(cfgs[i]);
308 int offset = pin % NMK_GPIO_PER_CHIP;
309
310 if (PIN_ALT(cfgs[i]) == NMK_GPIO_ALT_C)
311 slpm[pin / NMK_GPIO_PER_CHIP] &= ~BIT(offset);
312 }
313
314 nmk_gpio_glitch_slpm_init(slpm);
315 }
316
317 for (i = 0; i < num; i++) {
318 struct nmk_gpio_chip *nmk_chip;
319 int pin = PIN_NUM(cfgs[i]);
320
321 nmk_chip = get_irq_chip_data(NOMADIK_GPIO_TO_IRQ(pin));
322 if (!nmk_chip) {
323 ret = -EINVAL;
324 break;
325 }
326
327 spin_lock(&nmk_chip->lock);
328 __nmk_config_pin(nmk_chip, pin - nmk_chip->chip.base,
329 cfgs[i], sleep, glitch ? slpm : NULL);
330 spin_unlock(&nmk_chip->lock);
331 }
332
333 if (glitch)
334 nmk_gpio_glitch_slpm_restore(slpm);
335
336 spin_unlock_irqrestore(&nmk_gpio_slpm_lock, flags);
337
338 return ret;
185} 339}
186 340
187/** 341/**
@@ -200,19 +354,7 @@ static void __nmk_config_pin(struct nmk_gpio_chip *nmk_chip, unsigned offset,
200 */ 354 */
201int nmk_config_pin(pin_cfg_t cfg, bool sleep) 355int nmk_config_pin(pin_cfg_t cfg, bool sleep)
202{ 356{
203 struct nmk_gpio_chip *nmk_chip; 357 return __nmk_config_pins(&cfg, 1, sleep);
204 int gpio = PIN_NUM(cfg);
205 unsigned long flags;
206
207 nmk_chip = get_irq_chip_data(NOMADIK_GPIO_TO_IRQ(gpio));
208 if (!nmk_chip)
209 return -EINVAL;
210
211 spin_lock_irqsave(&nmk_chip->lock, flags);
212 __nmk_config_pin(nmk_chip, gpio - nmk_chip->chip.base, cfg, sleep);
213 spin_unlock_irqrestore(&nmk_chip->lock, flags);
214
215 return 0;
216} 358}
217EXPORT_SYMBOL(nmk_config_pin); 359EXPORT_SYMBOL(nmk_config_pin);
218 360
@@ -226,31 +368,13 @@ EXPORT_SYMBOL(nmk_config_pin);
226 */ 368 */
227int nmk_config_pins(pin_cfg_t *cfgs, int num) 369int nmk_config_pins(pin_cfg_t *cfgs, int num)
228{ 370{
229 int ret = 0; 371 return __nmk_config_pins(cfgs, num, false);
230 int i;
231
232 for (i = 0; i < num; i++) {
233 ret = nmk_config_pin(cfgs[i], false);
234 if (ret)
235 break;
236 }
237
238 return ret;
239} 372}
240EXPORT_SYMBOL(nmk_config_pins); 373EXPORT_SYMBOL(nmk_config_pins);
241 374
242int nmk_config_pins_sleep(pin_cfg_t *cfgs, int num) 375int nmk_config_pins_sleep(pin_cfg_t *cfgs, int num)
243{ 376{
244 int ret = 0; 377 return __nmk_config_pins(cfgs, num, true);
245 int i;
246
247 for (i = 0; i < num; i++) {
248 ret = nmk_config_pin(cfgs[i], true);
249 if (ret)
250 break;
251 }
252
253 return ret;
254} 378}
255EXPORT_SYMBOL(nmk_config_pins_sleep); 379EXPORT_SYMBOL(nmk_config_pins_sleep);
256 380
@@ -277,9 +401,13 @@ int nmk_gpio_set_slpm(int gpio, enum nmk_gpio_slpm mode)
277 if (!nmk_chip) 401 if (!nmk_chip)
278 return -EINVAL; 402 return -EINVAL;
279 403
280 spin_lock_irqsave(&nmk_chip->lock, flags); 404 spin_lock_irqsave(&nmk_gpio_slpm_lock, flags);
405 spin_lock(&nmk_chip->lock);
406
281 __nmk_gpio_set_slpm(nmk_chip, gpio - nmk_chip->chip.base, mode); 407 __nmk_gpio_set_slpm(nmk_chip, gpio - nmk_chip->chip.base, mode);
282 spin_unlock_irqrestore(&nmk_chip->lock, flags); 408
409 spin_unlock(&nmk_chip->lock);
410 spin_unlock_irqrestore(&nmk_gpio_slpm_lock, flags);
283 411
284 return 0; 412 return 0;
285} 413}
@@ -314,6 +442,15 @@ int nmk_gpio_set_pull(int gpio, enum nmk_gpio_pull pull)
314} 442}
315 443
316/* Mode functions */ 444/* Mode functions */
445/**
446 * nmk_gpio_set_mode() - set the mux mode of a gpio pin
447 * @gpio: pin number
448 * @gpio_mode: one of NMK_GPIO_ALT_GPIO, NMK_GPIO_ALT_A,
449 * NMK_GPIO_ALT_B, and NMK_GPIO_ALT_C
450 *
451 * Sets the mode of the specified pin to one of the alternate functions or
452 * plain GPIO.
453 */
317int nmk_gpio_set_mode(int gpio, int gpio_mode) 454int nmk_gpio_set_mode(int gpio, int gpio_mode)
318{ 455{
319 struct nmk_gpio_chip *nmk_chip; 456 struct nmk_gpio_chip *nmk_chip;
@@ -401,8 +538,20 @@ static void __nmk_gpio_irq_modify(struct nmk_gpio_chip *nmk_chip,
401 } 538 }
402} 539}
403 540
404static int nmk_gpio_irq_modify(struct irq_data *d, enum nmk_gpio_irq_type which, 541static void __nmk_gpio_set_wake(struct nmk_gpio_chip *nmk_chip,
405 bool enable) 542 int gpio, bool on)
543{
544#ifdef CONFIG_ARCH_U8500
545 if (cpu_is_u8500v2()) {
546 __nmk_gpio_set_slpm(nmk_chip, gpio - nmk_chip->chip.base,
547 on ? NMK_GPIO_SLPM_WAKEUP_ENABLE
548 : NMK_GPIO_SLPM_WAKEUP_DISABLE);
549 }
550#endif
551 __nmk_gpio_irq_modify(nmk_chip, gpio, WAKE, on);
552}
553
554static int nmk_gpio_irq_maskunmask(struct irq_data *d, bool enable)
406{ 555{
407 int gpio; 556 int gpio;
408 struct nmk_gpio_chip *nmk_chip; 557 struct nmk_gpio_chip *nmk_chip;
@@ -415,44 +564,58 @@ static int nmk_gpio_irq_modify(struct irq_data *d, enum nmk_gpio_irq_type which,
415 if (!nmk_chip) 564 if (!nmk_chip)
416 return -EINVAL; 565 return -EINVAL;
417 566
418 spin_lock_irqsave(&nmk_chip->lock, flags); 567 spin_lock_irqsave(&nmk_gpio_slpm_lock, flags);
419 __nmk_gpio_irq_modify(nmk_chip, gpio, which, enable); 568 spin_lock(&nmk_chip->lock);
420 spin_unlock_irqrestore(&nmk_chip->lock, flags); 569
570 __nmk_gpio_irq_modify(nmk_chip, gpio, NORMAL, enable);
571
572 if (!(nmk_chip->real_wake & bitmask))
573 __nmk_gpio_set_wake(nmk_chip, gpio, enable);
574
575 spin_unlock(&nmk_chip->lock);
576 spin_unlock_irqrestore(&nmk_gpio_slpm_lock, flags);
421 577
422 return 0; 578 return 0;
423} 579}
424 580
425static void nmk_gpio_irq_mask(struct irq_data *d) 581static void nmk_gpio_irq_mask(struct irq_data *d)
426{ 582{
427 nmk_gpio_irq_modify(d, NORMAL, false); 583 nmk_gpio_irq_maskunmask(d, false);
428} 584}
429 585
430static void nmk_gpio_irq_unmask(struct irq_data *d) 586static void nmk_gpio_irq_unmask(struct irq_data *d)
431{ 587{
432 nmk_gpio_irq_modify(d, NORMAL, true); 588 nmk_gpio_irq_maskunmask(d, true);
433} 589}
434 590
435static int nmk_gpio_irq_set_wake(struct irq_data *d, unsigned int on) 591static int nmk_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
436{ 592{
593 struct irq_desc *desc = irq_to_desc(d->irq);
594 bool enabled = !(desc->status & IRQ_DISABLED);
437 struct nmk_gpio_chip *nmk_chip; 595 struct nmk_gpio_chip *nmk_chip;
438 unsigned long flags; 596 unsigned long flags;
597 u32 bitmask;
439 int gpio; 598 int gpio;
440 599
441 gpio = NOMADIK_IRQ_TO_GPIO(d->irq); 600 gpio = NOMADIK_IRQ_TO_GPIO(d->irq);
442 nmk_chip = irq_data_get_irq_chip_data(d); 601 nmk_chip = irq_data_get_irq_chip_data(d);
443 if (!nmk_chip) 602 if (!nmk_chip)
444 return -EINVAL; 603 return -EINVAL;
604 bitmask = nmk_gpio_get_bitmask(gpio);
445 605
446 spin_lock_irqsave(&nmk_chip->lock, flags); 606 spin_lock_irqsave(&nmk_gpio_slpm_lock, flags);
447#ifdef CONFIG_ARCH_U8500 607 spin_lock(&nmk_chip->lock);
448 if (cpu_is_u8500v2()) { 608
449 __nmk_gpio_set_slpm(nmk_chip, gpio, 609 if (!enabled)
450 on ? NMK_GPIO_SLPM_WAKEUP_ENABLE 610 __nmk_gpio_set_wake(nmk_chip, gpio, on);
451 : NMK_GPIO_SLPM_WAKEUP_DISABLE); 611
452 } 612 if (on)
453#endif 613 nmk_chip->real_wake |= bitmask;
454 __nmk_gpio_irq_modify(nmk_chip, gpio, WAKE, on); 614 else
455 spin_unlock_irqrestore(&nmk_chip->lock, flags); 615 nmk_chip->real_wake &= ~bitmask;
616
617 spin_unlock(&nmk_chip->lock);
618 spin_unlock_irqrestore(&nmk_gpio_slpm_lock, flags);
456 619
457 return 0; 620 return 0;
458} 621}
@@ -483,7 +646,7 @@ static int nmk_gpio_irq_set_type(struct irq_data *d, unsigned int type)
483 if (enabled) 646 if (enabled)
484 __nmk_gpio_irq_modify(nmk_chip, gpio, NORMAL, false); 647 __nmk_gpio_irq_modify(nmk_chip, gpio, NORMAL, false);
485 648
486 if (wake) 649 if (enabled || wake)
487 __nmk_gpio_irq_modify(nmk_chip, gpio, WAKE, false); 650 __nmk_gpio_irq_modify(nmk_chip, gpio, WAKE, false);
488 651
489 nmk_chip->edge_rising &= ~bitmask; 652 nmk_chip->edge_rising &= ~bitmask;
@@ -497,7 +660,7 @@ static int nmk_gpio_irq_set_type(struct irq_data *d, unsigned int type)
497 if (enabled) 660 if (enabled)
498 __nmk_gpio_irq_modify(nmk_chip, gpio, NORMAL, true); 661 __nmk_gpio_irq_modify(nmk_chip, gpio, NORMAL, true);
499 662
500 if (wake) 663 if (enabled || wake)
501 __nmk_gpio_irq_modify(nmk_chip, gpio, WAKE, true); 664 __nmk_gpio_irq_modify(nmk_chip, gpio, WAKE, true);
502 665
503 spin_unlock_irqrestore(&nmk_chip->lock, flags); 666 spin_unlock_irqrestore(&nmk_chip->lock, flags);
@@ -514,12 +677,11 @@ static struct irq_chip nmk_gpio_irq_chip = {
514 .irq_set_wake = nmk_gpio_irq_set_wake, 677 .irq_set_wake = nmk_gpio_irq_set_wake,
515}; 678};
516 679
517static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) 680static void __nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc,
681 u32 status)
518{ 682{
519 struct nmk_gpio_chip *nmk_chip; 683 struct nmk_gpio_chip *nmk_chip;
520 struct irq_chip *host_chip = get_irq_chip(irq); 684 struct irq_chip *host_chip = get_irq_chip(irq);
521 unsigned int gpio_irq;
522 u32 pending;
523 unsigned int first_irq; 685 unsigned int first_irq;
524 686
525 if (host_chip->irq_mask_ack) 687 if (host_chip->irq_mask_ack)
@@ -532,29 +694,56 @@ static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
532 694
533 nmk_chip = get_irq_data(irq); 695 nmk_chip = get_irq_data(irq);
534 first_irq = NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base); 696 first_irq = NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base);
535 while ( (pending = readl(nmk_chip->addr + NMK_GPIO_IS)) ) { 697 while (status) {
536 gpio_irq = first_irq + __ffs(pending); 698 int bit = __ffs(status);
537 generic_handle_irq(gpio_irq); 699
700 generic_handle_irq(first_irq + bit);
701 status &= ~BIT(bit);
538 } 702 }
539 703
540 host_chip->irq_unmask(&desc->irq_data); 704 host_chip->irq_unmask(&desc->irq_data);
541} 705}
542 706
707static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
708{
709 struct nmk_gpio_chip *nmk_chip = get_irq_data(irq);
710 u32 status = readl(nmk_chip->addr + NMK_GPIO_IS);
711
712 __nmk_gpio_irq_handler(irq, desc, status);
713}
714
715static void nmk_gpio_secondary_irq_handler(unsigned int irq,
716 struct irq_desc *desc)
717{
718 struct nmk_gpio_chip *nmk_chip = get_irq_data(irq);
719 u32 status = nmk_chip->get_secondary_status(nmk_chip->bank);
720
721 __nmk_gpio_irq_handler(irq, desc, status);
722}
723
543static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip) 724static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip)
544{ 725{
545 unsigned int first_irq; 726 unsigned int first_irq;
546 int i; 727 int i;
547 728
548 first_irq = NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base); 729 first_irq = NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base);
549 for (i = first_irq; i < first_irq + NMK_GPIO_PER_CHIP; i++) { 730 for (i = first_irq; i < first_irq + nmk_chip->chip.ngpio; i++) {
550 set_irq_chip(i, &nmk_gpio_irq_chip); 731 set_irq_chip(i, &nmk_gpio_irq_chip);
551 set_irq_handler(i, handle_edge_irq); 732 set_irq_handler(i, handle_edge_irq);
552 set_irq_flags(i, IRQF_VALID); 733 set_irq_flags(i, IRQF_VALID);
553 set_irq_chip_data(i, nmk_chip); 734 set_irq_chip_data(i, nmk_chip);
554 set_irq_type(i, IRQ_TYPE_EDGE_FALLING); 735 set_irq_type(i, IRQ_TYPE_EDGE_FALLING);
555 } 736 }
737
556 set_irq_chained_handler(nmk_chip->parent_irq, nmk_gpio_irq_handler); 738 set_irq_chained_handler(nmk_chip->parent_irq, nmk_gpio_irq_handler);
557 set_irq_data(nmk_chip->parent_irq, nmk_chip); 739 set_irq_data(nmk_chip->parent_irq, nmk_chip);
740
741 if (nmk_chip->secondary_parent_irq >= 0) {
742 set_irq_chained_handler(nmk_chip->secondary_parent_irq,
743 nmk_gpio_secondary_irq_handler);
744 set_irq_data(nmk_chip->secondary_parent_irq, nmk_chip);
745 }
746
558 return 0; 747 return 0;
559} 748}
560 749
@@ -605,6 +794,97 @@ static int nmk_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
605 return NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base) + offset; 794 return NOMADIK_GPIO_TO_IRQ(nmk_chip->chip.base) + offset;
606} 795}
607 796
797#ifdef CONFIG_DEBUG_FS
798
799#include <linux/seq_file.h>
800
801static void nmk_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
802{
803 int mode;
804 unsigned i;
805 unsigned gpio = chip->base;
806 int is_out;
807 struct nmk_gpio_chip *nmk_chip =
808 container_of(chip, struct nmk_gpio_chip, chip);
809 const char *modes[] = {
810 [NMK_GPIO_ALT_GPIO] = "gpio",
811 [NMK_GPIO_ALT_A] = "altA",
812 [NMK_GPIO_ALT_B] = "altB",
813 [NMK_GPIO_ALT_C] = "altC",
814 };
815
816 for (i = 0; i < chip->ngpio; i++, gpio++) {
817 const char *label = gpiochip_is_requested(chip, i);
818 bool pull;
819 u32 bit = 1 << i;
820
821 if (!label)
822 continue;
823
824 is_out = readl(nmk_chip->addr + NMK_GPIO_DIR) & bit;
825 pull = !(readl(nmk_chip->addr + NMK_GPIO_PDIS) & bit);
826 mode = nmk_gpio_get_mode(gpio);
827 seq_printf(s, " gpio-%-3d (%-20.20s) %s %s %s %s",
828 gpio, label,
829 is_out ? "out" : "in ",
830 chip->get
831 ? (chip->get(chip, i) ? "hi" : "lo")
832 : "? ",
833 (mode < 0) ? "unknown" : modes[mode],
834 pull ? "pull" : "none");
835
836 if (!is_out) {
837 int irq = gpio_to_irq(gpio);
838 struct irq_desc *desc = irq_to_desc(irq);
839
840 /* This races with request_irq(), set_irq_type(),
841 * and set_irq_wake() ... but those are "rare".
842 *
843 * More significantly, trigger type flags aren't
844 * currently maintained by genirq.
845 */
846 if (irq >= 0 && desc->action) {
847 char *trigger;
848
849 switch (desc->status & IRQ_TYPE_SENSE_MASK) {
850 case IRQ_TYPE_NONE:
851 trigger = "(default)";
852 break;
853 case IRQ_TYPE_EDGE_FALLING:
854 trigger = "edge-falling";
855 break;
856 case IRQ_TYPE_EDGE_RISING:
857 trigger = "edge-rising";
858 break;
859 case IRQ_TYPE_EDGE_BOTH:
860 trigger = "edge-both";
861 break;
862 case IRQ_TYPE_LEVEL_HIGH:
863 trigger = "level-high";
864 break;
865 case IRQ_TYPE_LEVEL_LOW:
866 trigger = "level-low";
867 break;
868 default:
869 trigger = "?trigger?";
870 break;
871 }
872
873 seq_printf(s, " irq-%d %s%s",
874 irq, trigger,
875 (desc->status & IRQ_WAKEUP)
876 ? " wakeup" : "");
877 }
878 }
879
880 seq_printf(s, "\n");
881 }
882}
883
884#else
885#define nmk_gpio_dbg_show NULL
886#endif
887
608/* This structure is replicated for each GPIO block allocated at probe time */ 888/* This structure is replicated for each GPIO block allocated at probe time */
609static struct gpio_chip nmk_gpio_template = { 889static struct gpio_chip nmk_gpio_template = {
610 .direction_input = nmk_gpio_make_input, 890 .direction_input = nmk_gpio_make_input,
@@ -612,10 +892,64 @@ static struct gpio_chip nmk_gpio_template = {
612 .direction_output = nmk_gpio_make_output, 892 .direction_output = nmk_gpio_make_output,
613 .set = nmk_gpio_set_output, 893 .set = nmk_gpio_set_output,
614 .to_irq = nmk_gpio_to_irq, 894 .to_irq = nmk_gpio_to_irq,
615 .ngpio = NMK_GPIO_PER_CHIP, 895 .dbg_show = nmk_gpio_dbg_show,
616 .can_sleep = 0, 896 .can_sleep = 0,
617}; 897};
618 898
899/*
900 * Called from the suspend/resume path to only keep the real wakeup interrupts
901 * (those that have had set_irq_wake() called on them) as wakeup interrupts,
902 * and not the rest of the interrupts which we needed to have as wakeups for
903 * cpuidle.
904 *
905 * PM ops are not used since this needs to be done at the end, after all the
906 * other drivers are done with their suspend callbacks.
907 */
908void nmk_gpio_wakeups_suspend(void)
909{
910 int i;
911
912 for (i = 0; i < NUM_BANKS; i++) {
913 struct nmk_gpio_chip *chip = nmk_gpio_chips[i];
914
915 if (!chip)
916 break;
917
918 chip->rwimsc = readl(chip->addr + NMK_GPIO_RWIMSC);
919 chip->fwimsc = readl(chip->addr + NMK_GPIO_FWIMSC);
920
921 writel(chip->rwimsc & chip->real_wake,
922 chip->addr + NMK_GPIO_RWIMSC);
923 writel(chip->fwimsc & chip->real_wake,
924 chip->addr + NMK_GPIO_FWIMSC);
925
926 if (cpu_is_u8500v2()) {
927 chip->slpm = readl(chip->addr + NMK_GPIO_SLPC);
928
929 /* 0 -> wakeup enable */
930 writel(~chip->real_wake, chip->addr + NMK_GPIO_SLPC);
931 }
932 }
933}
934
935void nmk_gpio_wakeups_resume(void)
936{
937 int i;
938
939 for (i = 0; i < NUM_BANKS; i++) {
940 struct nmk_gpio_chip *chip = nmk_gpio_chips[i];
941
942 if (!chip)
943 break;
944
945 writel(chip->rwimsc, chip->addr + NMK_GPIO_RWIMSC);
946 writel(chip->fwimsc, chip->addr + NMK_GPIO_FWIMSC);
947
948 if (cpu_is_u8500v2())
949 writel(chip->slpm, chip->addr + NMK_GPIO_SLPC);
950 }
951}
952
619static int __devinit nmk_gpio_probe(struct platform_device *dev) 953static int __devinit nmk_gpio_probe(struct platform_device *dev)
620{ 954{
621 struct nmk_gpio_platform_data *pdata = dev->dev.platform_data; 955 struct nmk_gpio_platform_data *pdata = dev->dev.platform_data;
@@ -623,6 +957,7 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
623 struct gpio_chip *chip; 957 struct gpio_chip *chip;
624 struct resource *res; 958 struct resource *res;
625 struct clk *clk; 959 struct clk *clk;
960 int secondary_irq;
626 int irq; 961 int irq;
627 int ret; 962 int ret;
628 963
@@ -641,6 +976,12 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
641 goto out; 976 goto out;
642 } 977 }
643 978
979 secondary_irq = platform_get_irq(dev, 1);
980 if (secondary_irq >= 0 && !pdata->get_secondary_status) {
981 ret = -EINVAL;
982 goto out;
983 }
984
644 if (request_mem_region(res->start, resource_size(res), 985 if (request_mem_region(res->start, resource_size(res),
645 dev_name(&dev->dev)) == NULL) { 986 dev_name(&dev->dev)) == NULL) {
646 ret = -EBUSY; 987 ret = -EBUSY;
@@ -664,14 +1005,19 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
664 * The virt address in nmk_chip->addr is in the nomadik register space, 1005 * The virt address in nmk_chip->addr is in the nomadik register space,
665 * so we can simply convert the resource address, without remapping 1006 * so we can simply convert the resource address, without remapping
666 */ 1007 */
1008 nmk_chip->bank = dev->id;
667 nmk_chip->clk = clk; 1009 nmk_chip->clk = clk;
668 nmk_chip->addr = io_p2v(res->start); 1010 nmk_chip->addr = io_p2v(res->start);
669 nmk_chip->chip = nmk_gpio_template; 1011 nmk_chip->chip = nmk_gpio_template;
670 nmk_chip->parent_irq = irq; 1012 nmk_chip->parent_irq = irq;
1013 nmk_chip->secondary_parent_irq = secondary_irq;
1014 nmk_chip->get_secondary_status = pdata->get_secondary_status;
1015 nmk_chip->set_ioforce = pdata->set_ioforce;
671 spin_lock_init(&nmk_chip->lock); 1016 spin_lock_init(&nmk_chip->lock);
672 1017
673 chip = &nmk_chip->chip; 1018 chip = &nmk_chip->chip;
674 chip->base = pdata->first_gpio; 1019 chip->base = pdata->first_gpio;
1020 chip->ngpio = pdata->num_gpio;
675 chip->label = pdata->name ?: dev_name(&dev->dev); 1021 chip->label = pdata->name ?: dev_name(&dev->dev);
676 chip->dev = &dev->dev; 1022 chip->dev = &dev->dev;
677 chip->owner = THIS_MODULE; 1023 chip->owner = THIS_MODULE;
@@ -680,6 +1026,9 @@ static int __devinit nmk_gpio_probe(struct platform_device *dev)
680 if (ret) 1026 if (ret)
681 goto out_free; 1027 goto out_free;
682 1028
1029 BUG_ON(nmk_chip->bank >= ARRAY_SIZE(nmk_gpio_chips));
1030
1031 nmk_gpio_chips[nmk_chip->bank] = nmk_chip;
683 platform_set_drvdata(dev, nmk_chip); 1032 platform_set_drvdata(dev, nmk_chip);
684 1033
685 nmk_gpio_init_irq(nmk_chip); 1034 nmk_gpio_init_irq(nmk_chip);
@@ -705,10 +1054,8 @@ static struct platform_driver nmk_gpio_driver = {
705 .driver = { 1054 .driver = {
706 .owner = THIS_MODULE, 1055 .owner = THIS_MODULE,
707 .name = "gpio", 1056 .name = "gpio",
708 }, 1057 },
709 .probe = nmk_gpio_probe, 1058 .probe = nmk_gpio_probe,
710 .suspend = NULL, /* to be done */
711 .resume = NULL,
712}; 1059};
713 1060
714static int __init nmk_gpio_init(void) 1061static int __init nmk_gpio_init(void)
diff --git a/arch/arm/plat-nomadik/include/plat/gpio.h b/arch/arm/plat-nomadik/include/plat/gpio.h
index 67b113d639d8..1b9f6f0843d1 100644
--- a/arch/arm/plat-nomadik/include/plat/gpio.h
+++ b/arch/arm/plat-nomadik/include/plat/gpio.h
@@ -75,6 +75,9 @@ extern int nmk_gpio_set_pull(int gpio, enum nmk_gpio_pull pull);
75extern int nmk_gpio_set_mode(int gpio, int gpio_mode); 75extern int nmk_gpio_set_mode(int gpio, int gpio_mode);
76extern int nmk_gpio_get_mode(int gpio); 76extern int nmk_gpio_get_mode(int gpio);
77 77
78extern void nmk_gpio_wakeups_suspend(void);
79extern void nmk_gpio_wakeups_resume(void);
80
78/* 81/*
79 * Platform data to register a block: only the initial gpio/irq number. 82 * Platform data to register a block: only the initial gpio/irq number.
80 */ 83 */
@@ -82,6 +85,9 @@ struct nmk_gpio_platform_data {
82 char *name; 85 char *name;
83 int first_gpio; 86 int first_gpio;
84 int first_irq; 87 int first_irq;
88 int num_gpio;
89 u32 (*get_secondary_status)(unsigned int bank);
90 void (*set_ioforce)(bool enable);
85}; 91};
86 92
87#endif /* __ASM_PLAT_GPIO_H */ 93#endif /* __ASM_PLAT_GPIO_H */
diff --git a/arch/arm/plat-nomadik/include/plat/ste_dma40.h b/arch/arm/plat-nomadik/include/plat/ste_dma40.h
index 4d6dd4c39b75..c44886062f8e 100644
--- a/arch/arm/plat-nomadik/include/plat/ste_dma40.h
+++ b/arch/arm/plat-nomadik/include/plat/ste_dma40.h
@@ -104,6 +104,8 @@ struct stedma40_half_channel_info {
104 * 104 *
105 * @dir: MEM 2 MEM, PERIPH 2 MEM , MEM 2 PERIPH, PERIPH 2 PERIPH 105 * @dir: MEM 2 MEM, PERIPH 2 MEM , MEM 2 PERIPH, PERIPH 2 PERIPH
106 * @high_priority: true if high-priority 106 * @high_priority: true if high-priority
107 * @realtime: true if realtime mode is to be enabled. Only available on DMA40
108 * version 3+, i.e DB8500v2+
107 * @mode: channel mode: physical, logical, or operation 109 * @mode: channel mode: physical, logical, or operation
108 * @mode_opt: options for the chosen channel mode 110 * @mode_opt: options for the chosen channel mode
109 * @src_dev_type: Src device type 111 * @src_dev_type: Src device type
@@ -119,6 +121,7 @@ struct stedma40_half_channel_info {
119struct stedma40_chan_cfg { 121struct stedma40_chan_cfg {
120 enum stedma40_xfer_dir dir; 122 enum stedma40_xfer_dir dir;
121 bool high_priority; 123 bool high_priority;
124 bool realtime;
122 enum stedma40_mode mode; 125 enum stedma40_mode mode;
123 enum stedma40_mode_opt mode_opt; 126 enum stedma40_mode_opt mode_opt;
124 int src_dev_type; 127 int src_dev_type;
@@ -169,25 +172,6 @@ struct stedma40_platform_data {
169bool stedma40_filter(struct dma_chan *chan, void *data); 172bool stedma40_filter(struct dma_chan *chan, void *data);
170 173
171/** 174/**
172 * stedma40_memcpy_sg() - extension of the dma framework, memcpy to/from
173 * scattergatter lists.
174 *
175 * @chan: dmaengine handle
176 * @sgl_dst: Destination scatter list
177 * @sgl_src: Source scatter list
178 * @sgl_len: The length of each scatterlist. Both lists must be of equal length
179 * and each element must match the corresponding element in the other scatter
180 * list.
181 * @flags: is actually enum dma_ctrl_flags. See dmaengine.h
182 */
183
184struct dma_async_tx_descriptor *stedma40_memcpy_sg(struct dma_chan *chan,
185 struct scatterlist *sgl_dst,
186 struct scatterlist *sgl_src,
187 unsigned int sgl_len,
188 unsigned long flags);
189
190/**
191 * stedma40_slave_mem() - Transfers a raw data buffer to or from a slave 175 * stedma40_slave_mem() - Transfers a raw data buffer to or from a slave
192 * (=device) 176 * (=device)
193 * 177 *
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index 18fe3cb195dc..cd5f993612fd 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -54,7 +54,7 @@ config OMAP_SMARTREFLEX
54 user must write 1 to 54 user must write 1 to
55 /debug/voltage/vdd_<X>/smartreflex/autocomp, 55 /debug/voltage/vdd_<X>/smartreflex/autocomp,
56 where X is mpu or core for OMAP3. 56 where X is mpu or core for OMAP3.
57 Optionallly autocompensation can be enabled in the kernel 57 Optionally autocompensation can be enabled in the kernel
58 by default during system init via the enable_on_init flag 58 by default during system init via the enable_on_init flag
59 which an be passed as platform data to the smartreflex driver. 59 which an be passed as platform data to the smartreflex driver.
60 60
@@ -144,12 +144,9 @@ config OMAP_IOMMU_DEBUG
144config OMAP_IOMMU_IVA2 144config OMAP_IOMMU_IVA2
145 bool 145 bool
146 146
147choice
148 prompt "System timer"
149 default OMAP_32K_TIMER if !ARCH_OMAP15XX
150
151config OMAP_MPU_TIMER 147config OMAP_MPU_TIMER
152 bool "Use mpu timer" 148 bool "Use mpu timer"
149 depends on ARCH_OMAP1
153 help 150 help
154 Select this option if you want to use the OMAP mpu timer. This 151 Select this option if you want to use the OMAP mpu timer. This
155 timer provides more intra-tick resolution than the 32KHz timer, 152 timer provides more intra-tick resolution than the 32KHz timer,
@@ -158,6 +155,7 @@ config OMAP_MPU_TIMER
158config OMAP_32K_TIMER 155config OMAP_32K_TIMER
159 bool "Use 32KHz timer" 156 bool "Use 32KHz timer"
160 depends on ARCH_OMAP16XX || ARCH_OMAP2PLUS 157 depends on ARCH_OMAP16XX || ARCH_OMAP2PLUS
158 default y if (ARCH_OMAP16XX || ARCH_OMAP2PLUS)
161 help 159 help
162 Select this option if you want to enable the OMAP 32KHz timer. 160 Select this option if you want to enable the OMAP 32KHz timer.
163 This timer saves power compared to the OMAP_MPU_TIMER, and has 161 This timer saves power compared to the OMAP_MPU_TIMER, and has
@@ -165,8 +163,6 @@ config OMAP_32K_TIMER
165 intra-tick resolution than OMAP_MPU_TIMER. The 32KHz timer is 163 intra-tick resolution than OMAP_MPU_TIMER. The 32KHz timer is
166 currently only available for OMAP16XX, 24XX, 34XX and OMAP4. 164 currently only available for OMAP16XX, 24XX, 34XX and OMAP4.
167 165
168endchoice
169
170config OMAP3_L2_AUX_SECURE_SAVE_RESTORE 166config OMAP3_L2_AUX_SECURE_SAVE_RESTORE
171 bool "OMAP3 HS/EMU save and restore for L2 AUX control register" 167 bool "OMAP3 HS/EMU save and restore for L2 AUX control register"
172 depends on ARCH_OMAP3 && PM 168 depends on ARCH_OMAP3 && PM
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index fc62fb5fc20b..c9122dd6ee8d 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -37,14 +37,16 @@ static struct clk_functions *arch_clock;
37int clk_enable(struct clk *clk) 37int clk_enable(struct clk *clk)
38{ 38{
39 unsigned long flags; 39 unsigned long flags;
40 int ret = 0; 40 int ret;
41 41
42 if (clk == NULL || IS_ERR(clk)) 42 if (clk == NULL || IS_ERR(clk))
43 return -EINVAL; 43 return -EINVAL;
44 44
45 if (!arch_clock || !arch_clock->clk_enable)
46 return -EINVAL;
47
45 spin_lock_irqsave(&clockfw_lock, flags); 48 spin_lock_irqsave(&clockfw_lock, flags);
46 if (arch_clock->clk_enable) 49 ret = arch_clock->clk_enable(clk);
47 ret = arch_clock->clk_enable(clk);
48 spin_unlock_irqrestore(&clockfw_lock, flags); 50 spin_unlock_irqrestore(&clockfw_lock, flags);
49 51
50 return ret; 52 return ret;
@@ -58,6 +60,9 @@ void clk_disable(struct clk *clk)
58 if (clk == NULL || IS_ERR(clk)) 60 if (clk == NULL || IS_ERR(clk))
59 return; 61 return;
60 62
63 if (!arch_clock || !arch_clock->clk_disable)
64 return;
65
61 spin_lock_irqsave(&clockfw_lock, flags); 66 spin_lock_irqsave(&clockfw_lock, flags);
62 if (clk->usecount == 0) { 67 if (clk->usecount == 0) {
63 pr_err("Trying disable clock %s with 0 usecount\n", 68 pr_err("Trying disable clock %s with 0 usecount\n",
@@ -66,8 +71,7 @@ void clk_disable(struct clk *clk)
66 goto out; 71 goto out;
67 } 72 }
68 73
69 if (arch_clock->clk_disable) 74 arch_clock->clk_disable(clk);
70 arch_clock->clk_disable(clk);
71 75
72out: 76out:
73 spin_unlock_irqrestore(&clockfw_lock, flags); 77 spin_unlock_irqrestore(&clockfw_lock, flags);
@@ -77,7 +81,7 @@ EXPORT_SYMBOL(clk_disable);
77unsigned long clk_get_rate(struct clk *clk) 81unsigned long clk_get_rate(struct clk *clk)
78{ 82{
79 unsigned long flags; 83 unsigned long flags;
80 unsigned long ret = 0; 84 unsigned long ret;
81 85
82 if (clk == NULL || IS_ERR(clk)) 86 if (clk == NULL || IS_ERR(clk))
83 return 0; 87 return 0;
@@ -97,14 +101,16 @@ EXPORT_SYMBOL(clk_get_rate);
97long clk_round_rate(struct clk *clk, unsigned long rate) 101long clk_round_rate(struct clk *clk, unsigned long rate)
98{ 102{
99 unsigned long flags; 103 unsigned long flags;
100 long ret = 0; 104 long ret;
101 105
102 if (clk == NULL || IS_ERR(clk)) 106 if (clk == NULL || IS_ERR(clk))
103 return ret; 107 return 0;
108
109 if (!arch_clock || !arch_clock->clk_round_rate)
110 return 0;
104 111
105 spin_lock_irqsave(&clockfw_lock, flags); 112 spin_lock_irqsave(&clockfw_lock, flags);
106 if (arch_clock->clk_round_rate) 113 ret = arch_clock->clk_round_rate(clk, rate);
107 ret = arch_clock->clk_round_rate(clk, rate);
108 spin_unlock_irqrestore(&clockfw_lock, flags); 114 spin_unlock_irqrestore(&clockfw_lock, flags);
109 115
110 return ret; 116 return ret;
@@ -119,14 +125,13 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
119 if (clk == NULL || IS_ERR(clk)) 125 if (clk == NULL || IS_ERR(clk))
120 return ret; 126 return ret;
121 127
128 if (!arch_clock || !arch_clock->clk_set_rate)
129 return ret;
130
122 spin_lock_irqsave(&clockfw_lock, flags); 131 spin_lock_irqsave(&clockfw_lock, flags);
123 if (arch_clock->clk_set_rate) 132 ret = arch_clock->clk_set_rate(clk, rate);
124 ret = arch_clock->clk_set_rate(clk, rate); 133 if (ret == 0)
125 if (ret == 0) {
126 if (clk->recalc)
127 clk->rate = clk->recalc(clk);
128 propagate_rate(clk); 134 propagate_rate(clk);
129 }
130 spin_unlock_irqrestore(&clockfw_lock, flags); 135 spin_unlock_irqrestore(&clockfw_lock, flags);
131 136
132 return ret; 137 return ret;
@@ -141,15 +146,14 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
141 if (clk == NULL || IS_ERR(clk) || parent == NULL || IS_ERR(parent)) 146 if (clk == NULL || IS_ERR(clk) || parent == NULL || IS_ERR(parent))
142 return ret; 147 return ret;
143 148
149 if (!arch_clock || !arch_clock->clk_set_parent)
150 return ret;
151
144 spin_lock_irqsave(&clockfw_lock, flags); 152 spin_lock_irqsave(&clockfw_lock, flags);
145 if (clk->usecount == 0) { 153 if (clk->usecount == 0) {
146 if (arch_clock->clk_set_parent) 154 ret = arch_clock->clk_set_parent(clk, parent);
147 ret = arch_clock->clk_set_parent(clk, parent); 155 if (ret == 0)
148 if (ret == 0) {
149 if (clk->recalc)
150 clk->rate = clk->recalc(clk);
151 propagate_rate(clk); 156 propagate_rate(clk);
152 }
153 } else 157 } else
154 ret = -EBUSY; 158 ret = -EBUSY;
155 spin_unlock_irqrestore(&clockfw_lock, flags); 159 spin_unlock_irqrestore(&clockfw_lock, flags);
@@ -335,6 +339,38 @@ struct clk *omap_clk_get_by_name(const char *name)
335 return ret; 339 return ret;
336} 340}
337 341
342int omap_clk_enable_autoidle_all(void)
343{
344 struct clk *c;
345 unsigned long flags;
346
347 spin_lock_irqsave(&clockfw_lock, flags);
348
349 list_for_each_entry(c, &clocks, node)
350 if (c->ops->allow_idle)
351 c->ops->allow_idle(c);
352
353 spin_unlock_irqrestore(&clockfw_lock, flags);
354
355 return 0;
356}
357
358int omap_clk_disable_autoidle_all(void)
359{
360 struct clk *c;
361 unsigned long flags;
362
363 spin_lock_irqsave(&clockfw_lock, flags);
364
365 list_for_each_entry(c, &clocks, node)
366 if (c->ops->deny_idle)
367 c->ops->deny_idle(c);
368
369 spin_unlock_irqrestore(&clockfw_lock, flags);
370
371 return 0;
372}
373
338/* 374/*
339 * Low level helpers 375 * Low level helpers
340 */ 376 */
@@ -367,9 +403,11 @@ void clk_init_cpufreq_table(struct cpufreq_frequency_table **table)
367{ 403{
368 unsigned long flags; 404 unsigned long flags;
369 405
406 if (!arch_clock || !arch_clock->clk_init_cpufreq_table)
407 return;
408
370 spin_lock_irqsave(&clockfw_lock, flags); 409 spin_lock_irqsave(&clockfw_lock, flags);
371 if (arch_clock->clk_init_cpufreq_table) 410 arch_clock->clk_init_cpufreq_table(table);
372 arch_clock->clk_init_cpufreq_table(table);
373 spin_unlock_irqrestore(&clockfw_lock, flags); 411 spin_unlock_irqrestore(&clockfw_lock, flags);
374} 412}
375 413
@@ -377,9 +415,11 @@ void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table)
377{ 415{
378 unsigned long flags; 416 unsigned long flags;
379 417
418 if (!arch_clock || !arch_clock->clk_exit_cpufreq_table)
419 return;
420
380 spin_lock_irqsave(&clockfw_lock, flags); 421 spin_lock_irqsave(&clockfw_lock, flags);
381 if (arch_clock->clk_exit_cpufreq_table) 422 arch_clock->clk_exit_cpufreq_table(table);
382 arch_clock->clk_exit_cpufreq_table(table);
383 spin_unlock_irqrestore(&clockfw_lock, flags); 423 spin_unlock_irqrestore(&clockfw_lock, flags);
384} 424}
385#endif 425#endif
@@ -397,6 +437,9 @@ static int __init clk_disable_unused(void)
397 struct clk *ck; 437 struct clk *ck;
398 unsigned long flags; 438 unsigned long flags;
399 439
440 if (!arch_clock || !arch_clock->clk_disable_unused)
441 return 0;
442
400 pr_info("clock: disabling unused clocks to save power\n"); 443 pr_info("clock: disabling unused clocks to save power\n");
401 list_for_each_entry(ck, &clocks, node) { 444 list_for_each_entry(ck, &clocks, node) {
402 if (ck->ops == &clkops_null) 445 if (ck->ops == &clkops_null)
@@ -406,14 +449,14 @@ static int __init clk_disable_unused(void)
406 continue; 449 continue;
407 450
408 spin_lock_irqsave(&clockfw_lock, flags); 451 spin_lock_irqsave(&clockfw_lock, flags);
409 if (arch_clock->clk_disable_unused) 452 arch_clock->clk_disable_unused(ck);
410 arch_clock->clk_disable_unused(ck);
411 spin_unlock_irqrestore(&clockfw_lock, flags); 453 spin_unlock_irqrestore(&clockfw_lock, flags);
412 } 454 }
413 455
414 return 0; 456 return 0;
415} 457}
416late_initcall(clk_disable_unused); 458late_initcall(clk_disable_unused);
459late_initcall(omap_clk_enable_autoidle_all);
417#endif 460#endif
418 461
419int __init clk_init(struct clk_functions * custom_clocks) 462int __init clk_init(struct clk_functions * custom_clocks)
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index f04731820301..d9f10a31e604 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -24,10 +24,11 @@
24 24
25#define NO_LENGTH_CHECK 0xffffffff 25#define NO_LENGTH_CHECK 0xffffffff
26 26
27struct omap_board_config_kernel *omap_board_config; 27struct omap_board_config_kernel *omap_board_config __initdata;
28int omap_board_config_size; 28int omap_board_config_size;
29 29
30static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out) 30static const void *__init get_config(u16 tag, size_t len,
31 int skip, size_t *len_out)
31{ 32{
32 struct omap_board_config_kernel *kinfo = NULL; 33 struct omap_board_config_kernel *kinfo = NULL;
33 int i; 34 int i;
@@ -49,17 +50,15 @@ static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out)
49 return kinfo->data; 50 return kinfo->data;
50} 51}
51 52
52const void *__omap_get_config(u16 tag, size_t len, int nr) 53const void *__init __omap_get_config(u16 tag, size_t len, int nr)
53{ 54{
54 return get_config(tag, len, nr, NULL); 55 return get_config(tag, len, nr, NULL);
55} 56}
56EXPORT_SYMBOL(__omap_get_config);
57 57
58const void *omap_get_var_config(u16 tag, size_t *len) 58const void *__init omap_get_var_config(u16 tag, size_t *len)
59{ 59{
60 return get_config(tag, NO_LENGTH_CHECK, 0, len); 60 return get_config(tag, NO_LENGTH_CHECK, 0, len);
61} 61}
62EXPORT_SYMBOL(omap_get_var_config);
63 62
64void __init omap_reserve(void) 63void __init omap_reserve(void)
65{ 64{
diff --git a/arch/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c
index ea4644021fb9..f7fed6080190 100644
--- a/arch/arm/plat-omap/counter_32k.c
+++ b/arch/arm/plat-omap/counter_32k.c
@@ -36,8 +36,6 @@
36 36
37#define OMAP16XX_TIMER_32K_SYNCHRONIZED 0xfffbc410 37#define OMAP16XX_TIMER_32K_SYNCHRONIZED 0xfffbc410
38 38
39#if !(defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP15XX))
40
41#include <linux/clocksource.h> 39#include <linux/clocksource.h>
42 40
43/* 41/*
@@ -56,7 +54,7 @@ static cycle_t notrace omap16xx_32k_read(struct clocksource *cs)
56#define omap16xx_32k_read NULL 54#define omap16xx_32k_read NULL
57#endif 55#endif
58 56
59#ifdef CONFIG_ARCH_OMAP2420 57#ifdef CONFIG_SOC_OMAP2420
60static cycle_t notrace omap2420_32k_read(struct clocksource *cs) 58static cycle_t notrace omap2420_32k_read(struct clocksource *cs)
61{ 59{
62 return omap_readl(OMAP2420_32KSYNCT_BASE + 0x10) - offset_32k; 60 return omap_readl(OMAP2420_32KSYNCT_BASE + 0x10) - offset_32k;
@@ -65,7 +63,7 @@ static cycle_t notrace omap2420_32k_read(struct clocksource *cs)
65#define omap2420_32k_read NULL 63#define omap2420_32k_read NULL
66#endif 64#endif
67 65
68#ifdef CONFIG_ARCH_OMAP2430 66#ifdef CONFIG_SOC_OMAP2430
69static cycle_t notrace omap2430_32k_read(struct clocksource *cs) 67static cycle_t notrace omap2430_32k_read(struct clocksource *cs)
70{ 68{
71 return omap_readl(OMAP2430_32KSYNCT_BASE + 0x10) - offset_32k; 69 return omap_readl(OMAP2430_32KSYNCT_BASE + 0x10) - offset_32k;
@@ -122,12 +120,24 @@ static DEFINE_CLOCK_DATA(cd);
122#define SC_MULT 4000000000u 120#define SC_MULT 4000000000u
123#define SC_SHIFT 17 121#define SC_SHIFT 17
124 122
125unsigned long long notrace sched_clock(void) 123static inline unsigned long long notrace _omap_32k_sched_clock(void)
126{ 124{
127 u32 cyc = clocksource_32k.read(&clocksource_32k); 125 u32 cyc = clocksource_32k.read(&clocksource_32k);
128 return cyc_to_fixed_sched_clock(&cd, cyc, (u32)~0, SC_MULT, SC_SHIFT); 126 return cyc_to_fixed_sched_clock(&cd, cyc, (u32)~0, SC_MULT, SC_SHIFT);
129} 127}
130 128
129#ifndef CONFIG_OMAP_MPU_TIMER
130unsigned long long notrace sched_clock(void)
131{
132 return _omap_32k_sched_clock();
133}
134#else
135unsigned long long notrace omap_32k_sched_clock(void)
136{
137 return _omap_32k_sched_clock();
138}
139#endif
140
131static void notrace omap_update_sched_clock(void) 141static void notrace omap_update_sched_clock(void)
132{ 142{
133 u32 cyc = clocksource_32k.read(&clocksource_32k); 143 u32 cyc = clocksource_32k.read(&clocksource_32k);
@@ -160,7 +170,7 @@ void read_persistent_clock(struct timespec *ts)
160 *ts = *tsp; 170 *ts = *tsp;
161} 171}
162 172
163static int __init omap_init_clocksource_32k(void) 173int __init omap_init_clocksource_32k(void)
164{ 174{
165 static char err[] __initdata = KERN_ERR 175 static char err[] __initdata = KERN_ERR
166 "%s: can't register clocksource!\n"; 176 "%s: can't register clocksource!\n";
@@ -195,7 +205,3 @@ static int __init omap_init_clocksource_32k(void)
195 } 205 }
196 return 0; 206 return 0;
197} 207}
198arch_initcall(omap_init_clocksource_32k);
199
200#endif /* !(defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP15XX)) */
201
diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
index 11c54ec8d47f..da4f68dbba1d 100644
--- a/arch/arm/plat-omap/cpu-omap.c
+++ b/arch/arm/plat-omap/cpu-omap.c
@@ -101,7 +101,7 @@ static int omap_target(struct cpufreq_policy *policy,
101 return ret; 101 return ret;
102} 102}
103 103
104static int __init omap_cpu_init(struct cpufreq_policy *policy) 104static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
105{ 105{
106 int result = 0; 106 int result = 0;
107 107
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index 10245b837c10..7d9f815cedec 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -35,8 +35,8 @@
35 35
36static struct platform_device **omap_mcbsp_devices; 36static struct platform_device **omap_mcbsp_devices;
37 37
38void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config, 38void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
39 int size) 39 struct omap_mcbsp_platform_data *config, int size)
40{ 40{
41 int i; 41 int i;
42 42
@@ -54,6 +54,8 @@ void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config,
54 new_mcbsp = platform_device_alloc("omap-mcbsp", i + 1); 54 new_mcbsp = platform_device_alloc("omap-mcbsp", i + 1);
55 if (!new_mcbsp) 55 if (!new_mcbsp)
56 continue; 56 continue;
57 platform_device_add_resources(new_mcbsp, &res[i * res_count],
58 res_count);
57 new_mcbsp->dev.platform_data = &config[i]; 59 new_mcbsp->dev.platform_data = &config[i];
58 ret = platform_device_add(new_mcbsp); 60 ret = platform_device_add(new_mcbsp);
59 if (ret) { 61 if (ret) {
@@ -65,8 +67,8 @@ void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config,
65} 67}
66 68
67#else 69#else
68void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config, 70void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
69 int size) 71 struct omap_mcbsp_platform_data *config, int size)
70{ } 72{ }
71#endif 73#endif
72 74
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index c4b2b478b1a5..2ec3b5d9f214 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -53,7 +53,7 @@ enum { DMA_CHAIN_STARTED, DMA_CHAIN_NOTSTARTED };
53#endif 53#endif
54 54
55#define OMAP_DMA_ACTIVE 0x01 55#define OMAP_DMA_ACTIVE 0x01
56#define OMAP2_DMA_CSR_CLEAR_MASK 0xffe 56#define OMAP2_DMA_CSR_CLEAR_MASK 0xffffffff
57 57
58#define OMAP_FUNC_MUX_ARM_BASE (0xfffe1000 + 0xec) 58#define OMAP_FUNC_MUX_ARM_BASE (0xfffe1000 + 0xec)
59 59
@@ -134,7 +134,7 @@ static inline void omap_enable_channel_irq(int lch);
134 134
135#ifdef CONFIG_ARCH_OMAP15XX 135#ifdef CONFIG_ARCH_OMAP15XX
136/* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */ 136/* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */
137int omap_dma_in_1510_mode(void) 137static int omap_dma_in_1510_mode(void)
138{ 138{
139 return enable_1510_mode; 139 return enable_1510_mode;
140} 140}
@@ -1873,7 +1873,7 @@ static int omap2_dma_handle_ch(int ch)
1873 printk(KERN_INFO "DMA misaligned error with device %d\n", 1873 printk(KERN_INFO "DMA misaligned error with device %d\n",
1874 dma_chan[ch].dev_id); 1874 dma_chan[ch].dev_id);
1875 1875
1876 p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, ch); 1876 p->dma_write(status, CSR, ch);
1877 p->dma_write(1 << ch, IRQSTATUS_L0, ch); 1877 p->dma_write(1 << ch, IRQSTATUS_L0, ch);
1878 /* read back the register to flush the write */ 1878 /* read back the register to flush the write */
1879 p->dma_read(IRQSTATUS_L0, ch); 1879 p->dma_read(IRQSTATUS_L0, ch);
@@ -1893,10 +1893,9 @@ static int omap2_dma_handle_ch(int ch)
1893 OMAP_DMA_CHAIN_INCQHEAD(chain_id); 1893 OMAP_DMA_CHAIN_INCQHEAD(chain_id);
1894 1894
1895 status = p->dma_read(CSR, ch); 1895 status = p->dma_read(CSR, ch);
1896 p->dma_write(status, CSR, ch);
1896 } 1897 }
1897 1898
1898 p->dma_write(status, CSR, ch);
1899
1900 if (likely(dma_chan[ch].callback != NULL)) 1899 if (likely(dma_chan[ch].callback != NULL))
1901 dma_chan[ch].callback(ch, status, dma_chan[ch].data); 1900 dma_chan[ch].callback(ch, status, dma_chan[ch].data);
1902 1901
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 1d706cf63ca0..ee9f6ebba29b 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -342,6 +342,10 @@ static void omap_dm_timer_reset(struct omap_dm_timer *timer)
342 l |= 0x02 << 3; /* Set to smart-idle mode */ 342 l |= 0x02 << 3; /* Set to smart-idle mode */
343 l |= 0x2 << 8; /* Set clock activity to perserve f-clock on idle */ 343 l |= 0x2 << 8; /* Set clock activity to perserve f-clock on idle */
344 344
345 /* Enable autoidle on OMAP2 / OMAP3 */
346 if (cpu_is_omap24xx() || cpu_is_omap34xx())
347 l |= 0x1 << 0;
348
345 /* 349 /*
346 * Enable wake-up on OMAP2 CPUs. 350 * Enable wake-up on OMAP2 CPUs.
347 */ 351 */
diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c
index a4f8003de664..3341ca4703e9 100644
--- a/arch/arm/plat-omap/i2c.c
+++ b/arch/arm/plat-omap/i2c.c
@@ -112,6 +112,7 @@ static inline int omap1_i2c_add_bus(int bus_id)
112} 112}
113 113
114 114
115#ifdef CONFIG_ARCH_OMAP2PLUS
115/* 116/*
116 * XXX This function is a temporary compatibility wrapper - only 117 * XXX This function is a temporary compatibility wrapper - only
117 * needed until the I2C driver can be converted to call 118 * needed until the I2C driver can be converted to call
@@ -130,7 +131,6 @@ static struct omap_device_pm_latency omap_i2c_latency[] = {
130 }, 131 },
131}; 132};
132 133
133#ifdef CONFIG_ARCH_OMAP2PLUS
134static inline int omap2_i2c_add_bus(int bus_id) 134static inline int omap2_i2c_add_bus(int bus_id)
135{ 135{
136 int l; 136 int l;
diff --git a/arch/arm/plat-omap/include/plat/board.h b/arch/arm/plat-omap/include/plat/board.h
index 3cf4fa25ab3d..97126dfd2888 100644
--- a/arch/arm/plat-omap/include/plat/board.h
+++ b/arch/arm/plat-omap/include/plat/board.h
@@ -151,14 +151,14 @@ struct omap_board_config_kernel {
151 const void *data; 151 const void *data;
152}; 152};
153 153
154extern const void *__omap_get_config(u16 tag, size_t len, int nr); 154extern const void *__init __omap_get_config(u16 tag, size_t len, int nr);
155 155
156#define omap_get_config(tag, type) \ 156#define omap_get_config(tag, type) \
157 ((const type *) __omap_get_config((tag), sizeof(type), 0)) 157 ((const type *) __omap_get_config((tag), sizeof(type), 0))
158#define omap_get_nr_config(tag, type, nr) \ 158#define omap_get_nr_config(tag, type, nr) \
159 ((const type *) __omap_get_config((tag), sizeof(type), (nr))) 159 ((const type *) __omap_get_config((tag), sizeof(type), (nr)))
160 160
161extern const void *omap_get_var_config(u16 tag, size_t *len); 161extern const void *__init omap_get_var_config(u16 tag, size_t *len);
162 162
163extern struct omap_board_config_kernel *omap_board_config; 163extern struct omap_board_config_kernel *omap_board_config;
164extern int omap_board_config_size; 164extern int omap_board_config_size;
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h b/arch/arm/plat-omap/include/plat/clkdev_omap.h
index 256ab3f1ec8f..f1899a3e4174 100644
--- a/arch/arm/plat-omap/include/plat/clkdev_omap.h
+++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h
@@ -38,6 +38,7 @@ struct omap_clk {
38#define CK_3517 (1 << 9) 38#define CK_3517 (1 << 9)
39#define CK_36XX (1 << 10) /* 36xx/37xx-specific clocks */ 39#define CK_36XX (1 << 10) /* 36xx/37xx-specific clocks */
40#define CK_443X (1 << 11) 40#define CK_443X (1 << 11)
41#define CK_TI816X (1 << 12)
41 42
42 43
43#define CK_34XX (CK_3430ES1 | CK_3430ES2PLUS) 44#define CK_34XX (CK_3430ES1 | CK_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h
index 8eb0adab19ea..006e599c6613 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -25,6 +25,8 @@ struct clockdomain;
25 * @disable: fn ptr that enables the current clock in hardware 25 * @disable: fn ptr that enables the current clock in hardware
26 * @find_idlest: function returning the IDLEST register for the clock's IP blk 26 * @find_idlest: function returning the IDLEST register for the clock's IP blk
27 * @find_companion: function returning the "companion" clk reg for the clock 27 * @find_companion: function returning the "companion" clk reg for the clock
28 * @allow_idle: fn ptr that enables autoidle for the current clock in hardware
29 * @deny_idle: fn ptr that disables autoidle for the current clock in hardware
28 * 30 *
29 * A "companion" clk is an accompanying clock to the one being queried 31 * A "companion" clk is an accompanying clock to the one being queried
30 * that must be enabled for the IP module connected to the clock to 32 * that must be enabled for the IP module connected to the clock to
@@ -42,6 +44,8 @@ struct clkops {
42 u8 *, u8 *); 44 u8 *, u8 *);
43 void (*find_companion)(struct clk *, void __iomem **, 45 void (*find_companion)(struct clk *, void __iomem **,
44 u8 *); 46 u8 *);
47 void (*allow_idle)(struct clk *);
48 void (*deny_idle)(struct clk *);
45}; 49};
46 50
47#ifdef CONFIG_ARCH_OMAP2PLUS 51#ifdef CONFIG_ARCH_OMAP2PLUS
@@ -53,6 +57,7 @@ struct clkops {
53#define RATE_IN_3430ES2PLUS (1 << 3) /* 3430 ES >= 2 rates only */ 57#define RATE_IN_3430ES2PLUS (1 << 3) /* 3430 ES >= 2 rates only */
54#define RATE_IN_36XX (1 << 4) 58#define RATE_IN_36XX (1 << 4)
55#define RATE_IN_4430 (1 << 5) 59#define RATE_IN_4430 (1 << 5)
60#define RATE_IN_TI816X (1 << 6)
56 61
57#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X) 62#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X)
58#define RATE_IN_34XX (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS) 63#define RATE_IN_34XX (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
@@ -104,7 +109,6 @@ struct clksel {
104 * @clk_ref: struct clk pointer to the clock's reference clock input 109 * @clk_ref: struct clk pointer to the clock's reference clock input
105 * @control_reg: register containing the DPLL mode bitfield 110 * @control_reg: register containing the DPLL mode bitfield
106 * @enable_mask: mask of the DPLL mode bitfield in @control_reg 111 * @enable_mask: mask of the DPLL mode bitfield in @control_reg
107 * @rate_tolerance: maximum variance allowed from target rate (in Hz)
108 * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate() 112 * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate()
109 * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate() 113 * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate()
110 * @max_multiplier: maximum valid non-bypass multiplier value (actual) 114 * @max_multiplier: maximum valid non-bypass multiplier value (actual)
@@ -130,12 +134,9 @@ struct clksel {
130 * XXX Some DPLLs have multiple bypass inputs, so it's not technically 134 * XXX Some DPLLs have multiple bypass inputs, so it's not technically
131 * correct to only have one @clk_bypass pointer. 135 * correct to only have one @clk_bypass pointer.
132 * 136 *
133 * XXX @rate_tolerance should probably be deprecated - currently there
134 * don't seem to be any usecases for DPLL rounding that is not exact.
135 *
136 * XXX The runtime-variable fields (@last_rounded_rate, @last_rounded_m, 137 * XXX The runtime-variable fields (@last_rounded_rate, @last_rounded_m,
137 * @last_rounded_n) should be separated from the runtime-fixed fields 138 * @last_rounded_n) should be separated from the runtime-fixed fields
138 * and placed into a differenct structure, so that the runtime-fixed data 139 * and placed into a different structure, so that the runtime-fixed data
139 * can be placed into read-only space. 140 * can be placed into read-only space.
140 */ 141 */
141struct dpll_data { 142struct dpll_data {
@@ -146,7 +147,6 @@ struct dpll_data {
146 struct clk *clk_ref; 147 struct clk *clk_ref;
147 void __iomem *control_reg; 148 void __iomem *control_reg;
148 u32 enable_mask; 149 u32 enable_mask;
149 unsigned int rate_tolerance;
150 unsigned long last_rounded_rate; 150 unsigned long last_rounded_rate;
151 u16 last_rounded_m; 151 u16 last_rounded_m;
152 u16 max_multiplier; 152 u16 max_multiplier;
@@ -171,12 +171,24 @@ struct dpll_data {
171 171
172#endif 172#endif
173 173
174/* struct clk.flags possibilities */ 174/*
175 * struct clk.flags possibilities
176 *
177 * XXX document the rest of the clock flags here
178 *
179 * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL
180 * bits share the same register. This flag allows the
181 * omap4_dpllmx*() code to determine which GATE_CTRL bit field
182 * should be used. This is a temporary solution - a better approach
183 * would be to associate clock type-specific data with the clock,
184 * similar to the struct dpll_data approach.
185 */
175#define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */ 186#define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */
176#define CLOCK_IDLE_CONTROL (1 << 1) 187#define CLOCK_IDLE_CONTROL (1 << 1)
177#define CLOCK_NO_IDLE_PARENT (1 << 2) 188#define CLOCK_NO_IDLE_PARENT (1 << 2)
178#define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */ 189#define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */
179#define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */ 190#define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */
191#define CLOCK_CLKOUTX2 (1 << 5)
180 192
181/** 193/**
182 * struct clk - OMAP struct clk 194 * struct clk - OMAP struct clk
@@ -292,6 +304,8 @@ extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table);
292extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table); 304extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table);
293#endif 305#endif
294extern struct clk *omap_clk_get_by_name(const char *name); 306extern struct clk *omap_clk_get_by_name(const char *name);
307extern int omap_clk_enable_autoidle_all(void);
308extern int omap_clk_disable_autoidle_all(void);
295 309
296extern const struct clkops clkops_null; 310extern const struct clkops clkops_null;
297 311
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
index 6b8088ec74af..5288130be96e 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -35,6 +35,9 @@ struct sys_timer;
35 35
36extern void omap_map_common_io(void); 36extern void omap_map_common_io(void);
37extern struct sys_timer omap_timer; 37extern struct sys_timer omap_timer;
38extern bool omap_32k_timer_init(void);
39extern int __init omap_init_clocksource_32k(void);
40extern unsigned long long notrace omap_32k_sched_clock(void);
38 41
39extern void omap_reserve(void); 42extern void omap_reserve(void);
40 43
@@ -53,16 +56,13 @@ struct omap_globals {
53 unsigned long prm; /* Power and Reset Management */ 56 unsigned long prm; /* Power and Reset Management */
54 unsigned long cm; /* Clock Management */ 57 unsigned long cm; /* Clock Management */
55 unsigned long cm2; 58 unsigned long cm2;
56 unsigned long uart1_phys;
57 unsigned long uart2_phys;
58 unsigned long uart3_phys;
59 unsigned long uart4_phys;
60}; 59};
61 60
62void omap2_set_globals_242x(void); 61void omap2_set_globals_242x(void);
63void omap2_set_globals_243x(void); 62void omap2_set_globals_243x(void);
64void omap2_set_globals_3xxx(void); 63void omap2_set_globals_3xxx(void);
65void omap2_set_globals_443x(void); 64void omap2_set_globals_443x(void);
65void omap2_set_globals_ti816x(void);
66 66
67/* These get called from omap2_set_globals_xxxx(), do not call these */ 67/* These get called from omap2_set_globals_xxxx(), do not call these */
68void omap2_set_globals_tap(struct omap_globals *); 68void omap2_set_globals_tap(struct omap_globals *);
diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h
index 3fd8b4055727..8198bb6cdb5e 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 2004, 2008 Nokia Corporation 6 * Copyright (C) 2004, 2008 Nokia Corporation
7 * 7 *
8 * Copyright (C) 2009 Texas Instruments. 8 * Copyright (C) 2009-11 Texas Instruments.
9 * 9 *
10 * Written by Tony Lindgren <tony.lindgren@nokia.com> 10 * Written by Tony Lindgren <tony.lindgren@nokia.com>
11 * 11 *
@@ -105,6 +105,12 @@ static inline int is_omap ##subclass (void) \
105 return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \ 105 return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
106} 106}
107 107
108#define IS_TI_SUBCLASS(subclass, id) \
109static inline int is_ti ##subclass (void) \
110{ \
111 return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
112}
113
108IS_OMAP_CLASS(7xx, 0x07) 114IS_OMAP_CLASS(7xx, 0x07)
109IS_OMAP_CLASS(15xx, 0x15) 115IS_OMAP_CLASS(15xx, 0x15)
110IS_OMAP_CLASS(16xx, 0x16) 116IS_OMAP_CLASS(16xx, 0x16)
@@ -118,6 +124,8 @@ IS_OMAP_SUBCLASS(343x, 0x343)
118IS_OMAP_SUBCLASS(363x, 0x363) 124IS_OMAP_SUBCLASS(363x, 0x363)
119IS_OMAP_SUBCLASS(443x, 0x443) 125IS_OMAP_SUBCLASS(443x, 0x443)
120 126
127IS_TI_SUBCLASS(816x, 0x816)
128
121#define cpu_is_omap7xx() 0 129#define cpu_is_omap7xx() 0
122#define cpu_is_omap15xx() 0 130#define cpu_is_omap15xx() 0
123#define cpu_is_omap16xx() 0 131#define cpu_is_omap16xx() 0
@@ -126,6 +134,7 @@ IS_OMAP_SUBCLASS(443x, 0x443)
126#define cpu_is_omap243x() 0 134#define cpu_is_omap243x() 0
127#define cpu_is_omap34xx() 0 135#define cpu_is_omap34xx() 0
128#define cpu_is_omap343x() 0 136#define cpu_is_omap343x() 0
137#define cpu_is_ti816x() 0
129#define cpu_is_omap44xx() 0 138#define cpu_is_omap44xx() 0
130#define cpu_is_omap443x() 0 139#define cpu_is_omap443x() 0
131 140
@@ -170,11 +179,11 @@ IS_OMAP_SUBCLASS(443x, 0x443)
170# undef cpu_is_omap24xx 179# undef cpu_is_omap24xx
171# define cpu_is_omap24xx() is_omap24xx() 180# define cpu_is_omap24xx() is_omap24xx()
172# endif 181# endif
173# if defined (CONFIG_ARCH_OMAP2420) 182# if defined (CONFIG_SOC_OMAP2420)
174# undef cpu_is_omap242x 183# undef cpu_is_omap242x
175# define cpu_is_omap242x() is_omap242x() 184# define cpu_is_omap242x() is_omap242x()
176# endif 185# endif
177# if defined (CONFIG_ARCH_OMAP2430) 186# if defined (CONFIG_SOC_OMAP2430)
178# undef cpu_is_omap243x 187# undef cpu_is_omap243x
179# define cpu_is_omap243x() is_omap243x() 188# define cpu_is_omap243x() is_omap243x()
180# endif 189# endif
@@ -189,11 +198,11 @@ IS_OMAP_SUBCLASS(443x, 0x443)
189# undef cpu_is_omap24xx 198# undef cpu_is_omap24xx
190# define cpu_is_omap24xx() 1 199# define cpu_is_omap24xx() 1
191# endif 200# endif
192# if defined(CONFIG_ARCH_OMAP2420) 201# if defined(CONFIG_SOC_OMAP2420)
193# undef cpu_is_omap242x 202# undef cpu_is_omap242x
194# define cpu_is_omap242x() 1 203# define cpu_is_omap242x() 1
195# endif 204# endif
196# if defined(CONFIG_ARCH_OMAP2430) 205# if defined(CONFIG_SOC_OMAP2430)
197# undef cpu_is_omap243x 206# undef cpu_is_omap243x
198# define cpu_is_omap243x() 1 207# define cpu_is_omap243x() 1
199# endif 208# endif
@@ -201,7 +210,7 @@ IS_OMAP_SUBCLASS(443x, 0x443)
201# undef cpu_is_omap34xx 210# undef cpu_is_omap34xx
202# define cpu_is_omap34xx() 1 211# define cpu_is_omap34xx() 1
203# endif 212# endif
204# if defined(CONFIG_ARCH_OMAP3430) 213# if defined(CONFIG_SOC_OMAP3430)
205# undef cpu_is_omap343x 214# undef cpu_is_omap343x
206# define cpu_is_omap343x() 1 215# define cpu_is_omap343x() 1
207# endif 216# endif
@@ -330,6 +339,7 @@ IS_OMAP_TYPE(3517, 0x3517)
330# undef cpu_is_omap3530 339# undef cpu_is_omap3530
331# undef cpu_is_omap3505 340# undef cpu_is_omap3505
332# undef cpu_is_omap3517 341# undef cpu_is_omap3517
342# undef cpu_is_ti816x
333# define cpu_is_omap3430() is_omap3430() 343# define cpu_is_omap3430() is_omap3430()
334# define cpu_is_omap3503() (cpu_is_omap3430() && \ 344# define cpu_is_omap3503() (cpu_is_omap3430() && \
335 (!omap3_has_iva()) && \ 345 (!omap3_has_iva()) && \
@@ -345,6 +355,7 @@ IS_OMAP_TYPE(3517, 0x3517)
345# define cpu_is_omap3517() is_omap3517() 355# define cpu_is_omap3517() is_omap3517()
346# undef cpu_is_omap3630 356# undef cpu_is_omap3630
347# define cpu_is_omap3630() is_omap363x() 357# define cpu_is_omap3630() is_omap363x()
358# define cpu_is_ti816x() is_ti816x()
348#endif 359#endif
349 360
350# if defined(CONFIG_ARCH_OMAP4) 361# if defined(CONFIG_ARCH_OMAP4)
@@ -389,9 +400,15 @@ IS_OMAP_TYPE(3517, 0x3517)
389#define OMAP3505_REV(v) (OMAP35XX_CLASS | (0x3505 << 16) | (v << 8)) 400#define OMAP3505_REV(v) (OMAP35XX_CLASS | (0x3505 << 16) | (v << 8))
390#define OMAP3517_REV(v) (OMAP35XX_CLASS | (0x3517 << 16) | (v << 8)) 401#define OMAP3517_REV(v) (OMAP35XX_CLASS | (0x3517 << 16) | (v << 8))
391 402
403#define TI816X_CLASS 0x81600034
404#define TI8168_REV_ES1_0 TI816X_CLASS
405#define TI8168_REV_ES1_1 (TI816X_CLASS | (OMAP_REVBITS_01 << 8))
406
392#define OMAP443X_CLASS 0x44300044 407#define OMAP443X_CLASS 0x44300044
393#define OMAP4430_REV_ES1_0 OMAP443X_CLASS 408#define OMAP4430_REV_ES1_0 (OMAP443X_CLASS | (0x10 << 8))
394#define OMAP4430_REV_ES2_0 0x44301044 409#define OMAP4430_REV_ES2_0 (OMAP443X_CLASS | (0x20 << 8))
410#define OMAP4430_REV_ES2_1 (OMAP443X_CLASS | (0x21 << 8))
411#define OMAP4430_REV_ES2_2 (OMAP443X_CLASS | (0x22 << 8))
395 412
396/* 413/*
397 * omap_chip bits 414 * omap_chip bits
@@ -419,11 +436,16 @@ IS_OMAP_TYPE(3517, 0x3517)
419#define CHIP_IS_OMAP3630ES1_1 (1 << 9) 436#define CHIP_IS_OMAP3630ES1_1 (1 << 9)
420#define CHIP_IS_OMAP3630ES1_2 (1 << 10) 437#define CHIP_IS_OMAP3630ES1_2 (1 << 10)
421#define CHIP_IS_OMAP4430ES2 (1 << 11) 438#define CHIP_IS_OMAP4430ES2 (1 << 11)
439#define CHIP_IS_OMAP4430ES2_1 (1 << 12)
440#define CHIP_IS_OMAP4430ES2_2 (1 << 13)
441#define CHIP_IS_TI816X (1 << 14)
422 442
423#define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430) 443#define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430)
424 444
425#define CHIP_IS_OMAP4430 (CHIP_IS_OMAP4430ES1 | \ 445#define CHIP_IS_OMAP4430 (CHIP_IS_OMAP4430ES1 | \
426 CHIP_IS_OMAP4430ES2) 446 CHIP_IS_OMAP4430ES2 | \
447 CHIP_IS_OMAP4430ES2_1 | \
448 CHIP_IS_OMAP4430ES2_2)
427 449
428/* 450/*
429 * "GE" here represents "greater than or equal to" in terms of ES 451 * "GE" here represents "greater than or equal to" in terms of ES
@@ -455,6 +477,7 @@ extern u32 omap3_features;
455#define OMAP3_HAS_ISP BIT(4) 477#define OMAP3_HAS_ISP BIT(4)
456#define OMAP3_HAS_192MHZ_CLK BIT(5) 478#define OMAP3_HAS_192MHZ_CLK BIT(5)
457#define OMAP3_HAS_IO_WAKEUP BIT(6) 479#define OMAP3_HAS_IO_WAKEUP BIT(6)
480#define OMAP3_HAS_SDRC BIT(7)
458 481
459#define OMAP3_HAS_FEATURE(feat,flag) \ 482#define OMAP3_HAS_FEATURE(feat,flag) \
460static inline unsigned int omap3_has_ ##feat(void) \ 483static inline unsigned int omap3_has_ ##feat(void) \
@@ -469,5 +492,6 @@ OMAP3_HAS_FEATURE(neon, NEON)
469OMAP3_HAS_FEATURE(isp, ISP) 492OMAP3_HAS_FEATURE(isp, ISP)
470OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK) 493OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK)
471OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP) 494OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP)
495OMAP3_HAS_FEATURE(sdrc, SDRC)
472 496
473#endif 497#endif
diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h
index 537f4e449f50..5e04ddc18fa8 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -23,6 +23,7 @@
23#include <linux/list.h> 23#include <linux/list.h>
24#include <linux/kobject.h> 24#include <linux/kobject.h>
25#include <linux/device.h> 25#include <linux/device.h>
26#include <linux/platform_device.h>
26#include <asm/atomic.h> 27#include <asm/atomic.h>
27 28
28#define DISPC_IRQ_FRAMEDONE (1 << 0) 29#define DISPC_IRQ_FRAMEDONE (1 << 0)
@@ -57,6 +58,7 @@ enum omap_display_type {
57 OMAP_DISPLAY_TYPE_SDI = 1 << 2, 58 OMAP_DISPLAY_TYPE_SDI = 1 << 2,
58 OMAP_DISPLAY_TYPE_DSI = 1 << 3, 59 OMAP_DISPLAY_TYPE_DSI = 1 << 3,
59 OMAP_DISPLAY_TYPE_VENC = 1 << 4, 60 OMAP_DISPLAY_TYPE_VENC = 1 << 4,
61 OMAP_DISPLAY_TYPE_HDMI = 1 << 5,
60}; 62};
61 63
62enum omap_plane { 64enum omap_plane {
@@ -226,6 +228,23 @@ struct omap_dss_board_info {
226 struct omap_dss_device *default_device; 228 struct omap_dss_device *default_device;
227}; 229};
228 230
231#if defined(CONFIG_OMAP2_DSS_MODULE) || defined(CONFIG_OMAP2_DSS)
232/* Init with the board info */
233extern int omap_display_init(struct omap_dss_board_info *board_data);
234#else
235static inline int omap_display_init(struct omap_dss_board_info *board_data)
236{
237 return 0;
238}
239#endif
240
241struct omap_display_platform_data {
242 struct omap_dss_board_info *board_data;
243 /* TODO: Additional members to be added when PM is considered */
244
245 bool (*opt_clock_available)(const char *clk_role);
246};
247
229struct omap_video_timings { 248struct omap_video_timings {
230 /* Unit: pixels */ 249 /* Unit: pixels */
231 u16 x_res; 250 u16 x_res;
@@ -385,8 +404,8 @@ struct omap_dss_device {
385 struct { 404 struct {
386 u16 regn; 405 u16 regn;
387 u16 regm; 406 u16 regm;
388 u16 regm3; 407 u16 regm_dispc;
389 u16 regm4; 408 u16 regm_dsi;
390 409
391 u16 lp_clk_div; 410 u16 lp_clk_div;
392 411
@@ -544,6 +563,9 @@ int omap_dsi_update(struct omap_dss_device *dssdev,
544 int channel, 563 int channel,
545 u16 x, u16 y, u16 w, u16 h, 564 u16 x, u16 y, u16 w, u16 h,
546 void (*callback)(int, void *), void *data); 565 void (*callback)(int, void *), void *data);
566int omap_dsi_request_vc(struct omap_dss_device *dssdev, int *channel);
567int omap_dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id);
568void omap_dsi_release_vc(struct omap_dss_device *dssdev, int channel);
547 569
548int omapdss_dsi_display_enable(struct omap_dss_device *dssdev); 570int omapdss_dsi_display_enable(struct omap_dss_device *dssdev);
549void omapdss_dsi_display_disable(struct omap_dss_device *dssdev); 571void omapdss_dsi_display_disable(struct omap_dss_device *dssdev);
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index dfa3aff9761b..d6c70d2f4030 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -3,6 +3,12 @@
3 * 3 *
4 * OMAP Dual-Mode Timers 4 * OMAP Dual-Mode Timers
5 * 5 *
6 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
7 * Tarun Kanti DebBarma <tarun.kanti@ti.com>
8 * Thara Gopinath <thara@ti.com>
9 *
10 * Platform device conversion and hwmod support.
11 *
6 * Copyright (C) 2005 Nokia Corporation 12 * Copyright (C) 2005 Nokia Corporation
7 * Author: Lauri Leukkunen <lauri.leukkunen@nokia.com> 13 * Author: Lauri Leukkunen <lauri.leukkunen@nokia.com>
8 * PWM and clock framwork support by Timo Teras. 14 * PWM and clock framwork support by Timo Teras.
@@ -44,6 +50,11 @@
44#define OMAP_TIMER_TRIGGER_OVERFLOW 0x01 50#define OMAP_TIMER_TRIGGER_OVERFLOW 0x01
45#define OMAP_TIMER_TRIGGER_OVERFLOW_AND_COMPARE 0x02 51#define OMAP_TIMER_TRIGGER_OVERFLOW_AND_COMPARE 0x02
46 52
53/*
54 * IP revision identifier so that Highlander IP
55 * in OMAP4 can be distinguished.
56 */
57#define OMAP_TIMER_IP_VERSION_1 0x1
47struct omap_dm_timer; 58struct omap_dm_timer;
48extern struct omap_dm_timer *gptimer_wakeup; 59extern struct omap_dm_timer *gptimer_wakeup;
49extern struct sys_timer omap_timer; 60extern struct sys_timer omap_timer;
diff --git a/arch/arm/plat-omap/include/plat/fpga.h b/arch/arm/plat-omap/include/plat/fpga.h
index ae39bcb3f5ba..bd3c6324ae1f 100644
--- a/arch/arm/plat-omap/include/plat/fpga.h
+++ b/arch/arm/plat-omap/include/plat/fpga.h
@@ -30,18 +30,18 @@ extern void omap1510_fpga_init_irq(void);
30 * --------------------------------------------------------------------------- 30 * ---------------------------------------------------------------------------
31 */ 31 */
32/* maps in the FPGA registers and the ETHR registers */ 32/* maps in the FPGA registers and the ETHR registers */
33#define H2P2_DBG_FPGA_BASE IOMEM(0xE8000000) /* VA */ 33#define H2P2_DBG_FPGA_BASE 0xE8000000 /* VA */
34#define H2P2_DBG_FPGA_SIZE SZ_4K /* SIZE */ 34#define H2P2_DBG_FPGA_SIZE SZ_4K /* SIZE */
35#define H2P2_DBG_FPGA_START 0x04000000 /* PA */ 35#define H2P2_DBG_FPGA_START 0x04000000 /* PA */
36 36
37#define H2P2_DBG_FPGA_ETHR_START (H2P2_DBG_FPGA_START + 0x300) 37#define H2P2_DBG_FPGA_ETHR_START (H2P2_DBG_FPGA_START + 0x300)
38#define H2P2_DBG_FPGA_FPGA_REV (H2P2_DBG_FPGA_BASE + 0x10) /* FPGA Revision */ 38#define H2P2_DBG_FPGA_FPGA_REV IOMEM(H2P2_DBG_FPGA_BASE + 0x10) /* FPGA Revision */
39#define H2P2_DBG_FPGA_BOARD_REV (H2P2_DBG_FPGA_BASE + 0x12) /* Board Revision */ 39#define H2P2_DBG_FPGA_BOARD_REV IOMEM(H2P2_DBG_FPGA_BASE + 0x12) /* Board Revision */
40#define H2P2_DBG_FPGA_GPIO (H2P2_DBG_FPGA_BASE + 0x14) /* GPIO outputs */ 40#define H2P2_DBG_FPGA_GPIO IOMEM(H2P2_DBG_FPGA_BASE + 0x14) /* GPIO outputs */
41#define H2P2_DBG_FPGA_LEDS (H2P2_DBG_FPGA_BASE + 0x16) /* LEDs outputs */ 41#define H2P2_DBG_FPGA_LEDS IOMEM(H2P2_DBG_FPGA_BASE + 0x16) /* LEDs outputs */
42#define H2P2_DBG_FPGA_MISC_INPUTS (H2P2_DBG_FPGA_BASE + 0x18) /* Misc inputs */ 42#define H2P2_DBG_FPGA_MISC_INPUTS IOMEM(H2P2_DBG_FPGA_BASE + 0x18) /* Misc inputs */
43#define H2P2_DBG_FPGA_LAN_STATUS (H2P2_DBG_FPGA_BASE + 0x1A) /* LAN Status line */ 43#define H2P2_DBG_FPGA_LAN_STATUS IOMEM(H2P2_DBG_FPGA_BASE + 0x1A) /* LAN Status line */
44#define H2P2_DBG_FPGA_LAN_RESET (H2P2_DBG_FPGA_BASE + 0x1C) /* LAN Reset line */ 44#define H2P2_DBG_FPGA_LAN_RESET IOMEM(H2P2_DBG_FPGA_BASE + 0x1C) /* LAN Reset line */
45 45
46/* NOTE: most boards don't have a static mapping for the FPGA ... */ 46/* NOTE: most boards don't have a static mapping for the FPGA ... */
47struct h2p2_dbg_fpga { 47struct h2p2_dbg_fpga {
@@ -81,55 +81,55 @@ struct h2p2_dbg_fpga {
81 * OMAP-1510 FPGA 81 * OMAP-1510 FPGA
82 * --------------------------------------------------------------------------- 82 * ---------------------------------------------------------------------------
83 */ 83 */
84#define OMAP1510_FPGA_BASE IOMEM(0xE8000000) /* VA */ 84#define OMAP1510_FPGA_BASE 0xE8000000 /* VA */
85#define OMAP1510_FPGA_SIZE SZ_4K 85#define OMAP1510_FPGA_SIZE SZ_4K
86#define OMAP1510_FPGA_START 0x08000000 /* PA */ 86#define OMAP1510_FPGA_START 0x08000000 /* PA */
87 87
88/* Revision */ 88/* Revision */
89#define OMAP1510_FPGA_REV_LOW (OMAP1510_FPGA_BASE + 0x0) 89#define OMAP1510_FPGA_REV_LOW IOMEM(OMAP1510_FPGA_BASE + 0x0)
90#define OMAP1510_FPGA_REV_HIGH (OMAP1510_FPGA_BASE + 0x1) 90#define OMAP1510_FPGA_REV_HIGH IOMEM(OMAP1510_FPGA_BASE + 0x1)
91 91
92#define OMAP1510_FPGA_LCD_PANEL_CONTROL (OMAP1510_FPGA_BASE + 0x2) 92#define OMAP1510_FPGA_LCD_PANEL_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x2)
93#define OMAP1510_FPGA_LED_DIGIT (OMAP1510_FPGA_BASE + 0x3) 93#define OMAP1510_FPGA_LED_DIGIT IOMEM(OMAP1510_FPGA_BASE + 0x3)
94#define INNOVATOR_FPGA_HID_SPI (OMAP1510_FPGA_BASE + 0x4) 94#define INNOVATOR_FPGA_HID_SPI IOMEM(OMAP1510_FPGA_BASE + 0x4)
95#define OMAP1510_FPGA_POWER (OMAP1510_FPGA_BASE + 0x5) 95#define OMAP1510_FPGA_POWER IOMEM(OMAP1510_FPGA_BASE + 0x5)
96 96
97/* Interrupt status */ 97/* Interrupt status */
98#define OMAP1510_FPGA_ISR_LO (OMAP1510_FPGA_BASE + 0x6) 98#define OMAP1510_FPGA_ISR_LO IOMEM(OMAP1510_FPGA_BASE + 0x6)
99#define OMAP1510_FPGA_ISR_HI (OMAP1510_FPGA_BASE + 0x7) 99#define OMAP1510_FPGA_ISR_HI IOMEM(OMAP1510_FPGA_BASE + 0x7)
100 100
101/* Interrupt mask */ 101/* Interrupt mask */
102#define OMAP1510_FPGA_IMR_LO (OMAP1510_FPGA_BASE + 0x8) 102#define OMAP1510_FPGA_IMR_LO IOMEM(OMAP1510_FPGA_BASE + 0x8)
103#define OMAP1510_FPGA_IMR_HI (OMAP1510_FPGA_BASE + 0x9) 103#define OMAP1510_FPGA_IMR_HI IOMEM(OMAP1510_FPGA_BASE + 0x9)
104 104
105/* Reset registers */ 105/* Reset registers */
106#define OMAP1510_FPGA_HOST_RESET (OMAP1510_FPGA_BASE + 0xa) 106#define OMAP1510_FPGA_HOST_RESET IOMEM(OMAP1510_FPGA_BASE + 0xa)
107#define OMAP1510_FPGA_RST (OMAP1510_FPGA_BASE + 0xb) 107#define OMAP1510_FPGA_RST IOMEM(OMAP1510_FPGA_BASE + 0xb)
108 108
109#define OMAP1510_FPGA_AUDIO (OMAP1510_FPGA_BASE + 0xc) 109#define OMAP1510_FPGA_AUDIO IOMEM(OMAP1510_FPGA_BASE + 0xc)
110#define OMAP1510_FPGA_DIP (OMAP1510_FPGA_BASE + 0xe) 110#define OMAP1510_FPGA_DIP IOMEM(OMAP1510_FPGA_BASE + 0xe)
111#define OMAP1510_FPGA_FPGA_IO (OMAP1510_FPGA_BASE + 0xf) 111#define OMAP1510_FPGA_FPGA_IO IOMEM(OMAP1510_FPGA_BASE + 0xf)
112#define OMAP1510_FPGA_UART1 (OMAP1510_FPGA_BASE + 0x14) 112#define OMAP1510_FPGA_UART1 IOMEM(OMAP1510_FPGA_BASE + 0x14)
113#define OMAP1510_FPGA_UART2 (OMAP1510_FPGA_BASE + 0x15) 113#define OMAP1510_FPGA_UART2 IOMEM(OMAP1510_FPGA_BASE + 0x15)
114#define OMAP1510_FPGA_OMAP1510_STATUS (OMAP1510_FPGA_BASE + 0x16) 114#define OMAP1510_FPGA_OMAP1510_STATUS IOMEM(OMAP1510_FPGA_BASE + 0x16)
115#define OMAP1510_FPGA_BOARD_REV (OMAP1510_FPGA_BASE + 0x18) 115#define OMAP1510_FPGA_BOARD_REV IOMEM(OMAP1510_FPGA_BASE + 0x18)
116#define OMAP1510P1_PPT_DATA (OMAP1510_FPGA_BASE + 0x100) 116#define OMAP1510P1_PPT_DATA IOMEM(OMAP1510_FPGA_BASE + 0x100)
117#define OMAP1510P1_PPT_STATUS (OMAP1510_FPGA_BASE + 0x101) 117#define OMAP1510P1_PPT_STATUS IOMEM(OMAP1510_FPGA_BASE + 0x101)
118#define OMAP1510P1_PPT_CONTROL (OMAP1510_FPGA_BASE + 0x102) 118#define OMAP1510P1_PPT_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x102)
119 119
120#define OMAP1510_FPGA_TOUCHSCREEN (OMAP1510_FPGA_BASE + 0x204) 120#define OMAP1510_FPGA_TOUCHSCREEN IOMEM(OMAP1510_FPGA_BASE + 0x204)
121 121
122#define INNOVATOR_FPGA_INFO (OMAP1510_FPGA_BASE + 0x205) 122#define INNOVATOR_FPGA_INFO IOMEM(OMAP1510_FPGA_BASE + 0x205)
123#define INNOVATOR_FPGA_LCD_BRIGHT_LO (OMAP1510_FPGA_BASE + 0x206) 123#define INNOVATOR_FPGA_LCD_BRIGHT_LO IOMEM(OMAP1510_FPGA_BASE + 0x206)
124#define INNOVATOR_FPGA_LCD_BRIGHT_HI (OMAP1510_FPGA_BASE + 0x207) 124#define INNOVATOR_FPGA_LCD_BRIGHT_HI IOMEM(OMAP1510_FPGA_BASE + 0x207)
125#define INNOVATOR_FPGA_LED_GRN_LO (OMAP1510_FPGA_BASE + 0x208) 125#define INNOVATOR_FPGA_LED_GRN_LO IOMEM(OMAP1510_FPGA_BASE + 0x208)
126#define INNOVATOR_FPGA_LED_GRN_HI (OMAP1510_FPGA_BASE + 0x209) 126#define INNOVATOR_FPGA_LED_GRN_HI IOMEM(OMAP1510_FPGA_BASE + 0x209)
127#define INNOVATOR_FPGA_LED_RED_LO (OMAP1510_FPGA_BASE + 0x20a) 127#define INNOVATOR_FPGA_LED_RED_LO IOMEM(OMAP1510_FPGA_BASE + 0x20a)
128#define INNOVATOR_FPGA_LED_RED_HI (OMAP1510_FPGA_BASE + 0x20b) 128#define INNOVATOR_FPGA_LED_RED_HI IOMEM(OMAP1510_FPGA_BASE + 0x20b)
129#define INNOVATOR_FPGA_CAM_USB_CONTROL (OMAP1510_FPGA_BASE + 0x20c) 129#define INNOVATOR_FPGA_CAM_USB_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x20c)
130#define INNOVATOR_FPGA_EXP_CONTROL (OMAP1510_FPGA_BASE + 0x20d) 130#define INNOVATOR_FPGA_EXP_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x20d)
131#define INNOVATOR_FPGA_ISR2 (OMAP1510_FPGA_BASE + 0x20e) 131#define INNOVATOR_FPGA_ISR2 IOMEM(OMAP1510_FPGA_BASE + 0x20e)
132#define INNOVATOR_FPGA_IMR2 (OMAP1510_FPGA_BASE + 0x210) 132#define INNOVATOR_FPGA_IMR2 IOMEM(OMAP1510_FPGA_BASE + 0x210)
133 133
134#define OMAP1510_FPGA_ETHR_START (OMAP1510_FPGA_START + 0x300) 134#define OMAP1510_FPGA_ETHR_START (OMAP1510_FPGA_START + 0x300)
135 135
diff --git a/arch/arm/plat-omap/include/plat/gpmc.h b/arch/arm/plat-omap/include/plat/gpmc.h
index 85ded598853e..12b316165037 100644
--- a/arch/arm/plat-omap/include/plat/gpmc.h
+++ b/arch/arm/plat-omap/include/plat/gpmc.h
@@ -41,6 +41,8 @@
41#define GPMC_NAND_ADDRESS 0x0000000b 41#define GPMC_NAND_ADDRESS 0x0000000b
42#define GPMC_NAND_DATA 0x0000000c 42#define GPMC_NAND_DATA 0x0000000c
43 43
44#define GPMC_ENABLE_IRQ 0x0000000d
45
44/* ECC commands */ 46/* ECC commands */
45#define GPMC_ECC_READ 0 /* Reset Hardware ECC for read */ 47#define GPMC_ECC_READ 0 /* Reset Hardware ECC for read */
46#define GPMC_ECC_WRITE 1 /* Reset Hardware ECC for write */ 48#define GPMC_ECC_WRITE 1 /* Reset Hardware ECC for write */
@@ -78,6 +80,19 @@
78#define WR_RD_PIN_MONITORING 0x00600000 80#define WR_RD_PIN_MONITORING 0x00600000
79#define GPMC_PREFETCH_STATUS_FIFO_CNT(val) ((val >> 24) & 0x7F) 81#define GPMC_PREFETCH_STATUS_FIFO_CNT(val) ((val >> 24) & 0x7F)
80#define GPMC_PREFETCH_STATUS_COUNT(val) (val & 0x00003fff) 82#define GPMC_PREFETCH_STATUS_COUNT(val) (val & 0x00003fff)
83#define GPMC_IRQ_FIFOEVENTENABLE 0x01
84#define GPMC_IRQ_COUNT_EVENT 0x02
85
86#define PREFETCH_FIFOTHRESHOLD_MAX 0x40
87#define PREFETCH_FIFOTHRESHOLD(val) ((val) << 8)
88
89enum omap_ecc {
90 /* 1-bit ecc: stored at end of spare area */
91 OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */
92 OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */
93 /* 1-bit ecc: stored at begining of spare area as romcode */
94 OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */
95};
81 96
82/* 97/*
83 * Note that all values in this struct are in nanoseconds except sync_clk 98 * Note that all values in this struct are in nanoseconds except sync_clk
@@ -130,12 +145,11 @@ extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base);
130extern void gpmc_cs_free(int cs); 145extern void gpmc_cs_free(int cs);
131extern int gpmc_cs_set_reserved(int cs, int reserved); 146extern int gpmc_cs_set_reserved(int cs, int reserved);
132extern int gpmc_cs_reserved(int cs); 147extern int gpmc_cs_reserved(int cs);
133extern int gpmc_prefetch_enable(int cs, int dma_mode, 148extern int gpmc_prefetch_enable(int cs, int fifo_th, int dma_mode,
134 unsigned int u32_count, int is_write); 149 unsigned int u32_count, int is_write);
135extern int gpmc_prefetch_reset(int cs); 150extern int gpmc_prefetch_reset(int cs);
136extern void omap3_gpmc_save_context(void); 151extern void omap3_gpmc_save_context(void);
137extern void omap3_gpmc_restore_context(void); 152extern void omap3_gpmc_restore_context(void);
138extern void gpmc_init(void);
139extern int gpmc_read_status(int cmd); 153extern int gpmc_read_status(int cmd);
140extern int gpmc_cs_configure(int cs, int cmd, int wval); 154extern int gpmc_cs_configure(int cs, int cmd, int wval);
141extern int gpmc_nand_read(int cs, int cmd); 155extern int gpmc_nand_read(int cs, int cmd);
diff --git a/arch/arm/plat-omap/include/plat/hardware.h b/arch/arm/plat-omap/include/plat/hardware.h
index d5b26adfb890..e87efe1499b8 100644
--- a/arch/arm/plat-omap/include/plat/hardware.h
+++ b/arch/arm/plat-omap/include/plat/hardware.h
@@ -286,5 +286,6 @@
286#include <plat/omap24xx.h> 286#include <plat/omap24xx.h>
287#include <plat/omap34xx.h> 287#include <plat/omap34xx.h>
288#include <plat/omap44xx.h> 288#include <plat/omap44xx.h>
289#include <plat/ti816x.h>
289 290
290#endif /* __ASM_ARCH_OMAP_HARDWARE_H */ 291#endif /* __ASM_ARCH_OMAP_HARDWARE_H */
diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h
index ef4106c13183..d72ec85c97e6 100644
--- a/arch/arm/plat-omap/include/plat/io.h
+++ b/arch/arm/plat-omap/include/plat/io.h
@@ -259,7 +259,7 @@ struct omap_sdrc_params;
259extern void omap1_map_common_io(void); 259extern void omap1_map_common_io(void);
260extern void omap1_init_common_hw(void); 260extern void omap1_init_common_hw(void);
261 261
262#ifdef CONFIG_ARCH_OMAP2420 262#ifdef CONFIG_SOC_OMAP2420
263extern void omap242x_map_common_io(void); 263extern void omap242x_map_common_io(void);
264#else 264#else
265static inline void omap242x_map_common_io(void) 265static inline void omap242x_map_common_io(void)
@@ -267,7 +267,7 @@ static inline void omap242x_map_common_io(void)
267} 267}
268#endif 268#endif
269 269
270#ifdef CONFIG_ARCH_OMAP2430 270#ifdef CONFIG_SOC_OMAP2430
271extern void omap243x_map_common_io(void); 271extern void omap243x_map_common_io(void);
272#else 272#else
273static inline void omap243x_map_common_io(void) 273static inline void omap243x_map_common_io(void)
@@ -283,6 +283,14 @@ static inline void omap34xx_map_common_io(void)
283} 283}
284#endif 284#endif
285 285
286#ifdef CONFIG_SOC_OMAPTI816X
287extern void omapti816x_map_common_io(void);
288#else
289static inline void omapti816x_map_common_io(void)
290{
291}
292#endif
293
286#ifdef CONFIG_ARCH_OMAP4 294#ifdef CONFIG_ARCH_OMAP4
287extern void omap44xx_map_common_io(void); 295extern void omap44xx_map_common_io(void);
288#else 296#else
diff --git a/arch/arm/plat-omap/include/plat/iommu.h b/arch/arm/plat-omap/include/plat/iommu.h
index 69230d685538..174f1b9c8c03 100644
--- a/arch/arm/plat-omap/include/plat/iommu.h
+++ b/arch/arm/plat-omap/include/plat/iommu.h
@@ -31,6 +31,7 @@ struct iommu {
31 struct clk *clk; 31 struct clk *clk;
32 void __iomem *regbase; 32 void __iomem *regbase;
33 struct device *dev; 33 struct device *dev;
34 void *isr_priv;
34 35
35 unsigned int refcount; 36 unsigned int refcount;
36 struct mutex iommu_lock; /* global for this whole object */ 37 struct mutex iommu_lock; /* global for this whole object */
@@ -47,7 +48,7 @@ struct iommu {
47 struct list_head mmap; 48 struct list_head mmap;
48 struct mutex mmap_lock; /* protect mmap */ 49 struct mutex mmap_lock; /* protect mmap */
49 50
50 int (*isr)(struct iommu *obj); 51 int (*isr)(struct iommu *obj, u32 da, u32 iommu_errs, void *priv);
51 52
52 void *ctx; /* iommu context: registres saved area */ 53 void *ctx; /* iommu context: registres saved area */
53 u32 da_start; 54 u32 da_start;
@@ -109,6 +110,13 @@ struct iommu_platform_data {
109 u32 da_end; 110 u32 da_end;
110}; 111};
111 112
113/* IOMMU errors */
114#define OMAP_IOMMU_ERR_TLB_MISS (1 << 0)
115#define OMAP_IOMMU_ERR_TRANS_FAULT (1 << 1)
116#define OMAP_IOMMU_ERR_EMU_MISS (1 << 2)
117#define OMAP_IOMMU_ERR_TBLWALK_FAULT (1 << 3)
118#define OMAP_IOMMU_ERR_MULTIHIT_FAULT (1 << 4)
119
112#if defined(CONFIG_ARCH_OMAP1) 120#if defined(CONFIG_ARCH_OMAP1)
113#error "iommu for this processor not implemented yet" 121#error "iommu for this processor not implemented yet"
114#else 122#else
@@ -154,11 +162,17 @@ extern void flush_iotlb_range(struct iommu *obj, u32 start, u32 end);
154extern void flush_iotlb_all(struct iommu *obj); 162extern void flush_iotlb_all(struct iommu *obj);
155 163
156extern int iopgtable_store_entry(struct iommu *obj, struct iotlb_entry *e); 164extern int iopgtable_store_entry(struct iommu *obj, struct iotlb_entry *e);
165extern void iopgtable_lookup_entry(struct iommu *obj, u32 da, u32 **ppgd,
166 u32 **ppte);
157extern size_t iopgtable_clear_entry(struct iommu *obj, u32 iova); 167extern size_t iopgtable_clear_entry(struct iommu *obj, u32 iova);
158 168
159extern int iommu_set_da_range(struct iommu *obj, u32 start, u32 end); 169extern int iommu_set_da_range(struct iommu *obj, u32 start, u32 end);
160extern struct iommu *iommu_get(const char *name); 170extern struct iommu *iommu_get(const char *name);
161extern void iommu_put(struct iommu *obj); 171extern void iommu_put(struct iommu *obj);
172extern int iommu_set_isr(const char *name,
173 int (*isr)(struct iommu *obj, u32 da, u32 iommu_errs,
174 void *priv),
175 void *isr_priv);
162 176
163extern void iommu_save_ctx(struct iommu *obj); 177extern void iommu_save_ctx(struct iommu *obj);
164extern void iommu_restore_ctx(struct iommu *obj); 178extern void iommu_restore_ctx(struct iommu *obj);
diff --git a/arch/arm/plat-omap/include/plat/iovmm.h b/arch/arm/plat-omap/include/plat/iovmm.h
index bdc7ce5d7a4a..32a2f6c4d39e 100644
--- a/arch/arm/plat-omap/include/plat/iovmm.h
+++ b/arch/arm/plat-omap/include/plat/iovmm.h
@@ -71,8 +71,6 @@ struct iovm_struct {
71#define IOVMF_LINEAR_MASK (3 << (2 + IOVMF_SW_SHIFT)) 71#define IOVMF_LINEAR_MASK (3 << (2 + IOVMF_SW_SHIFT))
72 72
73#define IOVMF_DA_FIXED (1 << (4 + IOVMF_SW_SHIFT)) 73#define IOVMF_DA_FIXED (1 << (4 + IOVMF_SW_SHIFT))
74#define IOVMF_DA_ANON (2 << (4 + IOVMF_SW_SHIFT))
75#define IOVMF_DA_MASK (3 << (4 + IOVMF_SW_SHIFT))
76 74
77 75
78extern struct iovm_struct *find_iovm_area(struct iommu *obj, u32 da); 76extern struct iovm_struct *find_iovm_area(struct iommu *obj, u32 da);
diff --git a/arch/arm/plat-omap/include/plat/irqs.h b/arch/arm/plat-omap/include/plat/irqs.h
index 2910de921c52..d77928370463 100644
--- a/arch/arm/plat-omap/include/plat/irqs.h
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -315,9 +315,12 @@
315#define INT_34XX_SSM_ABORT_IRQ 6 315#define INT_34XX_SSM_ABORT_IRQ 6
316#define INT_34XX_SYS_NIRQ 7 316#define INT_34XX_SYS_NIRQ 7
317#define INT_34XX_D2D_FW_IRQ 8 317#define INT_34XX_D2D_FW_IRQ 8
318#define INT_34XX_L3_DBG_IRQ 9
319#define INT_34XX_L3_APP_IRQ 10
318#define INT_34XX_PRCM_MPU_IRQ 11 320#define INT_34XX_PRCM_MPU_IRQ 11
319#define INT_34XX_MCBSP1_IRQ 16 321#define INT_34XX_MCBSP1_IRQ 16
320#define INT_34XX_MCBSP2_IRQ 17 322#define INT_34XX_MCBSP2_IRQ 17
323#define INT_34XX_GPMC_IRQ 20
321#define INT_34XX_MCBSP3_IRQ 22 324#define INT_34XX_MCBSP3_IRQ 22
322#define INT_34XX_MCBSP4_IRQ 23 325#define INT_34XX_MCBSP4_IRQ 23
323#define INT_34XX_CAM_IRQ 24 326#define INT_34XX_CAM_IRQ 24
@@ -411,7 +414,13 @@
411#define TWL_IRQ_END TWL6030_IRQ_END 414#define TWL_IRQ_END TWL6030_IRQ_END
412#endif 415#endif
413 416
414#define NR_IRQS TWL_IRQ_END 417/* GPMC related */
418#define OMAP_GPMC_IRQ_BASE (TWL_IRQ_END)
419#define OMAP_GPMC_NR_IRQS 7
420#define OMAP_GPMC_IRQ_END (OMAP_GPMC_IRQ_BASE + OMAP_GPMC_NR_IRQS)
421
422
423#define NR_IRQS OMAP_GPMC_IRQ_END
415 424
416#define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32)) 425#define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32))
417 426
diff --git a/arch/arm/plat-omap/include/plat/l3_2xxx.h b/arch/arm/plat-omap/include/plat/l3_2xxx.h
new file mode 100644
index 000000000000..b8b5641379b0
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/l3_2xxx.h
@@ -0,0 +1,20 @@
1/*
2 * arch/arm/plat-omap/include/plat/l3_2xxx.h - L3 firewall definitions
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 * Sumit Semwal
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 */
13#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_L3_2XXX_H
14#define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_L3_2XXX_H
15
16/* L3 CONNIDs */
17/* Display Sub system (DSS) */
18#define OMAP2_L3_CORE_FW_CONNID_DSS 8
19
20#endif
diff --git a/arch/arm/plat-omap/include/plat/l3_3xxx.h b/arch/arm/plat-omap/include/plat/l3_3xxx.h
new file mode 100644
index 000000000000..cde1938c5f82
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/l3_3xxx.h
@@ -0,0 +1,20 @@
1/*
2 * arch/arm/plat-omap/include/plat/l3_3xxx.h - L3 firewall definitions
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 * Sumit Semwal
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 */
13#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_L3_3XXX_H
14#define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_L3_3XXX_H
15
16/* L3 Initiator IDs */
17/* Display Sub system (DSS) */
18#define OMAP3_L3_CORE_FW_INIT_ID_DSS 29
19
20#endif
diff --git a/arch/arm/plat-omap/include/plat/l4_2xxx.h b/arch/arm/plat-omap/include/plat/l4_2xxx.h
new file mode 100644
index 000000000000..3f39cf8a35c6
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/l4_2xxx.h
@@ -0,0 +1,24 @@
1/*
2 * arch/arm/plat-omap/include/plat/l4_2xxx.h - L4 firewall definitions
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 * Sumit Semwal
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 */
13#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_L4_2XXX_H
14#define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_L4_2XXX_H
15
16/* L4 CORE */
17/* Display Sub system (DSS) */
18#define OMAP2420_L4_CORE_FW_DSS_CORE_REGION 28
19#define OMAP2420_L4_CORE_FW_DSS_DISPC_REGION 29
20#define OMAP2420_L4_CORE_FW_DSS_RFBI_REGION 30
21#define OMAP2420_L4_CORE_FW_DSS_VENC_REGION 31
22#define OMAP2420_L4_CORE_FW_DSS_TA_REGION 32
23
24#endif
diff --git a/arch/arm/plat-omap/include/plat/l4_3xxx.h b/arch/arm/plat-omap/include/plat/l4_3xxx.h
index 5e1949375422..881a858b1ffc 100644
--- a/arch/arm/plat-omap/include/plat/l4_3xxx.h
+++ b/arch/arm/plat-omap/include/plat/l4_3xxx.h
@@ -21,4 +21,14 @@
21#define OMAP3_L4_CORE_FW_I2C3_REGION 73 21#define OMAP3_L4_CORE_FW_I2C3_REGION 73
22#define OMAP3_L4_CORE_FW_I2C3_TA_REGION 74 22#define OMAP3_L4_CORE_FW_I2C3_TA_REGION 74
23 23
24/* Display Sub system (DSS) */
25#define OMAP3_L4_CORE_FW_DSS_PROT_GROUP 2
26
27#define OMAP3_L4_CORE_FW_DSS_DSI_REGION 104
28#define OMAP3ES1_L4_CORE_FW_DSS_CORE_REGION 3
29#define OMAP3_L4_CORE_FW_DSS_CORE_REGION 4
30#define OMAP3_L4_CORE_FW_DSS_DISPC_REGION 4
31#define OMAP3_L4_CORE_FW_DSS_RFBI_REGION 5
32#define OMAP3_L4_CORE_FW_DSS_VENC_REGION 6
33#define OMAP3_L4_CORE_FW_DSS_TA_REGION 7
24#endif 34#endif
diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h b/arch/arm/plat-omap/include/plat/mcbsp.h
index b87d83ccd545..f8f690ab2997 100644
--- a/arch/arm/plat-omap/include/plat/mcbsp.h
+++ b/arch/arm/plat-omap/include/plat/mcbsp.h
@@ -37,6 +37,10 @@ static struct platform_device omap_mcbsp##port_nr = { \
37 .id = OMAP_MCBSP##port_nr, \ 37 .id = OMAP_MCBSP##port_nr, \
38} 38}
39 39
40#define MCBSP_CONFIG_TYPE2 0x2
41#define MCBSP_CONFIG_TYPE3 0x3
42#define MCBSP_CONFIG_TYPE4 0x4
43
40#define OMAP7XX_MCBSP1_BASE 0xfffb1000 44#define OMAP7XX_MCBSP1_BASE 0xfffb1000
41#define OMAP7XX_MCBSP2_BASE 0xfffb1800 45#define OMAP7XX_MCBSP2_BASE 0xfffb1800
42 46
@@ -48,32 +52,14 @@ static struct platform_device omap_mcbsp##port_nr = { \
48#define OMAP1610_MCBSP2_BASE 0xfffb1000 52#define OMAP1610_MCBSP2_BASE 0xfffb1000
49#define OMAP1610_MCBSP3_BASE 0xe1017000 53#define OMAP1610_MCBSP3_BASE 0xe1017000
50 54
51#define OMAP24XX_MCBSP1_BASE 0x48074000 55#ifdef CONFIG_ARCH_OMAP1
52#define OMAP24XX_MCBSP2_BASE 0x48076000
53#define OMAP2430_MCBSP3_BASE 0x4808c000
54#define OMAP2430_MCBSP4_BASE 0x4808e000
55#define OMAP2430_MCBSP5_BASE 0x48096000
56
57#define OMAP34XX_MCBSP1_BASE 0x48074000
58#define OMAP34XX_MCBSP2_BASE 0x49022000
59#define OMAP34XX_MCBSP2_ST_BASE 0x49028000
60#define OMAP34XX_MCBSP3_BASE 0x49024000
61#define OMAP34XX_MCBSP3_ST_BASE 0x4902A000
62#define OMAP34XX_MCBSP3_BASE 0x49024000
63#define OMAP34XX_MCBSP4_BASE 0x49026000
64#define OMAP34XX_MCBSP5_BASE 0x48096000
65
66#define OMAP44XX_MCBSP1_BASE 0x49022000
67#define OMAP44XX_MCBSP2_BASE 0x49024000
68#define OMAP44XX_MCBSP3_BASE 0x49026000
69#define OMAP44XX_MCBSP4_BASE 0x48096000
70
71#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
72 56
73#define OMAP_MCBSP_REG_DRR2 0x00 57#define OMAP_MCBSP_REG_DRR2 0x00
74#define OMAP_MCBSP_REG_DRR1 0x02 58#define OMAP_MCBSP_REG_DRR1 0x02
75#define OMAP_MCBSP_REG_DXR2 0x04 59#define OMAP_MCBSP_REG_DXR2 0x04
76#define OMAP_MCBSP_REG_DXR1 0x06 60#define OMAP_MCBSP_REG_DXR1 0x06
61#define OMAP_MCBSP_REG_DRR 0x02
62#define OMAP_MCBSP_REG_DXR 0x06
77#define OMAP_MCBSP_REG_SPCR2 0x08 63#define OMAP_MCBSP_REG_SPCR2 0x08
78#define OMAP_MCBSP_REG_SPCR1 0x0a 64#define OMAP_MCBSP_REG_SPCR1 0x0a
79#define OMAP_MCBSP_REG_RCR2 0x0c 65#define OMAP_MCBSP_REG_RCR2 0x0c
@@ -106,13 +92,6 @@ static struct platform_device omap_mcbsp##port_nr = { \
106#define OMAP_MCBSP_REG_XCCR 0x00 92#define OMAP_MCBSP_REG_XCCR 0x00
107#define OMAP_MCBSP_REG_RCCR 0x00 93#define OMAP_MCBSP_REG_RCCR 0x00
108 94
109#define AUDIO_MCBSP_DATAWRITE (OMAP1510_MCBSP1_BASE + OMAP_MCBSP_REG_DXR1)
110#define AUDIO_MCBSP_DATAREAD (OMAP1510_MCBSP1_BASE + OMAP_MCBSP_REG_DRR1)
111
112#define AUDIO_MCBSP OMAP_MCBSP1
113#define AUDIO_DMA_TX OMAP_DMA_MCBSP1_TX
114#define AUDIO_DMA_RX OMAP_DMA_MCBSP1_RX
115
116#else 95#else
117 96
118#define OMAP_MCBSP_REG_DRR2 0x00 97#define OMAP_MCBSP_REG_DRR2 0x00
@@ -168,13 +147,6 @@ static struct platform_device omap_mcbsp##port_nr = { \
168#define OMAP_ST_REG_SFIRCR 0x28 147#define OMAP_ST_REG_SFIRCR 0x28
169#define OMAP_ST_REG_SSELCR 0x2C 148#define OMAP_ST_REG_SSELCR 0x2C
170 149
171#define AUDIO_MCBSP_DATAWRITE (OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DXR1)
172#define AUDIO_MCBSP_DATAREAD (OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DRR1)
173
174#define AUDIO_MCBSP OMAP_MCBSP2
175#define AUDIO_DMA_TX OMAP24XX_DMA_MCBSP2_TX
176#define AUDIO_DMA_RX OMAP24XX_DMA_MCBSP2_RX
177
178#endif 150#endif
179 151
180/************************** McBSP SPCR1 bit definitions ***********************/ 152/************************** McBSP SPCR1 bit definitions ***********************/
@@ -428,8 +400,9 @@ struct omap_mcbsp_platform_data {
428#ifdef CONFIG_ARCH_OMAP3 400#ifdef CONFIG_ARCH_OMAP3
429 /* Sidetone block for McBSP 2 and 3 */ 401 /* Sidetone block for McBSP 2 and 3 */
430 unsigned long phys_base_st; 402 unsigned long phys_base_st;
431 u16 buffer_size;
432#endif 403#endif
404 u16 buffer_size;
405 unsigned int mcbsp_config_type;
433}; 406};
434 407
435struct omap_mcbsp_st_data { 408struct omap_mcbsp_st_data {
@@ -445,6 +418,7 @@ struct omap_mcbsp_st_data {
445struct omap_mcbsp { 418struct omap_mcbsp {
446 struct device *dev; 419 struct device *dev;
447 unsigned long phys_base; 420 unsigned long phys_base;
421 unsigned long phys_dma_base;
448 void __iomem *io_base; 422 void __iomem *io_base;
449 u8 id; 423 u8 id;
450 u8 free; 424 u8 free;
@@ -471,7 +445,6 @@ struct omap_mcbsp {
471 /* Protect the field .free, while checking if the mcbsp is in use */ 445 /* Protect the field .free, while checking if the mcbsp is in use */
472 spinlock_t lock; 446 spinlock_t lock;
473 struct omap_mcbsp_platform_data *pdata; 447 struct omap_mcbsp_platform_data *pdata;
474 struct clk *iclk;
475 struct clk *fclk; 448 struct clk *fclk;
476#ifdef CONFIG_ARCH_OMAP3 449#ifdef CONFIG_ARCH_OMAP3
477 struct omap_mcbsp_st_data *st_data; 450 struct omap_mcbsp_st_data *st_data;
@@ -480,7 +453,17 @@ struct omap_mcbsp {
480 u16 max_rx_thres; 453 u16 max_rx_thres;
481#endif 454#endif
482 void *reg_cache; 455 void *reg_cache;
456 unsigned int mcbsp_config_type;
483}; 457};
458
459/**
460 * omap_mcbsp_dev_attr - OMAP McBSP device attributes for omap_hwmod
461 * @sidetone: name of the sidetone device
462 */
463struct omap_mcbsp_dev_attr {
464 const char *sidetone;
465};
466
484extern struct omap_mcbsp **mcbsp_ptr; 467extern struct omap_mcbsp **mcbsp_ptr;
485extern int omap_mcbsp_count, omap_mcbsp_cache_size; 468extern int omap_mcbsp_count, omap_mcbsp_cache_size;
486 469
@@ -488,8 +471,8 @@ extern int omap_mcbsp_count, omap_mcbsp_cache_size;
488#define id_to_mcbsp_ptr(id) mcbsp_ptr[id]; 471#define id_to_mcbsp_ptr(id) mcbsp_ptr[id];
489 472
490int omap_mcbsp_init(void); 473int omap_mcbsp_init(void);
491void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config, 474void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
492 int size); 475 struct omap_mcbsp_platform_data *config, int size);
493void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg * config); 476void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg * config);
494#ifdef CONFIG_ARCH_OMAP3 477#ifdef CONFIG_ARCH_OMAP3
495void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold); 478void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold);
@@ -539,6 +522,9 @@ int omap_mcbsp_set_io_type(unsigned int id, omap_mcbsp_io_type_t io_type);
539void omap2_mcbsp1_mux_clkr_src(u8 mux); 522void omap2_mcbsp1_mux_clkr_src(u8 mux);
540void omap2_mcbsp1_mux_fsr_src(u8 mux); 523void omap2_mcbsp1_mux_fsr_src(u8 mux);
541 524
525int omap_mcbsp_dma_ch_params(unsigned int id, unsigned int stream);
526int omap_mcbsp_dma_reg_params(unsigned int id, unsigned int stream);
527
542#ifdef CONFIG_ARCH_OMAP3 528#ifdef CONFIG_ARCH_OMAP3
543/* Sidetone specific API */ 529/* Sidetone specific API */
544int omap_st_set_chgain(unsigned int id, int channel, s16 chgain); 530int omap_st_set_chgain(unsigned int id, int channel, s16 chgain);
diff --git a/arch/arm/plat-omap/include/plat/mcspi.h b/arch/arm/plat-omap/include/plat/mcspi.h
index 1254e4945b6f..3d51b18131cc 100644
--- a/arch/arm/plat-omap/include/plat/mcspi.h
+++ b/arch/arm/plat-omap/include/plat/mcspi.h
@@ -1,8 +1,19 @@
1#ifndef _OMAP2_MCSPI_H 1#ifndef _OMAP2_MCSPI_H
2#define _OMAP2_MCSPI_H 2#define _OMAP2_MCSPI_H
3 3
4#define OMAP2_MCSPI_REV 0
5#define OMAP3_MCSPI_REV 1
6#define OMAP4_MCSPI_REV 2
7
8#define OMAP4_MCSPI_REG_OFFSET 0x100
9
4struct omap2_mcspi_platform_config { 10struct omap2_mcspi_platform_config {
5 unsigned short num_cs; 11 unsigned short num_cs;
12 unsigned int regs_offset;
13};
14
15struct omap2_mcspi_dev_attr {
16 unsigned short num_chipselect;
6}; 17};
7 18
8struct omap2_mcspi_device_config { 19struct omap2_mcspi_device_config {
diff --git a/arch/arm/plat-omap/include/plat/memory.h b/arch/arm/plat-omap/include/plat/memory.h
index f8d922fb5584..e6720aa2d553 100644
--- a/arch/arm/plat-omap/include/plat/memory.h
+++ b/arch/arm/plat-omap/include/plat/memory.h
@@ -37,9 +37,9 @@
37 * Physical DRAM offset. 37 * Physical DRAM offset.
38 */ 38 */
39#if defined(CONFIG_ARCH_OMAP1) 39#if defined(CONFIG_ARCH_OMAP1)
40#define PHYS_OFFSET UL(0x10000000) 40#define PLAT_PHYS_OFFSET UL(0x10000000)
41#else 41#else
42#define PHYS_OFFSET UL(0x80000000) 42#define PLAT_PHYS_OFFSET UL(0x80000000)
43#endif 43#endif
44 44
45/* 45/*
diff --git a/arch/arm/plat-omap/include/plat/mmc.h b/arch/arm/plat-omap/include/plat/mmc.h
index f57f36abb07e..f38fef9f1310 100644
--- a/arch/arm/plat-omap/include/plat/mmc.h
+++ b/arch/arm/plat-omap/include/plat/mmc.h
@@ -24,25 +24,19 @@
24#define OMAP1_MMC2_BASE 0xfffb7c00 /* omap16xx only */ 24#define OMAP1_MMC2_BASE 0xfffb7c00 /* omap16xx only */
25 25
26#define OMAP24XX_NR_MMC 2 26#define OMAP24XX_NR_MMC 2
27#define OMAP34XX_NR_MMC 3
28#define OMAP44XX_NR_MMC 5
29#define OMAP2420_MMC_SIZE OMAP1_MMC_SIZE 27#define OMAP2420_MMC_SIZE OMAP1_MMC_SIZE
30#define OMAP3_HSMMC_SIZE 0x200
31#define OMAP4_HSMMC_SIZE 0x1000
32#define OMAP2_MMC1_BASE 0x4809c000 28#define OMAP2_MMC1_BASE 0x4809c000
33#define OMAP2_MMC2_BASE 0x480b4000 29
34#define OMAP3_MMC3_BASE 0x480ad000
35#define OMAP4_MMC4_BASE 0x480d1000
36#define OMAP4_MMC5_BASE 0x480d5000
37#define OMAP4_MMC_REG_OFFSET 0x100 30#define OMAP4_MMC_REG_OFFSET 0x100
38#define HSMMC5 (1 << 4)
39#define HSMMC4 (1 << 3)
40#define HSMMC3 (1 << 2)
41#define HSMMC2 (1 << 1)
42#define HSMMC1 (1 << 0)
43 31
44#define OMAP_MMC_MAX_SLOTS 2 32#define OMAP_MMC_MAX_SLOTS 2
45 33
34#define OMAP_HSMMC_SUPPORTS_DUAL_VOLT BIT(1)
35
36struct omap_mmc_dev_attr {
37 u8 flags;
38};
39
46struct omap_mmc_platform_data { 40struct omap_mmc_platform_data {
47 /* back-link to device */ 41 /* back-link to device */
48 struct device *dev; 42 struct device *dev;
@@ -71,6 +65,9 @@ struct omap_mmc_platform_data {
71 65
72 u64 dma_mask; 66 u64 dma_mask;
73 67
68 /* Integrating attributes from the omap_hwmod layer */
69 u8 controller_flags;
70
74 /* Register offset deviation */ 71 /* Register offset deviation */
75 u16 reg_offset; 72 u16 reg_offset;
76 73
@@ -159,8 +156,7 @@ extern void omap_mmc_notify_cover_event(struct device *dev, int slot,
159 defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) 156 defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
160void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data, 157void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
161 int nr_controllers); 158 int nr_controllers);
162void omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, 159void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data);
163 int nr_controllers);
164int omap_mmc_add(const char *name, int id, unsigned long base, 160int omap_mmc_add(const char *name, int id, unsigned long base,
165 unsigned long size, unsigned int irq, 161 unsigned long size, unsigned int irq,
166 struct omap_mmc_platform_data *data); 162 struct omap_mmc_platform_data *data);
@@ -169,8 +165,7 @@ static inline void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
169 int nr_controllers) 165 int nr_controllers)
170{ 166{
171} 167}
172static inline void omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, 168static inline void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data)
173 int nr_controllers)
174{ 169{
175} 170}
176static inline int omap_mmc_add(const char *name, int id, unsigned long base, 171static inline int omap_mmc_add(const char *name, int id, unsigned long base,
diff --git a/arch/arm/plat-omap/include/plat/multi.h b/arch/arm/plat-omap/include/plat/multi.h
index ffd909fa5287..999ffba2690c 100644
--- a/arch/arm/plat-omap/include/plat/multi.h
+++ b/arch/arm/plat-omap/include/plat/multi.h
@@ -66,7 +66,7 @@
66# error "OMAP1 and OMAP2PLUS can't be selected at the same time" 66# error "OMAP1 and OMAP2PLUS can't be selected at the same time"
67# endif 67# endif
68#endif 68#endif
69#ifdef CONFIG_ARCH_OMAP2420 69#ifdef CONFIG_SOC_OMAP2420
70# ifdef OMAP_NAME 70# ifdef OMAP_NAME
71# undef MULTI_OMAP2 71# undef MULTI_OMAP2
72# define MULTI_OMAP2 72# define MULTI_OMAP2
@@ -74,7 +74,7 @@
74# define OMAP_NAME omap2420 74# define OMAP_NAME omap2420
75# endif 75# endif
76#endif 76#endif
77#ifdef CONFIG_ARCH_OMAP2430 77#ifdef CONFIG_SOC_OMAP2430
78# ifdef OMAP_NAME 78# ifdef OMAP_NAME
79# undef MULTI_OMAP2 79# undef MULTI_OMAP2
80# define MULTI_OMAP2 80# define MULTI_OMAP2
diff --git a/arch/arm/plat-omap/include/plat/nand.h b/arch/arm/plat-omap/include/plat/nand.h
index 6562cd082bb1..d86d1ecf0068 100644
--- a/arch/arm/plat-omap/include/plat/nand.h
+++ b/arch/arm/plat-omap/include/plat/nand.h
@@ -8,8 +8,16 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#include <plat/gpmc.h>
11#include <linux/mtd/partitions.h> 12#include <linux/mtd/partitions.h>
12 13
14enum nand_io {
15 NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */
16 NAND_OMAP_POLLED, /* polled mode, without prefetch */
17 NAND_OMAP_PREFETCH_DMA, /* prefetch enabled sDMA mode */
18 NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */
19};
20
13struct omap_nand_platform_data { 21struct omap_nand_platform_data {
14 unsigned int options; 22 unsigned int options;
15 int cs; 23 int cs;
@@ -20,8 +28,11 @@ struct omap_nand_platform_data {
20 int (*nand_setup)(void); 28 int (*nand_setup)(void);
21 int (*dev_ready)(struct omap_nand_platform_data *); 29 int (*dev_ready)(struct omap_nand_platform_data *);
22 int dma_channel; 30 int dma_channel;
31 int gpmc_irq;
32 enum nand_io xfer_type;
23 unsigned long phys_base; 33 unsigned long phys_base;
24 int devsize; 34 int devsize;
35 enum omap_ecc ecc_opt;
25}; 36};
26 37
27/* minimum size for IO mapping */ 38/* minimum size for IO mapping */
diff --git a/arch/arm/plat-omap/include/plat/omap34xx.h b/arch/arm/plat-omap/include/plat/omap34xx.h
index 98fc8b4a4cc4..b9e85886b9d6 100644
--- a/arch/arm/plat-omap/include/plat/omap34xx.h
+++ b/arch/arm/plat-omap/include/plat/omap34xx.h
@@ -56,8 +56,12 @@
56#define OMAP3430_ISP_RESZ_BASE (OMAP3430_ISP_BASE + 0x1000) 56#define OMAP3430_ISP_RESZ_BASE (OMAP3430_ISP_BASE + 0x1000)
57#define OMAP3430_ISP_SBL_BASE (OMAP3430_ISP_BASE + 0x1200) 57#define OMAP3430_ISP_SBL_BASE (OMAP3430_ISP_BASE + 0x1200)
58#define OMAP3430_ISP_MMU_BASE (OMAP3430_ISP_BASE + 0x1400) 58#define OMAP3430_ISP_MMU_BASE (OMAP3430_ISP_BASE + 0x1400)
59#define OMAP3430_ISP_CSI2A_BASE (OMAP3430_ISP_BASE + 0x1800) 59#define OMAP3430_ISP_CSI2A_REGS1_BASE (OMAP3430_ISP_BASE + 0x1800)
60#define OMAP3430_ISP_CSI2PHY_BASE (OMAP3430_ISP_BASE + 0x1970) 60#define OMAP3430_ISP_CSIPHY2_BASE (OMAP3430_ISP_BASE + 0x1970)
61#define OMAP3630_ISP_CSI2A_REGS2_BASE (OMAP3430_ISP_BASE + 0x19C0)
62#define OMAP3630_ISP_CSI2C_REGS1_BASE (OMAP3430_ISP_BASE + 0x1C00)
63#define OMAP3630_ISP_CSIPHY1_BASE (OMAP3430_ISP_BASE + 0x1D70)
64#define OMAP3630_ISP_CSI2C_REGS2_BASE (OMAP3430_ISP_BASE + 0x1DC0)
61 65
62#define OMAP3430_ISP_END (OMAP3430_ISP_BASE + 0x06F) 66#define OMAP3430_ISP_END (OMAP3430_ISP_BASE + 0x06F)
63#define OMAP3430_ISP_CBUFF_END (OMAP3430_ISP_CBUFF_BASE + 0x077) 67#define OMAP3430_ISP_CBUFF_END (OMAP3430_ISP_CBUFF_BASE + 0x077)
@@ -69,8 +73,12 @@
69#define OMAP3430_ISP_RESZ_END (OMAP3430_ISP_RESZ_BASE + 0x0AB) 73#define OMAP3430_ISP_RESZ_END (OMAP3430_ISP_RESZ_BASE + 0x0AB)
70#define OMAP3430_ISP_SBL_END (OMAP3430_ISP_SBL_BASE + 0x0FB) 74#define OMAP3430_ISP_SBL_END (OMAP3430_ISP_SBL_BASE + 0x0FB)
71#define OMAP3430_ISP_MMU_END (OMAP3430_ISP_MMU_BASE + 0x06F) 75#define OMAP3430_ISP_MMU_END (OMAP3430_ISP_MMU_BASE + 0x06F)
72#define OMAP3430_ISP_CSI2A_END (OMAP3430_ISP_CSI2A_BASE + 0x16F) 76#define OMAP3430_ISP_CSI2A_REGS1_END (OMAP3430_ISP_CSI2A_REGS1_BASE + 0x16F)
73#define OMAP3430_ISP_CSI2PHY_END (OMAP3430_ISP_CSI2PHY_BASE + 0x007) 77#define OMAP3430_ISP_CSIPHY2_END (OMAP3430_ISP_CSIPHY2_BASE + 0x00B)
78#define OMAP3630_ISP_CSI2A_REGS2_END (OMAP3630_ISP_CSI2A_REGS2_BASE + 0x3F)
79#define OMAP3630_ISP_CSI2C_REGS1_END (OMAP3630_ISP_CSI2C_REGS1_BASE + 0x16F)
80#define OMAP3630_ISP_CSIPHY1_END (OMAP3630_ISP_CSIPHY1_BASE + 0x00B)
81#define OMAP3630_ISP_CSI2C_REGS2_END (OMAP3630_ISP_CSI2C_REGS2_BASE + 0x3F)
74 82
75#define OMAP34XX_HSUSB_OTG_BASE (L4_34XX_BASE + 0xAB000) 83#define OMAP34XX_HSUSB_OTG_BASE (L4_34XX_BASE + 0xAB000)
76#define OMAP34XX_USBTLL_BASE (L4_34XX_BASE + 0x62000) 84#define OMAP34XX_USBTLL_BASE (L4_34XX_BASE + 0x62000)
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 1eee85a8abb3..1adea9c62984 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * omap_hwmod macros, structures 2 * omap_hwmod macros, structures
3 * 3 *
4 * Copyright (C) 2009-2010 Nokia Corporation 4 * Copyright (C) 2009-2011 Nokia Corporation
5 * Paul Walmsley 5 * Paul Walmsley
6 * 6 *
7 * Created in collaboration with (alphabetical order): Benoît Cousson, 7 * Created in collaboration with (alphabetical order): Benoît Cousson,
@@ -30,11 +30,11 @@
30#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H 30#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H
31 31
32#include <linux/kernel.h> 32#include <linux/kernel.h>
33#include <linux/init.h>
33#include <linux/list.h> 34#include <linux/list.h>
34#include <linux/ioport.h> 35#include <linux/ioport.h>
35#include <linux/spinlock.h> 36#include <linux/spinlock.h>
36#include <plat/cpu.h> 37#include <plat/cpu.h>
37#include <plat/voltage.h>
38 38
39struct omap_device; 39struct omap_device;
40 40
@@ -90,6 +90,9 @@ extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2;
90struct omap_hwmod_mux_info { 90struct omap_hwmod_mux_info {
91 int nr_pads; 91 int nr_pads;
92 struct omap_device_pad *pads; 92 struct omap_device_pad *pads;
93 int nr_pads_dynamic;
94 struct omap_device_pad **pads_dynamic;
95 bool enabled;
93}; 96};
94 97
95/** 98/**
@@ -124,6 +127,7 @@ struct omap_hwmod_dma_info {
124 * struct omap_hwmod_rst_info - IPs reset lines use by hwmod 127 * struct omap_hwmod_rst_info - IPs reset lines use by hwmod
125 * @name: name of the reset line (module local name) 128 * @name: name of the reset line (module local name)
126 * @rst_shift: Offset of the reset bit 129 * @rst_shift: Offset of the reset bit
130 * @st_shift: Offset of the reset status bit (OMAP2/3 only)
127 * 131 *
128 * @name should be something short, e.g., "cpu0" or "rst". It is defined 132 * @name should be something short, e.g., "cpu0" or "rst". It is defined
129 * locally to the hwmod. 133 * locally to the hwmod.
@@ -131,6 +135,7 @@ struct omap_hwmod_dma_info {
131struct omap_hwmod_rst_info { 135struct omap_hwmod_rst_info {
132 const char *name; 136 const char *name;
133 u8 rst_shift; 137 u8 rst_shift;
138 u8 st_shift;
134}; 139};
135 140
136/** 141/**
@@ -178,7 +183,8 @@ struct omap_hwmod_omap2_firewall {
178#define ADDR_TYPE_RT (1 << 1) 183#define ADDR_TYPE_RT (1 << 1)
179 184
180/** 185/**
181 * struct omap_hwmod_addr_space - MPU address space handled by the hwmod 186 * struct omap_hwmod_addr_space - address space handled by the hwmod
187 * @name: name of the address space
182 * @pa_start: starting physical address 188 * @pa_start: starting physical address
183 * @pa_end: ending physical address 189 * @pa_end: ending physical address
184 * @flags: (see omap_hwmod_addr_space.flags macros above) 190 * @flags: (see omap_hwmod_addr_space.flags macros above)
@@ -187,6 +193,7 @@ struct omap_hwmod_omap2_firewall {
187 * structure. GPMC is one example. 193 * structure. GPMC is one example.
188 */ 194 */
189struct omap_hwmod_addr_space { 195struct omap_hwmod_addr_space {
196 const char *name;
190 u32 pa_start; 197 u32 pa_start;
191 u32 pa_end; 198 u32 pa_end;
192 u8 flags; 199 u8 flags;
@@ -370,9 +377,11 @@ struct omap_hwmod_omap4_prcm {
370 * of standby, rather than relying on module smart-standby 377 * of standby, rather than relying on module smart-standby
371 * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for 378 * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for
372 * SDRAM controller, etc. XXX probably belongs outside the main hwmod file 379 * SDRAM controller, etc. XXX probably belongs outside the main hwmod file
380 * XXX Should be HWMOD_SETUP_NO_RESET
373 * HWMOD_INIT_NO_IDLE: don't idle this module at boot - important for SDRAM 381 * HWMOD_INIT_NO_IDLE: don't idle this module at boot - important for SDRAM
374 * controller, etc. XXX probably belongs outside the main hwmod file 382 * controller, etc. XXX probably belongs outside the main hwmod file
375 * HWMOD_NO_AUTOIDLE: disable module autoidle (OCP_SYSCONFIG.AUTOIDLE) 383 * XXX Should be HWMOD_SETUP_NO_IDLE
384 * HWMOD_NO_OCP_AUTOIDLE: disable module autoidle (OCP_SYSCONFIG.AUTOIDLE)
376 * when module is enabled, rather than the default, which is to 385 * when module is enabled, rather than the default, which is to
377 * enable autoidle 386 * enable autoidle
378 * HWMOD_SET_DEFAULT_CLOCKACT: program CLOCKACTIVITY bits at startup 387 * HWMOD_SET_DEFAULT_CLOCKACT: program CLOCKACTIVITY bits at startup
@@ -535,11 +544,12 @@ struct omap_hwmod {
535 const struct omap_chip_id omap_chip; 544 const struct omap_chip_id omap_chip;
536}; 545};
537 546
538int omap_hwmod_init(struct omap_hwmod **ohs); 547int omap_hwmod_register(struct omap_hwmod **ohs);
539struct omap_hwmod *omap_hwmod_lookup(const char *name); 548struct omap_hwmod *omap_hwmod_lookup(const char *name);
540int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data), 549int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
541 void *data); 550 void *data);
542int omap_hwmod_late_init(void); 551
552int __init omap_hwmod_setup_one(const char *name);
543 553
544int omap_hwmod_enable(struct omap_hwmod *oh); 554int omap_hwmod_enable(struct omap_hwmod *oh);
545int _omap_hwmod_enable(struct omap_hwmod *oh); 555int _omap_hwmod_enable(struct omap_hwmod *oh);
@@ -555,6 +565,7 @@ int omap_hwmod_enable_clocks(struct omap_hwmod *oh);
555int omap_hwmod_disable_clocks(struct omap_hwmod *oh); 565int omap_hwmod_disable_clocks(struct omap_hwmod *oh);
556 566
557int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode); 567int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode);
568int omap_hwmod_set_ocp_autoidle(struct omap_hwmod *oh, u8 autoidle);
558 569
559int omap_hwmod_reset(struct omap_hwmod *oh); 570int omap_hwmod_reset(struct omap_hwmod *oh);
560void omap_hwmod_ocp_barrier(struct omap_hwmod *oh); 571void omap_hwmod_ocp_barrier(struct omap_hwmod *oh);
@@ -589,6 +600,8 @@ int omap_hwmod_for_each_by_class(const char *classname,
589int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state); 600int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state);
590u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh); 601u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
591 602
603int omap_hwmod_no_setup_reset(struct omap_hwmod *oh);
604
592/* 605/*
593 * Chip variant-specific hwmod init routines - XXX should be converted 606 * Chip variant-specific hwmod init routines - XXX should be converted
594 * to use initcalls once the initial boot ordering is straightened out 607 * to use initcalls once the initial boot ordering is straightened out
diff --git a/arch/arm/plat-omap/include/plat/onenand.h b/arch/arm/plat-omap/include/plat/onenand.h
index 1b430d5fdd54..2858667d2e4f 100644
--- a/arch/arm/plat-omap/include/plat/onenand.h
+++ b/arch/arm/plat-omap/include/plat/onenand.h
@@ -15,12 +15,20 @@
15#define ONENAND_SYNC_READ (1 << 0) 15#define ONENAND_SYNC_READ (1 << 0)
16#define ONENAND_SYNC_READWRITE (1 << 1) 16#define ONENAND_SYNC_READWRITE (1 << 1)
17 17
18struct onenand_freq_info {
19 u16 maf_id;
20 u16 dev_id;
21 u16 ver_id;
22};
23
18struct omap_onenand_platform_data { 24struct omap_onenand_platform_data {
19 int cs; 25 int cs;
20 int gpio_irq; 26 int gpio_irq;
21 struct mtd_partition *parts; 27 struct mtd_partition *parts;
22 int nr_parts; 28 int nr_parts;
23 int (*onenand_setup)(void __iomem *, int freq); 29 int (*onenand_setup)(void __iomem *, int *freq_ptr);
30 int (*get_freq)(const struct onenand_freq_info *freq_info,
31 bool *clk_dep);
24 int dma_channel; 32 int dma_channel;
25 u8 flags; 33 u8 flags;
26 u8 regulator_can_sleep; 34 u8 regulator_can_sleep;
diff --git a/arch/arm/plat-omap/include/plat/prcm.h b/arch/arm/plat-omap/include/plat/prcm.h
index 2fdf8c80d390..267f43bb2a4e 100644
--- a/arch/arm/plat-omap/include/plat/prcm.h
+++ b/arch/arm/plat-omap/include/plat/prcm.h
@@ -28,7 +28,6 @@
28#define __ASM_ARM_ARCH_OMAP_PRCM_H 28#define __ASM_ARM_ARCH_OMAP_PRCM_H
29 29
30u32 omap_prcm_get_reset_sources(void); 30u32 omap_prcm_get_reset_sources(void);
31void omap_prcm_arch_reset(char mode, const char *cmd);
32int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest, 31int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest,
33 const char *name); 32 const char *name);
34 33
diff --git a/arch/arm/plat-omap/include/plat/sdrc.h b/arch/arm/plat-omap/include/plat/sdrc.h
index efd87c8dda69..925b12b500dc 100644
--- a/arch/arm/plat-omap/include/plat/sdrc.h
+++ b/arch/arm/plat-omap/include/plat/sdrc.h
@@ -124,8 +124,14 @@ struct omap_sdrc_params {
124 u32 mr; 124 u32 mr;
125}; 125};
126 126
127void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0, 127#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
128void omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
128 struct omap_sdrc_params *sdrc_cs1); 129 struct omap_sdrc_params *sdrc_cs1);
130#else
131static inline void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
132 struct omap_sdrc_params *sdrc_cs1) {};
133#endif
134
129int omap2_sdrc_get_params(unsigned long r, 135int omap2_sdrc_get_params(unsigned long r,
130 struct omap_sdrc_params **sdrc_cs0, 136 struct omap_sdrc_params **sdrc_cs0,
131 struct omap_sdrc_params **sdrc_cs1); 137 struct omap_sdrc_params **sdrc_cs1);
diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
index cec5d56db2eb..2723f9166ea2 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -27,7 +27,7 @@
27 * 2. We assume printascii is called at least once before paging_init, 27 * 2. We assume printascii is called at least once before paging_init,
28 * and addruart has a chance to read OMAP_UART_INFO 28 * and addruart has a chance to read OMAP_UART_INFO
29 */ 29 */
30#define OMAP_UART_INFO (PHYS_OFFSET + 0x3ffc) 30#define OMAP_UART_INFO (PLAT_PHYS_OFFSET + 0x3ffc)
31 31
32/* OMAP1 serial ports */ 32/* OMAP1 serial ports */
33#define OMAP1_UART1_BASE 0xfffb0000 33#define OMAP1_UART1_BASE 0xfffb0000
@@ -51,6 +51,11 @@
51#define OMAP4_UART3_BASE 0x48020000 51#define OMAP4_UART3_BASE 0x48020000
52#define OMAP4_UART4_BASE 0x4806e000 52#define OMAP4_UART4_BASE 0x4806e000
53 53
54/* TI816X serial ports */
55#define TI816X_UART1_BASE 0x48020000
56#define TI816X_UART2_BASE 0x48022000
57#define TI816X_UART3_BASE 0x48024000
58
54/* External port on Zoom2/3 */ 59/* External port on Zoom2/3 */
55#define ZOOM_UART_BASE 0x10000000 60#define ZOOM_UART_BASE 0x10000000
56#define ZOOM_UART_VIRT 0xfa400000 61#define ZOOM_UART_VIRT 0xfa400000
@@ -81,6 +86,9 @@
81#define OMAP4UART2 OMAP2UART2 86#define OMAP4UART2 OMAP2UART2
82#define OMAP4UART3 43 87#define OMAP4UART3 43
83#define OMAP4UART4 44 88#define OMAP4UART4 44
89#define TI816XUART1 81
90#define TI816XUART2 82
91#define TI816XUART3 83
84#define ZOOM_UART 95 /* Only on zoom2/3 */ 92#define ZOOM_UART 95 /* Only on zoom2/3 */
85 93
86/* This is only used by 8250.c for omap1510 */ 94/* This is only used by 8250.c for omap1510 */
@@ -96,7 +104,6 @@
96 104
97struct omap_board_data; 105struct omap_board_data;
98 106
99extern void __init omap_serial_early_init(void);
100extern void omap_serial_init(void); 107extern void omap_serial_init(void);
101extern void omap_serial_init_port(struct omap_board_data *bdata); 108extern void omap_serial_init_port(struct omap_board_data *bdata);
102extern int omap_uart_can_sleep(void); 109extern int omap_uart_can_sleep(void);
diff --git a/arch/arm/plat-omap/include/plat/sram.h b/arch/arm/plat-omap/include/plat/sram.h
index 9967d5e855c7..f500fc34d065 100644
--- a/arch/arm/plat-omap/include/plat/sram.h
+++ b/arch/arm/plat-omap/include/plat/sram.h
@@ -12,7 +12,19 @@
12#define __ARCH_ARM_OMAP_SRAM_H 12#define __ARCH_ARM_OMAP_SRAM_H
13 13
14#ifndef __ASSEMBLY__ 14#ifndef __ASSEMBLY__
15extern void * omap_sram_push(void * start, unsigned long size); 15#include <asm/fncpy.h>
16
17extern void *omap_sram_push_address(unsigned long size);
18
19/* Macro to push a function to the internal SRAM, using the fncpy API */
20#define omap_sram_push(funcp, size) ({ \
21 typeof(&(funcp)) _res = NULL; \
22 void *_sram_address = omap_sram_push_address(size); \
23 if (_sram_address) \
24 _res = fncpy(_sram_address, &(funcp), size); \
25 _res; \
26})
27
16extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl); 28extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl);
17 29
18extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, 30extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
diff --git a/arch/arm/plat-omap/include/plat/system.h b/arch/arm/plat-omap/include/plat/system.h
index d0a119f735b4..c5fa9e929009 100644
--- a/arch/arm/plat-omap/include/plat/system.h
+++ b/arch/arm/plat-omap/include/plat/system.h
@@ -4,48 +4,14 @@
4 */ 4 */
5#ifndef __ASM_ARCH_SYSTEM_H 5#ifndef __ASM_ARCH_SYSTEM_H
6#define __ASM_ARCH_SYSTEM_H 6#define __ASM_ARCH_SYSTEM_H
7#include <linux/clk.h>
8 7
9#include <asm/mach-types.h> 8#include <asm/proc-fns.h>
10#include <mach/hardware.h>
11
12#include <plat/prcm.h>
13
14#ifndef CONFIG_MACH_VOICEBLUE
15#define voiceblue_reset() do {} while (0)
16#else
17extern void voiceblue_reset(void);
18#endif
19 9
20static inline void arch_idle(void) 10static inline void arch_idle(void)
21{ 11{
22 cpu_do_idle(); 12 cpu_do_idle();
23} 13}
24 14
25static inline void omap1_arch_reset(char mode, const char *cmd) 15extern void (*arch_reset)(char, const char *);
26{
27 /*
28 * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28
29 * "Global Software Reset Affects Traffic Controller Frequency".
30 */
31 if (cpu_is_omap5912()) {
32 omap_writew(omap_readw(DPLL_CTL) & ~(1 << 4),
33 DPLL_CTL);
34 omap_writew(0x8, ARM_RSTCT1);
35 }
36
37 if (machine_is_voiceblue())
38 voiceblue_reset();
39 else
40 omap_writew(1, ARM_RSTCT1);
41}
42
43static inline void arch_reset(char mode, const char *cmd)
44{
45 if (!cpu_class_is_omap2())
46 omap1_arch_reset(mode, cmd);
47 else
48 omap_prcm_arch_reset(mode, cmd);
49}
50 16
51#endif 17#endif
diff --git a/arch/arm/plat-omap/include/plat/ti816x.h b/arch/arm/plat-omap/include/plat/ti816x.h
new file mode 100644
index 000000000000..50510f5dda1e
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/ti816x.h
@@ -0,0 +1,27 @@
1/*
2 * This file contains the address data for various TI816X modules.
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef __ASM_ARCH_TI816X_H
17#define __ASM_ARCH_TI816X_H
18
19#define L4_SLOW_TI816X_BASE 0x48000000
20
21#define TI816X_SCM_BASE 0x48140000
22#define TI816X_CTRL_BASE TI816X_SCM_BASE
23#define TI816X_PRCM_BASE 0x48180000
24
25#define TI816X_ARM_INTC_BASE 0x48200000
26
27#endif /* __ASM_ARCH_TI816X_H */
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h
index ad98b85cae21..30b891c4a93f 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -93,6 +93,10 @@ static inline void flush(void)
93#define DEBUG_LL_ZOOM(mach) \ 93#define DEBUG_LL_ZOOM(mach) \
94 _DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART) 94 _DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
95 95
96#define DEBUG_LL_TI816X(p, mach) \
97 _DEBUG_LL_ENTRY(mach, TI816X_UART##p##_BASE, OMAP_PORT_SHIFT, \
98 TI816XUART##p)
99
96static inline void __arch_decomp_setup(unsigned long arch_id) 100static inline void __arch_decomp_setup(unsigned long arch_id)
97{ 101{
98 int port = 0; 102 int port = 0;
@@ -166,6 +170,9 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
166 DEBUG_LL_ZOOM(omap_zoom2); 170 DEBUG_LL_ZOOM(omap_zoom2);
167 DEBUG_LL_ZOOM(omap_zoom3); 171 DEBUG_LL_ZOOM(omap_zoom3);
168 172
173 /* TI8168 base boards using UART3 */
174 DEBUG_LL_TI816X(3, ti8168evm);
175
169 } while (0); 176 } while (0);
170} 177}
171 178
diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
index 450a332f1009..02b96c8f6a17 100644
--- a/arch/arm/plat-omap/include/plat/usb.h
+++ b/arch/arm/plat-omap/include/plat/usb.h
@@ -7,15 +7,12 @@
7#include <plat/board.h> 7#include <plat/board.h>
8 8
9#define OMAP3_HS_USB_PORTS 3 9#define OMAP3_HS_USB_PORTS 3
10enum ehci_hcd_omap_mode {
11 EHCI_HCD_OMAP_MODE_UNKNOWN,
12 EHCI_HCD_OMAP_MODE_PHY,
13 EHCI_HCD_OMAP_MODE_TLL,
14 EHCI_HCD_OMAP_MODE_HSIC,
15};
16 10
17enum ohci_omap3_port_mode { 11enum usbhs_omap_port_mode {
18 OMAP_OHCI_PORT_MODE_UNUSED, 12 OMAP_USBHS_PORT_MODE_UNUSED,
13 OMAP_EHCI_PORT_MODE_PHY,
14 OMAP_EHCI_PORT_MODE_TLL,
15 OMAP_EHCI_PORT_MODE_HSIC,
19 OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0, 16 OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0,
20 OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM, 17 OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM,
21 OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0, 18 OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0,
@@ -25,24 +22,45 @@ enum ohci_omap3_port_mode {
25 OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0, 22 OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0,
26 OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM, 23 OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM,
27 OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0, 24 OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0,
28 OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM, 25 OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM
29}; 26};
30 27
31struct ehci_hcd_omap_platform_data { 28struct usbhs_omap_board_data {
32 enum ehci_hcd_omap_mode port_mode[OMAP3_HS_USB_PORTS]; 29 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
33 unsigned phy_reset:1;
34 30
35 /* have to be valid if phy_reset is true and portx is in phy mode */ 31 /* have to be valid if phy_reset is true and portx is in phy mode */
36 int reset_gpio_port[OMAP3_HS_USB_PORTS]; 32 int reset_gpio_port[OMAP3_HS_USB_PORTS];
33
34 /* Set this to true for ES2.x silicon */
35 unsigned es2_compatibility:1;
36
37 unsigned phy_reset:1;
38
39 /*
40 * Regulators for USB PHYs.
41 * Each PHY can have a separate regulator.
42 */
43 struct regulator *regulator[OMAP3_HS_USB_PORTS];
37}; 44};
38 45
39struct ohci_hcd_omap_platform_data { 46struct ehci_hcd_omap_platform_data {
40 enum ohci_omap3_port_mode port_mode[OMAP3_HS_USB_PORTS]; 47 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
48 int reset_gpio_port[OMAP3_HS_USB_PORTS];
49 struct regulator *regulator[OMAP3_HS_USB_PORTS];
50 unsigned phy_reset:1;
51};
41 52
42 /* Set this to true for ES2.x silicon */ 53struct ohci_hcd_omap_platform_data {
54 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
43 unsigned es2_compatibility:1; 55 unsigned es2_compatibility:1;
44}; 56};
45 57
58struct usbhs_omap_platform_data {
59 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
60
61 struct ehci_hcd_omap_platform_data *ehci_data;
62 struct ohci_hcd_omap_platform_data *ohci_data;
63};
46/*-------------------------------------------------------------------------*/ 64/*-------------------------------------------------------------------------*/
47 65
48#define OMAP1_OTG_BASE 0xfffb0400 66#define OMAP1_OTG_BASE 0xfffb0400
@@ -80,17 +98,22 @@ enum musb_interface {MUSB_INTERFACE_ULPI, MUSB_INTERFACE_UTMI};
80 98
81extern void usb_musb_init(struct omap_musb_board_data *board_data); 99extern void usb_musb_init(struct omap_musb_board_data *board_data);
82 100
83extern void usb_ehci_init(const struct ehci_hcd_omap_platform_data *pdata); 101extern void usbhs_init(const struct usbhs_omap_board_data *pdata);
84 102
85extern void usb_ohci_init(const struct ohci_hcd_omap_platform_data *pdata); 103extern int omap_usbhs_enable(struct device *dev);
104extern void omap_usbhs_disable(struct device *dev);
86 105
87extern int omap4430_phy_power(struct device *dev, int ID, int on); 106extern int omap4430_phy_power(struct device *dev, int ID, int on);
88extern int omap4430_phy_set_clk(struct device *dev, int on); 107extern int omap4430_phy_set_clk(struct device *dev, int on);
89extern int omap4430_phy_init(struct device *dev); 108extern int omap4430_phy_init(struct device *dev);
90extern int omap4430_phy_exit(struct device *dev); 109extern int omap4430_phy_exit(struct device *dev);
91 110extern int omap4430_phy_suspend(struct device *dev, int suspend);
92#endif 111#endif
93 112
113extern void am35x_musb_reset(void);
114extern void am35x_musb_phy_power(u8 on);
115extern void am35x_musb_clear_irq(void);
116extern void am35x_musb_set_mode(u8 musb_mode);
94 117
95/* 118/*
96 * FIXME correct answer depends on hmc_mode, 119 * FIXME correct answer depends on hmc_mode,
diff --git a/arch/arm/plat-omap/io.c b/arch/arm/plat-omap/io.c
index f1295fafcd31..f1ecfa9fc61d 100644
--- a/arch/arm/plat-omap/io.c
+++ b/arch/arm/plat-omap/io.c
@@ -85,7 +85,10 @@ void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type)
85 } 85 }
86#endif 86#endif
87#ifdef CONFIG_ARCH_OMAP3 87#ifdef CONFIG_ARCH_OMAP3
88 if (cpu_is_omap34xx()) { 88 if (cpu_is_ti816x()) {
89 if (BETWEEN(p, L4_34XX_PHYS, L4_34XX_SIZE))
90 return XLATE(p, L4_34XX_PHYS, L4_34XX_VIRT);
91 } else if (cpu_is_omap34xx()) {
89 if (BETWEEN(p, L3_34XX_PHYS, L3_34XX_SIZE)) 92 if (BETWEEN(p, L3_34XX_PHYS, L3_34XX_SIZE))
90 return XLATE(p, L3_34XX_PHYS, L3_34XX_VIRT); 93 return XLATE(p, L3_34XX_PHYS, L3_34XX_VIRT);
91 if (BETWEEN(p, L4_34XX_PHYS, L4_34XX_SIZE)) 94 if (BETWEEN(p, L4_34XX_PHYS, L4_34XX_SIZE))
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c
index b1107c08da56..8a51fd58f656 100644
--- a/arch/arm/plat-omap/iommu.c
+++ b/arch/arm/plat-omap/iommu.c
@@ -104,6 +104,9 @@ static int iommu_enable(struct iommu *obj)
104 if (!obj) 104 if (!obj)
105 return -EINVAL; 105 return -EINVAL;
106 106
107 if (!arch_iommu)
108 return -ENODEV;
109
107 clk_enable(obj->clk); 110 clk_enable(obj->clk);
108 111
109 err = arch_iommu->enable(obj); 112 err = arch_iommu->enable(obj);
@@ -780,25 +783,19 @@ static void iopgtable_clear_entry_all(struct iommu *obj)
780 */ 783 */
781static irqreturn_t iommu_fault_handler(int irq, void *data) 784static irqreturn_t iommu_fault_handler(int irq, void *data)
782{ 785{
783 u32 stat, da; 786 u32 da, errs;
784 u32 *iopgd, *iopte; 787 u32 *iopgd, *iopte;
785 int err = -EIO;
786 struct iommu *obj = data; 788 struct iommu *obj = data;
787 789
788 if (!obj->refcount) 790 if (!obj->refcount)
789 return IRQ_NONE; 791 return IRQ_NONE;
790 792
791 /* Dynamic loading TLB or PTE */
792 if (obj->isr)
793 err = obj->isr(obj);
794
795 if (!err)
796 return IRQ_HANDLED;
797
798 clk_enable(obj->clk); 793 clk_enable(obj->clk);
799 stat = iommu_report_fault(obj, &da); 794 errs = iommu_report_fault(obj, &da);
800 clk_disable(obj->clk); 795 clk_disable(obj->clk);
801 if (!stat) 796
797 /* Fault callback or TLB/PTE Dynamic loading */
798 if (obj->isr && !obj->isr(obj, da, errs, obj->isr_priv))
802 return IRQ_HANDLED; 799 return IRQ_HANDLED;
803 800
804 iommu_disable(obj); 801 iommu_disable(obj);
@@ -806,15 +803,16 @@ static irqreturn_t iommu_fault_handler(int irq, void *data)
806 iopgd = iopgd_offset(obj, da); 803 iopgd = iopgd_offset(obj, da);
807 804
808 if (!iopgd_is_table(*iopgd)) { 805 if (!iopgd_is_table(*iopgd)) {
809 dev_err(obj->dev, "%s: da:%08x pgd:%p *pgd:%08x\n", __func__, 806 dev_err(obj->dev, "%s: errs:0x%08x da:0x%08x pgd:0x%p "
810 da, iopgd, *iopgd); 807 "*pgd:px%08x\n", obj->name, errs, da, iopgd, *iopgd);
811 return IRQ_NONE; 808 return IRQ_NONE;
812 } 809 }
813 810
814 iopte = iopte_offset(iopgd, da); 811 iopte = iopte_offset(iopgd, da);
815 812
816 dev_err(obj->dev, "%s: da:%08x pgd:%p *pgd:%08x pte:%p *pte:%08x\n", 813 dev_err(obj->dev, "%s: errs:0x%08x da:0x%08x pgd:0x%p *pgd:0x%08x "
817 __func__, da, iopgd, *iopgd, iopte, *iopte); 814 "pte:0x%p *pte:0x%08x\n", obj->name, errs, da, iopgd, *iopgd,
815 iopte, *iopte);
818 816
819 return IRQ_NONE; 817 return IRQ_NONE;
820} 818}
@@ -917,6 +915,33 @@ void iommu_put(struct iommu *obj)
917} 915}
918EXPORT_SYMBOL_GPL(iommu_put); 916EXPORT_SYMBOL_GPL(iommu_put);
919 917
918int iommu_set_isr(const char *name,
919 int (*isr)(struct iommu *obj, u32 da, u32 iommu_errs,
920 void *priv),
921 void *isr_priv)
922{
923 struct device *dev;
924 struct iommu *obj;
925
926 dev = driver_find_device(&omap_iommu_driver.driver, NULL, (void *)name,
927 device_match_by_alias);
928 if (!dev)
929 return -ENODEV;
930
931 obj = to_iommu(dev);
932 mutex_lock(&obj->iommu_lock);
933 if (obj->refcount != 0) {
934 mutex_unlock(&obj->iommu_lock);
935 return -EBUSY;
936 }
937 obj->isr = isr;
938 obj->isr_priv = isr_priv;
939 mutex_unlock(&obj->iommu_lock);
940
941 return 0;
942}
943EXPORT_SYMBOL_GPL(iommu_set_isr);
944
920/* 945/*
921 * OMAP Device MMU(IOMMU) detection 946 * OMAP Device MMU(IOMMU) detection
922 */ 947 */
@@ -957,11 +982,6 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev)
957 err = -ENODEV; 982 err = -ENODEV;
958 goto err_mem; 983 goto err_mem;
959 } 984 }
960 obj->regbase = ioremap(res->start, resource_size(res));
961 if (!obj->regbase) {
962 err = -ENOMEM;
963 goto err_mem;
964 }
965 985
966 res = request_mem_region(res->start, resource_size(res), 986 res = request_mem_region(res->start, resource_size(res),
967 dev_name(&pdev->dev)); 987 dev_name(&pdev->dev));
@@ -970,6 +990,12 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev)
970 goto err_mem; 990 goto err_mem;
971 } 991 }
972 992
993 obj->regbase = ioremap(res->start, resource_size(res));
994 if (!obj->regbase) {
995 err = -ENOMEM;
996 goto err_ioremap;
997 }
998
973 irq = platform_get_irq(pdev, 0); 999 irq = platform_get_irq(pdev, 0);
974 if (irq < 0) { 1000 if (irq < 0) {
975 err = -ENODEV; 1001 err = -ENODEV;
@@ -998,8 +1024,9 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev)
998err_pgd: 1024err_pgd:
999 free_irq(irq, obj); 1025 free_irq(irq, obj);
1000err_irq: 1026err_irq:
1001 release_mem_region(res->start, resource_size(res));
1002 iounmap(obj->regbase); 1027 iounmap(obj->regbase);
1028err_ioremap:
1029 release_mem_region(res->start, resource_size(res));
1003err_mem: 1030err_mem:
1004 clk_put(obj->clk); 1031 clk_put(obj->clk);
1005err_clk: 1032err_clk:
diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c
index 6dc1296c8c77..51ef43e8def6 100644
--- a/arch/arm/plat-omap/iovmm.c
+++ b/arch/arm/plat-omap/iovmm.c
@@ -271,20 +271,21 @@ static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da,
271 size_t bytes, u32 flags) 271 size_t bytes, u32 flags)
272{ 272{
273 struct iovm_struct *new, *tmp; 273 struct iovm_struct *new, *tmp;
274 u32 start, prev_end, alignement; 274 u32 start, prev_end, alignment;
275 275
276 if (!obj || !bytes) 276 if (!obj || !bytes)
277 return ERR_PTR(-EINVAL); 277 return ERR_PTR(-EINVAL);
278 278
279 start = da; 279 start = da;
280 alignement = PAGE_SIZE; 280 alignment = PAGE_SIZE;
281 281
282 if (flags & IOVMF_DA_ANON) { 282 if (~flags & IOVMF_DA_FIXED) {
283 start = obj->da_start; 283 /* Don't map address 0 */
284 start = obj->da_start ? obj->da_start : alignment;
284 285
285 if (flags & IOVMF_LINEAR) 286 if (flags & IOVMF_LINEAR)
286 alignement = iopgsz_max(bytes); 287 alignment = iopgsz_max(bytes);
287 start = roundup(start, alignement); 288 start = roundup(start, alignment);
288 } else if (start < obj->da_start || start > obj->da_end || 289 } else if (start < obj->da_start || start > obj->da_end ||
289 obj->da_end - start < bytes) { 290 obj->da_end - start < bytes) {
290 return ERR_PTR(-EINVAL); 291 return ERR_PTR(-EINVAL);
@@ -303,8 +304,8 @@ static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da,
303 if (tmp->da_start > start && (tmp->da_start - start) >= bytes) 304 if (tmp->da_start > start && (tmp->da_start - start) >= bytes)
304 goto found; 305 goto found;
305 306
306 if (tmp->da_end >= start && flags & IOVMF_DA_ANON) 307 if (tmp->da_end >= start && ~flags & IOVMF_DA_FIXED)
307 start = roundup(tmp->da_end + 1, alignement); 308 start = roundup(tmp->da_end + 1, alignment);
308 309
309 prev_end = tmp->da_end; 310 prev_end = tmp->da_end;
310 } 311 }
@@ -650,7 +651,6 @@ u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt,
650 flags &= IOVMF_HW_MASK; 651 flags &= IOVMF_HW_MASK;
651 flags |= IOVMF_DISCONT; 652 flags |= IOVMF_DISCONT;
652 flags |= IOVMF_MMIO; 653 flags |= IOVMF_MMIO;
653 flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);
654 654
655 da = __iommu_vmap(obj, da, sgt, va, bytes, flags); 655 da = __iommu_vmap(obj, da, sgt, va, bytes, flags);
656 if (IS_ERR_VALUE(da)) 656 if (IS_ERR_VALUE(da))
@@ -690,7 +690,7 @@ EXPORT_SYMBOL_GPL(iommu_vunmap);
690 * @flags: iovma and page property 690 * @flags: iovma and page property
691 * 691 *
692 * Allocate @bytes linearly and creates 1-n-1 mapping and returns 692 * Allocate @bytes linearly and creates 1-n-1 mapping and returns
693 * @da again, which might be adjusted if 'IOVMF_DA_ANON' is set. 693 * @da again, which might be adjusted if 'IOVMF_DA_FIXED' is not set.
694 */ 694 */
695u32 iommu_vmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags) 695u32 iommu_vmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags)
696{ 696{
@@ -709,7 +709,6 @@ u32 iommu_vmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags)
709 flags &= IOVMF_HW_MASK; 709 flags &= IOVMF_HW_MASK;
710 flags |= IOVMF_DISCONT; 710 flags |= IOVMF_DISCONT;
711 flags |= IOVMF_ALLOC; 711 flags |= IOVMF_ALLOC;
712 flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);
713 712
714 sgt = sgtable_alloc(bytes, flags, da, 0); 713 sgt = sgtable_alloc(bytes, flags, da, 0);
715 if (IS_ERR(sgt)) { 714 if (IS_ERR(sgt)) {
@@ -780,7 +779,7 @@ static u32 __iommu_kmap(struct iommu *obj, u32 da, u32 pa, void *va,
780 * @flags: iovma and page property 779 * @flags: iovma and page property
781 * 780 *
782 * Creates 1-1-1 mapping and returns @da again, which can be 781 * Creates 1-1-1 mapping and returns @da again, which can be
783 * adjusted if 'IOVMF_DA_ANON' is set. 782 * adjusted if 'IOVMF_DA_FIXED' is not set.
784 */ 783 */
785u32 iommu_kmap(struct iommu *obj, u32 da, u32 pa, size_t bytes, 784u32 iommu_kmap(struct iommu *obj, u32 da, u32 pa, size_t bytes,
786 u32 flags) 785 u32 flags)
@@ -799,7 +798,6 @@ u32 iommu_kmap(struct iommu *obj, u32 da, u32 pa, size_t bytes,
799 flags &= IOVMF_HW_MASK; 798 flags &= IOVMF_HW_MASK;
800 flags |= IOVMF_LINEAR; 799 flags |= IOVMF_LINEAR;
801 flags |= IOVMF_MMIO; 800 flags |= IOVMF_MMIO;
802 flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);
803 801
804 da = __iommu_kmap(obj, da, pa, va, bytes, flags); 802 da = __iommu_kmap(obj, da, pa, va, bytes, flags);
805 if (IS_ERR_VALUE(da)) 803 if (IS_ERR_VALUE(da))
@@ -838,7 +836,7 @@ EXPORT_SYMBOL_GPL(iommu_kunmap);
838 * @flags: iovma and page property 836 * @flags: iovma and page property
839 * 837 *
840 * Allocate @bytes linearly and creates 1-1-1 mapping and returns 838 * Allocate @bytes linearly and creates 1-1-1 mapping and returns
841 * @da again, which might be adjusted if 'IOVMF_DA_ANON' is set. 839 * @da again, which might be adjusted if 'IOVMF_DA_FIXED' is not set.
842 */ 840 */
843u32 iommu_kmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags) 841u32 iommu_kmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags)
844{ 842{
@@ -858,7 +856,6 @@ u32 iommu_kmalloc(struct iommu *obj, u32 da, size_t bytes, u32 flags)
858 flags &= IOVMF_HW_MASK; 856 flags &= IOVMF_HW_MASK;
859 flags |= IOVMF_LINEAR; 857 flags |= IOVMF_LINEAR;
860 flags |= IOVMF_ALLOC; 858 flags |= IOVMF_ALLOC;
861 flags |= (da ? IOVMF_DA_FIXED : IOVMF_DA_ANON);
862 859
863 da = __iommu_kmap(obj, da, pa, va, bytes, flags); 860 da = __iommu_kmap(obj, da, pa, va, bytes, flags);
864 if (IS_ERR_VALUE(da)) 861 if (IS_ERR_VALUE(da))
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 459b319a9fad..69ddc9f76c13 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -32,7 +32,6 @@
32 32
33#include <plat/mailbox.h> 33#include <plat/mailbox.h>
34 34
35static struct workqueue_struct *mboxd;
36static struct omap_mbox **mboxes; 35static struct omap_mbox **mboxes;
37 36
38static int mbox_configured; 37static int mbox_configured;
@@ -197,7 +196,7 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox)
197 /* no more messages in the fifo. clear IRQ source. */ 196 /* no more messages in the fifo. clear IRQ source. */
198 ack_mbox_irq(mbox, IRQ_RX); 197 ack_mbox_irq(mbox, IRQ_RX);
199nomem: 198nomem:
200 queue_work(mboxd, &mbox->rxq->work); 199 schedule_work(&mbox->rxq->work);
201} 200}
202 201
203static irqreturn_t mbox_interrupt(int irq, void *p) 202static irqreturn_t mbox_interrupt(int irq, void *p)
@@ -307,7 +306,7 @@ static void omap_mbox_fini(struct omap_mbox *mbox)
307 if (!--mbox->use_count) { 306 if (!--mbox->use_count) {
308 free_irq(mbox->irq, mbox); 307 free_irq(mbox->irq, mbox);
309 tasklet_kill(&mbox->txq->tasklet); 308 tasklet_kill(&mbox->txq->tasklet);
310 flush_work(&mbox->rxq->work); 309 flush_work_sync(&mbox->rxq->work);
311 mbox_queue_free(mbox->txq); 310 mbox_queue_free(mbox->txq);
312 mbox_queue_free(mbox->rxq); 311 mbox_queue_free(mbox->rxq);
313 } 312 }
@@ -322,15 +321,18 @@ static void omap_mbox_fini(struct omap_mbox *mbox)
322 321
323struct omap_mbox *omap_mbox_get(const char *name, struct notifier_block *nb) 322struct omap_mbox *omap_mbox_get(const char *name, struct notifier_block *nb)
324{ 323{
325 struct omap_mbox *mbox; 324 struct omap_mbox *_mbox, *mbox = NULL;
326 int ret; 325 int i, ret;
327 326
328 if (!mboxes) 327 if (!mboxes)
329 return ERR_PTR(-EINVAL); 328 return ERR_PTR(-EINVAL);
330 329
331 for (mbox = *mboxes; mbox; mbox++) 330 for (i = 0; (_mbox = mboxes[i]); i++) {
332 if (!strcmp(mbox->name, name)) 331 if (!strcmp(_mbox->name, name)) {
332 mbox = _mbox;
333 break; 333 break;
334 }
335 }
334 336
335 if (!mbox) 337 if (!mbox)
336 return ERR_PTR(-ENOENT); 338 return ERR_PTR(-ENOENT);
@@ -406,10 +408,6 @@ static int __init omap_mbox_init(void)
406 if (err) 408 if (err)
407 return err; 409 return err;
408 410
409 mboxd = create_workqueue("mboxd");
410 if (!mboxd)
411 return -ENOMEM;
412
413 /* kfifo size sanity check: alignment and minimal size */ 411 /* kfifo size sanity check: alignment and minimal size */
414 mbox_kfifo_size = ALIGN(mbox_kfifo_size, sizeof(mbox_msg_t)); 412 mbox_kfifo_size = ALIGN(mbox_kfifo_size, sizeof(mbox_msg_t));
415 mbox_kfifo_size = max_t(unsigned int, mbox_kfifo_size, 413 mbox_kfifo_size = max_t(unsigned int, mbox_kfifo_size,
@@ -421,7 +419,6 @@ subsys_initcall(omap_mbox_init);
421 419
422static void __exit omap_mbox_exit(void) 420static void __exit omap_mbox_exit(void)
423{ 421{
424 destroy_workqueue(mboxd);
425 class_unregister(&omap_mbox_class); 422 class_unregister(&omap_mbox_class);
426} 423}
427module_exit(omap_mbox_exit); 424module_exit(omap_mbox_exit);
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index b5a6e178a7f9..d598d9fd65ac 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -27,6 +27,8 @@
27 27
28#include <plat/dma.h> 28#include <plat/dma.h>
29#include <plat/mcbsp.h> 29#include <plat/mcbsp.h>
30#include <plat/omap_device.h>
31#include <linux/pm_runtime.h>
30 32
31/* XXX These "sideways" includes are a sign that something is wrong */ 33/* XXX These "sideways" includes are a sign that something is wrong */
32#include "../mach-omap2/cm2xxx_3xxx.h" 34#include "../mach-omap2/cm2xxx_3xxx.h"
@@ -227,10 +229,83 @@ void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg *config)
227} 229}
228EXPORT_SYMBOL(omap_mcbsp_config); 230EXPORT_SYMBOL(omap_mcbsp_config);
229 231
232/**
233 * omap_mcbsp_dma_params - returns the dma channel number
234 * @id - mcbsp id
235 * @stream - indicates the direction of data flow (rx or tx)
236 *
237 * Returns the dma channel number for the rx channel or tx channel
238 * based on the value of @stream for the requested mcbsp given by @id
239 */
240int omap_mcbsp_dma_ch_params(unsigned int id, unsigned int stream)
241{
242 struct omap_mcbsp *mcbsp;
243
244 if (!omap_mcbsp_check_valid_id(id)) {
245 printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
246 return -ENODEV;
247 }
248 mcbsp = id_to_mcbsp_ptr(id);
249
250 if (stream)
251 return mcbsp->dma_rx_sync;
252 else
253 return mcbsp->dma_tx_sync;
254}
255EXPORT_SYMBOL(omap_mcbsp_dma_ch_params);
256
257/**
258 * omap_mcbsp_dma_reg_params - returns the address of mcbsp data register
259 * @id - mcbsp id
260 * @stream - indicates the direction of data flow (rx or tx)
261 *
262 * Returns the address of mcbsp data transmit register or data receive register
263 * to be used by DMA for transferring/receiving data based on the value of
264 * @stream for the requested mcbsp given by @id
265 */
266int omap_mcbsp_dma_reg_params(unsigned int id, unsigned int stream)
267{
268 struct omap_mcbsp *mcbsp;
269 int data_reg;
270
271 if (!omap_mcbsp_check_valid_id(id)) {
272 printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
273 return -ENODEV;
274 }
275 mcbsp = id_to_mcbsp_ptr(id);
276
277 data_reg = mcbsp->phys_dma_base;
278
279 if (mcbsp->mcbsp_config_type < MCBSP_CONFIG_TYPE2) {
280 if (stream)
281 data_reg += OMAP_MCBSP_REG_DRR1;
282 else
283 data_reg += OMAP_MCBSP_REG_DXR1;
284 } else {
285 if (stream)
286 data_reg += OMAP_MCBSP_REG_DRR;
287 else
288 data_reg += OMAP_MCBSP_REG_DXR;
289 }
290
291 return data_reg;
292}
293EXPORT_SYMBOL(omap_mcbsp_dma_reg_params);
294
230#ifdef CONFIG_ARCH_OMAP3 295#ifdef CONFIG_ARCH_OMAP3
296static struct omap_device *find_omap_device_by_dev(struct device *dev)
297{
298 struct platform_device *pdev = container_of(dev,
299 struct platform_device, dev);
300 return container_of(pdev, struct omap_device, pdev);
301}
302
231static void omap_st_on(struct omap_mcbsp *mcbsp) 303static void omap_st_on(struct omap_mcbsp *mcbsp)
232{ 304{
233 unsigned int w; 305 unsigned int w;
306 struct omap_device *od;
307
308 od = find_omap_device_by_dev(mcbsp->dev);
234 309
235 /* 310 /*
236 * Sidetone uses McBSP ICLK - which must not idle when sidetones 311 * Sidetone uses McBSP ICLK - which must not idle when sidetones
@@ -244,9 +319,6 @@ static void omap_st_on(struct omap_mcbsp *mcbsp)
244 w = MCBSP_READ(mcbsp, SSELCR); 319 w = MCBSP_READ(mcbsp, SSELCR);
245 MCBSP_WRITE(mcbsp, SSELCR, w | SIDETONEEN); 320 MCBSP_WRITE(mcbsp, SSELCR, w | SIDETONEEN);
246 321
247 w = MCBSP_ST_READ(mcbsp, SYSCONFIG);
248 MCBSP_ST_WRITE(mcbsp, SYSCONFIG, w & ~(ST_AUTOIDLE));
249
250 /* Enable Sidetone from Sidetone Core */ 322 /* Enable Sidetone from Sidetone Core */
251 w = MCBSP_ST_READ(mcbsp, SSELCR); 323 w = MCBSP_ST_READ(mcbsp, SSELCR);
252 MCBSP_ST_WRITE(mcbsp, SSELCR, w | ST_SIDETONEEN); 324 MCBSP_ST_WRITE(mcbsp, SSELCR, w | ST_SIDETONEEN);
@@ -255,13 +327,13 @@ static void omap_st_on(struct omap_mcbsp *mcbsp)
255static void omap_st_off(struct omap_mcbsp *mcbsp) 327static void omap_st_off(struct omap_mcbsp *mcbsp)
256{ 328{
257 unsigned int w; 329 unsigned int w;
330 struct omap_device *od;
331
332 od = find_omap_device_by_dev(mcbsp->dev);
258 333
259 w = MCBSP_ST_READ(mcbsp, SSELCR); 334 w = MCBSP_ST_READ(mcbsp, SSELCR);
260 MCBSP_ST_WRITE(mcbsp, SSELCR, w & ~(ST_SIDETONEEN)); 335 MCBSP_ST_WRITE(mcbsp, SSELCR, w & ~(ST_SIDETONEEN));
261 336
262 w = MCBSP_ST_READ(mcbsp, SYSCONFIG);
263 MCBSP_ST_WRITE(mcbsp, SYSCONFIG, w | ST_AUTOIDLE);
264
265 w = MCBSP_READ(mcbsp, SSELCR); 337 w = MCBSP_READ(mcbsp, SSELCR);
266 MCBSP_WRITE(mcbsp, SSELCR, w & ~(SIDETONEEN)); 338 MCBSP_WRITE(mcbsp, SSELCR, w & ~(SIDETONEEN));
267 339
@@ -273,9 +345,9 @@ static void omap_st_off(struct omap_mcbsp *mcbsp)
273static void omap_st_fir_write(struct omap_mcbsp *mcbsp, s16 *fir) 345static void omap_st_fir_write(struct omap_mcbsp *mcbsp, s16 *fir)
274{ 346{
275 u16 val, i; 347 u16 val, i;
348 struct omap_device *od;
276 349
277 val = MCBSP_ST_READ(mcbsp, SYSCONFIG); 350 od = find_omap_device_by_dev(mcbsp->dev);
278 MCBSP_ST_WRITE(mcbsp, SYSCONFIG, val & ~(ST_AUTOIDLE));
279 351
280 val = MCBSP_ST_READ(mcbsp, SSELCR); 352 val = MCBSP_ST_READ(mcbsp, SSELCR);
281 353
@@ -303,9 +375,9 @@ static void omap_st_chgain(struct omap_mcbsp *mcbsp)
303{ 375{
304 u16 w; 376 u16 w;
305 struct omap_mcbsp_st_data *st_data = mcbsp->st_data; 377 struct omap_mcbsp_st_data *st_data = mcbsp->st_data;
378 struct omap_device *od;
306 379
307 w = MCBSP_ST_READ(mcbsp, SYSCONFIG); 380 od = find_omap_device_by_dev(mcbsp->dev);
308 MCBSP_ST_WRITE(mcbsp, SYSCONFIG, w & ~(ST_AUTOIDLE));
309 381
310 w = MCBSP_ST_READ(mcbsp, SSELCR); 382 w = MCBSP_ST_READ(mcbsp, SSELCR);
311 383
@@ -648,48 +720,33 @@ EXPORT_SYMBOL(omap_mcbsp_get_dma_op_mode);
648 720
649static inline void omap34xx_mcbsp_request(struct omap_mcbsp *mcbsp) 721static inline void omap34xx_mcbsp_request(struct omap_mcbsp *mcbsp)
650{ 722{
723 struct omap_device *od;
724
725 od = find_omap_device_by_dev(mcbsp->dev);
651 /* 726 /*
652 * Enable wakup behavior, smart idle and all wakeups 727 * Enable wakup behavior, smart idle and all wakeups
653 * REVISIT: some wakeups may be unnecessary 728 * REVISIT: some wakeups may be unnecessary
654 */ 729 */
655 if (cpu_is_omap34xx() || cpu_is_omap44xx()) { 730 if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
656 u16 syscon; 731 MCBSP_WRITE(mcbsp, WAKEUPEN, XRDYEN | RRDYEN);
657
658 syscon = MCBSP_READ(mcbsp, SYSCON);
659 syscon &= ~(ENAWAKEUP | SIDLEMODE(0x03) | CLOCKACTIVITY(0x03));
660
661 if (mcbsp->dma_op_mode == MCBSP_DMA_MODE_THRESHOLD) {
662 syscon |= (ENAWAKEUP | SIDLEMODE(0x02) |
663 CLOCKACTIVITY(0x02));
664 MCBSP_WRITE(mcbsp, WAKEUPEN, XRDYEN | RRDYEN);
665 } else {
666 syscon |= SIDLEMODE(0x01);
667 }
668
669 MCBSP_WRITE(mcbsp, SYSCON, syscon);
670 } 732 }
671} 733}
672 734
673static inline void omap34xx_mcbsp_free(struct omap_mcbsp *mcbsp) 735static inline void omap34xx_mcbsp_free(struct omap_mcbsp *mcbsp)
674{ 736{
737 struct omap_device *od;
738
739 od = find_omap_device_by_dev(mcbsp->dev);
740
675 /* 741 /*
676 * Disable wakup behavior, smart idle and all wakeups 742 * Disable wakup behavior, smart idle and all wakeups
677 */ 743 */
678 if (cpu_is_omap34xx() || cpu_is_omap44xx()) { 744 if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
679 u16 syscon;
680
681 syscon = MCBSP_READ(mcbsp, SYSCON);
682 syscon &= ~(ENAWAKEUP | SIDLEMODE(0x03) | CLOCKACTIVITY(0x03));
683 /* 745 /*
684 * HW bug workaround - If no_idle mode is taken, we need to 746 * HW bug workaround - If no_idle mode is taken, we need to
685 * go to smart_idle before going to always_idle, or the 747 * go to smart_idle before going to always_idle, or the
686 * device will not hit retention anymore. 748 * device will not hit retention anymore.
687 */ 749 */
688 syscon |= SIDLEMODE(0x02);
689 MCBSP_WRITE(mcbsp, SYSCON, syscon);
690
691 syscon &= ~(SIDLEMODE(0x03));
692 MCBSP_WRITE(mcbsp, SYSCON, syscon);
693 750
694 MCBSP_WRITE(mcbsp, WAKEUPEN, 0); 751 MCBSP_WRITE(mcbsp, WAKEUPEN, 0);
695 } 752 }
@@ -764,8 +821,7 @@ int omap_mcbsp_request(unsigned int id)
764 if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->request) 821 if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->request)
765 mcbsp->pdata->ops->request(id); 822 mcbsp->pdata->ops->request(id);
766 823
767 clk_enable(mcbsp->iclk); 824 pm_runtime_get_sync(mcbsp->dev);
768 clk_enable(mcbsp->fclk);
769 825
770 /* Do procedure specific to omap34xx arch, if applicable */ 826 /* Do procedure specific to omap34xx arch, if applicable */
771 omap34xx_mcbsp_request(mcbsp); 827 omap34xx_mcbsp_request(mcbsp);
@@ -813,8 +869,7 @@ err_clk_disable:
813 /* Do procedure specific to omap34xx arch, if applicable */ 869 /* Do procedure specific to omap34xx arch, if applicable */
814 omap34xx_mcbsp_free(mcbsp); 870 omap34xx_mcbsp_free(mcbsp);
815 871
816 clk_disable(mcbsp->fclk); 872 pm_runtime_put_sync(mcbsp->dev);
817 clk_disable(mcbsp->iclk);
818 873
819 spin_lock(&mcbsp->lock); 874 spin_lock(&mcbsp->lock);
820 mcbsp->free = true; 875 mcbsp->free = true;
@@ -844,8 +899,7 @@ void omap_mcbsp_free(unsigned int id)
844 /* Do procedure specific to omap34xx arch, if applicable */ 899 /* Do procedure specific to omap34xx arch, if applicable */
845 omap34xx_mcbsp_free(mcbsp); 900 omap34xx_mcbsp_free(mcbsp);
846 901
847 clk_disable(mcbsp->fclk); 902 pm_runtime_put_sync(mcbsp->dev);
848 clk_disable(mcbsp->iclk);
849 903
850 if (mcbsp->io_type == OMAP_MCBSP_IRQ_IO) { 904 if (mcbsp->io_type == OMAP_MCBSP_IRQ_IO) {
851 /* Free IRQs */ 905 /* Free IRQs */
@@ -1649,7 +1703,8 @@ static const struct attribute_group sidetone_attr_group = {
1649 1703
1650static int __devinit omap_st_add(struct omap_mcbsp *mcbsp) 1704static int __devinit omap_st_add(struct omap_mcbsp *mcbsp)
1651{ 1705{
1652 struct omap_mcbsp_platform_data *pdata = mcbsp->pdata; 1706 struct platform_device *pdev;
1707 struct resource *res;
1653 struct omap_mcbsp_st_data *st_data; 1708 struct omap_mcbsp_st_data *st_data;
1654 int err; 1709 int err;
1655 1710
@@ -1659,7 +1714,10 @@ static int __devinit omap_st_add(struct omap_mcbsp *mcbsp)
1659 goto err1; 1714 goto err1;
1660 } 1715 }
1661 1716
1662 st_data->io_base_st = ioremap(pdata->phys_base_st, SZ_4K); 1717 pdev = container_of(mcbsp->dev, struct platform_device, dev);
1718
1719 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sidetone");
1720 st_data->io_base_st = ioremap(res->start, resource_size(res));
1663 if (!st_data->io_base_st) { 1721 if (!st_data->io_base_st) {
1664 err = -ENOMEM; 1722 err = -ENOMEM;
1665 goto err2; 1723 goto err2;
@@ -1748,6 +1806,7 @@ static int __devinit omap_mcbsp_probe(struct platform_device *pdev)
1748 struct omap_mcbsp_platform_data *pdata = pdev->dev.platform_data; 1806 struct omap_mcbsp_platform_data *pdata = pdev->dev.platform_data;
1749 struct omap_mcbsp *mcbsp; 1807 struct omap_mcbsp *mcbsp;
1750 int id = pdev->id - 1; 1808 int id = pdev->id - 1;
1809 struct resource *res;
1751 int ret = 0; 1810 int ret = 0;
1752 1811
1753 if (!pdata) { 1812 if (!pdata) {
@@ -1777,47 +1836,78 @@ static int __devinit omap_mcbsp_probe(struct platform_device *pdev)
1777 mcbsp->dma_tx_lch = -1; 1836 mcbsp->dma_tx_lch = -1;
1778 mcbsp->dma_rx_lch = -1; 1837 mcbsp->dma_rx_lch = -1;
1779 1838
1780 mcbsp->phys_base = pdata->phys_base; 1839 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu");
1781 mcbsp->io_base = ioremap(pdata->phys_base, SZ_4K); 1840 if (!res) {
1841 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1842 if (!res) {
1843 dev_err(&pdev->dev, "%s:mcbsp%d has invalid memory"
1844 "resource\n", __func__, pdev->id);
1845 ret = -ENOMEM;
1846 goto exit;
1847 }
1848 }
1849 mcbsp->phys_base = res->start;
1850 omap_mcbsp_cache_size = resource_size(res);
1851 mcbsp->io_base = ioremap(res->start, resource_size(res));
1782 if (!mcbsp->io_base) { 1852 if (!mcbsp->io_base) {
1783 ret = -ENOMEM; 1853 ret = -ENOMEM;
1784 goto err_ioremap; 1854 goto err_ioremap;
1785 } 1855 }
1786 1856
1857 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma");
1858 if (!res)
1859 mcbsp->phys_dma_base = mcbsp->phys_base;
1860 else
1861 mcbsp->phys_dma_base = res->start;
1862
1787 /* Default I/O is IRQ based */ 1863 /* Default I/O is IRQ based */
1788 mcbsp->io_type = OMAP_MCBSP_IRQ_IO; 1864 mcbsp->io_type = OMAP_MCBSP_IRQ_IO;
1789 mcbsp->tx_irq = pdata->tx_irq;
1790 mcbsp->rx_irq = pdata->rx_irq;
1791 mcbsp->dma_rx_sync = pdata->dma_rx_sync;
1792 mcbsp->dma_tx_sync = pdata->dma_tx_sync;
1793 1865
1794 mcbsp->iclk = clk_get(&pdev->dev, "ick"); 1866 mcbsp->tx_irq = platform_get_irq_byname(pdev, "tx");
1795 if (IS_ERR(mcbsp->iclk)) { 1867 mcbsp->rx_irq = platform_get_irq_byname(pdev, "rx");
1796 ret = PTR_ERR(mcbsp->iclk); 1868
1797 dev_err(&pdev->dev, "unable to get ick: %d\n", ret); 1869 /* From OMAP4 there will be a single irq line */
1798 goto err_iclk; 1870 if (mcbsp->tx_irq == -ENXIO)
1871 mcbsp->tx_irq = platform_get_irq(pdev, 0);
1872
1873 res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
1874 if (!res) {
1875 dev_err(&pdev->dev, "%s:mcbsp%d has invalid rx DMA channel\n",
1876 __func__, pdev->id);
1877 ret = -ENODEV;
1878 goto err_res;
1879 }
1880 mcbsp->dma_rx_sync = res->start;
1881
1882 res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
1883 if (!res) {
1884 dev_err(&pdev->dev, "%s:mcbsp%d has invalid tx DMA channel\n",
1885 __func__, pdev->id);
1886 ret = -ENODEV;
1887 goto err_res;
1799 } 1888 }
1889 mcbsp->dma_tx_sync = res->start;
1800 1890
1801 mcbsp->fclk = clk_get(&pdev->dev, "fck"); 1891 mcbsp->fclk = clk_get(&pdev->dev, "fck");
1802 if (IS_ERR(mcbsp->fclk)) { 1892 if (IS_ERR(mcbsp->fclk)) {
1803 ret = PTR_ERR(mcbsp->fclk); 1893 ret = PTR_ERR(mcbsp->fclk);
1804 dev_err(&pdev->dev, "unable to get fck: %d\n", ret); 1894 dev_err(&pdev->dev, "unable to get fck: %d\n", ret);
1805 goto err_fclk; 1895 goto err_res;
1806 } 1896 }
1807 1897
1808 mcbsp->pdata = pdata; 1898 mcbsp->pdata = pdata;
1809 mcbsp->dev = &pdev->dev; 1899 mcbsp->dev = &pdev->dev;
1810 mcbsp_ptr[id] = mcbsp; 1900 mcbsp_ptr[id] = mcbsp;
1901 mcbsp->mcbsp_config_type = pdata->mcbsp_config_type;
1811 platform_set_drvdata(pdev, mcbsp); 1902 platform_set_drvdata(pdev, mcbsp);
1903 pm_runtime_enable(mcbsp->dev);
1812 1904
1813 /* Initialize mcbsp properties for OMAP34XX if needed / applicable */ 1905 /* Initialize mcbsp properties for OMAP34XX if needed / applicable */
1814 omap34xx_device_init(mcbsp); 1906 omap34xx_device_init(mcbsp);
1815 1907
1816 return 0; 1908 return 0;
1817 1909
1818err_fclk: 1910err_res:
1819 clk_put(mcbsp->iclk);
1820err_iclk:
1821 iounmap(mcbsp->io_base); 1911 iounmap(mcbsp->io_base);
1822err_ioremap: 1912err_ioremap:
1823 kfree(mcbsp); 1913 kfree(mcbsp);
@@ -1839,7 +1929,6 @@ static int __devexit omap_mcbsp_remove(struct platform_device *pdev)
1839 omap34xx_device_exit(mcbsp); 1929 omap34xx_device_exit(mcbsp);
1840 1930
1841 clk_put(mcbsp->fclk); 1931 clk_put(mcbsp->fclk);
1842 clk_put(mcbsp->iclk);
1843 1932
1844 iounmap(mcbsp->io_base); 1933 iounmap(mcbsp->io_base);
1845 kfree(mcbsp); 1934 kfree(mcbsp);
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index 57adb270767b..9bbda9acb73b 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -83,9 +83,11 @@
83#include <linux/err.h> 83#include <linux/err.h>
84#include <linux/io.h> 84#include <linux/io.h>
85#include <linux/clk.h> 85#include <linux/clk.h>
86#include <linux/clkdev.h>
86 87
87#include <plat/omap_device.h> 88#include <plat/omap_device.h>
88#include <plat/omap_hwmod.h> 89#include <plat/omap_hwmod.h>
90#include <plat/clock.h>
89 91
90/* These parameters are passed to _omap_device_{de,}activate() */ 92/* These parameters are passed to _omap_device_{de,}activate() */
91#define USE_WAKEUP_LAT 0 93#define USE_WAKEUP_LAT 0
@@ -239,12 +241,12 @@ static inline struct omap_device *_find_by_pdev(struct platform_device *pdev)
239} 241}
240 242
241/** 243/**
242 * _add_optional_clock_alias - Add clock alias for hwmod optional clocks 244 * _add_optional_clock_clkdev - Add clkdev entry for hwmod optional clocks
243 * @od: struct omap_device *od 245 * @od: struct omap_device *od
244 * 246 *
245 * For every optional clock present per hwmod per omap_device, this function 247 * For every optional clock present per hwmod per omap_device, this function
246 * adds an entry in the clocks list of the form <dev-id=dev_name, con-id=role> 248 * adds an entry in the clkdev table of the form <dev-id=dev_name, con-id=role>
247 * if an entry is already present in it with the form <dev-id=NULL, con-id=role> 249 * if it does not exist already.
248 * 250 *
249 * The function is called from inside omap_device_build_ss(), after 251 * The function is called from inside omap_device_build_ss(), after
250 * omap_device_register. 252 * omap_device_register.
@@ -254,25 +256,39 @@ static inline struct omap_device *_find_by_pdev(struct platform_device *pdev)
254 * 256 *
255 * No return value. 257 * No return value.
256 */ 258 */
257static void _add_optional_clock_alias(struct omap_device *od, 259static void _add_optional_clock_clkdev(struct omap_device *od,
258 struct omap_hwmod *oh) 260 struct omap_hwmod *oh)
259{ 261{
260 int i; 262 int i;
261 263
262 for (i = 0; i < oh->opt_clks_cnt; i++) { 264 for (i = 0; i < oh->opt_clks_cnt; i++) {
263 struct omap_hwmod_opt_clk *oc; 265 struct omap_hwmod_opt_clk *oc;
264 int r; 266 struct clk *r;
267 struct clk_lookup *l;
265 268
266 oc = &oh->opt_clks[i]; 269 oc = &oh->opt_clks[i];
267 270
268 if (!oc->_clk) 271 if (!oc->_clk)
269 continue; 272 continue;
270 273
271 r = clk_add_alias(oc->role, dev_name(&od->pdev.dev), 274 r = clk_get_sys(dev_name(&od->pdev.dev), oc->role);
272 (char *)oc->clk, &od->pdev.dev); 275 if (!IS_ERR(r))
273 if (r) 276 continue; /* clkdev entry exists */
274 pr_err("omap_device: %s: clk_add_alias for %s failed\n", 277
278 r = omap_clk_get_by_name((char *)oc->clk);
279 if (IS_ERR(r)) {
280 pr_err("omap_device: %s: omap_clk_get_by_name for %s failed\n",
281 dev_name(&od->pdev.dev), oc->clk);
282 continue;
283 }
284
285 l = clkdev_alloc(r, oc->role, dev_name(&od->pdev.dev));
286 if (!l) {
287 pr_err("omap_device: %s: clkdev_alloc for %s failed\n",
275 dev_name(&od->pdev.dev), oc->role); 288 dev_name(&od->pdev.dev), oc->role);
289 return;
290 }
291 clkdev_add(l);
276 } 292 }
277} 293}
278 294
@@ -480,7 +496,7 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
480 496
481 for (i = 0; i < oh_cnt; i++) { 497 for (i = 0; i < oh_cnt; i++) {
482 hwmods[i]->od = od; 498 hwmods[i]->od = od;
483 _add_optional_clock_alias(od, hwmods[i]); 499 _add_optional_clock_clkdev(od, hwmods[i]);
484 } 500 }
485 501
486 if (ret) 502 if (ret)
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index e26e50487d60..a3f50b34a90d 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -242,7 +242,14 @@ static void __init omap_map_sram(void)
242 omap_sram_size - SRAM_BOOTLOADER_SZ); 242 omap_sram_size - SRAM_BOOTLOADER_SZ);
243} 243}
244 244
245void * omap_sram_push(void * start, unsigned long size) 245/*
246 * Memory allocator for SRAM: calculates the new ceiling address
247 * for pushing a function using the fncpy API.
248 *
249 * Note that fncpy requires the returned address to be aligned
250 * to an 8-byte boundary.
251 */
252void *omap_sram_push_address(unsigned long size)
246{ 253{
247 if (size > (omap_sram_ceil - (omap_sram_base + SRAM_BOOTLOADER_SZ))) { 254 if (size > (omap_sram_ceil - (omap_sram_base + SRAM_BOOTLOADER_SZ))) {
248 printk(KERN_ERR "Not enough space in SRAM\n"); 255 printk(KERN_ERR "Not enough space in SRAM\n");
@@ -250,10 +257,7 @@ void * omap_sram_push(void * start, unsigned long size)
250 } 257 }
251 258
252 omap_sram_ceil -= size; 259 omap_sram_ceil -= size;
253 omap_sram_ceil = ROUND_DOWN(omap_sram_ceil, sizeof(void *)); 260 omap_sram_ceil = ROUND_DOWN(omap_sram_ceil, FNCPY_ALIGN);
254 memcpy((void *)omap_sram_ceil, start, size);
255 flush_icache_range((unsigned long)omap_sram_ceil,
256 (unsigned long)(omap_sram_ceil + size));
257 261
258 return (void *)omap_sram_ceil; 262 return (void *)omap_sram_ceil;
259} 263}
@@ -312,7 +316,7 @@ u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass)
312} 316}
313#endif 317#endif
314 318
315#ifdef CONFIG_ARCH_OMAP2420 319#ifdef CONFIG_SOC_OMAP2420
316static int __init omap242x_sram_init(void) 320static int __init omap242x_sram_init(void)
317{ 321{
318 _omap2_sram_ddr_init = omap_sram_push(omap242x_sram_ddr_init, 322 _omap2_sram_ddr_init = omap_sram_push(omap242x_sram_ddr_init,
@@ -333,7 +337,7 @@ static inline int omap242x_sram_init(void)
333} 337}
334#endif 338#endif
335 339
336#ifdef CONFIG_ARCH_OMAP2430 340#ifdef CONFIG_SOC_OMAP2430
337static int __init omap243x_sram_init(void) 341static int __init omap243x_sram_init(void)
338{ 342{
339 _omap2_sram_ddr_init = omap_sram_push(omap243x_sram_ddr_init, 343 _omap2_sram_ddr_init = omap_sram_push(omap243x_sram_ddr_init,
@@ -405,20 +409,6 @@ static inline int omap34xx_sram_init(void)
405} 409}
406#endif 410#endif
407 411
408#ifdef CONFIG_ARCH_OMAP4
409static int __init omap44xx_sram_init(void)
410{
411 printk(KERN_ERR "FIXME: %s not implemented\n", __func__);
412
413 return -ENODEV;
414}
415#else
416static inline int omap44xx_sram_init(void)
417{
418 return 0;
419}
420#endif
421
422int __init omap_sram_init(void) 412int __init omap_sram_init(void)
423{ 413{
424 omap_detect_sram(); 414 omap_detect_sram();
@@ -432,8 +422,6 @@ int __init omap_sram_init(void)
432 omap243x_sram_init(); 422 omap243x_sram_init();
433 else if (cpu_is_omap34xx()) 423 else if (cpu_is_omap34xx())
434 omap34xx_sram_init(); 424 omap34xx_sram_init();
435 else if (cpu_is_omap44xx())
436 omap44xx_sram_init();
437 425
438 return 0; 426 return 0;
439} 427}
diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c
index 5f3522314815..078894bc3b9a 100644
--- a/arch/arm/plat-orion/gpio.c
+++ b/arch/arm/plat-orion/gpio.c
@@ -17,55 +17,123 @@
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19 19
20static DEFINE_SPINLOCK(gpio_lock); 20/*
21static unsigned long gpio_valid_input[BITS_TO_LONGS(GPIO_MAX)]; 21 * GPIO unit register offsets.
22static unsigned long gpio_valid_output[BITS_TO_LONGS(GPIO_MAX)]; 22 */
23#define GPIO_OUT_OFF 0x0000
24#define GPIO_IO_CONF_OFF 0x0004
25#define GPIO_BLINK_EN_OFF 0x0008
26#define GPIO_IN_POL_OFF 0x000c
27#define GPIO_DATA_IN_OFF 0x0010
28#define GPIO_EDGE_CAUSE_OFF 0x0014
29#define GPIO_EDGE_MASK_OFF 0x0018
30#define GPIO_LEVEL_MASK_OFF 0x001c
31
32struct orion_gpio_chip {
33 struct gpio_chip chip;
34 spinlock_t lock;
35 void __iomem *base;
36 unsigned long valid_input;
37 unsigned long valid_output;
38 int mask_offset;
39 int secondary_irq_base;
40};
41
42static void __iomem *GPIO_OUT(struct orion_gpio_chip *ochip)
43{
44 return ochip->base + GPIO_OUT_OFF;
45}
46
47static void __iomem *GPIO_IO_CONF(struct orion_gpio_chip *ochip)
48{
49 return ochip->base + GPIO_IO_CONF_OFF;
50}
51
52static void __iomem *GPIO_BLINK_EN(struct orion_gpio_chip *ochip)
53{
54 return ochip->base + GPIO_BLINK_EN_OFF;
55}
56
57static void __iomem *GPIO_IN_POL(struct orion_gpio_chip *ochip)
58{
59 return ochip->base + GPIO_IN_POL_OFF;
60}
61
62static void __iomem *GPIO_DATA_IN(struct orion_gpio_chip *ochip)
63{
64 return ochip->base + GPIO_DATA_IN_OFF;
65}
66
67static void __iomem *GPIO_EDGE_CAUSE(struct orion_gpio_chip *ochip)
68{
69 return ochip->base + GPIO_EDGE_CAUSE_OFF;
70}
71
72static void __iomem *GPIO_EDGE_MASK(struct orion_gpio_chip *ochip)
73{
74 return ochip->base + ochip->mask_offset + GPIO_EDGE_MASK_OFF;
75}
76
77static void __iomem *GPIO_LEVEL_MASK(struct orion_gpio_chip *ochip)
78{
79 return ochip->base + ochip->mask_offset + GPIO_LEVEL_MASK_OFF;
80}
81
23 82
24static inline void __set_direction(unsigned pin, int input) 83static struct orion_gpio_chip orion_gpio_chips[2];
84static int orion_gpio_chip_count;
85
86static inline void
87__set_direction(struct orion_gpio_chip *ochip, unsigned pin, int input)
25{ 88{
26 u32 u; 89 u32 u;
27 90
28 u = readl(GPIO_IO_CONF(pin)); 91 u = readl(GPIO_IO_CONF(ochip));
29 if (input) 92 if (input)
30 u |= 1 << (pin & 31); 93 u |= 1 << pin;
31 else 94 else
32 u &= ~(1 << (pin & 31)); 95 u &= ~(1 << pin);
33 writel(u, GPIO_IO_CONF(pin)); 96 writel(u, GPIO_IO_CONF(ochip));
34} 97}
35 98
36static void __set_level(unsigned pin, int high) 99static void __set_level(struct orion_gpio_chip *ochip, unsigned pin, int high)
37{ 100{
38 u32 u; 101 u32 u;
39 102
40 u = readl(GPIO_OUT(pin)); 103 u = readl(GPIO_OUT(ochip));
41 if (high) 104 if (high)
42 u |= 1 << (pin & 31); 105 u |= 1 << pin;
43 else 106 else
44 u &= ~(1 << (pin & 31)); 107 u &= ~(1 << pin);
45 writel(u, GPIO_OUT(pin)); 108 writel(u, GPIO_OUT(ochip));
46} 109}
47 110
48static inline void __set_blinking(unsigned pin, int blink) 111static inline void
112__set_blinking(struct orion_gpio_chip *ochip, unsigned pin, int blink)
49{ 113{
50 u32 u; 114 u32 u;
51 115
52 u = readl(GPIO_BLINK_EN(pin)); 116 u = readl(GPIO_BLINK_EN(ochip));
53 if (blink) 117 if (blink)
54 u |= 1 << (pin & 31); 118 u |= 1 << pin;
55 else 119 else
56 u &= ~(1 << (pin & 31)); 120 u &= ~(1 << pin);
57 writel(u, GPIO_BLINK_EN(pin)); 121 writel(u, GPIO_BLINK_EN(ochip));
58} 122}
59 123
60static inline int orion_gpio_is_valid(unsigned pin, int mode) 124static inline int
125orion_gpio_is_valid(struct orion_gpio_chip *ochip, unsigned pin, int mode)
61{ 126{
62 if (pin < GPIO_MAX) { 127 if (pin >= ochip->chip.ngpio)
63 if ((mode & GPIO_INPUT_OK) && !test_bit(pin, gpio_valid_input)) 128 goto err_out;
64 goto err_out; 129
65 if ((mode & GPIO_OUTPUT_OK) && !test_bit(pin, gpio_valid_output)) 130 if ((mode & GPIO_INPUT_OK) && !test_bit(pin, &ochip->valid_input))
66 goto err_out; 131 goto err_out;
67 return true; 132
68 } 133 if ((mode & GPIO_OUTPUT_OK) && !test_bit(pin, &ochip->valid_output))
134 goto err_out;
135
136 return 1;
69 137
70err_out: 138err_out:
71 pr_debug("%s: invalid GPIO %d\n", __func__, pin); 139 pr_debug("%s: invalid GPIO %d\n", __func__, pin);
@@ -75,134 +143,155 @@ err_out:
75/* 143/*
76 * GENERIC_GPIO primitives. 144 * GENERIC_GPIO primitives.
77 */ 145 */
146static int orion_gpio_request(struct gpio_chip *chip, unsigned pin)
147{
148 struct orion_gpio_chip *ochip =
149 container_of(chip, struct orion_gpio_chip, chip);
150
151 if (orion_gpio_is_valid(ochip, pin, GPIO_INPUT_OK) ||
152 orion_gpio_is_valid(ochip, pin, GPIO_OUTPUT_OK))
153 return 0;
154
155 return -EINVAL;
156}
157
78static int orion_gpio_direction_input(struct gpio_chip *chip, unsigned pin) 158static int orion_gpio_direction_input(struct gpio_chip *chip, unsigned pin)
79{ 159{
160 struct orion_gpio_chip *ochip =
161 container_of(chip, struct orion_gpio_chip, chip);
80 unsigned long flags; 162 unsigned long flags;
81 163
82 if (!orion_gpio_is_valid(pin, GPIO_INPUT_OK)) 164 if (!orion_gpio_is_valid(ochip, pin, GPIO_INPUT_OK))
83 return -EINVAL; 165 return -EINVAL;
84 166
85 spin_lock_irqsave(&gpio_lock, flags); 167 spin_lock_irqsave(&ochip->lock, flags);
86 168 __set_direction(ochip, pin, 1);
87 /* Configure GPIO direction. */ 169 spin_unlock_irqrestore(&ochip->lock, flags);
88 __set_direction(pin, 1);
89
90 spin_unlock_irqrestore(&gpio_lock, flags);
91 170
92 return 0; 171 return 0;
93} 172}
94 173
95static int orion_gpio_get_value(struct gpio_chip *chip, unsigned pin) 174static int orion_gpio_get(struct gpio_chip *chip, unsigned pin)
96{ 175{
176 struct orion_gpio_chip *ochip =
177 container_of(chip, struct orion_gpio_chip, chip);
97 int val; 178 int val;
98 179
99 if (readl(GPIO_IO_CONF(pin)) & (1 << (pin & 31))) 180 if (readl(GPIO_IO_CONF(ochip)) & (1 << pin)) {
100 val = readl(GPIO_DATA_IN(pin)) ^ readl(GPIO_IN_POL(pin)); 181 val = readl(GPIO_DATA_IN(ochip)) ^ readl(GPIO_IN_POL(ochip));
101 else 182 } else {
102 val = readl(GPIO_OUT(pin)); 183 val = readl(GPIO_OUT(ochip));
184 }
103 185
104 return (val >> (pin & 31)) & 1; 186 return (val >> pin) & 1;
105} 187}
106 188
107static int orion_gpio_direction_output(struct gpio_chip *chip, unsigned pin, 189static int
108 int value) 190orion_gpio_direction_output(struct gpio_chip *chip, unsigned pin, int value)
109{ 191{
192 struct orion_gpio_chip *ochip =
193 container_of(chip, struct orion_gpio_chip, chip);
110 unsigned long flags; 194 unsigned long flags;
111 195
112 if (!orion_gpio_is_valid(pin, GPIO_OUTPUT_OK)) 196 if (!orion_gpio_is_valid(ochip, pin, GPIO_OUTPUT_OK))
113 return -EINVAL; 197 return -EINVAL;
114 198
115 spin_lock_irqsave(&gpio_lock, flags); 199 spin_lock_irqsave(&ochip->lock, flags);
116 200 __set_blinking(ochip, pin, 0);
117 /* Disable blinking. */ 201 __set_level(ochip, pin, value);
118 __set_blinking(pin, 0); 202 __set_direction(ochip, pin, 0);
119 203 spin_unlock_irqrestore(&ochip->lock, flags);
120 /* Configure GPIO output value. */
121 __set_level(pin, value);
122
123 /* Configure GPIO direction. */
124 __set_direction(pin, 0);
125
126 spin_unlock_irqrestore(&gpio_lock, flags);
127 204
128 return 0; 205 return 0;
129} 206}
130 207
131static void orion_gpio_set_value(struct gpio_chip *chip, unsigned pin, 208static void orion_gpio_set(struct gpio_chip *chip, unsigned pin, int value)
132 int value)
133{ 209{
210 struct orion_gpio_chip *ochip =
211 container_of(chip, struct orion_gpio_chip, chip);
134 unsigned long flags; 212 unsigned long flags;
135 213
136 spin_lock_irqsave(&gpio_lock, flags); 214 spin_lock_irqsave(&ochip->lock, flags);
137 215 __set_level(ochip, pin, value);
138 /* Configure GPIO output value. */ 216 spin_unlock_irqrestore(&ochip->lock, flags);
139 __set_level(pin, value);
140
141 spin_unlock_irqrestore(&gpio_lock, flags);
142} 217}
143 218
144static int orion_gpio_request(struct gpio_chip *chip, unsigned pin) 219static int orion_gpio_to_irq(struct gpio_chip *chip, unsigned pin)
145{ 220{
146 if (orion_gpio_is_valid(pin, GPIO_INPUT_OK) || 221 struct orion_gpio_chip *ochip =
147 orion_gpio_is_valid(pin, GPIO_OUTPUT_OK)) 222 container_of(chip, struct orion_gpio_chip, chip);
148 return 0;
149 return -EINVAL;
150}
151 223
152static struct gpio_chip orion_gpiochip = { 224 return ochip->secondary_irq_base + pin;
153 .label = "orion_gpio",
154 .direction_input = orion_gpio_direction_input,
155 .get = orion_gpio_get_value,
156 .direction_output = orion_gpio_direction_output,
157 .set = orion_gpio_set_value,
158 .request = orion_gpio_request,
159 .base = 0,
160 .ngpio = GPIO_MAX,
161 .can_sleep = 0,
162};
163
164void __init orion_gpio_init(void)
165{
166 gpiochip_add(&orion_gpiochip);
167} 225}
168 226
227
169/* 228/*
170 * Orion-specific GPIO API extensions. 229 * Orion-specific GPIO API extensions.
171 */ 230 */
231static struct orion_gpio_chip *orion_gpio_chip_find(int pin)
232{
233 int i;
234
235 for (i = 0; i < orion_gpio_chip_count; i++) {
236 struct orion_gpio_chip *ochip = orion_gpio_chips + i;
237 struct gpio_chip *chip = &ochip->chip;
238
239 if (pin >= chip->base && pin < chip->base + chip->ngpio)
240 return ochip;
241 }
242
243 return NULL;
244}
245
172void __init orion_gpio_set_unused(unsigned pin) 246void __init orion_gpio_set_unused(unsigned pin)
173{ 247{
248 struct orion_gpio_chip *ochip = orion_gpio_chip_find(pin);
249
250 if (ochip == NULL)
251 return;
252
253 pin -= ochip->chip.base;
254
174 /* Configure as output, drive low. */ 255 /* Configure as output, drive low. */
175 __set_level(pin, 0); 256 __set_level(ochip, pin, 0);
176 __set_direction(pin, 0); 257 __set_direction(ochip, pin, 0);
177} 258}
178 259
179void __init orion_gpio_set_valid(unsigned pin, int mode) 260void __init orion_gpio_set_valid(unsigned pin, int mode)
180{ 261{
262 struct orion_gpio_chip *ochip = orion_gpio_chip_find(pin);
263
264 if (ochip == NULL)
265 return;
266
267 pin -= ochip->chip.base;
268
181 if (mode == 1) 269 if (mode == 1)
182 mode = GPIO_INPUT_OK | GPIO_OUTPUT_OK; 270 mode = GPIO_INPUT_OK | GPIO_OUTPUT_OK;
271
183 if (mode & GPIO_INPUT_OK) 272 if (mode & GPIO_INPUT_OK)
184 __set_bit(pin, gpio_valid_input); 273 __set_bit(pin, &ochip->valid_input);
185 else 274 else
186 __clear_bit(pin, gpio_valid_input); 275 __clear_bit(pin, &ochip->valid_input);
276
187 if (mode & GPIO_OUTPUT_OK) 277 if (mode & GPIO_OUTPUT_OK)
188 __set_bit(pin, gpio_valid_output); 278 __set_bit(pin, &ochip->valid_output);
189 else 279 else
190 __clear_bit(pin, gpio_valid_output); 280 __clear_bit(pin, &ochip->valid_output);
191} 281}
192 282
193void orion_gpio_set_blink(unsigned pin, int blink) 283void orion_gpio_set_blink(unsigned pin, int blink)
194{ 284{
285 struct orion_gpio_chip *ochip = orion_gpio_chip_find(pin);
195 unsigned long flags; 286 unsigned long flags;
196 287
197 spin_lock_irqsave(&gpio_lock, flags); 288 if (ochip == NULL)
289 return;
198 290
199 /* Set output value to zero. */ 291 spin_lock_irqsave(&ochip->lock, flags);
200 __set_level(pin, 0); 292 __set_level(ochip, pin, 0);
201 293 __set_blinking(ochip, pin, blink);
202 /* Set blinking. */ 294 spin_unlock_irqrestore(&ochip->lock, flags);
203 __set_blinking(pin, blink);
204
205 spin_unlock_irqrestore(&gpio_lock, flags);
206} 295}
207EXPORT_SYMBOL(orion_gpio_set_blink); 296EXPORT_SYMBOL(orion_gpio_set_blink);
208 297
@@ -234,59 +323,78 @@ EXPORT_SYMBOL(orion_gpio_set_blink);
234 ****************************************************************************/ 323 ****************************************************************************/
235static void gpio_irq_ack(struct irq_data *d) 324static void gpio_irq_ack(struct irq_data *d)
236{ 325{
237 int type = irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK; 326 struct orion_gpio_chip *ochip = irq_data_get_irq_chip_data(d);
327 int type;
328
329 type = irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK;
238 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) { 330 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
239 int pin = irq_to_gpio(d->irq); 331 int pin = d->irq - ochip->secondary_irq_base;
240 writel(~(1 << (pin & 31)), GPIO_EDGE_CAUSE(pin)); 332
333 writel(~(1 << pin), GPIO_EDGE_CAUSE(ochip));
241 } 334 }
242} 335}
243 336
244static void gpio_irq_mask(struct irq_data *d) 337static void gpio_irq_mask(struct irq_data *d)
245{ 338{
246 int pin = irq_to_gpio(d->irq); 339 struct orion_gpio_chip *ochip = irq_data_get_irq_chip_data(d);
247 int type = irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK; 340 int type;
248 u32 reg = (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) ? 341 void __iomem *reg;
249 GPIO_EDGE_MASK(pin) : GPIO_LEVEL_MASK(pin); 342 int pin;
250 u32 u = readl(reg); 343
251 u &= ~(1 << (pin & 31)); 344 type = irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK;
252 writel(u, reg); 345 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING))
346 reg = GPIO_EDGE_MASK(ochip);
347 else
348 reg = GPIO_LEVEL_MASK(ochip);
349
350 pin = d->irq - ochip->secondary_irq_base;
351
352 writel(readl(reg) & ~(1 << pin), reg);
253} 353}
254 354
255static void gpio_irq_unmask(struct irq_data *d) 355static void gpio_irq_unmask(struct irq_data *d)
256{ 356{
257 int pin = irq_to_gpio(d->irq); 357 struct orion_gpio_chip *ochip = irq_data_get_irq_chip_data(d);
258 int type = irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK; 358 int type;
259 u32 reg = (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) ? 359 void __iomem *reg;
260 GPIO_EDGE_MASK(pin) : GPIO_LEVEL_MASK(pin); 360 int pin;
261 u32 u = readl(reg); 361
262 u |= 1 << (pin & 31); 362 type = irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK;
263 writel(u, reg); 363 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING))
364 reg = GPIO_EDGE_MASK(ochip);
365 else
366 reg = GPIO_LEVEL_MASK(ochip);
367
368 pin = d->irq - ochip->secondary_irq_base;
369
370 writel(readl(reg) | (1 << pin), reg);
264} 371}
265 372
266static int gpio_irq_set_type(struct irq_data *d, u32 type) 373static int gpio_irq_set_type(struct irq_data *d, u32 type)
267{ 374{
268 int pin = irq_to_gpio(d->irq); 375 struct orion_gpio_chip *ochip = irq_data_get_irq_chip_data(d);
269 struct irq_desc *desc; 376 int pin;
270 u32 u; 377 u32 u;
271 378
272 u = readl(GPIO_IO_CONF(pin)) & (1 << (pin & 31)); 379 pin = d->irq - ochip->secondary_irq_base;
380
381 u = readl(GPIO_IO_CONF(ochip)) & (1 << pin);
273 if (!u) { 382 if (!u) {
274 printk(KERN_ERR "orion gpio_irq_set_type failed " 383 printk(KERN_ERR "orion gpio_irq_set_type failed "
275 "(irq %d, pin %d).\n", d->irq, pin); 384 "(irq %d, pin %d).\n", d->irq, pin);
276 return -EINVAL; 385 return -EINVAL;
277 } 386 }
278 387
279 desc = irq_desc + d->irq;
280
281 /* 388 /*
282 * Set edge/level type. 389 * Set edge/level type.
283 */ 390 */
284 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) { 391 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
285 desc->handle_irq = handle_edge_irq; 392 set_irq_handler(d->irq, handle_edge_irq);
286 } else if (type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) { 393 } else if (type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) {
287 desc->handle_irq = handle_level_irq; 394 set_irq_handler(d->irq, handle_level_irq);
288 } else { 395 } else {
289 printk(KERN_ERR "failed to set irq=%d (type=%d)\n", d->irq, type); 396 printk(KERN_ERR "failed to set irq=%d (type=%d)\n",
397 d->irq, type);
290 return -EINVAL; 398 return -EINVAL;
291 } 399 }
292 400
@@ -294,31 +402,29 @@ static int gpio_irq_set_type(struct irq_data *d, u32 type)
294 * Configure interrupt polarity. 402 * Configure interrupt polarity.
295 */ 403 */
296 if (type == IRQ_TYPE_EDGE_RISING || type == IRQ_TYPE_LEVEL_HIGH) { 404 if (type == IRQ_TYPE_EDGE_RISING || type == IRQ_TYPE_LEVEL_HIGH) {
297 u = readl(GPIO_IN_POL(pin)); 405 u = readl(GPIO_IN_POL(ochip));
298 u &= ~(1 << (pin & 31)); 406 u &= ~(1 << pin);
299 writel(u, GPIO_IN_POL(pin)); 407 writel(u, GPIO_IN_POL(ochip));
300 } else if (type == IRQ_TYPE_EDGE_FALLING || type == IRQ_TYPE_LEVEL_LOW) { 408 } else if (type == IRQ_TYPE_EDGE_FALLING || type == IRQ_TYPE_LEVEL_LOW) {
301 u = readl(GPIO_IN_POL(pin)); 409 u = readl(GPIO_IN_POL(ochip));
302 u |= 1 << (pin & 31); 410 u |= 1 << pin;
303 writel(u, GPIO_IN_POL(pin)); 411 writel(u, GPIO_IN_POL(ochip));
304 } else if (type == IRQ_TYPE_EDGE_BOTH) { 412 } else if (type == IRQ_TYPE_EDGE_BOTH) {
305 u32 v; 413 u32 v;
306 414
307 v = readl(GPIO_IN_POL(pin)) ^ readl(GPIO_DATA_IN(pin)); 415 v = readl(GPIO_IN_POL(ochip)) ^ readl(GPIO_DATA_IN(ochip));
308 416
309 /* 417 /*
310 * set initial polarity based on current input level 418 * set initial polarity based on current input level
311 */ 419 */
312 u = readl(GPIO_IN_POL(pin)); 420 u = readl(GPIO_IN_POL(ochip));
313 if (v & (1 << (pin & 31))) 421 if (v & (1 << pin))
314 u |= 1 << (pin & 31); /* falling */ 422 u |= 1 << pin; /* falling */
315 else 423 else
316 u &= ~(1 << (pin & 31)); /* rising */ 424 u &= ~(1 << pin); /* rising */
317 writel(u, GPIO_IN_POL(pin)); 425 writel(u, GPIO_IN_POL(ochip));
318 } 426 }
319 427
320 desc->status = (desc->status & ~IRQ_TYPE_SENSE_MASK) | type;
321
322 return 0; 428 return 0;
323} 429}
324 430
@@ -330,29 +436,87 @@ struct irq_chip orion_gpio_irq_chip = {
330 .irq_set_type = gpio_irq_set_type, 436 .irq_set_type = gpio_irq_set_type,
331}; 437};
332 438
439void __init orion_gpio_init(int gpio_base, int ngpio,
440 u32 base, int mask_offset, int secondary_irq_base)
441{
442 struct orion_gpio_chip *ochip;
443 int i;
444
445 if (orion_gpio_chip_count == ARRAY_SIZE(orion_gpio_chips))
446 return;
447
448 ochip = orion_gpio_chips + orion_gpio_chip_count;
449 ochip->chip.label = "orion_gpio";
450 ochip->chip.request = orion_gpio_request;
451 ochip->chip.direction_input = orion_gpio_direction_input;
452 ochip->chip.get = orion_gpio_get;
453 ochip->chip.direction_output = orion_gpio_direction_output;
454 ochip->chip.set = orion_gpio_set;
455 ochip->chip.to_irq = orion_gpio_to_irq;
456 ochip->chip.base = gpio_base;
457 ochip->chip.ngpio = ngpio;
458 ochip->chip.can_sleep = 0;
459 spin_lock_init(&ochip->lock);
460 ochip->base = (void __iomem *)base;
461 ochip->valid_input = 0;
462 ochip->valid_output = 0;
463 ochip->mask_offset = mask_offset;
464 ochip->secondary_irq_base = secondary_irq_base;
465
466 gpiochip_add(&ochip->chip);
467
468 orion_gpio_chip_count++;
469
470 /*
471 * Mask and clear GPIO interrupts.
472 */
473 writel(0, GPIO_EDGE_CAUSE(ochip));
474 writel(0, GPIO_EDGE_MASK(ochip));
475 writel(0, GPIO_LEVEL_MASK(ochip));
476
477 for (i = 0; i < ngpio; i++) {
478 unsigned int irq = secondary_irq_base + i;
479
480 set_irq_chip(irq, &orion_gpio_irq_chip);
481 set_irq_handler(irq, handle_level_irq);
482 set_irq_chip_data(irq, ochip);
483 irq_desc[irq].status |= IRQ_LEVEL;
484 set_irq_flags(irq, IRQF_VALID);
485 }
486}
487
333void orion_gpio_irq_handler(int pinoff) 488void orion_gpio_irq_handler(int pinoff)
334{ 489{
490 struct orion_gpio_chip *ochip;
335 u32 cause; 491 u32 cause;
336 int pin; 492 int i;
337 493
338 cause = readl(GPIO_DATA_IN(pinoff)) & readl(GPIO_LEVEL_MASK(pinoff)); 494 ochip = orion_gpio_chip_find(pinoff);
339 cause |= readl(GPIO_EDGE_CAUSE(pinoff)) & readl(GPIO_EDGE_MASK(pinoff)); 495 if (ochip == NULL)
496 return;
340 497
341 for (pin = pinoff; pin < pinoff + 8; pin++) { 498 cause = readl(GPIO_DATA_IN(ochip)) & readl(GPIO_LEVEL_MASK(ochip));
342 int irq = gpio_to_irq(pin); 499 cause |= readl(GPIO_EDGE_CAUSE(ochip)) & readl(GPIO_EDGE_MASK(ochip));
343 struct irq_desc *desc = irq_desc + irq;
344 500
345 if (!(cause & (1 << (pin & 31)))) 501 for (i = 0; i < ochip->chip.ngpio; i++) {
502 int irq;
503 struct irq_desc *desc;
504
505 irq = ochip->secondary_irq_base + i;
506
507 if (!(cause & (1 << i)))
346 continue; 508 continue;
347 509
510 desc = irq_desc + irq;
348 if ((desc->status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) { 511 if ((desc->status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
349 /* Swap polarity (race with GPIO line) */ 512 /* Swap polarity (race with GPIO line) */
350 u32 polarity; 513 u32 polarity;
351 514
352 polarity = readl(GPIO_IN_POL(pin)); 515 polarity = readl(GPIO_IN_POL(ochip));
353 polarity ^= 1 << (pin & 31); 516 polarity ^= 1 << i;
354 writel(polarity, GPIO_IN_POL(pin)); 517 writel(polarity, GPIO_IN_POL(ochip));
355 } 518 }
519
356 desc_handle_irq(irq, desc); 520 desc_handle_irq(irq, desc);
357 } 521 }
358} 522}
diff --git a/arch/arm/plat-orion/include/plat/gpio.h b/arch/arm/plat-orion/include/plat/gpio.h
index 07c430fdc9ef..5578b9803fc6 100644
--- a/arch/arm/plat-orion/include/plat/gpio.h
+++ b/arch/arm/plat-orion/include/plat/gpio.h
@@ -12,6 +12,7 @@
12#define __PLAT_GPIO_H 12#define __PLAT_GPIO_H
13 13
14#include <linux/init.h> 14#include <linux/init.h>
15#include <asm-generic/gpio.h>
15 16
16/* 17/*
17 * GENERIC_GPIO primitives. 18 * GENERIC_GPIO primitives.
@@ -19,6 +20,7 @@
19#define gpio_get_value __gpio_get_value 20#define gpio_get_value __gpio_get_value
20#define gpio_set_value __gpio_set_value 21#define gpio_set_value __gpio_set_value
21#define gpio_cansleep __gpio_cansleep 22#define gpio_cansleep __gpio_cansleep
23#define gpio_to_irq __gpio_to_irq
22 24
23/* 25/*
24 * Orion-specific GPIO API extensions. 26 * Orion-specific GPIO API extensions.
@@ -31,7 +33,8 @@ void orion_gpio_set_blink(unsigned pin, int blink);
31void orion_gpio_set_valid(unsigned pin, int mode); 33void orion_gpio_set_valid(unsigned pin, int mode);
32 34
33/* Initialize gpiolib. */ 35/* Initialize gpiolib. */
34void __init orion_gpio_init(void); 36void __init orion_gpio_init(int gpio_base, int ngpio,
37 u32 base, int mask_offset, int secondary_irq_base);
35 38
36/* 39/*
37 * GPIO interrupt handling. 40 * GPIO interrupt handling.
diff --git a/arch/arm/plat-orion/include/plat/time.h b/arch/arm/plat-orion/include/plat/time.h
index c06ca35f3613..4d5f1f6e18df 100644
--- a/arch/arm/plat-orion/include/plat/time.h
+++ b/arch/arm/plat-orion/include/plat/time.h
@@ -11,7 +11,10 @@
11#ifndef __PLAT_TIME_H 11#ifndef __PLAT_TIME_H
12#define __PLAT_TIME_H 12#define __PLAT_TIME_H
13 13
14void orion_time_init(unsigned int irq, unsigned int tclk); 14void orion_time_set_base(u32 timer_base);
15
16void orion_time_init(u32 bridge_base, u32 bridge_timer1_clr_mask,
17 unsigned int irq, unsigned int tclk);
15 18
16 19
17#endif 20#endif
diff --git a/arch/arm/plat-orion/time.c b/arch/arm/plat-orion/time.c
index c3da2478b2aa..742b0323c57b 100644
--- a/arch/arm/plat-orion/time.c
+++ b/arch/arm/plat-orion/time.c
@@ -18,28 +18,42 @@
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/irq.h> 19#include <linux/irq.h>
20#include <asm/sched_clock.h> 20#include <asm/sched_clock.h>
21#include <asm/mach/time.h>
22#include <mach/bridge-regs.h>
23#include <mach/hardware.h>
24 21
25/* 22/*
26 * Number of timer ticks per jiffy. 23 * MBus bridge block registers.
27 */ 24 */
28static u32 ticks_per_jiffy; 25#define BRIDGE_CAUSE_OFF 0x0110
26#define BRIDGE_MASK_OFF 0x0114
27#define BRIDGE_INT_TIMER0 0x0002
28#define BRIDGE_INT_TIMER1 0x0004
29 29
30 30
31/* 31/*
32 * Timer block registers. 32 * Timer block registers.
33 */ 33 */
34#define TIMER_CTRL (TIMER_VIRT_BASE + 0x0000) 34#define TIMER_CTRL_OFF 0x0000
35#define TIMER0_EN 0x0001 35#define TIMER0_EN 0x0001
36#define TIMER0_RELOAD_EN 0x0002 36#define TIMER0_RELOAD_EN 0x0002
37#define TIMER1_EN 0x0004 37#define TIMER1_EN 0x0004
38#define TIMER1_RELOAD_EN 0x0008 38#define TIMER1_RELOAD_EN 0x0008
39#define TIMER0_RELOAD (TIMER_VIRT_BASE + 0x0010) 39#define TIMER0_RELOAD_OFF 0x0010
40#define TIMER0_VAL (TIMER_VIRT_BASE + 0x0014) 40#define TIMER0_VAL_OFF 0x0014
41#define TIMER1_RELOAD (TIMER_VIRT_BASE + 0x0018) 41#define TIMER1_RELOAD_OFF 0x0018
42#define TIMER1_VAL (TIMER_VIRT_BASE + 0x001c) 42#define TIMER1_VAL_OFF 0x001c
43
44
45/*
46 * SoC-specific data.
47 */
48static void __iomem *bridge_base;
49static u32 bridge_timer1_clr_mask;
50static void __iomem *timer_base;
51
52
53/*
54 * Number of timer ticks per jiffy.
55 */
56static u32 ticks_per_jiffy;
43 57
44 58
45/* 59/*
@@ -50,14 +64,14 @@ static DEFINE_CLOCK_DATA(cd);
50 64
51unsigned long long notrace sched_clock(void) 65unsigned long long notrace sched_clock(void)
52{ 66{
53 u32 cyc = 0xffffffff - readl(TIMER0_VAL); 67 u32 cyc = ~readl(timer_base + TIMER0_VAL_OFF);
54 return cyc_to_sched_clock(&cd, cyc, (u32)~0); 68 return cyc_to_sched_clock(&cd, cyc, (u32)~0);
55} 69}
56 70
57 71
58static void notrace orion_update_sched_clock(void) 72static void notrace orion_update_sched_clock(void)
59{ 73{
60 u32 cyc = 0xffffffff - readl(TIMER0_VAL); 74 u32 cyc = ~readl(timer_base + TIMER0_VAL_OFF);
61 update_sched_clock(&cd, cyc, (u32)~0); 75 update_sched_clock(&cd, cyc, (u32)~0);
62} 76}
63 77
@@ -71,7 +85,7 @@ static void __init setup_sched_clock(unsigned long tclk)
71 */ 85 */
72static cycle_t orion_clksrc_read(struct clocksource *cs) 86static cycle_t orion_clksrc_read(struct clocksource *cs)
73{ 87{
74 return 0xffffffff - readl(TIMER0_VAL); 88 return 0xffffffff - readl(timer_base + TIMER0_VAL_OFF);
75} 89}
76 90
77static struct clocksource orion_clksrc = { 91static struct clocksource orion_clksrc = {
@@ -101,23 +115,23 @@ orion_clkevt_next_event(unsigned long delta, struct clock_event_device *dev)
101 /* 115 /*
102 * Clear and enable clockevent timer interrupt. 116 * Clear and enable clockevent timer interrupt.
103 */ 117 */
104 writel(BRIDGE_INT_TIMER1_CLR, BRIDGE_CAUSE); 118 writel(bridge_timer1_clr_mask, bridge_base + BRIDGE_CAUSE_OFF);
105 119
106 u = readl(BRIDGE_MASK); 120 u = readl(bridge_base + BRIDGE_MASK_OFF);
107 u |= BRIDGE_INT_TIMER1; 121 u |= BRIDGE_INT_TIMER1;
108 writel(u, BRIDGE_MASK); 122 writel(u, bridge_base + BRIDGE_MASK_OFF);
109 123
110 /* 124 /*
111 * Setup new clockevent timer value. 125 * Setup new clockevent timer value.
112 */ 126 */
113 writel(delta, TIMER1_VAL); 127 writel(delta, timer_base + TIMER1_VAL_OFF);
114 128
115 /* 129 /*
116 * Enable the timer. 130 * Enable the timer.
117 */ 131 */
118 u = readl(TIMER_CTRL); 132 u = readl(timer_base + TIMER_CTRL_OFF);
119 u = (u & ~TIMER1_RELOAD_EN) | TIMER1_EN; 133 u = (u & ~TIMER1_RELOAD_EN) | TIMER1_EN;
120 writel(u, TIMER_CTRL); 134 writel(u, timer_base + TIMER_CTRL_OFF);
121 135
122 local_irq_restore(flags); 136 local_irq_restore(flags);
123 137
@@ -135,37 +149,38 @@ orion_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
135 /* 149 /*
136 * Setup timer to fire at 1/HZ intervals. 150 * Setup timer to fire at 1/HZ intervals.
137 */ 151 */
138 writel(ticks_per_jiffy - 1, TIMER1_RELOAD); 152 writel(ticks_per_jiffy - 1, timer_base + TIMER1_RELOAD_OFF);
139 writel(ticks_per_jiffy - 1, TIMER1_VAL); 153 writel(ticks_per_jiffy - 1, timer_base + TIMER1_VAL_OFF);
140 154
141 /* 155 /*
142 * Enable timer interrupt. 156 * Enable timer interrupt.
143 */ 157 */
144 u = readl(BRIDGE_MASK); 158 u = readl(bridge_base + BRIDGE_MASK_OFF);
145 writel(u | BRIDGE_INT_TIMER1, BRIDGE_MASK); 159 writel(u | BRIDGE_INT_TIMER1, bridge_base + BRIDGE_MASK_OFF);
146 160
147 /* 161 /*
148 * Enable timer. 162 * Enable timer.
149 */ 163 */
150 u = readl(TIMER_CTRL); 164 u = readl(timer_base + TIMER_CTRL_OFF);
151 writel(u | TIMER1_EN | TIMER1_RELOAD_EN, TIMER_CTRL); 165 writel(u | TIMER1_EN | TIMER1_RELOAD_EN,
166 timer_base + TIMER_CTRL_OFF);
152 } else { 167 } else {
153 /* 168 /*
154 * Disable timer. 169 * Disable timer.
155 */ 170 */
156 u = readl(TIMER_CTRL); 171 u = readl(timer_base + TIMER_CTRL_OFF);
157 writel(u & ~TIMER1_EN, TIMER_CTRL); 172 writel(u & ~TIMER1_EN, timer_base + TIMER_CTRL_OFF);
158 173
159 /* 174 /*
160 * Disable timer interrupt. 175 * Disable timer interrupt.
161 */ 176 */
162 u = readl(BRIDGE_MASK); 177 u = readl(bridge_base + BRIDGE_MASK_OFF);
163 writel(u & ~BRIDGE_INT_TIMER1, BRIDGE_MASK); 178 writel(u & ~BRIDGE_INT_TIMER1, bridge_base + BRIDGE_MASK_OFF);
164 179
165 /* 180 /*
166 * ACK pending timer interrupt. 181 * ACK pending timer interrupt.
167 */ 182 */
168 writel(BRIDGE_INT_TIMER1_CLR, BRIDGE_CAUSE); 183 writel(bridge_timer1_clr_mask, bridge_base + BRIDGE_CAUSE_OFF);
169 184
170 } 185 }
171 local_irq_restore(flags); 186 local_irq_restore(flags);
@@ -185,7 +200,7 @@ static irqreturn_t orion_timer_interrupt(int irq, void *dev_id)
185 /* 200 /*
186 * ACK timer interrupt and call event handler. 201 * ACK timer interrupt and call event handler.
187 */ 202 */
188 writel(BRIDGE_INT_TIMER1_CLR, BRIDGE_CAUSE); 203 writel(bridge_timer1_clr_mask, bridge_base + BRIDGE_CAUSE_OFF);
189 orion_clkevt.event_handler(&orion_clkevt); 204 orion_clkevt.event_handler(&orion_clkevt);
190 205
191 return IRQ_HANDLED; 206 return IRQ_HANDLED;
@@ -197,31 +212,45 @@ static struct irqaction orion_timer_irq = {
197 .handler = orion_timer_interrupt 212 .handler = orion_timer_interrupt
198}; 213};
199 214
200void __init orion_time_init(unsigned int irq, unsigned int tclk) 215void __init
216orion_time_set_base(u32 _timer_base)
217{
218 timer_base = (void __iomem *)_timer_base;
219}
220
221void __init
222orion_time_init(u32 _bridge_base, u32 _bridge_timer1_clr_mask,
223 unsigned int irq, unsigned int tclk)
201{ 224{
202 u32 u; 225 u32 u;
203 226
227 /*
228 * Set SoC-specific data.
229 */
230 bridge_base = (void __iomem *)_bridge_base;
231 bridge_timer1_clr_mask = _bridge_timer1_clr_mask;
232
204 ticks_per_jiffy = (tclk + HZ/2) / HZ; 233 ticks_per_jiffy = (tclk + HZ/2) / HZ;
205 234
206 /* 235 /*
207 * Set scale and timer for sched_clock 236 * Set scale and timer for sched_clock.
208 */ 237 */
209 setup_sched_clock(tclk); 238 setup_sched_clock(tclk);
210 239
211 /* 240 /*
212 * Setup free-running clocksource timer (interrupts 241 * Setup free-running clocksource timer (interrupts
213 * disabled.) 242 * disabled).
214 */ 243 */
215 writel(0xffffffff, TIMER0_VAL); 244 writel(0xffffffff, timer_base + TIMER0_VAL_OFF);
216 writel(0xffffffff, TIMER0_RELOAD); 245 writel(0xffffffff, timer_base + TIMER0_RELOAD_OFF);
217 u = readl(BRIDGE_MASK); 246 u = readl(bridge_base + BRIDGE_MASK_OFF);
218 writel(u & ~BRIDGE_INT_TIMER0, BRIDGE_MASK); 247 writel(u & ~BRIDGE_INT_TIMER0, bridge_base + BRIDGE_MASK_OFF);
219 u = readl(TIMER_CTRL); 248 u = readl(timer_base + TIMER_CTRL_OFF);
220 writel(u | TIMER0_EN | TIMER0_RELOAD_EN, TIMER_CTRL); 249 writel(u | TIMER0_EN | TIMER0_RELOAD_EN, timer_base + TIMER_CTRL_OFF);
221 clocksource_register_hz(&orion_clksrc, tclk); 250 clocksource_register_hz(&orion_clksrc, tclk);
222 251
223 /* 252 /*
224 * Setup clockevent timer (interrupt-driven.) 253 * Setup clockevent timer (interrupt-driven).
225 */ 254 */
226 setup_irq(irq, &orion_timer_irq); 255 setup_irq(irq, &orion_timer_irq);
227 orion_clkevt.mult = div_sc(tclk, NSEC_PER_SEC, orion_clkevt.shift); 256 orion_clkevt.mult = div_sc(tclk, NSEC_PER_SEC, orion_clkevt.shift);
diff --git a/arch/arm/plat-pxa/include/plat/i2c.h b/arch/arm/plat-pxa/include/plat/i2c.h
deleted file mode 100644
index 1a9f65e6ec0f..000000000000
--- a/arch/arm/plat-pxa/include/plat/i2c.h
+++ /dev/null
@@ -1,82 +0,0 @@
1/*
2 * i2c_pxa.h
3 *
4 * Copyright (C) 2002 Intrinsyc Software Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11#ifndef _I2C_PXA_H_
12#define _I2C_PXA_H_
13
14#if 0
15#define DEF_TIMEOUT 3
16#else
17/* need a longer timeout if we're dealing with the fact we may well be
18 * looking at a multi-master environment
19*/
20#define DEF_TIMEOUT 32
21#endif
22
23#define BUS_ERROR (-EREMOTEIO)
24#define XFER_NAKED (-ECONNREFUSED)
25#define I2C_RETRY (-2000) /* an error has occurred retry transmit */
26
27/* ICR initialize bit values
28*
29* 15. FM 0 (100 Khz operation)
30* 14. UR 0 (No unit reset)
31* 13. SADIE 0 (Disables the unit from interrupting on slave addresses
32* matching its slave address)
33* 12. ALDIE 0 (Disables the unit from interrupt when it loses arbitration
34* in master mode)
35* 11. SSDIE 0 (Disables interrupts from a slave stop detected, in slave mode)
36* 10. BEIE 1 (Enable interrupts from detected bus errors, no ACK sent)
37* 9. IRFIE 1 (Enable interrupts from full buffer received)
38* 8. ITEIE 1 (Enables the I2C unit to interrupt when transmit buffer empty)
39* 7. GCD 1 (Disables i2c unit response to general call messages as a slave)
40* 6. IUE 0 (Disable unit until we change settings)
41* 5. SCLE 1 (Enables the i2c clock output for master mode (drives SCL)
42* 4. MA 0 (Only send stop with the ICR stop bit)
43* 3. TB 0 (We are not transmitting a byte initially)
44* 2. ACKNAK 0 (Send an ACK after the unit receives a byte)
45* 1. STOP 0 (Do not send a STOP)
46* 0. START 0 (Do not send a START)
47*
48*/
49#define I2C_ICR_INIT (ICR_BEIE | ICR_IRFIE | ICR_ITEIE | ICR_GCD | ICR_SCLE)
50
51/* I2C status register init values
52 *
53 * 10. BED 1 (Clear bus error detected)
54 * 9. SAD 1 (Clear slave address detected)
55 * 7. IRF 1 (Clear IDBR Receive Full)
56 * 6. ITE 1 (Clear IDBR Transmit Empty)
57 * 5. ALD 1 (Clear Arbitration Loss Detected)
58 * 4. SSD 1 (Clear Slave Stop Detected)
59 */
60#define I2C_ISR_INIT 0x7FF /* status register init */
61
62struct i2c_slave_client;
63
64struct i2c_pxa_platform_data {
65 unsigned int slave_addr;
66 struct i2c_slave_client *slave;
67 unsigned int class;
68 unsigned int use_pio :1;
69 unsigned int fast_mode :1;
70};
71
72extern void pxa_set_i2c_info(struct i2c_pxa_platform_data *info);
73
74#ifdef CONFIG_PXA27x
75extern void pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info);
76#endif
77
78#ifdef CONFIG_PXA3xx
79extern void pxa3xx_set_i2c_power_info(struct i2c_pxa_platform_data *info);
80#endif
81
82#endif
diff --git a/arch/arm/plat-pxa/mfp.c b/arch/arm/plat-pxa/mfp.c
index b77e018d36c1..a9aa5ad3f4eb 100644
--- a/arch/arm/plat-pxa/mfp.c
+++ b/arch/arm/plat-pxa/mfp.c
@@ -139,10 +139,11 @@ static const unsigned long mfpr_edge[] = {
139#define mfp_configured(p) ((p)->config != -1) 139#define mfp_configured(p) ((p)->config != -1)
140 140
141/* 141/*
142 * perform a read-back of any MFPR register to make sure the 142 * perform a read-back of any valid MFPR register to make sure the
143 * previous writings are finished 143 * previous writings are finished
144 */ 144 */
145#define mfpr_sync() (void)__raw_readl(mfpr_mmio_base + 0) 145static unsigned long mfpr_off_readback;
146#define mfpr_sync() (void)__raw_readl(mfpr_mmio_base + mfpr_off_readback)
146 147
147static inline void __mfp_config_run(struct mfp_pin *p) 148static inline void __mfp_config_run(struct mfp_pin *p)
148{ 149{
@@ -248,6 +249,9 @@ void __init mfp_init_addr(struct mfp_addr_map *map)
248 249
249 spin_lock_irqsave(&mfp_spin_lock, flags); 250 spin_lock_irqsave(&mfp_spin_lock, flags);
250 251
252 /* mfp offset for readback */
253 mfpr_off_readback = map[0].offset;
254
251 for (p = map; p->start != MFP_PIN_INVALID; p++) { 255 for (p = map; p->start != MFP_PIN_INVALID; p++) {
252 offset = p->offset; 256 offset = p->offset;
253 i = p->start; 257 i = p->start;
diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
index eb105e61c746..d9c4096ebf45 100644
--- a/arch/arm/plat-s3c24xx/Kconfig
+++ b/arch/arm/plat-s3c24xx/Kconfig
@@ -56,13 +56,6 @@ config S3C24XX_DCLK
56 help 56 help
57 Clock code for supporting DCLK/CLKOUT on S3C24XX architectures 57 Clock code for supporting DCLK/CLKOUT on S3C24XX architectures
58 58
59config S3C24XX_PWM
60 bool "PWM device support"
61 select HAVE_PWM
62 help
63 Support for exporting the PWM timer blocks via the pwm device
64 system.
65
66# gpio configurations 59# gpio configurations
67 60
68config S3C24XX_GPIO_EXTRA 61config S3C24XX_GPIO_EXTRA
diff --git a/arch/arm/plat-s3c24xx/cpu-freq.c b/arch/arm/plat-s3c24xx/cpu-freq.c
index 25a8fc7f512e..eea75ff81d15 100644
--- a/arch/arm/plat-s3c24xx/cpu-freq.c
+++ b/arch/arm/plat-s3c24xx/cpu-freq.c
@@ -433,7 +433,7 @@ static int s3c_cpufreq_verify(struct cpufreq_policy *policy)
433static struct cpufreq_frequency_table suspend_pll; 433static struct cpufreq_frequency_table suspend_pll;
434static unsigned int suspend_freq; 434static unsigned int suspend_freq;
435 435
436static int s3c_cpufreq_suspend(struct cpufreq_policy *policy, pm_message_t pmsg) 436static int s3c_cpufreq_suspend(struct cpufreq_policy *policy)
437{ 437{
438 suspend_pll.frequency = clk_get_rate(_clk_mpll); 438 suspend_pll.frequency = clk_get_rate(_clk_mpll);
439 suspend_pll.index = __raw_readl(S3C2410_MPLLCON); 439 suspend_pll.index = __raw_readl(S3C2410_MPLLCON);
diff --git a/arch/arm/plat-s3c24xx/include/plat/udc.h b/arch/arm/plat-s3c24xx/include/plat/udc.h
index 546bb4008f49..80457c6414aa 100644
--- a/arch/arm/plat-s3c24xx/include/plat/udc.h
+++ b/arch/arm/plat-s3c24xx/include/plat/udc.h
@@ -27,6 +27,10 @@ enum s3c2410_udc_cmd_e {
27struct s3c2410_udc_mach_info { 27struct s3c2410_udc_mach_info {
28 void (*udc_command)(enum s3c2410_udc_cmd_e); 28 void (*udc_command)(enum s3c2410_udc_cmd_e);
29 void (*vbus_draw)(unsigned int ma); 29 void (*vbus_draw)(unsigned int ma);
30
31 unsigned int pullup_pin;
32 unsigned int pullup_pin_inverted;
33
30 unsigned int vbus_pin; 34 unsigned int vbus_pin;
31 unsigned char vbus_pin_inverted; 35 unsigned char vbus_pin_inverted;
32}; 36};
diff --git a/arch/arm/plat-s3c24xx/sleep.S b/arch/arm/plat-s3c24xx/sleep.S
index e73e3b6e88d2..fd7032f84ae7 100644
--- a/arch/arm/plat-s3c24xx/sleep.S
+++ b/arch/arm/plat-s3c24xx/sleep.S
@@ -44,23 +44,13 @@
44 /* s3c_cpu_save 44 /* s3c_cpu_save
45 * 45 *
46 * entry: 46 * entry:
47 * r0 = save address (virtual addr of s3c_sleep_save_phys) 47 * r1 = v:p offset
48 */ 48 */
49 49
50ENTRY(s3c_cpu_save) 50ENTRY(s3c_cpu_save)
51 stmfd sp!, { r4 - r12, lr } 51 stmfd sp!, { r4 - r12, lr }
52 52 ldr r3, =resume_with_mmu
53 @@ store co-processor registers 53 bl cpu_suspend
54
55 mrc p15, 0, r4, c13, c0, 0 @ PID
56 mrc p15, 0, r5, c3, c0, 0 @ Domain ID
57 mrc p15, 0, r6, c2, c0, 0 @ translation table base address
58 mrc p15, 0, r7, c1, c0, 0 @ control register
59
60 stmia r0, { r4 - r13 }
61
62 @@ write our state back to RAM
63 bl s3c_pm_cb_flushcache
64 54
65 @@ jump to final code to send system to sleep 55 @@ jump to final code to send system to sleep
66 ldr r0, =pm_cpu_sleep 56 ldr r0, =pm_cpu_sleep
@@ -76,20 +66,6 @@ resume_with_mmu:
76 66
77 .ltorg 67 .ltorg
78 68
79 @@ the next bits sit in the .data segment, even though they
80 @@ happen to be code... the s3c_sleep_save_phys needs to be
81 @@ accessed by the resume code before it can restore the MMU.
82 @@ This means that the variable has to be close enough for the
83 @@ code to read it... since the .text segment needs to be RO,
84 @@ the data segment can be the only place to put this code.
85
86 .data
87
88 .global s3c_sleep_save_phys
89s3c_sleep_save_phys:
90 .word 0
91
92
93 /* sleep magic, to allow the bootloader to check for an valid 69 /* sleep magic, to allow the bootloader to check for an valid
94 * image to resume to. Must be the first word before the 70 * image to resume to. Must be the first word before the
95 * s3c_cpu_resume entry. 71 * s3c_cpu_resume entry.
@@ -100,10 +76,6 @@ s3c_sleep_save_phys:
100 /* s3c_cpu_resume 76 /* s3c_cpu_resume
101 * 77 *
102 * resume code entry for bootloader to call 78 * resume code entry for bootloader to call
103 *
104 * we must put this code here in the data segment as we have no
105 * other way of restoring the stack pointer after sleep, and we
106 * must not write to the code segment (code is read-only)
107 */ 79 */
108 80
109ENTRY(s3c_cpu_resume) 81ENTRY(s3c_cpu_resume)
@@ -134,25 +106,4 @@ ENTRY(s3c_cpu_resume)
134 beq 1001b 106 beq 1001b
135#endif /* CONFIG_DEBUG_RESUME */ 107#endif /* CONFIG_DEBUG_RESUME */
136 108
137 mov r1, #0 109 b cpu_resume
138 mcr p15, 0, r1, c8, c7, 0 @@ invalidate I & D TLBs
139 mcr p15, 0, r1, c7, c7, 0 @@ invalidate I & D caches
140
141 ldr r0, s3c_sleep_save_phys @ address of restore block
142 ldmia r0, { r4 - r13 }
143
144 mcr p15, 0, r4, c13, c0, 0 @ PID
145 mcr p15, 0, r5, c3, c0, 0 @ Domain ID
146 mcr p15, 0, r6, c2, c0, 0 @ translation table base
147
148#ifdef CONFIG_DEBUG_RESUME
149 mov r3, #'R'
150 strb r3, [ r2, #S3C2410_UTXH ]
151#endif
152
153 ldr r2, =resume_with_mmu
154 mcr p15, 0, r7, c1, c0, 0 @ turn on MMU, etc
155 nop @ second-to-last before mmu
156 mov pc, r2 @ go back to virtual address
157
158 .ltorg
diff --git a/arch/arm/plat-s5p/Kconfig b/arch/arm/plat-s5p/Kconfig
index deb39951a22e..849229716586 100644
--- a/arch/arm/plat-s5p/Kconfig
+++ b/arch/arm/plat-s5p/Kconfig
@@ -7,10 +7,10 @@
7 7
8config PLAT_S5P 8config PLAT_S5P
9 bool 9 bool
10 depends on (ARCH_S5P64X0 || ARCH_S5P6442 || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_S5PV310) 10 depends on (ARCH_S5P64X0 || ARCH_S5P6442 || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_EXYNOS4)
11 default y 11 default y
12 select ARM_VIC if !ARCH_S5PV310 12 select ARM_VIC if !ARCH_EXYNOS4
13 select ARM_GIC if ARCH_S5PV310 13 select ARM_GIC if ARCH_EXYNOS4
14 select NO_IOPORT 14 select NO_IOPORT
15 select ARCH_REQUIRE_GPIOLIB 15 select ARCH_REQUIRE_GPIOLIB
16 select S3C_GPIO_TRACK 16 select S3C_GPIO_TRACK
@@ -37,6 +37,19 @@ config S5P_GPIO_INT
37 help 37 help
38 Common code for the GPIO interrupts (other than external interrupts.) 38 Common code for the GPIO interrupts (other than external interrupts.)
39 39
40config S5P_HRT
41 bool
42 help
43 Use the High Resolution timer support
44
45comment "System MMU"
46
47config S5P_SYSTEM_MMU
48 bool "S5P SYSTEM MMU"
49 depends on ARCH_EXYNOS4
50 help
51 Say Y here if you want to enable System MMU
52
40config S5P_DEV_FIMC0 53config S5P_DEV_FIMC0
41 bool 54 bool
42 help 55 help
@@ -52,6 +65,11 @@ config S5P_DEV_FIMC2
52 help 65 help
53 Compile in platform device definitions for FIMC controller 2 66 Compile in platform device definitions for FIMC controller 2
54 67
68config S5P_DEV_FIMC3
69 bool
70 help
71 Compile in platform device definitions for FIMC controller 3
72
55config S5P_DEV_ONENAND 73config S5P_DEV_ONENAND
56 bool 74 bool
57 help 75 help
@@ -67,18 +85,7 @@ config S5P_DEV_CSIS1
67 help 85 help
68 Compile in platform device definitions for MIPI-CSIS channel 1 86 Compile in platform device definitions for MIPI-CSIS channel 1
69 87
70menuconfig S5P_SYSMMU 88config S5P_SETUP_MIPIPHY
71 bool "SYSMMU support" 89 bool
72 depends on ARCH_S5PV310
73 help
74 This is a System MMU driver for Samsung ARM based Soc.
75
76if S5P_SYSMMU
77
78config S5P_SYSMMU_DEBUG
79 bool "Enables debug messages"
80 depends on S5P_SYSMMU
81 help 90 help
82 This enables SYSMMU driver debug massages. 91 Compile in common setup code for MIPI-CSIS and MIPI-DSIM devices
83
84endif
diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile
index 92efe1adcfd6..42afff7f60be 100644
--- a/arch/arm/plat-s5p/Makefile
+++ b/arch/arm/plat-s5p/Makefile
@@ -19,15 +19,18 @@ obj-y += clock.o
19obj-y += irq.o 19obj-y += irq.o
20obj-$(CONFIG_S5P_EXT_INT) += irq-eint.o 20obj-$(CONFIG_S5P_EXT_INT) += irq-eint.o
21obj-$(CONFIG_S5P_GPIO_INT) += irq-gpioint.o 21obj-$(CONFIG_S5P_GPIO_INT) += irq-gpioint.o
22obj-$(CONFIG_S5P_SYSTEM_MMU) += sysmmu.o
22obj-$(CONFIG_PM) += pm.o 23obj-$(CONFIG_PM) += pm.o
23obj-$(CONFIG_PM) += irq-pm.o 24obj-$(CONFIG_PM) += irq-pm.o
25obj-$(CONFIG_S5P_HRT) += s5p-time.o
24 26
25# devices 27# devices
26 28
27obj-$(CONFIG_S5P_DEV_FIMC0) += dev-fimc0.o 29obj-$(CONFIG_S5P_DEV_FIMC0) += dev-fimc0.o
28obj-$(CONFIG_S5P_DEV_FIMC1) += dev-fimc1.o 30obj-$(CONFIG_S5P_DEV_FIMC1) += dev-fimc1.o
29obj-$(CONFIG_S5P_DEV_FIMC2) += dev-fimc2.o 31obj-$(CONFIG_S5P_DEV_FIMC2) += dev-fimc2.o
32obj-$(CONFIG_S5P_DEV_FIMC3) += dev-fimc3.o
30obj-$(CONFIG_S5P_DEV_ONENAND) += dev-onenand.o 33obj-$(CONFIG_S5P_DEV_ONENAND) += dev-onenand.o
31obj-$(CONFIG_S5P_DEV_CSIS0) += dev-csis0.o 34obj-$(CONFIG_S5P_DEV_CSIS0) += dev-csis0.o
32obj-$(CONFIG_S5P_DEV_CSIS1) += dev-csis1.o 35obj-$(CONFIG_S5P_DEV_CSIS1) += dev-csis1.o
33obj-$(CONFIG_S5P_SYSMMU) += sysmmu.o 36obj-$(CONFIG_S5P_SETUP_MIPIPHY) += setup-mipiphy.o
diff --git a/arch/arm/plat-s5p/cpu.c b/arch/arm/plat-s5p/cpu.c
index 047d31c1bbd8..c3bfe9b13acf 100644
--- a/arch/arm/plat-s5p/cpu.c
+++ b/arch/arm/plat-s5p/cpu.c
@@ -1,7 +1,7 @@
1/* linux/arch/arm/plat-s5p/cpu.c 1/* linux/arch/arm/plat-s5p/cpu.c
2 * 2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2009-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * S5P CPU Support 6 * S5P CPU Support
7 * 7 *
@@ -12,17 +12,20 @@
12 12
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <mach/map.h> 15
16#include <asm/mach/arch.h> 16#include <asm/mach/arch.h>
17#include <asm/mach/map.h> 17#include <asm/mach/map.h>
18
19#include <mach/map.h>
18#include <mach/regs-clock.h> 20#include <mach/regs-clock.h>
21
19#include <plat/cpu.h> 22#include <plat/cpu.h>
20#include <plat/s5p6440.h> 23#include <plat/s5p6440.h>
21#include <plat/s5p6442.h> 24#include <plat/s5p6442.h>
22#include <plat/s5p6450.h> 25#include <plat/s5p6450.h>
23#include <plat/s5pc100.h> 26#include <plat/s5pc100.h>
24#include <plat/s5pv210.h> 27#include <plat/s5pv210.h>
25#include <plat/s5pv310.h> 28#include <plat/exynos4.h>
26 29
27/* table of supported CPUs */ 30/* table of supported CPUs */
28 31
@@ -31,7 +34,7 @@ static const char name_s5p6442[] = "S5P6442";
31static const char name_s5p6450[] = "S5P6450"; 34static const char name_s5p6450[] = "S5P6450";
32static const char name_s5pc100[] = "S5PC100"; 35static const char name_s5pc100[] = "S5PC100";
33static const char name_s5pv210[] = "S5PV210/S5PC110"; 36static const char name_s5pv210[] = "S5PV210/S5PC110";
34static const char name_s5pv310[] = "S5PV310"; 37static const char name_exynos4210[] = "EXYNOS4210";
35 38
36static struct cpu_table cpu_ids[] __initdata = { 39static struct cpu_table cpu_ids[] __initdata = {
37 { 40 {
@@ -75,13 +78,13 @@ static struct cpu_table cpu_ids[] __initdata = {
75 .init = s5pv210_init, 78 .init = s5pv210_init,
76 .name = name_s5pv210, 79 .name = name_s5pv210,
77 }, { 80 }, {
78 .idcode = 0x43200000, 81 .idcode = 0x43210000,
79 .idmask = 0xfffff000, 82 .idmask = 0xfffff000,
80 .map_io = s5pv310_map_io, 83 .map_io = exynos4_map_io,
81 .init_clocks = s5pv310_init_clocks, 84 .init_clocks = exynos4_init_clocks,
82 .init_uarts = s5pv310_init_uarts, 85 .init_uarts = exynos4_init_uarts,
83 .init = s5pv310_init, 86 .init = exynos4_init,
84 .name = name_s5pv310, 87 .name = name_exynos4210,
85 }, 88 },
86}; 89};
87 90
diff --git a/arch/arm/plat-s5p/dev-csis0.c b/arch/arm/plat-s5p/dev-csis0.c
index dfab1c85f54f..e3aabef5e347 100644
--- a/arch/arm/plat-s5p/dev-csis0.c
+++ b/arch/arm/plat-s5p/dev-csis0.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2010 Samsung Electronics 2 * Copyright (C) 2010-2011 Samsung Electronics Co., Ltd.
3 * 3 *
4 * S5P series device definition for MIPI-CSIS channel 0 4 * S5P series device definition for MIPI-CSIS channel 0
5 * 5 *
diff --git a/arch/arm/plat-s5p/dev-csis1.c b/arch/arm/plat-s5p/dev-csis1.c
index e3053f27fbbf..08b91b580207 100644
--- a/arch/arm/plat-s5p/dev-csis1.c
+++ b/arch/arm/plat-s5p/dev-csis1.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2010 Samsung Electronics 2 * Copyright (C) 2010-2011 Samsung Electronics Co., Ltd.
3 * 3 *
4 * S5P series device definition for MIPI-CSIS channel 1 4 * S5P series device definition for MIPI-CSIS channel 1
5 * 5 *
diff --git a/arch/arm/plat-s5p/dev-fimc3.c b/arch/arm/plat-s5p/dev-fimc3.c
new file mode 100644
index 000000000000..ef31beca386c
--- /dev/null
+++ b/arch/arm/plat-s5p/dev-fimc3.c
@@ -0,0 +1,43 @@
1/* linux/arch/arm/plat-s5p/dev-fimc3.c
2 *
3 * Copyright (c) 2010 Samsung Electronics
4 *
5 * Base S5P FIMC3 resource and device definitions
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/dma-mapping.h>
14#include <linux/platform_device.h>
15#include <linux/interrupt.h>
16#include <linux/ioport.h>
17#include <mach/map.h>
18
19static struct resource s5p_fimc3_resource[] = {
20 [0] = {
21 .start = S5P_PA_FIMC3,
22 .end = S5P_PA_FIMC3 + SZ_4K - 1,
23 .flags = IORESOURCE_MEM,
24 },
25 [1] = {
26 .start = IRQ_FIMC3,
27 .end = IRQ_FIMC3,
28 .flags = IORESOURCE_IRQ,
29 },
30};
31
32static u64 s5p_fimc3_dma_mask = DMA_BIT_MASK(32);
33
34struct platform_device s5p_device_fimc3 = {
35 .name = "s5p-fimc",
36 .id = 3,
37 .num_resources = ARRAY_SIZE(s5p_fimc3_resource),
38 .resource = s5p_fimc3_resource,
39 .dev = {
40 .dma_mask = &s5p_fimc3_dma_mask,
41 .coherent_dma_mask = DMA_BIT_MASK(32),
42 },
43};
diff --git a/arch/arm/plat-s5p/dev-uart.c b/arch/arm/plat-s5p/dev-uart.c
index 6a7342886171..afaf87fdb93e 100644
--- a/arch/arm/plat-s5p/dev-uart.c
+++ b/arch/arm/plat-s5p/dev-uart.c
@@ -28,7 +28,7 @@
28static struct resource s5p_uart0_resource[] = { 28static struct resource s5p_uart0_resource[] = {
29 [0] = { 29 [0] = {
30 .start = S5P_PA_UART0, 30 .start = S5P_PA_UART0,
31 .end = S5P_PA_UART0 + S5P_SZ_UART, 31 .end = S5P_PA_UART0 + S5P_SZ_UART - 1,
32 .flags = IORESOURCE_MEM, 32 .flags = IORESOURCE_MEM,
33 }, 33 },
34 [1] = { 34 [1] = {
@@ -51,7 +51,7 @@ static struct resource s5p_uart0_resource[] = {
51static struct resource s5p_uart1_resource[] = { 51static struct resource s5p_uart1_resource[] = {
52 [0] = { 52 [0] = {
53 .start = S5P_PA_UART1, 53 .start = S5P_PA_UART1,
54 .end = S5P_PA_UART1 + S5P_SZ_UART, 54 .end = S5P_PA_UART1 + S5P_SZ_UART - 1,
55 .flags = IORESOURCE_MEM, 55 .flags = IORESOURCE_MEM,
56 }, 56 },
57 [1] = { 57 [1] = {
@@ -74,7 +74,7 @@ static struct resource s5p_uart1_resource[] = {
74static struct resource s5p_uart2_resource[] = { 74static struct resource s5p_uart2_resource[] = {
75 [0] = { 75 [0] = {
76 .start = S5P_PA_UART2, 76 .start = S5P_PA_UART2,
77 .end = S5P_PA_UART2 + S5P_SZ_UART, 77 .end = S5P_PA_UART2 + S5P_SZ_UART - 1,
78 .flags = IORESOURCE_MEM, 78 .flags = IORESOURCE_MEM,
79 }, 79 },
80 [1] = { 80 [1] = {
@@ -98,7 +98,7 @@ static struct resource s5p_uart3_resource[] = {
98#if CONFIG_SERIAL_SAMSUNG_UARTS > 3 98#if CONFIG_SERIAL_SAMSUNG_UARTS > 3
99 [0] = { 99 [0] = {
100 .start = S5P_PA_UART3, 100 .start = S5P_PA_UART3,
101 .end = S5P_PA_UART3 + S5P_SZ_UART, 101 .end = S5P_PA_UART3 + S5P_SZ_UART - 1,
102 .flags = IORESOURCE_MEM, 102 .flags = IORESOURCE_MEM,
103 }, 103 },
104 [1] = { 104 [1] = {
@@ -123,7 +123,7 @@ static struct resource s5p_uart4_resource[] = {
123#if CONFIG_SERIAL_SAMSUNG_UARTS > 4 123#if CONFIG_SERIAL_SAMSUNG_UARTS > 4
124 [0] = { 124 [0] = {
125 .start = S5P_PA_UART4, 125 .start = S5P_PA_UART4,
126 .end = S5P_PA_UART4 + S5P_SZ_UART, 126 .end = S5P_PA_UART4 + S5P_SZ_UART - 1,
127 .flags = IORESOURCE_MEM, 127 .flags = IORESOURCE_MEM,
128 }, 128 },
129 [1] = { 129 [1] = {
@@ -148,7 +148,7 @@ static struct resource s5p_uart5_resource[] = {
148#if CONFIG_SERIAL_SAMSUNG_UARTS > 5 148#if CONFIG_SERIAL_SAMSUNG_UARTS > 5
149 [0] = { 149 [0] = {
150 .start = S5P_PA_UART5, 150 .start = S5P_PA_UART5,
151 .end = S5P_PA_UART5 + S5P_SZ_UART, 151 .end = S5P_PA_UART5 + S5P_SZ_UART - 1,
152 .flags = IORESOURCE_MEM, 152 .flags = IORESOURCE_MEM,
153 }, 153 },
154 [1] = { 154 [1] = {
diff --git a/arch/arm/plat-s5p/include/plat/camport.h b/arch/arm/plat-s5p/include/plat/camport.h
new file mode 100644
index 000000000000..71688c8ba288
--- /dev/null
+++ b/arch/arm/plat-s5p/include/plat/camport.h
@@ -0,0 +1,28 @@
1/*
2 * Copyright (C) 2011 Samsung Electronics Co., Ltd.
3 *
4 * S5P series camera interface helper functions
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef PLAT_S5P_CAMPORT_H_
12#define PLAT_S5P_CAMPORT_H_ __FILE__
13
14enum s5p_camport_id {
15 S5P_CAMPORT_A,
16 S5P_CAMPORT_B,
17};
18
19/*
20 * The helper functions to configure GPIO for the camera parallel bus.
21 * The camera port can be multiplexed with any FIMC entity, even multiple
22 * FIMC entities are allowed to be attached to a single port simultaneously.
23 * These functions are to be used in the board setup code.
24 */
25int s5pv210_fimc_setup_gpio(enum s5p_camport_id id);
26int exynos4_fimc_setup_gpio(enum s5p_camport_id id);
27
28#endif
diff --git a/arch/arm/plat-s5p/include/plat/csis.h b/arch/arm/plat-s5p/include/plat/csis.h
deleted file mode 100644
index 51e308c7981d..000000000000
--- a/arch/arm/plat-s5p/include/plat/csis.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * Copyright (C) 2010 Samsung Electronics
3 *
4 * S5P series MIPI CSI slave device support
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef PLAT_S5P_CSIS_H_
12#define PLAT_S5P_CSIS_H_ __FILE__
13
14/**
15 * struct s5p_platform_mipi_csis - platform data for MIPI-CSIS
16 * @clk_rate: bus clock frequency
17 * @lanes: number of data lanes used
18 * @alignment: data alignment in bits
19 * @hs_settle: HS-RX settle time
20 */
21struct s5p_platform_mipi_csis {
22 unsigned long clk_rate;
23 u8 lanes;
24 u8 alignment;
25 u8 hs_settle;
26};
27
28#endif /* PLAT_S5P_CSIS_H_ */
diff --git a/arch/arm/plat-s5p/include/plat/exynos4.h b/arch/arm/plat-s5p/include/plat/exynos4.h
new file mode 100644
index 000000000000..907caab53dcf
--- /dev/null
+++ b/arch/arm/plat-s5p/include/plat/exynos4.h
@@ -0,0 +1,34 @@
1/* linux/arch/arm/plat-s5p/include/plat/exynos4.h
2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Header file for exynos4 cpu support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13/* Common init code for EXYNOS4 related SoCs */
14
15extern void exynos4_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
16extern void exynos4_register_clocks(void);
17extern void exynos4_setup_clocks(void);
18
19#ifdef CONFIG_CPU_EXYNOS4210
20
21extern int exynos4_init(void);
22extern void exynos4_init_irq(void);
23extern void exynos4_map_io(void);
24extern void exynos4_init_clocks(int xtal);
25extern struct sys_timer exynos4_timer;
26
27#define exynos4_init_uarts exynos4_common_init_uarts
28
29#else
30#define exynos4_init_clocks NULL
31#define exynos4_init_uarts NULL
32#define exynos4_map_io NULL
33#define exynos4_init NULL
34#endif
diff --git a/arch/arm/plat-s5p/include/plat/mipi_csis.h b/arch/arm/plat-s5p/include/plat/mipi_csis.h
new file mode 100644
index 000000000000..9bd254c5ed22
--- /dev/null
+++ b/arch/arm/plat-s5p/include/plat/mipi_csis.h
@@ -0,0 +1,43 @@
1/*
2 * Copyright (C) 2010-2011 Samsung Electronics Co., Ltd.
3 *
4 * S5P series MIPI CSI slave device support
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef PLAT_S5P_MIPI_CSIS_H_
12#define PLAT_S5P_MIPI_CSIS_H_ __FILE__
13
14struct platform_device;
15
16/**
17 * struct s5p_platform_mipi_csis - platform data for S5P MIPI-CSIS driver
18 * @clk_rate: bus clock frequency
19 * @lanes: number of data lanes used
20 * @alignment: data alignment in bits
21 * @hs_settle: HS-RX settle time
22 * @fixed_phy_vdd: false to enable external D-PHY regulator management in the
23 * driver or true in case this regulator has no enable function
24 * @phy_enable: pointer to a callback controlling D-PHY enable/reset
25 */
26struct s5p_platform_mipi_csis {
27 unsigned long clk_rate;
28 u8 lanes;
29 u8 alignment;
30 u8 hs_settle;
31 bool fixed_phy_vdd;
32 int (*phy_enable)(struct platform_device *pdev, bool on);
33};
34
35/**
36 * s5p_csis_phy_enable - global MIPI-CSI receiver D-PHY control
37 * @pdev: MIPI-CSIS platform device
38 * @on: true to enable D-PHY and deassert its reset
39 * false to disable D-PHY
40 */
41int s5p_csis_phy_enable(struct platform_device *pdev, bool on);
42
43#endif /* PLAT_S5P_MIPI_CSIS_H_ */
diff --git a/arch/arm/plat-s5p/include/plat/s5p-time.h b/arch/arm/plat-s5p/include/plat/s5p-time.h
new file mode 100644
index 000000000000..575e88109db8
--- /dev/null
+++ b/arch/arm/plat-s5p/include/plat/s5p-time.h
@@ -0,0 +1,40 @@
1/* linux/arch/arm/plat-s5p/include/plat/s5p-time.h
2 *
3 * Copyright 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Header file for s5p time support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_PLAT_S5P_TIME_H
14#define __ASM_PLAT_S5P_TIME_H __FILE__
15
16/* S5P HR-Timer Clock mode */
17enum s5p_timer_mode {
18 S5P_PWM0,
19 S5P_PWM1,
20 S5P_PWM2,
21 S5P_PWM3,
22 S5P_PWM4,
23};
24
25struct s5p_timer_source {
26 unsigned int event_id;
27 unsigned int source_id;
28};
29
30/* Be able to sleep for atleast 4 seconds (usually more) */
31#define S5PTIMER_MIN_RANGE 4
32
33#define TCNT_MAX 0xffffffff
34#define NON_PERIODIC 0
35#define PERIODIC 1
36
37extern void __init s5p_set_timer_source(enum s5p_timer_mode event,
38 enum s5p_timer_mode source);
39extern struct sys_timer s5p_timer;
40#endif /* __ASM_PLAT_S5P_TIME_H */
diff --git a/arch/arm/plat-s5p/include/plat/s5pv310.h b/arch/arm/plat-s5p/include/plat/s5pv310.h
deleted file mode 100644
index 769c991ceb37..000000000000
--- a/arch/arm/plat-s5p/include/plat/s5pv310.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/* linux/arch/arm/plat-s5p/include/plat/s5pv310.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Header file for s5pv310 cpu support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13/* Common init code for S5PV310 related SoCs */
14
15extern void s5pv310_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
16extern void s5pv310_register_clocks(void);
17extern void s5pv310_setup_clocks(void);
18
19#ifdef CONFIG_CPU_S5PV310
20
21extern int s5pv310_init(void);
22extern void s5pv310_init_irq(void);
23extern void s5pv310_map_io(void);
24extern void s5pv310_init_clocks(int xtal);
25extern struct sys_timer s5pv310_timer;
26
27#define s5pv310_init_uarts s5pv310_common_init_uarts
28
29#else
30#define s5pv310_init_clocks NULL
31#define s5pv310_init_uarts NULL
32#define s5pv310_map_io NULL
33#define s5pv310_init NULL
34#endif
diff --git a/arch/arm/plat-s5p/include/plat/sysmmu.h b/arch/arm/plat-s5p/include/plat/sysmmu.h
index db298fc5438a..bf5283c2a19d 100644
--- a/arch/arm/plat-s5p/include/plat/sysmmu.h
+++ b/arch/arm/plat-s5p/include/plat/sysmmu.h
@@ -1,23 +1,95 @@
1/* linux/arch/arm/plat-s5p/include/plat/sysmmu.h 1/* linux/arch/arm/plat-s5p/include/plat/sysmmu.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/ 4 * http://www.samsung.com
5 * 5 *
6 * Samsung sysmmu driver 6 * Samsung System MMU driver for S5P platform
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11*/ 11*/
12 12
13#ifndef __ASM_PLAT_S5P_SYSMMU_H 13#ifndef __ASM__PLAT_SYSMMU_H
14#define __ASM_PLAT_S5P_SYSMMU_H __FILE__ 14#define __ASM__PLAT_SYSMMU_H __FILE__
15 15
16/* debug macro */ 16enum S5P_SYSMMU_INTERRUPT_TYPE {
17#ifdef CONFIG_S5P_SYSMMU_DEBUG 17 SYSMMU_PAGEFAULT,
18#define sysmmu_debug(fmt, arg...) printk(KERN_INFO "[%s] " fmt, __func__, ## arg) 18 SYSMMU_AR_MULTIHIT,
19 SYSMMU_AW_MULTIHIT,
20 SYSMMU_BUSERROR,
21 SYSMMU_AR_SECURITY,
22 SYSMMU_AR_ACCESS,
23 SYSMMU_AW_SECURITY,
24 SYSMMU_AW_PROTECTION, /* 7 */
25 SYSMMU_FAULTS_NUM
26};
27
28#ifdef CONFIG_S5P_SYSTEM_MMU
29
30#include <mach/sysmmu.h>
31
32/**
33 * s5p_sysmmu_enable() - enable system mmu of ip
34 * @ips: The ip connected system mmu.
35 * #pgd: Base physical address of the 1st level page table
36 *
37 * This function enable system mmu to transfer address
38 * from virtual address to physical address
39 */
40void s5p_sysmmu_enable(sysmmu_ips ips, unsigned long pgd);
41
42/**
43 * s5p_sysmmu_disable() - disable sysmmu mmu of ip
44 * @ips: The ip connected system mmu.
45 *
46 * This function disable system mmu to transfer address
47 * from virtual address to physical address
48 */
49void s5p_sysmmu_disable(sysmmu_ips ips);
50
51/**
52 * s5p_sysmmu_set_tablebase_pgd() - set page table base address to refer page table
53 * @ips: The ip connected system mmu.
54 * @pgd: The page table base address.
55 *
56 * This function set page table base address
57 * When system mmu transfer address from virtaul address to physical address,
58 * system mmu refer address information from page table
59 */
60void s5p_sysmmu_set_tablebase_pgd(sysmmu_ips ips, unsigned long pgd);
61
62/**
63 * s5p_sysmmu_tlb_invalidate() - flush all TLB entry in system mmu
64 * @ips: The ip connected system mmu.
65 *
66 * This function flush all TLB entry in system mmu
67 */
68void s5p_sysmmu_tlb_invalidate(sysmmu_ips ips);
69
70/** s5p_sysmmu_set_fault_handler() - Fault handler for System MMUs
71 * @itype: type of fault.
72 * @pgtable_base: the physical address of page table base. This is 0 if @ips is
73 * SYSMMU_BUSERROR.
74 * @fault_addr: the device (virtual) address that the System MMU tried to
75 * translated. This is 0 if @ips is SYSMMU_BUSERROR.
76 * Called when interrupt occurred by the System MMUs
77 * The device drivers of peripheral devices that has a System MMU can implement
78 * a fault handler to resolve address translation fault by System MMU.
79 * The meanings of return value and parameters are described below.
80
81 * return value: non-zero if the fault is correctly resolved.
82 * zero if the fault is not handled.
83 */
84void s5p_sysmmu_set_fault_handler(sysmmu_ips ips,
85 int (*handler)(enum S5P_SYSMMU_INTERRUPT_TYPE itype,
86 unsigned long pgtable_base,
87 unsigned long fault_addr));
19#else 88#else
20#define sysmmu_debug(fmt, arg...) do { } while (0) 89#define s5p_sysmmu_enable(ips, pgd) do { } while (0)
90#define s5p_sysmmu_disable(ips) do { } while (0)
91#define s5p_sysmmu_set_tablebase_pgd(ips, pgd) do { } while (0)
92#define s5p_sysmmu_tlb_invalidate(ips) do { } while (0)
93#define s5p_sysmmu_set_fault_handler(ips, handler) do { } while (0)
21#endif 94#endif
22 95#endif /* __ASM_PLAT_SYSMMU_H */
23#endif /* __ASM_PLAT_S5P_SYSMMU_H */
diff --git a/arch/arm/plat-s5p/irq-gpioint.c b/arch/arm/plat-s5p/irq-gpioint.c
index 3b6bf89d1739..cd87d3256e03 100644
--- a/arch/arm/plat-s5p/irq-gpioint.c
+++ b/arch/arm/plat-s5p/irq-gpioint.c
@@ -17,82 +17,79 @@
17#include <linux/irq.h> 17#include <linux/irq.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/slab.h>
20 21
21#include <mach/map.h> 22#include <mach/map.h>
22#include <plat/gpio-core.h> 23#include <plat/gpio-core.h>
23#include <plat/gpio-cfg.h> 24#include <plat/gpio-cfg.h>
24 25
25#define S5P_GPIOREG(x) (S5P_VA_GPIO + (x)) 26#define GPIO_BASE(chip) (((unsigned long)(chip)->base) & 0xFFFFF000u)
26 27
27#define GPIOINT_CON_OFFSET 0x700 28#define CON_OFFSET 0x700
28#define GPIOINT_MASK_OFFSET 0x900 29#define MASK_OFFSET 0x900
29#define GPIOINT_PEND_OFFSET 0xA00 30#define PEND_OFFSET 0xA00
31#define REG_OFFSET(x) ((x) << 2)
30 32
31static struct s3c_gpio_chip *irq_chips[S5P_GPIOINT_GROUP_MAXNR]; 33struct s5p_gpioint_bank {
32 34 struct list_head list;
33static int s5p_gpioint_get_group(struct irq_data *data) 35 int start;
34{ 36 int nr_groups;
35 struct gpio_chip *chip = irq_data_get_irq_data(data); 37 int irq;
36 struct s3c_gpio_chip *s3c_chip = container_of(chip, 38 struct s3c_gpio_chip **chips;
37 struct s3c_gpio_chip, chip); 39 void (*handler)(unsigned int, struct irq_desc *);
38 int group; 40};
39
40 for (group = 0; group < S5P_GPIOINT_GROUP_MAXNR; group++)
41 if (s3c_chip == irq_chips[group])
42 break;
43 41
44 return group; 42LIST_HEAD(banks);
45}
46 43
47static int s5p_gpioint_get_offset(struct irq_data *data) 44static int s5p_gpioint_get_offset(struct irq_data *data)
48{ 45{
49 struct gpio_chip *chip = irq_data_get_irq_data(data); 46 struct s3c_gpio_chip *chip = irq_data_get_irq_data(data);
50 struct s3c_gpio_chip *s3c_chip = container_of(chip, 47 return data->irq - chip->irq_base;
51 struct s3c_gpio_chip, chip);
52
53 return data->irq - s3c_chip->irq_base;
54} 48}
55 49
56static void s5p_gpioint_ack(struct irq_data *data) 50static void s5p_gpioint_ack(struct irq_data *data)
57{ 51{
52 struct s3c_gpio_chip *chip = irq_data_get_irq_data(data);
58 int group, offset, pend_offset; 53 int group, offset, pend_offset;
59 unsigned int value; 54 unsigned int value;
60 55
61 group = s5p_gpioint_get_group(data); 56 group = chip->group;
62 offset = s5p_gpioint_get_offset(data); 57 offset = s5p_gpioint_get_offset(data);
63 pend_offset = group << 2; 58 pend_offset = REG_OFFSET(group);
64 59
65 value = __raw_readl(S5P_GPIOREG(GPIOINT_PEND_OFFSET) + pend_offset); 60 value = __raw_readl(GPIO_BASE(chip) + PEND_OFFSET + pend_offset);
66 value |= 1 << offset; 61 value |= BIT(offset);
67 __raw_writel(value, S5P_GPIOREG(GPIOINT_PEND_OFFSET) + pend_offset); 62 __raw_writel(value, GPIO_BASE(chip) + PEND_OFFSET + pend_offset);
68} 63}
69 64
70static void s5p_gpioint_mask(struct irq_data *data) 65static void s5p_gpioint_mask(struct irq_data *data)
71{ 66{
67 struct s3c_gpio_chip *chip = irq_data_get_irq_data(data);
72 int group, offset, mask_offset; 68 int group, offset, mask_offset;
73 unsigned int value; 69 unsigned int value;
74 70
75 group = s5p_gpioint_get_group(data); 71 group = chip->group;
76 offset = s5p_gpioint_get_offset(data); 72 offset = s5p_gpioint_get_offset(data);
77 mask_offset = group << 2; 73 mask_offset = REG_OFFSET(group);
78 74
79 value = __raw_readl(S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); 75 value = __raw_readl(GPIO_BASE(chip) + MASK_OFFSET + mask_offset);
80 value |= 1 << offset; 76 value |= BIT(offset);
81 __raw_writel(value, S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); 77 __raw_writel(value, GPIO_BASE(chip) + MASK_OFFSET + mask_offset);
82} 78}
83 79
84static void s5p_gpioint_unmask(struct irq_data *data) 80static void s5p_gpioint_unmask(struct irq_data *data)
85{ 81{
82 struct s3c_gpio_chip *chip = irq_data_get_irq_data(data);
86 int group, offset, mask_offset; 83 int group, offset, mask_offset;
87 unsigned int value; 84 unsigned int value;
88 85
89 group = s5p_gpioint_get_group(data); 86 group = chip->group;
90 offset = s5p_gpioint_get_offset(data); 87 offset = s5p_gpioint_get_offset(data);
91 mask_offset = group << 2; 88 mask_offset = REG_OFFSET(group);
92 89
93 value = __raw_readl(S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); 90 value = __raw_readl(GPIO_BASE(chip) + MASK_OFFSET + mask_offset);
94 value &= ~(1 << offset); 91 value &= ~BIT(offset);
95 __raw_writel(value, S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); 92 __raw_writel(value, GPIO_BASE(chip) + MASK_OFFSET + mask_offset);
96} 93}
97 94
98static void s5p_gpioint_mask_ack(struct irq_data *data) 95static void s5p_gpioint_mask_ack(struct irq_data *data)
@@ -103,12 +100,13 @@ static void s5p_gpioint_mask_ack(struct irq_data *data)
103 100
104static int s5p_gpioint_set_type(struct irq_data *data, unsigned int type) 101static int s5p_gpioint_set_type(struct irq_data *data, unsigned int type)
105{ 102{
103 struct s3c_gpio_chip *chip = irq_data_get_irq_data(data);
106 int group, offset, con_offset; 104 int group, offset, con_offset;
107 unsigned int value; 105 unsigned int value;
108 106
109 group = s5p_gpioint_get_group(data); 107 group = chip->group;
110 offset = s5p_gpioint_get_offset(data); 108 offset = s5p_gpioint_get_offset(data);
111 con_offset = group << 2; 109 con_offset = REG_OFFSET(group);
112 110
113 switch (type) { 111 switch (type) {
114 case IRQ_TYPE_EDGE_RISING: 112 case IRQ_TYPE_EDGE_RISING:
@@ -132,15 +130,15 @@ static int s5p_gpioint_set_type(struct irq_data *data, unsigned int type)
132 return -EINVAL; 130 return -EINVAL;
133 } 131 }
134 132
135 value = __raw_readl(S5P_GPIOREG(GPIOINT_CON_OFFSET) + con_offset); 133 value = __raw_readl(GPIO_BASE(chip) + CON_OFFSET + con_offset);
136 value &= ~(0x7 << (offset * 0x4)); 134 value &= ~(0x7 << (offset * 0x4));
137 value |= (type << (offset * 0x4)); 135 value |= (type << (offset * 0x4));
138 __raw_writel(value, S5P_GPIOREG(GPIOINT_CON_OFFSET) + con_offset); 136 __raw_writel(value, GPIO_BASE(chip) + CON_OFFSET + con_offset);
139 137
140 return 0; 138 return 0;
141} 139}
142 140
143struct irq_chip s5p_gpioint = { 141static struct irq_chip s5p_gpioint = {
144 .name = "s5p_gpioint", 142 .name = "s5p_gpioint",
145 .irq_ack = s5p_gpioint_ack, 143 .irq_ack = s5p_gpioint_ack,
146 .irq_mask = s5p_gpioint_mask, 144 .irq_mask = s5p_gpioint_mask,
@@ -151,30 +149,29 @@ struct irq_chip s5p_gpioint = {
151 149
152static void s5p_gpioint_handler(unsigned int irq, struct irq_desc *desc) 150static void s5p_gpioint_handler(unsigned int irq, struct irq_desc *desc)
153{ 151{
154 int group, offset, pend_offset, mask_offset; 152 struct s5p_gpioint_bank *bank = get_irq_data(irq);
155 int real_irq; 153 int group, pend_offset, mask_offset;
156 unsigned int pend, mask; 154 unsigned int pend, mask;
157 155
158 for (group = 0; group < S5P_GPIOINT_GROUP_MAXNR; group++) { 156 for (group = 0; group < bank->nr_groups; group++) {
159 pend_offset = group << 2; 157 struct s3c_gpio_chip *chip = bank->chips[group];
160 pend = __raw_readl(S5P_GPIOREG(GPIOINT_PEND_OFFSET) + 158 if (!chip)
161 pend_offset); 159 continue;
160
161 pend_offset = REG_OFFSET(group);
162 pend = __raw_readl(GPIO_BASE(chip) + PEND_OFFSET + pend_offset);
162 if (!pend) 163 if (!pend)
163 continue; 164 continue;
164 165
165 mask_offset = group << 2; 166 mask_offset = REG_OFFSET(group);
166 mask = __raw_readl(S5P_GPIOREG(GPIOINT_MASK_OFFSET) + 167 mask = __raw_readl(GPIO_BASE(chip) + MASK_OFFSET + mask_offset);
167 mask_offset);
168 pend &= ~mask; 168 pend &= ~mask;
169 169
170 for (offset = 0; offset < 8; offset++) { 170 while (pend) {
171 if (pend & (1 << offset)) { 171 int offset = fls(pend) - 1;
172 struct s3c_gpio_chip *chip = irq_chips[group]; 172 int real_irq = chip->irq_base + offset;
173 if (chip) { 173 generic_handle_irq(real_irq);
174 real_irq = chip->irq_base + offset; 174 pend &= ~BIT(offset);
175 generic_handle_irq(real_irq);
176 }
177 }
178 } 175 }
179 } 176 }
180} 177}
@@ -182,27 +179,48 @@ static void s5p_gpioint_handler(unsigned int irq, struct irq_desc *desc)
182static __init int s5p_gpioint_add(struct s3c_gpio_chip *chip) 179static __init int s5p_gpioint_add(struct s3c_gpio_chip *chip)
183{ 180{
184 static int used_gpioint_groups = 0; 181 static int used_gpioint_groups = 0;
185 static bool handler_registered = 0;
186 int irq, group = chip->group; 182 int irq, group = chip->group;
187 int i; 183 int i;
184 struct s5p_gpioint_bank *bank = NULL;
188 185
189 if (used_gpioint_groups >= S5P_GPIOINT_GROUP_COUNT) 186 if (used_gpioint_groups >= S5P_GPIOINT_GROUP_COUNT)
190 return -ENOMEM; 187 return -ENOMEM;
191 188
189 list_for_each_entry(bank, &banks, list) {
190 if (group >= bank->start &&
191 group < bank->start + bank->nr_groups)
192 break;
193 }
194 if (!bank)
195 return -EINVAL;
196
197 if (!bank->handler) {
198 bank->chips = kzalloc(sizeof(struct s3c_gpio_chip *) *
199 bank->nr_groups, GFP_KERNEL);
200 if (!bank->chips)
201 return -ENOMEM;
202
203 set_irq_chained_handler(bank->irq, s5p_gpioint_handler);
204 set_irq_data(bank->irq, bank);
205 bank->handler = s5p_gpioint_handler;
206 printk(KERN_INFO "Registered chained gpio int handler for interrupt %d.\n",
207 bank->irq);
208 }
209
210 /*
211 * chained GPIO irq has been sucessfully registered, allocate new gpio
212 * int group and assign irq nubmers
213 */
214
192 chip->irq_base = S5P_GPIOINT_BASE + 215 chip->irq_base = S5P_GPIOINT_BASE +
193 used_gpioint_groups * S5P_GPIOINT_GROUP_SIZE; 216 used_gpioint_groups * S5P_GPIOINT_GROUP_SIZE;
194 used_gpioint_groups++; 217 used_gpioint_groups++;
195 218
196 if (!handler_registered) { 219 bank->chips[group - bank->start] = chip;
197 set_irq_chained_handler(IRQ_GPIOINT, s5p_gpioint_handler);
198 handler_registered = 1;
199 }
200
201 irq_chips[group] = chip;
202 for (i = 0; i < chip->chip.ngpio; i++) { 220 for (i = 0; i < chip->chip.ngpio; i++) {
203 irq = chip->irq_base + i; 221 irq = chip->irq_base + i;
204 set_irq_chip(irq, &s5p_gpioint); 222 set_irq_chip(irq, &s5p_gpioint);
205 set_irq_data(irq, &chip->chip); 223 set_irq_data(irq, chip);
206 set_irq_handler(irq, handle_level_irq); 224 set_irq_handler(irq, handle_level_irq);
207 set_irq_flags(irq, IRQF_VALID); 225 set_irq_flags(irq, IRQF_VALID);
208 } 226 }
@@ -235,3 +253,19 @@ int __init s5p_register_gpio_interrupt(int pin)
235 } 253 }
236 return ret; 254 return ret;
237} 255}
256
257int __init s5p_register_gpioint_bank(int chain_irq, int start, int nr_groups)
258{
259 struct s5p_gpioint_bank *bank;
260
261 bank = kzalloc(sizeof(*bank), GFP_KERNEL);
262 if (!bank)
263 return -ENOMEM;
264
265 bank->start = start;
266 bank->nr_groups = nr_groups;
267 bank->irq = chain_irq;
268
269 list_add_tail(&bank->list, &banks);
270 return 0;
271}
diff --git a/arch/arm/plat-s5p/s5p-time.c b/arch/arm/plat-s5p/s5p-time.c
new file mode 100644
index 000000000000..8090403eec0f
--- /dev/null
+++ b/arch/arm/plat-s5p/s5p-time.c
@@ -0,0 +1,448 @@
1/* linux/arch/arm/plat-s5p/s5p-time.c
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P - Common hr-timer support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/sched.h>
14#include <linux/interrupt.h>
15#include <linux/irq.h>
16#include <linux/err.h>
17#include <linux/clk.h>
18#include <linux/clockchips.h>
19#include <linux/platform_device.h>
20
21#include <asm/smp_twd.h>
22#include <asm/mach/time.h>
23#include <asm/mach/arch.h>
24#include <asm/mach/map.h>
25#include <asm/sched_clock.h>
26
27#include <mach/map.h>
28#include <plat/devs.h>
29#include <plat/regs-timer.h>
30#include <plat/s5p-time.h>
31
32static struct clk *tin_event;
33static struct clk *tin_source;
34static struct clk *tdiv_event;
35static struct clk *tdiv_source;
36static struct clk *timerclk;
37static struct s5p_timer_source timer_source;
38static unsigned long clock_count_per_tick;
39static void s5p_timer_resume(void);
40
41static void s5p_time_stop(enum s5p_timer_mode mode)
42{
43 unsigned long tcon;
44
45 tcon = __raw_readl(S3C2410_TCON);
46
47 switch (mode) {
48 case S5P_PWM0:
49 tcon &= ~S3C2410_TCON_T0START;
50 break;
51
52 case S5P_PWM1:
53 tcon &= ~S3C2410_TCON_T1START;
54 break;
55
56 case S5P_PWM2:
57 tcon &= ~S3C2410_TCON_T2START;
58 break;
59
60 case S5P_PWM3:
61 tcon &= ~S3C2410_TCON_T3START;
62 break;
63
64 case S5P_PWM4:
65 tcon &= ~S3C2410_TCON_T4START;
66 break;
67
68 default:
69 printk(KERN_ERR "Invalid Timer %d\n", mode);
70 break;
71 }
72 __raw_writel(tcon, S3C2410_TCON);
73}
74
75static void s5p_time_setup(enum s5p_timer_mode mode, unsigned long tcnt)
76{
77 unsigned long tcon;
78
79 tcon = __raw_readl(S3C2410_TCON);
80
81 tcnt--;
82
83 switch (mode) {
84 case S5P_PWM0:
85 tcon &= ~(0x0f << 0);
86 tcon |= S3C2410_TCON_T0MANUALUPD;
87 break;
88
89 case S5P_PWM1:
90 tcon &= ~(0x0f << 8);
91 tcon |= S3C2410_TCON_T1MANUALUPD;
92 break;
93
94 case S5P_PWM2:
95 tcon &= ~(0x0f << 12);
96 tcon |= S3C2410_TCON_T2MANUALUPD;
97 break;
98
99 case S5P_PWM3:
100 tcon &= ~(0x0f << 16);
101 tcon |= S3C2410_TCON_T3MANUALUPD;
102 break;
103
104 case S5P_PWM4:
105 tcon &= ~(0x07 << 20);
106 tcon |= S3C2410_TCON_T4MANUALUPD;
107 break;
108
109 default:
110 printk(KERN_ERR "Invalid Timer %d\n", mode);
111 break;
112 }
113
114 __raw_writel(tcnt, S3C2410_TCNTB(mode));
115 __raw_writel(tcnt, S3C2410_TCMPB(mode));
116 __raw_writel(tcon, S3C2410_TCON);
117}
118
119static void s5p_time_start(enum s5p_timer_mode mode, bool periodic)
120{
121 unsigned long tcon;
122
123 tcon = __raw_readl(S3C2410_TCON);
124
125 switch (mode) {
126 case S5P_PWM0:
127 tcon |= S3C2410_TCON_T0START;
128 tcon &= ~S3C2410_TCON_T0MANUALUPD;
129
130 if (periodic)
131 tcon |= S3C2410_TCON_T0RELOAD;
132 else
133 tcon &= ~S3C2410_TCON_T0RELOAD;
134 break;
135
136 case S5P_PWM1:
137 tcon |= S3C2410_TCON_T1START;
138 tcon &= ~S3C2410_TCON_T1MANUALUPD;
139
140 if (periodic)
141 tcon |= S3C2410_TCON_T1RELOAD;
142 else
143 tcon &= ~S3C2410_TCON_T1RELOAD;
144 break;
145
146 case S5P_PWM2:
147 tcon |= S3C2410_TCON_T2START;
148 tcon &= ~S3C2410_TCON_T2MANUALUPD;
149
150 if (periodic)
151 tcon |= S3C2410_TCON_T2RELOAD;
152 else
153 tcon &= ~S3C2410_TCON_T2RELOAD;
154 break;
155
156 case S5P_PWM3:
157 tcon |= S3C2410_TCON_T3START;
158 tcon &= ~S3C2410_TCON_T3MANUALUPD;
159
160 if (periodic)
161 tcon |= S3C2410_TCON_T3RELOAD;
162 else
163 tcon &= ~S3C2410_TCON_T3RELOAD;
164 break;
165
166 case S5P_PWM4:
167 tcon |= S3C2410_TCON_T4START;
168 tcon &= ~S3C2410_TCON_T4MANUALUPD;
169
170 if (periodic)
171 tcon |= S3C2410_TCON_T4RELOAD;
172 else
173 tcon &= ~S3C2410_TCON_T4RELOAD;
174 break;
175
176 default:
177 printk(KERN_ERR "Invalid Timer %d\n", mode);
178 break;
179 }
180 __raw_writel(tcon, S3C2410_TCON);
181}
182
183static int s5p_set_next_event(unsigned long cycles,
184 struct clock_event_device *evt)
185{
186 s5p_time_setup(timer_source.event_id, cycles);
187 s5p_time_start(timer_source.event_id, NON_PERIODIC);
188
189 return 0;
190}
191
192static void s5p_set_mode(enum clock_event_mode mode,
193 struct clock_event_device *evt)
194{
195 s5p_time_stop(timer_source.event_id);
196
197 switch (mode) {
198 case CLOCK_EVT_MODE_PERIODIC:
199 s5p_time_setup(timer_source.event_id, clock_count_per_tick);
200 s5p_time_start(timer_source.event_id, PERIODIC);
201 break;
202
203 case CLOCK_EVT_MODE_ONESHOT:
204 break;
205
206 case CLOCK_EVT_MODE_UNUSED:
207 case CLOCK_EVT_MODE_SHUTDOWN:
208 break;
209
210 case CLOCK_EVT_MODE_RESUME:
211 s5p_timer_resume();
212 break;
213 }
214}
215
216static void s5p_timer_resume(void)
217{
218 /* event timer restart */
219 s5p_time_setup(timer_source.event_id, clock_count_per_tick);
220 s5p_time_start(timer_source.event_id, PERIODIC);
221
222 /* source timer restart */
223 s5p_time_setup(timer_source.source_id, TCNT_MAX);
224 s5p_time_start(timer_source.source_id, PERIODIC);
225}
226
227void __init s5p_set_timer_source(enum s5p_timer_mode event,
228 enum s5p_timer_mode source)
229{
230 s3c_device_timer[event].dev.bus = &platform_bus_type;
231 s3c_device_timer[source].dev.bus = &platform_bus_type;
232
233 timer_source.event_id = event;
234 timer_source.source_id = source;
235}
236
237static struct clock_event_device time_event_device = {
238 .name = "s5p_event_timer",
239 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
240 .rating = 200,
241 .set_next_event = s5p_set_next_event,
242 .set_mode = s5p_set_mode,
243};
244
245static irqreturn_t s5p_clock_event_isr(int irq, void *dev_id)
246{
247 struct clock_event_device *evt = dev_id;
248
249 evt->event_handler(evt);
250
251 return IRQ_HANDLED;
252}
253
254static struct irqaction s5p_clock_event_irq = {
255 .name = "s5p_time_irq",
256 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
257 .handler = s5p_clock_event_isr,
258 .dev_id = &time_event_device,
259};
260
261static void __init s5p_clockevent_init(void)
262{
263 unsigned long pclk;
264 unsigned long clock_rate;
265 unsigned int irq_number;
266 struct clk *tscaler;
267
268 pclk = clk_get_rate(timerclk);
269
270 tscaler = clk_get_parent(tdiv_event);
271
272 clk_set_rate(tscaler, pclk / 2);
273 clk_set_rate(tdiv_event, pclk / 2);
274 clk_set_parent(tin_event, tdiv_event);
275
276 clock_rate = clk_get_rate(tin_event);
277 clock_count_per_tick = clock_rate / HZ;
278
279 clockevents_calc_mult_shift(&time_event_device,
280 clock_rate, S5PTIMER_MIN_RANGE);
281 time_event_device.max_delta_ns =
282 clockevent_delta2ns(-1, &time_event_device);
283 time_event_device.min_delta_ns =
284 clockevent_delta2ns(1, &time_event_device);
285
286 time_event_device.cpumask = cpumask_of(0);
287 clockevents_register_device(&time_event_device);
288
289 irq_number = timer_source.event_id + IRQ_TIMER0;
290 setup_irq(irq_number, &s5p_clock_event_irq);
291}
292
293static cycle_t s5p_timer_read(struct clocksource *cs)
294{
295 unsigned long offset = 0;
296
297 switch (timer_source.source_id) {
298 case S5P_PWM0:
299 case S5P_PWM1:
300 case S5P_PWM2:
301 case S5P_PWM3:
302 offset = (timer_source.source_id * 0x0c) + 0x14;
303 break;
304
305 case S5P_PWM4:
306 offset = 0x40;
307 break;
308
309 default:
310 printk(KERN_ERR "Invalid Timer %d\n", timer_source.source_id);
311 return 0;
312 }
313
314 return (cycle_t) ~__raw_readl(S3C_TIMERREG(offset));
315}
316
317/*
318 * Override the global weak sched_clock symbol with this
319 * local implementation which uses the clocksource to get some
320 * better resolution when scheduling the kernel. We accept that
321 * this wraps around for now, since it is just a relative time
322 * stamp. (Inspired by U300 implementation.)
323 */
324static DEFINE_CLOCK_DATA(cd);
325
326unsigned long long notrace sched_clock(void)
327{
328 u32 cyc;
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
343 default:
344 printk(KERN_ERR "Invalid Timer %d\n", timer_source.source_id);
345 return 0;
346 }
347
348 cyc = ~__raw_readl(S3C_TIMERREG(offset));
349 return cyc_to_sched_clock(&cd, cyc, (u32)~0);
350}
351
352static void notrace s5p_update_sched_clock(void)
353{
354 u32 cyc;
355 unsigned long offset = 0;
356
357 switch (timer_source.source_id) {
358 case S5P_PWM0:
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
373 cyc = ~__raw_readl(S3C_TIMERREG(offset));
374 update_sched_clock(&cd, cyc, (u32)~0);
375}
376
377struct clocksource time_clocksource = {
378 .name = "s5p_clocksource_timer",
379 .rating = 250,
380 .read = s5p_timer_read,
381 .mask = CLOCKSOURCE_MASK(32),
382 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
383};
384
385static void __init s5p_clocksource_init(void)
386{
387 unsigned long pclk;
388 unsigned long clock_rate;
389
390 pclk = clk_get_rate(timerclk);
391
392 clk_set_rate(tdiv_source, pclk / 2);
393 clk_set_parent(tin_source, tdiv_source);
394
395 clock_rate = clk_get_rate(tin_source);
396
397 init_sched_clock(&cd, s5p_update_sched_clock, 32, clock_rate);
398
399 s5p_time_setup(timer_source.source_id, TCNT_MAX);
400 s5p_time_start(timer_source.source_id, PERIODIC);
401
402 if (clocksource_register_hz(&time_clocksource, clock_rate))
403 panic("%s: can't register clocksource\n", time_clocksource.name);
404}
405
406static void __init s5p_timer_resources(void)
407{
408
409 unsigned long event_id = timer_source.event_id;
410 unsigned long source_id = timer_source.source_id;
411
412 timerclk = clk_get(NULL, "timers");
413 if (IS_ERR(timerclk))
414 panic("failed to get timers clock for timer");
415
416 clk_enable(timerclk);
417
418 tin_event = clk_get(&s3c_device_timer[event_id].dev, "pwm-tin");
419 if (IS_ERR(tin_event))
420 panic("failed to get pwm-tin clock for event timer");
421
422 tdiv_event = clk_get(&s3c_device_timer[event_id].dev, "pwm-tdiv");
423 if (IS_ERR(tdiv_event))
424 panic("failed to get pwm-tdiv clock for event timer");
425
426 clk_enable(tin_event);
427
428 tin_source = clk_get(&s3c_device_timer[source_id].dev, "pwm-tin");
429 if (IS_ERR(tin_source))
430 panic("failed to get pwm-tin clock for source timer");
431
432 tdiv_source = clk_get(&s3c_device_timer[source_id].dev, "pwm-tdiv");
433 if (IS_ERR(tdiv_source))
434 panic("failed to get pwm-tdiv clock for source timer");
435
436 clk_enable(tin_source);
437}
438
439static void __init s5p_timer_init(void)
440{
441 s5p_timer_resources();
442 s5p_clockevent_init();
443 s5p_clocksource_init();
444}
445
446struct sys_timer s5p_timer = {
447 .init = s5p_timer_init,
448};
diff --git a/arch/arm/plat-s5p/setup-mipiphy.c b/arch/arm/plat-s5p/setup-mipiphy.c
new file mode 100644
index 000000000000..683c466c0e6a
--- /dev/null
+++ b/arch/arm/plat-s5p/setup-mipiphy.c
@@ -0,0 +1,63 @@
1/*
2 * Copyright (C) 2011 Samsung Electronics Co., Ltd.
3 *
4 * S5P - Helper functions for MIPI-CSIS and MIPI-DSIM D-PHY control
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/kernel.h>
12#include <linux/platform_device.h>
13#include <linux/io.h>
14#include <linux/spinlock.h>
15#include <mach/regs-clock.h>
16
17static int __s5p_mipi_phy_control(struct platform_device *pdev,
18 bool on, u32 reset)
19{
20 static DEFINE_SPINLOCK(lock);
21 void __iomem *addr;
22 unsigned long flags;
23 int pid;
24 u32 cfg;
25
26 if (!pdev)
27 return -EINVAL;
28
29 pid = (pdev->id == -1) ? 0 : pdev->id;
30
31 if (pid != 0 && pid != 1)
32 return -EINVAL;
33
34 addr = S5P_MIPI_DPHY_CONTROL(pid);
35
36 spin_lock_irqsave(&lock, flags);
37
38 cfg = __raw_readl(addr);
39 cfg = on ? (cfg | reset) : (cfg & ~reset);
40 __raw_writel(cfg, addr);
41
42 if (on) {
43 cfg |= S5P_MIPI_DPHY_ENABLE;
44 } else if (!(cfg & (S5P_MIPI_DPHY_SRESETN |
45 S5P_MIPI_DPHY_MRESETN) & ~reset)) {
46 cfg &= ~S5P_MIPI_DPHY_ENABLE;
47 }
48
49 __raw_writel(cfg, addr);
50 spin_unlock_irqrestore(&lock, flags);
51
52 return 0;
53}
54
55int s5p_csis_phy_enable(struct platform_device *pdev, bool on)
56{
57 return __s5p_mipi_phy_control(pdev, on, S5P_MIPI_DPHY_SRESETN);
58}
59
60int s5p_dsim_phy_enable(struct platform_device *pdev, bool on)
61{
62 return __s5p_mipi_phy_control(pdev, on, S5P_MIPI_DPHY_MRESETN);
63}
diff --git a/arch/arm/plat-s5p/sysmmu.c b/arch/arm/plat-s5p/sysmmu.c
index d804914dc2e2..54f5eddc921d 100644
--- a/arch/arm/plat-s5p/sysmmu.c
+++ b/arch/arm/plat-s5p/sysmmu.c
@@ -12,282 +12,266 @@
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14 14
15#include <asm/pgtable.h>
16
15#include <mach/map.h> 17#include <mach/map.h>
16#include <mach/regs-sysmmu.h> 18#include <mach/regs-sysmmu.h>
17#include <mach/sysmmu.h>
18
19#include <plat/sysmmu.h> 19#include <plat/sysmmu.h>
20 20
21struct sysmmu_controller s5p_sysmmu_cntlrs[S5P_SYSMMU_TOTAL_IPNUM]; 21#define CTRL_ENABLE 0x5
22 22#define CTRL_BLOCK 0x7
23void s5p_sysmmu_register(struct sysmmu_controller *sysmmuconp) 23#define CTRL_DISABLE 0x0
24{ 24
25 unsigned int reg_mmu_ctrl; 25static struct device *dev;
26 unsigned int reg_mmu_status; 26
27 unsigned int reg_pt_base_addr; 27static unsigned short fault_reg_offset[SYSMMU_FAULTS_NUM] = {
28 unsigned int reg_int_status; 28 S5P_PAGE_FAULT_ADDR,
29 unsigned int reg_page_ft_addr; 29 S5P_AR_FAULT_ADDR,
30 30 S5P_AW_FAULT_ADDR,
31 reg_int_status = __raw_readl(sysmmuconp->regs + S5P_INT_STATUS); 31 S5P_DEFAULT_SLAVE_ADDR,
32 reg_mmu_ctrl = __raw_readl(sysmmuconp->regs + S5P_MMU_CTRL); 32 S5P_AR_FAULT_ADDR,
33 reg_mmu_status = __raw_readl(sysmmuconp->regs + S5P_MMU_STATUS); 33 S5P_AR_FAULT_ADDR,
34 reg_pt_base_addr = __raw_readl(sysmmuconp->regs + S5P_PT_BASE_ADDR); 34 S5P_AW_FAULT_ADDR,
35 reg_page_ft_addr = __raw_readl(sysmmuconp->regs + S5P_PAGE_FAULT_ADDR); 35 S5P_AW_FAULT_ADDR
36 36};
37 printk(KERN_INFO "%s: ips:%s\n", __func__, sysmmuconp->name);
38 printk(KERN_INFO "%s: MMU_CTRL:0x%X, ", __func__, reg_mmu_ctrl);
39 printk(KERN_INFO "MMU_STATUS:0x%X, PT_BASE_ADDR:0x%X\n", reg_mmu_status, reg_pt_base_addr);
40 printk(KERN_INFO "%s: INT_STATUS:0x%X, PAGE_FAULT_ADDR:0x%X\n", __func__, reg_int_status, reg_page_ft_addr);
41
42 switch (reg_int_status & 0xFF) {
43 case 0x1:
44 printk(KERN_INFO "%s: Page fault\n", __func__);
45 printk(KERN_INFO "%s: Virtual address causing last page fault or bus error : 0x%x\n", __func__ , reg_page_ft_addr);
46 break;
47 case 0x2:
48 printk(KERN_INFO "%s: AR multi-hit fault\n", __func__);
49 break;
50 case 0x4:
51 printk(KERN_INFO "%s: AW multi-hit fault\n", __func__);
52 break;
53 case 0x8:
54 printk(KERN_INFO "%s: Bus error\n", __func__);
55 break;
56 case 0x10:
57 printk(KERN_INFO "%s: AR Security protection fault\n", __func__);
58 break;
59 case 0x20:
60 printk(KERN_INFO "%s: AR Access protection fault\n", __func__);
61 break;
62 case 0x40:
63 printk(KERN_INFO "%s: AW Security protection fault\n", __func__);
64 break;
65 case 0x80:
66 printk(KERN_INFO "%s: AW Access protection fault\n", __func__);
67 break;
68 }
69}
70 37
71static irqreturn_t s5p_sysmmu_irq(int irq, void *dev_id) 38static char *sysmmu_fault_name[SYSMMU_FAULTS_NUM] = {
72{ 39 "PAGE FAULT",
73 unsigned int i; 40 "AR MULTI-HIT FAULT",
74 unsigned int reg_int_status; 41 "AW MULTI-HIT FAULT",
75 struct sysmmu_controller *sysmmuconp; 42 "BUS ERROR",
43 "AR SECURITY PROTECTION FAULT",
44 "AR ACCESS PROTECTION FAULT",
45 "AW SECURITY PROTECTION FAULT",
46 "AW ACCESS PROTECTION FAULT"
47};
76 48
77 for (i = 0; i < S5P_SYSMMU_TOTAL_IPNUM; i++) { 49static int (*fault_handlers[S5P_SYSMMU_TOTAL_IPNUM])(
78 sysmmuconp = &s5p_sysmmu_cntlrs[i]; 50 enum S5P_SYSMMU_INTERRUPT_TYPE itype,
51 unsigned long pgtable_base,
52 unsigned long fault_addr);
79 53
80 if (sysmmuconp->enable == true) { 54/*
81 reg_int_status = __raw_readl(sysmmuconp->regs + S5P_INT_STATUS); 55 * If adjacent 2 bits are true, the system MMU is enabled.
56 * The system MMU is disabled, otherwise.
57 */
58static unsigned long sysmmu_states;
82 59
83 if (reg_int_status & 0xFF) 60static inline void set_sysmmu_active(sysmmu_ips ips)
84 s5p_sysmmu_register(sysmmuconp); 61{
85 } 62 sysmmu_states |= 3 << (ips * 2);
86 }
87 return IRQ_HANDLED;
88} 63}
89 64
90int s5p_sysmmu_set_tablebase_pgd(sysmmu_ips ips, unsigned long pgd) 65static inline void set_sysmmu_inactive(sysmmu_ips ips)
91{ 66{
92 struct sysmmu_controller *sysmmuconp = NULL; 67 sysmmu_states &= ~(3 << (ips * 2));
93 68}
94 sysmmuconp = &s5p_sysmmu_cntlrs[ips];
95
96 if (sysmmuconp == NULL) {
97 printk(KERN_ERR "failed to get ip's sysmmu info\n");
98 return 1;
99 }
100 69
101 /* Set sysmmu page table base address */ 70static inline int is_sysmmu_active(sysmmu_ips ips)
102 __raw_writel(pgd, sysmmuconp->regs + S5P_PT_BASE_ADDR); 71{
72 return sysmmu_states & (3 << (ips * 2));
73}
103 74
104 if (s5p_sysmmu_tlb_invalidate(ips) != 0) 75static void __iomem *sysmmusfrs[S5P_SYSMMU_TOTAL_IPNUM];
105 printk(KERN_ERR "failed s5p_sysmmu_tlb_invalidate\n");
106 76
107 return 0; 77static inline void sysmmu_block(sysmmu_ips ips)
78{
79 __raw_writel(CTRL_BLOCK, sysmmusfrs[ips] + S5P_MMU_CTRL);
80 dev_dbg(dev, "%s is blocked.\n", sysmmu_ips_name[ips]);
108} 81}
109 82
110static int s5p_sysmmu_set_tablebase(sysmmu_ips ips) 83static inline void sysmmu_unblock(sysmmu_ips ips)
111{ 84{
112 unsigned int pg; 85 __raw_writel(CTRL_ENABLE, sysmmusfrs[ips] + S5P_MMU_CTRL);
113 struct sysmmu_controller *sysmmuconp; 86 dev_dbg(dev, "%s is unblocked.\n", sysmmu_ips_name[ips]);
87}
114 88
115 sysmmuconp = &s5p_sysmmu_cntlrs[ips]; 89static inline void __sysmmu_tlb_invalidate(sysmmu_ips ips)
90{
91 __raw_writel(0x1, sysmmusfrs[ips] + S5P_MMU_FLUSH);
92 dev_dbg(dev, "TLB of %s is invalidated.\n", sysmmu_ips_name[ips]);
93}
116 94
117 if (sysmmuconp == NULL) { 95static inline void __sysmmu_set_ptbase(sysmmu_ips ips, unsigned long pgd)
118 printk(KERN_ERR "failed to get ip's sysmmu info\n"); 96{
119 return 1; 97 if (unlikely(pgd == 0)) {
98 pgd = (unsigned long)ZERO_PAGE(0);
99 __raw_writel(0x20, sysmmusfrs[ips] + S5P_MMU_CFG); /* 4KB LV1 */
100 } else {
101 __raw_writel(0x0, sysmmusfrs[ips] + S5P_MMU_CFG); /* 16KB LV1 */
120 } 102 }
121 103
122 __asm__("mrc p15, 0, %0, c2, c0, 0" \ 104 __raw_writel(pgd, sysmmusfrs[ips] + S5P_PT_BASE_ADDR);
123 : "=r" (pg) : : "cc"); \
124 pg &= ~0x3fff;
125
126 sysmmu_debug("CP15 TTBR0 : 0x%x\n", pg);
127 105
128 /* Set sysmmu page table base address */ 106 dev_dbg(dev, "Page table base of %s is initialized with 0x%08lX.\n",
129 __raw_writel(pg, sysmmuconp->regs + S5P_PT_BASE_ADDR); 107 sysmmu_ips_name[ips], pgd);
108 __sysmmu_tlb_invalidate(ips);
109}
130 110
131 return 0; 111void sysmmu_set_fault_handler(sysmmu_ips ips,
112 int (*handler)(enum S5P_SYSMMU_INTERRUPT_TYPE itype,
113 unsigned long pgtable_base,
114 unsigned long fault_addr))
115{
116 BUG_ON(!((ips >= SYSMMU_MDMA) && (ips < S5P_SYSMMU_TOTAL_IPNUM)));
117 fault_handlers[ips] = handler;
132} 118}
133 119
134int s5p_sysmmu_enable(sysmmu_ips ips) 120static irqreturn_t s5p_sysmmu_irq(int irq, void *dev_id)
135{ 121{
136 unsigned int reg; 122 /* SYSMMU is in blocked when interrupt occurred. */
123 unsigned long base = 0;
124 sysmmu_ips ips = (sysmmu_ips)dev_id;
125 enum S5P_SYSMMU_INTERRUPT_TYPE itype;
137 126
138 struct sysmmu_controller *sysmmuconp; 127 itype = (enum S5P_SYSMMU_INTERRUPT_TYPE)
128 __ffs(__raw_readl(sysmmusfrs[ips] + S5P_INT_STATUS));
139 129
140 sysmmuconp = &s5p_sysmmu_cntlrs[ips]; 130 BUG_ON(!((itype >= 0) && (itype < 8)));
141 131
142 if (sysmmuconp == NULL) { 132 dev_alert(dev, "%s occurred by %s.\n", sysmmu_fault_name[itype],
143 printk(KERN_ERR "failed to get ip's sysmmu info\n"); 133 sysmmu_ips_name[ips]);
144 return 1;
145 }
146 134
147 s5p_sysmmu_set_tablebase(ips); 135 if (fault_handlers[ips]) {
136 unsigned long addr;
148 137
149 /* replacement policy : LRU */ 138 base = __raw_readl(sysmmusfrs[ips] + S5P_PT_BASE_ADDR);
150 reg = __raw_readl(sysmmuconp->regs + S5P_MMU_CFG); 139 addr = __raw_readl(sysmmusfrs[ips] + fault_reg_offset[itype]);
151 reg |= 0x1;
152 __raw_writel(reg, sysmmuconp->regs + S5P_MMU_CFG);
153 140
154 /* Enable interrupt, Enable MMU */ 141 if (fault_handlers[ips](itype, base, addr)) {
155 reg = __raw_readl(sysmmuconp->regs + S5P_MMU_CTRL); 142 __raw_writel(1 << itype,
156 reg |= (0x1 << 2) | (0x1 << 0); 143 sysmmusfrs[ips] + S5P_INT_CLEAR);
144 dev_notice(dev, "%s from %s is resolved."
145 " Retrying translation.\n",
146 sysmmu_fault_name[itype], sysmmu_ips_name[ips]);
147 } else {
148 base = 0;
149 }
150 }
157 151
158 __raw_writel(reg, sysmmuconp->regs + S5P_MMU_CTRL); 152 sysmmu_unblock(ips);
159 153
160 sysmmuconp->enable = true; 154 if (!base)
155 dev_notice(dev, "%s from %s is not handled.\n",
156 sysmmu_fault_name[itype], sysmmu_ips_name[ips]);
161 157
162 return 0; 158 return IRQ_HANDLED;
163} 159}
164 160
165int s5p_sysmmu_disable(sysmmu_ips ips) 161void s5p_sysmmu_set_tablebase_pgd(sysmmu_ips ips, unsigned long pgd)
166{ 162{
167 unsigned int reg; 163 if (is_sysmmu_active(ips)) {
168 164 sysmmu_block(ips);
169 struct sysmmu_controller *sysmmuconp = NULL; 165 __sysmmu_set_ptbase(ips, pgd);
170 166 sysmmu_unblock(ips);
171 if (ips > S5P_SYSMMU_TOTAL_IPNUM) 167 } else {
172 printk(KERN_ERR "failed to get ips parameter\n"); 168 dev_dbg(dev, "%s is disabled. "
173 169 "Skipping initializing page table base.\n",
174 sysmmuconp = &s5p_sysmmu_cntlrs[ips]; 170 sysmmu_ips_name[ips]);
175
176 if (sysmmuconp == NULL) {
177 printk(KERN_ERR "failed to get ip's sysmmu info\n");
178 return 1;
179 } 171 }
172}
180 173
181 reg = __raw_readl(sysmmuconp->regs + S5P_MMU_CFG); 174void s5p_sysmmu_enable(sysmmu_ips ips, unsigned long pgd)
182 175{
183 /* replacement policy : LRU */ 176 if (!is_sysmmu_active(ips)) {
184 reg |= 0x1; 177 sysmmu_clk_enable(ips);
185 __raw_writel(reg, sysmmuconp->regs + S5P_MMU_CFG);
186
187 reg = __raw_readl(sysmmuconp->regs + S5P_MMU_CTRL);
188 178
189 /* Disable MMU */ 179 __sysmmu_set_ptbase(ips, pgd);
190 reg &= ~0x1;
191 __raw_writel(reg, sysmmuconp->regs + S5P_MMU_CTRL);
192 180
193 sysmmuconp->enable = false; 181 __raw_writel(CTRL_ENABLE, sysmmusfrs[ips] + S5P_MMU_CTRL);
194 182
195 return 0; 183 set_sysmmu_active(ips);
184 dev_dbg(dev, "%s is enabled.\n", sysmmu_ips_name[ips]);
185 } else {
186 dev_dbg(dev, "%s is already enabled.\n", sysmmu_ips_name[ips]);
187 }
196} 188}
197 189
198int s5p_sysmmu_tlb_invalidate(sysmmu_ips ips) 190void s5p_sysmmu_disable(sysmmu_ips ips)
199{ 191{
200 unsigned int reg; 192 if (is_sysmmu_active(ips)) {
201 struct sysmmu_controller *sysmmuconp = NULL; 193 __raw_writel(CTRL_DISABLE, sysmmusfrs[ips] + S5P_MMU_CTRL);
202 194 set_sysmmu_inactive(ips);
203 sysmmuconp = &s5p_sysmmu_cntlrs[ips]; 195 sysmmu_clk_disable(ips);
204 196 dev_dbg(dev, "%s is disabled.\n", sysmmu_ips_name[ips]);
205 if (sysmmuconp == NULL) { 197 } else {
206 printk(KERN_ERR "failed to get ip's sysmmu info\n"); 198 dev_dbg(dev, "%s is already disabled.\n", sysmmu_ips_name[ips]);
207 return 1;
208 } 199 }
200}
209 201
210 /* set Block MMU for flush TLB */ 202void s5p_sysmmu_tlb_invalidate(sysmmu_ips ips)
211 reg = __raw_readl(sysmmuconp->regs + S5P_MMU_CTRL); 203{
212 reg |= 0x1 << 1; 204 if (is_sysmmu_active(ips)) {
213 __raw_writel(reg, sysmmuconp->regs + S5P_MMU_CTRL); 205 sysmmu_block(ips);
214 206 __sysmmu_tlb_invalidate(ips);
215 /* flush all TLB entry */ 207 sysmmu_unblock(ips);
216 __raw_writel(0x1, sysmmuconp->regs + S5P_MMU_FLUSH); 208 } else {
217 209 dev_dbg(dev, "%s is disabled. "
218 /* set Un-block MMU after flush TLB */ 210 "Skipping invalidating TLB.\n", sysmmu_ips_name[ips]);
219 reg = __raw_readl(sysmmuconp->regs + S5P_MMU_CTRL); 211 }
220 reg &= ~(0x1 << 1);
221 __raw_writel(reg, sysmmuconp->regs + S5P_MMU_CTRL);
222
223 return 0;
224} 212}
225 213
226static int s5p_sysmmu_probe(struct platform_device *pdev) 214static int s5p_sysmmu_probe(struct platform_device *pdev)
227{ 215{
228 int i; 216 int i, ret;
229 int ret; 217 struct resource *res, *mem;
230 struct resource *res; 218
231 struct sysmmu_controller *sysmmuconp; 219 dev = &pdev->dev;
232 sysmmu_ips ips;
233 220
234 for (i = 0; i < S5P_SYSMMU_TOTAL_IPNUM; i++) { 221 for (i = 0; i < S5P_SYSMMU_TOTAL_IPNUM; i++) {
235 sysmmuconp = &s5p_sysmmu_cntlrs[i]; 222 int irq;
236 if (sysmmuconp == NULL) {
237 printk(KERN_ERR "failed to get ip's sysmmu info\n");
238 ret = -ENOENT;
239 goto err_res;
240 }
241 223
242 sysmmuconp->name = sysmmu_ips_name[i]; 224 sysmmu_clk_init(dev, i);
225 sysmmu_clk_disable(i);
243 226
244 res = platform_get_resource(pdev, IORESOURCE_MEM, i); 227 res = platform_get_resource(pdev, IORESOURCE_MEM, i);
245 if (!res) { 228 if (!res) {
246 printk(KERN_ERR "failed to get sysmmu resource\n"); 229 dev_err(dev, "Failed to get the resource of %s.\n",
230 sysmmu_ips_name[i]);
247 ret = -ENODEV; 231 ret = -ENODEV;
248 goto err_res; 232 goto err_res;
249 } 233 }
250 234
251 sysmmuconp->mem = request_mem_region(res->start, 235 mem = request_mem_region(res->start,
252 ((res->end) - (res->start)) + 1, pdev->name); 236 ((res->end) - (res->start)) + 1, pdev->name);
253 if (!sysmmuconp->mem) { 237 if (!mem) {
254 pr_err("failed to request sysmmu memory region\n"); 238 dev_err(dev, "Failed to request the memory region of %s.\n",
239 sysmmu_ips_name[i]);
255 ret = -EBUSY; 240 ret = -EBUSY;
256 goto err_res; 241 goto err_res;
257 } 242 }
258 243
259 sysmmuconp->regs = ioremap(res->start, res->end - res->start + 1); 244 sysmmusfrs[i] = ioremap(res->start, res->end - res->start + 1);
260 if (!sysmmuconp->regs) { 245 if (!sysmmusfrs[i]) {
261 pr_err("failed to sysmmu ioremap\n"); 246 dev_err(dev, "Failed to ioremap() for %s.\n",
247 sysmmu_ips_name[i]);
262 ret = -ENXIO; 248 ret = -ENXIO;
263 goto err_reg; 249 goto err_reg;
264 } 250 }
265 251
266 sysmmuconp->irq = platform_get_irq(pdev, i); 252 irq = platform_get_irq(pdev, i);
267 if (sysmmuconp->irq <= 0) { 253 if (irq <= 0) {
268 pr_err("failed to get sysmmu irq resource\n"); 254 dev_err(dev, "Failed to get the IRQ resource of %s.\n",
255 sysmmu_ips_name[i]);
269 ret = -ENOENT; 256 ret = -ENOENT;
270 goto err_map; 257 goto err_map;
271 } 258 }
272 259
273 ret = request_irq(sysmmuconp->irq, s5p_sysmmu_irq, IRQF_DISABLED, pdev->name, sysmmuconp); 260 if (request_irq(irq, s5p_sysmmu_irq, IRQF_DISABLED,
274 if (ret) { 261 pdev->name, (void *)i)) {
275 pr_err("failed to request irq\n"); 262 dev_err(dev, "Failed to request IRQ for %s.\n",
263 sysmmu_ips_name[i]);
276 ret = -ENOENT; 264 ret = -ENOENT;
277 goto err_map; 265 goto err_map;
278 } 266 }
279
280 ips = (sysmmu_ips)i;
281
282 sysmmuconp->ips = ips;
283 } 267 }
284 268
285 return 0; 269 return 0;
286 270
287err_reg:
288 release_mem_region((resource_size_t)sysmmuconp->mem, (resource_size_t)((res->end) - (res->start) + 1));
289err_map: 271err_map:
290 iounmap(sysmmuconp->regs); 272 iounmap(sysmmusfrs[i]);
273err_reg:
274 release_mem_region(mem->start, resource_size(mem));
291err_res: 275err_res:
292 return ret; 276 return ret;
293} 277}
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 32be05cf82a3..be72100b81b4 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -273,6 +273,19 @@ config SAMSUNG_DEV_KEYPAD
273 help 273 help
274 Compile in platform device definitions for keypad 274 Compile in platform device definitions for keypad
275 275
276config SAMSUNG_DEV_PWM
277 bool
278 default y if ARCH_S3C2410
279 help
280 Compile in platform device definition for PWM Timer
281
282config S3C24XX_PWM
283 bool "PWM device support"
284 select HAVE_PWM
285 help
286 Support for exporting the PWM timer blocks via the pwm device
287 system
288
276# DMA 289# DMA
277 290
278config S3C_DMA 291config S3C_DMA
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
index 29932f88a8d6..e9de58a2e294 100644
--- a/arch/arm/plat-samsung/Makefile
+++ b/arch/arm/plat-samsung/Makefile
@@ -59,6 +59,7 @@ obj-$(CONFIG_SAMSUNG_DEV_ADC) += dev-adc.o
59obj-$(CONFIG_SAMSUNG_DEV_IDE) += dev-ide.o 59obj-$(CONFIG_SAMSUNG_DEV_IDE) += dev-ide.o
60obj-$(CONFIG_SAMSUNG_DEV_TS) += dev-ts.o 60obj-$(CONFIG_SAMSUNG_DEV_TS) += dev-ts.o
61obj-$(CONFIG_SAMSUNG_DEV_KEYPAD) += dev-keypad.o 61obj-$(CONFIG_SAMSUNG_DEV_KEYPAD) += dev-keypad.o
62obj-$(CONFIG_SAMSUNG_DEV_PWM) += dev-pwm.o
62 63
63# DMA support 64# DMA support
64 65
diff --git a/arch/arm/plat-samsung/dev-pwm.c b/arch/arm/plat-samsung/dev-pwm.c
new file mode 100644
index 000000000000..dab47b0e1900
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-pwm.c
@@ -0,0 +1,53 @@
1/* linux/arch/arm/plat-samsung/dev-pwm.c
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Copyright (c) 2007 Ben Dooks
7 * Copyright (c) 2008 Simtec Electronics
8 * Ben Dooks <ben@simtec.co.uk>, <ben-linux@fluff.org>
9 *
10 * S3C series device definition for the PWM timer
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 */
16
17#include <linux/kernel.h>
18#include <linux/platform_device.h>
19
20#include <mach/irqs.h>
21
22#include <plat/devs.h>
23
24#define TIMER_RESOURCE_SIZE (1)
25
26#define TIMER_RESOURCE(_tmr, _irq) \
27 (struct resource [TIMER_RESOURCE_SIZE]) { \
28 [0] = { \
29 .start = _irq, \
30 .end = _irq, \
31 .flags = IORESOURCE_IRQ \
32 } \
33 }
34
35#define DEFINE_S3C_TIMER(_tmr_no, _irq) \
36 .name = "s3c24xx-pwm", \
37 .id = _tmr_no, \
38 .num_resources = TIMER_RESOURCE_SIZE, \
39 .resource = TIMER_RESOURCE(_tmr_no, _irq), \
40
41/*
42 * since we already have an static mapping for the timer,
43 * we do not bother setting any IO resource for the base.
44 */
45
46struct platform_device s3c_device_timer[] = {
47 [0] = { DEFINE_S3C_TIMER(0, IRQ_TIMER0) },
48 [1] = { DEFINE_S3C_TIMER(1, IRQ_TIMER1) },
49 [2] = { DEFINE_S3C_TIMER(2, IRQ_TIMER2) },
50 [3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3) },
51 [4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4) },
52};
53EXPORT_SYMBOL(s3c_device_timer);
diff --git a/arch/arm/plat-samsung/dev-ts.c b/arch/arm/plat-samsung/dev-ts.c
index 236ef8427d7d..3e4bd8147bf4 100644
--- a/arch/arm/plat-samsung/dev-ts.c
+++ b/arch/arm/plat-samsung/dev-ts.c
@@ -58,4 +58,3 @@ void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *pd)
58 58
59 s3c_device_ts.dev.platform_data = npd; 59 s3c_device_ts.dev.platform_data = npd;
60} 60}
61EXPORT_SYMBOL(s3c24xx_ts_set_platdata);
diff --git a/arch/arm/plat-samsung/dev-uart.c b/arch/arm/plat-samsung/dev-uart.c
index 3776cd952450..5928105490fa 100644
--- a/arch/arm/plat-samsung/dev-uart.c
+++ b/arch/arm/plat-samsung/dev-uart.c
@@ -15,6 +15,8 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17 17
18#include <plat/devs.h>
19
18/* uart devices */ 20/* uart devices */
19 21
20static struct platform_device s3c24xx_uart_device0 = { 22static struct platform_device s3c24xx_uart_device0 = {
diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h
index 9addb3dfb4bc..cedfff51c82b 100644
--- a/arch/arm/plat-samsung/include/plat/cpu.h
+++ b/arch/arm/plat-samsung/include/plat/cpu.h
@@ -82,6 +82,7 @@ extern struct sysdev_class s3c64xx_sysclass;
82extern struct sysdev_class s5p64x0_sysclass; 82extern struct sysdev_class s5p64x0_sysclass;
83extern struct sysdev_class s5p6442_sysclass; 83extern struct sysdev_class s5p6442_sysclass;
84extern struct sysdev_class s5pv210_sysclass; 84extern struct sysdev_class s5pv210_sysclass;
85extern struct sysdev_class exynos4_sysclass;
85 86
86extern void (*s5pc1xx_idle)(void); 87extern void (*s5pc1xx_idle)(void);
87 88
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h
index b4d208b42957..f0da6b70fba4 100644
--- a/arch/arm/plat-samsung/include/plat/devs.h
+++ b/arch/arm/plat-samsung/include/plat/devs.h
@@ -1,5 +1,8 @@
1/* arch/arm/plat-samsung/include/plat/devs.h 1/* arch/arm/plat-samsung/include/plat/devs.h
2 * 2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
3 * Copyright (c) 2004 Simtec Electronics 6 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 7 * Ben Dooks <ben@simtec.co.uk>
5 * 8 *
@@ -96,15 +99,16 @@ extern struct platform_device s5pv210_device_iis1;
96extern struct platform_device s5pv210_device_iis2; 99extern struct platform_device s5pv210_device_iis2;
97extern struct platform_device s5pv210_device_spdif; 100extern struct platform_device s5pv210_device_spdif;
98 101
99extern struct platform_device s5pv310_device_ac97; 102extern struct platform_device exynos4_device_ac97;
100extern struct platform_device s5pv310_device_pcm0; 103extern struct platform_device exynos4_device_pcm0;
101extern struct platform_device s5pv310_device_pcm1; 104extern struct platform_device exynos4_device_pcm1;
102extern struct platform_device s5pv310_device_pcm2; 105extern struct platform_device exynos4_device_pcm2;
103extern struct platform_device s5pv310_device_i2s0; 106extern struct platform_device exynos4_device_i2s0;
104extern struct platform_device s5pv310_device_i2s1; 107extern struct platform_device exynos4_device_i2s1;
105extern struct platform_device s5pv310_device_i2s2; 108extern struct platform_device exynos4_device_i2s2;
106extern struct platform_device s5pv310_device_spdif; 109extern struct platform_device exynos4_device_spdif;
107extern struct platform_device s5pv310_device_pd[]; 110extern struct platform_device exynos4_device_pd[];
111extern struct platform_device exynos4_device_ahci;
108 112
109extern struct platform_device s5p6442_device_pcm0; 113extern struct platform_device s5p6442_device_pcm0;
110extern struct platform_device s5p6442_device_pcm1; 114extern struct platform_device s5p6442_device_pcm1;
@@ -133,11 +137,12 @@ extern struct platform_device samsung_device_keypad;
133extern struct platform_device s5p_device_fimc0; 137extern struct platform_device s5p_device_fimc0;
134extern struct platform_device s5p_device_fimc1; 138extern struct platform_device s5p_device_fimc1;
135extern struct platform_device s5p_device_fimc2; 139extern struct platform_device s5p_device_fimc2;
140extern struct platform_device s5p_device_fimc3;
136 141
137extern struct platform_device s5p_device_mipi_csis0; 142extern struct platform_device s5p_device_mipi_csis0;
138extern struct platform_device s5p_device_mipi_csis1; 143extern struct platform_device s5p_device_mipi_csis1;
139 144
140extern struct platform_device s5pv310_device_sysmmu; 145extern struct platform_device exynos4_device_sysmmu;
141 146
142/* s3c2440 specific devices */ 147/* s3c2440 specific devices */
143 148
diff --git a/arch/arm/plat-samsung/include/plat/fimc-core.h b/arch/arm/plat-samsung/include/plat/fimc-core.h
index 81a3bfeeccad..945a99d59563 100644
--- a/arch/arm/plat-samsung/include/plat/fimc-core.h
+++ b/arch/arm/plat-samsung/include/plat/fimc-core.h
@@ -38,6 +38,11 @@ static inline void s3c_fimc_setname(int id, char *name)
38 s5p_device_fimc2.name = name; 38 s5p_device_fimc2.name = name;
39 break; 39 break;
40#endif 40#endif
41#ifdef CONFIG_S5P_DEV_FIMC3
42 case 3:
43 s5p_device_fimc3.name = name;
44 break;
45#endif
41 } 46 }
42} 47}
43 48
diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg.h b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
index e4b5cf126fa9..5e04fa6eda74 100644
--- a/arch/arm/plat-samsung/include/plat/gpio-cfg.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
@@ -225,4 +225,20 @@ extern int s5p_gpio_set_drvstr(unsigned int pin, s5p_gpio_drvstr_t drvstr);
225 */ 225 */
226extern int s5p_register_gpio_interrupt(int pin); 226extern int s5p_register_gpio_interrupt(int pin);
227 227
228/** s5p_register_gpioint_bank() - add gpio bank for further gpio interrupt
229 * registration (see s5p_register_gpio_interrupt function)
230 * @chain_irq: chained irq number for the gpio int handler for this bank
231 * @start: start gpio group number of this bank
232 * @nr_groups: number of gpio groups handled by this bank
233 *
234 * This functions registers initial information about gpio banks that
235 * can be later used by the s5p_register_gpio_interrupt() function to
236 * enable support for gpio interrupt for particular gpio group.
237 */
238#ifdef CONFIG_S5P_GPIO_INT
239extern int s5p_register_gpioint_bank(int chain_irq, int start, int nr_groups);
240#else
241#define s5p_register_gpioint_bank(chain_irq, start, nr_groups) do { } while (0)
242#endif
243
228#endif /* __PLAT_GPIO_CFG_H */ 244#endif /* __PLAT_GPIO_CFG_H */
diff --git a/arch/arm/plat-samsung/include/plat/pd.h b/arch/arm/plat-samsung/include/plat/pd.h
index 5f0ad85783db..abb4bc32716a 100644
--- a/arch/arm/plat-samsung/include/plat/pd.h
+++ b/arch/arm/plat-samsung/include/plat/pd.h
@@ -1,6 +1,6 @@
1/* linux/arch/arm/plat-samsung/include/plat/pd.h 1/* linux/arch/arm/plat-samsung/include/plat/pd.h
2 * 2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com 4 * http://www.samsung.com
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ struct samsung_pd_info {
17 void __iomem *base; 17 void __iomem *base;
18}; 18};
19 19
20enum s5pv310_pd_block { 20enum exynos4_pd_block {
21 PD_MFC, 21 PD_MFC,
22 PD_G3D, 22 PD_G3D,
23 PD_LCD0, 23 PD_LCD0,
diff --git a/arch/arm/plat-samsung/include/plat/pm.h b/arch/arm/plat-samsung/include/plat/pm.h
index d9025e377675..937cc2ace517 100644
--- a/arch/arm/plat-samsung/include/plat/pm.h
+++ b/arch/arm/plat-samsung/include/plat/pm.h
@@ -17,6 +17,8 @@
17 17
18#include <linux/irq.h> 18#include <linux/irq.h>
19 19
20struct sys_device;
21
20#ifdef CONFIG_PM 22#ifdef CONFIG_PM
21 23
22extern __init int s3c_pm_init(void); 24extern __init int s3c_pm_init(void);
@@ -50,13 +52,11 @@ extern unsigned char pm_uart_udivslot; /* true to save UART UDIVSLOT */
50 52
51/* from sleep.S */ 53/* from sleep.S */
52 54
53extern int s3c_cpu_save(unsigned long *saveblk); 55extern int s3c_cpu_save(unsigned long *saveblk, long);
54extern void s3c_cpu_resume(void); 56extern void s3c_cpu_resume(void);
55 57
56extern void s3c2410_cpu_suspend(void); 58extern void s3c2410_cpu_suspend(void);
57 59
58extern unsigned long s3c_sleep_save_phys;
59
60/* sleep save info */ 60/* sleep save info */
61 61
62/** 62/**
@@ -179,13 +179,5 @@ extern void s3c_pm_restore_gpios(void);
179 */ 179 */
180extern void s3c_pm_save_gpios(void); 180extern void s3c_pm_save_gpios(void);
181 181
182/**
183 * s3c_pm_cb_flushcache - callback for assembly code
184 *
185 * Callback to issue flush_cache_all() as this call is
186 * not a directly callable object.
187 */
188extern void s3c_pm_cb_flushcache(void);
189
190extern void s3c_pm_save_core(void); 182extern void s3c_pm_save_core(void);
191extern void s3c_pm_restore_core(void); 183extern void s3c_pm_restore_core(void);
diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h
index 5a41a0b69eec..b0bdf16549d5 100644
--- a/arch/arm/plat-samsung/include/plat/sdhci.h
+++ b/arch/arm/plat-samsung/include/plat/sdhci.h
@@ -1,4 +1,7 @@
1/* linux/arch/arm/plat-s3c/include/plat/sdhci.h 1/* linux/arch/arm/plat-samsung/include/plat/sdhci.h
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
2 * 5 *
3 * Copyright 2008 Openmoko, Inc. 6 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 7 * Copyright 2008 Simtec Electronics
@@ -119,10 +122,10 @@ extern void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
119extern void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *, int w); 122extern void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
120extern void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *, int w); 123extern void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
121extern void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *, int w); 124extern void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *, int w);
122extern void s5pv310_setup_sdhci0_cfg_gpio(struct platform_device *, int w); 125extern void exynos4_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
123extern void s5pv310_setup_sdhci1_cfg_gpio(struct platform_device *, int w); 126extern void exynos4_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
124extern void s5pv310_setup_sdhci2_cfg_gpio(struct platform_device *, int w); 127extern void exynos4_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
125extern void s5pv310_setup_sdhci3_cfg_gpio(struct platform_device *, int w); 128extern void exynos4_setup_sdhci3_cfg_gpio(struct platform_device *, int w);
126 129
127/* S3C2416 SDHCI setup */ 130/* S3C2416 SDHCI setup */
128 131
@@ -334,57 +337,57 @@ static inline void s5pv210_default_sdhci3(void) { }
334 337
335#endif /* CONFIG_S5PV210_SETUP_SDHCI */ 338#endif /* CONFIG_S5PV210_SETUP_SDHCI */
336 339
337/* S5PV310 SDHCI setup */ 340/* EXYNOS4 SDHCI setup */
338#ifdef CONFIG_S5PV310_SETUP_SDHCI 341#ifdef CONFIG_EXYNOS4_SETUP_SDHCI
339extern char *s5pv310_hsmmc_clksrcs[4]; 342extern char *exynos4_hsmmc_clksrcs[4];
340 343
341extern void s5pv310_setup_sdhci_cfg_card(struct platform_device *dev, 344extern void exynos4_setup_sdhci_cfg_card(struct platform_device *dev,
342 void __iomem *r, 345 void __iomem *r,
343 struct mmc_ios *ios, 346 struct mmc_ios *ios,
344 struct mmc_card *card); 347 struct mmc_card *card);
345 348
346static inline void s5pv310_default_sdhci0(void) 349static inline void exynos4_default_sdhci0(void)
347{ 350{
348#ifdef CONFIG_S3C_DEV_HSMMC 351#ifdef CONFIG_S3C_DEV_HSMMC
349 s3c_hsmmc0_def_platdata.clocks = s5pv310_hsmmc_clksrcs; 352 s3c_hsmmc0_def_platdata.clocks = exynos4_hsmmc_clksrcs;
350 s3c_hsmmc0_def_platdata.cfg_gpio = s5pv310_setup_sdhci0_cfg_gpio; 353 s3c_hsmmc0_def_platdata.cfg_gpio = exynos4_setup_sdhci0_cfg_gpio;
351 s3c_hsmmc0_def_platdata.cfg_card = s5pv310_setup_sdhci_cfg_card; 354 s3c_hsmmc0_def_platdata.cfg_card = exynos4_setup_sdhci_cfg_card;
352#endif 355#endif
353} 356}
354 357
355static inline void s5pv310_default_sdhci1(void) 358static inline void exynos4_default_sdhci1(void)
356{ 359{
357#ifdef CONFIG_S3C_DEV_HSMMC1 360#ifdef CONFIG_S3C_DEV_HSMMC1
358 s3c_hsmmc1_def_platdata.clocks = s5pv310_hsmmc_clksrcs; 361 s3c_hsmmc1_def_platdata.clocks = exynos4_hsmmc_clksrcs;
359 s3c_hsmmc1_def_platdata.cfg_gpio = s5pv310_setup_sdhci1_cfg_gpio; 362 s3c_hsmmc1_def_platdata.cfg_gpio = exynos4_setup_sdhci1_cfg_gpio;
360 s3c_hsmmc1_def_platdata.cfg_card = s5pv310_setup_sdhci_cfg_card; 363 s3c_hsmmc1_def_platdata.cfg_card = exynos4_setup_sdhci_cfg_card;
361#endif 364#endif
362} 365}
363 366
364static inline void s5pv310_default_sdhci2(void) 367static inline void exynos4_default_sdhci2(void)
365{ 368{
366#ifdef CONFIG_S3C_DEV_HSMMC2 369#ifdef CONFIG_S3C_DEV_HSMMC2
367 s3c_hsmmc2_def_platdata.clocks = s5pv310_hsmmc_clksrcs; 370 s3c_hsmmc2_def_platdata.clocks = exynos4_hsmmc_clksrcs;
368 s3c_hsmmc2_def_platdata.cfg_gpio = s5pv310_setup_sdhci2_cfg_gpio; 371 s3c_hsmmc2_def_platdata.cfg_gpio = exynos4_setup_sdhci2_cfg_gpio;
369 s3c_hsmmc2_def_platdata.cfg_card = s5pv310_setup_sdhci_cfg_card; 372 s3c_hsmmc2_def_platdata.cfg_card = exynos4_setup_sdhci_cfg_card;
370#endif 373#endif
371} 374}
372 375
373static inline void s5pv310_default_sdhci3(void) 376static inline void exynos4_default_sdhci3(void)
374{ 377{
375#ifdef CONFIG_S3C_DEV_HSMMC3 378#ifdef CONFIG_S3C_DEV_HSMMC3
376 s3c_hsmmc3_def_platdata.clocks = s5pv310_hsmmc_clksrcs; 379 s3c_hsmmc3_def_platdata.clocks = exynos4_hsmmc_clksrcs;
377 s3c_hsmmc3_def_platdata.cfg_gpio = s5pv310_setup_sdhci3_cfg_gpio; 380 s3c_hsmmc3_def_platdata.cfg_gpio = exynos4_setup_sdhci3_cfg_gpio;
378 s3c_hsmmc3_def_platdata.cfg_card = s5pv310_setup_sdhci_cfg_card; 381 s3c_hsmmc3_def_platdata.cfg_card = exynos4_setup_sdhci_cfg_card;
379#endif 382#endif
380} 383}
381 384
382#else 385#else
383static inline void s5pv310_default_sdhci0(void) { } 386static inline void exynos4_default_sdhci0(void) { }
384static inline void s5pv310_default_sdhci1(void) { } 387static inline void exynos4_default_sdhci1(void) { }
385static inline void s5pv310_default_sdhci2(void) { } 388static inline void exynos4_default_sdhci2(void) { }
386static inline void s5pv310_default_sdhci3(void) { } 389static inline void exynos4_default_sdhci3(void) { }
387 390
388#endif /* CONFIG_S5PV310_SETUP_SDHCI */ 391#endif /* CONFIG_EXYNOS4_SETUP_SDHCI */
389 392
390#endif /* __PLAT_S3C_SDHCI_H */ 393#endif /* __PLAT_S3C_SDHCI_H */
diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c
index 02d531fb3f81..d5b58d31903c 100644
--- a/arch/arm/plat-samsung/pm.c
+++ b/arch/arm/plat-samsung/pm.c
@@ -241,8 +241,6 @@ void (*pm_cpu_sleep)(void);
241 241
242static int s3c_pm_enter(suspend_state_t state) 242static int s3c_pm_enter(suspend_state_t state)
243{ 243{
244 static unsigned long regs_save[16];
245
246 /* ensure the debug is initialised (if enabled) */ 244 /* ensure the debug is initialised (if enabled) */
247 245
248 s3c_pm_debug_init(); 246 s3c_pm_debug_init();
@@ -266,12 +264,6 @@ static int s3c_pm_enter(suspend_state_t state)
266 return -EINVAL; 264 return -EINVAL;
267 } 265 }
268 266
269 /* store the physical address of the register recovery block */
270
271 s3c_sleep_save_phys = virt_to_phys(regs_save);
272
273 S3C_PMDBG("s3c_sleep_save_phys=0x%08lx\n", s3c_sleep_save_phys);
274
275 /* save all necessary core registers not covered by the drivers */ 267 /* save all necessary core registers not covered by the drivers */
276 268
277 s3c_pm_save_gpios(); 269 s3c_pm_save_gpios();
@@ -305,7 +297,7 @@ static int s3c_pm_enter(suspend_state_t state)
305 * we resume as it saves its own register state and restores it 297 * we resume as it saves its own register state and restores it
306 * during the resume. */ 298 * during the resume. */
307 299
308 s3c_cpu_save(regs_save); 300 s3c_cpu_save(0, PLAT_PHYS_OFFSET - PAGE_OFFSET);
309 301
310 /* restore the cpu state using the kernel's cpu init code. */ 302 /* restore the cpu state using the kernel's cpu init code. */
311 303
@@ -336,12 +328,6 @@ static int s3c_pm_enter(suspend_state_t state)
336 return 0; 328 return 0;
337} 329}
338 330
339/* callback from assembly code */
340void s3c_pm_cb_flushcache(void)
341{
342 flush_cache_all();
343}
344
345static int s3c_pm_prepare(void) 331static int s3c_pm_prepare(void)
346{ 332{
347 /* prepare check area if configured */ 333 /* prepare check area if configured */
diff --git a/arch/arm/plat-samsung/pwm.c b/arch/arm/plat-samsung/pwm.c
index 2eeb49fa056d..f37457c52064 100644
--- a/arch/arm/plat-samsung/pwm.c
+++ b/arch/arm/plat-samsung/pwm.c
@@ -20,10 +20,8 @@
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/pwm.h> 21#include <linux/pwm.h>
22 22
23#include <mach/irqs.h>
24#include <mach/map.h> 23#include <mach/map.h>
25 24
26#include <plat/devs.h>
27#include <plat/regs-timer.h> 25#include <plat/regs-timer.h>
28 26
29struct pwm_device { 27struct pwm_device {
@@ -47,37 +45,6 @@ struct pwm_device {
47 45
48static struct clk *clk_scaler[2]; 46static struct clk *clk_scaler[2];
49 47
50/* Standard setup for a timer block. */
51
52#define TIMER_RESOURCE_SIZE (1)
53
54#define TIMER_RESOURCE(_tmr, _irq) \
55 (struct resource [TIMER_RESOURCE_SIZE]) { \
56 [0] = { \
57 .start = _irq, \
58 .end = _irq, \
59 .flags = IORESOURCE_IRQ \
60 } \
61 }
62
63#define DEFINE_S3C_TIMER(_tmr_no, _irq) \
64 .name = "s3c24xx-pwm", \
65 .id = _tmr_no, \
66 .num_resources = TIMER_RESOURCE_SIZE, \
67 .resource = TIMER_RESOURCE(_tmr_no, _irq), \
68
69/* since we already have an static mapping for the timer, we do not
70 * bother setting any IO resource for the base.
71 */
72
73struct platform_device s3c_device_timer[] = {
74 [0] = { DEFINE_S3C_TIMER(0, IRQ_TIMER0) },
75 [1] = { DEFINE_S3C_TIMER(1, IRQ_TIMER1) },
76 [2] = { DEFINE_S3C_TIMER(2, IRQ_TIMER2) },
77 [3] = { DEFINE_S3C_TIMER(3, IRQ_TIMER3) },
78 [4] = { DEFINE_S3C_TIMER(4, IRQ_TIMER4) },
79};
80
81static inline int pwm_is_tdiv(struct pwm_device *pwm) 48static inline int pwm_is_tdiv(struct pwm_device *pwm)
82{ 49{
83 return clk_get_parent(pwm->clk) == pwm->clk_div; 50 return clk_get_parent(pwm->clk) == pwm->clk_div;
diff --git a/arch/arm/plat-spear/Makefile b/arch/arm/plat-spear/Makefile
index eb89540aeda9..b4f340b8f1f1 100644
--- a/arch/arm/plat-spear/Makefile
+++ b/arch/arm/plat-spear/Makefile
@@ -3,6 +3,6 @@
3# 3#
4 4
5# Common support 5# Common support
6obj-y := clock.o padmux.o time.o 6obj-y := clock.o time.o
7 7
8obj-$(CONFIG_ARCH_SPEAR3XX) += shirq.o 8obj-$(CONFIG_ARCH_SPEAR3XX) += shirq.o padmux.o
diff --git a/arch/arm/plat-spear/clock.c b/arch/arm/plat-spear/clock.c
index ee4f90e534d8..bdbd7ec9cb6b 100644
--- a/arch/arm/plat-spear/clock.c
+++ b/arch/arm/plat-spear/clock.c
@@ -12,18 +12,25 @@
12 */ 12 */
13 13
14#include <linux/bug.h> 14#include <linux/bug.h>
15#include <linux/clk.h>
16#include <linux/debugfs.h>
15#include <linux/err.h> 17#include <linux/err.h>
16#include <linux/io.h> 18#include <linux/io.h>
17#include <linux/list.h> 19#include <linux/list.h>
18#include <linux/module.h> 20#include <linux/module.h>
19#include <linux/spinlock.h> 21#include <linux/spinlock.h>
20#include <mach/misc_regs.h>
21#include <plat/clock.h> 22#include <plat/clock.h>
22 23
23static DEFINE_SPINLOCK(clocks_lock); 24static DEFINE_SPINLOCK(clocks_lock);
24static LIST_HEAD(root_clks); 25static LIST_HEAD(root_clks);
26#ifdef CONFIG_DEBUG_FS
27static LIST_HEAD(clocks);
28#endif
25 29
26static void propagate_rate(struct list_head *); 30static void propagate_rate(struct clk *, int on_init);
31#ifdef CONFIG_DEBUG_FS
32static int clk_debugfs_reparent(struct clk *);
33#endif
27 34
28static int generic_clk_enable(struct clk *clk) 35static int generic_clk_enable(struct clk *clk)
29{ 36{
@@ -65,6 +72,104 @@ static struct clkops generic_clkops = {
65 .disable = generic_clk_disable, 72 .disable = generic_clk_disable,
66}; 73};
67 74
75/* returns current programmed clocks clock info structure */
76static struct pclk_info *pclk_info_get(struct clk *clk)
77{
78 unsigned int val, i;
79 struct pclk_info *info = NULL;
80
81 val = (readl(clk->pclk_sel->pclk_sel_reg) >> clk->pclk_sel_shift)
82 & clk->pclk_sel->pclk_sel_mask;
83
84 for (i = 0; i < clk->pclk_sel->pclk_count; i++) {
85 if (clk->pclk_sel->pclk_info[i].pclk_val == val)
86 info = &clk->pclk_sel->pclk_info[i];
87 }
88
89 return info;
90}
91
92/*
93 * Set Update pclk, and pclk_info of clk and add clock sibling node to current
94 * parents children list
95 */
96static void clk_reparent(struct clk *clk, struct pclk_info *pclk_info)
97{
98 unsigned long flags;
99
100 spin_lock_irqsave(&clocks_lock, flags);
101 list_del(&clk->sibling);
102 list_add(&clk->sibling, &pclk_info->pclk->children);
103
104 clk->pclk = pclk_info->pclk;
105 spin_unlock_irqrestore(&clocks_lock, flags);
106
107#ifdef CONFIG_DEBUG_FS
108 clk_debugfs_reparent(clk);
109#endif
110}
111
112static void do_clk_disable(struct clk *clk)
113{
114 if (!clk)
115 return;
116
117 if (!clk->usage_count) {
118 WARN_ON(1);
119 return;
120 }
121
122 clk->usage_count--;
123
124 if (clk->usage_count == 0) {
125 /*
126 * Surely, there are no active childrens or direct users
127 * of this clock
128 */
129 if (clk->pclk)
130 do_clk_disable(clk->pclk);
131
132 if (clk->ops && clk->ops->disable)
133 clk->ops->disable(clk);
134 }
135}
136
137static int do_clk_enable(struct clk *clk)
138{
139 int ret = 0;
140
141 if (!clk)
142 return -EFAULT;
143
144 if (clk->usage_count == 0) {
145 if (clk->pclk) {
146 ret = do_clk_enable(clk->pclk);
147 if (ret)
148 goto err;
149 }
150 if (clk->ops && clk->ops->enable) {
151 ret = clk->ops->enable(clk);
152 if (ret) {
153 if (clk->pclk)
154 do_clk_disable(clk->pclk);
155 goto err;
156 }
157 }
158 /*
159 * Since the clock is going to be used for the first
160 * time please reclac
161 */
162 if (clk->recalc) {
163 ret = clk->recalc(clk);
164 if (ret)
165 goto err;
166 }
167 }
168 clk->usage_count++;
169err:
170 return ret;
171}
172
68/* 173/*
69 * clk_enable - inform the system when the clock source should be running. 174 * clk_enable - inform the system when the clock source should be running.
70 * @clk: clock source 175 * @clk: clock source
@@ -78,17 +183,9 @@ int clk_enable(struct clk *clk)
78 unsigned long flags; 183 unsigned long flags;
79 int ret = 0; 184 int ret = 0;
80 185
81 if (!clk || IS_ERR(clk))
82 return -EFAULT;
83
84 spin_lock_irqsave(&clocks_lock, flags); 186 spin_lock_irqsave(&clocks_lock, flags);
85 if (clk->usage_count == 0) { 187 ret = do_clk_enable(clk);
86 if (clk->ops && clk->ops->enable)
87 ret = clk->ops->enable(clk);
88 }
89 clk->usage_count++;
90 spin_unlock_irqrestore(&clocks_lock, flags); 188 spin_unlock_irqrestore(&clocks_lock, flags);
91
92 return ret; 189 return ret;
93} 190}
94EXPORT_SYMBOL(clk_enable); 191EXPORT_SYMBOL(clk_enable);
@@ -109,17 +206,8 @@ void clk_disable(struct clk *clk)
109{ 206{
110 unsigned long flags; 207 unsigned long flags;
111 208
112 if (!clk || IS_ERR(clk))
113 return;
114
115 WARN_ON(clk->usage_count == 0);
116
117 spin_lock_irqsave(&clocks_lock, flags); 209 spin_lock_irqsave(&clocks_lock, flags);
118 clk->usage_count--; 210 do_clk_disable(clk);
119 if (clk->usage_count == 0) {
120 if (clk->ops && clk->ops->disable)
121 clk->ops->disable(clk);
122 }
123 spin_unlock_irqrestore(&clocks_lock, flags); 211 spin_unlock_irqrestore(&clocks_lock, flags);
124} 212}
125EXPORT_SYMBOL(clk_disable); 213EXPORT_SYMBOL(clk_disable);
@@ -153,15 +241,14 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
153 int i, found = 0, val = 0; 241 int i, found = 0, val = 0;
154 unsigned long flags; 242 unsigned long flags;
155 243
156 if (!clk || IS_ERR(clk) || !parent || IS_ERR(parent)) 244 if (!clk || !parent)
157 return -EFAULT; 245 return -EFAULT;
158 if (clk->usage_count)
159 return -EBUSY;
160 if (!clk->pclk_sel)
161 return -EPERM;
162 if (clk->pclk == parent) 246 if (clk->pclk == parent)
163 return 0; 247 return 0;
248 if (!clk->pclk_sel)
249 return -EPERM;
164 250
251 /* check if requested parent is in clk parent list */
165 for (i = 0; i < clk->pclk_sel->pclk_count; i++) { 252 for (i = 0; i < clk->pclk_sel->pclk_count; i++) {
166 if (clk->pclk_sel->pclk_info[i].pclk == parent) { 253 if (clk->pclk_sel->pclk_info[i].pclk == parent) {
167 found = 1; 254 found = 1;
@@ -176,25 +263,58 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
176 /* reflect parent change in hardware */ 263 /* reflect parent change in hardware */
177 val = readl(clk->pclk_sel->pclk_sel_reg); 264 val = readl(clk->pclk_sel->pclk_sel_reg);
178 val &= ~(clk->pclk_sel->pclk_sel_mask << clk->pclk_sel_shift); 265 val &= ~(clk->pclk_sel->pclk_sel_mask << clk->pclk_sel_shift);
179 val |= clk->pclk_sel->pclk_info[i].pclk_mask << clk->pclk_sel_shift; 266 val |= clk->pclk_sel->pclk_info[i].pclk_val << clk->pclk_sel_shift;
180 writel(val, clk->pclk_sel->pclk_sel_reg); 267 writel(val, clk->pclk_sel->pclk_sel_reg);
181 spin_unlock_irqrestore(&clocks_lock, flags); 268 spin_unlock_irqrestore(&clocks_lock, flags);
182 269
183 /* reflect parent change in software */ 270 /* reflect parent change in software */
184 clk->recalc(clk); 271 clk_reparent(clk, &clk->pclk_sel->pclk_info[i]);
185 propagate_rate(&clk->children); 272
273 propagate_rate(clk, 0);
186 return 0; 274 return 0;
187} 275}
188EXPORT_SYMBOL(clk_set_parent); 276EXPORT_SYMBOL(clk_set_parent);
189 277
278/**
279 * clk_set_rate - set the clock rate for a clock source
280 * @clk: clock source
281 * @rate: desired clock rate in Hz
282 *
283 * Returns success (0) or negative errno.
284 */
285int clk_set_rate(struct clk *clk, unsigned long rate)
286{
287 unsigned long flags;
288 int ret = -EINVAL;
289
290 if (!clk || !rate)
291 return -EFAULT;
292
293 if (clk->set_rate) {
294 spin_lock_irqsave(&clocks_lock, flags);
295 ret = clk->set_rate(clk, rate);
296 if (!ret)
297 /* if successful -> propagate */
298 propagate_rate(clk, 0);
299 spin_unlock_irqrestore(&clocks_lock, flags);
300 } else if (clk->pclk) {
301 u32 mult = clk->div_factor ? clk->div_factor : 1;
302 ret = clk_set_rate(clk->pclk, mult * rate);
303 }
304
305 return ret;
306}
307EXPORT_SYMBOL(clk_set_rate);
308
190/* registers clock in platform clock framework */ 309/* registers clock in platform clock framework */
191void clk_register(struct clk_lookup *cl) 310void clk_register(struct clk_lookup *cl)
192{ 311{
193 struct clk *clk = cl->clk; 312 struct clk *clk;
194 unsigned long flags; 313 unsigned long flags;
195 314
196 if (!clk || IS_ERR(clk)) 315 if (!cl || !cl->clk)
197 return; 316 return;
317 clk = cl->clk;
198 318
199 spin_lock_irqsave(&clocks_lock, flags); 319 spin_lock_irqsave(&clocks_lock, flags);
200 320
@@ -207,71 +327,173 @@ void clk_register(struct clk_lookup *cl)
207 /* root clock don't have any parents */ 327 /* root clock don't have any parents */
208 if (!clk->pclk && !clk->pclk_sel) { 328 if (!clk->pclk && !clk->pclk_sel) {
209 list_add(&clk->sibling, &root_clks); 329 list_add(&clk->sibling, &root_clks);
210 /* add clocks with only one parent to parent's children list */
211 } else if (clk->pclk && !clk->pclk_sel) { 330 } else if (clk->pclk && !clk->pclk_sel) {
331 /* add clocks with only one parent to parent's children list */
212 list_add(&clk->sibling, &clk->pclk->children); 332 list_add(&clk->sibling, &clk->pclk->children);
213 } else { 333 } else {
214 /* add clocks with > 1 parent to 1st parent's children list */ 334 /* clocks with more than one parent */
215 list_add(&clk->sibling, 335 struct pclk_info *pclk_info;
216 &clk->pclk_sel->pclk_info[0].pclk->children); 336
337 pclk_info = pclk_info_get(clk);
338 if (!pclk_info) {
339 pr_err("CLKDEV: invalid pclk info of clk with"
340 " %s dev_id and %s con_id\n",
341 cl->dev_id, cl->con_id);
342 } else {
343 clk->pclk = pclk_info->pclk;
344 list_add(&clk->sibling, &pclk_info->pclk->children);
345 }
217 } 346 }
347
218 spin_unlock_irqrestore(&clocks_lock, flags); 348 spin_unlock_irqrestore(&clocks_lock, flags);
219 349
350 /* debugfs specific */
351#ifdef CONFIG_DEBUG_FS
352 list_add(&clk->node, &clocks);
353 clk->cl = cl;
354#endif
355
220 /* add clock to arm clockdev framework */ 356 /* add clock to arm clockdev framework */
221 clkdev_add(cl); 357 clkdev_add(cl);
222} 358}
223 359
224/** 360/**
225 * propagate_rate - recalculate and propagate all clocks in list head 361 * propagate_rate - recalculate and propagate all clocks to children
362 * @pclk: parent clock required to be propogated
363 * @on_init: flag for enabling clocks which are ENABLED_ON_INIT.
226 * 364 *
227 * Recalculates all root clocks in list head, which if the clock's .recalc is 365 * Recalculates all children clocks
228 * set correctly, should also propagate their rates.
229 */ 366 */
230static void propagate_rate(struct list_head *lhead) 367void propagate_rate(struct clk *pclk, int on_init)
231{ 368{
232 struct clk *clkp, *_temp; 369 struct clk *clk, *_temp;
370 int ret = 0;
233 371
234 list_for_each_entry_safe(clkp, _temp, lhead, sibling) { 372 list_for_each_entry_safe(clk, _temp, &pclk->children, sibling) {
235 if (clkp->recalc) 373 if (clk->recalc) {
236 clkp->recalc(clkp); 374 ret = clk->recalc(clk);
237 propagate_rate(&clkp->children); 375 /*
376 * recalc will return error if clk out is not programmed
377 * In this case configure default rate.
378 */
379 if (ret && clk->set_rate)
380 clk->set_rate(clk, 0);
381 }
382 propagate_rate(clk, on_init);
383
384 if (!on_init)
385 continue;
386
387 /* Enable clks enabled on init, in software view */
388 if (clk->flags & ENABLED_ON_INIT)
389 do_clk_enable(clk);
238 } 390 }
239} 391}
240 392
241/* returns current programmed clocks clock info structure */ 393/**
242static struct pclk_info *pclk_info_get(struct clk *clk) 394 * round_rate_index - return closest programmable rate index in rate_config tbl
395 * @clk: ptr to clock structure
396 * @drate: desired rate
397 * @rate: final rate will be returned in this variable only.
398 *
399 * Finds index in rate_config for highest clk rate which is less than
400 * requested rate. If there is no clk rate lesser than requested rate then
401 * -EINVAL is returned. This routine assumes that rate_config is written
402 * in incrementing order of clk rates.
403 * If drate passed is zero then default rate is programmed.
404 */
405static int
406round_rate_index(struct clk *clk, unsigned long drate, unsigned long *rate)
243{ 407{
244 unsigned int mask, i; 408 unsigned long tmp = 0, prev_rate = 0;
245 unsigned long flags; 409 int index;
246 struct pclk_info *info = NULL;
247 410
248 spin_lock_irqsave(&clocks_lock, flags); 411 if (!clk->calc_rate)
249 mask = (readl(clk->pclk_sel->pclk_sel_reg) >> clk->pclk_sel_shift) 412 return -EFAULT;
250 & clk->pclk_sel->pclk_sel_mask;
251 413
252 for (i = 0; i < clk->pclk_sel->pclk_count; i++) { 414 if (!drate)
253 if (clk->pclk_sel->pclk_info[i].pclk_mask == mask) 415 return -EINVAL;
254 info = &clk->pclk_sel->pclk_info[i]; 416
417 /*
418 * This loops ends on two conditions:
419 * - as soon as clk is found with rate greater than requested rate.
420 * - if all clks in rate_config are smaller than requested rate.
421 */
422 for (index = 0; index < clk->rate_config.count; index++) {
423 prev_rate = tmp;
424 tmp = clk->calc_rate(clk, index);
425 if (drate < tmp) {
426 index--;
427 break;
428 }
255 } 429 }
256 spin_unlock_irqrestore(&clocks_lock, flags); 430 /* return if can't find suitable clock */
431 if (index < 0) {
432 index = -EINVAL;
433 *rate = 0;
434 } else if (index == clk->rate_config.count) {
435 /* program with highest clk rate possible */
436 index = clk->rate_config.count - 1;
437 *rate = tmp;
438 } else
439 *rate = prev_rate;
257 440
258 return info; 441 return index;
259} 442}
260 443
261/* 444/**
262 * Set pclk as cclk's parent and add clock sibling node to current parents 445 * clk_round_rate - adjust a rate to the exact rate a clock can provide
263 * children list 446 * @clk: clock source
447 * @rate: desired clock rate in Hz
448 *
449 * Returns rounded clock rate in Hz, or negative errno.
264 */ 450 */
265static void change_parent(struct clk *cclk, struct clk *pclk) 451long clk_round_rate(struct clk *clk, unsigned long drate)
266{ 452{
267 unsigned long flags; 453 long rate = 0;
454 int index;
455
456 /*
457 * propagate call to parent who supports calc_rate. Similar approach is
458 * used in clk_set_rate.
459 */
460 if (!clk->calc_rate) {
461 u32 mult;
462 if (!clk->pclk)
463 return clk->rate;
464
465 mult = clk->div_factor ? clk->div_factor : 1;
466 return clk_round_rate(clk->pclk, mult * drate) / mult;
467 }
268 468
269 spin_lock_irqsave(&clocks_lock, flags); 469 index = round_rate_index(clk, drate, &rate);
270 list_del(&cclk->sibling); 470 if (index >= 0)
271 list_add(&cclk->sibling, &pclk->children); 471 return rate;
472 else
473 return index;
474}
475EXPORT_SYMBOL(clk_round_rate);
272 476
273 cclk->pclk = pclk; 477/*All below functions are called with lock held */
274 spin_unlock_irqrestore(&clocks_lock, flags); 478
479/*
480 * Calculates pll clk rate for specific value of mode, m, n and p
481 *
482 * In normal mode
483 * rate = (2 * M[15:8] * Fin)/(N * 2^P)
484 *
485 * In Dithered mode
486 * rate = (2 * M[15:0] * Fin)/(256 * N * 2^P)
487 */
488unsigned long pll_calc_rate(struct clk *clk, int index)
489{
490 unsigned long rate = clk->pclk->rate;
491 struct pll_rate_tbl *tbls = clk->rate_config.tbls;
492 unsigned int mode;
493
494 mode = tbls[index].mode ? 256 : 1;
495 return (((2 * rate / 10000) * tbls[index].m) /
496 (mode * tbls[index].n * (1 << tbls[index].p))) * 10000;
275} 497}
276 498
277/* 499/*
@@ -283,47 +505,146 @@ static void change_parent(struct clk *cclk, struct clk *pclk)
283 * In Dithered mode 505 * In Dithered mode
284 * rate = (2 * M[15:0] * Fin)/(256 * N * 2^P) 506 * rate = (2 * M[15:0] * Fin)/(256 * N * 2^P)
285 */ 507 */
286void pll1_clk_recalc(struct clk *clk) 508int pll_clk_recalc(struct clk *clk)
287{ 509{
288 struct pll_clk_config *config = clk->private_data; 510 struct pll_clk_config *config = clk->private_data;
289 unsigned int num = 2, den = 0, val, mode = 0; 511 unsigned int num = 2, den = 0, val, mode = 0;
290 unsigned long flags;
291 512
292 spin_lock_irqsave(&clocks_lock, flags); 513 mode = (readl(config->mode_reg) >> config->masks->mode_shift) &
293 mode = (readl(config->mode_reg) >> PLL_MODE_SHIFT) & 514 config->masks->mode_mask;
294 PLL_MODE_MASK;
295 515
296 val = readl(config->cfg_reg); 516 val = readl(config->cfg_reg);
297 /* calculate denominator */ 517 /* calculate denominator */
298 den = (val >> PLL_DIV_P_SHIFT) & PLL_DIV_P_MASK; 518 den = (val >> config->masks->div_p_shift) & config->masks->div_p_mask;
299 den = 1 << den; 519 den = 1 << den;
300 den *= (val >> PLL_DIV_N_SHIFT) & PLL_DIV_N_MASK; 520 den *= (val >> config->masks->div_n_shift) & config->masks->div_n_mask;
301 521
302 /* calculate numerator & denominator */ 522 /* calculate numerator & denominator */
303 if (!mode) { 523 if (!mode) {
304 /* Normal mode */ 524 /* Normal mode */
305 num *= (val >> PLL_NORM_FDBK_M_SHIFT) & PLL_NORM_FDBK_M_MASK; 525 num *= (val >> config->masks->norm_fdbk_m_shift) &
526 config->masks->norm_fdbk_m_mask;
306 } else { 527 } else {
307 /* Dithered mode */ 528 /* Dithered mode */
308 num *= (val >> PLL_DITH_FDBK_M_SHIFT) & PLL_DITH_FDBK_M_MASK; 529 num *= (val >> config->masks->dith_fdbk_m_shift) &
530 config->masks->dith_fdbk_m_mask;
309 den *= 256; 531 den *= 256;
310 } 532 }
311 533
534 if (!den)
535 return -EINVAL;
536
312 clk->rate = (((clk->pclk->rate/10000) * num) / den) * 10000; 537 clk->rate = (((clk->pclk->rate/10000) * num) / den) * 10000;
313 spin_unlock_irqrestore(&clocks_lock, flags); 538 return 0;
539}
540
541/*
542 * Configures new clock rate of pll
543 */
544int pll_clk_set_rate(struct clk *clk, unsigned long desired_rate)
545{
546 struct pll_rate_tbl *tbls = clk->rate_config.tbls;
547 struct pll_clk_config *config = clk->private_data;
548 unsigned long val, rate;
549 int i;
550
551 i = round_rate_index(clk, desired_rate, &rate);
552 if (i < 0)
553 return i;
554
555 val = readl(config->mode_reg) &
556 ~(config->masks->mode_mask << config->masks->mode_shift);
557 val |= (tbls[i].mode & config->masks->mode_mask) <<
558 config->masks->mode_shift;
559 writel(val, config->mode_reg);
560
561 val = readl(config->cfg_reg) &
562 ~(config->masks->div_p_mask << config->masks->div_p_shift);
563 val |= (tbls[i].p & config->masks->div_p_mask) <<
564 config->masks->div_p_shift;
565 val &= ~(config->masks->div_n_mask << config->masks->div_n_shift);
566 val |= (tbls[i].n & config->masks->div_n_mask) <<
567 config->masks->div_n_shift;
568 val &= ~(config->masks->dith_fdbk_m_mask <<
569 config->masks->dith_fdbk_m_shift);
570 if (tbls[i].mode)
571 val |= (tbls[i].m & config->masks->dith_fdbk_m_mask) <<
572 config->masks->dith_fdbk_m_shift;
573 else
574 val |= (tbls[i].m & config->masks->norm_fdbk_m_mask) <<
575 config->masks->norm_fdbk_m_shift;
576
577 writel(val, config->cfg_reg);
578
579 clk->rate = rate;
580
581 return 0;
582}
583
584/*
585 * Calculates ahb, apb clk rate for specific value of div
586 */
587unsigned long bus_calc_rate(struct clk *clk, int index)
588{
589 unsigned long rate = clk->pclk->rate;
590 struct bus_rate_tbl *tbls = clk->rate_config.tbls;
591
592 return rate / (tbls[index].div + 1);
314} 593}
315 594
316/* calculates current programmed rate of ahb or apb bus */ 595/* calculates current programmed rate of ahb or apb bus */
317void bus_clk_recalc(struct clk *clk) 596int bus_clk_recalc(struct clk *clk)
318{ 597{
319 struct bus_clk_config *config = clk->private_data; 598 struct bus_clk_config *config = clk->private_data;
320 unsigned int div; 599 unsigned int div;
321 unsigned long flags;
322 600
323 spin_lock_irqsave(&clocks_lock, flags); 601 div = ((readl(config->reg) >> config->masks->shift) &
324 div = ((readl(config->reg) >> config->shift) & config->mask) + 1; 602 config->masks->mask) + 1;
603
604 if (!div)
605 return -EINVAL;
606
325 clk->rate = (unsigned long)clk->pclk->rate / div; 607 clk->rate = (unsigned long)clk->pclk->rate / div;
326 spin_unlock_irqrestore(&clocks_lock, flags); 608 return 0;
609}
610
611/* Configures new clock rate of AHB OR APB bus */
612int bus_clk_set_rate(struct clk *clk, unsigned long desired_rate)
613{
614 struct bus_rate_tbl *tbls = clk->rate_config.tbls;
615 struct bus_clk_config *config = clk->private_data;
616 unsigned long val, rate;
617 int i;
618
619 i = round_rate_index(clk, desired_rate, &rate);
620 if (i < 0)
621 return i;
622
623 val = readl(config->reg) &
624 ~(config->masks->mask << config->masks->shift);
625 val |= (tbls[i].div & config->masks->mask) << config->masks->shift;
626 writel(val, config->reg);
627
628 clk->rate = rate;
629
630 return 0;
631}
632
633/*
634 * gives rate for different values of eq, x and y
635 *
636 * Fout from synthesizer can be given from two equations:
637 * Fout1 = (Fin * X/Y)/2 EQ1
638 * Fout2 = Fin * X/Y EQ2
639 */
640unsigned long aux_calc_rate(struct clk *clk, int index)
641{
642 unsigned long rate = clk->pclk->rate;
643 struct aux_rate_tbl *tbls = clk->rate_config.tbls;
644 u8 eq = tbls[index].eq ? 1 : 2;
645
646 return (((rate/10000) * tbls[index].xscale) /
647 (tbls[index].yscale * eq)) * 10000;
327} 648}
328 649
329/* 650/*
@@ -336,44 +657,76 @@ void bus_clk_recalc(struct clk *clk)
336 * 657 *
337 * Selection of eqn 1 or 2 is programmed in register 658 * Selection of eqn 1 or 2 is programmed in register
338 */ 659 */
339void aux_clk_recalc(struct clk *clk) 660int aux_clk_recalc(struct clk *clk)
340{ 661{
341 struct aux_clk_config *config = clk->private_data; 662 struct aux_clk_config *config = clk->private_data;
342 struct pclk_info *pclk_info = NULL;
343 unsigned int num = 1, den = 1, val, eqn; 663 unsigned int num = 1, den = 1, val, eqn;
344 unsigned long flags;
345 664
346 /* get current programmed parent */ 665 val = readl(config->synth_reg);
347 pclk_info = pclk_info_get(clk);
348 if (!pclk_info) {
349 spin_lock_irqsave(&clocks_lock, flags);
350 clk->pclk = NULL;
351 clk->rate = 0;
352 spin_unlock_irqrestore(&clocks_lock, flags);
353 return;
354 }
355 666
356 change_parent(clk, pclk_info->pclk); 667 eqn = (val >> config->masks->eq_sel_shift) &
668 config->masks->eq_sel_mask;
669 if (eqn == config->masks->eq1_mask)
670 den *= 2;
357 671
358 spin_lock_irqsave(&clocks_lock, flags); 672 /* calculate numerator */
359 if (pclk_info->scalable) { 673 num = (val >> config->masks->xscale_sel_shift) &
360 val = readl(config->synth_reg); 674 config->masks->xscale_sel_mask;
361 675
362 eqn = (val >> AUX_EQ_SEL_SHIFT) & AUX_EQ_SEL_MASK; 676 /* calculate denominator */
363 if (eqn == AUX_EQ1_SEL) 677 den *= (val >> config->masks->yscale_sel_shift) &
364 den *= 2; 678 config->masks->yscale_sel_mask;
365 679
366 /* calculate numerator */ 680 if (!den)
367 num = (val >> AUX_XSCALE_SHIFT) & AUX_XSCALE_MASK; 681 return -EINVAL;
368 682
369 /* calculate denominator */ 683 clk->rate = (((clk->pclk->rate/10000) * num) / den) * 10000;
370 den *= (val >> AUX_YSCALE_SHIFT) & AUX_YSCALE_MASK; 684 return 0;
371 val = (((clk->pclk->rate/10000) * num) / den) * 10000; 685}
372 } else
373 val = clk->pclk->rate;
374 686
375 clk->rate = val; 687/* Configures new clock rate of auxiliary synthesizers used by: UART, FIRDA*/
376 spin_unlock_irqrestore(&clocks_lock, flags); 688int aux_clk_set_rate(struct clk *clk, unsigned long desired_rate)
689{
690 struct aux_rate_tbl *tbls = clk->rate_config.tbls;
691 struct aux_clk_config *config = clk->private_data;
692 unsigned long val, rate;
693 int i;
694
695 i = round_rate_index(clk, desired_rate, &rate);
696 if (i < 0)
697 return i;
698
699 val = readl(config->synth_reg) &
700 ~(config->masks->eq_sel_mask << config->masks->eq_sel_shift);
701 val |= (tbls[i].eq & config->masks->eq_sel_mask) <<
702 config->masks->eq_sel_shift;
703 val &= ~(config->masks->xscale_sel_mask <<
704 config->masks->xscale_sel_shift);
705 val |= (tbls[i].xscale & config->masks->xscale_sel_mask) <<
706 config->masks->xscale_sel_shift;
707 val &= ~(config->masks->yscale_sel_mask <<
708 config->masks->yscale_sel_shift);
709 val |= (tbls[i].yscale & config->masks->yscale_sel_mask) <<
710 config->masks->yscale_sel_shift;
711 writel(val, config->synth_reg);
712
713 clk->rate = rate;
714
715 return 0;
716}
717
718/*
719 * Calculates gpt clk rate for different values of mscale and nscale
720 *
721 * Fout= Fin/((2 ^ (N+1)) * (M+1))
722 */
723unsigned long gpt_calc_rate(struct clk *clk, int index)
724{
725 unsigned long rate = clk->pclk->rate;
726 struct gpt_rate_tbl *tbls = clk->rate_config.tbls;
727
728 return rate / ((1 << (tbls[index].nscale + 1)) *
729 (tbls[index].mscale + 1));
377} 730}
378 731
379/* 732/*
@@ -381,46 +734,142 @@ void aux_clk_recalc(struct clk *clk)
381 * Fout from synthesizer can be given from below equations: 734 * Fout from synthesizer can be given from below equations:
382 * Fout= Fin/((2 ^ (N+1)) * (M+1)) 735 * Fout= Fin/((2 ^ (N+1)) * (M+1))
383 */ 736 */
384void gpt_clk_recalc(struct clk *clk) 737int gpt_clk_recalc(struct clk *clk)
385{ 738{
386 struct aux_clk_config *config = clk->private_data; 739 struct gpt_clk_config *config = clk->private_data;
387 struct pclk_info *pclk_info = NULL;
388 unsigned int div = 1, val; 740 unsigned int div = 1, val;
389 unsigned long flags;
390 741
391 pclk_info = pclk_info_get(clk); 742 val = readl(config->synth_reg);
392 if (!pclk_info) { 743 div += (val >> config->masks->mscale_sel_shift) &
393 spin_lock_irqsave(&clocks_lock, flags); 744 config->masks->mscale_sel_mask;
394 clk->pclk = NULL; 745 div *= 1 << (((val >> config->masks->nscale_sel_shift) &
395 clk->rate = 0; 746 config->masks->nscale_sel_mask) + 1);
396 spin_unlock_irqrestore(&clocks_lock, flags);
397 return;
398 }
399
400 change_parent(clk, pclk_info->pclk);
401 747
402 spin_lock_irqsave(&clocks_lock, flags); 748 if (!div)
403 if (pclk_info->scalable) { 749 return -EINVAL;
404 val = readl(config->synth_reg);
405 div += (val >> GPT_MSCALE_SHIFT) & GPT_MSCALE_MASK;
406 div *= 1 << (((val >> GPT_NSCALE_SHIFT) & GPT_NSCALE_MASK) + 1);
407 }
408 750
409 clk->rate = (unsigned long)clk->pclk->rate / div; 751 clk->rate = (unsigned long)clk->pclk->rate / div;
410 spin_unlock_irqrestore(&clocks_lock, flags); 752 return 0;
753}
754
755/* Configures new clock rate of gptiliary synthesizers used by: UART, FIRDA*/
756int gpt_clk_set_rate(struct clk *clk, unsigned long desired_rate)
757{
758 struct gpt_rate_tbl *tbls = clk->rate_config.tbls;
759 struct gpt_clk_config *config = clk->private_data;
760 unsigned long val, rate;
761 int i;
762
763 i = round_rate_index(clk, desired_rate, &rate);
764 if (i < 0)
765 return i;
766
767 val = readl(config->synth_reg) & ~(config->masks->mscale_sel_mask <<
768 config->masks->mscale_sel_shift);
769 val |= (tbls[i].mscale & config->masks->mscale_sel_mask) <<
770 config->masks->mscale_sel_shift;
771 val &= ~(config->masks->nscale_sel_mask <<
772 config->masks->nscale_sel_shift);
773 val |= (tbls[i].nscale & config->masks->nscale_sel_mask) <<
774 config->masks->nscale_sel_shift;
775 writel(val, config->synth_reg);
776
777 clk->rate = rate;
778
779 return 0;
411} 780}
412 781
413/* 782/*
414 * Used for clocks that always have same value as the parent clock divided by a 783 * Calculates clcd clk rate for different values of div
784 *
785 * Fout from synthesizer can be given from below equation:
786 * Fout= Fin/2*div (division factor)
787 * div is 17 bits:-
788 * 0-13 (fractional part)
789 * 14-16 (integer part)
790 * To calculate Fout we left shift val by 14 bits and divide Fin by
791 * complete div (including fractional part) and then right shift the
792 * result by 14 places.
793 */
794unsigned long clcd_calc_rate(struct clk *clk, int index)
795{
796 unsigned long rate = clk->pclk->rate;
797 struct clcd_rate_tbl *tbls = clk->rate_config.tbls;
798
799 rate /= 1000;
800 rate <<= 12;
801 rate /= (2 * tbls[index].div);
802 rate >>= 12;
803 rate *= 1000;
804
805 return rate;
806}
807
808/*
809 * calculates current programmed rate of clcd synthesizer
810 * Fout from synthesizer can be given from below equation:
811 * Fout= Fin/2*div (division factor)
812 * div is 17 bits:-
813 * 0-13 (fractional part)
814 * 14-16 (integer part)
815 * To calculate Fout we left shift val by 14 bits and divide Fin by
816 * complete div (including fractional part) and then right shift the
817 * result by 14 places.
818 */
819int clcd_clk_recalc(struct clk *clk)
820{
821 struct clcd_clk_config *config = clk->private_data;
822 unsigned int div = 1;
823 unsigned long prate;
824 unsigned int val;
825
826 val = readl(config->synth_reg);
827 div = (val >> config->masks->div_factor_shift) &
828 config->masks->div_factor_mask;
829
830 if (!div)
831 return -EINVAL;
832
833 prate = clk->pclk->rate / 1000; /* first level division, make it KHz */
834
835 clk->rate = (((unsigned long)prate << 12) / (2 * div)) >> 12;
836 clk->rate *= 1000;
837 return 0;
838}
839
840/* Configures new clock rate of auxiliary synthesizers used by: UART, FIRDA*/
841int clcd_clk_set_rate(struct clk *clk, unsigned long desired_rate)
842{
843 struct clcd_rate_tbl *tbls = clk->rate_config.tbls;
844 struct clcd_clk_config *config = clk->private_data;
845 unsigned long val, rate;
846 int i;
847
848 i = round_rate_index(clk, desired_rate, &rate);
849 if (i < 0)
850 return i;
851
852 val = readl(config->synth_reg) & ~(config->masks->div_factor_mask <<
853 config->masks->div_factor_shift);
854 val |= (tbls[i].div & config->masks->div_factor_mask) <<
855 config->masks->div_factor_shift;
856 writel(val, config->synth_reg);
857
858 clk->rate = rate;
859
860 return 0;
861}
862
863/*
864 * Used for clocks that always have value as the parent clock divided by a
415 * fixed divisor 865 * fixed divisor
416 */ 866 */
417void follow_parent(struct clk *clk) 867int follow_parent(struct clk *clk)
418{ 868{
419 unsigned long flags; 869 unsigned int div_factor = (clk->div_factor < 1) ? 1 : clk->div_factor;
420 870
421 spin_lock_irqsave(&clocks_lock, flags); 871 clk->rate = clk->pclk->rate/div_factor;
422 clk->rate = clk->pclk->rate; 872 return 0;
423 spin_unlock_irqrestore(&clocks_lock, flags);
424} 873}
425 874
426/** 875/**
@@ -431,5 +880,124 @@ void follow_parent(struct clk *clk)
431 */ 880 */
432void recalc_root_clocks(void) 881void recalc_root_clocks(void)
433{ 882{
434 propagate_rate(&root_clks); 883 struct clk *pclk;
884 unsigned long flags;
885 int ret = 0;
886
887 spin_lock_irqsave(&clocks_lock, flags);
888 list_for_each_entry(pclk, &root_clks, sibling) {
889 if (pclk->recalc) {
890 ret = pclk->recalc(pclk);
891 /*
892 * recalc will return error if clk out is not programmed
893 * In this case configure default clock.
894 */
895 if (ret && pclk->set_rate)
896 pclk->set_rate(pclk, 0);
897 }
898 propagate_rate(pclk, 1);
899 /* Enable clks enabled on init, in software view */
900 if (pclk->flags & ENABLED_ON_INIT)
901 do_clk_enable(pclk);
902 }
903 spin_unlock_irqrestore(&clocks_lock, flags);
904}
905
906#ifdef CONFIG_DEBUG_FS
907/*
908 * debugfs support to trace clock tree hierarchy and attributes
909 */
910static struct dentry *clk_debugfs_root;
911static int clk_debugfs_register_one(struct clk *c)
912{
913 int err;
914 struct dentry *d, *child;
915 struct clk *pa = c->pclk;
916 char s[255];
917 char *p = s;
918
919 if (c) {
920 if (c->cl->con_id)
921 p += sprintf(p, "%s", c->cl->con_id);
922 if (c->cl->dev_id)
923 p += sprintf(p, "%s", c->cl->dev_id);
924 }
925 d = debugfs_create_dir(s, pa ? pa->dent : clk_debugfs_root);
926 if (!d)
927 return -ENOMEM;
928 c->dent = d;
929
930 d = debugfs_create_u32("usage_count", S_IRUGO, c->dent,
931 (u32 *)&c->usage_count);
932 if (!d) {
933 err = -ENOMEM;
934 goto err_out;
935 }
936 d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate);
937 if (!d) {
938 err = -ENOMEM;
939 goto err_out;
940 }
941 d = debugfs_create_x32("flags", S_IRUGO, c->dent, (u32 *)&c->flags);
942 if (!d) {
943 err = -ENOMEM;
944 goto err_out;
945 }
946 return 0;
947
948err_out:
949 d = c->dent;
950 list_for_each_entry(child, &d->d_subdirs, d_u.d_child)
951 debugfs_remove(child);
952 debugfs_remove(c->dent);
953 return err;
954}
955
956static int clk_debugfs_register(struct clk *c)
957{
958 int err;
959 struct clk *pa = c->pclk;
960
961 if (pa && !pa->dent) {
962 err = clk_debugfs_register(pa);
963 if (err)
964 return err;
965 }
966
967 if (!c->dent) {
968 err = clk_debugfs_register_one(c);
969 if (err)
970 return err;
971 }
972 return 0;
973}
974
975static int __init clk_debugfs_init(void)
976{
977 struct clk *c;
978 struct dentry *d;
979 int err;
980
981 d = debugfs_create_dir("clock", NULL);
982 if (!d)
983 return -ENOMEM;
984 clk_debugfs_root = d;
985
986 list_for_each_entry(c, &clocks, node) {
987 err = clk_debugfs_register(c);
988 if (err)
989 goto err_out;
990 }
991 return 0;
992err_out:
993 debugfs_remove_recursive(clk_debugfs_root);
994 return err;
995}
996late_initcall(clk_debugfs_init);
997
998static int clk_debugfs_reparent(struct clk *c)
999{
1000 debugfs_remove(c->dent);
1001 return clk_debugfs_register_one(c);
435} 1002}
1003#endif /* CONFIG_DEBUG_FS */
diff --git a/arch/arm/plat-spear/include/plat/clock.h b/arch/arm/plat-spear/include/plat/clock.h
index 2572260f990f..2ae6606930a6 100644
--- a/arch/arm/plat-spear/include/plat/clock.h
+++ b/arch/arm/plat-spear/include/plat/clock.h
@@ -21,6 +21,7 @@
21/* clk structure flags */ 21/* clk structure flags */
22#define ALWAYS_ENABLED (1 << 0) /* clock always enabled */ 22#define ALWAYS_ENABLED (1 << 0) /* clock always enabled */
23#define RESET_TO_ENABLE (1 << 1) /* reset register bit to enable clk */ 23#define RESET_TO_ENABLE (1 << 1) /* reset register bit to enable clk */
24#define ENABLED_ON_INIT (1 << 2) /* clocks enabled at init */
24 25
25/** 26/**
26 * struct clkops - clock operations 27 * struct clkops - clock operations
@@ -35,13 +36,11 @@ struct clkops {
35/** 36/**
36 * struct pclk_info - parents info 37 * struct pclk_info - parents info
37 * @pclk: pointer to parent clk 38 * @pclk: pointer to parent clk
38 * @pclk_mask: value to be written for selecting this parent 39 * @pclk_val: value to be written for selecting this parent
39 * @scalable: Is parent scalable (1 - YES, 0 - NO)
40 */ 40 */
41struct pclk_info { 41struct pclk_info {
42 struct clk *pclk; 42 struct clk *pclk;
43 u8 pclk_mask; 43 u8 pclk_val;
44 u8 scalable;
45}; 44};
46 45
47/** 46/**
@@ -54,11 +53,23 @@ struct pclk_info {
54struct pclk_sel { 53struct pclk_sel {
55 struct pclk_info *pclk_info; 54 struct pclk_info *pclk_info;
56 u8 pclk_count; 55 u8 pclk_count;
57 unsigned int *pclk_sel_reg; 56 void __iomem *pclk_sel_reg;
58 unsigned int pclk_sel_mask; 57 unsigned int pclk_sel_mask;
59}; 58};
60 59
61/** 60/**
61 * struct rate_config - clk rate configurations
62 * @tbls: array of device specific clk rate tables, in ascending order of rates
63 * @count: size of tbls array
64 * @default_index: default setting when originally disabled
65 */
66struct rate_config {
67 void *tbls;
68 u8 count;
69 u8 default_index;
70};
71
72/**
62 * struct clk - clock structure 73 * struct clk - clock structure
63 * @usage_count: num of users who enabled this clock 74 * @usage_count: num of users who enabled this clock
64 * @flags: flags for clock properties 75 * @flags: flags for clock properties
@@ -67,21 +78,32 @@ struct pclk_sel {
67 * @en_reg_bit: clk enable/disable bit 78 * @en_reg_bit: clk enable/disable bit
68 * @ops: clk enable/disable ops - generic_clkops selected if NULL 79 * @ops: clk enable/disable ops - generic_clkops selected if NULL
69 * @recalc: pointer to clock rate recalculate function 80 * @recalc: pointer to clock rate recalculate function
81 * @set_rate: pointer to clock set rate function
82 * @calc_rate: pointer to clock get rate function for index
83 * @rate_config: rate configuration information, used by set_rate
84 * @div_factor: division factor to parent clock.
70 * @pclk: current parent clk 85 * @pclk: current parent clk
71 * @pclk_sel: pointer to parent selection structure 86 * @pclk_sel: pointer to parent selection structure
72 * @pclk_sel_shift: register shift for selecting parent of this clock 87 * @pclk_sel_shift: register shift for selecting parent of this clock
73 * @children: list for childrens or this clock 88 * @children: list for childrens or this clock
74 * @sibling: node for list of clocks having same parents 89 * @sibling: node for list of clocks having same parents
75 * @private_data: clock specific private data 90 * @private_data: clock specific private data
91 * @node: list to maintain clocks linearly
92 * @cl: clocklook up assoicated with this clock
93 * @dent: object for debugfs
76 */ 94 */
77struct clk { 95struct clk {
78 unsigned int usage_count; 96 unsigned int usage_count;
79 unsigned int flags; 97 unsigned int flags;
80 unsigned long rate; 98 unsigned long rate;
81 unsigned int *en_reg; 99 void __iomem *en_reg;
82 u8 en_reg_bit; 100 u8 en_reg_bit;
83 const struct clkops *ops; 101 const struct clkops *ops;
84 void (*recalc) (struct clk *); 102 int (*recalc) (struct clk *);
103 int (*set_rate) (struct clk *, unsigned long rate);
104 unsigned long (*calc_rate)(struct clk *, int index);
105 struct rate_config rate_config;
106 unsigned int div_factor;
85 107
86 struct clk *pclk; 108 struct clk *pclk;
87 struct pclk_sel *pclk_sel; 109 struct pclk_sel *pclk_sel;
@@ -90,37 +112,137 @@ struct clk {
90 struct list_head children; 112 struct list_head children;
91 struct list_head sibling; 113 struct list_head sibling;
92 void *private_data; 114 void *private_data;
115#ifdef CONFIG_DEBUG_FS
116 struct list_head node;
117 struct clk_lookup *cl;
118 struct dentry *dent;
119#endif
93}; 120};
94 121
95/* pll configuration structure */ 122/* pll configuration structure */
123struct pll_clk_masks {
124 u32 mode_mask;
125 u32 mode_shift;
126
127 u32 norm_fdbk_m_mask;
128 u32 norm_fdbk_m_shift;
129 u32 dith_fdbk_m_mask;
130 u32 dith_fdbk_m_shift;
131 u32 div_p_mask;
132 u32 div_p_shift;
133 u32 div_n_mask;
134 u32 div_n_shift;
135};
136
96struct pll_clk_config { 137struct pll_clk_config {
97 unsigned int *mode_reg; 138 void __iomem *mode_reg;
98 unsigned int *cfg_reg; 139 void __iomem *cfg_reg;
140 struct pll_clk_masks *masks;
141};
142
143/* pll clk rate config structure */
144struct pll_rate_tbl {
145 u8 mode;
146 u16 m;
147 u8 n;
148 u8 p;
99}; 149};
100 150
101/* ahb and apb bus configuration structure */ 151/* ahb and apb bus configuration structure */
152struct bus_clk_masks {
153 u32 mask;
154 u32 shift;
155};
156
102struct bus_clk_config { 157struct bus_clk_config {
103 unsigned int *reg; 158 void __iomem *reg;
104 unsigned int mask; 159 struct bus_clk_masks *masks;
105 unsigned int shift; 160};
161
162/* ahb and apb clk bus rate config structure */
163struct bus_rate_tbl {
164 u8 div;
165};
166
167/* Aux clk configuration structure: applicable to UART and FIRDA */
168struct aux_clk_masks {
169 u32 eq_sel_mask;
170 u32 eq_sel_shift;
171 u32 eq1_mask;
172 u32 eq2_mask;
173 u32 xscale_sel_mask;
174 u32 xscale_sel_shift;
175 u32 yscale_sel_mask;
176 u32 yscale_sel_shift;
106}; 177};
107 178
108/*
109 * Aux clk configuration structure: applicable to GPT, UART and FIRDA
110 */
111struct aux_clk_config { 179struct aux_clk_config {
112 unsigned int *synth_reg; 180 void __iomem *synth_reg;
181 struct aux_clk_masks *masks;
182};
183
184/* aux clk rate config structure */
185struct aux_rate_tbl {
186 u16 xscale;
187 u16 yscale;
188 u8 eq;
189};
190
191/* GPT clk configuration structure */
192struct gpt_clk_masks {
193 u32 mscale_sel_mask;
194 u32 mscale_sel_shift;
195 u32 nscale_sel_mask;
196 u32 nscale_sel_shift;
197};
198
199struct gpt_clk_config {
200 void __iomem *synth_reg;
201 struct gpt_clk_masks *masks;
202};
203
204/* gpt clk rate config structure */
205struct gpt_rate_tbl {
206 u16 mscale;
207 u16 nscale;
208};
209
210/* clcd clk configuration structure */
211struct clcd_synth_masks {
212 u32 div_factor_mask;
213 u32 div_factor_shift;
214};
215
216struct clcd_clk_config {
217 void __iomem *synth_reg;
218 struct clcd_synth_masks *masks;
219};
220
221/* clcd clk rate config structure */
222struct clcd_rate_tbl {
223 u16 div;
113}; 224};
114 225
115/* platform specific clock functions */ 226/* platform specific clock functions */
116void clk_register(struct clk_lookup *cl); 227void clk_register(struct clk_lookup *cl);
117void recalc_root_clocks(void); 228void recalc_root_clocks(void);
118 229
119/* clock recalc functions */ 230/* clock recalc & set rate functions */
120void follow_parent(struct clk *clk); 231int follow_parent(struct clk *clk);
121void pll1_clk_recalc(struct clk *clk); 232unsigned long pll_calc_rate(struct clk *clk, int index);
122void bus_clk_recalc(struct clk *clk); 233int pll_clk_recalc(struct clk *clk);
123void gpt_clk_recalc(struct clk *clk); 234int pll_clk_set_rate(struct clk *clk, unsigned long desired_rate);
124void aux_clk_recalc(struct clk *clk); 235unsigned long bus_calc_rate(struct clk *clk, int index);
236int bus_clk_recalc(struct clk *clk);
237int bus_clk_set_rate(struct clk *clk, unsigned long desired_rate);
238unsigned long gpt_calc_rate(struct clk *clk, int index);
239int gpt_clk_recalc(struct clk *clk);
240int gpt_clk_set_rate(struct clk *clk, unsigned long desired_rate);
241unsigned long aux_calc_rate(struct clk *clk, int index);
242int aux_clk_recalc(struct clk *clk);
243int aux_clk_set_rate(struct clk *clk, unsigned long desired_rate);
244unsigned long clcd_calc_rate(struct clk *clk, int index);
245int clcd_clk_recalc(struct clk *clk);
246int clcd_clk_set_rate(struct clk *clk, unsigned long desired_rate);
125 247
126#endif /* __PLAT_CLOCK_H */ 248#endif /* __PLAT_CLOCK_H */
diff --git a/arch/arm/plat-spear/include/plat/debug-macro.S b/arch/arm/plat-spear/include/plat/debug-macro.S
index e91270e4f640..8501bbf2c092 100644
--- a/arch/arm/plat-spear/include/plat/debug-macro.S
+++ b/arch/arm/plat-spear/include/plat/debug-macro.S
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include <linux/amba/serial.h> 14#include <linux/amba/serial.h>
15#include <mach/spear.h> 15#include <mach/hardware.h>
16 16
17 .macro addruart, rp, rv 17 .macro addruart, rp, rv
18 mov \rp, #SPEAR_DBG_UART_BASE @ Physical base 18 mov \rp, #SPEAR_DBG_UART_BASE @ Physical base
diff --git a/arch/arm/plat-spear/include/plat/hardware.h b/arch/arm/plat-spear/include/plat/hardware.h
new file mode 100644
index 000000000000..66d677225d15
--- /dev/null
+++ b/arch/arm/plat-spear/include/plat/hardware.h
@@ -0,0 +1,23 @@
1/*
2 * arch/arm/plat-spear/include/plat/hardware.h
3 *
4 * Hardware definitions for SPEAr
5 *
6 * Copyright (C) 2010 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __PLAT_HARDWARE_H
15#define __PLAT_HARDWARE_H
16
17#ifndef __ASSEMBLY__
18#define IOMEM(x) ((void __iomem __force *)(x))
19#else
20#define IOMEM(x) (x)
21#endif
22
23#endif /* __PLAT_HARDWARE_H */
diff --git a/arch/arm/plat-spear/include/plat/memory.h b/arch/arm/plat-spear/include/plat/memory.h
index 27a4aba77343..7e3599e1104e 100644
--- a/arch/arm/plat-spear/include/plat/memory.h
+++ b/arch/arm/plat-spear/include/plat/memory.h
@@ -15,6 +15,6 @@
15#define __PLAT_MEMORY_H 15#define __PLAT_MEMORY_H
16 16
17/* Physical DRAM offset */ 17/* Physical DRAM offset */
18#define PHYS_OFFSET UL(0x00000000) 18#define PLAT_PHYS_OFFSET UL(0x00000000)
19 19
20#endif /* __PLAT_MEMORY_H */ 20#endif /* __PLAT_MEMORY_H */
diff --git a/arch/arm/plat-spear/include/plat/system.h b/arch/arm/plat-spear/include/plat/system.h
index 55a4e405d578..a235fa0ca777 100644
--- a/arch/arm/plat-spear/include/plat/system.h
+++ b/arch/arm/plat-spear/include/plat/system.h
@@ -14,9 +14,9 @@
14#ifndef __PLAT_SYSTEM_H 14#ifndef __PLAT_SYSTEM_H
15#define __PLAT_SYSTEM_H 15#define __PLAT_SYSTEM_H
16 16
17#include <asm/hardware/sp810.h>
18#include <linux/io.h> 17#include <linux/io.h>
19#include <mach/spear.h> 18#include <asm/hardware/sp810.h>
19#include <mach/hardware.h>
20 20
21static inline void arch_idle(void) 21static inline void arch_idle(void)
22{ 22{
diff --git a/arch/arm/plat-spear/include/plat/uncompress.h b/arch/arm/plat-spear/include/plat/uncompress.h
index 99ba6789cc97..1bf84527aee4 100644
--- a/arch/arm/plat-spear/include/plat/uncompress.h
+++ b/arch/arm/plat-spear/include/plat/uncompress.h
@@ -13,7 +13,7 @@
13 13
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/amba/serial.h> 15#include <linux/amba/serial.h>
16#include <mach/spear.h> 16#include <mach/hardware.h>
17 17
18#ifndef __PLAT_UNCOMPRESS_H 18#ifndef __PLAT_UNCOMPRESS_H
19#define __PLAT_UNCOMPRESS_H 19#define __PLAT_UNCOMPRESS_H
@@ -24,10 +24,10 @@ static inline void putc(int c)
24{ 24{
25 void __iomem *base = (void __iomem *)SPEAR_DBG_UART_BASE; 25 void __iomem *base = (void __iomem *)SPEAR_DBG_UART_BASE;
26 26
27 while (readl(base + UART01x_FR) & UART01x_FR_TXFF) 27 while (readl_relaxed(base + UART01x_FR) & UART01x_FR_TXFF)
28 barrier(); 28 barrier();
29 29
30 writel(c, base + UART01x_DR); 30 writel_relaxed(c, base + UART01x_DR);
31} 31}
32 32
33static inline void flush(void) 33static inline void flush(void)
diff --git a/arch/arm/plat-spear/include/plat/vmalloc.h b/arch/arm/plat-spear/include/plat/vmalloc.h
index 09e9372aea21..8c8b24d07046 100644
--- a/arch/arm/plat-spear/include/plat/vmalloc.h
+++ b/arch/arm/plat-spear/include/plat/vmalloc.h
@@ -14,6 +14,6 @@
14#ifndef __PLAT_VMALLOC_H 14#ifndef __PLAT_VMALLOC_H
15#define __PLAT_VMALLOC_H 15#define __PLAT_VMALLOC_H
16 16
17#define VMALLOC_END 0xF0000000 17#define VMALLOC_END 0xF0000000UL
18 18
19#endif /* __PLAT_VMALLOC_H */ 19#endif /* __PLAT_VMALLOC_H */
diff --git a/arch/arm/plat-spear/time.c b/arch/arm/plat-spear/time.c
index 839c88df9994..dbb6e4fff79d 100644
--- a/arch/arm/plat-spear/time.c
+++ b/arch/arm/plat-spear/time.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/arm/plat-spear/time.c 2 * arch/arm/plat-spear/time.c
3 * 3 *
4 * Copyright (C) 2009 ST Microelectronics 4 * Copyright (C) 2010 ST Microelectronics
5 * Shiraz Hashim<shiraz.hashim@st.com> 5 * Shiraz Hashim<shiraz.hashim@st.com>
6 * 6 *
7 * This file is licensed under the terms of the GNU General Public 7 * This file is licensed under the terms of the GNU General Public
@@ -20,10 +20,9 @@
20#include <linux/time.h> 20#include <linux/time.h>
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <asm/mach/time.h> 22#include <asm/mach/time.h>
23#include <mach/irqs.h>
24#include <mach/hardware.h>
25#include <mach/spear.h>
26#include <mach/generic.h> 23#include <mach/generic.h>
24#include <mach/hardware.h>
25#include <mach/irqs.h>
27 26
28/* 27/*
29 * We would use TIMER0 and TIMER1 as clockevent and clocksource. 28 * We would use TIMER0 and TIMER1 as clockevent and clocksource.
@@ -211,7 +210,7 @@ static void __init spear_clockevent_init(void)
211 210
212void __init spear_setup_timer(void) 211void __init spear_setup_timer(void)
213{ 212{
214 struct clk *pll3_clk; 213 int ret;
215 214
216 if (!request_mem_region(SPEAR_GPT0_BASE, SZ_1K, "gpt0")) { 215 if (!request_mem_region(SPEAR_GPT0_BASE, SZ_1K, "gpt0")) {
217 pr_err("%s:cannot get IO addr\n", __func__); 216 pr_err("%s:cannot get IO addr\n", __func__);
@@ -230,26 +229,21 @@ void __init spear_setup_timer(void)
230 goto err_iomap; 229 goto err_iomap;
231 } 230 }
232 231
233 pll3_clk = clk_get(NULL, "pll3_48m_clk"); 232 ret = clk_enable(gpt_clk);
234 if (!pll3_clk) { 233 if (ret < 0) {
235 pr_err("%s:couldn't get PLL3 as parent for gpt\n", __func__); 234 pr_err("%s:couldn't enable gpt clock\n", __func__);
236 goto err_iomap; 235 goto err_clk;
237 } 236 }
238 237
239 clk_set_parent(gpt_clk, pll3_clk);
240
241 spear_clockevent_init(); 238 spear_clockevent_init();
242 spear_clocksource_init(); 239 spear_clocksource_init();
243 240
244 return; 241 return;
245 242
243err_clk:
244 clk_put(gpt_clk);
246err_iomap: 245err_iomap:
247 iounmap(gpt_base); 246 iounmap(gpt_base);
248
249err_mem: 247err_mem:
250 release_mem_region(SPEAR_GPT0_BASE, SZ_1K); 248 release_mem_region(SPEAR_GPT0_BASE, SZ_1K);
251} 249}
252
253struct sys_timer spear_sys_timer = {
254 .init = spear_setup_timer,
255};
diff --git a/arch/arm/plat-stmp3xxx/include/mach/memory.h b/arch/arm/plat-stmp3xxx/include/mach/memory.h
index 7b875a07a1a7..61fa54882e12 100644
--- a/arch/arm/plat-stmp3xxx/include/mach/memory.h
+++ b/arch/arm/plat-stmp3xxx/include/mach/memory.h
@@ -17,6 +17,6 @@
17/* 17/*
18 * Physical DRAM offset. 18 * Physical DRAM offset.
19 */ 19 */
20#define PHYS_OFFSET UL(0x40000000) 20#define PLAT_PHYS_OFFSET UL(0x40000000)
21 21
22#endif 22#endif
diff --git a/arch/arm/plat-tcc/include/mach/memory.h b/arch/arm/plat-tcc/include/mach/memory.h
index cd91ba8a670b..28a6e0cd13b3 100644
--- a/arch/arm/plat-tcc/include/mach/memory.h
+++ b/arch/arm/plat-tcc/include/mach/memory.h
@@ -13,6 +13,6 @@
13/* 13/*
14 * Physical DRAM offset. 14 * Physical DRAM offset.
15 */ 15 */
16#define PHYS_OFFSET UL(0x20000000) 16#define PLAT_PHYS_OFFSET UL(0x20000000)
17 17
18#endif 18#endif
diff --git a/arch/arm/plat-versatile/Kconfig b/arch/arm/plat-versatile/Kconfig
new file mode 100644
index 000000000000..52353beb369d
--- /dev/null
+++ b/arch/arm/plat-versatile/Kconfig
@@ -0,0 +1,17 @@
1if PLAT_VERSATILE
2
3config PLAT_VERSATILE_CLCD
4 bool
5
6config PLAT_VERSATILE_FPGA_IRQ
7 bool
8
9config PLAT_VERSATILE_LEDS
10 def_bool y if LEDS_CLASS
11 depends on ARCH_REALVIEW || ARCH_VERSATILE
12
13config PLAT_VERSATILE_SCHED_CLOCK
14 def_bool y if !ARCH_INTEGRATOR_AP
15 select HAVE_SCHED_CLOCK
16
17endif
diff --git a/arch/arm/plat-versatile/Makefile b/arch/arm/plat-versatile/Makefile
index 16dde0819934..69714db47c33 100644
--- a/arch/arm/plat-versatile/Makefile
+++ b/arch/arm/plat-versatile/Makefile
@@ -1,8 +1,7 @@
1obj-y := clock.o 1obj-y := clock.o
2ifneq ($(CONFIG_ARCH_INTEGRATOR),y) 2obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
3obj-y += sched-clock.o 3obj-$(CONFIG_PLAT_VERSATILE_CLCD) += clcd.o
4endif 4obj-$(CONFIG_PLAT_VERSATILE_FPGA_IRQ) += fpga-irq.o
5ifeq ($(CONFIG_LEDS_CLASS),y) 5obj-$(CONFIG_PLAT_VERSATILE_LEDS) += leds.o
6obj-$(CONFIG_ARCH_REALVIEW) += leds.o 6obj-$(CONFIG_PLAT_VERSATILE_SCHED_CLOCK) += sched-clock.o
7obj-$(CONFIG_ARCH_VERSATILE) += leds.o 7obj-$(CONFIG_SMP) += headsmp.o platsmp.o
8endif
diff --git a/arch/arm/plat-versatile/clcd.c b/arch/arm/plat-versatile/clcd.c
new file mode 100644
index 000000000000..6628cc27efc5
--- /dev/null
+++ b/arch/arm/plat-versatile/clcd.c
@@ -0,0 +1,182 @@
1#include <linux/device.h>
2#include <linux/dma-mapping.h>
3#include <linux/amba/bus.h>
4#include <linux/amba/clcd.h>
5#include <plat/clcd.h>
6
7static struct clcd_panel vga = {
8 .mode = {
9 .name = "VGA",
10 .refresh = 60,
11 .xres = 640,
12 .yres = 480,
13 .pixclock = 39721,
14 .left_margin = 40,
15 .right_margin = 24,
16 .upper_margin = 32,
17 .lower_margin = 11,
18 .hsync_len = 96,
19 .vsync_len = 2,
20 .sync = 0,
21 .vmode = FB_VMODE_NONINTERLACED,
22 },
23 .width = -1,
24 .height = -1,
25 .tim2 = TIM2_BCD | TIM2_IPC,
26 .cntl = CNTL_LCDTFT | CNTL_BGR | CNTL_LCDVCOMP(1),
27 .caps = CLCD_CAP_5551 | CLCD_CAP_565 | CLCD_CAP_888,
28 .bpp = 16,
29};
30
31static struct clcd_panel xvga = {
32 .mode = {
33 .name = "XVGA",
34 .refresh = 60,
35 .xres = 1024,
36 .yres = 768,
37 .pixclock = 15748,
38 .left_margin = 152,
39 .right_margin = 48,
40 .upper_margin = 23,
41 .lower_margin = 3,
42 .hsync_len = 104,
43 .vsync_len = 4,
44 .sync = 0,
45 .vmode = FB_VMODE_NONINTERLACED,
46 },
47 .width = -1,
48 .height = -1,
49 .tim2 = TIM2_BCD | TIM2_IPC,
50 .cntl = CNTL_LCDTFT | CNTL_BGR | CNTL_LCDVCOMP(1),
51 .caps = CLCD_CAP_5551 | CLCD_CAP_565 | CLCD_CAP_888,
52 .bpp = 16,
53};
54
55/* Sanyo TM38QV67A02A - 3.8 inch QVGA (320x240) Color TFT */
56static struct clcd_panel sanyo_tm38qv67a02a = {
57 .mode = {
58 .name = "Sanyo TM38QV67A02A",
59 .refresh = 116,
60 .xres = 320,
61 .yres = 240,
62 .pixclock = 100000,
63 .left_margin = 6,
64 .right_margin = 6,
65 .upper_margin = 5,
66 .lower_margin = 5,
67 .hsync_len = 6,
68 .vsync_len = 6,
69 .sync = 0,
70 .vmode = FB_VMODE_NONINTERLACED,
71 },
72 .width = -1,
73 .height = -1,
74 .tim2 = TIM2_BCD,
75 .cntl = CNTL_LCDTFT | CNTL_BGR | CNTL_LCDVCOMP(1),
76 .caps = CLCD_CAP_5551,
77 .bpp = 16,
78};
79
80static struct clcd_panel sanyo_2_5_in = {
81 .mode = {
82 .name = "Sanyo QVGA Portrait",
83 .refresh = 116,
84 .xres = 240,
85 .yres = 320,
86 .pixclock = 100000,
87 .left_margin = 20,
88 .right_margin = 10,
89 .upper_margin = 2,
90 .lower_margin = 2,
91 .hsync_len = 10,
92 .vsync_len = 2,
93 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
94 .vmode = FB_VMODE_NONINTERLACED,
95 },
96 .width = -1,
97 .height = -1,
98 .tim2 = TIM2_IVS | TIM2_IHS | TIM2_IPC,
99 .cntl = CNTL_LCDTFT | CNTL_BGR | CNTL_LCDVCOMP(1),
100 .caps = CLCD_CAP_5551,
101 .bpp = 16,
102};
103
104/* Epson L2F50113T00 - 2.2 inch 176x220 Color TFT */
105static struct clcd_panel epson_l2f50113t00 = {
106 .mode = {
107 .name = "Epson L2F50113T00",
108 .refresh = 390,
109 .xres = 176,
110 .yres = 220,
111 .pixclock = 62500,
112 .left_margin = 3,
113 .right_margin = 2,
114 .upper_margin = 1,
115 .lower_margin = 0,
116 .hsync_len = 3,
117 .vsync_len = 2,
118 .sync = 0,
119 .vmode = FB_VMODE_NONINTERLACED,
120 },
121 .width = -1,
122 .height = -1,
123 .tim2 = TIM2_BCD | TIM2_IPC,
124 .cntl = CNTL_LCDTFT | CNTL_BGR | CNTL_LCDVCOMP(1),
125 .caps = CLCD_CAP_5551,
126 .bpp = 16,
127};
128
129static struct clcd_panel *panels[] = {
130 &vga,
131 &xvga,
132 &sanyo_tm38qv67a02a,
133 &sanyo_2_5_in,
134 &epson_l2f50113t00,
135};
136
137struct clcd_panel *versatile_clcd_get_panel(const char *name)
138{
139 int i;
140
141 for (i = 0; i < ARRAY_SIZE(panels); i++)
142 if (strcmp(panels[i]->mode.name, name) == 0)
143 break;
144
145 if (i < ARRAY_SIZE(panels))
146 return panels[i];
147
148 pr_err("CLCD: couldn't get parameters for panel %s\n", name);
149
150 return NULL;
151}
152
153int versatile_clcd_setup_dma(struct clcd_fb *fb, unsigned long framesize)
154{
155 dma_addr_t dma;
156
157 fb->fb.screen_base = dma_alloc_writecombine(&fb->dev->dev, framesize,
158 &dma, GFP_KERNEL);
159 if (!fb->fb.screen_base) {
160 pr_err("CLCD: unable to map framebuffer\n");
161 return -ENOMEM;
162 }
163
164 fb->fb.fix.smem_start = dma;
165 fb->fb.fix.smem_len = framesize;
166
167 return 0;
168}
169
170int versatile_clcd_mmap_dma(struct clcd_fb *fb, struct vm_area_struct *vma)
171{
172 return dma_mmap_writecombine(&fb->dev->dev, vma,
173 fb->fb.screen_base,
174 fb->fb.fix.smem_start,
175 fb->fb.fix.smem_len);
176}
177
178void versatile_clcd_remove_dma(struct clcd_fb *fb)
179{
180 dma_free_writecombine(&fb->dev->dev, fb->fb.fix.smem_len,
181 fb->fb.screen_base, fb->fb.fix.smem_start);
182}
diff --git a/arch/arm/plat-versatile/fpga-irq.c b/arch/arm/plat-versatile/fpga-irq.c
new file mode 100644
index 000000000000..31d945d37e4f
--- /dev/null
+++ b/arch/arm/plat-versatile/fpga-irq.c
@@ -0,0 +1,72 @@
1/*
2 * Support for Versatile FPGA-based IRQ controllers
3 */
4#include <linux/irq.h>
5#include <linux/io.h>
6
7#include <asm/mach/irq.h>
8#include <plat/fpga-irq.h>
9
10#define IRQ_STATUS 0x00
11#define IRQ_RAW_STATUS 0x04
12#define IRQ_ENABLE_SET 0x08
13#define IRQ_ENABLE_CLEAR 0x0c
14
15static void fpga_irq_mask(struct irq_data *d)
16{
17 struct fpga_irq_data *f = irq_data_get_irq_chip_data(d);
18 u32 mask = 1 << (d->irq - f->irq_start);
19
20 writel(mask, f->base + IRQ_ENABLE_CLEAR);
21}
22
23static void fpga_irq_unmask(struct irq_data *d)
24{
25 struct fpga_irq_data *f = irq_data_get_irq_chip_data(d);
26 u32 mask = 1 << (d->irq - f->irq_start);
27
28 writel(mask, f->base + IRQ_ENABLE_SET);
29}
30
31static void fpga_irq_handle(unsigned int irq, struct irq_desc *desc)
32{
33 struct fpga_irq_data *f = get_irq_desc_data(desc);
34 u32 status = readl(f->base + IRQ_STATUS);
35
36 if (status == 0) {
37 do_bad_IRQ(irq, desc);
38 return;
39 }
40
41 do {
42 irq = ffs(status) - 1;
43 status &= ~(1 << irq);
44
45 generic_handle_irq(irq + f->irq_start);
46 } while (status);
47}
48
49void __init fpga_irq_init(int parent_irq, u32 valid, struct fpga_irq_data *f)
50{
51 unsigned int i;
52
53 f->chip.irq_ack = fpga_irq_mask;
54 f->chip.irq_mask = fpga_irq_mask;
55 f->chip.irq_unmask = fpga_irq_unmask;
56
57 if (parent_irq != -1) {
58 set_irq_data(parent_irq, f);
59 set_irq_chained_handler(parent_irq, fpga_irq_handle);
60 }
61
62 for (i = 0; i < 32; i++) {
63 if (valid & (1 << i)) {
64 unsigned int irq = f->irq_start + i;
65
66 set_irq_chip_data(irq, f);
67 set_irq_chip(irq, &f->chip);
68 set_irq_handler(irq, handle_level_irq);
69 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
70 }
71 }
72}
diff --git a/arch/arm/mach-vexpress/headsmp.S b/arch/arm/plat-versatile/headsmp.S
index 7a3f0632947c..d397a1fb2f54 100644
--- a/arch/arm/mach-vexpress/headsmp.S
+++ b/arch/arm/plat-versatile/headsmp.S
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-vexpress/headsmp.S 2 * linux/arch/arm/plat-versatile/headsmp.S
3 * 3 *
4 * Copyright (c) 2003 ARM Limited 4 * Copyright (c) 2003 ARM Limited
5 * All Rights Reserved 5 * All Rights Reserved
@@ -14,11 +14,11 @@
14 __INIT 14 __INIT
15 15
16/* 16/*
17 * Versatile Express specific entry point for secondary CPUs. This 17 * Realview/Versatile Express specific entry point for secondary CPUs.
18 * provides a "holding pen" into which all secondary cores are held 18 * This provides a "holding pen" into which all secondary cores are held
19 * until we're ready for them to initialise. 19 * until we're ready for them to initialise.
20 */ 20 */
21ENTRY(vexpress_secondary_startup) 21ENTRY(versatile_secondary_startup)
22 mrc p15, 0, r0, c0, c0, 5 22 mrc p15, 0, r0, c0, c0, 5
23 and r0, r0, #15 23 and r0, r0, #15
24 adr r4, 1f 24 adr r4, 1f
diff --git a/arch/arm/plat-versatile/include/plat/clcd.h b/arch/arm/plat-versatile/include/plat/clcd.h
new file mode 100644
index 000000000000..6bb6a1d2019b
--- /dev/null
+++ b/arch/arm/plat-versatile/include/plat/clcd.h
@@ -0,0 +1,9 @@
1#ifndef PLAT_CLCD_H
2#define PLAT_CLCD_H
3
4struct clcd_panel *versatile_clcd_get_panel(const char *);
5int versatile_clcd_setup_dma(struct clcd_fb *, unsigned long);
6int versatile_clcd_mmap_dma(struct clcd_fb *, struct vm_area_struct *);
7void versatile_clcd_remove_dma(struct clcd_fb *);
8
9#endif
diff --git a/arch/arm/plat-versatile/include/plat/fpga-irq.h b/arch/arm/plat-versatile/include/plat/fpga-irq.h
new file mode 100644
index 000000000000..627fafd1e595
--- /dev/null
+++ b/arch/arm/plat-versatile/include/plat/fpga-irq.h
@@ -0,0 +1,12 @@
1#ifndef PLAT_FPGA_IRQ_H
2#define PLAT_FPGA_IRQ_H
3
4struct fpga_irq_data {
5 void __iomem *base;
6 unsigned int irq_start;
7 struct irq_chip chip;
8};
9
10void fpga_irq_init(int, u32, struct fpga_irq_data *);
11
12#endif
diff --git a/arch/arm/mach-vexpress/localtimer.c b/arch/arm/plat-versatile/localtimer.c
index c0e3a59a0bfc..0fb3961999b5 100644
--- a/arch/arm/mach-vexpress/localtimer.c
+++ b/arch/arm/plat-versatile/localtimer.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-vexpress/localtimer.c 2 * linux/arch/arm/plat-versatile/localtimer.c
3 * 3 *
4 * Copyright (C) 2002 ARM Ltd. 4 * Copyright (C) 2002 ARM Ltd.
5 * All Rights Reserved 5 * All Rights Reserved
@@ -19,8 +19,9 @@
19/* 19/*
20 * Setup the local clock events for a CPU. 20 * Setup the local clock events for a CPU.
21 */ 21 */
22void __cpuinit local_timer_setup(struct clock_event_device *evt) 22int __cpuinit local_timer_setup(struct clock_event_device *evt)
23{ 23{
24 evt->irq = IRQ_LOCALTIMER; 24 evt->irq = IRQ_LOCALTIMER;
25 twd_timer_setup(evt); 25 twd_timer_setup(evt);
26 return 0;
26} 27}
diff --git a/arch/arm/plat-versatile/platsmp.c b/arch/arm/plat-versatile/platsmp.c
new file mode 100644
index 000000000000..ba3d471d4bcf
--- /dev/null
+++ b/arch/arm/plat-versatile/platsmp.c
@@ -0,0 +1,104 @@
1/*
2 * linux/arch/arm/plat-versatile/platsmp.c
3 *
4 * Copyright (C) 2002 ARM Ltd.
5 * 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 version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/init.h>
12#include <linux/errno.h>
13#include <linux/delay.h>
14#include <linux/device.h>
15#include <linux/jiffies.h>
16#include <linux/smp.h>
17
18#include <asm/cacheflush.h>
19
20/*
21 * control for which core is the next to come out of the secondary
22 * boot "holding pen"
23 */
24volatile int __cpuinitdata pen_release = -1;
25
26/*
27 * Write pen_release in a way that is guaranteed to be visible to all
28 * observers, irrespective of whether they're taking part in coherency
29 * or not. This is necessary for the hotplug code to work reliably.
30 */
31static void __cpuinit write_pen_release(int val)
32{
33 pen_release = val;
34 smp_wmb();
35 __cpuc_flush_dcache_area((void *)&pen_release, sizeof(pen_release));
36 outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
37}
38
39static DEFINE_SPINLOCK(boot_lock);
40
41void __cpuinit platform_secondary_init(unsigned int cpu)
42{
43 /*
44 * if any interrupts are already enabled for the primary
45 * core (e.g. timer irq), then they will not have been enabled
46 * for us: do so
47 */
48 gic_secondary_init(0);
49
50 /*
51 * let the primary processor know we're out of the
52 * pen, then head off into the C entry point
53 */
54 write_pen_release(-1);
55
56 /*
57 * Synchronise with the boot thread.
58 */
59 spin_lock(&boot_lock);
60 spin_unlock(&boot_lock);
61}
62
63int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
64{
65 unsigned long timeout;
66
67 /*
68 * Set synchronisation state between this boot processor
69 * and the secondary one
70 */
71 spin_lock(&boot_lock);
72
73 /*
74 * This is really belt and braces; we hold unintended secondary
75 * CPUs in the holding pen until we're ready for them. However,
76 * since we haven't sent them a soft interrupt, they shouldn't
77 * be there.
78 */
79 write_pen_release(cpu);
80
81 /*
82 * Send the secondary CPU a soft interrupt, thereby causing
83 * the boot monitor to read the system wide flags register,
84 * and branch to the address found there.
85 */
86 smp_cross_call(cpumask_of(cpu), 1);
87
88 timeout = jiffies + (1 * HZ);
89 while (time_before(jiffies, timeout)) {
90 smp_rmb();
91 if (pen_release == -1)
92 break;
93
94 udelay(10);
95 }
96
97 /*
98 * now the secondary core is starting up let it run its
99 * calibrations, then wait for it to finish
100 */
101 spin_unlock(&boot_lock);
102
103 return pen_release != -1 ? -ENOSYS : 0;
104}
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index 2fea897ebeb1..7ca41f0a09b1 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -12,2745 +12,458 @@
12# 12#
13# http://www.arm.linux.org.uk/developer/machines/?action=new 13# http://www.arm.linux.org.uk/developer/machines/?action=new
14# 14#
15# Last update: Sun Dec 12 23:24:27 2010 15# XXX: This is a cut-down version of the file; it contains only machines that
16# XXX: are in mainline or have been submitted to the machine database within
17# XXX: the last 12 months. If your entry is missing please email rmk at
18# XXX: <linux@arm.linux.org.uk>
19#
20# Last update: Sun Mar 20 18:06:11 2011
16# 21#
17# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number 22# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
18# 23#
19ebsa110 ARCH_EBSA110 EBSA110 0 24ebsa110 ARCH_EBSA110 EBSA110 0
20riscpc ARCH_RPC RISCPC 1 25riscpc ARCH_RPC RISCPC 1
21nexuspci ARCH_NEXUSPCI NEXUSPCI 3
22ebsa285 ARCH_EBSA285 EBSA285 4 26ebsa285 ARCH_EBSA285 EBSA285 4
23netwinder ARCH_NETWINDER NETWINDER 5 27netwinder ARCH_NETWINDER NETWINDER 5
24cats ARCH_CATS CATS 6 28cats ARCH_CATS CATS 6
25tbox ARCH_TBOX TBOX 7
26co285 ARCH_CO285 CO285 8
27clps7110 ARCH_CLPS7110 CLPS7110 9
28archimedes ARCH_ARC ARCHIMEDES 10
29a5k ARCH_A5K A5K 11
30etoile ARCH_ETOILE ETOILE 12
31lacie_nas ARCH_LACIE_NAS LACIE_NAS 13
32clps7500 ARCH_CLPS7500 CLPS7500 14
33shark ARCH_SHARK SHARK 15 29shark ARCH_SHARK SHARK 15
34brutus SA1100_BRUTUS BRUTUS 16 30brutus SA1100_BRUTUS BRUTUS 16
35personal_server ARCH_PERSONAL_SERVER PERSONAL_SERVER 17 31personal_server ARCH_PERSONAL_SERVER PERSONAL_SERVER 17
36itsy SA1100_ITSY ITSY 18
37l7200 ARCH_L7200 L7200 19 32l7200 ARCH_L7200 L7200 19
38pleb SA1100_PLEB PLEB 20 33pleb SA1100_PLEB PLEB 20
39integrator ARCH_INTEGRATOR INTEGRATOR 21 34integrator ARCH_INTEGRATOR INTEGRATOR 21
40h3600 SA1100_H3600 H3600 22 35h3600 SA1100_H3600 H3600 22
41ixp1200 ARCH_IXP1200 IXP1200 23
42p720t ARCH_P720T P720T 24 36p720t ARCH_P720T P720T 24
43assabet SA1100_ASSABET ASSABET 25 37assabet SA1100_ASSABET ASSABET 25
44victor SA1100_VICTOR VICTOR 26
45lart SA1100_LART LART 27 38lart SA1100_LART LART 27
46ranger SA1100_RANGER RANGER 28
47graphicsclient SA1100_GRAPHICSCLIENT GRAPHICSCLIENT 29 39graphicsclient SA1100_GRAPHICSCLIENT GRAPHICSCLIENT 29
48xp860 SA1100_XP860 XP860 30 40xp860 SA1100_XP860 XP860 30
49cerf SA1100_CERF CERF 31 41cerf SA1100_CERF CERF 31
50nanoengine SA1100_NANOENGINE NANOENGINE 32 42nanoengine SA1100_NANOENGINE NANOENGINE 32
51fpic SA1100_FPIC FPIC 33
52extenex1 SA1100_EXTENEX1 EXTENEX1 34
53sherman SA1100_SHERMAN SHERMAN 35
54accelent_sa SA1100_ACCELENT ACCELENT_SA 36
55accelent_l7200 ARCH_L7200_ACCELENT ACCELENT_L7200 37
56netport SA1100_NETPORT NETPORT 38
57pangolin SA1100_PANGOLIN PANGOLIN 39
58yopy SA1100_YOPY YOPY 40
59coolidge SA1100_COOLIDGE COOLIDGE 41
60huw_webpanel SA1100_HUW_WEBPANEL HUW_WEBPANEL 42
61spotme ARCH_SPOTME SPOTME 43
62freebird ARCH_FREEBIRD FREEBIRD 44
63ti925 ARCH_TI925 TI925 45
64riscstation ARCH_RISCSTATION RISCSTATION 46
65cavy SA1100_CAVY CAVY 47
66jornada720 SA1100_JORNADA720 JORNADA720 48 43jornada720 SA1100_JORNADA720 JORNADA720 48
67omnimeter SA1100_OMNIMETER OMNIMETER 49
68edb7211 ARCH_EDB7211 EDB7211 50 44edb7211 ARCH_EDB7211 EDB7211 50
69citygo SA1100_CITYGO CITYGO 51
70pfs168 SA1100_PFS168 PFS168 52 45pfs168 SA1100_PFS168 PFS168 52
71spot SA1100_SPOT SPOT 53
72flexanet SA1100_FLEXANET FLEXANET 54 46flexanet SA1100_FLEXANET FLEXANET 54
73webpal ARCH_WEBPAL WEBPAL 55
74linpda SA1100_LINPDA LINPDA 56
75anakin ARCH_ANAKIN ANAKIN 57
76mvi SA1100_MVI MVI 58
77jupiter SA1100_JUPITER JUPITER 59
78psionw ARCH_PSIONW PSIONW 60
79aln SA1100_ALN ALN 61
80epxa ARCH_CAMELOT CAMELOT 62
81gds2200 SA1100_GDS2200 GDS2200 63
82netbook SA1100_PSION_SERIES7 PSION_SERIES7 64
83xfile SA1100_XFILE XFILE 65
84accelent_ep9312 ARCH_ACCELENT_EP9312 ACCELENT_EP9312 66
85ic200 ARCH_IC200 IC200 67
86creditlart SA1100_CREDITLART CREDITLART 68
87htm SA1100_HTM HTM 69
88iq80310 ARCH_IQ80310 IQ80310 70
89freebot SA1100_FREEBOT FREEBOT 71
90entel ARCH_ENTEL ENTEL 72
91enp3510 ARCH_ENP3510 ENP3510 73
92trizeps SA1100_TRIZEPS TRIZEPS 74
93nesa SA1100_NESA NESA 75
94venus ARCH_VENUS VENUS 76
95tardis ARCH_TARDIS TARDIS 77
96mercury ARCH_MERCURY MERCURY 78
97empeg SA1100_EMPEG EMPEG 79
98adi_evb ARCH_I80200FCC I80200FCC 80
99itt_cpb SA1100_ITT_CPB ITT_CPB 81
100svc SA1100_SVC SVC 82
101alpha2 SA1100_ALPHA2 ALPHA2 84
102alpha1 SA1100_ALPHA1 ALPHA1 85
103netarm ARCH_NETARM NETARM 86
104simpad SA1100_SIMPAD SIMPAD 87 47simpad SA1100_SIMPAD SIMPAD 87
105pda1 ARCH_PDA1 PDA1 88
106lubbock ARCH_LUBBOCK LUBBOCK 89 48lubbock ARCH_LUBBOCK LUBBOCK 89
107aniko ARCH_ANIKO ANIKO 90
108clep7212 ARCH_CLEP7212 CLEP7212 91 49clep7212 ARCH_CLEP7212 CLEP7212 91
109cs89712 ARCH_CS89712 CS89712 92
110weararm SA1100_WEARARM WEARARM 93
111possio_px SA1100_POSSIO_PX POSSIO_PX 94
112sidearm SA1100_SIDEARM SIDEARM 95
113stork SA1100_STORK STORK 96
114shannon SA1100_SHANNON SHANNON 97 50shannon SA1100_SHANNON SHANNON 97
115ace ARCH_ACE ACE 98
116ballyarm SA1100_BALLYARM BALLYARM 99
117simputer SA1100_SIMPUTER SIMPUTER 100
118nexterm SA1100_NEXTERM NEXTERM 101
119sa1100_elf SA1100_SA1100_ELF SA1100_ELF 102
120gator SA1100_GATOR GATOR 103
121granite ARCH_GRANITE GRANITE 104
122consus SA1100_CONSUS CONSUS 105 51consus SA1100_CONSUS CONSUS 105
123aaed2000 ARCH_AAED2000 AAED2000 106 52aaed2000 ARCH_AAED2000 AAED2000 106
124cdb89712 ARCH_CDB89712 CDB89712 107 53cdb89712 ARCH_CDB89712 CDB89712 107
125graphicsmaster SA1100_GRAPHICSMASTER GRAPHICSMASTER 108 54graphicsmaster SA1100_GRAPHICSMASTER GRAPHICSMASTER 108
126adsbitsy SA1100_ADSBITSY ADSBITSY 109 55adsbitsy SA1100_ADSBITSY ADSBITSY 109
127pxa_idp ARCH_PXA_IDP PXA_IDP 110 56pxa_idp ARCH_PXA_IDP PXA_IDP 110
128plce ARCH_PLCE PLCE 111
129pt_system3 SA1100_PT_SYSTEM3 PT_SYSTEM3 112 57pt_system3 SA1100_PT_SYSTEM3 PT_SYSTEM3 112
130murphy ARCH_MEDALB MEDALB 113
131eagle ARCH_EAGLE EAGLE 114
132dsc21 ARCH_DSC21 DSC21 115
133dsc24 ARCH_DSC24 DSC24 116
134ti5472 ARCH_TI5472 TI5472 117
135autcpu12 ARCH_AUTCPU12 AUTCPU12 118 58autcpu12 ARCH_AUTCPU12 AUTCPU12 118
136uengine ARCH_UENGINE UENGINE 119
137bluestem SA1100_BLUESTEM BLUESTEM 120
138xingu8 ARCH_XINGU8 XINGU8 121
139bushstb ARCH_BUSHSTB BUSHSTB 122
140epsilon1 SA1100_EPSILON1 EPSILON1 123
141balloon SA1100_BALLOON BALLOON 124
142puppy ARCH_PUPPY PUPPY 125
143elroy SA1100_ELROY ELROY 126
144gms720 ARCH_GMS720 GMS720 127
145s24x ARCH_S24X S24X 128
146jtel_clep7312 ARCH_JTEL_CLEP7312 JTEL_CLEP7312 129
147cx821xx ARCH_CX821XX CX821XX 130
148edb7312 ARCH_EDB7312 EDB7312 131
149bsa1110 SA1100_BSA1110 BSA1110 132
150powerpin ARCH_POWERPIN POWERPIN 133
151openarm ARCH_OPENARM OPENARM 134
152whitechapel SA1100_WHITECHAPEL WHITECHAPEL 135
153h3100 SA1100_H3100 H3100 136 59h3100 SA1100_H3100 H3100 136
154h3800 SA1100_H3800 H3800 137
155blue_v1 ARCH_BLUE_V1 BLUE_V1 138
156pxa_cerf ARCH_PXA_CERF PXA_CERF 139
157arm7tevb ARCH_ARM7TEVB ARM7TEVB 140
158d7400 SA1100_D7400 D7400 141
159piranha ARCH_PIRANHA PIRANHA 142
160sbcamelot SA1100_SBCAMELOT SBCAMELOT 143
161kings SA1100_KINGS KINGS 144
162smdk2400 ARCH_SMDK2400 SMDK2400 145
163collie SA1100_COLLIE COLLIE 146 60collie SA1100_COLLIE COLLIE 146
164idr ARCH_IDR IDR 147
165badge4 SA1100_BADGE4 BADGE4 148 61badge4 SA1100_BADGE4 BADGE4 148
166webnet ARCH_WEBNET WEBNET 149
167d7300 SA1100_D7300 D7300 150
168cep SA1100_CEP CEP 151
169fortunet ARCH_FORTUNET FORTUNET 152 62fortunet ARCH_FORTUNET FORTUNET 152
170vc547x ARCH_VC547X VC547X 153
171filewalker SA1100_FILEWALKER FILEWALKER 154
172netgateway SA1100_NETGATEWAY NETGATEWAY 155
173symbol2800 SA1100_SYMBOL2800 SYMBOL2800 156
174suns SA1100_SUNS SUNS 157
175frodo SA1100_FRODO FRODO 158
176ms301 SA1100_MACH_TYTE_MS301 MACH_TYTE_MS301 159
177mx1ads ARCH_MX1ADS MX1ADS 160 63mx1ads ARCH_MX1ADS MX1ADS 160
178h7201 ARCH_H7201 H7201 161 64h7201 ARCH_H7201 H7201 161
179h7202 ARCH_H7202 H7202 162 65h7202 ARCH_H7202 H7202 162
180amico ARCH_AMICO AMICO 163
181iam SA1100_IAM IAM 164
182tt530 SA1100_TT530 TT530 165
183sam2400 ARCH_SAM2400 SAM2400 166
184jornada56x SA1100_JORNADA56X JORNADA56X 167
185active SA1100_ACTIVE ACTIVE 168
186iq80321 ARCH_IQ80321 IQ80321 169 66iq80321 ARCH_IQ80321 IQ80321 169
187wid SA1100_WID WID 170
188sabinal ARCH_SABINAL SABINAL 171
189ixp425_matacumbe ARCH_IXP425_MATACUMBE IXP425_MATACUMBE 172
190miniprint SA1100_MINIPRINT MINIPRINT 173
191adm510x ARCH_ADM510X ADM510X 174
192svs200 SA1100_SVS200 SVS200 175
193atg_tcu ARCH_ATG_TCU ATG_TCU 176
194jornada820 SA1100_JORNADA820 JORNADA820 177
195s3c44b0 ARCH_S3C44B0 S3C44B0 178
196margis2 ARCH_MARGIS2 MARGIS2 179
197ks8695 ARCH_KS8695 KS8695 180 67ks8695 ARCH_KS8695 KS8695 180
198brh ARCH_BRH BRH 181
199s3c2410 ARCH_S3C2410 S3C2410 182
200possio_px30 ARCH_POSSIO_PX30 POSSIO_PX30 183
201s3c2800 ARCH_S3C2800 S3C2800 184
202fleetwood SA1100_FLEETWOOD FLEETWOOD 185
203omaha ARCH_OMAHA OMAHA 186
204ta7 ARCH_TA7 TA7 187
205nova SA1100_NOVA NOVA 188
206hmk ARCH_HMK HMK 189
207karo ARCH_KARO KARO 190
208fester SA1100_FESTER FESTER 191
209gpi ARCH_GPI GPI 192
210smdk2410 ARCH_SMDK2410 SMDK2410 193 68smdk2410 ARCH_SMDK2410 SMDK2410 193
211i519 ARCH_I519 I519 194
212nexio SA1100_NEXIO NEXIO 195
213bitbox SA1100_BITBOX BITBOX 196
214g200 SA1100_G200 G200 197
215gill SA1100_GILL GILL 198
216pxa_mercury ARCH_PXA_MERCURY PXA_MERCURY 199
217ceiva ARCH_CEIVA CEIVA 200 69ceiva ARCH_CEIVA CEIVA 200
218fret SA1100_FRET FRET 201
219emailphone SA1100_EMAILPHONE EMAILPHONE 202
220h3900 ARCH_H3900 H3900 203
221pxa1 ARCH_PXA1 PXA1 204
222koan369 SA1100_KOAN369 KOAN369 205
223cogent ARCH_COGENT COGENT 206
224esl_simputer ARCH_ESL_SIMPUTER ESL_SIMPUTER 207
225esl_simputer_clr ARCH_ESL_SIMPUTER_CLR ESL_SIMPUTER_CLR 208
226esl_simputer_bw ARCH_ESL_SIMPUTER_BW ESL_SIMPUTER_BW 209
227hhp_cradle ARCH_HHP_CRADLE HHP_CRADLE 210
228he500 ARCH_HE500 HE500 211
229inhandelf2 SA1100_INHANDELF2 INHANDELF2 212
230inhandftip SA1100_INHANDFTIP INHANDFTIP 213
231dnp1110 SA1100_DNP1110 DNP1110 214
232pnp1110 SA1100_PNP1110 PNP1110 215
233csb226 ARCH_CSB226 CSB226 216
234arnold SA1100_ARNOLD ARNOLD 217
235voiceblue MACH_VOICEBLUE VOICEBLUE 218 70voiceblue MACH_VOICEBLUE VOICEBLUE 218
236jz8028 ARCH_JZ8028 JZ8028 219
237h5400 ARCH_H5400 H5400 220 71h5400 ARCH_H5400 H5400 220
238forte SA1100_FORTE FORTE 221
239acam SA1100_ACAM ACAM 222
240abox SA1100_ABOX ABOX 223
241atmel ARCH_ATMEL ATMEL 224
242sitsang ARCH_SITSANG SITSANG 225
243cpu1110lcdnet SA1100_CPU1110LCDNET CPU1110LCDNET 226
244mpl_vcma9 ARCH_MPL_VCMA9 MPL_VCMA9 227
245opus_a1 ARCH_OPUS_A1 OPUS_A1 228
246daytona ARCH_DAYTONA DAYTONA 229
247killbear SA1100_KILLBEAR KILLBEAR 230
248yoho ARCH_YOHO YOHO 231
249jasper ARCH_JASPER JASPER 232
250dsc25 ARCH_DSC25 DSC25 233
251omap_innovator MACH_OMAP_INNOVATOR OMAP_INNOVATOR 234 72omap_innovator MACH_OMAP_INNOVATOR OMAP_INNOVATOR 234
252mnci ARCH_RAMSES RAMSES 235
253s28x ARCH_S28X S28X 236
254mport3 ARCH_MPORT3 MPORT3 237
255pxa_eagle250 ARCH_PXA_EAGLE250 PXA_EAGLE250 238
256pdb ARCH_PDB PDB 239
257blue_2g SA1100_BLUE_2G BLUE_2G 240
258bluearch SA1100_BLUEARCH BLUEARCH 241
259ixdp2400 ARCH_IXDP2400 IXDP2400 242 73ixdp2400 ARCH_IXDP2400 IXDP2400 242
260ixdp2800 ARCH_IXDP2800 IXDP2800 243 74ixdp2800 ARCH_IXDP2800 IXDP2800 243
261explorer SA1100_EXPLORER EXPLORER 244
262ixdp425 ARCH_IXDP425 IXDP425 245 75ixdp425 ARCH_IXDP425 IXDP425 245
263chimp ARCH_CHIMP CHIMP 246
264stork_nest ARCH_STORK_NEST STORK_NEST 247
265stork_egg ARCH_STORK_EGG STORK_EGG 248
266wismo SA1100_WISMO WISMO 249
267ezlinx ARCH_EZLINX EZLINX 250
268at91rm9200 ARCH_AT91RM9200 AT91RM9200 251
269adtech_orion ARCH_ADTECH_ORION ADTECH_ORION 252
270neptune ARCH_NEPTUNE NEPTUNE 253
271hackkit SA1100_HACKKIT HACKKIT 254 76hackkit SA1100_HACKKIT HACKKIT 254
272pxa_wins30 ARCH_PXA_WINS30 PXA_WINS30 255
273lavinna SA1100_LAVINNA LAVINNA 256
274pxa_uengine ARCH_PXA_UENGINE PXA_UENGINE 257
275innokom ARCH_INNOKOM INNOKOM 258
276bms ARCH_BMS BMS 259
277ixcdp1100 ARCH_IXCDP1100 IXCDP1100 260 77ixcdp1100 ARCH_IXCDP1100 IXCDP1100 260
278prpmc1100 ARCH_PRPMC1100 PRPMC1100 261
279at91rm9200dk ARCH_AT91RM9200DK AT91RM9200DK 262 78at91rm9200dk ARCH_AT91RM9200DK AT91RM9200DK 262
280armstick ARCH_ARMSTICK ARMSTICK 263
281armonie ARCH_ARMONIE ARMONIE 264
282mport1 ARCH_MPORT1 MPORT1 265
283s3c5410 ARCH_S3C5410 S3C5410 266
284zcp320a ARCH_ZCP320A ZCP320A 267
285i_box ARCH_I_BOX I_BOX 268
286stlc1502 ARCH_STLC1502 STLC1502 269
287siren ARCH_SIREN SIREN 270
288greenlake ARCH_GREENLAKE GREENLAKE 271
289argus ARCH_ARGUS ARGUS 272
290combadge SA1100_COMBADGE COMBADGE 273
291rokepxa ARCH_ROKEPXA ROKEPXA 274
292cintegrator ARCH_CINTEGRATOR CINTEGRATOR 275 79cintegrator ARCH_CINTEGRATOR CINTEGRATOR 275
293guidea07 ARCH_GUIDEA07 GUIDEA07 276
294tat257 ARCH_TAT257 TAT257 277
295igp2425 ARCH_IGP2425 IGP2425 278
296bluegrama ARCH_BLUEGRAMMA BLUEGRAMMA 279
297ipod ARCH_IPOD IPOD 280
298adsbitsyx ARCH_ADSBITSYX ADSBITSYX 281
299trizeps2 ARCH_TRIZEPS2 TRIZEPS2 282
300viper ARCH_VIPER VIPER 283 80viper ARCH_VIPER VIPER 283
301adsbitsyplus SA1100_ADSBITSYPLUS ADSBITSYPLUS 284
302adsagc SA1100_ADSAGC ADSAGC 285
303stp7312 ARCH_STP7312 STP7312 286
304nx_phnx MACH_NX_PHNX NX_PHNX 287
305wep_ep250 ARCH_WEP_EP250 WEP_EP250 288
306inhandelf3 ARCH_INHANDELF3 INHANDELF3 289
307adi_coyote ARCH_ADI_COYOTE ADI_COYOTE 290 81adi_coyote ARCH_ADI_COYOTE ADI_COYOTE 290
308iyonix ARCH_IYONIX IYONIX 291
309damicam1 ARCH_DAMICAM_SA1110 DAMICAM_SA1110 292
310meg03 ARCH_MEG03 MEG03 293
311pxa_whitechapel ARCH_PXA_WHITECHAPEL PXA_WHITECHAPEL 294
312nwsc ARCH_NWSC NWSC 295
313nwlarm ARCH_NWLARM NWLARM 296
314ixp425_mguard ARCH_IXP425_MGUARD IXP425_MGUARD 297
315pxa_netdcu4 ARCH_PXA_NETDCU4 PXA_NETDCU4 298
316ixdp2401 ARCH_IXDP2401 IXDP2401 299 82ixdp2401 ARCH_IXDP2401 IXDP2401 299
317ixdp2801 ARCH_IXDP2801 IXDP2801 300 83ixdp2801 ARCH_IXDP2801 IXDP2801 300
318zodiac ARCH_ZODIAC ZODIAC 301
319armmodul ARCH_ARMMODUL ARMMODUL 302
320ketop SA1100_KETOP KETOP 303
321av7200 ARCH_AV7200 AV7200 304
322arch_ti925 ARCH_ARCH_TI925 ARCH_TI925 305
323acq200 ARCH_ACQ200 ACQ200 306
324pt_dafit SA1100_PT_DAFIT PT_DAFIT 307
325ihba ARCH_IHBA IHBA 308
326quinque ARCH_QUINQUE QUINQUE 309
327nimbraone ARCH_NIMBRAONE NIMBRAONE 310
328nimbra29x ARCH_NIMBRA29X NIMBRA29X 311
329nimbra210 ARCH_NIMBRA210 NIMBRA210 312
330hhp_d95xx ARCH_HHP_D95XX HHP_D95XX 313
331labarm ARCH_LABARM LABARM 314
332m825xx ARCH_M825XX M825XX 315
333m7100 SA1100_M7100 M7100 316
334nipc2 ARCH_NIPC2 NIPC2 317
335fu7202 ARCH_FU7202 FU7202 318
336adsagx ARCH_ADSAGX ADSAGX 319
337pxa_pooh ARCH_PXA_POOH PXA_POOH 320
338bandon ARCH_BANDON BANDON 321
339pcm7210 ARCH_PCM7210 PCM7210 322
340nms9200 ARCH_NMS9200 NMS9200 323
341logodl ARCH_LOGODL LOGODL 324
342m7140 SA1100_M7140 M7140 325
343korebot ARCH_KOREBOT KOREBOT 326
344iq31244 ARCH_IQ31244 IQ31244 327 84iq31244 ARCH_IQ31244 IQ31244 327
345koan393 SA1100_KOAN393 KOAN393 328
346inhandftip3 ARCH_INHANDFTIP3 INHANDFTIP3 329
347gonzo ARCH_GONZO GONZO 330
348bast ARCH_BAST BAST 331 85bast ARCH_BAST BAST 331
349scanpass ARCH_SCANPASS SCANPASS 332
350ep7312_pooh ARCH_EP7312_POOH EP7312_POOH 333
351ta7s ARCH_TA7S TA7S 334
352ta7v ARCH_TA7V TA7V 335
353icarus SA1100_ICARUS ICARUS 336
354h1900 ARCH_H1900 H1900 337
355gemini SA1100_GEMINI GEMINI 338
356axim ARCH_AXIM AXIM 339
357audiotron ARCH_AUDIOTRON AUDIOTRON 340
358h2200 ARCH_H2200 H2200 341
359loox600 ARCH_LOOX600 LOOX600 342
360niop ARCH_NIOP NIOP 343
361dm310 ARCH_DM310 DM310 344
362seedpxa_c2 ARCH_SEEDPXA_C2 SEEDPXA_C2 345
363ixp4xx_mguardpci ARCH_IXP4XX_MGUARD_PCI IXP4XX_MGUARD_PCI 346
364h1940 ARCH_H1940 H1940 347 86h1940 ARCH_H1940 H1940 347
365scorpio ARCH_SCORPIO SCORPIO 348
366viva ARCH_VIVA VIVA 349
367pxa_xcard ARCH_PXA_XCARD PXA_XCARD 350
368csb335 ARCH_CSB335 CSB335 351
369ixrd425 ARCH_IXRD425 IXRD425 352
370iq80315 ARCH_IQ80315 IQ80315 353
371nmp7312 ARCH_NMP7312 NMP7312 354
372cx861xx ARCH_CX861XX CX861XX 355
373enp2611 ARCH_ENP2611 ENP2611 356 87enp2611 ARCH_ENP2611 ENP2611 356
374xda SA1100_XDA XDA 357
375csir_ims ARCH_CSIR_IMS CSIR_IMS 358
376ixp421_dnaeeth ARCH_IXP421_DNAEETH IXP421_DNAEETH 359
377pocketserv9200 ARCH_POCKETSERV9200 POCKETSERV9200 360
378toto ARCH_TOTO TOTO 361
379s3c2440 ARCH_S3C2440 S3C2440 362 88s3c2440 ARCH_S3C2440 S3C2440 362
380ks8695p ARCH_KS8695P KS8695P 363
381se4000 ARCH_SE4000 SE4000 364
382quadriceps ARCH_QUADRICEPS QUADRICEPS 365
383bronco ARCH_BRONCO BRONCO 366
384esl_wireless_tab ARCH_ESL_WIRELESS_TAB ESL_WIRELESS_TAB 367
385esl_sofcomp ARCH_ESL_SOFCOMP ESL_SOFCOMP 368
386s5c7375 ARCH_S5C7375 S5C7375 369
387spearhead ARCH_SPEARHEAD SPEARHEAD 370
388pantera ARCH_PANTERA PANTERA 371
389prayoglite ARCH_PRAYOGLITE PRAYOGLITE 372
390gumstix ARCH_GUMSTIX GUMSTIX 373 89gumstix ARCH_GUMSTIX GUMSTIX 373
391rcube ARCH_RCUBE RCUBE 374
392rea_olv ARCH_REA_OLV REA_OLV 375
393pxa_iphone ARCH_PXA_IPHONE PXA_IPHONE 376
394s3c3410 ARCH_S3C3410 S3C3410 377
395espd_4510b ARCH_ESPD_4510B ESPD_4510B 378
396mp1x ARCH_MP1X MP1X 379
397at91rm9200tb ARCH_AT91RM9200TB AT91RM9200TB 380
398adsvgx ARCH_ADSVGX ADSVGX 381
399omap_h2 MACH_OMAP_H2 OMAP_H2 382 90omap_h2 MACH_OMAP_H2 OMAP_H2 382
400pelee ARCH_PELEE PELEE 383
401e740 MACH_E740 E740 384 91e740 MACH_E740 E740 384
402iq80331 ARCH_IQ80331 IQ80331 385 92iq80331 ARCH_IQ80331 IQ80331 385
403versatile_pb ARCH_VERSATILE_PB VERSATILE_PB 387 93versatile_pb ARCH_VERSATILE_PB VERSATILE_PB 387
404kev7a400 MACH_KEV7A400 KEV7A400 388 94kev7a400 MACH_KEV7A400 KEV7A400 388
405lpd7a400 MACH_LPD7A400 LPD7A400 389 95lpd7a400 MACH_LPD7A400 LPD7A400 389
406lpd7a404 MACH_LPD7A404 LPD7A404 390 96lpd7a404 MACH_LPD7A404 LPD7A404 390
407fujitsu_camelot ARCH_FUJITSU_CAMELOT FUJITSU_CAMELOT 391
408janus2m ARCH_JANUS2M JANUS2M 392
409embtf MACH_EMBTF EMBTF 393
410hpm MACH_HPM HPM 394
411smdk2410tk MACH_SMDK2410TK SMDK2410TK 395
412smdk2410aj MACH_SMDK2410AJ SMDK2410AJ 396
413streetracer MACH_STREETRACER STREETRACER 397
414eframe MACH_EFRAME EFRAME 398
415csb337 MACH_CSB337 CSB337 399 97csb337 MACH_CSB337 CSB337 399
416pxa_lark MACH_PXA_LARK PXA_LARK 400
417pxa_pnp2110 MACH_PNP2110 PNP2110 401
418tcc72x MACH_TCC72X TCC72X 402
419altair MACH_ALTAIR ALTAIR 403
420kc3 MACH_KC3 KC3 404
421sinteftd MACH_SINTEFTD SINTEFTD 405
422mainstone MACH_MAINSTONE MAINSTONE 406 98mainstone MACH_MAINSTONE MAINSTONE 406
423aday4x MACH_ADAY4X ADAY4X 407
424lite300 MACH_LITE300 LITE300 408
425s5c7376 MACH_S5C7376 S5C7376 409
426mt02 MACH_MT02 MT02 410
427mport3s MACH_MPORT3S MPORT3S 411
428ra_alpha MACH_RA_ALPHA RA_ALPHA 412
429xcep MACH_XCEP XCEP 413 99xcep MACH_XCEP XCEP 413
430arcom_vulcan MACH_ARCOM_VULCAN ARCOM_VULCAN 414 100arcom_vulcan MACH_ARCOM_VULCAN ARCOM_VULCAN 414
431stargate MACH_STARGATE STARGATE 415
432armadilloj MACH_ARMADILLOJ ARMADILLOJ 416
433elroy_jack MACH_ELROY_JACK ELROY_JACK 417
434backend MACH_BACKEND BACKEND 418
435s5linbox MACH_S5LINBOX S5LINBOX 419
436nomadik MACH_NOMADIK NOMADIK 420 101nomadik MACH_NOMADIK NOMADIK 420
437ia_cpu_9200 MACH_IA_CPU_9200 IA_CPU_9200 421
438at91_bja1 MACH_AT91_BJA1 AT91_BJA1 422
439corgi MACH_CORGI CORGI 423 102corgi MACH_CORGI CORGI 423
440poodle MACH_POODLE POODLE 424 103poodle MACH_POODLE POODLE 424
441ten MACH_TEN TEN 425
442roverp5p MACH_ROVERP5P ROVERP5P 426
443sc2700 MACH_SC2700 SC2700 427
444ex_eagle MACH_EX_EAGLE EX_EAGLE 428
445nx_pxa12 MACH_NX_PXA12 NX_PXA12 429
446nx_pxa5 MACH_NX_PXA5 NX_PXA5 430
447blackboard2 MACH_BLACKBOARD2 BLACKBOARD2 431
448i819 MACH_I819 I819 432
449ixmb995e MACH_IXMB995E IXMB995E 433
450skyrider MACH_SKYRIDER SKYRIDER 434
451skyhawk MACH_SKYHAWK SKYHAWK 435
452enterprise MACH_ENTERPRISE ENTERPRISE 436
453dep2410 MACH_DEP2410 DEP2410 437
454armcore MACH_ARMCORE ARMCORE 438 104armcore MACH_ARMCORE ARMCORE 438
455hobbit MACH_HOBBIT HOBBIT 439
456h7210 MACH_H7210 H7210 440
457pxa_netdcu5 MACH_PXA_NETDCU5 PXA_NETDCU5 441
458acc MACH_ACC ACC 442
459esl_sarva MACH_ESL_SARVA ESL_SARVA 443
460xm250 MACH_XM250 XM250 444
461t6tc1xb MACH_T6TC1XB T6TC1XB 445
462ess710 MACH_ESS710 ESS710 446
463mx31ads MACH_MX31ADS MX31ADS 447 105mx31ads MACH_MX31ADS MX31ADS 447
464himalaya MACH_HIMALAYA HIMALAYA 448 106himalaya MACH_HIMALAYA HIMALAYA 448
465bolfenk MACH_BOLFENK BOLFENK 449
466at91rm9200kr MACH_AT91RM9200KR AT91RM9200KR 450
467edb9312 MACH_EDB9312 EDB9312 451 107edb9312 MACH_EDB9312 EDB9312 451
468omap_generic MACH_OMAP_GENERIC OMAP_GENERIC 452 108omap_generic MACH_OMAP_GENERIC OMAP_GENERIC 452
469aximx3 MACH_AXIMX3 AXIMX3 453
470eb67xdip MACH_EB67XDIP EB67XDIP 454
471webtxs MACH_WEBTXS WEBTXS 455
472hawk MACH_HAWK HAWK 456
473ccat91sbc001 MACH_CCAT91SBC001 CCAT91SBC001 457
474expresso MACH_EXPRESSO EXPRESSO 458
475h4000 MACH_H4000 H4000 459
476dino MACH_DINO DINO 460
477ml675k MACH_ML675K ML675K 461
478edb9301 MACH_EDB9301 EDB9301 462 109edb9301 MACH_EDB9301 EDB9301 462
479edb9315 MACH_EDB9315 EDB9315 463 110edb9315 MACH_EDB9315 EDB9315 463
480reciva_tt MACH_RECIVA_TT RECIVA_TT 464
481cstcb01 MACH_CSTCB01 CSTCB01 465
482cstcb1 MACH_CSTCB1 CSTCB1 466
483shadwell MACH_SHADWELL SHADWELL 467
484goepel263 MACH_GOEPEL263 GOEPEL263 468
485acq100 MACH_ACQ100 ACQ100 469
486mx1fs2 MACH_MX1FS2 MX1FS2 470
487hiptop_g1 MACH_HIPTOP_G1 HIPTOP_G1 471
488sparky MACH_SPARKY SPARKY 472
489ns9750 MACH_NS9750 NS9750 473
490phoenix MACH_PHOENIX PHOENIX 474
491vr1000 MACH_VR1000 VR1000 475 111vr1000 MACH_VR1000 VR1000 475
492deisterpxa MACH_DEISTERPXA DEISTERPXA 476
493bcm1160 MACH_BCM1160 BCM1160 477
494pcm022 MACH_PCM022 PCM022 478
495adsgcx MACH_ADSGCX ADSGCX 479
496dreadnaught MACH_DREADNAUGHT DREADNAUGHT 480
497dm320 MACH_DM320 DM320 481
498markov MACH_MARKOV MARKOV 482
499cos7a400 MACH_COS7A400 COS7A400 483
500milano MACH_MILANO MILANO 484
501ue9328 MACH_UE9328 UE9328 485
502uex255 MACH_UEX255 UEX255 486
503ue2410 MACH_UE2410 UE2410 487
504a620 MACH_A620 A620 488
505ocelot MACH_OCELOT OCELOT 489
506cheetah MACH_CHEETAH CHEETAH 490
507omap_perseus2 MACH_OMAP_PERSEUS2 OMAP_PERSEUS2 491 112omap_perseus2 MACH_OMAP_PERSEUS2 OMAP_PERSEUS2 491
508zvue MACH_ZVUE ZVUE 492
509roverp1 MACH_ROVERP1 ROVERP1 493
510asidial2 MACH_ASIDIAL2 ASIDIAL2 494
511s3c24a0 MACH_S3C24A0 S3C24A0 495
512e800 MACH_E800 E800 496 113e800 MACH_E800 E800 496
513e750 MACH_E750 E750 497 114e750 MACH_E750 E750 497
514s3c5500 MACH_S3C5500 S3C5500 498
515smdk5500 MACH_SMDK5500 SMDK5500 499
516signalsync MACH_SIGNALSYNC SIGNALSYNC 500
517nbc MACH_NBC NBC 501
518kodiak MACH_KODIAK KODIAK 502
519netbookpro MACH_NETBOOKPRO NETBOOKPRO 503
520hw90200 MACH_HW90200 HW90200 504
521condor MACH_CONDOR CONDOR 505
522cup MACH_CUP CUP 506
523kite MACH_KITE KITE 507
524scb9328 MACH_SCB9328 SCB9328 508 115scb9328 MACH_SCB9328 SCB9328 508
525omap_h3 MACH_OMAP_H3 OMAP_H3 509 116omap_h3 MACH_OMAP_H3 OMAP_H3 509
526omap_h4 MACH_OMAP_H4 OMAP_H4 510 117omap_h4 MACH_OMAP_H4 OMAP_H4 510
527n10 MACH_N10 N10 511
528montejade MACH_MONTAJADE MONTAJADE 512
529sg560 MACH_SG560 SG560 513
530dp1000 MACH_DP1000 DP1000 514
531omap_osk MACH_OMAP_OSK OMAP_OSK 515 118omap_osk MACH_OMAP_OSK OMAP_OSK 515
532rg100v3 MACH_RG100V3 RG100V3 516
533mx2ads MACH_MX2ADS MX2ADS 517
534pxa_kilo MACH_PXA_KILO PXA_KILO 518
535ixp4xx_eagle MACH_IXP4XX_EAGLE IXP4XX_EAGLE 519
536tosa MACH_TOSA TOSA 520 119tosa MACH_TOSA TOSA 520
537mb2520f MACH_MB2520F MB2520F 521
538emc1000 MACH_EMC1000 EMC1000 522
539tidsc25 MACH_TIDSC25 TIDSC25 523
540akcpmxl MACH_AKCPMXL AKCPMXL 524
541av3xx MACH_AV3XX AV3XX 525
542avila MACH_AVILA AVILA 526 120avila MACH_AVILA AVILA 526
543pxa_mpm10 MACH_PXA_MPM10 PXA_MPM10 527
544pxa_kyanite MACH_PXA_KYANITE PXA_KYANITE 528
545sgold MACH_SGOLD SGOLD 529
546oscar MACH_OSCAR OSCAR 530
547epxa4usb2 MACH_EPXA4USB2 EPXA4USB2 531
548xsengine MACH_XSENGINE XSENGINE 532
549ip600 MACH_IP600 IP600 533
550mcan2 MACH_MCAN2 MCAN2 534
551ddi_blueridge MACH_DDI_BLUERIDGE DDI_BLUERIDGE 535
552skyminder MACH_SKYMINDER SKYMINDER 536
553lpd79520 MACH_LPD79520 LPD79520 537
554edb9302 MACH_EDB9302 EDB9302 538 121edb9302 MACH_EDB9302 EDB9302 538
555hw90340 MACH_HW90340 HW90340 539
556cip_box MACH_CIP_BOX CIP_BOX 540
557ivpn MACH_IVPN IVPN 541
558rsoc2 MACH_RSOC2 RSOC2 542
559husky MACH_HUSKY HUSKY 543 122husky MACH_HUSKY HUSKY 543
560boxer MACH_BOXER BOXER 544
561shepherd MACH_SHEPHERD SHEPHERD 545 123shepherd MACH_SHEPHERD SHEPHERD 545
562aml42800aa MACH_AML42800AA AML42800AA 546
563lpc2294 MACH_LPC2294 LPC2294 548
564switchgrass MACH_SWITCHGRASS SWITCHGRASS 549
565ens_cmu MACH_ENS_CMU ENS_CMU 550
566mm6_sdb MACH_MM6_SDB MM6_SDB 551
567saturn MACH_SATURN SATURN 552
568i30030evb MACH_I30030EVB I30030EVB 553
569mxc27530evb MACH_MXC27530EVB MXC27530EVB 554
570smdk2800 MACH_SMDK2800 SMDK2800 555
571mtwilson MACH_MTWILSON MTWILSON 556
572ziti MACH_ZITI ZITI 557
573grandfather MACH_GRANDFATHER GRANDFATHER 558
574tengine MACH_TENGINE TENGINE 559
575s3c2460 MACH_S3C2460 S3C2460 560
576pdm MACH_PDM PDM 561
577h4700 MACH_H4700 H4700 562 124h4700 MACH_H4700 H4700 562
578h6300 MACH_H6300 H6300 563
579rz1700 MACH_RZ1700 RZ1700 564
580a716 MACH_A716 A716 565
581estk2440a MACH_ESTK2440A ESTK2440A 566
582atwixp425 MACH_ATWIXP425 ATWIXP425 567
583csb336 MACH_CSB336 CSB336 568
584rirm2 MACH_RIRM2 RIRM2 569
585cx23518 MACH_CX23518 CX23518 570
586cx2351x MACH_CX2351X CX2351X 571
587computime MACH_COMPUTIME COMPUTIME 572
588izarus MACH_IZARUS IZARUS 573
589pxa_rts MACH_RTS RTS 574
590se5100 MACH_SE5100 SE5100 575
591s3c2510 MACH_S3C2510 S3C2510 576
592csb437tl MACH_CSB437TL CSB437TL 577
593slauson MACH_SLAUSON SLAUSON 578
594pearlriver MACH_PEARLRIVER PEARLRIVER 579
595tdc_p210 MACH_TDC_P210 TDC_P210 580
596sg580 MACH_SG580 SG580 581
597wrsbcarm7 MACH_WRSBCARM7 WRSBCARM7 582
598ipd MACH_IPD IPD 583
599pxa_dnp2110 MACH_PXA_DNP2110 PXA_DNP2110 584
600xaeniax MACH_XAENIAX XAENIAX 585
601somn4250 MACH_SOMN4250 SOMN4250 586
602pleb2 MACH_PLEB2 PLEB2 587
603cornwallis MACH_CORNWALLIS CORNWALLIS 588
604gurney_drv MACH_GURNEY_DRV GURNEY_DRV 589
605chaffee MACH_CHAFFEE CHAFFEE 590
606rms101 MACH_RMS101 RMS101 591
607rx3715 MACH_RX3715 RX3715 592 125rx3715 MACH_RX3715 RX3715 592
608swift MACH_SWIFT SWIFT 593
609roverp7 MACH_ROVERP7 ROVERP7 594
610pr818s MACH_PR818S PR818S 595
611trxpro MACH_TRXPRO TRXPRO 596
612nslu2 MACH_NSLU2 NSLU2 597 126nslu2 MACH_NSLU2 NSLU2 597
613e400 MACH_E400 E400 598 127e400 MACH_E400 E400 598
614trab MACH_TRAB TRAB 599
615cmc_pu2 MACH_CMC_PU2 CMC_PU2 600
616fulcrum MACH_FULCRUM FULCRUM 601
617netgate42x MACH_NETGATE42X NETGATE42X 602
618str710 MACH_STR710 STR710 603
619ixdpg425 MACH_IXDPG425 IXDPG425 604 128ixdpg425 MACH_IXDPG425 IXDPG425 604
620tomtomgo MACH_TOMTOMGO TOMTOMGO 605
621versatile_ab MACH_VERSATILE_AB VERSATILE_AB 606 129versatile_ab MACH_VERSATILE_AB VERSATILE_AB 606
622edb9307 MACH_EDB9307 EDB9307 607 130edb9307 MACH_EDB9307 EDB9307 607
623sg565 MACH_SG565 SG565 608
624lpd79524 MACH_LPD79524 LPD79524 609
625lpd79525 MACH_LPD79525 LPD79525 610
626rms100 MACH_RMS100 RMS100 611
627kb9200 MACH_KB9200 KB9200 612 131kb9200 MACH_KB9200 KB9200 612
628sx1 MACH_SX1 SX1 613 132sx1 MACH_SX1 SX1 613
629hms39c7092 MACH_HMS39C7092 HMS39C7092 614
630armadillo MACH_ARMADILLO ARMADILLO 615
631ipcu MACH_IPCU IPCU 616
632loox720 MACH_LOOX720 LOOX720 617
633ixdp465 MACH_IXDP465 IXDP465 618 133ixdp465 MACH_IXDP465 IXDP465 618
634ixdp2351 MACH_IXDP2351 IXDP2351 619 134ixdp2351 MACH_IXDP2351 IXDP2351 619
635adsvix MACH_ADSVIX ADSVIX 620
636dm270 MACH_DM270 DM270 621
637socltplus MACH_SOCLTPLUS SOCLTPLUS 622
638ecia MACH_ECIA ECIA 623
639cm4008 MACH_CM4008 CM4008 624
640p2001 MACH_P2001 P2001 625
641twister MACH_TWISTER TWISTER 626
642mudshark MACH_MUDSHARK MUDSHARK 627
643hb2 MACH_HB2 HB2 628
644iq80332 MACH_IQ80332 IQ80332 629 135iq80332 MACH_IQ80332 IQ80332 629
645sendt MACH_SENDT SENDT 630
646mx2jazz MACH_MX2JAZZ MX2JAZZ 631
647multiio MACH_MULTIIO MULTIIO 632
648hrdisplay MACH_HRDISPLAY HRDISPLAY 633
649mxc27530ads MACH_MXC27530ADS MXC27530ADS 634
650trizeps3 MACH_TRIZEPS3 TRIZEPS3 635
651zefeerdza MACH_ZEFEERDZA ZEFEERDZA 636
652zefeerdzb MACH_ZEFEERDZB ZEFEERDZB 637
653zefeerdzg MACH_ZEFEERDZG ZEFEERDZG 638
654zefeerdzn MACH_ZEFEERDZN ZEFEERDZN 639
655zefeerdzq MACH_ZEFEERDZQ ZEFEERDZQ 640
656gtwx5715 MACH_GTWX5715 GTWX5715 641 136gtwx5715 MACH_GTWX5715 GTWX5715 641
657astro_jack MACH_ASTRO_JACK ASTRO_JACK 643
658tip03 MACH_TIP03 TIP03 644
659a9200ec MACH_A9200EC A9200EC 645
660pnx0105 MACH_PNX0105 PNX0105 646
661adcpoecpu MACH_ADCPOECPU ADCPOECPU 647
662csb637 MACH_CSB637 CSB637 648 137csb637 MACH_CSB637 CSB637 648
663mb9200 MACH_MB9200 MB9200 650
664kulun MACH_KULUN KULUN 651
665snapper MACH_SNAPPER SNAPPER 652
666optima MACH_OPTIMA OPTIMA 653
667dlhsbc MACH_DLHSBC DLHSBC 654
668x30 MACH_X30 X30 655
669n30 MACH_N30 N30 656 138n30 MACH_N30 N30 656
670manga_ks8695 MACH_MANGA_KS8695 MANGA_KS8695 657
671ajax MACH_AJAX AJAX 658
672nec_mp900 MACH_NEC_MP900 NEC_MP900 659 139nec_mp900 MACH_NEC_MP900 NEC_MP900 659
673vvtk1000 MACH_VVTK1000 VVTK1000 661
674kafa MACH_KAFA KAFA 662 140kafa MACH_KAFA KAFA 662
675vvtk3000 MACH_VVTK3000 VVTK3000 663
676pimx1 MACH_PIMX1 PIMX1 664
677ollie MACH_OLLIE OLLIE 665
678skymax MACH_SKYMAX SKYMAX 666
679jazz MACH_JAZZ JAZZ 667
680tel_t3 MACH_TEL_T3 TEL_T3 668
681aisino_fcr255 MACH_AISINO_FCR255 AISINO_FCR255 669
682btweb MACH_BTWEB BTWEB 670
683dbg_lh79520 MACH_DBG_LH79520 DBG_LH79520 671
684cm41xx MACH_CM41XX CM41XX 672
685ts72xx MACH_TS72XX TS72XX 673 141ts72xx MACH_TS72XX TS72XX 673
686nggpxa MACH_NGGPXA NGGPXA 674
687csb535 MACH_CSB535 CSB535 675
688csb536 MACH_CSB536 CSB536 676
689pxa_trakpod MACH_PXA_TRAKPOD PXA_TRAKPOD 677
690praxis MACH_PRAXIS PRAXIS 678
691lh75411 MACH_LH75411 LH75411 679
692otom MACH_OTOM OTOM 680 142otom MACH_OTOM OTOM 680
693nexcoder_2440 MACH_NEXCODER_2440 NEXCODER_2440 681 143nexcoder_2440 MACH_NEXCODER_2440 NEXCODER_2440 681
694loox410 MACH_LOOX410 LOOX410 682
695westlake MACH_WESTLAKE WESTLAKE 683
696nsb MACH_NSB NSB 684
697esl_sarva_stn MACH_ESL_SARVA_STN ESL_SARVA_STN 685
698esl_sarva_tft MACH_ESL_SARVA_TFT ESL_SARVA_TFT 686
699esl_sarva_iad MACH_ESL_SARVA_IAD ESL_SARVA_IAD 687
700esl_sarva_acc MACH_ESL_SARVA_ACC ESL_SARVA_ACC 688
701typhoon MACH_TYPHOON TYPHOON 689
702cnav MACH_CNAV CNAV 690
703a730 MACH_A730 A730 691
704netstar MACH_NETSTAR NETSTAR 692
705supercon MACH_PHASEFALE_SUPERCON PHASEFALE_SUPERCON 693
706shiva1100 MACH_SHIVA1100 SHIVA1100 694
707etexsc MACH_ETEXSC ETEXSC 695
708ixdpg465 MACH_IXDPG465 IXDPG465 696
709a9m2410 MACH_A9M2410 A9M2410 697
710a9m2440 MACH_A9M2440 A9M2440 698
711a9m9750 MACH_A9M9750 A9M9750 699
712a9m9360 MACH_A9M9360 A9M9360 700
713unc90 MACH_UNC90 UNC90 701
714eco920 MACH_ECO920 ECO920 702 144eco920 MACH_ECO920 ECO920 702
715satview MACH_SATVIEW SATVIEW 703
716roadrunner MACH_ROADRUNNER ROADRUNNER 704 145roadrunner MACH_ROADRUNNER ROADRUNNER 704
717at91rm9200ek MACH_AT91RM9200EK AT91RM9200EK 705 146at91rm9200ek MACH_AT91RM9200EK AT91RM9200EK 705
718gp32 MACH_GP32 GP32 706
719gem MACH_GEM GEM 707
720i858 MACH_I858 I858 708
721hx2750 MACH_HX2750 HX2750 709
722mxc91131evb MACH_MXC91131EVB MXC91131EVB 710
723p700 MACH_P700 P700 711
724cpe MACH_CPE CPE 712
725spitz MACH_SPITZ SPITZ 713 147spitz MACH_SPITZ SPITZ 713
726nimbra340 MACH_NIMBRA340 NIMBRA340 714
727lpc22xx MACH_LPC22XX LPC22XX 715
728omap_comet3 MACH_COMET3 COMET3 716
729omap_comet4 MACH_COMET4 COMET4 717
730csb625 MACH_CSB625 CSB625 718
731fortunet2 MACH_FORTUNET2 FORTUNET2 719
732s5h2200 MACH_S5H2200 S5H2200 720
733optorm920 MACH_OPTORM920 OPTORM920 721
734adsbitsyxb MACH_ADSBITSYXB ADSBITSYXB 722
735adssphere MACH_ADSSPHERE ADSSPHERE 723 148adssphere MACH_ADSSPHERE ADSSPHERE 723
736adsportal MACH_ADSPORTAL ADSPORTAL 724
737ln2410sbc MACH_LN2410SBC LN2410SBC 725
738cb3rufc MACH_CB3RUFC CB3RUFC 726
739mp2usb MACH_MP2USB MP2USB 727
740ntnp425c MACH_NTNP425C NTNP425C 728
741colibri MACH_COLIBRI COLIBRI 729 149colibri MACH_COLIBRI COLIBRI 729
742pcm7220 MACH_PCM7220 PCM7220 730
743gateway7001 MACH_GATEWAY7001 GATEWAY7001 731 150gateway7001 MACH_GATEWAY7001 GATEWAY7001 731
744pcm027 MACH_PCM027 PCM027 732 151pcm027 MACH_PCM027 PCM027 732
745cmpxa MACH_CMPXA CMPXA 733
746anubis MACH_ANUBIS ANUBIS 734 152anubis MACH_ANUBIS ANUBIS 734
747ite8152 MACH_ITE8152 ITE8152 735
748lpc3xxx MACH_LPC3XXX LPC3XXX 736
749puppeteer MACH_PUPPETEER PUPPETEER 737
750e570 MACH_E570 E570 739
751x50 MACH_X50 X50 740
752recon MACH_RECON RECON 741
753xboardgp8 MACH_XBOARDGP8 XBOARDGP8 742
754fpic2 MACH_FPIC2 FPIC2 743
755akita MACH_AKITA AKITA 744 153akita MACH_AKITA AKITA 744
756a81 MACH_A81 A81 745
757svm_sc25x MACH_SVM_SC25X SVM_SC25X 746
758vt020 MACH_VADATECH020 VADATECH020 747
759tli MACH_TLI TLI 748
760edb9315lc MACH_EDB9315LC EDB9315LC 749
761passec MACH_PASSEC PASSEC 750
762ds_tiger MACH_DS_TIGER DS_TIGER 751
763e310 MACH_E310 E310 752
764e330 MACH_E330 E330 753 154e330 MACH_E330 E330 753
765rt3000 MACH_RT3000 RT3000 754
766nokia770 MACH_NOKIA770 NOKIA770 755 155nokia770 MACH_NOKIA770 NOKIA770 755
767pnx0106 MACH_PNX0106 PNX0106 756
768hx21xx MACH_HX21XX HX21XX 757
769faraday MACH_FARADAY FARADAY 758
770sbc9312 MACH_SBC9312 SBC9312 759
771batman MACH_BATMAN BATMAN 760
772jpd201 MACH_JPD201 JPD201 761
773mipsa MACH_MIPSA MIPSA 762
774kacom MACH_KACOM KACOM 763
775swarcocpu MACH_SWARCOCPU SWARCOCPU 764
776swarcodsl MACH_SWARCODSL SWARCODSL 765
777blueangel MACH_BLUEANGEL BLUEANGEL 766
778hairygrama MACH_HAIRYGRAMA HAIRYGRAMA 767
779banff MACH_BANFF BANFF 768
780carmeva MACH_CARMEVA CARMEVA 769 156carmeva MACH_CARMEVA CARMEVA 769
781sam255 MACH_SAM255 SAM255 770
782ppm10 MACH_PPM10 PPM10 771
783edb9315a MACH_EDB9315A EDB9315A 772 157edb9315a MACH_EDB9315A EDB9315A 772
784sunset MACH_SUNSET SUNSET 773
785stargate2 MACH_STARGATE2 STARGATE2 774 158stargate2 MACH_STARGATE2 STARGATE2 774
786intelmote2 MACH_INTELMOTE2 INTELMOTE2 775 159intelmote2 MACH_INTELMOTE2 INTELMOTE2 775
787trizeps4 MACH_TRIZEPS4 TRIZEPS4 776 160trizeps4 MACH_TRIZEPS4 TRIZEPS4 776
788mainstone2 MACH_MAINSTONE2 MAINSTONE2 777
789ez_ixp42x MACH_EZ_IXP42X EZ_IXP42X 778
790tapwave_zodiac MACH_TAPWAVE_ZODIAC TAPWAVE_ZODIAC 779
791universalmeter MACH_UNIVERSALMETER UNIVERSALMETER 780
792hicoarm9 MACH_HICOARM9 HICOARM9 781
793pnx4008 MACH_PNX4008 PNX4008 782 161pnx4008 MACH_PNX4008 PNX4008 782
794kws6000 MACH_KWS6000 KWS6000 783
795portux920t MACH_PORTUX920T PORTUX920T 784
796ez_x5 MACH_EZ_X5 EZ_X5 785
797omap_rudolph MACH_OMAP_RUDOLPH OMAP_RUDOLPH 786
798cpuat91 MACH_CPUAT91 CPUAT91 787 162cpuat91 MACH_CPUAT91 CPUAT91 787
799rea9200 MACH_REA9200 REA9200 788
800acts_pune_sa1110 MACH_ACTS_PUNE_SA1110 ACTS_PUNE_SA1110 789
801ixp425 MACH_IXP425 IXP425 790
802i30030ads MACH_I30030ADS I30030ADS 791
803perch MACH_PERCH PERCH 792
804eis05r1 MACH_EIS05R1 EIS05R1 793
805pepperpad MACH_PEPPERPAD PEPPERPAD 794
806sb3010 MACH_SB3010 SB3010 795
807rm9200 MACH_RM9200 RM9200 796
808dma03 MACH_DMA03 DMA03 797
809road_s101 MACH_ROAD_S101 ROAD_S101 798
810iq81340sc MACH_IQ81340SC IQ81340SC 799 163iq81340sc MACH_IQ81340SC IQ81340SC 799
811iq_nextgen_b MACH_IQ_NEXTGEN_B IQ_NEXTGEN_B 800
812iq81340mc MACH_IQ81340MC IQ81340MC 801 164iq81340mc MACH_IQ81340MC IQ81340MC 801
813iq_nextgen_d MACH_IQ_NEXTGEN_D IQ_NEXTGEN_D 802
814iq_nextgen_e MACH_IQ_NEXTGEN_E IQ_NEXTGEN_E 803
815mallow_at91 MACH_MALLOW_AT91 MALLOW_AT91 804
816cybertracker_i MACH_CYBERTRACKER_I CYBERTRACKER_I 805
817gesbc931x MACH_GESBC931X GESBC931X 806
818centipad MACH_CENTIPAD CENTIPAD 807
819armsoc MACH_ARMSOC ARMSOC 808
820se4200 MACH_SE4200 SE4200 809
821ems197a MACH_EMS197A EMS197A 810
822micro9 MACH_MICRO9 MICRO9 811 165micro9 MACH_MICRO9 MICRO9 811
823micro9l MACH_MICRO9L MICRO9L 812 166micro9l MACH_MICRO9L MICRO9L 812
824uc5471dsp MACH_UC5471DSP UC5471DSP 813
825sj5471eng MACH_SJ5471ENG SJ5471ENG 814
826none MACH_CMPXA26X CMPXA26X 815
827nc1 MACH_NC NC 816
828omap_palmte MACH_OMAP_PALMTE OMAP_PALMTE 817 167omap_palmte MACH_OMAP_PALMTE OMAP_PALMTE 817
829ajax52x MACH_AJAX52X AJAX52X 818
830siriustar MACH_SIRIUSTAR SIRIUSTAR 819
831iodata_hdlg MACH_IODATA_HDLG IODATA_HDLG 820
832at91rm9200utl MACH_AT91RM9200UTL AT91RM9200UTL 821
833biosafe MACH_BIOSAFE BIOSAFE 822
834mp1000 MACH_MP1000 MP1000 823
835parsy MACH_PARSY PARSY 824
836ccxp270 MACH_CCXP CCXP 825
837omap_gsample MACH_OMAP_GSAMPLE OMAP_GSAMPLE 826
838realview_eb MACH_REALVIEW_EB REALVIEW_EB 827 168realview_eb MACH_REALVIEW_EB REALVIEW_EB 827
839samoa MACH_SAMOA SAMOA 828
840palmt3 MACH_PALMT3 PALMT3 829
841i878 MACH_I878 I878 830
842borzoi MACH_BORZOI BORZOI 831 169borzoi MACH_BORZOI BORZOI 831
843gecko MACH_GECKO GECKO 832
844ds101 MACH_DS101 DS101 833
845omap_palmtt2 MACH_OMAP_PALMTT2 OMAP_PALMTT2 834
846palmld MACH_PALMLD PALMLD 835 170palmld MACH_PALMLD PALMLD 835
847cc9c MACH_CC9C CC9C 836
848sbc1670 MACH_SBC1670 SBC1670 837
849ixdp28x5 MACH_IXDP28X5 IXDP28X5 838 171ixdp28x5 MACH_IXDP28X5 IXDP28X5 838
850omap_palmtt MACH_OMAP_PALMTT OMAP_PALMTT 839 172omap_palmtt MACH_OMAP_PALMTT OMAP_PALMTT 839
851ml696k MACH_ML696K ML696K 840
852arcom_zeus MACH_ARCOM_ZEUS ARCOM_ZEUS 841 173arcom_zeus MACH_ARCOM_ZEUS ARCOM_ZEUS 841
853osiris MACH_OSIRIS OSIRIS 842 174osiris MACH_OSIRIS OSIRIS 842
854maestro MACH_MAESTRO MAESTRO 843
855palmte2 MACH_PALMTE2 PALMTE2 844 175palmte2 MACH_PALMTE2 PALMTE2 844
856ixbbm MACH_IXBBM IXBBM 845
857mx27ads MACH_MX27ADS MX27ADS 846 176mx27ads MACH_MX27ADS MX27ADS 846
858ax8004 MACH_AX8004 AX8004 847
859at91sam9261ek MACH_AT91SAM9261EK AT91SAM9261EK 848 177at91sam9261ek MACH_AT91SAM9261EK AT91SAM9261EK 848
860loft MACH_LOFT LOFT 849 178loft MACH_LOFT LOFT 849
861magpie MACH_MAGPIE MAGPIE 850
862mx21ads MACH_MX21ADS MX21ADS 851 179mx21ads MACH_MX21ADS MX21ADS 851
863mb87m3400 MACH_MB87M3400 MB87M3400 852
864mguard_delta MACH_MGUARD_DELTA MGUARD_DELTA 853
865davinci_dvdp MACH_DAVINCI_DVDP DAVINCI_DVDP 854
866htcuniversal MACH_HTCUNIVERSAL HTCUNIVERSAL 855
867tpad MACH_TPAD TPAD 856
868roverp3 MACH_ROVERP3 ROVERP3 857
869jornada928 MACH_JORNADA928 JORNADA928 858
870mv88fxx81 MACH_MV88FXX81 MV88FXX81 859
871stmp36xx MACH_STMP36XX STMP36XX 860
872sxni79524 MACH_SXNI79524 SXNI79524 861
873ams_delta MACH_AMS_DELTA AMS_DELTA 862 180ams_delta MACH_AMS_DELTA AMS_DELTA 862
874uranium MACH_URANIUM URANIUM 863
875ucon MACH_UCON UCON 864
876nas100d MACH_NAS100D NAS100D 865 181nas100d MACH_NAS100D NAS100D 865
877l083 MACH_L083_1000 L083_1000 866
878ezx MACH_EZX EZX 867
879pnx5220 MACH_PNX5220 PNX5220 868
880butte MACH_BUTTE BUTTE 869
881srm2 MACH_SRM2 SRM2 870
882dsbr MACH_DSBR DSBR 871
883crystalball MACH_CRYSTALBALL CRYSTALBALL 872
884tinypxa27x MACH_TINYPXA27X TINYPXA27X 873
885herbie MACH_HERBIE HERBIE 874
886magician MACH_MAGICIAN MAGICIAN 875 182magician MACH_MAGICIAN MAGICIAN 875
887cm4002 MACH_CM4002 CM4002 876
888b4 MACH_B4 B4 877
889maui MACH_MAUI MAUI 878
890cybertracker_g MACH_CYBERTRACKER_G CYBERTRACKER_G 879
891nxdkn MACH_NXDKN NXDKN 880 183nxdkn MACH_NXDKN NXDKN 880
892mio8390 MACH_MIO8390 MIO8390 881
893omi_board MACH_OMI_BOARD OMI_BOARD 882
894mx21civ MACH_MX21CIV MX21CIV 883
895mahi_cdac MACH_MAHI_CDAC MAHI_CDAC 884
896palmtx MACH_PALMTX PALMTX 885 184palmtx MACH_PALMTX PALMTX 885
897s3c2413 MACH_S3C2413 S3C2413 887 185s3c2413 MACH_S3C2413 S3C2413 887
898samsys_ep0 MACH_SAMSYS_EP0 SAMSYS_EP0 888
899wg302v1 MACH_WG302V1 WG302V1 889
900wg302v2 MACH_WG302V2 WG302V2 890 186wg302v2 MACH_WG302V2 WG302V2 890
901eb42x MACH_EB42X EB42X 891
902iq331es MACH_IQ331ES IQ331ES 892
903cosydsp MACH_COSYDSP COSYDSP 893
904uplat7d_proto MACH_UPLAT7D UPLAT7D 894
905ptdavinci MACH_PTDAVINCI PTDAVINCI 895
906mbus MACH_MBUS MBUS 896
907nadia2vb MACH_NADIA2VB NADIA2VB 897
908r1000 MACH_R1000 R1000 898
909hw90250 MACH_HW90250 HW90250 899
910omap_2430sdp MACH_OMAP_2430SDP OMAP_2430SDP 900 187omap_2430sdp MACH_OMAP_2430SDP OMAP_2430SDP 900
911davinci_evm MACH_DAVINCI_EVM DAVINCI_EVM 901 188davinci_evm MACH_DAVINCI_EVM DAVINCI_EVM 901
912omap_tornado MACH_OMAP_TORNADO OMAP_TORNADO 902
913olocreek MACH_OLOCREEK OLOCREEK 903
914palmz72 MACH_PALMZ72 PALMZ72 904 189palmz72 MACH_PALMZ72 PALMZ72 904
915nxdb500 MACH_NXDB500 NXDB500 905 190nxdb500 MACH_NXDB500 NXDB500 905
916apf9328 MACH_APF9328 APF9328 906
917omap_wipoq MACH_OMAP_WIPOQ OMAP_WIPOQ 907
918omap_twip MACH_OMAP_TWIP OMAP_TWIP 908
919treo650 MACH_TREO650 TREO650 909
920acumen MACH_ACUMEN ACUMEN 910
921xp100 MACH_XP100 XP100 911
922fs2410 MACH_FS2410 FS2410 912
923pxa270_cerf MACH_PXA270_CERF PXA270_CERF 913
924sq2ftlpalm MACH_SQ2FTLPALM SQ2FTLPALM 914
925bsemserver MACH_BSEMSERVER BSEMSERVER 915
926netclient MACH_NETCLIENT NETCLIENT 916
927palmt5 MACH_PALMT5 PALMT5 917 191palmt5 MACH_PALMT5 PALMT5 917
928palmtc MACH_PALMTC PALMTC 918 192palmtc MACH_PALMTC PALMTC 918
929omap_apollon MACH_OMAP_APOLLON OMAP_APOLLON 919 193omap_apollon MACH_OMAP_APOLLON OMAP_APOLLON 919
930mxc30030evb MACH_MXC30030EVB MXC30030EVB 920
931rea_cpu2 MACH_REA_2D REA_2D 921
932eti3e524 MACH_TI3E524 TI3E524 922
933ateb9200 MACH_ATEB9200 ATEB9200 923 194ateb9200 MACH_ATEB9200 ATEB9200 923
934auckland MACH_AUCKLAND AUCKLAND 924
935ak3220m MACH_AK3320M AK3320M 925
936duramax MACH_DURAMAX DURAMAX 926
937n35 MACH_N35 N35 927 195n35 MACH_N35 N35 927
938pronghorn MACH_PRONGHORN PRONGHORN 928
939fundy MACH_FUNDY FUNDY 929
940logicpd_pxa270 MACH_LOGICPD_PXA270 LOGICPD_PXA270 930 196logicpd_pxa270 MACH_LOGICPD_PXA270 LOGICPD_PXA270 930
941cpu777 MACH_CPU777 CPU777 931
942simicon9201 MACH_SIMICON9201 SIMICON9201 932
943leap2_hpm MACH_LEAP2_HPM LEAP2_HPM 933
944cm922txa10 MACH_CM922TXA10 CM922TXA10 934
945sandgate MACH_PXA PXA 935
946sandgate2 MACH_SANDGATE2 SANDGATE2 936
947sandgate2g MACH_SANDGATE2G SANDGATE2G 937
948sandgate2p MACH_SANDGATE2P SANDGATE2P 938
949fred_jack MACH_FRED_JACK FRED_JACK 939
950ttg_color1 MACH_TTG_COLOR1 TTG_COLOR1 940
951nxeb500hmi MACH_NXEB500HMI NXEB500HMI 941 197nxeb500hmi MACH_NXEB500HMI NXEB500HMI 941
952netdcu8 MACH_NETDCU8 NETDCU8 942
953ng_fvx538 MACH_NG_FVX538 NG_FVX538 944
954ng_fvs338 MACH_NG_FVS338 NG_FVS338 945
955pnx4103 MACH_PNX4103 PNX4103 946
956hesdb MACH_HESDB HESDB 947
957xsilo MACH_XSILO XSILO 948
958espresso MACH_ESPRESSO ESPRESSO 949 198espresso MACH_ESPRESSO ESPRESSO 949
959emlc MACH_EMLC EMLC 950
960sisteron MACH_SISTERON SISTERON 951
961rx1950 MACH_RX1950 RX1950 952 199rx1950 MACH_RX1950 RX1950 952
962tsc_venus MACH_TSC_VENUS TSC_VENUS 953
963ds101j MACH_DS101J DS101J 954
964mxc30030ads MACH_MXC30030ADS MXC30030ADS 955
965fujitsu_wimaxsoc MACH_FUJITSU_WIMAXSOC FUJITSU_WIMAXSOC 956
966dualpcmodem MACH_DUALPCMODEM DUALPCMODEM 957
967gesbc9312 MACH_GESBC9312 GESBC9312 958 200gesbc9312 MACH_GESBC9312 GESBC9312 958
968htcapache MACH_HTCAPACHE HTCAPACHE 959
969ixdp435 MACH_IXDP435 IXDP435 960
970catprovt100 MACH_CATPROVT100 CATPROVT100 961
971picotux1xx MACH_PICOTUX1XX PICOTUX1XX 962
972picotux2xx MACH_PICOTUX2XX PICOTUX2XX 963 201picotux2xx MACH_PICOTUX2XX PICOTUX2XX 963
973dsmg600 MACH_DSMG600 DSMG600 964 202dsmg600 MACH_DSMG600 DSMG600 964
974empc2 MACH_EMPC2 EMPC2 965
975ventura MACH_VENTURA VENTURA 966
976phidget_sbc MACH_PHIDGET_SBC PHIDGET_SBC 967
977ij3k MACH_IJ3K IJ3K 968
978pisgah MACH_PISGAH PISGAH 969
979omap_fsample MACH_OMAP_FSAMPLE OMAP_FSAMPLE 970 203omap_fsample MACH_OMAP_FSAMPLE OMAP_FSAMPLE 970
980sg720 MACH_SG720 SG720 971
981redfox MACH_REDFOX REDFOX 972
982mysh_ep9315_1 MACH_MYSH_EP9315_1 MYSH_EP9315_1 973
983tpf106 MACH_TPF106 TPF106 974
984at91rm9200kg MACH_AT91RM9200KG AT91RM9200KG 975
985rcmt2 MACH_SLEDB SLEDB 976
986ontrack MACH_ONTRACK ONTRACK 977
987pm1200 MACH_PM1200 PM1200 978
988ess24562 MACH_ESS24XXX ESS24XXX 979
989coremp7 MACH_COREMP7 COREMP7 980
990nexcoder_6446 MACH_NEXCODER_6446 NEXCODER_6446 981
991stvc8380 MACH_STVC8380 STVC8380 982
992teklynx MACH_TEKLYNX TEKLYNX 983
993carbonado MACH_CARBONADO CARBONADO 984
994sysmos_mp730 MACH_SYSMOS_MP730 SYSMOS_MP730 985
995snapper_cl15 MACH_SNAPPER_CL15 SNAPPER_CL15 986 204snapper_cl15 MACH_SNAPPER_CL15 SNAPPER_CL15 986
996pgigim MACH_PGIGIM PGIGIM 987
997ptx9160p2 MACH_PTX9160P2 PTX9160P2 988
998dcore1 MACH_DCORE1 DCORE1 989
999victorpxa MACH_VICTORPXA VICTORPXA 990
1000mx2dtb MACH_MX2DTB MX2DTB 991
1001pxa_irex_er0100 MACH_PXA_IREX_ER0100 PXA_IREX_ER0100 992
1002omap_palmz71 MACH_OMAP_PALMZ71 OMAP_PALMZ71 993 205omap_palmz71 MACH_OMAP_PALMZ71 OMAP_PALMZ71 993
1003bartec_deg MACH_BARTEC_DEG BARTEC_DEG 994
1004hw50251 MACH_HW50251 HW50251 995
1005ibox MACH_IBOX IBOX 996
1006atlaslh7a404 MACH_ATLASLH7A404 ATLASLH7A404 997
1007pt2026 MACH_PT2026 PT2026 998
1008htcalpine MACH_HTCALPINE HTCALPINE 999
1009bartec_vtu MACH_BARTEC_VTU BARTEC_VTU 1000
1010vcoreii MACH_VCOREII VCOREII 1001
1011pdnb3 MACH_PDNB3 PDNB3 1002
1012htcbeetles MACH_HTCBEETLES HTCBEETLES 1003
1013s3c6400 MACH_S3C6400 S3C6400 1004
1014s3c2443 MACH_S3C2443 S3C2443 1005
1015omap_ldk MACH_OMAP_LDK OMAP_LDK 1006
1016smdk2460 MACH_SMDK2460 SMDK2460 1007
1017smdk2440 MACH_SMDK2440 SMDK2440 1008
1018smdk2412 MACH_SMDK2412 SMDK2412 1009 206smdk2412 MACH_SMDK2412 SMDK2412 1009
1019webbox MACH_WEBBOX WEBBOX 1010
1020cwwndp MACH_CWWNDP CWWNDP 1011
1021i839 MACH_DRAGON DRAGON 1012
1022opendo_cpu_board MACH_OPENDO_CPU_BOARD OPENDO_CPU_BOARD 1013
1023ccm2200 MACH_CCM2200 CCM2200 1014
1024etwarm MACH_ETWARM ETWARM 1015
1025m93030 MACH_M93030 M93030 1016
1026cc7u MACH_CC7U CC7U 1017
1027mtt_ranger MACH_MTT_RANGER MTT_RANGER 1018
1028nexus MACH_NEXUS NEXUS 1019
1029desman MACH_DESMAN DESMAN 1020
1030bkde303 MACH_BKDE303 BKDE303 1021
1031smdk2413 MACH_SMDK2413 SMDK2413 1022 207smdk2413 MACH_SMDK2413 SMDK2413 1022
1032aml_m7200 MACH_AML_M7200 AML_M7200 1023
1033aml_m5900 MACH_AML_M5900 AML_M5900 1024 208aml_m5900 MACH_AML_M5900 AML_M5900 1024
1034sg640 MACH_SG640 SG640 1025
1035edg79524 MACH_EDG79524 EDG79524 1026
1036ai2410 MACH_AI2410 AI2410 1027
1037ixp465 MACH_IXP465 IXP465 1028
1038balloon3 MACH_BALLOON3 BALLOON3 1029 209balloon3 MACH_BALLOON3 BALLOON3 1029
1039heins MACH_HEINS HEINS 1030
1040mpluseva MACH_MPLUSEVA MPLUSEVA 1031
1041rt042 MACH_RT042 RT042 1032
1042cwiem MACH_CWIEM CWIEM 1033
1043cm_x270 MACH_CM_X270 CM_X270 1034
1044cm_x255 MACH_CM_X255 CM_X255 1035
1045esh_at91 MACH_ESH_AT91 ESH_AT91 1036
1046sandgate3 MACH_SANDGATE3 SANDGATE3 1037
1047primo MACH_PRIMO PRIMO 1038
1048gemstone MACH_GEMSTONE GEMSTONE 1039
1049pronghorn_metro MACH_PRONGHORNMETRO PRONGHORNMETRO 1040
1050sidewinder MACH_SIDEWINDER SIDEWINDER 1041
1051picomod1 MACH_PICOMOD1 PICOMOD1 1042
1052sg590 MACH_SG590 SG590 1043
1053akai9307 MACH_AKAI9307 AKAI9307 1044
1054fontaine MACH_FONTAINE FONTAINE 1045
1055wombat MACH_WOMBAT WOMBAT 1046
1056acq300 MACH_ACQ300 ACQ300 1047
1057mod272 MACH_MOD_270 MOD_270 1048
1058vmc_vc0820 MACH_VC0820 VC0820 1049
1059ani_aim MACH_ANI_AIM ANI_AIM 1050
1060jellyfish MACH_JELLYFISH JELLYFISH 1051
1061amanita MACH_AMANITA AMANITA 1052
1062vlink MACH_VLINK VLINK 1053
1063dexflex MACH_DEXFLEX DEXFLEX 1054
1064eigen_ttq MACH_EIGEN_TTQ EIGEN_TTQ 1055
1065arcom_titan MACH_ARCOM_TITAN ARCOM_TITAN 1056
1066tabla MACH_TABLA TABLA 1057
1067mdirac3 MACH_MDIRAC3 MDIRAC3 1058
1068mrhfbp2 MACH_MRHFBP2 MRHFBP2 1059
1069at91rm9200rb MACH_AT91RM9200RB AT91RM9200RB 1060
1070ani_apm MACH_ANI_APM ANI_APM 1061
1071ella1 MACH_ELLA1 ELLA1 1062
1072inhand_pxa27x MACH_INHAND_PXA27X INHAND_PXA27X 1063
1073inhand_pxa25x MACH_INHAND_PXA25X INHAND_PXA25X 1064
1074empos_xm MACH_EMPOS_XM EMPOS_XM 1065
1075empos MACH_EMPOS EMPOS 1066
1076empos_tiny MACH_EMPOS_TINY EMPOS_TINY 1067
1077empos_sm MACH_EMPOS_SM EMPOS_SM 1068
1078egret MACH_EGRET EGRET 1069
1079ostrich MACH_OSTRICH OSTRICH 1070
1080n50 MACH_N50 N50 1071
1081ecbat91 MACH_ECBAT91 ECBAT91 1072 210ecbat91 MACH_ECBAT91 ECBAT91 1072
1082stareast MACH_STAREAST STAREAST 1073
1083dspg_dw MACH_DSPG_DW DSPG_DW 1074
1084onearm MACH_ONEARM ONEARM 1075 211onearm MACH_ONEARM ONEARM 1075
1085mrg110_6 MACH_MRG110_6 MRG110_6 1076
1086wrt300nv2 MACH_WRT300NV2 WRT300NV2 1077
1087xm_bulverde MACH_XM_BULVERDE XM_BULVERDE 1078
1088msm6100 MACH_MSM6100 MSM6100 1079
1089eti_b1 MACH_ETI_B1 ETI_B1 1080
1090za9l_series MACH_ZILOG_ZA9L ZILOG_ZA9L 1081
1091bit2440 MACH_BIT2440 BIT2440 1082
1092nbi MACH_NBI NBI 1083
1093smdk2443 MACH_SMDK2443 SMDK2443 1084 212smdk2443 MACH_SMDK2443 SMDK2443 1084
1094vdavinci MACH_VDAVINCI VDAVINCI 1085
1095atc6 MACH_ATC6 ATC6 1086
1096multmdw MACH_MULTMDW MULTMDW 1087
1097mba2440 MACH_MBA2440 MBA2440 1088
1098ecsd MACH_ECSD ECSD 1089
1099palmz31 MACH_PALMZ31 PALMZ31 1090
1100fsg MACH_FSG FSG 1091 213fsg MACH_FSG FSG 1091
1101razor101 MACH_RAZOR101 RAZOR101 1092
1102opera_tdm MACH_OPERA_TDM OPERA_TDM 1093
1103comcerto MACH_COMCERTO COMCERTO 1094
1104tb0319 MACH_TB0319 TB0319 1095
1105kws8000 MACH_KWS8000 KWS8000 1096
1106b2 MACH_B2 B2 1097
1107lcl54 MACH_LCL54 LCL54 1098
1108at91sam9260ek MACH_AT91SAM9260EK AT91SAM9260EK 1099 214at91sam9260ek MACH_AT91SAM9260EK AT91SAM9260EK 1099
1109glantank MACH_GLANTANK GLANTANK 1100 215glantank MACH_GLANTANK GLANTANK 1100
1110n2100 MACH_N2100 N2100 1101 216n2100 MACH_N2100 N2100 1101
1111n4100 MACH_N4100 N4100 1102
1112rsc4 MACH_VERTICAL_RSC4 VERTICAL_RSC4 1103
1113sg8100 MACH_SG8100 SG8100 1104
1114im42xx MACH_IM42XX IM42XX 1105
1115ftxx MACH_FTXX FTXX 1106
1116lwfusion MACH_LWFUSION LWFUSION 1107
1117qt2410 MACH_QT2410 QT2410 1108 217qt2410 MACH_QT2410 QT2410 1108
1118kixrp435 MACH_KIXRP435 KIXRP435 1109 218kixrp435 MACH_KIXRP435 KIXRP435 1109
1119ccw9c MACH_CCW9C CCW9C 1110
1120dabhs MACH_DABHS DABHS 1111
1121gzmx MACH_GZMX GZMX 1112
1122ipnw100ap MACH_IPNW100AP IPNW100AP 1113
1123cc9p9360dev MACH_CC9P9360DEV CC9P9360DEV 1114 219cc9p9360dev MACH_CC9P9360DEV CC9P9360DEV 1114
1124cc9p9750dev MACH_CC9P9750DEV CC9P9750DEV 1115
1125cc9p9360val MACH_CC9P9360VAL CC9P9360VAL 1116
1126cc9p9750val MACH_CC9P9750VAL CC9P9750VAL 1117
1127nx70v MACH_NX70V NX70V 1118
1128at91rm9200df MACH_AT91RM9200DF AT91RM9200DF 1119
1129se_pilot2 MACH_SE_PILOT2 SE_PILOT2 1120
1130mtcn_t800 MACH_MTCN_T800 MTCN_T800 1121
1131vcmx212 MACH_VCMX212 VCMX212 1122
1132lynx MACH_LYNX LYNX 1123
1133at91sam9260id MACH_AT91SAM9260ID AT91SAM9260ID 1124
1134hw86052 MACH_HW86052 HW86052 1125
1135pilz_pmi3 MACH_PILZ_PMI3 PILZ_PMI3 1126
1136edb9302a MACH_EDB9302A EDB9302A 1127 220edb9302a MACH_EDB9302A EDB9302A 1127
1137edb9307a MACH_EDB9307A EDB9307A 1128 221edb9307a MACH_EDB9307A EDB9307A 1128
1138ct_dfs MACH_CT_DFS CT_DFS 1129
1139pilz_pmi4 MACH_PILZ_PMI4 PILZ_PMI4 1130
1140xceednp_ixp MACH_XCEEDNP_IXP XCEEDNP_IXP 1131
1141smdk2442b MACH_SMDK2442B SMDK2442B 1132
1142xnode MACH_XNODE XNODE 1133
1143aidx270 MACH_AIDX270 AIDX270 1134
1144rema MACH_REMA REMA 1135
1145bps1000 MACH_BPS1000 BPS1000 1136
1146hw90350 MACH_HW90350 HW90350 1137
1147omap_3430sdp MACH_OMAP_3430SDP OMAP_3430SDP 1138 222omap_3430sdp MACH_OMAP_3430SDP OMAP_3430SDP 1138
1148bluetouch MACH_BLUETOUCH BLUETOUCH 1139
1149vstms MACH_VSTMS VSTMS 1140 223vstms MACH_VSTMS VSTMS 1140
1150xsbase270 MACH_XSBASE270 XSBASE270 1141
1151at91sam9260ek_cn MACH_AT91SAM9260EK_CN AT91SAM9260EK_CN 1142
1152adsturboxb MACH_ADSTURBOXB ADSTURBOXB 1143
1153oti4110 MACH_OTI4110 OTI4110 1144
1154hme_pxa MACH_HME_PXA HME_PXA 1145
1155deisterdca MACH_DEISTERDCA DEISTERDCA 1146
1156ces_ssem2 MACH_CES_SSEM2 CES_SSEM2 1147
1157ces_mtr MACH_CES_MTR CES_MTR 1148
1158tds_avng_sbc MACH_TDS_AVNG_SBC TDS_AVNG_SBC 1149
1159everest MACH_EVEREST EVEREST 1150
1160pnx4010 MACH_PNX4010 PNX4010 1151
1161oxnas MACH_OXNAS OXNAS 1152
1162fiori MACH_FIORI FIORI 1153
1163ml1200 MACH_ML1200 ML1200 1154
1164pecos MACH_PECOS PECOS 1155
1165nb2xxx MACH_NB2XXX NB2XXX 1156
1166hw6900 MACH_HW6900 HW6900 1157
1167cdcs_quoll MACH_CDCS_QUOLL CDCS_QUOLL 1158
1168quicksilver MACH_QUICKSILVER QUICKSILVER 1159
1169uplat926 MACH_UPLAT926 UPLAT926 1160
1170dep2410_dep2410 MACH_DEP2410_THOMAS DEP2410_THOMAS 1161
1171dtk2410 MACH_DTK2410 DTK2410 1162
1172chili MACH_CHILI CHILI 1163
1173demeter MACH_DEMETER DEMETER 1164
1174dionysus MACH_DIONYSUS DIONYSUS 1165
1175as352x MACH_AS352X AS352X 1166
1176service MACH_SERVICE SERVICE 1167
1177cs_e9301 MACH_CS_E9301 CS_E9301 1168
1178micro9m MACH_MICRO9M MICRO9M 1169 224micro9m MACH_MICRO9M MICRO9M 1169
1179ia_mospck MACH_IA_MOSPCK IA_MOSPCK 1170
1180ql201b MACH_QL201B QL201B 1171
1181bbm MACH_BBM BBM 1174
1182exxx MACH_EXXX EXXX 1175
1183wma11b MACH_WMA11B WMA11B 1176
1184pelco_atlas MACH_PELCO_ATLAS PELCO_ATLAS 1177
1185g500 MACH_G500 G500 1178
1186bug MACH_BUG BUG 1179 225bug MACH_BUG BUG 1179
1187mx33ads MACH_MX33ADS MX33ADS 1180
1188chub MACH_CHUB CHUB 1181
1189neo1973_gta01 MACH_NEO1973_GTA01 NEO1973_GTA01 1182
1190w90n740 MACH_W90N740 W90N740 1183
1191medallion_sa2410 MACH_MEDALLION_SA2410 MEDALLION_SA2410 1184
1192ia_cpu_9200_2 MACH_IA_CPU_9200_2 IA_CPU_9200_2 1185
1193dimmrm9200 MACH_DIMMRM9200 DIMMRM9200 1186
1194pm9261 MACH_PM9261 PM9261 1187
1195ml7304 MACH_ML7304 ML7304 1189
1196ucp250 MACH_UCP250 UCP250 1190
1197intboard MACH_INTBOARD INTBOARD 1191
1198gulfstream MACH_GULFSTREAM GULFSTREAM 1192
1199labquest MACH_LABQUEST LABQUEST 1193
1200vcmx313 MACH_VCMX313 VCMX313 1194
1201urg200 MACH_URG200 URG200 1195
1202cpux255lcdnet MACH_CPUX255LCDNET CPUX255LCDNET 1196
1203netdcu9 MACH_NETDCU9 NETDCU9 1197
1204netdcu10 MACH_NETDCU10 NETDCU10 1198
1205dspg_dga MACH_DSPG_DGA DSPG_DGA 1199
1206dspg_dvw MACH_DSPG_DVW DSPG_DVW 1200
1207solos MACH_SOLOS SOLOS 1201
1208at91sam9263ek MACH_AT91SAM9263EK AT91SAM9263EK 1202 226at91sam9263ek MACH_AT91SAM9263EK AT91SAM9263EK 1202
1209osstbox MACH_OSSTBOX OSSTBOX 1203
1210kbat9261 MACH_KBAT9261 KBAT9261 1204
1211ct1100 MACH_CT1100 CT1100 1205
1212akcppxa MACH_AKCPPXA AKCPPXA 1206
1213ochaya1020 MACH_OCHAYA1020 OCHAYA1020 1207
1214hitrack MACH_HITRACK HITRACK 1208
1215syme1 MACH_SYME1 SYME1 1209
1216syhl1 MACH_SYHL1 SYHL1 1210
1217empca400 MACH_EMPCA400 EMPCA400 1211
1218em7210 MACH_EM7210 EM7210 1212 227em7210 MACH_EM7210 EM7210 1212
1219htchermes MACH_HTCHERMES HTCHERMES 1213
1220eti_c1 MACH_ETI_C1 ETI_C1 1214
1221ac100 MACH_AC100 AC100 1216
1222sneetch MACH_SNEETCH SNEETCH 1217
1223studentmate MACH_STUDENTMATE STUDENTMATE 1218
1224zir2410 MACH_ZIR2410 ZIR2410 1219
1225zir2413 MACH_ZIR2413 ZIR2413 1220
1226dlonip3 MACH_DLONIP3 DLONIP3 1221
1227instream MACH_INSTREAM INSTREAM 1222
1228ambarella MACH_AMBARELLA AMBARELLA 1223
1229nevis MACH_NEVIS NEVIS 1224
1230htc_trinity MACH_HTC_TRINITY HTC_TRINITY 1225
1231ql202b MACH_QL202B QL202B 1226
1232vpac270 MACH_VPAC270 VPAC270 1227 228vpac270 MACH_VPAC270 VPAC270 1227
1233rd129 MACH_RD129 RD129 1228
1234htcwizard MACH_HTCWIZARD HTCWIZARD 1229
1235treo680 MACH_TREO680 TREO680 1230 229treo680 MACH_TREO680 TREO680 1230
1236tecon_tmezon MACH_TECON_TMEZON TECON_TMEZON 1231
1237zylonite MACH_ZYLONITE ZYLONITE 1233 230zylonite MACH_ZYLONITE ZYLONITE 1233
1238gene1270 MACH_GENE1270 GENE1270 1234
1239zir2412 MACH_ZIR2412 ZIR2412 1235
1240mx31lite MACH_MX31LITE MX31LITE 1236 231mx31lite MACH_MX31LITE MX31LITE 1236
1241t700wx MACH_T700WX T700WX 1237
1242vf100 MACH_VF100 VF100 1238
1243nsb2 MACH_NSB2 NSB2 1239
1244nxhmi_bb MACH_NXHMI_BB NXHMI_BB 1240
1245nxhmi_re MACH_NXHMI_RE NXHMI_RE 1241
1246n4100pro MACH_N4100PRO N4100PRO 1242
1247sam9260 MACH_SAM9260 SAM9260 1243
1248omap_treo600 MACH_OMAP_TREO600 OMAP_TREO600 1244
1249indy2410 MACH_INDY2410 INDY2410 1245
1250nelt_a MACH_NELT_A NELT_A 1246
1251n311 MACH_N311 N311 1248
1252at91sam9260vgk MACH_AT91SAM9260VGK AT91SAM9260VGK 1249
1253at91leppe MACH_AT91LEPPE AT91LEPPE 1250
1254at91lepccn MACH_AT91LEPCCN AT91LEPCCN 1251
1255apc7100 MACH_APC7100 APC7100 1252
1256stargazer MACH_STARGAZER STARGAZER 1253
1257sonata MACH_SONATA SONATA 1254
1258schmoogie MACH_SCHMOOGIE SCHMOOGIE 1255
1259aztool MACH_AZTOOL AZTOOL 1256
1260mioa701 MACH_MIOA701 MIOA701 1257 232mioa701 MACH_MIOA701 MIOA701 1257
1261sxni9260 MACH_SXNI9260 SXNI9260 1258
1262mxc27520evb MACH_MXC27520EVB MXC27520EVB 1259
1263armadillo5x0 MACH_ARMADILLO5X0 ARMADILLO5X0 1260 233armadillo5x0 MACH_ARMADILLO5X0 ARMADILLO5X0 1260
1264mb9260 MACH_MB9260 MB9260 1261
1265mb9263 MACH_MB9263 MB9263 1262
1266ipac9302 MACH_IPAC9302 IPAC9302 1263
1267cc9p9360js MACH_CC9P9360JS CC9P9360JS 1264 234cc9p9360js MACH_CC9P9360JS CC9P9360JS 1264
1268gallium MACH_GALLIUM GALLIUM 1265
1269msc2410 MACH_MSC2410 MSC2410 1266
1270ghi270 MACH_GHI270 GHI270 1267
1271davinci_leonardo MACH_DAVINCI_LEONARDO DAVINCI_LEONARDO 1268
1272oiab MACH_OIAB OIAB 1269
1273smdk6400 MACH_SMDK6400 SMDK6400 1270 235smdk6400 MACH_SMDK6400 SMDK6400 1270
1274nokia_n800 MACH_NOKIA_N800 NOKIA_N800 1271 236nokia_n800 MACH_NOKIA_N800 NOKIA_N800 1271
1275greenphone MACH_GREENPHONE GREENPHONE 1272
1276compex42x MACH_COMPEXWP18 COMPEXWP18 1273
1277xmate MACH_XMATE XMATE 1274
1278energizer MACH_ENERGIZER ENERGIZER 1275
1279ime1 MACH_IME1 IME1 1276
1280sweda_tms MACH_SWEDATMS SWEDATMS 1277
1281ntnp435c MACH_NTNP435C NTNP435C 1278
1282spectro2 MACH_SPECTRO2 SPECTRO2 1279
1283h6039 MACH_H6039 H6039 1280
1284ep80219 MACH_EP80219 EP80219 1281 237ep80219 MACH_EP80219 EP80219 1281
1285samoa_ii MACH_SAMOA_II SAMOA_II 1282
1286cwmxl MACH_CWMXL CWMXL 1283
1287as9200 MACH_AS9200 AS9200 1284
1288sfx1149 MACH_SFX1149 SFX1149 1285
1289navi010 MACH_NAVI010 NAVI010 1286
1290multmdp MACH_MULTMDP MULTMDP 1287
1291scb9520 MACH_SCB9520 SCB9520 1288
1292htcathena MACH_HTCATHENA HTCATHENA 1289
1293xp179 MACH_XP179 XP179 1290
1294h4300 MACH_H4300 H4300 1291
1295goramo_mlr MACH_GORAMO_MLR GORAMO_MLR 1292 238goramo_mlr MACH_GORAMO_MLR GORAMO_MLR 1292
1296mxc30020evb MACH_MXC30020EVB MXC30020EVB 1293
1297adsbitsyg5 MACH_ADSBITSYG5 ADSBITSYG5 1294
1298adsportalplus MACH_ADSPORTALPLUS ADSPORTALPLUS 1295
1299mmsp2plus MACH_MMSP2PLUS MMSP2PLUS 1296
1300em_x270 MACH_EM_X270 EM_X270 1297 239em_x270 MACH_EM_X270 EM_X270 1297
1301tpp302 MACH_TPP302 TPP302 1298
1302tpp104 MACH_TPM104 TPM104 1299
1303tpm102 MACH_TPM102 TPM102 1300
1304tpm109 MACH_TPM109 TPM109 1301
1305fbxo1 MACH_FBXO1 FBXO1 1302
1306hxd8 MACH_HXD8 HXD8 1303
1307neo1973_gta02 MACH_NEO1973_GTA02 NEO1973_GTA02 1304 240neo1973_gta02 MACH_NEO1973_GTA02 NEO1973_GTA02 1304
1308emtest MACH_EMTEST EMTEST 1305
1309ad6900 MACH_AD6900 AD6900 1306
1310europa MACH_EUROPA EUROPA 1307
1311metroconnect MACH_METROCONNECT METROCONNECT 1308
1312ez_s2410 MACH_EZ_S2410 EZ_S2410 1309
1313ez_s2440 MACH_EZ_S2440 EZ_S2440 1310
1314ez_ep9312 MACH_EZ_EP9312 EZ_EP9312 1311
1315ez_ep9315 MACH_EZ_EP9315 EZ_EP9315 1312
1316ez_x7 MACH_EZ_X7 EZ_X7 1313
1317godotdb MACH_GODOTDB GODOTDB 1314
1318mistral MACH_MISTRAL MISTRAL 1315
1319msm MACH_MSM MSM 1316
1320ct5910 MACH_CT5910 CT5910 1317
1321ct5912 MACH_CT5912 CT5912 1318
1322hynet_ine MACH_HYNET_INE HYNET_INE 1319
1323hynet_app MACH_HYNET_APP HYNET_APP 1320
1324msm7200 MACH_MSM7200 MSM7200 1321
1325msm7600 MACH_MSM7600 MSM7600 1322
1326ceb255 MACH_CEB255 CEB255 1323
1327ciel MACH_CIEL CIEL 1324
1328slm5650 MACH_SLM5650 SLM5650 1325
1329at91sam9rlek MACH_AT91SAM9RLEK AT91SAM9RLEK 1326 241at91sam9rlek MACH_AT91SAM9RLEK AT91SAM9RLEK 1326
1330comtech_router MACH_COMTECH_ROUTER COMTECH_ROUTER 1327
1331sbc2410x MACH_SBC2410X SBC2410X 1328
1332at4x0bd MACH_AT4X0BD AT4X0BD 1329
1333cbifr MACH_CBIFR CBIFR 1330
1334arcom_quantum MACH_ARCOM_QUANTUM ARCOM_QUANTUM 1331
1335matrix520 MACH_MATRIX520 MATRIX520 1332
1336matrix510 MACH_MATRIX510 MATRIX510 1333
1337matrix500 MACH_MATRIX500 MATRIX500 1334
1338m501 MACH_M501 M501 1335
1339aaeon1270 MACH_AAEON1270 AAEON1270 1336
1340matrix500ev MACH_MATRIX500EV MATRIX500EV 1337
1341pac500 MACH_PAC500 PAC500 1338
1342pnx8181 MACH_PNX8181 PNX8181 1339
1343colibri320 MACH_COLIBRI320 COLIBRI320 1340 242colibri320 MACH_COLIBRI320 COLIBRI320 1340
1344aztoolbb MACH_AZTOOLBB AZTOOLBB 1341
1345aztoolg2 MACH_AZTOOLG2 AZTOOLG2 1342
1346dvlhost MACH_DVLHOST DVLHOST 1343
1347zir9200 MACH_ZIR9200 ZIR9200 1344
1348zir9260 MACH_ZIR9260 ZIR9260 1345
1349cocopah MACH_COCOPAH COCOPAH 1346
1350nds MACH_NDS NDS 1347
1351rosencrantz MACH_ROSENCRANTZ ROSENCRANTZ 1348
1352fttx_odsc MACH_FTTX_ODSC FTTX_ODSC 1349
1353classe_r6904 MACH_CLASSE_R6904 CLASSE_R6904 1350
1354cam60 MACH_CAM60 CAM60 1351 243cam60 MACH_CAM60 CAM60 1351
1355mxc30031ads MACH_MXC30031ADS MXC30031ADS 1352
1356datacall MACH_DATACALL DATACALL 1353
1357at91eb01 MACH_AT91EB01 AT91EB01 1354 244at91eb01 MACH_AT91EB01 AT91EB01 1354
1358rty MACH_RTY RTY 1355
1359dwl2100 MACH_DWL2100 DWL2100 1356
1360vinsi MACH_VINSI VINSI 1357
1361db88f5281 MACH_DB88F5281 DB88F5281 1358 245db88f5281 MACH_DB88F5281 DB88F5281 1358
1362csb726 MACH_CSB726 CSB726 1359 246csb726 MACH_CSB726 CSB726 1359
1363tik27 MACH_TIK27 TIK27 1360
1364mx_uc7420 MACH_MX_UC7420 MX_UC7420 1361
1365rirm3 MACH_RIRM3 RIRM3 1362
1366pelco_odyssey MACH_PELCO_ODYSSEY PELCO_ODYSSEY 1363
1367adx_abox MACH_ADX_ABOX ADX_ABOX 1365
1368adx_tpid MACH_ADX_TPID ADX_TPID 1366
1369minicheck MACH_MINICHECK MINICHECK 1367
1370idam MACH_IDAM IDAM 1368
1371mario_mx MACH_MARIO_MX MARIO_MX 1369
1372vi1888 MACH_VI1888 VI1888 1370
1373zr4230 MACH_ZR4230 ZR4230 1371
1374t1_ix_blue MACH_T1_IX_BLUE T1_IX_BLUE 1372
1375syhq2 MACH_SYHQ2 SYHQ2 1373
1376computime_r3 MACH_COMPUTIME_R3 COMPUTIME_R3 1374
1377oratis MACH_ORATIS ORATIS 1375
1378mikko MACH_MIKKO MIKKO 1376
1379holon MACH_HOLON HOLON 1377
1380olip8 MACH_OLIP8 OLIP8 1378
1381ghi270hg MACH_GHI270HG GHI270HG 1379
1382davinci_dm6467_evm MACH_DAVINCI_DM6467_EVM DAVINCI_DM6467_EVM 1380 247davinci_dm6467_evm MACH_DAVINCI_DM6467_EVM DAVINCI_DM6467_EVM 1380
1383davinci_dm355_evm MACH_DAVINCI_DM355_EVM DAVINCI_DM355_EVM 1381 248davinci_dm355_evm MACH_DAVINCI_DM355_EVM DAVINCI_DM355_EVM 1381
1384blackriver MACH_BLACKRIVER BLACKRIVER 1383
1385sandgate_wp MACH_SANDGATEWP SANDGATEWP 1384
1386cdotbwsg MACH_CDOTBWSG CDOTBWSG 1385
1387quark963 MACH_QUARK963 QUARK963 1386
1388csb735 MACH_CSB735 CSB735 1387
1389littleton MACH_LITTLETON LITTLETON 1388 249littleton MACH_LITTLETON LITTLETON 1388
1390mio_p550 MACH_MIO_P550 MIO_P550 1389
1391motion2440 MACH_MOTION2440 MOTION2440 1390
1392imm500 MACH_IMM500 IMM500 1391
1393homematic MACH_HOMEMATIC HOMEMATIC 1392
1394ermine MACH_ERMINE ERMINE 1393
1395kb9202b MACH_KB9202B KB9202B 1394
1396hs1xx MACH_HS1XX HS1XX 1395
1397studentmate2440 MACH_STUDENTMATE2440 STUDENTMATE2440 1396
1398arvoo_l1_z1 MACH_ARVOO_L1_Z1 ARVOO_L1_Z1 1397
1399dep2410k MACH_DEP2410K DEP2410K 1398
1400xxsvideo MACH_XXSVIDEO XXSVIDEO 1399
1401im4004 MACH_IM4004 IM4004 1400
1402ochaya1050 MACH_OCHAYA1050 OCHAYA1050 1401
1403lep9261 MACH_LEP9261 LEP9261 1402
1404svenmeb MACH_SVENMEB SVENMEB 1403
1405fortunet2ne MACH_FORTUNET2NE FORTUNET2NE 1404
1406nxhx MACH_NXHX NXHX 1406
1407realview_pb11mp MACH_REALVIEW_PB11MP REALVIEW_PB11MP 1407 250realview_pb11mp MACH_REALVIEW_PB11MP REALVIEW_PB11MP 1407
1408ids500 MACH_IDS500 IDS500 1408
1409ors_n725 MACH_ORS_N725 ORS_N725 1409
1410hsdarm MACH_HSDARM HSDARM 1410
1411sha_pon003 MACH_SHA_PON003 SHA_PON003 1411
1412sha_pon004 MACH_SHA_PON004 SHA_PON004 1412
1413sha_pon007 MACH_SHA_PON007 SHA_PON007 1413
1414sha_pon011 MACH_SHA_PON011 SHA_PON011 1414
1415h6042 MACH_H6042 H6042 1415
1416h6043 MACH_H6043 H6043 1416
1417looxc550 MACH_LOOXC550 LOOXC550 1417
1418cnty_titan MACH_CNTY_TITAN CNTY_TITAN 1418
1419app3xx MACH_APP3XX APP3XX 1419
1420sideoatsgrama MACH_SIDEOATSGRAMA SIDEOATSGRAMA 1420
1421treo700p MACH_TREO700P TREO700P 1421
1422treo700w MACH_TREO700W TREO700W 1422
1423treo750 MACH_TREO750 TREO750 1423
1424treo755p MACH_TREO755P TREO755P 1424
1425ezreganut9200 MACH_EZREGANUT9200 EZREGANUT9200 1425
1426sarge MACH_SARGE SARGE 1426
1427a696 MACH_A696 A696 1427
1428turtle1916 MACH_TURTLE TURTLE 1428
1429mx27_3ds MACH_MX27_3DS MX27_3DS 1430 251mx27_3ds MACH_MX27_3DS MX27_3DS 1430
1430bishop MACH_BISHOP BISHOP 1431
1431pxx MACH_PXX PXX 1432
1432redwood MACH_REDWOOD REDWOOD 1433
1433omap_2430dlp MACH_OMAP_2430DLP OMAP_2430DLP 1436
1434omap_2430osk MACH_OMAP_2430OSK OMAP_2430OSK 1437
1435sardine MACH_SARDINE SARDINE 1438
1436halibut MACH_HALIBUT HALIBUT 1439 252halibut MACH_HALIBUT HALIBUT 1439
1437trout MACH_TROUT TROUT 1440 253trout MACH_TROUT TROUT 1440
1438goldfish MACH_GOLDFISH GOLDFISH 1441
1439gesbc2440 MACH_GESBC2440 GESBC2440 1442
1440nomad MACH_NOMAD NOMAD 1443
1441rosalind MACH_ROSALIND ROSALIND 1444
1442cc9p9215 MACH_CC9P9215 CC9P9215 1445
1443cc9p9210 MACH_CC9P9210 CC9P9210 1446
1444cc9p9215js MACH_CC9P9215JS CC9P9215JS 1447
1445cc9p9210js MACH_CC9P9210JS CC9P9210JS 1448
1446nasffe MACH_NASFFE NASFFE 1449
1447tn2x0bd MACH_TN2X0BD TN2X0BD 1450
1448gwmpxa MACH_GWMPXA GWMPXA 1451
1449exyplus MACH_EXYPLUS EXYPLUS 1452
1450jadoo21 MACH_JADOO21 JADOO21 1453
1451looxn560 MACH_LOOXN560 LOOXN560 1454
1452bonsai MACH_BONSAI BONSAI 1455
1453adsmilgato MACH_ADSMILGATO ADSMILGATO 1456
1454gba MACH_GBA GBA 1457
1455h6044 MACH_H6044 H6044 1458
1456app MACH_APP APP 1459
1457tct_hammer MACH_TCT_HAMMER TCT_HAMMER 1460 254tct_hammer MACH_TCT_HAMMER TCT_HAMMER 1460
1458herald MACH_HERALD HERALD 1461 255herald MACH_HERALD HERALD 1461
1459artemis MACH_ARTEMIS ARTEMIS 1462
1460htctitan MACH_HTCTITAN HTCTITAN 1463
1461qranium MACH_QRANIUM QRANIUM 1464
1462adx_wsc2 MACH_ADX_WSC2 ADX_WSC2 1465
1463adx_medcom MACH_ADX_MEDCOM ADX_MEDCOM 1466
1464bboard MACH_BBOARD BBOARD 1467
1465cambria MACH_CAMBRIA CAMBRIA 1468
1466mt7xxx MACH_MT7XXX MT7XXX 1469
1467matrix512 MACH_MATRIX512 MATRIX512 1470
1468matrix522 MACH_MATRIX522 MATRIX522 1471
1469ipac5010 MACH_IPAC5010 IPAC5010 1472
1470sakura MACH_SAKURA SAKURA 1473
1471grocx MACH_GROCX GROCX 1474
1472pm9263 MACH_PM9263 PM9263 1475
1473sim_one MACH_SIM_ONE SIM_ONE 1476 256sim_one MACH_SIM_ONE SIM_ONE 1476
1474acq132 MACH_ACQ132 ACQ132 1477
1475datr MACH_DATR DATR 1478
1476actux1 MACH_ACTUX1 ACTUX1 1479
1477actux2 MACH_ACTUX2 ACTUX2 1480
1478actux3 MACH_ACTUX3 ACTUX3 1481
1479flexit MACH_FLEXIT FLEXIT 1482
1480bh2x0bd MACH_BH2X0BD BH2X0BD 1483
1481atb2002 MACH_ATB2002 ATB2002 1484
1482xenon MACH_XENON XENON 1485
1483fm607 MACH_FM607 FM607 1486
1484matrix514 MACH_MATRIX514 MATRIX514 1487
1485matrix524 MACH_MATRIX524 MATRIX524 1488
1486inpod MACH_INPOD INPOD 1489
1487jive MACH_JIVE JIVE 1490 257jive MACH_JIVE JIVE 1490
1488tll_mx21 MACH_TLL_MX21 TLL_MX21 1491
1489sbc2800 MACH_SBC2800 SBC2800 1492
1490cc7ucamry MACH_CC7UCAMRY CC7UCAMRY 1493
1491ubisys_p9_sc15 MACH_UBISYS_P9_SC15 UBISYS_P9_SC15 1494
1492ubisys_p9_ssc2d10 MACH_UBISYS_P9_SSC2D10 UBISYS_P9_SSC2D10 1495
1493ubisys_p9_rcu3 MACH_UBISYS_P9_RCU3 UBISYS_P9_RCU3 1496
1494aml_m8000 MACH_AML_M8000 AML_M8000 1497
1495snapper_270 MACH_SNAPPER_270 SNAPPER_270 1498
1496omap_bbx MACH_OMAP_BBX OMAP_BBX 1499
1497ucn2410 MACH_UCN2410 UCN2410 1500
1498sam9_l9260 MACH_SAM9_L9260 SAM9_L9260 1501 258sam9_l9260 MACH_SAM9_L9260 SAM9_L9260 1501
1499eti_c2 MACH_ETI_C2 ETI_C2 1502
1500avalanche MACH_AVALANCHE AVALANCHE 1503
1501realview_pb1176 MACH_REALVIEW_PB1176 REALVIEW_PB1176 1504 259realview_pb1176 MACH_REALVIEW_PB1176 REALVIEW_PB1176 1504
1502dp1500 MACH_DP1500 DP1500 1505
1503apple_iphone MACH_APPLE_IPHONE APPLE_IPHONE 1506
1504yl9200 MACH_YL9200 YL9200 1507 260yl9200 MACH_YL9200 YL9200 1507
1505rd88f5182 MACH_RD88F5182 RD88F5182 1508 261rd88f5182 MACH_RD88F5182 RD88F5182 1508
1506kurobox_pro MACH_KUROBOX_PRO KUROBOX_PRO 1509 262kurobox_pro MACH_KUROBOX_PRO KUROBOX_PRO 1509
1507se_poet MACH_SE_POET SE_POET 1510
1508mx31_3ds MACH_MX31_3DS MX31_3DS 1511 263mx31_3ds MACH_MX31_3DS MX31_3DS 1511
1509r270 MACH_R270 R270 1512
1510armour21 MACH_ARMOUR21 ARMOUR21 1513
1511dt2 MACH_DT2 DT2 1514
1512vt4 MACH_VT4 VT4 1515
1513tyco320 MACH_TYCO320 TYCO320 1516
1514adma MACH_ADMA ADMA 1517
1515wp188 MACH_WP188 WP188 1518
1516corsica MACH_CORSICA CORSICA 1519
1517bigeye MACH_BIGEYE BIGEYE 1520
1518tll5000 MACH_TLL5000 TLL5000 1522
1519bebot MACH_BEBOT BEBOT 1523
1520qong MACH_QONG QONG 1524 264qong MACH_QONG QONG 1524
1521tcompact MACH_TCOMPACT TCOMPACT 1525
1522puma5 MACH_PUMA5 PUMA5 1526
1523elara MACH_ELARA ELARA 1527
1524ellington MACH_ELLINGTON ELLINGTON 1528
1525xda_atom MACH_XDA_ATOM XDA_ATOM 1529
1526energizer2 MACH_ENERGIZER2 ENERGIZER2 1530
1527odin MACH_ODIN ODIN 1531
1528actux4 MACH_ACTUX4 ACTUX4 1532
1529esl_omap MACH_ESL_OMAP ESL_OMAP 1533
1530omap2evm MACH_OMAP2EVM OMAP2EVM 1534 265omap2evm MACH_OMAP2EVM OMAP2EVM 1534
1531omap3evm MACH_OMAP3EVM OMAP3EVM 1535 266omap3evm MACH_OMAP3EVM OMAP3EVM 1535
1532adx_pcu57 MACH_ADX_PCU57 ADX_PCU57 1536
1533monaco MACH_MONACO MONACO 1537
1534levante MACH_LEVANTE LEVANTE 1538
1535tmxipx425 MACH_TMXIPX425 TMXIPX425 1539
1536leep MACH_LEEP LEEP 1540
1537raad MACH_RAAD RAAD 1541
1538dns323 MACH_DNS323 DNS323 1542 267dns323 MACH_DNS323 DNS323 1542
1539ap1000 MACH_AP1000 AP1000 1543
1540a9sam6432 MACH_A9SAM6432 A9SAM6432 1544
1541shiny MACH_SHINY SHINY 1545
1542omap3_beagle MACH_OMAP3_BEAGLE OMAP3_BEAGLE 1546 268omap3_beagle MACH_OMAP3_BEAGLE OMAP3_BEAGLE 1546
1543csr_bdb2 MACH_CSR_BDB2 CSR_BDB2 1547
1544nokia_n810 MACH_NOKIA_N810 NOKIA_N810 1548 269nokia_n810 MACH_NOKIA_N810 NOKIA_N810 1548
1545c270 MACH_C270 C270 1549
1546sentry MACH_SENTRY SENTRY 1550
1547pcm038 MACH_PCM038 PCM038 1551 270pcm038 MACH_PCM038 PCM038 1551
1548anc300 MACH_ANC300 ANC300 1552
1549htckaiser MACH_HTCKAISER HTCKAISER 1553
1550sbat100 MACH_SBAT100 SBAT100 1554
1551modunorm MACH_MODUNORM MODUNORM 1555
1552pelos_twarm MACH_PELOS_TWARM PELOS_TWARM 1556
1553flank MACH_FLANK FLANK 1557
1554sirloin MACH_SIRLOIN SIRLOIN 1558
1555brisket MACH_BRISKET BRISKET 1559
1556chuck MACH_CHUCK CHUCK 1560
1557otter MACH_OTTER OTTER 1561
1558davinci_ldk MACH_DAVINCI_LDK DAVINCI_LDK 1562
1559phreedom MACH_PHREEDOM PHREEDOM 1563
1560sg310 MACH_SG310 SG310 1564
1561ts_x09 MACH_TS209 TS209 1565 271ts_x09 MACH_TS209 TS209 1565
1562at91cap9adk MACH_AT91CAP9ADK AT91CAP9ADK 1566 272at91cap9adk MACH_AT91CAP9ADK AT91CAP9ADK 1566
1563tion9315 MACH_TION9315 TION9315 1567
1564mast MACH_MAST MAST 1568
1565pfw MACH_PFW PFW 1569
1566yl_p2440 MACH_YL_P2440 YL_P2440 1570
1567zsbc32 MACH_ZSBC32 ZSBC32 1571
1568omap_pace2 MACH_OMAP_PACE2 OMAP_PACE2 1572
1569imx_pace2 MACH_IMX_PACE2 IMX_PACE2 1573
1570mx31moboard MACH_MX31MOBOARD MX31MOBOARD 1574 273mx31moboard MACH_MX31MOBOARD MX31MOBOARD 1574
1571mx37_3ds MACH_MX37_3DS MX37_3DS 1575
1572rcc MACH_RCC RCC 1576
1573dmp MACH_ARM9 ARM9 1577
1574vision_ep9307 MACH_VISION_EP9307 VISION_EP9307 1578
1575scly1000 MACH_SCLY1000 SCLY1000 1579
1576fontel_ep MACH_FONTEL_EP FONTEL_EP 1580
1577voiceblue3g MACH_VOICEBLUE3G VOICEBLUE3G 1581
1578tt9200 MACH_TT9200 TT9200 1582
1579digi2410 MACH_DIGI2410 DIGI2410 1583
1580terastation_pro2 MACH_TERASTATION_PRO2 TERASTATION_PRO2 1584 274terastation_pro2 MACH_TERASTATION_PRO2 TERASTATION_PRO2 1584
1581linkstation_pro MACH_LINKSTATION_PRO LINKSTATION_PRO 1585 275linkstation_pro MACH_LINKSTATION_PRO LINKSTATION_PRO 1585
1582motorola_a780 MACH_MOTOROLA_A780 MOTOROLA_A780 1587
1583motorola_e6 MACH_MOTOROLA_E6 MOTOROLA_E6 1588
1584motorola_e2 MACH_MOTOROLA_E2 MOTOROLA_E2 1589
1585motorola_e680 MACH_MOTOROLA_E680 MOTOROLA_E680 1590
1586ur2410 MACH_UR2410 UR2410 1591
1587tas9261 MACH_TAS9261 TAS9261 1592
1588davinci_hermes_hd MACH_HERMES_HD HERMES_HD 1593
1589davinci_perseo_hd MACH_PERSEO_HD PERSEO_HD 1594
1590stargazer2 MACH_STARGAZER2 STARGAZER2 1595
1591e350 MACH_E350 E350 1596 276e350 MACH_E350 E350 1596
1592wpcm450 MACH_WPCM450 WPCM450 1597
1593cartesio MACH_CARTESIO CARTESIO 1598
1594toybox MACH_TOYBOX TOYBOX 1599
1595tx27 MACH_TX27 TX27 1600
1596ts409 MACH_TS409 TS409 1601 277ts409 MACH_TS409 TS409 1601
1597p300 MACH_P300 P300 1602
1598xdacomet MACH_XDACOMET XDACOMET 1603
1599dexflex2 MACH_DEXFLEX2 DEXFLEX2 1604
1600ow MACH_OW OW 1605
1601armebs3 MACH_ARMEBS3 ARMEBS3 1606
1602u3 MACH_U3 U3 1607
1603smdk2450 MACH_SMDK2450 SMDK2450 1608
1604rsi_ews MACH_RSI_EWS RSI_EWS 1609
1605tnb MACH_TNB TNB 1610
1606toepath MACH_TOEPATH TOEPATH 1611
1607kb9263 MACH_KB9263 KB9263 1612
1608mt7108 MACH_MT7108 MT7108 1613
1609smtr2440 MACH_SMTR2440 SMTR2440 1614
1610manao MACH_MANAO MANAO 1615
1611cm_x300 MACH_CM_X300 CM_X300 1616 278cm_x300 MACH_CM_X300 CM_X300 1616
1612gulfstream_kp MACH_GULFSTREAM_KP GULFSTREAM_KP 1617
1613lanreadyfn522 MACH_LANREADYFN522 LANREADYFN522 1618
1614arma37 MACH_ARMA37 ARMA37 1619
1615mendel MACH_MENDEL MENDEL 1620
1616pelco_iliad MACH_PELCO_ILIAD PELCO_ILIAD 1621
1617unit2p MACH_UNIT2P UNIT2P 1622
1618inc20otter MACH_INC20OTTER INC20OTTER 1623
1619at91sam9g20ek MACH_AT91SAM9G20EK AT91SAM9G20EK 1624 279at91sam9g20ek MACH_AT91SAM9G20EK AT91SAM9G20EK 1624
1620sc_ge2 MACH_STORCENTER STORCENTER 1625
1621smdk6410 MACH_SMDK6410 SMDK6410 1626 280smdk6410 MACH_SMDK6410 SMDK6410 1626
1622u300 MACH_U300 U300 1627 281u300 MACH_U300 U300 1627
1623u500 MACH_U500 U500 1628
1624ds9260 MACH_DS9260 DS9260 1629
1625riverrock MACH_RIVERROCK RIVERROCK 1630
1626scibath MACH_SCIBATH SCIBATH 1631
1627at91sam7se MACH_AT91SAM7SE512EK AT91SAM7SE512EK 1632
1628wrt350n_v2 MACH_WRT350N_V2 WRT350N_V2 1633 282wrt350n_v2 MACH_WRT350N_V2 WRT350N_V2 1633
1629multimedia MACH_MULTIMEDIA MULTIMEDIA 1634
1630marvin MACH_MARVIN MARVIN 1635
1631x500 MACH_X500 X500 1636
1632awlug4lcu MACH_AWLUG4LCU AWLUG4LCU 1637
1633palermoc MACH_PALERMOC PALERMOC 1638
1634omap_ldp MACH_OMAP_LDP OMAP_LDP 1639 283omap_ldp MACH_OMAP_LDP OMAP_LDP 1639
1635ip500 MACH_IP500 IP500 1640
1636ase2 MACH_ASE2 ASE2 1642
1637mx35evb MACH_MX35EVB MX35EVB 1643
1638aml_m8050 MACH_AML_M8050 AML_M8050 1644
1639mx35_3ds MACH_MX35_3DS MX35_3DS 1645 284mx35_3ds MACH_MX35_3DS MX35_3DS 1645
1640mars MACH_MARS MARS 1646
1641neuros_osd2 MACH_NEUROS_OSD2 NEUROS_OSD2 1647 285neuros_osd2 MACH_NEUROS_OSD2 NEUROS_OSD2 1647
1642badger MACH_BADGER BADGER 1648
1643trizeps4wl MACH_TRIZEPS4WL TRIZEPS4WL 1649 286trizeps4wl MACH_TRIZEPS4WL TRIZEPS4WL 1649
1644trizeps5 MACH_TRIZEPS5 TRIZEPS5 1650
1645marlin MACH_MARLIN MARLIN 1651
1646ts78xx MACH_TS78XX TS78XX 1652 287ts78xx MACH_TS78XX TS78XX 1652
1647hpipaq214 MACH_HPIPAQ214 HPIPAQ214 1653
1648at572d940dcm MACH_AT572D940DCM AT572D940DCM 1654
1649ne1board MACH_NE1BOARD NE1BOARD 1655
1650zante MACH_ZANTE ZANTE 1656
1651sffsdr MACH_SFFSDR SFFSDR 1657 288sffsdr MACH_SFFSDR SFFSDR 1657
1652tw2662 MACH_TW2662 TW2662 1658
1653vf10xx MACH_VF10XX VF10XX 1659
1654zoran43xx MACH_ZORAN43XX ZORAN43XX 1660
1655sonix926 MACH_SONIX926 SONIX926 1661
1656celestialsemi MACH_CELESTIALSEMI CELESTIALSEMI 1662
1657cc9m2443js MACH_CC9M2443JS CC9M2443JS 1663
1658tw5334 MACH_TW5334 TW5334 1664
1659omap_htcartemis MACH_HTCARTEMIS HTCARTEMIS 1665
1660nal_hlite MACH_NAL_HLITE NAL_HLITE 1666
1661htcvogue MACH_HTCVOGUE HTCVOGUE 1667
1662smartweb MACH_SMARTWEB SMARTWEB 1668
1663mv86xx MACH_MV86XX MV86XX 1669
1664mv87xx MACH_MV87XX MV87XX 1670
1665songyoungho MACH_SONGYOUNGHO SONGYOUNGHO 1671
1666younghotema MACH_YOUNGHOTEMA YOUNGHOTEMA 1672
1667pcm037 MACH_PCM037 PCM037 1673 289pcm037 MACH_PCM037 PCM037 1673
1668mmvp MACH_MMVP MMVP 1674
1669mmap MACH_MMAP MMAP 1675
1670ptid2410 MACH_PTID2410 PTID2410 1676
1671james_926 MACH_JAMES_926 JAMES_926 1677
1672fm6000 MACH_FM6000 FM6000 1678
1673db88f6281_bp MACH_DB88F6281_BP DB88F6281_BP 1680 290db88f6281_bp MACH_DB88F6281_BP DB88F6281_BP 1680
1674rd88f6192_nas MACH_RD88F6192_NAS RD88F6192_NAS 1681 291rd88f6192_nas MACH_RD88F6192_NAS RD88F6192_NAS 1681
1675rd88f6281 MACH_RD88F6281 RD88F6281 1682 292rd88f6281 MACH_RD88F6281 RD88F6281 1682
1676db78x00_bp MACH_DB78X00_BP DB78X00_BP 1683 293db78x00_bp MACH_DB78X00_BP DB78X00_BP 1683
1677smdk2416 MACH_SMDK2416 SMDK2416 1685 294smdk2416 MACH_SMDK2416 SMDK2416 1685
1678oce_spider_si MACH_OCE_SPIDER_SI OCE_SPIDER_SI 1686
1679oce_spider_sk MACH_OCE_SPIDER_SK OCE_SPIDER_SK 1687
1680rovern6 MACH_ROVERN6 ROVERN6 1688
1681pelco_evolution MACH_PELCO_EVOLUTION PELCO_EVOLUTION 1689
1682wbd111 MACH_WBD111 WBD111 1690 295wbd111 MACH_WBD111 WBD111 1690
1683elaracpe MACH_ELARACPE ELARACPE 1691
1684mabv3 MACH_MABV3 MABV3 1692
1685mv2120 MACH_MV2120 MV2120 1693 296mv2120 MACH_MV2120 MV2120 1693
1686csb737 MACH_CSB737 CSB737 1695
1687mx51_3ds MACH_MX51_3DS MX51_3DS 1696 297mx51_3ds MACH_MX51_3DS MX51_3DS 1696
1688g900 MACH_G900 G900 1697
1689apf27 MACH_APF27 APF27 1698
1690ggus2000 MACH_GGUS2000 GGUS2000 1699
1691omap_2430_mimic MACH_OMAP_2430_MIMIC OMAP_2430_MIMIC 1700
1692imx27lite MACH_IMX27LITE IMX27LITE 1701 298imx27lite MACH_IMX27LITE IMX27LITE 1701
1693almex MACH_ALMEX ALMEX 1702
1694control MACH_CONTROL CONTROL 1703
1695mba2410 MACH_MBA2410 MBA2410 1704
1696volcano MACH_VOLCANO VOLCANO 1705
1697zenith MACH_ZENITH ZENITH 1706
1698muchip MACH_MUCHIP MUCHIP 1707
1699magellan MACH_MAGELLAN MAGELLAN 1708
1700usb_a9260 MACH_USB_A9260 USB_A9260 1709 299usb_a9260 MACH_USB_A9260 USB_A9260 1709
1701usb_a9263 MACH_USB_A9263 USB_A9263 1710 300usb_a9263 MACH_USB_A9263 USB_A9263 1710
1702qil_a9260 MACH_QIL_A9260 QIL_A9260 1711 301qil_a9260 MACH_QIL_A9260 QIL_A9260 1711
1703cme9210 MACH_CME9210 CME9210 1712
1704hczh4 MACH_HCZH4 HCZH4 1713
1705spearbasic MACH_SPEARBASIC SPEARBASIC 1714
1706dep2440 MACH_DEP2440 DEP2440 1715
1707hdl_gxr MACH_HDL_GXR HDL_GXR 1716
1708hdl_gt MACH_HDL_GT HDL_GT 1717
1709hdl_4g MACH_HDL_4G HDL_4G 1718
1710s3c6000 MACH_S3C6000 S3C6000 1719
1711mmsp2_mdk MACH_MMSP2_MDK MMSP2_MDK 1720
1712mpx220 MACH_MPX220 MPX220 1721
1713kzm_arm11_01 MACH_KZM_ARM11_01 KZM_ARM11_01 1722 302kzm_arm11_01 MACH_KZM_ARM11_01 KZM_ARM11_01 1722
1714htc_polaris MACH_HTC_POLARIS HTC_POLARIS 1723
1715htc_kaiser MACH_HTC_KAISER HTC_KAISER 1724
1716lg_ks20 MACH_LG_KS20 LG_KS20 1725
1717hhgps MACH_HHGPS HHGPS 1726
1718nokia_n810_wimax MACH_NOKIA_N810_WIMAX NOKIA_N810_WIMAX 1727 303nokia_n810_wimax MACH_NOKIA_N810_WIMAX NOKIA_N810_WIMAX 1727
1719insight MACH_INSIGHT INSIGHT 1728
1720sapphire MACH_SAPPHIRE SAPPHIRE 1729 304sapphire MACH_SAPPHIRE SAPPHIRE 1729
1721csb637xo MACH_CSB637XO CSB637XO 1730
1722evisiong MACH_EVISIONG EVISIONG 1731
1723stmp37xx MACH_STMP37XX STMP37XX 1732 305stmp37xx MACH_STMP37XX STMP37XX 1732
1724stmp378x MACH_STMP378X STMP378X 1733 306stmp378x MACH_STMP378X STMP378X 1733
1725tnt MACH_TNT TNT 1734
1726tbxt MACH_TBXT TBXT 1735
1727playmate MACH_PLAYMATE PLAYMATE 1736
1728pns10 MACH_PNS10 PNS10 1737
1729eznavi MACH_EZNAVI EZNAVI 1738
1730ps4000 MACH_PS4000 PS4000 1739
1731ezx_a780 MACH_EZX_A780 EZX_A780 1740 307ezx_a780 MACH_EZX_A780 EZX_A780 1740
1732ezx_e680 MACH_EZX_E680 EZX_E680 1741 308ezx_e680 MACH_EZX_E680 EZX_E680 1741
1733ezx_a1200 MACH_EZX_A1200 EZX_A1200 1742 309ezx_a1200 MACH_EZX_A1200 EZX_A1200 1742
1734ezx_e6 MACH_EZX_E6 EZX_E6 1743 310ezx_e6 MACH_EZX_E6 EZX_E6 1743
1735ezx_e2 MACH_EZX_E2 EZX_E2 1744 311ezx_e2 MACH_EZX_E2 EZX_E2 1744
1736ezx_a910 MACH_EZX_A910 EZX_A910 1745 312ezx_a910 MACH_EZX_A910 EZX_A910 1745
1737cwmx31 MACH_CWMX31 CWMX31 1746
1738sl2312 MACH_SL2312 SL2312 1747
1739blenny MACH_BLENNY BLENNY 1748
1740ds107 MACH_DS107 DS107 1749
1741dsx07 MACH_DSX07 DSX07 1750
1742picocom1 MACH_PICOCOM1 PICOCOM1 1751
1743lynx_wolverine MACH_LYNX_WOLVERINE LYNX_WOLVERINE 1752
1744ubisys_p9_sc19 MACH_UBISYS_P9_SC19 UBISYS_P9_SC19 1753
1745kratos_low MACH_KRATOS_LOW KRATOS_LOW 1754
1746m700 MACH_M700 M700 1755
1747edmini_v2 MACH_EDMINI_V2 EDMINI_V2 1756 313edmini_v2 MACH_EDMINI_V2 EDMINI_V2 1756
1748zipit2 MACH_ZIPIT2 ZIPIT2 1757 314zipit2 MACH_ZIPIT2 ZIPIT2 1757
1749hslfemtocell MACH_HSLFEMTOCELL HSLFEMTOCELL 1758
1750daintree_at91 MACH_DAINTREE_AT91 DAINTREE_AT91 1759
1751sg560usb MACH_SG560USB SG560USB 1760
1752omap3_pandora MACH_OMAP3_PANDORA OMAP3_PANDORA 1761 315omap3_pandora MACH_OMAP3_PANDORA OMAP3_PANDORA 1761
1753usr8200 MACH_USR8200 USR8200 1762
1754s1s65k MACH_S1S65K S1S65K 1763
1755s2s65a MACH_S2S65A S2S65A 1764
1756icore MACH_ICORE ICORE 1765
1757mss2 MACH_MSS2 MSS2 1766 316mss2 MACH_MSS2 MSS2 1766
1758belmont MACH_BELMONT BELMONT 1767
1759asusp525 MACH_ASUSP525 ASUSP525 1768
1760lb88rc8480 MACH_LB88RC8480 LB88RC8480 1769 317lb88rc8480 MACH_LB88RC8480 LB88RC8480 1769
1761hipxa MACH_HIPXA HIPXA 1770
1762mx25_3ds MACH_MX25_3DS MX25_3DS 1771 318mx25_3ds MACH_MX25_3DS MX25_3DS 1771
1763m800 MACH_M800 M800 1772
1764omap3530_lv_som MACH_OMAP3530_LV_SOM OMAP3530_LV_SOM 1773 319omap3530_lv_som MACH_OMAP3530_LV_SOM OMAP3530_LV_SOM 1773
1765prima_evb MACH_PRIMA_EVB PRIMA_EVB 1774
1766mx31bt1 MACH_MX31BT1 MX31BT1 1775
1767atlas4_evb MACH_ATLAS4_EVB ATLAS4_EVB 1776
1768mx31cicada MACH_MX31CICADA MX31CICADA 1777
1769mi424wr MACH_MI424WR MI424WR 1778
1770axs_ultrax MACH_AXS_ULTRAX AXS_ULTRAX 1779
1771at572d940deb MACH_AT572D940DEB AT572D940DEB 1780
1772davinci_da830_evm MACH_DAVINCI_DA830_EVM DAVINCI_DA830_EVM 1781 320davinci_da830_evm MACH_DAVINCI_DA830_EVM DAVINCI_DA830_EVM 1781
1773ep9302 MACH_EP9302 EP9302 1782
1774at572d940hfek MACH_AT572D940HFEB AT572D940HFEB 1783 321at572d940hfek MACH_AT572D940HFEB AT572D940HFEB 1783
1775cybook3 MACH_CYBOOK3 CYBOOK3 1784
1776wdg002 MACH_WDG002 WDG002 1785
1777sg560adsl MACH_SG560ADSL SG560ADSL 1786
1778nextio_n2800_ica MACH_NEXTIO_N2800_ICA NEXTIO_N2800_ICA 1787
1779dove_db MACH_DOVE_DB DOVE_DB 1788 322dove_db MACH_DOVE_DB DOVE_DB 1788
1780marvell_newdb MACH_MARVELL_NEWDB MARVELL_NEWDB 1789
1781vandihud MACH_VANDIHUD VANDIHUD 1790
1782magx_e8 MACH_MAGX_E8 MAGX_E8 1791
1783magx_z6 MACH_MAGX_Z6 MAGX_Z6 1792
1784magx_v8 MACH_MAGX_V8 MAGX_V8 1793
1785magx_u9 MACH_MAGX_U9 MAGX_U9 1794
1786toughcf08 MACH_TOUGHCF08 TOUGHCF08 1795
1787zw4400 MACH_ZW4400 ZW4400 1796
1788marat91 MACH_MARAT91 MARAT91 1797
1789overo MACH_OVERO OVERO 1798 323overo MACH_OVERO OVERO 1798
1790at2440evb MACH_AT2440EVB AT2440EVB 1799 324at2440evb MACH_AT2440EVB AT2440EVB 1799
1791neocore926 MACH_NEOCORE926 NEOCORE926 1800 325neocore926 MACH_NEOCORE926 NEOCORE926 1800
1792wnr854t MACH_WNR854T WNR854T 1801 326wnr854t MACH_WNR854T WNR854T 1801
1793imx27 MACH_IMX27 IMX27 1802
1794moose_db MACH_MOOSE_DB MOOSE_DB 1803
1795fab4 MACH_FAB4 FAB4 1804
1796htcdiamond MACH_HTCDIAMOND HTCDIAMOND 1805
1797fiona MACH_FIONA FIONA 1806
1798mxc30030_x MACH_MXC30030_X MXC30030_X 1807
1799bmp1000 MACH_BMP1000 BMP1000 1808
1800logi9200 MACH_LOGI9200 LOGI9200 1809
1801tqma31 MACH_TQMA31 TQMA31 1810
1802ccw9p9215js MACH_CCW9P9215JS CCW9P9215JS 1811
1803rd88f5181l_ge MACH_RD88F5181L_GE RD88F5181L_GE 1812 327rd88f5181l_ge MACH_RD88F5181L_GE RD88F5181L_GE 1812
1804sifmain MACH_SIFMAIN SIFMAIN 1813
1805sam9_l9261 MACH_SAM9_L9261 SAM9_L9261 1814
1806cc9m2443 MACH_CC9M2443 CC9M2443 1815
1807xaria300 MACH_XARIA300 XARIA300 1816
1808it9200 MACH_IT9200 IT9200 1817
1809rd88f5181l_fxo MACH_RD88F5181L_FXO RD88F5181L_FXO 1818 328rd88f5181l_fxo MACH_RD88F5181L_FXO RD88F5181L_FXO 1818
1810kriss_sensor MACH_KRISS_SENSOR KRISS_SENSOR 1819
1811pilz_pmi5 MACH_PILZ_PMI5 PILZ_PMI5 1820
1812jade MACH_JADE JADE 1821
1813ks8695_softplc MACH_KS8695_SOFTPLC KS8695_SOFTPLC 1822
1814gprisc3 MACH_GPRISC3 GPRISC3 1823
1815stamp9g20 MACH_STAMP9G20 STAMP9G20 1824 329stamp9g20 MACH_STAMP9G20 STAMP9G20 1824
1816smdk6430 MACH_SMDK6430 SMDK6430 1825
1817smdkc100 MACH_SMDKC100 SMDKC100 1826 330smdkc100 MACH_SMDKC100 SMDKC100 1826
1818tavorevb MACH_TAVOREVB TAVOREVB 1827 331tavorevb MACH_TAVOREVB TAVOREVB 1827
1819saar MACH_SAAR SAAR 1828 332saar MACH_SAAR SAAR 1828
1820deister_eyecam MACH_DEISTER_EYECAM DEISTER_EYECAM 1829
1821at91sam9m10g45ek MACH_AT91SAM9M10G45EK AT91SAM9M10G45EK 1830 333at91sam9m10g45ek MACH_AT91SAM9M10G45EK AT91SAM9M10G45EK 1830
1822linkstation_produo MACH_LINKSTATION_PRODUO LINKSTATION_PRODUO 1831
1823hit_b0 MACH_HIT_B0 HIT_B0 1832
1824adx_rmu MACH_ADX_RMU ADX_RMU 1833
1825xg_cpe_main MACH_XG_CPE_MAIN XG_CPE_MAIN 1834
1826edb9407a MACH_EDB9407A EDB9407A 1835
1827dtb9608 MACH_DTB9608 DTB9608 1836
1828em104v1 MACH_EM104V1 EM104V1 1837
1829demo MACH_DEMO DEMO 1838
1830logi9260 MACH_LOGI9260 LOGI9260 1839
1831mx31_exm32 MACH_MX31_EXM32 MX31_EXM32 1840
1832usb_a9g20 MACH_USB_A9G20 USB_A9G20 1841
1833picproje2008 MACH_PICPROJE2008 PICPROJE2008 1842
1834cs_e9315 MACH_CS_E9315 CS_E9315 1843
1835qil_a9g20 MACH_QIL_A9G20 QIL_A9G20 1844
1836sha_pon020 MACH_SHA_PON020 SHA_PON020 1845
1837nad MACH_NAD NAD 1846
1838sbc35_a9260 MACH_SBC35_A9260 SBC35_A9260 1847
1839sbc35_a9g20 MACH_SBC35_A9G20 SBC35_A9G20 1848
1840davinci_beginning MACH_DAVINCI_BEGINNING DAVINCI_BEGINNING 1849
1841uwc MACH_UWC UWC 1850
1842mxlads MACH_MXLADS MXLADS 1851 334mxlads MACH_MXLADS MXLADS 1851
1843htcnike MACH_HTCNIKE HTCNIKE 1852
1844deister_pxa270 MACH_DEISTER_PXA270 DEISTER_PXA270 1853
1845cme9210js MACH_CME9210JS CME9210JS 1854
1846cc9p9360 MACH_CC9P9360 CC9P9360 1855
1847mocha MACH_MOCHA MOCHA 1856
1848wapd170ag MACH_WAPD170AG WAPD170AG 1857
1849linkstation_mini MACH_LINKSTATION_MINI LINKSTATION_MINI 1858 335linkstation_mini MACH_LINKSTATION_MINI LINKSTATION_MINI 1858
1850afeb9260 MACH_AFEB9260 AFEB9260 1859 336afeb9260 MACH_AFEB9260 AFEB9260 1859
1851w90x900 MACH_W90X900 W90X900 1860
1852w90x700 MACH_W90X700 W90X700 1861
1853kt300ip MACH_KT300IP KT300IP 1862
1854kt300ip_g20 MACH_KT300IP_G20 KT300IP_G20 1863
1855srcm MACH_SRCM SRCM 1864
1856wlnx_9260 MACH_WLNX_9260 WLNX_9260 1865
1857openmoko_gta03 MACH_OPENMOKO_GTA03 OPENMOKO_GTA03 1866
1858osprey2 MACH_OSPREY2 OSPREY2 1867
1859kbio9260 MACH_KBIO9260 KBIO9260 1868
1860ginza MACH_GINZA GINZA 1869
1861a636n MACH_A636N A636N 1870
1862imx27ipcam MACH_IMX27IPCAM IMX27IPCAM 1871 337imx27ipcam MACH_IMX27IPCAM IMX27IPCAM 1871
1863nemoc MACH_NEMOC NEMOC 1872
1864geneva MACH_GENEVA GENEVA 1873
1865htcpharos MACH_HTCPHAROS HTCPHAROS 1874
1866neonc MACH_NEONC NEONC 1875
1867nas7100 MACH_NAS7100 NAS7100 1876
1868teuphone MACH_TEUPHONE TEUPHONE 1877
1869annax_eth2 MACH_ANNAX_ETH2 ANNAX_ETH2 1878
1870csb733 MACH_CSB733 CSB733 1879
1871bk3 MACH_BK3 BK3 1880
1872omap_em32 MACH_OMAP_EM32 OMAP_EM32 1881
1873et9261cp MACH_ET9261CP ET9261CP 1882
1874jasperc MACH_JASPERC JASPERC 1883
1875issi_arm9 MACH_ISSI_ARM9 ISSI_ARM9 1884
1876ued MACH_UED UED 1885
1877esiblade MACH_ESIBLADE ESIBLADE 1886
1878eye02 MACH_EYE02 EYE02 1887
1879imx27kbd MACH_IMX27KBD IMX27KBD 1888
1880sst61vc010_fpga MACH_SST61VC010_FPGA SST61VC010_FPGA 1889
1881kixvp435 MACH_KIXVP435 KIXVP435 1890
1882kixnp435 MACH_KIXNP435 KIXNP435 1891
1883africa MACH_AFRICA AFRICA 1892
1884nh233 MACH_NH233 NH233 1893
1885rd88f6183ap_ge MACH_RD88F6183AP_GE RD88F6183AP_GE 1894 338rd88f6183ap_ge MACH_RD88F6183AP_GE RD88F6183AP_GE 1894
1886bcm4760 MACH_BCM4760 BCM4760 1895
1887eddy_v2 MACH_EDDY_V2 EDDY_V2 1896
1888realview_pba8 MACH_REALVIEW_PBA8 REALVIEW_PBA8 1897 339realview_pba8 MACH_REALVIEW_PBA8 REALVIEW_PBA8 1897
1889hid_a7 MACH_HID_A7 HID_A7 1898
1890hero MACH_HERO HERO 1899
1891omap_poseidon MACH_OMAP_POSEIDON OMAP_POSEIDON 1900
1892realview_pbx MACH_REALVIEW_PBX REALVIEW_PBX 1901 340realview_pbx MACH_REALVIEW_PBX REALVIEW_PBX 1901
1893micro9s MACH_MICRO9S MICRO9S 1902 341micro9s MACH_MICRO9S MICRO9S 1902
1894mako MACH_MAKO MAKO 1903
1895xdaflame MACH_XDAFLAME XDAFLAME 1904
1896phidget_sbc2 MACH_PHIDGET_SBC2 PHIDGET_SBC2 1905
1897limestone MACH_LIMESTONE LIMESTONE 1906
1898iprobe_c32 MACH_IPROBE_C32 IPROBE_C32 1907
1899rut100 MACH_RUT100 RUT100 1908 342rut100 MACH_RUT100 RUT100 1908
1900asusp535 MACH_ASUSP535 ASUSP535 1909
1901htcraphael MACH_HTCRAPHAEL HTCRAPHAEL 1910
1902sygdg1 MACH_SYGDG1 SYGDG1 1911
1903sygdg2 MACH_SYGDG2 SYGDG2 1912
1904seoul MACH_SEOUL SEOUL 1913
1905salerno MACH_SALERNO SALERNO 1914
1906ucn_s3c64xx MACH_UCN_S3C64XX UCN_S3C64XX 1915
1907msm7201a MACH_MSM7201A MSM7201A 1916
1908lpr1 MACH_LPR1 LPR1 1917
1909armadillo500fx MACH_ARMADILLO500FX ARMADILLO500FX 1918
1910g3evm MACH_G3EVM G3EVM 1919 343g3evm MACH_G3EVM G3EVM 1919
1911z3_dm355 MACH_Z3_DM355 Z3_DM355 1920
1912w90p910evb MACH_W90P910EVB W90P910EVB 1921 344w90p910evb MACH_W90P910EVB W90P910EVB 1921
1913w90p920evb MACH_W90P920EVB W90P920EVB 1922
1914w90p950evb MACH_W90P950EVB W90P950EVB 1923 345w90p950evb MACH_W90P950EVB W90P950EVB 1923
1915w90n960evb MACH_W90N960EVB W90N960EVB 1924 346w90n960evb MACH_W90N960EVB W90N960EVB 1924
1916camhd MACH_CAMHD CAMHD 1925
1917mvc100 MACH_MVC100 MVC100 1926
1918electrum_200 MACH_ELECTRUM_200 ELECTRUM_200 1927
1919htcjade MACH_HTCJADE HTCJADE 1928
1920memphis MACH_MEMPHIS MEMPHIS 1929
1921imx27sbc MACH_IMX27SBC IMX27SBC 1930
1922lextar MACH_LEXTAR LEXTAR 1931
1923mv88f6281gtw_ge MACH_MV88F6281GTW_GE MV88F6281GTW_GE 1932 347mv88f6281gtw_ge MACH_MV88F6281GTW_GE MV88F6281GTW_GE 1932
1924ncp MACH_NCP NCP 1933 348ncp MACH_NCP NCP 1933
1925z32an_series MACH_Z32AN Z32AN 1934
1926tmq_capd MACH_TMQ_CAPD TMQ_CAPD 1935
1927omap3_wl MACH_OMAP3_WL OMAP3_WL 1936
1928chumby MACH_CHUMBY CHUMBY 1937
1929atsarm9 MACH_ATSARM9 ATSARM9 1938
1930davinci_dm365_evm MACH_DAVINCI_DM365_EVM DAVINCI_DM365_EVM 1939 349davinci_dm365_evm MACH_DAVINCI_DM365_EVM DAVINCI_DM365_EVM 1939
1931bahamas MACH_BAHAMAS BAHAMAS 1940
1932das MACH_DAS DAS 1941
1933minidas MACH_MINIDAS MINIDAS 1942
1934vk1000 MACH_VK1000 VK1000 1943
1935centro MACH_CENTRO CENTRO 1944 350centro MACH_CENTRO CENTRO 1944
1936ctera_2bay MACH_CTERA_2BAY CTERA_2BAY 1945
1937edgeconnect MACH_EDGECONNECT EDGECONNECT 1946
1938nd27000 MACH_ND27000 ND27000 1947
1939cobra MACH_GEMALTO_COBRA GEMALTO_COBRA 1948
1940ingelabs_comet MACH_INGELABS_COMET INGELABS_COMET 1949
1941pollux_wiz MACH_POLLUX_WIZ POLLUX_WIZ 1950
1942blackstone MACH_BLACKSTONE BLACKSTONE 1951
1943topaz MACH_TOPAZ TOPAZ 1952
1944aixle MACH_AIXLE AIXLE 1953
1945mw998 MACH_MW998 MW998 1954
1946nokia_rx51 MACH_NOKIA_RX51 NOKIA_RX51 1955 351nokia_rx51 MACH_NOKIA_RX51 NOKIA_RX51 1955
1947vsc5605ev MACH_VSC5605EV VSC5605EV 1956
1948nt98700dk MACH_NT98700DK NT98700DK 1957
1949icontact MACH_ICONTACT ICONTACT 1958
1950swarco_frcpu MACH_SWARCO_FRCPU SWARCO_FRCPU 1959
1951swarco_scpu MACH_SWARCO_SCPU SWARCO_SCPU 1960
1952bbox_p16 MACH_BBOX_P16 BBOX_P16 1961
1953bstd MACH_BSTD BSTD 1962
1954sbc2440ii MACH_SBC2440II SBC2440II 1963
1955pcm034 MACH_PCM034 PCM034 1964
1956neso MACH_NESO NESO 1965
1957wlnx_9g20 MACH_WLNX_9G20 WLNX_9G20 1966
1958omap_zoom2 MACH_OMAP_ZOOM2 OMAP_ZOOM2 1967 352omap_zoom2 MACH_OMAP_ZOOM2 OMAP_ZOOM2 1967
1959totemnova MACH_TOTEMNOVA TOTEMNOVA 1968
1960c5000 MACH_C5000 C5000 1969
1961unipo_at91sam9263 MACH_UNIPO_AT91SAM9263 UNIPO_AT91SAM9263 1970
1962ethernut5 MACH_ETHERNUT5 ETHERNUT5 1971
1963arm11 MACH_ARM11 ARM11 1972
1964cpuat9260 MACH_CPUAT9260 CPUAT9260 1973 353cpuat9260 MACH_CPUAT9260 CPUAT9260 1973
1965cpupxa255 MACH_CPUPXA255 CPUPXA255 1974
1966eukrea_cpuimx27 MACH_CPUIMX27 CPUIMX27 1975 354eukrea_cpuimx27 MACH_CPUIMX27 CPUIMX27 1975
1967cheflux MACH_CHEFLUX CHEFLUX 1976
1968eb_cpux9k2 MACH_EB_CPUX9K2 EB_CPUX9K2 1977
1969opcotec MACH_OPCOTEC OPCOTEC 1978
1970yt MACH_YT YT 1979
1971motoq MACH_MOTOQ MOTOQ 1980
1972bsb1 MACH_BSB1 BSB1 1981
1973acs5k MACH_ACS5K ACS5K 1982 355acs5k MACH_ACS5K ACS5K 1982
1974milan MACH_MILAN MILAN 1983
1975quartzv2 MACH_QUARTZV2 QUARTZV2 1984
1976rsvp MACH_RSVP RSVP 1985
1977rmp200 MACH_RMP200 RMP200 1986
1978snapper_9260 MACH_SNAPPER_9260 SNAPPER_9260 1987 356snapper_9260 MACH_SNAPPER_9260 SNAPPER_9260 1987
1979dsm320 MACH_DSM320 DSM320 1988 357dsm320 MACH_DSM320 DSM320 1988
1980adsgcm MACH_ADSGCM ADSGCM 1989
1981ase2_400 MACH_ASE2_400 ASE2_400 1990
1982pizza MACH_PIZZA PIZZA 1991
1983spot_ngpl MACH_SPOT_NGPL SPOT_NGPL 1992
1984armata MACH_ARMATA ARMATA 1993
1985exeda MACH_EXEDA EXEDA 1994 358exeda MACH_EXEDA EXEDA 1994
1986mx31sf005 MACH_MX31SF005 MX31SF005 1995
1987f5d8231_4_v2 MACH_F5D8231_4_V2 F5D8231_4_V2 1996
1988q2440 MACH_Q2440 Q2440 1997
1989qq2440 MACH_QQ2440 QQ2440 1998
1990mini2440 MACH_MINI2440 MINI2440 1999 359mini2440 MACH_MINI2440 MINI2440 1999
1991colibri300 MACH_COLIBRI300 COLIBRI300 2000 360colibri300 MACH_COLIBRI300 COLIBRI300 2000
1992jades MACH_JADES JADES 2001
1993spark MACH_SPARK SPARK 2002
1994benzina MACH_BENZINA BENZINA 2003
1995blaze MACH_BLAZE BLAZE 2004
1996linkstation_ls_hgl MACH_LINKSTATION_LS_HGL LINKSTATION_LS_HGL 2005 361linkstation_ls_hgl MACH_LINKSTATION_LS_HGL LINKSTATION_LS_HGL 2005
1997htckovsky MACH_HTCKOVSKY HTCKOVSKY 2006
1998sony_prs505 MACH_SONY_PRS505 SONY_PRS505 2007
1999hanlin_v3 MACH_HANLIN_V3 HANLIN_V3 2008
2000sapphira MACH_SAPPHIRA SAPPHIRA 2009
2001dack_sda_01 MACH_DACK_SDA_01 DACK_SDA_01 2010
2002armbox MACH_ARMBOX ARMBOX 2011
2003harris_rvp MACH_HARRIS_RVP HARRIS_RVP 2012
2004ribaldo MACH_RIBALDO RIBALDO 2013
2005agora MACH_AGORA AGORA 2014
2006omap3_mini MACH_OMAP3_MINI OMAP3_MINI 2015
2007a9sam6432_b MACH_A9SAM6432_B A9SAM6432_B 2016
2008usg2410 MACH_USG2410 USG2410 2017
2009pc72052_i10_revb MACH_PC72052_I10_REVB PC72052_I10_REVB 2018
2010mx35_exm32 MACH_MX35_EXM32 MX35_EXM32 2019
2011topas910 MACH_TOPAS910 TOPAS910 2020
2012hyena MACH_HYENA HYENA 2021
2013pospax MACH_POSPAX POSPAX 2022
2014hdl_gx MACH_HDL_GX HDL_GX 2023
2015ctera_4bay MACH_CTERA_4BAY CTERA_4BAY 2024
2016ctera_plug_c MACH_CTERA_PLUG_C CTERA_PLUG_C 2025
2017crwea_plug_i MACH_CRWEA_PLUG_I CRWEA_PLUG_I 2026
2018egauge2 MACH_EGAUGE2 EGAUGE2 2027
2019didj MACH_DIDJ DIDJ 2028
2020m_s3c2443 MACH_MEISTER MEISTER 2029
2021htcblackstone MACH_HTCBLACKSTONE HTCBLACKSTONE 2030
2022cpuat9g20 MACH_CPUAT9G20 CPUAT9G20 2031 362cpuat9g20 MACH_CPUAT9G20 CPUAT9G20 2031
2023smdk6440 MACH_SMDK6440 SMDK6440 2032 363smdk6440 MACH_SMDK6440 SMDK6440 2032
2024omap_35xx_mvp MACH_OMAP_35XX_MVP OMAP_35XX_MVP 2033
2025ctera_plug_i MACH_CTERA_PLUG_I CTERA_PLUG_I 2034
2026pvg610_100 MACH_PVG610 PVG610 2035
2027hprw6815 MACH_HPRW6815 HPRW6815 2036
2028omap3_oswald MACH_OMAP3_OSWALD OMAP3_OSWALD 2037
2029nas4220b MACH_NAS4220B NAS4220B 2038 364nas4220b MACH_NAS4220B NAS4220B 2038
2030htcraphael_cdma MACH_HTCRAPHAEL_CDMA HTCRAPHAEL_CDMA 2039
2031htcdiamond_cdma MACH_HTCDIAMOND_CDMA HTCDIAMOND_CDMA 2040
2032scaler MACH_SCALER SCALER 2041
2033zylonite2 MACH_ZYLONITE2 ZYLONITE2 2042 365zylonite2 MACH_ZYLONITE2 ZYLONITE2 2042
2034aspenite MACH_ASPENITE ASPENITE 2043 366aspenite MACH_ASPENITE ASPENITE 2043
2035teton MACH_TETON TETON 2044
2036ttc_dkb MACH_TTC_DKB TTC_DKB 2045 367ttc_dkb MACH_TTC_DKB TTC_DKB 2045
2037bishop2 MACH_BISHOP2 BISHOP2 2046
2038ippv5 MACH_IPPV5 IPPV5 2047
2039farm926 MACH_FARM926 FARM926 2048
2040mmccpu MACH_MMCCPU MMCCPU 2049
2041sgmsfl MACH_SGMSFL SGMSFL 2050
2042tt8000 MACH_TT8000 TT8000 2051
2043zrn4300lp MACH_ZRN4300LP ZRN4300LP 2052
2044mptc MACH_MPTC MPTC 2053
2045h6051 MACH_H6051 H6051 2054
2046pvg610_101 MACH_PVG610_101 PVG610_101 2055
2047stamp9261_pc_evb MACH_STAMP9261_PC_EVB STAMP9261_PC_EVB 2056
2048pelco_odysseus MACH_PELCO_ODYSSEUS PELCO_ODYSSEUS 2057
2049tny_a9260 MACH_TNY_A9260 TNY_A9260 2058
2050tny_a9g20 MACH_TNY_A9G20 TNY_A9G20 2059
2051aesop_mp2530f MACH_AESOP_MP2530F AESOP_MP2530F 2060
2052dx900 MACH_DX900 DX900 2061
2053cpodc2 MACH_CPODC2 CPODC2 2062
2054tilt_8925 MACH_TILT_8925 TILT_8925 2063
2055davinci_dm357_evm MACH_DAVINCI_DM357_EVM DAVINCI_DM357_EVM 2064
2056swordfish MACH_SWORDFISH SWORDFISH 2065
2057corvus MACH_CORVUS CORVUS 2066
2058taurus MACH_TAURUS TAURUS 2067
2059axm MACH_AXM AXM 2068
2060axc MACH_AXC AXC 2069
2061baby MACH_BABY BABY 2070
2062mp200 MACH_MP200 MP200 2071
2063pcm043 MACH_PCM043 PCM043 2072 368pcm043 MACH_PCM043 PCM043 2072
2064hanlin_v3c MACH_HANLIN_V3C HANLIN_V3C 2073
2065kbk9g20 MACH_KBK9G20 KBK9G20 2074
2066adsturbog5 MACH_ADSTURBOG5 ADSTURBOG5 2075
2067avenger_lite1 MACH_AVENGER_LITE1 AVENGER_LITE1 2076
2068suc82x MACH_SUC SUC 2077
2069at91sam7s256 MACH_AT91SAM7S256 AT91SAM7S256 2078
2070mendoza MACH_MENDOZA MENDOZA 2079
2071kira MACH_KIRA KIRA 2080
2072mx1hbm MACH_MX1HBM MX1HBM 2081
2073quatro43xx MACH_QUATRO43XX QUATRO43XX 2082
2074quatro4230 MACH_QUATRO4230 QUATRO4230 2083
2075nsb400 MACH_NSB400 NSB400 2084
2076drp255 MACH_DRP255 DRP255 2085
2077thoth MACH_THOTH THOTH 2086
2078firestone MACH_FIRESTONE FIRESTONE 2087
2079asusp750 MACH_ASUSP750 ASUSP750 2088
2080ctera_dl MACH_CTERA_DL CTERA_DL 2089
2081socr MACH_SOCR SOCR 2090
2082htcoxygen MACH_HTCOXYGEN HTCOXYGEN 2091
2083heroc MACH_HEROC HEROC 2092
2084zeno6800 MACH_ZENO6800 ZENO6800 2093
2085sc2mcs MACH_SC2MCS SC2MCS 2094
2086gene100 MACH_GENE100 GENE100 2095
2087as353x MACH_AS353X AS353X 2096
2088sheevaplug MACH_SHEEVAPLUG SHEEVAPLUG 2097 369sheevaplug MACH_SHEEVAPLUG SHEEVAPLUG 2097
2089at91sam9g20 MACH_AT91SAM9G20 AT91SAM9G20 2098
2090mv88f6192gtw_fe MACH_MV88F6192GTW_FE MV88F6192GTW_FE 2099
2091cc9200 MACH_CC9200 CC9200 2100
2092sm9200 MACH_SM9200 SM9200 2101
2093tp9200 MACH_TP9200 TP9200 2102
2094snapperdv MACH_SNAPPERDV SNAPPERDV 2103
2095avengers_lite MACH_AVENGERS_LITE AVENGERS_LITE 2104 370avengers_lite MACH_AVENGERS_LITE AVENGERS_LITE 2104
2096avengers_lite1 MACH_AVENGERS_LITE1 AVENGERS_LITE1 2105
2097omap3axon MACH_OMAP3AXON OMAP3AXON 2106
2098ma8xx MACH_MA8XX MA8XX 2107
2099mp201ek MACH_MP201EK MP201EK 2108
2100davinci_tux MACH_DAVINCI_TUX DAVINCI_TUX 2109
2101mpa1600 MACH_MPA1600 MPA1600 2110
2102pelco_troy MACH_PELCO_TROY PELCO_TROY 2111
2103nsb667 MACH_NSB667 NSB667 2112
2104rovers5_4mpix MACH_ROVERS5_4MPIX ROVERS5_4MPIX 2113
2105twocom MACH_TWOCOM TWOCOM 2114
2106ubisys_p9_rcu3r2 MACH_UBISYS_P9_RCU3R2 UBISYS_P9_RCU3R2 2115
2107hero_espresso MACH_HERO_ESPRESSO HERO_ESPRESSO 2116
2108afeusb MACH_AFEUSB AFEUSB 2117
2109t830 MACH_T830 T830 2118
2110spd8020_cc MACH_SPD8020_CC SPD8020_CC 2119
2111om_3d7k MACH_OM_3D7K OM_3D7K 2120
2112picocom2 MACH_PICOCOM2 PICOCOM2 2121
2113uwg4mx27 MACH_UWG4MX27 UWG4MX27 2122
2114uwg4mx31 MACH_UWG4MX31 UWG4MX31 2123
2115cherry MACH_CHERRY CHERRY 2124
2116mx51_babbage MACH_MX51_BABBAGE MX51_BABBAGE 2125 371mx51_babbage MACH_MX51_BABBAGE MX51_BABBAGE 2125
2117s3c2440turkiye MACH_S3C2440TURKIYE S3C2440TURKIYE 2126
2118tx37 MACH_TX37 TX37 2127
2119sbc2800_9g20 MACH_SBC2800_9G20 SBC2800_9G20 2128
2120benzglb MACH_BENZGLB BENZGLB 2129
2121benztd MACH_BENZTD BENZTD 2130
2122cartesio_plus MACH_CARTESIO_PLUS CARTESIO_PLUS 2131
2123solrad_g20 MACH_SOLRAD_G20 SOLRAD_G20 2132
2124mx27wallace MACH_MX27WALLACE MX27WALLACE 2133
2125fmzwebmodul MACH_FMZWEBMODUL FMZWEBMODUL 2134
2126rd78x00_masa MACH_RD78X00_MASA RD78X00_MASA 2135 372rd78x00_masa MACH_RD78X00_MASA RD78X00_MASA 2135
2127smallogger MACH_SMALLOGGER SMALLOGGER 2136
2128ccw9p9215 MACH_CCW9P9215 CCW9P9215 2137
2129dm355_leopard MACH_DM355_LEOPARD DM355_LEOPARD 2138 373dm355_leopard MACH_DM355_LEOPARD DM355_LEOPARD 2138
2130ts219 MACH_TS219 TS219 2139 374ts219 MACH_TS219 TS219 2139
2131tny_a9263 MACH_TNY_A9263 TNY_A9263 2140
2132apollo MACH_APOLLO APOLLO 2141
2133at91cap9stk MACH_AT91CAP9STK AT91CAP9STK 2142
2134spc300 MACH_SPC300 SPC300 2143
2135eko MACH_EKO EKO 2144
2136ccw9m2443 MACH_CCW9M2443 CCW9M2443 2145
2137ccw9m2443js MACH_CCW9M2443JS CCW9M2443JS 2146
2138m2m_router_device MACH_M2M_ROUTER_DEVICE M2M_ROUTER_DEVICE 2147
2139str9104nas MACH_STAR9104NAS STAR9104NAS 2148
2140pca100 MACH_PCA100 PCA100 2149 375pca100 MACH_PCA100 PCA100 2149
2141z3_dm365_mod_01 MACH_Z3_DM365_MOD_01 Z3_DM365_MOD_01 2150
2142hipox MACH_HIPOX HIPOX 2151
2143omap3_piteds MACH_OMAP3_PITEDS OMAP3_PITEDS 2152
2144bm150r MACH_BM150R BM150R 2153
2145tbone MACH_TBONE TBONE 2154
2146merlin MACH_MERLIN MERLIN 2155
2147falcon MACH_FALCON FALCON 2156
2148davinci_da850_evm MACH_DAVINCI_DA850_EVM DAVINCI_DA850_EVM 2157 376davinci_da850_evm MACH_DAVINCI_DA850_EVM DAVINCI_DA850_EVM 2157
2149s5p6440 MACH_S5P6440 S5P6440 2158
2150at91sam9g10ek MACH_AT91SAM9G10EK AT91SAM9G10EK 2159 377at91sam9g10ek MACH_AT91SAM9G10EK AT91SAM9G10EK 2159
2151omap_4430sdp MACH_OMAP_4430SDP OMAP_4430SDP 2160 378omap_4430sdp MACH_OMAP_4430SDP OMAP_4430SDP 2160
2152lpc313x MACH_LPC313X LPC313X 2161
2153magx_zn5 MACH_MAGX_ZN5 MAGX_ZN5 2162 379magx_zn5 MACH_MAGX_ZN5 MAGX_ZN5 2162
2154magx_em30 MACH_MAGX_EM30 MAGX_EM30 2163
2155magx_ve66 MACH_MAGX_VE66 MAGX_VE66 2164
2156meesc MACH_MEESC MEESC 2165
2157otc570 MACH_OTC570 OTC570 2166
2158bcu2412 MACH_BCU2412 BCU2412 2167
2159beacon MACH_BEACON BEACON 2168
2160actia_tgw MACH_ACTIA_TGW ACTIA_TGW 2169
2161e4430 MACH_E4430 E4430 2170
2162ql300 MACH_QL300 QL300 2171
2163btmavb101 MACH_BTMAVB101 BTMAVB101 2172
2164btmawb101 MACH_BTMAWB101 BTMAWB101 2173
2165sq201 MACH_SQ201 SQ201 2174
2166quatro45xx MACH_QUATRO45XX QUATRO45XX 2175
2167openpad MACH_OPENPAD OPENPAD 2176
2168tx25 MACH_TX25 TX25 2177
2169omap3_torpedo MACH_OMAP3_TORPEDO OMAP3_TORPEDO 2178 380omap3_torpedo MACH_OMAP3_TORPEDO OMAP3_TORPEDO 2178
2170htcraphael_k MACH_HTCRAPHAEL_K HTCRAPHAEL_K 2179
2171lal43 MACH_LAL43 LAL43 2181
2172htcraphael_cdma500 MACH_HTCRAPHAEL_CDMA500 HTCRAPHAEL_CDMA500 2182
2173anw6410 MACH_ANW6410 ANW6410 2183 381anw6410 MACH_ANW6410 ANW6410 2183
2174htcprophet MACH_HTCPROPHET HTCPROPHET 2185
2175cfa_10022 MACH_CFA_10022 CFA_10022 2186
2176imx27_visstrim_m10 MACH_IMX27_VISSTRIM_M10 IMX27_VISSTRIM_M10 2187 382imx27_visstrim_m10 MACH_IMX27_VISSTRIM_M10 IMX27_VISSTRIM_M10 2187
2177px2imx27 MACH_PX2IMX27 PX2IMX27 2188
2178stm3210e_eval MACH_STM3210E_EVAL STM3210E_EVAL 2189
2179dvs10 MACH_DVS10 DVS10 2190
2180portuxg20 MACH_PORTUXG20 PORTUXG20 2191 383portuxg20 MACH_PORTUXG20 PORTUXG20 2191
2181arm_spv MACH_ARM_SPV ARM_SPV 2192
2182smdkc110 MACH_SMDKC110 SMDKC110 2193 384smdkc110 MACH_SMDKC110 SMDKC110 2193
2183cabespresso MACH_CABESPRESSO CABESPRESSO 2194
2184hmc800 MACH_HMC800 HMC800 2195
2185sholes MACH_SHOLES SHOLES 2196
2186btmxc31 MACH_BTMXC31 BTMXC31 2197
2187dt501 MACH_DT501 DT501 2198
2188ktx MACH_KTX KTX 2199
2189omap3517evm MACH_OMAP3517EVM OMAP3517EVM 2200 385omap3517evm MACH_OMAP3517EVM OMAP3517EVM 2200
2190netspace_v2 MACH_NETSPACE_V2 NETSPACE_V2 2201 386netspace_v2 MACH_NETSPACE_V2 NETSPACE_V2 2201
2191netspace_max_v2 MACH_NETSPACE_MAX_V2 NETSPACE_MAX_V2 2202 387netspace_max_v2 MACH_NETSPACE_MAX_V2 NETSPACE_MAX_V2 2202
2192d2net_v2 MACH_D2NET_V2 D2NET_V2 2203 388d2net_v2 MACH_D2NET_V2 D2NET_V2 2203
2193net2big_v2 MACH_NET2BIG_V2 NET2BIG_V2 2204 389net2big_v2 MACH_NET2BIG_V2 NET2BIG_V2 2204
2194net4big_v2 MACH_NET4BIG_V2 NET4BIG_V2 2205
2195net5big_v2 MACH_NET5BIG_V2 NET5BIG_V2 2206 390net5big_v2 MACH_NET5BIG_V2 NET5BIG_V2 2206
2196endb2443 MACH_ENDB2443 ENDB2443 2207
2197inetspace_v2 MACH_INETSPACE_V2 INETSPACE_V2 2208 391inetspace_v2 MACH_INETSPACE_V2 INETSPACE_V2 2208
2198tros MACH_TROS TROS 2209
2199pelco_homer MACH_PELCO_HOMER PELCO_HOMER 2210
2200ofsp8 MACH_OFSP8 OFSP8 2211
2201at91sam9g45ekes MACH_AT91SAM9G45EKES AT91SAM9G45EKES 2212 392at91sam9g45ekes MACH_AT91SAM9G45EKES AT91SAM9G45EKES 2212
2202guf_cupid MACH_GUF_CUPID GUF_CUPID 2213
2203eab1r MACH_EAB1R EAB1R 2214
2204desirec MACH_DESIREC DESIREC 2215
2205cordoba MACH_CORDOBA CORDOBA 2216
2206irvine MACH_IRVINE IRVINE 2217
2207sff772 MACH_SFF772 SFF772 2218
2208pelco_milano MACH_PELCO_MILANO PELCO_MILANO 2219
2209pc7302 MACH_PC7302 PC7302 2220 393pc7302 MACH_PC7302 PC7302 2220
2210bip6000 MACH_BIP6000 BIP6000 2221
2211silvermoon MACH_SILVERMOON SILVERMOON 2222
2212vc0830 MACH_VC0830 VC0830 2223
2213dt430 MACH_DT430 DT430 2224
2214ji42pf MACH_JI42PF JI42PF 2225
2215gnet_ksm MACH_GNET_KSM GNET_KSM 2226
2216gnet_sgm MACH_GNET_SGM GNET_SGM 2227
2217gnet_sgr MACH_GNET_SGR GNET_SGR 2228
2218omap3_icetekevm MACH_OMAP3_ICETEKEVM OMAP3_ICETEKEVM 2229
2219pnp MACH_PNP PNP 2230
2220ctera_2bay_k MACH_CTERA_2BAY_K CTERA_2BAY_K 2231
2221ctera_2bay_u MACH_CTERA_2BAY_U CTERA_2BAY_U 2232
2222sas_c MACH_SAS_C SAS_C 2233
2223vma2315 MACH_VMA2315 VMA2315 2234
2224vcs MACH_VCS VCS 2235
2225spear600 MACH_SPEAR600 SPEAR600 2236 394spear600 MACH_SPEAR600 SPEAR600 2236
2226spear300 MACH_SPEAR300 SPEAR300 2237 395spear300 MACH_SPEAR300 SPEAR300 2237
2227spear1300 MACH_SPEAR1300 SPEAR1300 2238
2228lilly1131 MACH_LILLY1131 LILLY1131 2239 396lilly1131 MACH_LILLY1131 LILLY1131 2239
2229arvoo_ax301 MACH_ARVOO_AX301 ARVOO_AX301 2240
2230mapphone MACH_MAPPHONE MAPPHONE 2241
2231legend MACH_LEGEND LEGEND 2242
2232salsa MACH_SALSA SALSA 2243
2233lounge MACH_LOUNGE LOUNGE 2244
2234vision MACH_VISION VISION 2245
2235vmb20 MACH_VMB20 VMB20 2246
2236hy2410 MACH_HY2410 HY2410 2247
2237hy9315 MACH_HY9315 HY9315 2248
2238bullwinkle MACH_BULLWINKLE BULLWINKLE 2249
2239arm_ultimator2 MACH_ARM_ULTIMATOR2 ARM_ULTIMATOR2 2250
2240vs_v210 MACH_VS_V210 VS_V210 2252
2241vs_v212 MACH_VS_V212 VS_V212 2253
2242hmt MACH_HMT HMT 2254 397hmt MACH_HMT HMT 2254
2243suen3 MACH_SUEN3 SUEN3 2255
2244vesper MACH_VESPER VESPER 2256
2245str9 MACH_STR9 STR9 2257
2246omap3_wl_ff MACH_OMAP3_WL_FF OMAP3_WL_FF 2258
2247simcom MACH_SIMCOM SIMCOM 2259
2248mcwebio MACH_MCWEBIO MCWEBIO 2260
2249omap3_phrazer MACH_OMAP3_PHRAZER OMAP3_PHRAZER 2261
2250darwin MACH_DARWIN DARWIN 2262
2251oratiscomu MACH_ORATISCOMU ORATISCOMU 2263
2252rtsbc20 MACH_RTSBC20 RTSBC20 2264
2253sgh_i780 MACH_I780 I780 2265
2254gemini324 MACH_GEMINI324 GEMINI324 2266
2255oratislan MACH_ORATISLAN ORATISLAN 2267
2256oratisalog MACH_ORATISALOG ORATISALOG 2268
2257oratismadi MACH_ORATISMADI ORATISMADI 2269
2258oratisot16 MACH_ORATISOT16 ORATISOT16 2270
2259oratisdesk MACH_ORATISDESK ORATISDESK 2271
2260vexpress MACH_VEXPRESS VEXPRESS 2272 398vexpress MACH_VEXPRESS VEXPRESS 2272
2261sintexo MACH_SINTEXO SINTEXO 2273
2262cm3389 MACH_CM3389 CM3389 2274
2263omap3_cio MACH_OMAP3_CIO OMAP3_CIO 2275
2264sgh_i900 MACH_SGH_I900 SGH_I900 2276
2265bst100 MACH_BST100 BST100 2277
2266passion MACH_PASSION PASSION 2278
2267indesign_at91sam MACH_INDESIGN_AT91SAM INDESIGN_AT91SAM 2279
2268c4_badger MACH_C4_BADGER C4_BADGER 2280
2269c4_viper MACH_C4_VIPER C4_VIPER 2281
2270d2net MACH_D2NET D2NET 2282 399d2net MACH_D2NET D2NET 2282
2271bigdisk MACH_BIGDISK BIGDISK 2283 400bigdisk MACH_BIGDISK BIGDISK 2283
2272notalvision MACH_NOTALVISION NOTALVISION 2284
2273omap3_kboc MACH_OMAP3_KBOC OMAP3_KBOC 2285
2274cyclone MACH_CYCLONE CYCLONE 2286
2275ninja MACH_NINJA NINJA 2287
2276at91sam9g20ek_2mmc MACH_AT91SAM9G20EK_2MMC AT91SAM9G20EK_2MMC 2288 401at91sam9g20ek_2mmc MACH_AT91SAM9G20EK_2MMC AT91SAM9G20EK_2MMC 2288
2277bcmring MACH_BCMRING BCMRING 2289 402bcmring MACH_BCMRING BCMRING 2289
2278resol_dl2 MACH_RESOL_DL2 RESOL_DL2 2290
2279ifosw MACH_IFOSW IFOSW 2291
2280htcrhodium MACH_HTCRHODIUM HTCRHODIUM 2292
2281htctopaz MACH_HTCTOPAZ HTCTOPAZ 2293
2282matrix504 MACH_MATRIX504 MATRIX504 2294
2283mrfsa MACH_MRFSA MRFSA 2295
2284sc_p270 MACH_SC_P270 SC_P270 2296
2285atlas5_evb MACH_ATLAS5_EVB ATLAS5_EVB 2297
2286pelco_lobox MACH_PELCO_LOBOX PELCO_LOBOX 2298
2287dilax_pcu200 MACH_DILAX_PCU200 DILAX_PCU200 2299
2288leonardo MACH_LEONARDO LEONARDO 2300
2289zoran_approach7 MACH_ZORAN_APPROACH7 ZORAN_APPROACH7 2301
2290dp6xx MACH_DP6XX DP6XX 2302
2291bcm2153_vesper MACH_BCM2153_VESPER BCM2153_VESPER 2303
2292mahimahi MACH_MAHIMAHI MAHIMAHI 2304 403mahimahi MACH_MAHIMAHI MAHIMAHI 2304
2293clickc MACH_CLICKC CLICKC 2305
2294zb_gateway MACH_ZB_GATEWAY ZB_GATEWAY 2306
2295tazcard MACH_TAZCARD TAZCARD 2307
2296tazdev MACH_TAZDEV TAZDEV 2308
2297annax_cb_arm MACH_ANNAX_CB_ARM ANNAX_CB_ARM 2309
2298annax_dm3 MACH_ANNAX_DM3 ANNAX_DM3 2310
2299cerebric MACH_CEREBRIC CEREBRIC 2311
2300orca MACH_ORCA ORCA 2312
2301pc9260 MACH_PC9260 PC9260 2313
2302ems285a MACH_EMS285A EMS285A 2314
2303gec2410 MACH_GEC2410 GEC2410 2315
2304gec2440 MACH_GEC2440 GEC2440 2316
2305mw903 MACH_ARCH_MW903 ARCH_MW903 2317
2306mw2440 MACH_MW2440 MW2440 2318
2307ecac2378 MACH_ECAC2378 ECAC2378 2319
2308tazkiosk MACH_TAZKIOSK TAZKIOSK 2320
2309whiterabbit_mch MACH_WHITERABBIT_MCH WHITERABBIT_MCH 2321
2310sbox9263 MACH_SBOX9263 SBOX9263 2322
2311oreo MACH_OREO OREO 2323
2312smdk6442 MACH_SMDK6442 SMDK6442 2324 404smdk6442 MACH_SMDK6442 SMDK6442 2324
2313openrd_base MACH_OPENRD_BASE OPENRD_BASE 2325 405openrd_base MACH_OPENRD_BASE OPENRD_BASE 2325
2314incredible MACH_INCREDIBLE INCREDIBLE 2326
2315incrediblec MACH_INCREDIBLEC INCREDIBLEC 2327
2316heroct MACH_HEROCT HEROCT 2328
2317mmnet1000 MACH_MMNET1000 MMNET1000 2329
2318devkit8000 MACH_DEVKIT8000 DEVKIT8000 2330 406devkit8000 MACH_DEVKIT8000 DEVKIT8000 2330
2319devkit9000 MACH_DEVKIT9000 DEVKIT9000 2331
2320mx31txtr MACH_MX31TXTR MX31TXTR 2332
2321u380 MACH_U380 U380 2333
2322oamp3_hualu MACH_HUALU_BOARD HUALU_BOARD 2334
2323npcmx50 MACH_NPCMX50 NPCMX50 2335
2324mx51_efikamx MACH_MX51_EFIKAMX MX51_EFIKAMX 2336 407mx51_efikamx MACH_MX51_EFIKAMX MX51_EFIKAMX 2336
2325mx51_lange52 MACH_MX51_LANGE52 MX51_LANGE52 2337
2326riom MACH_RIOM RIOM 2338
2327comcas MACH_COMCAS COMCAS 2339
2328wsi_mx27 MACH_WSI_MX27 WSI_MX27 2340
2329cm_t35 MACH_CM_T35 CM_T35 2341 408cm_t35 MACH_CM_T35 CM_T35 2341
2330net2big MACH_NET2BIG NET2BIG 2342 409net2big MACH_NET2BIG NET2BIG 2342
2331motorola_a1600 MACH_MOTOROLA_A1600 MOTOROLA_A1600 2343
2332igep0020 MACH_IGEP0020 IGEP0020 2344 410igep0020 MACH_IGEP0020 IGEP0020 2344
2333igep0010 MACH_IGEP0010 IGEP0010 2345
2334mv6281gtwge2 MACH_MV6281GTWGE2 MV6281GTWGE2 2346
2335scat100 MACH_SCAT100 SCAT100 2347
2336sanmina MACH_SANMINA SANMINA 2348
2337momento MACH_MOMENTO MOMENTO 2349
2338nuc9xx MACH_NUC9XX NUC9XX 2350
2339nuc910evb MACH_NUC910EVB NUC910EVB 2351
2340nuc920evb MACH_NUC920EVB NUC920EVB 2352
2341nuc950evb MACH_NUC950EVB NUC950EVB 2353
2342nuc945evb MACH_NUC945EVB NUC945EVB 2354
2343nuc960evb MACH_NUC960EVB NUC960EVB 2355
2344nuc932evb MACH_NUC932EVB NUC932EVB 2356 411nuc932evb MACH_NUC932EVB NUC932EVB 2356
2345nuc900 MACH_NUC900 NUC900 2357
2346sd1soc MACH_SD1SOC SD1SOC 2358
2347ln2440bc MACH_LN2440BC LN2440BC 2359
2348rsbc MACH_RSBC RSBC 2360
2349openrd_client MACH_OPENRD_CLIENT OPENRD_CLIENT 2361 412openrd_client MACH_OPENRD_CLIENT OPENRD_CLIENT 2361
2350hpipaq11x MACH_HPIPAQ11X HPIPAQ11X 2362
2351wayland MACH_WAYLAND WAYLAND 2363
2352acnbsx102 MACH_ACNBSX102 ACNBSX102 2364
2353hwat91 MACH_HWAT91 HWAT91 2365
2354at91sam9263cs MACH_AT91SAM9263CS AT91SAM9263CS 2366
2355csb732 MACH_CSB732 CSB732 2367
2356u8500 MACH_U8500 U8500 2368 413u8500 MACH_U8500 U8500 2368
2357huqiu MACH_HUQIU HUQIU 2369
2358mx51_efikasb MACH_MX51_EFIKASB MX51_EFIKASB 2370 414mx51_efikasb MACH_MX51_EFIKASB MX51_EFIKASB 2370
2359pmt1g MACH_PMT1G PMT1G 2371
2360htcelf MACH_HTCELF HTCELF 2372
2361armadillo420 MACH_ARMADILLO420 ARMADILLO420 2373
2362armadillo440 MACH_ARMADILLO440 ARMADILLO440 2374
2363u_chip_dual_arm MACH_U_CHIP_DUAL_ARM U_CHIP_DUAL_ARM 2375
2364csr_bdb3 MACH_CSR_BDB3 CSR_BDB3 2376
2365dolby_cat1018 MACH_DOLBY_CAT1018 DOLBY_CAT1018 2377
2366hy9307 MACH_HY9307 HY9307 2378
2367aspire_easystore MACH_A_ES A_ES 2379
2368davinci_irif MACH_DAVINCI_IRIF DAVINCI_IRIF 2380
2369agama9263 MACH_AGAMA9263 AGAMA9263 2381
2370marvell_jasper MACH_MARVELL_JASPER MARVELL_JASPER 2382 415marvell_jasper MACH_MARVELL_JASPER MARVELL_JASPER 2382
2371flint MACH_FLINT FLINT 2383 416flint MACH_FLINT FLINT 2383
2372tavorevb3 MACH_TAVOREVB3 TAVOREVB3 2384 417tavorevb3 MACH_TAVOREVB3 TAVOREVB3 2384
2373sch_m490 MACH_SCH_M490 SCH_M490 2386
2374rbl01 MACH_RBL01 RBL01 2387
2375omnifi MACH_OMNIFI OMNIFI 2388
2376otavalo MACH_OTAVALO OTAVALO 2389
2377sienna MACH_SIENNA SIENNA 2390
2378htc_excalibur_s620 MACH_HTC_EXCALIBUR_S620 HTC_EXCALIBUR_S620 2391
2379htc_opal MACH_HTC_OPAL HTC_OPAL 2392
2380touchbook MACH_TOUCHBOOK TOUCHBOOK 2393 418touchbook MACH_TOUCHBOOK TOUCHBOOK 2393
2381latte MACH_LATTE LATTE 2394
2382xa200 MACH_XA200 XA200 2395
2383nimrod MACH_NIMROD NIMROD 2396
2384cc9p9215_3g MACH_CC9P9215_3G CC9P9215_3G 2397
2385cc9p9215_3gjs MACH_CC9P9215_3GJS CC9P9215_3GJS 2398
2386tk71 MACH_TK71 TK71 2399
2387comham3525 MACH_COMHAM3525 COMHAM3525 2400
2388mx31erebus MACH_MX31EREBUS MX31EREBUS 2401
2389mcardmx27 MACH_MCARDMX27 MCARDMX27 2402
2390paradise MACH_PARADISE PARADISE 2403
2391tide MACH_TIDE TIDE 2404
2392wzl2440 MACH_WZL2440 WZL2440 2405
2393sdrdemo MACH_SDRDEMO SDRDEMO 2406
2394ethercan2 MACH_ETHERCAN2 ETHERCAN2 2407
2395ecmimg20 MACH_ECMIMG20 ECMIMG20 2408
2396omap_dragon MACH_OMAP_DRAGON OMAP_DRAGON 2409
2397halo MACH_HALO HALO 2410
2398huangshan MACH_HUANGSHAN HUANGSHAN 2411
2399vl_ma2sc MACH_VL_MA2SC VL_MA2SC 2412
2400raumfeld_rc MACH_RAUMFELD_RC RAUMFELD_RC 2413 419raumfeld_rc MACH_RAUMFELD_RC RAUMFELD_RC 2413
2401raumfeld_connector MACH_RAUMFELD_CONNECTOR RAUMFELD_CONNECTOR 2414 420raumfeld_connector MACH_RAUMFELD_CONNECTOR RAUMFELD_CONNECTOR 2414
2402raumfeld_speaker MACH_RAUMFELD_SPEAKER RAUMFELD_SPEAKER 2415 421raumfeld_speaker MACH_RAUMFELD_SPEAKER RAUMFELD_SPEAKER 2415
2403multibus_master MACH_MULTIBUS_MASTER MULTIBUS_MASTER 2416
2404multibus_pbk MACH_MULTIBUS_PBK MULTIBUS_PBK 2417
2405tnetv107x MACH_TNETV107X TNETV107X 2418 422tnetv107x MACH_TNETV107X TNETV107X 2418
2406snake MACH_SNAKE SNAKE 2419
2407cwmx27 MACH_CWMX27 CWMX27 2420
2408sch_m480 MACH_SCH_M480 SCH_M480 2421
2409platypus MACH_PLATYPUS PLATYPUS 2422
2410pss2 MACH_PSS2 PSS2 2423
2411davinci_apm150 MACH_DAVINCI_APM150 DAVINCI_APM150 2424
2412str9100 MACH_STR9100 STR9100 2425
2413net5big MACH_NET5BIG NET5BIG 2426
2414seabed9263 MACH_SEABED9263 SEABED9263 2427
2415mx51_m2id MACH_MX51_M2ID MX51_M2ID 2428
2416octvocplus_eb MACH_OCTVOCPLUS_EB OCTVOCPLUS_EB 2429
2417klk_firefox MACH_KLK_FIREFOX KLK_FIREFOX 2430
2418klk_wirma_module MACH_KLK_WIRMA_MODULE KLK_WIRMA_MODULE 2431
2419klk_wirma_mmi MACH_KLK_WIRMA_MMI KLK_WIRMA_MMI 2432
2420supersonic MACH_SUPERSONIC SUPERSONIC 2433
2421liberty MACH_LIBERTY LIBERTY 2434
2422mh355 MACH_MH355 MH355 2435
2423pc7802 MACH_PC7802 PC7802 2436
2424gnet_sgc MACH_GNET_SGC GNET_SGC 2437
2425einstein15 MACH_EINSTEIN15 EINSTEIN15 2438
2426cmpd MACH_CMPD CMPD 2439
2427davinci_hase1 MACH_DAVINCI_HASE1 DAVINCI_HASE1 2440
2428lgeincitephone MACH_LGEINCITEPHONE LGEINCITEPHONE 2441
2429ea313x MACH_EA313X EA313X 2442
2430fwbd_39064 MACH_FWBD_39064 FWBD_39064 2443
2431fwbd_390128 MACH_FWBD_390128 FWBD_390128 2444
2432pelco_moe MACH_PELCO_MOE PELCO_MOE 2445
2433minimix27 MACH_MINIMIX27 MINIMIX27 2446
2434omap3_thunder MACH_OMAP3_THUNDER OMAP3_THUNDER 2447
2435passionc MACH_PASSIONC PASSIONC 2448
2436mx27amata MACH_MX27AMATA MX27AMATA 2449
2437bgat1 MACH_BGAT1 BGAT1 2450
2438buzz MACH_BUZZ BUZZ 2451
2439mb9g20 MACH_MB9G20 MB9G20 2452
2440yushan MACH_YUSHAN YUSHAN 2453
2441lizard MACH_LIZARD LIZARD 2454
2442omap3polycom MACH_OMAP3POLYCOM OMAP3POLYCOM 2455
2443smdkv210 MACH_SMDKV210 SMDKV210 2456 423smdkv210 MACH_SMDKV210 SMDKV210 2456
2444bravo MACH_BRAVO BRAVO 2457
2445siogentoo1 MACH_SIOGENTOO1 SIOGENTOO1 2458
2446siogentoo2 MACH_SIOGENTOO2 SIOGENTOO2 2459
2447sm3k MACH_SM3K SM3K 2460
2448acer_tempo_f900 MACH_ACER_TEMPO_F900 ACER_TEMPO_F900 2461
2449sst61vc010_dev MACH_SST61VC010_DEV SST61VC010_DEV 2462
2450glittertind MACH_GLITTERTIND GLITTERTIND 2463
2451omap_zoom3 MACH_OMAP_ZOOM3 OMAP_ZOOM3 2464 424omap_zoom3 MACH_OMAP_ZOOM3 OMAP_ZOOM3 2464
2452omap_3630sdp MACH_OMAP_3630SDP OMAP_3630SDP 2465 425omap_3630sdp MACH_OMAP_3630SDP OMAP_3630SDP 2465
2453cybook2440 MACH_CYBOOK2440 CYBOOK2440 2466
2454torino_s MACH_TORINO_S TORINO_S 2467
2455havana MACH_HAVANA HAVANA 2468
2456beaumont_11 MACH_BEAUMONT_11 BEAUMONT_11 2469
2457vanguard MACH_VANGUARD VANGUARD 2470
2458s5pc110_draco MACH_S5PC110_DRACO S5PC110_DRACO 2471
2459cartesio_two MACH_CARTESIO_TWO CARTESIO_TWO 2472
2460aster MACH_ASTER ASTER 2473
2461voguesv210 MACH_VOGUESV210 VOGUESV210 2474
2462acm500x MACH_ACM500X ACM500X 2475
2463km9260 MACH_KM9260 KM9260 2476
2464nideflexg1 MACH_NIDEFLEXG1 NIDEFLEXG1 2477
2465ctera_plug_io MACH_CTERA_PLUG_IO CTERA_PLUG_IO 2478
2466smartq7 MACH_SMARTQ7 SMARTQ7 2479 426smartq7 MACH_SMARTQ7 SMARTQ7 2479
2467at91sam9g10ek2 MACH_AT91SAM9G10EK2 AT91SAM9G10EK2 2480
2468asusp527 MACH_ASUSP527 ASUSP527 2481
2469at91sam9g20mpm2 MACH_AT91SAM9G20MPM2 AT91SAM9G20MPM2 2482
2470topasa900 MACH_TOPASA900 TOPASA900 2483
2471electrum_100 MACH_ELECTRUM_100 ELECTRUM_100 2484
2472mx51grb MACH_MX51GRB MX51GRB 2485
2473xea300 MACH_XEA300 XEA300 2486
2474htcstartrek MACH_HTCSTARTREK HTCSTARTREK 2487
2475lima MACH_LIMA LIMA 2488
2476csb740 MACH_CSB740 CSB740 2489
2477usb_s8815 MACH_USB_S8815 USB_S8815 2490
2478watson_efm_plugin MACH_WATSON_EFM_PLUGIN WATSON_EFM_PLUGIN 2491
2479milkyway MACH_MILKYWAY MILKYWAY 2492
2480g4evm MACH_G4EVM G4EVM 2493 427g4evm MACH_G4EVM G4EVM 2493
2481picomod6 MACH_PICOMOD6 PICOMOD6 2494
2482omapl138_hawkboard MACH_OMAPL138_HAWKBOARD OMAPL138_HAWKBOARD 2495 428omapl138_hawkboard MACH_OMAPL138_HAWKBOARD OMAPL138_HAWKBOARD 2495
2483ip6000 MACH_IP6000 IP6000 2496
2484ip6010 MACH_IP6010 IP6010 2497
2485utm400 MACH_UTM400 UTM400 2498
2486omap3_zybex MACH_OMAP3_ZYBEX OMAP3_ZYBEX 2499
2487wireless_space MACH_WIRELESS_SPACE WIRELESS_SPACE 2500
2488sx560 MACH_SX560 SX560 2501
2489ts41x MACH_TS41X TS41X 2502 429ts41x MACH_TS41X TS41X 2502
2490elphel10373 MACH_ELPHEL10373 ELPHEL10373 2503
2491rhobot MACH_RHOBOT RHOBOT 2504
2492mx51_refresh MACH_MX51_REFRESH MX51_REFRESH 2505
2493ls9260 MACH_LS9260 LS9260 2506
2494shank MACH_SHANK SHANK 2507
2495qsd8x50_st1 MACH_QSD8X50_ST1 QSD8X50_ST1 2508
2496at91sam9m10ekes MACH_AT91SAM9M10EKES AT91SAM9M10EKES 2509
2497hiram MACH_HIRAM HIRAM 2510
2498phy3250 MACH_PHY3250 PHY3250 2511 430phy3250 MACH_PHY3250 PHY3250 2511
2499ea3250 MACH_EA3250 EA3250 2512
2500fdi3250 MACH_FDI3250 FDI3250 2513
2501whitestone MACH_WHITESTONE WHITESTONE 2514
2502at91sam9263nit MACH_AT91SAM9263NIT AT91SAM9263NIT 2515
2503ccmx51 MACH_CCMX51 CCMX51 2516
2504ccmx51js MACH_CCMX51JS CCMX51JS 2517
2505ccwmx51 MACH_CCWMX51 CCWMX51 2518
2506ccwmx51js MACH_CCWMX51JS CCWMX51JS 2519
2507mini6410 MACH_MINI6410 MINI6410 2520 431mini6410 MACH_MINI6410 MINI6410 2520
2508tiny6410 MACH_TINY6410 TINY6410 2521
2509nano6410 MACH_NANO6410 NANO6410 2522
2510at572d940hfnldb MACH_AT572D940HFNLDB AT572D940HFNLDB 2523
2511htcleo MACH_HTCLEO HTCLEO 2524
2512avp13 MACH_AVP13 AVP13 2525
2513xxsvideod MACH_XXSVIDEOD XXSVIDEOD 2526
2514vpnext MACH_VPNEXT VPNEXT 2527
2515swarco_itc3 MACH_SWARCO_ITC3 SWARCO_ITC3 2528
2516tx51 MACH_TX51 TX51 2529
2517dolby_cat1021 MACH_DOLBY_CAT1021 DOLBY_CAT1021 2530
2518mx28evk MACH_MX28EVK MX28EVK 2531 432mx28evk MACH_MX28EVK MX28EVK 2531
2519phoenix260 MACH_PHOENIX260 PHOENIX260 2532
2520uvaca_stork MACH_UVACA_STORK UVACA_STORK 2533
2521smartq5 MACH_SMARTQ5 SMARTQ5 2534 433smartq5 MACH_SMARTQ5 SMARTQ5 2534
2522all3078 MACH_ALL3078 ALL3078 2535
2523ctera_2bay_ds MACH_CTERA_2BAY_DS CTERA_2BAY_DS 2536
2524siogentoo3 MACH_SIOGENTOO3 SIOGENTOO3 2537
2525epb5000 MACH_EPB5000 EPB5000 2538
2526hy9263 MACH_HY9263 HY9263 2539
2527acer_tempo_m900 MACH_ACER_TEMPO_M900 ACER_TEMPO_M900 2540
2528acer_tempo_dx650 MACH_ACER_TEMPO_DX900 ACER_TEMPO_DX900 2541
2529acer_tempo_x960 MACH_ACER_TEMPO_X960 ACER_TEMPO_X960 2542
2530acer_eten_v900 MACH_ACER_ETEN_V900 ACER_ETEN_V900 2543
2531acer_eten_x900 MACH_ACER_ETEN_X900 ACER_ETEN_X900 2544
2532bonnell MACH_BONNELL BONNELL 2545
2533oht_mx27 MACH_OHT_MX27 OHT_MX27 2546
2534htcquartz MACH_HTCQUARTZ HTCQUARTZ 2547
2535davinci_dm6467tevm MACH_DAVINCI_DM6467TEVM DAVINCI_DM6467TEVM 2548 434davinci_dm6467tevm MACH_DAVINCI_DM6467TEVM DAVINCI_DM6467TEVM 2548
2536c3ax03 MACH_C3AX03 C3AX03 2549
2537mxt_td60 MACH_MXT_TD60 MXT_TD60 2550 435mxt_td60 MACH_MXT_TD60 MXT_TD60 2550
2538esyx MACH_ESYX ESYX 2551
2539dove_db2 MACH_DOVE_DB2 DOVE_DB2 2552
2540bulldog MACH_BULLDOG BULLDOG 2553
2541derell_me2000 MACH_DERELL_ME2000 DERELL_ME2000 2554
2542bcmring_base MACH_BCMRING_BASE BCMRING_BASE 2555
2543bcmring_evm MACH_BCMRING_EVM BCMRING_EVM 2556
2544bcmring_evm_jazz MACH_BCMRING_EVM_JAZZ BCMRING_EVM_JAZZ 2557
2545bcmring_sp MACH_BCMRING_SP BCMRING_SP 2558
2546bcmring_sv MACH_BCMRING_SV BCMRING_SV 2559
2547bcmring_sv_jazz MACH_BCMRING_SV_JAZZ BCMRING_SV_JAZZ 2560
2548bcmring_tablet MACH_BCMRING_TABLET BCMRING_TABLET 2561
2549bcmring_vp MACH_BCMRING_VP BCMRING_VP 2562
2550bcmring_evm_seikor MACH_BCMRING_EVM_SEIKOR BCMRING_EVM_SEIKOR 2563
2551bcmring_sp_wqvga MACH_BCMRING_SP_WQVGA BCMRING_SP_WQVGA 2564
2552bcmring_custom MACH_BCMRING_CUSTOM BCMRING_CUSTOM 2565
2553acer_s200 MACH_ACER_S200 ACER_S200 2566
2554bt270 MACH_BT270 BT270 2567
2555iseo MACH_ISEO ISEO 2568
2556cezanne MACH_CEZANNE CEZANNE 2569
2557lucca MACH_LUCCA LUCCA 2570
2558supersmart MACH_SUPERSMART SUPERSMART 2571
2559arm11_board MACH_CS_MISANO CS_MISANO 2572
2560magnolia2 MACH_MAGNOLIA2 MAGNOLIA2 2573
2561emxx MACH_EMXX EMXX 2574
2562outlaw MACH_OUTLAW OUTLAW 2575
2563riot_bei2 MACH_RIOT_BEI2 RIOT_BEI2 2576
2564riot_vox MACH_RIOT_VOX RIOT_VOX 2577
2565riot_x37 MACH_RIOT_X37 RIOT_X37 2578
2566mega25mx MACH_MEGA25MX MEGA25MX 2579
2567benzina2 MACH_BENZINA2 BENZINA2 2580
2568ignite MACH_IGNITE IGNITE 2581
2569foggia MACH_FOGGIA FOGGIA 2582
2570arezzo MACH_AREZZO AREZZO 2583
2571leica_skywalker MACH_LEICA_SKYWALKER LEICA_SKYWALKER 2584
2572jacinto2_jamr MACH_JACINTO2_JAMR JACINTO2_JAMR 2585
2573gts_nova MACH_GTS_NOVA GTS_NOVA 2586
2574p3600 MACH_P3600 P3600 2587
2575dlt2 MACH_DLT2 DLT2 2588
2576df3120 MACH_DF3120 DF3120 2589
2577ecucore_9g20 MACH_ECUCORE_9G20 ECUCORE_9G20 2590
2578nautel_lpc3240 MACH_NAUTEL_LPC3240 NAUTEL_LPC3240 2591
2579glacier MACH_GLACIER GLACIER 2592
2580phrazer_bulldog MACH_PHRAZER_BULLDOG PHRAZER_BULLDOG 2593
2581omap3_bulldog MACH_OMAP3_BULLDOG OMAP3_BULLDOG 2594
2582pca101 MACH_PCA101 PCA101 2595
2583buzzc MACH_BUZZC BUZZC 2596
2584sasie2 MACH_SASIE2 SASIE2 2597
2585davinci_cio MACH_DAVINCI_CIO DAVINCI_CIO 2598
2586smartmeter_dl MACH_SMARTMETER_DL SMARTMETER_DL 2599
2587wzl6410 MACH_WZL6410 WZL6410 2600
2588wzl6410m MACH_WZL6410M WZL6410M 2601
2589wzl6410f MACH_WZL6410F WZL6410F 2602
2590wzl6410i MACH_WZL6410I WZL6410I 2603
2591spacecom1 MACH_SPACECOM1 SPACECOM1 2604
2592pingu920 MACH_PINGU920 PINGU920 2605
2593bravoc MACH_BRAVOC BRAVOC 2606
2594cybo2440 MACH_CYBO2440 CYBO2440 2607
2595vdssw MACH_VDSSW VDSSW 2608
2596romulus MACH_ROMULUS ROMULUS 2609
2597omap_magic MACH_OMAP_MAGIC OMAP_MAGIC 2610
2598eltd100 MACH_ELTD100 ELTD100 2611
2599capc7117 MACH_CAPC7117 CAPC7117 2612 436capc7117 MACH_CAPC7117 CAPC7117 2612
2600swan MACH_SWAN SWAN 2613
2601veu MACH_VEU VEU 2614
2602rm2 MACH_RM2 RM2 2615
2603tt2100 MACH_TT2100 TT2100 2616
2604venice MACH_VENICE VENICE 2617
2605pc7323 MACH_PC7323 PC7323 2618
2606masp MACH_MASP MASP 2619
2607fujitsu_tvstbsoc0 MACH_FUJITSU_TVSTBSOC FUJITSU_TVSTBSOC 2620
2608fujitsu_tvstbsoc1 MACH_FUJITSU_TVSTBSOC1 FUJITSU_TVSTBSOC1 2621
2609lexikon MACH_LEXIKON LEXIKON 2622
2610mini2440v2 MACH_MINI2440V2 MINI2440V2 2623
2611icontrol MACH_ICONTROL ICONTROL 2624 437icontrol MACH_ICONTROL ICONTROL 2624
2612gplugd MACH_SHEEVAD SHEEVAD 2625
2613qsd8x50a_st1_1 MACH_QSD8X50A_ST1_1 QSD8X50A_ST1_1 2626
2614qsd8x50a_st1_5 MACH_QSD8X50A_ST1_5 QSD8X50A_ST1_5 2627 438qsd8x50a_st1_5 MACH_QSD8X50A_ST1_5 QSD8X50A_ST1_5 2627
2615bee MACH_BEE BEE 2628
2616mx23evk MACH_MX23EVK MX23EVK 2629 439mx23evk MACH_MX23EVK MX23EVK 2629
2617ap4evb MACH_AP4EVB AP4EVB 2630 440ap4evb MACH_AP4EVB AP4EVB 2630
2618stockholm MACH_STOCKHOLM STOCKHOLM 2631
2619lpc_h3131 MACH_LPC_H3131 LPC_H3131 2632
2620stingray MACH_STINGRAY STINGRAY 2633
2621kraken MACH_KRAKEN KRAKEN 2634
2622gw2388 MACH_GW2388 GW2388 2635
2623jadecpu MACH_JADECPU JADECPU 2636
2624carlisle MACH_CARLISLE CARLISLE 2637
2625lux_sf9 MACH_LUX_SF9 LUX_SF9 2638
2626nemid_tb MACH_NEMID_TB NEMID_TB 2639
2627terrier MACH_TERRIER TERRIER 2640
2628turbot MACH_TURBOT TURBOT 2641
2629sanddab MACH_SANDDAB SANDDAB 2642
2630mx35_cicada MACH_MX35_CICADA MX35_CICADA 2643
2631ghi2703d MACH_GHI2703D GHI2703D 2644
2632lux_sfx9 MACH_LUX_SFX9 LUX_SFX9 2645
2633lux_sf9g MACH_LUX_SF9G LUX_SF9G 2646
2634lux_edk9 MACH_LUX_EDK9 LUX_EDK9 2647
2635hw90240 MACH_HW90240 HW90240 2648
2636dm365_leopard MACH_DM365_LEOPARD DM365_LEOPARD 2649
2637mityomapl138 MACH_MITYOMAPL138 MITYOMAPL138 2650 441mityomapl138 MACH_MITYOMAPL138 MITYOMAPL138 2650
2638scat110 MACH_SCAT110 SCAT110 2651
2639acer_a1 MACH_ACER_A1 ACER_A1 2652
2640cmcontrol MACH_CMCONTROL CMCONTROL 2653
2641pelco_lamar MACH_PELCO_LAMAR PELCO_LAMAR 2654
2642rfp43 MACH_RFP43 RFP43 2655
2643sk86r0301 MACH_SK86R0301 SK86R0301 2656
2644ctpxa MACH_CTPXA CTPXA 2657
2645epb_arm9_a MACH_EPB_ARM9_A EPB_ARM9_A 2658
2646guruplug MACH_GURUPLUG GURUPLUG 2659 442guruplug MACH_GURUPLUG GURUPLUG 2659
2647spear310 MACH_SPEAR310 SPEAR310 2660 443spear310 MACH_SPEAR310 SPEAR310 2660
2648spear320 MACH_SPEAR320 SPEAR320 2661 444spear320 MACH_SPEAR320 SPEAR320 2661
2649robotx MACH_ROBOTX ROBOTX 2662
2650lsxhl MACH_LSXHL LSXHL 2663
2651smartlite MACH_SMARTLITE SMARTLITE 2664
2652cws2 MACH_CWS2 CWS2 2665
2653m619 MACH_M619 M619 2666
2654smartview MACH_SMARTVIEW SMARTVIEW 2667
2655lsa_salsa MACH_LSA_SALSA LSA_SALSA 2668
2656kizbox MACH_KIZBOX KIZBOX 2669
2657htccharmer MACH_HTCCHARMER HTCCHARMER 2670
2658guf_neso_lt MACH_GUF_NESO_LT GUF_NESO_LT 2671
2659pm9g45 MACH_PM9G45 PM9G45 2672
2660htcpanther MACH_HTCPANTHER HTCPANTHER 2673
2661htcpanther_cdma MACH_HTCPANTHER_CDMA HTCPANTHER_CDMA 2674
2662reb01 MACH_REB01 REB01 2675
2663aquila MACH_AQUILA AQUILA 2676 445aquila MACH_AQUILA AQUILA 2676
2664spark_sls_hw2 MACH_SPARK_SLS_HW2 SPARK_SLS_HW2 2677
2665sheeva_esata MACH_ESATA_SHEEVAPLUG ESATA_SHEEVAPLUG 2678 446sheeva_esata MACH_ESATA_SHEEVAPLUG ESATA_SHEEVAPLUG 2678
2666msm7x30_surf MACH_MSM7X30_SURF MSM7X30_SURF 2679 447msm7x30_surf MACH_MSM7X30_SURF MSM7X30_SURF 2679
2667micro2440 MACH_MICRO2440 MICRO2440 2680
2668am2440 MACH_AM2440 AM2440 2681
2669tq2440 MACH_TQ2440 TQ2440 2682
2670lpc2478oem MACH_LPC2478OEM LPC2478OEM 2683
2671ak880x MACH_AK880X AK880X 2684
2672cobra3530 MACH_COBRA3530 COBRA3530 2685
2673pmppb MACH_PMPPB PMPPB 2686
2674u6715 MACH_U6715 U6715 2687
2675axar1500_sender MACH_AXAR1500_SENDER AXAR1500_SENDER 2688
2676g30_dvb MACH_G30_DVB G30_DVB 2689
2677vc088x MACH_VC088X VC088X 2690
2678mioa702 MACH_MIOA702 MIOA702 2691
2679hpmin MACH_HPMIN HPMIN 2692
2680ak880xak MACH_AK880XAK AK880XAK 2693
2681arm926tomap850 MACH_ARM926TOMAP850 ARM926TOMAP850 2694
2682lkevm MACH_LKEVM LKEVM 2695
2683mw6410 MACH_MW6410 MW6410 2696
2684terastation_wxl MACH_TERASTATION_WXL TERASTATION_WXL 2697 448terastation_wxl MACH_TERASTATION_WXL TERASTATION_WXL 2697
2685cpu8000e MACH_CPU8000E CPU8000E 2698
2686catania MACH_CATANIA CATANIA 2699
2687tokyo MACH_TOKYO TOKYO 2700
2688msm7201a_surf MACH_MSM7201A_SURF MSM7201A_SURF 2701
2689msm7201a_ffa MACH_MSM7201A_FFA MSM7201A_FFA 2702
2690msm7x25_surf MACH_MSM7X25_SURF MSM7X25_SURF 2703 449msm7x25_surf MACH_MSM7X25_SURF MSM7X25_SURF 2703
2691msm7x25_ffa MACH_MSM7X25_FFA MSM7X25_FFA 2704 450msm7x25_ffa MACH_MSM7X25_FFA MSM7X25_FFA 2704
2692msm7x27_surf MACH_MSM7X27_SURF MSM7X27_SURF 2705 451msm7x27_surf MACH_MSM7X27_SURF MSM7X27_SURF 2705
2693msm7x27_ffa MACH_MSM7X27_FFA MSM7X27_FFA 2706 452msm7x27_ffa MACH_MSM7X27_FFA MSM7X27_FFA 2706
2694msm7x30_ffa MACH_MSM7X30_FFA MSM7X30_FFA 2707 453msm7x30_ffa MACH_MSM7X30_FFA MSM7X30_FFA 2707
2695qsd8x50_surf MACH_QSD8X50_SURF QSD8X50_SURF 2708 454qsd8x50_surf MACH_QSD8X50_SURF QSD8X50_SURF 2708
2696qsd8x50_comet MACH_QSD8X50_COMET QSD8X50_COMET 2709
2697qsd8x50_ffa MACH_QSD8X50_FFA QSD8X50_FFA 2710
2698qsd8x50a_surf MACH_QSD8X50A_SURF QSD8X50A_SURF 2711
2699qsd8x50a_ffa MACH_QSD8X50A_FFA QSD8X50A_FFA 2712
2700adx_xgcp10 MACH_ADX_XGCP10 ADX_XGCP10 2713
2701mcgwumts2a MACH_MCGWUMTS2A MCGWUMTS2A 2714
2702mobikt MACH_MOBIKT MOBIKT 2715
2703mx53_evk MACH_MX53_EVK MX53_EVK 2716 455mx53_evk MACH_MX53_EVK MX53_EVK 2716
2704igep0030 MACH_IGEP0030 IGEP0030 2717 456igep0030 MACH_IGEP0030 IGEP0030 2717
2705axell_h40_h50_ctrl MACH_AXELL_H40_H50_CTRL AXELL_H40_H50_CTRL 2718
2706dtcommod MACH_DTCOMMOD DTCOMMOD 2719
2707gould MACH_GOULD GOULD 2720
2708siberia MACH_SIBERIA SIBERIA 2721
2709sbc3530 MACH_SBC3530 SBC3530 2722 457sbc3530 MACH_SBC3530 SBC3530 2722
2710qarm MACH_QARM QARM 2723
2711mips MACH_MIPS MIPS 2724
2712mx27grb MACH_MX27GRB MX27GRB 2725
2713sbc8100 MACH_SBC8100 SBC8100 2726
2714saarb MACH_SAARB SAARB 2727 458saarb MACH_SAARB SAARB 2727
2715omap3mini MACH_OMAP3MINI OMAP3MINI 2728
2716cnmbook7se MACH_CNMBOOK7SE CNMBOOK7SE 2729
2717catan MACH_CATAN CATAN 2730
2718harmony MACH_HARMONY HARMONY 2731 459harmony MACH_HARMONY HARMONY 2731
2719tonga MACH_TONGA TONGA 2732
2720cybook_orizon MACH_CYBOOK_ORIZON CYBOOK_ORIZON 2733
2721htcrhodiumcdma MACH_HTCRHODIUMCDMA HTCRHODIUMCDMA 2734
2722epc_g45 MACH_EPC_G45 EPC_G45 2735
2723epc_lpc3250 MACH_EPC_LPC3250 EPC_LPC3250 2736
2724mxc91341evb MACH_MXC91341EVB MXC91341EVB 2737
2725rtw1000 MACH_RTW1000 RTW1000 2738
2726bobcat MACH_BOBCAT BOBCAT 2739
2727trizeps6 MACH_TRIZEPS6 TRIZEPS6 2740
2728msm7x30_fluid MACH_MSM7X30_FLUID MSM7X30_FLUID 2741 460msm7x30_fluid MACH_MSM7X30_FLUID MSM7X30_FLUID 2741
2729nedap9263 MACH_NEDAP9263 NEDAP9263 2742
2730netgear_ms2110 MACH_NETGEAR_MS2110 NETGEAR_MS2110 2743
2731bmx MACH_BMX BMX 2744
2732netstream MACH_NETSTREAM NETSTREAM 2745
2733vpnext_rcu MACH_VPNEXT_RCU VPNEXT_RCU 2746
2734vpnext_mpu MACH_VPNEXT_MPU VPNEXT_MPU 2747
2735bcmring_tablet_v1 MACH_BCMRING_TABLET_V1 BCMRING_TABLET_V1 2748
2736sgarm10 MACH_SGARM10 SGARM10 2749
2737cm_t3517 MACH_CM_T3517 CM_T3517 2750 461cm_t3517 MACH_CM_T3517 CM_T3517 2750
2738omap3_cps MACH_OMAP3_CPS OMAP3_CPS 2751
2739axar1500_receiver MACH_AXAR1500_RECEIVER AXAR1500_RECEIVER 2752
2740wbd222 MACH_WBD222 WBD222 2753 462wbd222 MACH_WBD222 WBD222 2753
2741mt65xx MACH_MT65XX MT65XX 2754
2742msm8x60_surf MACH_MSM8X60_SURF MSM8X60_SURF 2755 463msm8x60_surf MACH_MSM8X60_SURF MSM8X60_SURF 2755
2743msm8x60_sim MACH_MSM8X60_SIM MSM8X60_SIM 2756 464msm8x60_sim MACH_MSM8X60_SIM MSM8X60_SIM 2756
2744vmc300 MACH_VMC300 VMC300 2757
2745tcc8000_sdk MACH_TCC8000_SDK TCC8000_SDK 2758 465tcc8000_sdk MACH_TCC8000_SDK TCC8000_SDK 2758
2746nanos MACH_NANOS NANOS 2759
2747stamp9g10 MACH_STAMP9G10 STAMP9G10 2760
2748stamp9g45 MACH_STAMP9G45 STAMP9G45 2761
2749h6053 MACH_H6053 H6053 2762
2750smint01 MACH_SMINT01 SMINT01 2763
2751prtlvt2 MACH_PRTLVT2 PRTLVT2 2764
2752ap420 MACH_AP420 AP420 2765 466ap420 MACH_AP420 AP420 2765
2753htcshift MACH_HTCSHIFT HTCSHIFT 2766
2754davinci_dm365_fc MACH_DAVINCI_DM365_FC DAVINCI_DM365_FC 2767 467davinci_dm365_fc MACH_DAVINCI_DM365_FC DAVINCI_DM365_FC 2767
2755msm8x55_surf MACH_MSM8X55_SURF MSM8X55_SURF 2768 468msm8x55_surf MACH_MSM8X55_SURF MSM8X55_SURF 2768
2756msm8x55_ffa MACH_MSM8X55_FFA MSM8X55_FFA 2769 469msm8x55_ffa MACH_MSM8X55_FFA MSM8X55_FFA 2769
@@ -2761,7 +474,6 @@ oreo_controller MACH_OREO_CONTROLLER OREO_CONTROLLER 2773
2761kopin_models MACH_KOPIN_MODELS KOPIN_MODELS 2774 474kopin_models MACH_KOPIN_MODELS KOPIN_MODELS 2774
2762ttc_vision2 MACH_TTC_VISION2 TTC_VISION2 2775 475ttc_vision2 MACH_TTC_VISION2 TTC_VISION2 2775
2763cns3420vb MACH_CNS3420VB CNS3420VB 2776 476cns3420vb MACH_CNS3420VB CNS3420VB 2776
2764lpc2 MACH_LPC2 LPC2 2777
2765olympus MACH_OLYMPUS OLYMPUS 2778 477olympus MACH_OLYMPUS OLYMPUS 2778
2766vortex MACH_VORTEX VORTEX 2779 478vortex MACH_VORTEX VORTEX 2779
2767s5pc200 MACH_S5PC200 S5PC200 2780 479s5pc200 MACH_S5PC200 S5PC200 2780
@@ -2788,7 +500,6 @@ ti8168evm MACH_TI8168EVM TI8168EVM 2800
2788neocoreomap MACH_NEOCOREOMAP NEOCOREOMAP 2801 500neocoreomap MACH_NEOCOREOMAP NEOCOREOMAP 2801
2789withings_wbp MACH_WITHINGS_WBP WITHINGS_WBP 2802 501withings_wbp MACH_WITHINGS_WBP WITHINGS_WBP 2802
2790dbps MACH_DBPS DBPS 2803 502dbps MACH_DBPS DBPS 2803
2791sbc9261 MACH_SBC9261 SBC9261 2804
2792pcbfp0001 MACH_PCBFP0001 PCBFP0001 2805 503pcbfp0001 MACH_PCBFP0001 PCBFP0001 2805
2793speedy MACH_SPEEDY SPEEDY 2806 504speedy MACH_SPEEDY SPEEDY 2806
2794chrysaor MACH_CHRYSAOR CHRYSAOR 2807 505chrysaor MACH_CHRYSAOR CHRYSAOR 2807
@@ -2812,7 +523,6 @@ p565 MACH_P565 P565 2824
2812acer_a4 MACH_ACER_A4 ACER_A4 2825 523acer_a4 MACH_ACER_A4 ACER_A4 2825
2813davinci_dm368_bip MACH_DAVINCI_DM368_BIP DAVINCI_DM368_BIP 2826 524davinci_dm368_bip MACH_DAVINCI_DM368_BIP DAVINCI_DM368_BIP 2826
2814eshare MACH_ESHARE ESHARE 2827 525eshare MACH_ESHARE ESHARE 2827
2815hw_omapl138_europa MACH_HW_OMAPL138_EUROPA HW_OMAPL138_EUROPA 2828
2816wlbargn MACH_WLBARGN WLBARGN 2829 526wlbargn MACH_WLBARGN WLBARGN 2829
2817bm170 MACH_BM170 BM170 2830 527bm170 MACH_BM170 BM170 2830
2818netspace_mini_v2 MACH_NETSPACE_MINI_V2 NETSPACE_MINI_V2 2831 528netspace_mini_v2 MACH_NETSPACE_MINI_V2 NETSPACE_MINI_V2 2831
@@ -2879,7 +589,6 @@ davinci_picto MACH_DAVINCI_PICTO DAVINCI_PICTO 2891
2879mecha MACH_MECHA MECHA 2892 589mecha MACH_MECHA MECHA 2892
2880bubba3 MACH_BUBBA3 BUBBA3 2893 590bubba3 MACH_BUBBA3 BUBBA3 2893
2881pupitre MACH_PUPITRE PUPITRE 2894 591pupitre MACH_PUPITRE PUPITRE 2894
2882tegra_harmony MACH_TEGRA_HARMONY TEGRA_HARMONY 2895
2883tegra_vogue MACH_TEGRA_VOGUE TEGRA_VOGUE 2896 592tegra_vogue MACH_TEGRA_VOGUE TEGRA_VOGUE 2896
2884tegra_e1165 MACH_TEGRA_E1165 TEGRA_E1165 2897 593tegra_e1165 MACH_TEGRA_E1165 TEGRA_E1165 2897
2885simplenet MACH_SIMPLENET SIMPLENET 2898 594simplenet MACH_SIMPLENET SIMPLENET 2898
@@ -2969,7 +678,6 @@ netspace_lite_v2 MACH_NETSPACE_LITE_V2 NETSPACE_LITE_V2 2983
2969ssc MACH_SSC SSC 2984 678ssc MACH_SSC SSC 2984
2970premierwave_en MACH_PREMIERWAVE_EN PREMIERWAVE_EN 2985 679premierwave_en MACH_PREMIERWAVE_EN PREMIERWAVE_EN 2985
2971wasabi MACH_WASABI WASABI 2986 680wasabi MACH_WASABI WASABI 2986
2972vivow MACH_VIVOW VIVOW 2987
2973mx50_rdp MACH_MX50_RDP MX50_RDP 2988 681mx50_rdp MACH_MX50_RDP MX50_RDP 2988
2974universal_c210 MACH_UNIVERSAL_C210 UNIVERSAL_C210 2989 682universal_c210 MACH_UNIVERSAL_C210 UNIVERSAL_C210 2989
2975real6410 MACH_REAL6410 REAL6410 2990 683real6410 MACH_REAL6410 REAL6410 2990
@@ -2987,7 +695,7 @@ pxwnas_500_1000 MACH_PXWNAS_500_1000 PXWNAS_500_1000 3001
2987ea20 MACH_EA20 EA20 3002 695ea20 MACH_EA20 EA20 3002
2988awm2 MACH_AWM2 AWM2 3003 696awm2 MACH_AWM2 AWM2 3003
2989ti8148evm MACH_TI8148EVM TI8148EVM 3004 697ti8148evm MACH_TI8148EVM TI8148EVM 3004
2990tegra_seaboard MACH_TEGRA_SEABOARD TEGRA_SEABOARD 3005 698seaboard MACH_SEABOARD SEABOARD 3005
2991linkstation_chlv2 MACH_LINKSTATION_CHLV2 LINKSTATION_CHLV2 3006 699linkstation_chlv2 MACH_LINKSTATION_CHLV2 LINKSTATION_CHLV2 3006
2992tera_pro2_rack MACH_TERA_PRO2_RACK TERA_PRO2_RACK 3007 700tera_pro2_rack MACH_TERA_PRO2_RACK TERA_PRO2_RACK 3007
2993rubys MACH_RUBYS RUBYS 3008 701rubys MACH_RUBYS RUBYS 3008
@@ -3017,12 +725,10 @@ remus MACH_REMUS REMUS 3031
3017at91cap7xdk MACH_AT91CAP7XDK AT91CAP7XDK 3032 725at91cap7xdk MACH_AT91CAP7XDK AT91CAP7XDK 3032
3018at91cap7stk MACH_AT91CAP7STK AT91CAP7STK 3033 726at91cap7stk MACH_AT91CAP7STK AT91CAP7STK 3033
3019kt_sbc_sam9_1 MACH_KT_SBC_SAM9_1 KT_SBC_SAM9_1 3034 727kt_sbc_sam9_1 MACH_KT_SBC_SAM9_1 KT_SBC_SAM9_1 3034
3020oratisrouter MACH_ORATISROUTER ORATISROUTER 3035
3021armada_xp_db MACH_ARMADA_XP_DB ARMADA_XP_DB 3036 728armada_xp_db MACH_ARMADA_XP_DB ARMADA_XP_DB 3036
3022spdm MACH_SPDM SPDM 3037 729spdm MACH_SPDM SPDM 3037
3023gtib MACH_GTIB GTIB 3038 730gtib MACH_GTIB GTIB 3038
3024dgm3240 MACH_DGM3240 DGM3240 3039 731dgm3240 MACH_DGM3240 DGM3240 3039
3025atlas_i_lpe MACH_ATLAS_I_LPE ATLAS_I_LPE 3040
3026htcmega MACH_HTCMEGA HTCMEGA 3041 732htcmega MACH_HTCMEGA HTCMEGA 3041
3027tricorder MACH_TRICORDER TRICORDER 3042 733tricorder MACH_TRICORDER TRICORDER 3042
3028tx28 MACH_TX28 TX28 3043 734tx28 MACH_TX28 TX28 3043
@@ -3062,7 +768,6 @@ clod MACH_CLOD CLOD 3077
3062rump MACH_RUMP RUMP 3078 768rump MACH_RUMP RUMP 3078
3063tenderloin MACH_TENDERLOIN TENDERLOIN 3079 769tenderloin MACH_TENDERLOIN TENDERLOIN 3079
3064shortloin MACH_SHORTLOIN SHORTLOIN 3080 770shortloin MACH_SHORTLOIN SHORTLOIN 3080
3065crespo MACH_CRESPO CRESPO 3081
3066antares MACH_ANTARES ANTARES 3082 771antares MACH_ANTARES ANTARES 3082
3067wb40n MACH_WB40N WB40N 3083 772wb40n MACH_WB40N WB40N 3083
3068herring MACH_HERRING HERRING 3084 773herring MACH_HERRING HERRING 3084
@@ -3111,7 +816,6 @@ smartqv3 MACH_SMARTQV3 SMARTQV3 3126
3111smartqv7 MACH_SMARTQV7 SMARTQV7 3127 816smartqv7 MACH_SMARTQV7 SMARTQV7 3127
3112paz00 MACH_PAZ00 PAZ00 3128 817paz00 MACH_PAZ00 PAZ00 3128
3113acmenetusfoxg20 MACH_ACMENETUSFOXG20 ACMENETUSFOXG20 3129 818acmenetusfoxg20 MACH_ACMENETUSFOXG20 ACMENETUSFOXG20 3129
3114htcwillow MACH_HTCWILLOW HTCWILLOW 3130
3115fwbd_0404 MACH_FWBD_0404 FWBD_0404 3131 819fwbd_0404 MACH_FWBD_0404 FWBD_0404 3131
3116hdgu MACH_HDGU HDGU 3132 820hdgu MACH_HDGU HDGU 3132
3117pyramid MACH_PYRAMID PYRAMID 3133 821pyramid MACH_PYRAMID PYRAMID 3133
@@ -3162,7 +866,6 @@ b5500 MACH_B5500 B5500 3177
3162s5500 MACH_S5500 S5500 3178 866s5500 MACH_S5500 S5500 3178
3163icon MACH_ICON ICON 3179 867icon MACH_ICON ICON 3179
3164elephant MACH_ELEPHANT ELEPHANT 3180 868elephant MACH_ELEPHANT ELEPHANT 3180
3165msm8x60_fusion MACH_MSM8X60_FUSION MSM8X60_FUSION 3181
3166shooter MACH_SHOOTER SHOOTER 3182 869shooter MACH_SHOOTER SHOOTER 3182
3167spade_lte MACH_SPADE_LTE SPADE_LTE 3183 870spade_lte MACH_SPADE_LTE SPADE_LTE 3183
3168philhwani MACH_PHILHWANI PHILHWANI 3184 871philhwani MACH_PHILHWANI PHILHWANI 3184
@@ -3174,13 +877,11 @@ ag5evm MACH_AG5EVM AG5EVM 3189
3174sc575plc MACH_SC575PLC SC575PLC 3190 877sc575plc MACH_SC575PLC SC575PLC 3190
3175sc575hmi MACH_SC575IPC SC575IPC 3191 878sc575hmi MACH_SC575IPC SC575IPC 3191
3176omap3_tdm3730 MACH_OMAP3_TDM3730 OMAP3_TDM3730 3192 879omap3_tdm3730 MACH_OMAP3_TDM3730 OMAP3_TDM3730 3192
3177g7 MACH_G7 G7 3193
3178top9000_eval MACH_TOP9000_EVAL TOP9000_EVAL 3194 880top9000_eval MACH_TOP9000_EVAL TOP9000_EVAL 3194
3179top9000_su MACH_TOP9000_SU TOP9000_SU 3195 881top9000_su MACH_TOP9000_SU TOP9000_SU 3195
3180utm300 MACH_UTM300 UTM300 3196 882utm300 MACH_UTM300 UTM300 3196
3181tsunagi MACH_TSUNAGI TSUNAGI 3197 883tsunagi MACH_TSUNAGI TSUNAGI 3197
3182ts75xx MACH_TS75XX TS75XX 3198 884ts75xx MACH_TS75XX TS75XX 3198
3183msm8x60_fusn_ffa MACH_MSM8X60_FUSN_FFA MSM8X60_FUSN_FFA 3199
3184ts47xx MACH_TS47XX TS47XX 3200 885ts47xx MACH_TS47XX TS47XX 3200
3185da850_k5 MACH_DA850_K5 DA850_K5 3201 886da850_k5 MACH_DA850_K5 DA850_K5 3201
3186ax502 MACH_AX502 AX502 3202 887ax502 MACH_AX502 AX502 3202
@@ -3190,7 +891,7 @@ synergy MACH_SYNERGY SYNERGY 3205
3190ics_if_voip MACH_ICS_IF_VOIP ICS_IF_VOIP 3206 891ics_if_voip MACH_ICS_IF_VOIP ICS_IF_VOIP 3206
3191wlf_cragg_6410 MACH_WLF_CRAGG_6410 WLF_CRAGG_6410 3207 892wlf_cragg_6410 MACH_WLF_CRAGG_6410 WLF_CRAGG_6410 3207
3192punica MACH_PUNICA PUNICA 3208 893punica MACH_PUNICA PUNICA 3208
3193sbc_nt250 MACH_SBC_NT250 SBC_NT250 3209 894trimslice MACH_TRIMSLICE TRIMSLICE 3209
3194mx27_wmultra MACH_MX27_WMULTRA MX27_WMULTRA 3210 895mx27_wmultra MACH_MX27_WMULTRA MX27_WMULTRA 3210
3195mackerel MACH_MACKEREL MACKEREL 3211 896mackerel MACH_MACKEREL MACKEREL 3211
3196fa9x27 MACH_FA9X27 FA9X27 3213 897fa9x27 MACH_FA9X27 FA9X27 3213
@@ -3219,3 +920,182 @@ pivicc MACH_PIVICC PIVICC 3235
3219pcm048 MACH_PCM048 PCM048 3236 920pcm048 MACH_PCM048 PCM048 3236
3220dds MACH_DDS DDS 3237 921dds MACH_DDS DDS 3237
3221chalten_xa1 MACH_CHALTEN_XA1 CHALTEN_XA1 3238 922chalten_xa1 MACH_CHALTEN_XA1 CHALTEN_XA1 3238
923ts48xx MACH_TS48XX TS48XX 3239
924tonga2_tfttimer MACH_TONGA2_TFTTIMER TONGA2_TFTTIMER 3240
925whistler MACH_WHISTLER WHISTLER 3241
926asl_phoenix MACH_ASL_PHOENIX ASL_PHOENIX 3242
927at91sam9263otlite MACH_AT91SAM9263OTLITE AT91SAM9263OTLITE 3243
928ddplug MACH_DDPLUG DDPLUG 3244
929d2plug MACH_D2PLUG D2PLUG 3245
930kzm9d MACH_KZM9D KZM9D 3246
931verdi_lte MACH_VERDI_LTE VERDI_LTE 3247
932nanozoom MACH_NANOZOOM NANOZOOM 3248
933dm3730_som_lv MACH_DM3730_SOM_LV DM3730_SOM_LV 3249
934dm3730_torpedo MACH_DM3730_TORPEDO DM3730_TORPEDO 3250
935anchovy MACH_ANCHOVY ANCHOVY 3251
936re2rev20 MACH_RE2REV20 RE2REV20 3253
937re2rev21 MACH_RE2REV21 RE2REV21 3254
938cns21xx MACH_CNS21XX CNS21XX 3255
939rider MACH_RIDER RIDER 3257
940nsk330 MACH_NSK330 NSK330 3258
941cns2133evb MACH_CNS2133EVB CNS2133EVB 3259
942z3_816x_mod MACH_Z3_816X_MOD Z3_816X_MOD 3260
943z3_814x_mod MACH_Z3_814X_MOD Z3_814X_MOD 3261
944beect MACH_BEECT BEECT 3262
945dma_thunderbug MACH_DMA_THUNDERBUG DMA_THUNDERBUG 3263
946omn_at91sam9g20 MACH_OMN_AT91SAM9G20 OMN_AT91SAM9G20 3264
947mx25_e2s_uc MACH_MX25_E2S_UC MX25_E2S_UC 3265
948mione MACH_MIONE MIONE 3266
949top9000_tcu MACH_TOP9000_TCU TOP9000_TCU 3267
950top9000_bsl MACH_TOP9000_BSL TOP9000_BSL 3268
951kingdom MACH_KINGDOM KINGDOM 3269
952armadillo460 MACH_ARMADILLO460 ARMADILLO460 3270
953lq2 MACH_LQ2 LQ2 3271
954sweda_tms2 MACH_SWEDA_TMS2 SWEDA_TMS2 3272
955mx53_loco MACH_MX53_LOCO MX53_LOCO 3273
956acer_a8 MACH_ACER_A8 ACER_A8 3275
957acer_gauguin MACH_ACER_GAUGUIN ACER_GAUGUIN 3276
958guppy MACH_GUPPY GUPPY 3277
959mx61_ard MACH_MX61_ARD MX61_ARD 3278
960tx53 MACH_TX53 TX53 3279
961omapl138_case_a3 MACH_OMAPL138_CASE_A3 OMAPL138_CASE_A3 3280
962uemd MACH_UEMD UEMD 3281
963ccwmx51mut MACH_CCWMX51MUT CCWMX51MUT 3282
964rockhopper MACH_ROCKHOPPER ROCKHOPPER 3283
965nookcolor MACH_NOOKCOLOR NOOKCOLOR 3284
966hkdkc100 MACH_HKDKC100 HKDKC100 3285
967ts42xx MACH_TS42XX TS42XX 3286
968aebl MACH_AEBL AEBL 3287
969wario MACH_WARIO WARIO 3288
970gfs_spm MACH_GFS_SPM GFS_SPM 3289
971cm_t3730 MACH_CM_T3730 CM_T3730 3290
972isc3 MACH_ISC3 ISC3 3291
973rascal MACH_RASCAL RASCAL 3292
974hrefv60 MACH_HREFV60 HREFV60 3293
975tpt_2_0 MACH_TPT_2_0 TPT_2_0 3294
976pyramid_td MACH_PYRAMID_TD PYRAMID_TD 3295
977splendor MACH_SPLENDOR SPLENDOR 3296
978guf_planet MACH_GUF_PLANET GUF_PLANET 3297
979msm8x60_qt MACH_MSM8X60_QT MSM8X60_QT 3298
980htc_hd_mini MACH_HTC_HD_MINI HTC_HD_MINI 3299
981athene MACH_ATHENE ATHENE 3300
982deep_r_ek_1 MACH_DEEP_R_EK_1 DEEP_R_EK_1 3301
983vivow_ct MACH_VIVOW_CT VIVOW_CT 3302
984nery_1000 MACH_NERY_1000 NERY_1000 3303
985rfl109145_ssrv MACH_RFL109145_SSRV RFL109145_SSRV 3304
986nmh MACH_NMH NMH 3305
987wn802t MACH_WN802T WN802T 3306
988dragonet MACH_DRAGONET DRAGONET 3307
989at91sam9263desk16l MACH_AT91SAM9263DESK16L AT91SAM9263DESK16L 3309
990bcmhana_sv MACH_BCMHANA_SV BCMHANA_SV 3310
991bcmhana_tablet MACH_BCMHANA_TABLET BCMHANA_TABLET 3311
992koi MACH_KOI KOI 3312
993ts4800 MACH_TS4800 TS4800 3313
994tqma9263 MACH_TQMA9263 TQMA9263 3314
995holiday MACH_HOLIDAY HOLIDAY 3315
996dma_6410 MACH_DMA6410 DMA6410 3316
997pcats_overlay MACH_PCATS_OVERLAY PCATS_OVERLAY 3317
998hwgw6410 MACH_HWGW6410 HWGW6410 3318
999shenzhou MACH_SHENZHOU SHENZHOU 3319
1000cwme9210 MACH_CWME9210 CWME9210 3320
1001cwme9210js MACH_CWME9210JS CWME9210JS 3321
1002pgs_v1 MACH_PGS_SITARA PGS_SITARA 3322
1003colibri_tegra2 MACH_COLIBRI_TEGRA2 COLIBRI_TEGRA2 3323
1004w21 MACH_W21 W21 3324
1005polysat1 MACH_POLYSAT1 POLYSAT1 3325
1006dataway MACH_DATAWAY DATAWAY 3326
1007cobral138 MACH_COBRAL138 COBRAL138 3327
1008roverpcs8 MACH_ROVERPCS8 ROVERPCS8 3328
1009marvelc MACH_MARVELC MARVELC 3329
1010navefihid MACH_NAVEFIHID NAVEFIHID 3330
1011dm365_cv100 MACH_DM365_CV100 DM365_CV100 3331
1012able MACH_ABLE ABLE 3332
1013legacy MACH_LEGACY LEGACY 3333
1014icong MACH_ICONG ICONG 3334
1015rover_g8 MACH_ROVER_G8 ROVER_G8 3335
1016t5388p MACH_T5388P T5388P 3336
1017dingo MACH_DINGO DINGO 3337
1018goflexhome MACH_GOFLEXHOME GOFLEXHOME 3338
1019lanreadyfn511 MACH_LANREADYFN511 LANREADYFN511 3340
1020omap3_baia MACH_OMAP3_BAIA OMAP3_BAIA 3341
1021omap3smartdisplay MACH_OMAP3SMARTDISPLAY OMAP3SMARTDISPLAY 3342
1022xilinx MACH_XILINX XILINX 3343
1023a2f MACH_A2F A2F 3344
1024sky25 MACH_SKY25 SKY25 3345
1025ccmx53 MACH_CCMX53 CCMX53 3346
1026ccmx53js MACH_CCMX53JS CCMX53JS 3347
1027ccwmx53 MACH_CCWMX53 CCWMX53 3348
1028ccwmx53js MACH_CCWMX53JS CCWMX53JS 3349
1029frisms MACH_FRISMS FRISMS 3350
1030msm7x27a_ffa MACH_MSM7X27A_FFA MSM7X27A_FFA 3351
1031msm7x27a_surf MACH_MSM7X27A_SURF MSM7X27A_SURF 3352
1032msm7x27a_rumi3 MACH_MSM7X27A_RUMI3 MSM7X27A_RUMI3 3353
1033dimmsam9g20 MACH_DIMMSAM9G20 DIMMSAM9G20 3354
1034dimm_imx28 MACH_DIMM_IMX28 DIMM_IMX28 3355
1035amk_a4 MACH_AMK_A4 AMK_A4 3356
1036gnet_sgme MACH_GNET_SGME GNET_SGME 3357
1037shooter_u MACH_SHOOTER_U SHOOTER_U 3358
1038vmx53 MACH_VMX53 VMX53 3359
1039rhino MACH_RHINO RHINO 3360
1040armlex4210 MACH_ARMLEX4210 ARMLEX4210 3361
1041swarcoextmodem MACH_SWARCOEXTMODEM SWARCOEXTMODEM 3362
1042snowball MACH_SNOWBALL SNOWBALL 3363
1043pcm049 MACH_PCM049 PCM049 3364
1044vigor MACH_VIGOR VIGOR 3365
1045oslo_amundsen MACH_OSLO_AMUNDSEN OSLO_AMUNDSEN 3366
1046gsl_diamond MACH_GSL_DIAMOND GSL_DIAMOND 3367
1047cv2201 MACH_CV2201 CV2201 3368
1048cv2202 MACH_CV2202 CV2202 3369
1049cv2203 MACH_CV2203 CV2203 3370
1050vit_ibox MACH_VIT_IBOX VIT_IBOX 3371
1051dm6441_esp MACH_DM6441_ESP DM6441_ESP 3372
1052at91sam9x5ek MACH_AT91SAM9X5EK AT91SAM9X5EK 3373
1053libra MACH_LIBRA LIBRA 3374
1054easycrrh MACH_EASYCRRH EASYCRRH 3375
1055tripel MACH_TRIPEL TRIPEL 3376
1056endian_mini MACH_ENDIAN_MINI ENDIAN_MINI 3377
1057xilinx_ep107 MACH_XILINX_EP107 XILINX_EP107 3378
1058nuri MACH_NURI NURI 3379
1059janus MACH_JANUS JANUS 3380
1060ddnas MACH_DDNAS DDNAS 3381
1061tag MACH_TAG TAG 3382
1062tagw MACH_TAGW TAGW 3383
1063nitrogen_vm_imx51 MACH_NITROGEN_VM_IMX51 NITROGEN_VM_IMX51 3384
1064viprinet MACH_VIPRINET VIPRINET 3385
1065bockw MACH_BOCKW BOCKW 3386
1066eva2000 MACH_EVA2000 EVA2000 3387
1067steelyard MACH_STEELYARD STEELYARD 3388
1068sdh001 MACH_MACH_SDH001 MACH_SDH001 3390
1069nsslsboard MACH_NSSLSBOARD NSSLSBOARD 3392
1070geneva_b5 MACH_GENEVA_B5 GENEVA_B5 3393
1071spear1340 MACH_SPEAR1340 SPEAR1340 3394
1072rexmas MACH_REXMAS REXMAS 3395
1073msm8960_cdp MACH_MSM8960_CDP MSM8960_CDP 3396
1074msm8960_mdp MACH_MSM8960_MDP MSM8960_MDP 3397
1075msm8960_fluid MACH_MSM8960_FLUID MSM8960_FLUID 3398
1076msm8960_apq MACH_MSM8960_APQ MSM8960_APQ 3399
1077helios_v2 MACH_HELIOS_V2 HELIOS_V2 3400
1078mif10p MACH_MIF10P MIF10P 3401
1079iam28 MACH_IAM28 IAM28 3402
1080picasso MACH_PICASSO PICASSO 3403
1081mr301a MACH_MR301A MR301A 3404
1082notle MACH_NOTLE NOTLE 3405
1083eelx2 MACH_EELX2 EELX2 3406
1084moon MACH_MOON MOON 3407
1085ruby MACH_RUBY RUBY 3408
1086goldengate MACH_GOLDENGATE GOLDENGATE 3409
1087ctbu_gen2 MACH_CTBU_GEN2 CTBU_GEN2 3410
1088kmp_am17_01 MACH_KMP_AM17_01 KMP_AM17_01 3411
1089wtplug MACH_WTPLUG WTPLUG 3412
1090mx27su2 MACH_MX27SU2 MX27SU2 3413
1091nb31 MACH_NB31 NB31 3414
1092hjsdu MACH_HJSDU HJSDU 3415
1093td3_rev1 MACH_TD3_REV1 TD3_REV1 3416
1094eag_ci4000 MACH_EAG_CI4000 EAG_CI4000 3417
1095net5big_nand_v2 MACH_NET5BIG_NAND_V2 NET5BIG_NAND_V2 3418
1096cpx2 MACH_CPX2 CPX2 3419
1097net2big_nand_v2 MACH_NET2BIG_NAND_V2 NET2BIG_NAND_V2 3420
1098ecuv5 MACH_ECUV5 ECUV5 3421
1099hsgx6d MACH_HSGX6D HSGX6D 3422
1100dawad7 MACH_DAWAD7 DAWAD7 3423
1101sam9repeater MACH_SAM9REPEATER SAM9REPEATER 3424
diff --git a/arch/arm/vfp/Makefile b/arch/arm/vfp/Makefile
index 39f6d8e1af73..6de73aab0195 100644
--- a/arch/arm/vfp/Makefile
+++ b/arch/arm/vfp/Makefile
@@ -4,8 +4,8 @@
4# Copyright (C) 2001 ARM Limited 4# Copyright (C) 2001 ARM Limited
5# 5#
6 6
7# EXTRA_CFLAGS := -DDEBUG 7# ccflags-y := -DDEBUG
8# EXTRA_AFLAGS := -DDEBUG 8# asflags-y := -DDEBUG
9 9
10KBUILD_AFLAGS :=$(KBUILD_AFLAGS:-msoft-float=-Wa,-mfpu=softvfp+vfp) 10KBUILD_AFLAGS :=$(KBUILD_AFLAGS:-msoft-float=-Wa,-mfpu=softvfp+vfp)
11LDFLAGS +=--no-warn-mismatch 11LDFLAGS +=--no-warn-mismatch
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 0797cb528b46..bbf3da012afd 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -153,7 +153,7 @@ static struct notifier_block vfp_notifier_block = {
153 * Raise a SIGFPE for the current process. 153 * Raise a SIGFPE for the current process.
154 * sicode describes the signal being raised. 154 * sicode describes the signal being raised.
155 */ 155 */
156void vfp_raise_sigfpe(unsigned int sicode, struct pt_regs *regs) 156static void vfp_raise_sigfpe(unsigned int sicode, struct pt_regs *regs)
157{ 157{
158 siginfo_t info; 158 siginfo_t info;
159 159
@@ -489,8 +489,11 @@ void vfp_flush_hwstate(struct thread_info *thread)
489 489
490/* 490/*
491 * VFP hardware can lose all context when a CPU goes offline. 491 * VFP hardware can lose all context when a CPU goes offline.
492 * Safely clear our held state when a CPU has been killed, and 492 * As we will be running in SMP mode with CPU hotplug, we will save the
493 * re-enable access to VFP when the CPU comes back online. 493 * hardware state at every thread switch. We clear our held state when
494 * a CPU has been killed, indicating that the VFP hardware doesn't contain
495 * a threads VFP state. When a CPU starts up, we re-enable access to the
496 * VFP hardware.
494 * 497 *
495 * Both CPU_DYING and CPU_STARTING are called on the CPU which 498 * Both CPU_DYING and CPU_STARTING are called on the CPU which
496 * is being offlined/onlined. 499 * is being offlined/onlined.